diff --git a/sdk/agricultureplatform/Azure.ResourceManager.AgriculturePlatform/Azure.ResourceManager.AgriculturePlatform.sln b/sdk/agricultureplatform/Azure.ResourceManager.AgriculturePlatform/Azure.ResourceManager.AgriculturePlatform.sln new file mode 100644 index 000000000000..6ab8d706f738 --- /dev/null +++ b/sdk/agricultureplatform/Azure.ResourceManager.AgriculturePlatform/Azure.ResourceManager.AgriculturePlatform.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.AgriculturePlatform.Samples", "samples\Azure.ResourceManager.AgriculturePlatform.Samples.csproj", "{7A2DFF15-5746-49F4-BD0F-C6C35337088A}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Azure.ResourceManager.AgriculturePlatform", "src\Azure.ResourceManager.AgriculturePlatform.csproj", "{28FF4005-4467-4E36-92E7-DEA27DEB1519}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Azure.ResourceManager.AgriculturePlatform.Tests", "tests\Azure.ResourceManager.AgriculturePlatform.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/agricultureplatform/Azure.ResourceManager.AgriculturePlatform/CHANGELOG.md b/sdk/agricultureplatform/Azure.ResourceManager.AgriculturePlatform/CHANGELOG.md new file mode 100644 index 000000000000..8b33f0fedccc --- /dev/null +++ b/sdk/agricultureplatform/Azure.ResourceManager.AgriculturePlatform/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/agricultureplatform/Azure.ResourceManager.AgriculturePlatform/Directory.Build.props b/sdk/agricultureplatform/Azure.ResourceManager.AgriculturePlatform/Directory.Build.props new file mode 100644 index 000000000000..63bd836ad44b --- /dev/null +++ b/sdk/agricultureplatform/Azure.ResourceManager.AgriculturePlatform/Directory.Build.props @@ -0,0 +1,6 @@ + + + + diff --git a/sdk/agricultureplatform/Azure.ResourceManager.AgriculturePlatform/README.md b/sdk/agricultureplatform/Azure.ResourceManager.AgriculturePlatform/README.md new file mode 100644 index 000000000000..32e0e8fbfd8c --- /dev/null +++ b/sdk/agricultureplatform/Azure.ResourceManager.AgriculturePlatform/README.md @@ -0,0 +1,80 @@ +# Microsoft Azure AgriculturePlatform 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 AgriculturePlatform management library for .NET with [NuGet](https://www.nuget.org/): + +```dotnetcli +dotnet add package Azure.ResourceManager.AgriculturePlatform --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/agricultureplatform/Azure.ResourceManager.AgriculturePlatform/api/Azure.ResourceManager.AgriculturePlatform.net8.0.cs b/sdk/agricultureplatform/Azure.ResourceManager.AgriculturePlatform/api/Azure.ResourceManager.AgriculturePlatform.net8.0.cs new file mode 100644 index 000000000000..260a330c9fd9 --- /dev/null +++ b/sdk/agricultureplatform/Azure.ResourceManager.AgriculturePlatform/api/Azure.ResourceManager.AgriculturePlatform.net8.0.cs @@ -0,0 +1,321 @@ +namespace Azure.ResourceManager.AgriculturePlatform +{ + public static partial class AgriculturePlatformExtensions + { + public static Azure.ResourceManager.AgriculturePlatform.AgriServiceResource GetAgriServiceResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.Response GetAgriServiceResource(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string agriServiceResourceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static System.Threading.Tasks.Task> GetAgriServiceResourceAsync(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string agriServiceResourceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.ResourceManager.AgriculturePlatform.AgriServiceResourceCollection GetAgriServiceResources(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource) { throw null; } + public static Azure.Pageable GetAgriServiceResources(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.AsyncPageable GetAgriServiceResourcesAsync(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class AgriServiceResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected AgriServiceResource() { } + public virtual Azure.ResourceManager.AgriculturePlatform.AgriServiceResourceData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public virtual Azure.Response AddTag(string key, string value, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> AddTagAsync(string key, string value, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string agriServiceResourceName) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response GetAvailableSolutions(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAvailableSolutionsAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response RemoveTag(string key, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> RemoveTagAsync(string key, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response SetTags(System.Collections.Generic.IDictionary tags, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> SetTagsAsync(System.Collections.Generic.IDictionary tags, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + Azure.ResourceManager.AgriculturePlatform.AgriServiceResourceData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AgriculturePlatform.AgriServiceResourceData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.AgriculturePlatform.Models.AgriServiceResourcePatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.AgriculturePlatform.Models.AgriServiceResourcePatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class AgriServiceResourceCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected AgriServiceResourceCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string agriServiceResourceName, Azure.ResourceManager.AgriculturePlatform.AgriServiceResourceData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string agriServiceResourceName, Azure.ResourceManager.AgriculturePlatform.AgriServiceResourceData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string agriServiceResourceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string agriServiceResourceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string agriServiceResourceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string agriServiceResourceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string agriServiceResourceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string agriServiceResourceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class AgriServiceResourceData : Azure.ResourceManager.Models.TrackedResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public AgriServiceResourceData(Azure.Core.AzureLocation location) { } + public Azure.ResourceManager.Models.ManagedServiceIdentity Identity { get { throw null; } set { } } + public Azure.ResourceManager.AgriculturePlatform.Models.AgriServiceResourceProperties Properties { get { throw null; } set { } } + public Azure.ResourceManager.AgriculturePlatform.Models.AgriculturePlatformSku Sku { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AgriculturePlatform.AgriServiceResourceData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AgriculturePlatform.AgriServiceResourceData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } +} +namespace Azure.ResourceManager.AgriculturePlatform.Mocking +{ + public partial class MockableAgriculturePlatformArmClient : Azure.ResourceManager.ArmResource + { + protected MockableAgriculturePlatformArmClient() { } + public virtual Azure.ResourceManager.AgriculturePlatform.AgriServiceResource GetAgriServiceResource(Azure.Core.ResourceIdentifier id) { throw null; } + } + public partial class MockableAgriculturePlatformResourceGroupResource : Azure.ResourceManager.ArmResource + { + protected MockableAgriculturePlatformResourceGroupResource() { } + public virtual Azure.Response GetAgriServiceResource(string agriServiceResourceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAgriServiceResourceAsync(string agriServiceResourceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.AgriculturePlatform.AgriServiceResourceCollection GetAgriServiceResources() { throw null; } + } + public partial class MockableAgriculturePlatformSubscriptionResource : Azure.ResourceManager.ArmResource + { + protected MockableAgriculturePlatformSubscriptionResource() { } + public virtual Azure.Pageable GetAgriServiceResources(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAgriServiceResourcesAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } +} +namespace Azure.ResourceManager.AgriculturePlatform.Models +{ + public partial class AgriculturePlatformSku : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public AgriculturePlatformSku(string name) { } + public int? Capacity { get { throw null; } set { } } + public string Family { get { throw null; } set { } } + public string Name { get { throw null; } set { } } + public string Size { get { throw null; } set { } } + public Azure.ResourceManager.AgriculturePlatform.Models.AgriculturePlatformSkuTier? Tier { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AgriculturePlatform.Models.AgriculturePlatformSku System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AgriculturePlatform.Models.AgriculturePlatformSku System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public enum AgriculturePlatformSkuTier + { + Free = 0, + Basic = 1, + Standard = 2, + Premium = 3, + } + public partial class AgriServiceConfig : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public AgriServiceConfig() { } + public string AppServiceResourceId { get { throw null; } } + public string CosmosDbResourceId { get { throw null; } } + public string InstanceUri { get { throw null; } } + public string KeyVaultResourceId { get { throw null; } } + public string RedisCacheResourceId { get { throw null; } } + public string StorageAccountResourceId { get { throw null; } } + public string Version { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AgriculturePlatform.Models.AgriServiceConfig System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AgriculturePlatform.Models.AgriServiceConfig System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class AgriServiceResourcePatch : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public AgriServiceResourcePatch() { } + public Azure.ResourceManager.Models.ManagedServiceIdentity Identity { get { throw null; } set { } } + public Azure.ResourceManager.AgriculturePlatform.Models.AgriServiceResourceUpdateProperties Properties { get { throw null; } set { } } + public Azure.ResourceManager.AgriculturePlatform.Models.AgriculturePlatformSku Sku { get { throw null; } set { } } + public System.Collections.Generic.IDictionary Tags { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AgriculturePlatform.Models.AgriServiceResourcePatch System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AgriculturePlatform.Models.AgriServiceResourcePatch System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class AgriServiceResourceProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public AgriServiceResourceProperties() { } + public Azure.ResourceManager.AgriculturePlatform.Models.AgriServiceConfig Config { get { throw null; } set { } } + public System.Collections.Generic.IList DataConnectorCredentials { get { throw null; } } + public System.Collections.Generic.IList InstalledSolutions { get { throw null; } } + public System.Collections.Generic.IReadOnlyList ManagedOnBehalfOfMoboBrokerResources { get { throw null; } } + public Azure.ResourceManager.AgriculturePlatform.Models.ProvisioningState? ProvisioningState { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AgriculturePlatform.Models.AgriServiceResourceProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AgriculturePlatform.Models.AgriServiceResourceProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class AgriServiceResourceUpdateProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public AgriServiceResourceUpdateProperties() { } + public Azure.ResourceManager.AgriculturePlatform.Models.AgriServiceConfig Config { get { throw null; } set { } } + public System.Collections.Generic.IList DataConnectorCredentials { get { throw null; } } + public System.Collections.Generic.IList InstalledSolutions { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AgriculturePlatform.Models.AgriServiceResourceUpdateProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AgriculturePlatform.Models.AgriServiceResourceUpdateProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public static partial class ArmAgriculturePlatformModelFactory + { + public static Azure.ResourceManager.AgriculturePlatform.Models.AgriServiceConfig AgriServiceConfig(string instanceUri = null, string version = null, string appServiceResourceId = null, string cosmosDbResourceId = null, string storageAccountResourceId = null, string keyVaultResourceId = null, string redisCacheResourceId = null) { throw null; } + public static Azure.ResourceManager.AgriculturePlatform.AgriServiceResourceData AgriServiceResourceData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), Azure.ResourceManager.AgriculturePlatform.Models.AgriServiceResourceProperties properties = null, Azure.ResourceManager.Models.ManagedServiceIdentity identity = null, Azure.ResourceManager.AgriculturePlatform.Models.AgriculturePlatformSku sku = null) { throw null; } + public static Azure.ResourceManager.AgriculturePlatform.Models.AgriServiceResourceProperties AgriServiceResourceProperties(Azure.ResourceManager.AgriculturePlatform.Models.ProvisioningState? provisioningState = default(Azure.ResourceManager.AgriculturePlatform.Models.ProvisioningState?), Azure.ResourceManager.AgriculturePlatform.Models.AgriServiceConfig config = null, System.Collections.Generic.IEnumerable managedOnBehalfOfMoboBrokerResources = null, System.Collections.Generic.IEnumerable dataConnectorCredentials = null, System.Collections.Generic.IEnumerable installedSolutions = null) { throw null; } + public static Azure.ResourceManager.AgriculturePlatform.Models.AvailableAgriSolutionListResult AvailableAgriSolutionListResult(System.Collections.Generic.IEnumerable solutions = null) { throw null; } + public static Azure.ResourceManager.AgriculturePlatform.Models.DataManagerForAgricultureSolution DataManagerForAgricultureSolution(string partnerId = null, string solutionId = null, string partnerTenantId = null, System.Collections.Generic.IEnumerable dataAccessScopes = null, Azure.ResourceManager.AgriculturePlatform.Models.MarketPlaceOfferDetails marketPlaceOfferDetails = null, string saasApplicationId = null, string accessAzureDataManagerForAgricultureApplicationId = null, string accessAzureDataManagerForAgricultureApplicationName = null, bool isValidateInput = false) { throw null; } + public static Azure.ResourceManager.AgriculturePlatform.Models.MarketPlaceOfferDetails MarketPlaceOfferDetails(string saasOfferId = null, string publisherId = null) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct AuthCredentialsKind : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public AuthCredentialsKind(string value) { throw null; } + public static Azure.ResourceManager.AgriculturePlatform.Models.AuthCredentialsKind ApiKeyAuthCredentials { get { throw null; } } + public static Azure.ResourceManager.AgriculturePlatform.Models.AuthCredentialsKind OAuthClientCredentials { get { throw null; } } + public bool Equals(Azure.ResourceManager.AgriculturePlatform.Models.AuthCredentialsKind other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.AgriculturePlatform.Models.AuthCredentialsKind left, Azure.ResourceManager.AgriculturePlatform.Models.AuthCredentialsKind right) { throw null; } + public static implicit operator Azure.ResourceManager.AgriculturePlatform.Models.AuthCredentialsKind (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.AgriculturePlatform.Models.AuthCredentialsKind left, Azure.ResourceManager.AgriculturePlatform.Models.AuthCredentialsKind right) { throw null; } + public override string ToString() { throw null; } + } + public partial class AvailableAgriSolutionListResult : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal AvailableAgriSolutionListResult() { } + public System.Collections.Generic.IReadOnlyList Solutions { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AgriculturePlatform.Models.AvailableAgriSolutionListResult System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AgriculturePlatform.Models.AvailableAgriSolutionListResult System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DataConnectorCredentialMap : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DataConnectorCredentialMap(string key, Azure.ResourceManager.AgriculturePlatform.Models.DataConnectorCredentials value) { } + public string Key { get { throw null; } set { } } + public Azure.ResourceManager.AgriculturePlatform.Models.DataConnectorCredentials Value { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AgriculturePlatform.Models.DataConnectorCredentialMap System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AgriculturePlatform.Models.DataConnectorCredentialMap System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DataConnectorCredentials : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DataConnectorCredentials() { } + public string ClientId { get { throw null; } set { } } + public string KeyName { get { throw null; } set { } } + public string KeyVaultUri { get { throw null; } set { } } + public string KeyVersion { get { throw null; } set { } } + public Azure.ResourceManager.AgriculturePlatform.Models.AuthCredentialsKind? Kind { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AgriculturePlatform.Models.DataConnectorCredentials System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AgriculturePlatform.Models.DataConnectorCredentials System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DataManagerForAgricultureSolution : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal DataManagerForAgricultureSolution() { } + public string AccessAzureDataManagerForAgricultureApplicationId { get { throw null; } } + public string AccessAzureDataManagerForAgricultureApplicationName { get { throw null; } } + public System.Collections.Generic.IReadOnlyList DataAccessScopes { get { throw null; } } + public bool IsValidateInput { get { throw null; } } + public Azure.ResourceManager.AgriculturePlatform.Models.MarketPlaceOfferDetails MarketPlaceOfferDetails { get { throw null; } } + public string PartnerId { get { throw null; } } + public string PartnerTenantId { get { throw null; } } + public string SaasApplicationId { get { throw null; } } + public string SolutionId { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AgriculturePlatform.Models.DataManagerForAgricultureSolution System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AgriculturePlatform.Models.DataManagerForAgricultureSolution System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class InstalledSolutionMap : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public InstalledSolutionMap(string key, Azure.ResourceManager.AgriculturePlatform.Models.Solution value) { } + public string Key { get { throw null; } set { } } + public Azure.ResourceManager.AgriculturePlatform.Models.Solution Value { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AgriculturePlatform.Models.InstalledSolutionMap System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AgriculturePlatform.Models.InstalledSolutionMap System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class MarketPlaceOfferDetails : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal MarketPlaceOfferDetails() { } + public string PublisherId { get { throw null; } } + public string SaasOfferId { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AgriculturePlatform.Models.MarketPlaceOfferDetails System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AgriculturePlatform.Models.MarketPlaceOfferDetails System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct ProvisioningState : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public ProvisioningState(string value) { throw null; } + public static Azure.ResourceManager.AgriculturePlatform.Models.ProvisioningState Accepted { get { throw null; } } + public static Azure.ResourceManager.AgriculturePlatform.Models.ProvisioningState Canceled { get { throw null; } } + public static Azure.ResourceManager.AgriculturePlatform.Models.ProvisioningState Deleting { get { throw null; } } + public static Azure.ResourceManager.AgriculturePlatform.Models.ProvisioningState Failed { get { throw null; } } + public static Azure.ResourceManager.AgriculturePlatform.Models.ProvisioningState Provisioning { get { throw null; } } + public static Azure.ResourceManager.AgriculturePlatform.Models.ProvisioningState Succeeded { get { throw null; } } + public static Azure.ResourceManager.AgriculturePlatform.Models.ProvisioningState Updating { get { throw null; } } + public bool Equals(Azure.ResourceManager.AgriculturePlatform.Models.ProvisioningState other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.AgriculturePlatform.Models.ProvisioningState left, Azure.ResourceManager.AgriculturePlatform.Models.ProvisioningState right) { throw null; } + public static implicit operator Azure.ResourceManager.AgriculturePlatform.Models.ProvisioningState (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.AgriculturePlatform.Models.ProvisioningState left, Azure.ResourceManager.AgriculturePlatform.Models.ProvisioningState right) { throw null; } + public override string ToString() { throw null; } + } + public partial class Solution : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public Solution() { } + public string ApplicationName { get { throw null; } set { } } + public string MarketPlacePublisherId { get { throw null; } set { } } + public string PartnerId { get { throw null; } set { } } + public string PlanId { get { throw null; } set { } } + public string SaasSubscriptionId { get { throw null; } set { } } + public string SaasSubscriptionName { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AgriculturePlatform.Models.Solution System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AgriculturePlatform.Models.Solution System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } +} diff --git a/sdk/agricultureplatform/Azure.ResourceManager.AgriculturePlatform/api/Azure.ResourceManager.AgriculturePlatform.netstandard2.0.cs b/sdk/agricultureplatform/Azure.ResourceManager.AgriculturePlatform/api/Azure.ResourceManager.AgriculturePlatform.netstandard2.0.cs new file mode 100644 index 000000000000..260a330c9fd9 --- /dev/null +++ b/sdk/agricultureplatform/Azure.ResourceManager.AgriculturePlatform/api/Azure.ResourceManager.AgriculturePlatform.netstandard2.0.cs @@ -0,0 +1,321 @@ +namespace Azure.ResourceManager.AgriculturePlatform +{ + public static partial class AgriculturePlatformExtensions + { + public static Azure.ResourceManager.AgriculturePlatform.AgriServiceResource GetAgriServiceResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.Response GetAgriServiceResource(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string agriServiceResourceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static System.Threading.Tasks.Task> GetAgriServiceResourceAsync(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string agriServiceResourceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.ResourceManager.AgriculturePlatform.AgriServiceResourceCollection GetAgriServiceResources(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource) { throw null; } + public static Azure.Pageable GetAgriServiceResources(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.AsyncPageable GetAgriServiceResourcesAsync(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class AgriServiceResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected AgriServiceResource() { } + public virtual Azure.ResourceManager.AgriculturePlatform.AgriServiceResourceData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public virtual Azure.Response AddTag(string key, string value, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> AddTagAsync(string key, string value, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string agriServiceResourceName) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response GetAvailableSolutions(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAvailableSolutionsAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response RemoveTag(string key, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> RemoveTagAsync(string key, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response SetTags(System.Collections.Generic.IDictionary tags, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> SetTagsAsync(System.Collections.Generic.IDictionary tags, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + Azure.ResourceManager.AgriculturePlatform.AgriServiceResourceData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AgriculturePlatform.AgriServiceResourceData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.AgriculturePlatform.Models.AgriServiceResourcePatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.AgriculturePlatform.Models.AgriServiceResourcePatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class AgriServiceResourceCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected AgriServiceResourceCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string agriServiceResourceName, Azure.ResourceManager.AgriculturePlatform.AgriServiceResourceData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string agriServiceResourceName, Azure.ResourceManager.AgriculturePlatform.AgriServiceResourceData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string agriServiceResourceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string agriServiceResourceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string agriServiceResourceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string agriServiceResourceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string agriServiceResourceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string agriServiceResourceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class AgriServiceResourceData : Azure.ResourceManager.Models.TrackedResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public AgriServiceResourceData(Azure.Core.AzureLocation location) { } + public Azure.ResourceManager.Models.ManagedServiceIdentity Identity { get { throw null; } set { } } + public Azure.ResourceManager.AgriculturePlatform.Models.AgriServiceResourceProperties Properties { get { throw null; } set { } } + public Azure.ResourceManager.AgriculturePlatform.Models.AgriculturePlatformSku Sku { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AgriculturePlatform.AgriServiceResourceData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AgriculturePlatform.AgriServiceResourceData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } +} +namespace Azure.ResourceManager.AgriculturePlatform.Mocking +{ + public partial class MockableAgriculturePlatformArmClient : Azure.ResourceManager.ArmResource + { + protected MockableAgriculturePlatformArmClient() { } + public virtual Azure.ResourceManager.AgriculturePlatform.AgriServiceResource GetAgriServiceResource(Azure.Core.ResourceIdentifier id) { throw null; } + } + public partial class MockableAgriculturePlatformResourceGroupResource : Azure.ResourceManager.ArmResource + { + protected MockableAgriculturePlatformResourceGroupResource() { } + public virtual Azure.Response GetAgriServiceResource(string agriServiceResourceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAgriServiceResourceAsync(string agriServiceResourceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.AgriculturePlatform.AgriServiceResourceCollection GetAgriServiceResources() { throw null; } + } + public partial class MockableAgriculturePlatformSubscriptionResource : Azure.ResourceManager.ArmResource + { + protected MockableAgriculturePlatformSubscriptionResource() { } + public virtual Azure.Pageable GetAgriServiceResources(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAgriServiceResourcesAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } +} +namespace Azure.ResourceManager.AgriculturePlatform.Models +{ + public partial class AgriculturePlatformSku : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public AgriculturePlatformSku(string name) { } + public int? Capacity { get { throw null; } set { } } + public string Family { get { throw null; } set { } } + public string Name { get { throw null; } set { } } + public string Size { get { throw null; } set { } } + public Azure.ResourceManager.AgriculturePlatform.Models.AgriculturePlatformSkuTier? Tier { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AgriculturePlatform.Models.AgriculturePlatformSku System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AgriculturePlatform.Models.AgriculturePlatformSku System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public enum AgriculturePlatformSkuTier + { + Free = 0, + Basic = 1, + Standard = 2, + Premium = 3, + } + public partial class AgriServiceConfig : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public AgriServiceConfig() { } + public string AppServiceResourceId { get { throw null; } } + public string CosmosDbResourceId { get { throw null; } } + public string InstanceUri { get { throw null; } } + public string KeyVaultResourceId { get { throw null; } } + public string RedisCacheResourceId { get { throw null; } } + public string StorageAccountResourceId { get { throw null; } } + public string Version { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AgriculturePlatform.Models.AgriServiceConfig System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AgriculturePlatform.Models.AgriServiceConfig System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class AgriServiceResourcePatch : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public AgriServiceResourcePatch() { } + public Azure.ResourceManager.Models.ManagedServiceIdentity Identity { get { throw null; } set { } } + public Azure.ResourceManager.AgriculturePlatform.Models.AgriServiceResourceUpdateProperties Properties { get { throw null; } set { } } + public Azure.ResourceManager.AgriculturePlatform.Models.AgriculturePlatformSku Sku { get { throw null; } set { } } + public System.Collections.Generic.IDictionary Tags { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AgriculturePlatform.Models.AgriServiceResourcePatch System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AgriculturePlatform.Models.AgriServiceResourcePatch System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class AgriServiceResourceProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public AgriServiceResourceProperties() { } + public Azure.ResourceManager.AgriculturePlatform.Models.AgriServiceConfig Config { get { throw null; } set { } } + public System.Collections.Generic.IList DataConnectorCredentials { get { throw null; } } + public System.Collections.Generic.IList InstalledSolutions { get { throw null; } } + public System.Collections.Generic.IReadOnlyList ManagedOnBehalfOfMoboBrokerResources { get { throw null; } } + public Azure.ResourceManager.AgriculturePlatform.Models.ProvisioningState? ProvisioningState { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AgriculturePlatform.Models.AgriServiceResourceProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AgriculturePlatform.Models.AgriServiceResourceProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class AgriServiceResourceUpdateProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public AgriServiceResourceUpdateProperties() { } + public Azure.ResourceManager.AgriculturePlatform.Models.AgriServiceConfig Config { get { throw null; } set { } } + public System.Collections.Generic.IList DataConnectorCredentials { get { throw null; } } + public System.Collections.Generic.IList InstalledSolutions { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AgriculturePlatform.Models.AgriServiceResourceUpdateProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AgriculturePlatform.Models.AgriServiceResourceUpdateProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public static partial class ArmAgriculturePlatformModelFactory + { + public static Azure.ResourceManager.AgriculturePlatform.Models.AgriServiceConfig AgriServiceConfig(string instanceUri = null, string version = null, string appServiceResourceId = null, string cosmosDbResourceId = null, string storageAccountResourceId = null, string keyVaultResourceId = null, string redisCacheResourceId = null) { throw null; } + public static Azure.ResourceManager.AgriculturePlatform.AgriServiceResourceData AgriServiceResourceData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), Azure.ResourceManager.AgriculturePlatform.Models.AgriServiceResourceProperties properties = null, Azure.ResourceManager.Models.ManagedServiceIdentity identity = null, Azure.ResourceManager.AgriculturePlatform.Models.AgriculturePlatformSku sku = null) { throw null; } + public static Azure.ResourceManager.AgriculturePlatform.Models.AgriServiceResourceProperties AgriServiceResourceProperties(Azure.ResourceManager.AgriculturePlatform.Models.ProvisioningState? provisioningState = default(Azure.ResourceManager.AgriculturePlatform.Models.ProvisioningState?), Azure.ResourceManager.AgriculturePlatform.Models.AgriServiceConfig config = null, System.Collections.Generic.IEnumerable managedOnBehalfOfMoboBrokerResources = null, System.Collections.Generic.IEnumerable dataConnectorCredentials = null, System.Collections.Generic.IEnumerable installedSolutions = null) { throw null; } + public static Azure.ResourceManager.AgriculturePlatform.Models.AvailableAgriSolutionListResult AvailableAgriSolutionListResult(System.Collections.Generic.IEnumerable solutions = null) { throw null; } + public static Azure.ResourceManager.AgriculturePlatform.Models.DataManagerForAgricultureSolution DataManagerForAgricultureSolution(string partnerId = null, string solutionId = null, string partnerTenantId = null, System.Collections.Generic.IEnumerable dataAccessScopes = null, Azure.ResourceManager.AgriculturePlatform.Models.MarketPlaceOfferDetails marketPlaceOfferDetails = null, string saasApplicationId = null, string accessAzureDataManagerForAgricultureApplicationId = null, string accessAzureDataManagerForAgricultureApplicationName = null, bool isValidateInput = false) { throw null; } + public static Azure.ResourceManager.AgriculturePlatform.Models.MarketPlaceOfferDetails MarketPlaceOfferDetails(string saasOfferId = null, string publisherId = null) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct AuthCredentialsKind : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public AuthCredentialsKind(string value) { throw null; } + public static Azure.ResourceManager.AgriculturePlatform.Models.AuthCredentialsKind ApiKeyAuthCredentials { get { throw null; } } + public static Azure.ResourceManager.AgriculturePlatform.Models.AuthCredentialsKind OAuthClientCredentials { get { throw null; } } + public bool Equals(Azure.ResourceManager.AgriculturePlatform.Models.AuthCredentialsKind other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.AgriculturePlatform.Models.AuthCredentialsKind left, Azure.ResourceManager.AgriculturePlatform.Models.AuthCredentialsKind right) { throw null; } + public static implicit operator Azure.ResourceManager.AgriculturePlatform.Models.AuthCredentialsKind (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.AgriculturePlatform.Models.AuthCredentialsKind left, Azure.ResourceManager.AgriculturePlatform.Models.AuthCredentialsKind right) { throw null; } + public override string ToString() { throw null; } + } + public partial class AvailableAgriSolutionListResult : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal AvailableAgriSolutionListResult() { } + public System.Collections.Generic.IReadOnlyList Solutions { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AgriculturePlatform.Models.AvailableAgriSolutionListResult System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AgriculturePlatform.Models.AvailableAgriSolutionListResult System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DataConnectorCredentialMap : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DataConnectorCredentialMap(string key, Azure.ResourceManager.AgriculturePlatform.Models.DataConnectorCredentials value) { } + public string Key { get { throw null; } set { } } + public Azure.ResourceManager.AgriculturePlatform.Models.DataConnectorCredentials Value { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AgriculturePlatform.Models.DataConnectorCredentialMap System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AgriculturePlatform.Models.DataConnectorCredentialMap System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DataConnectorCredentials : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DataConnectorCredentials() { } + public string ClientId { get { throw null; } set { } } + public string KeyName { get { throw null; } set { } } + public string KeyVaultUri { get { throw null; } set { } } + public string KeyVersion { get { throw null; } set { } } + public Azure.ResourceManager.AgriculturePlatform.Models.AuthCredentialsKind? Kind { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AgriculturePlatform.Models.DataConnectorCredentials System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AgriculturePlatform.Models.DataConnectorCredentials System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DataManagerForAgricultureSolution : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal DataManagerForAgricultureSolution() { } + public string AccessAzureDataManagerForAgricultureApplicationId { get { throw null; } } + public string AccessAzureDataManagerForAgricultureApplicationName { get { throw null; } } + public System.Collections.Generic.IReadOnlyList DataAccessScopes { get { throw null; } } + public bool IsValidateInput { get { throw null; } } + public Azure.ResourceManager.AgriculturePlatform.Models.MarketPlaceOfferDetails MarketPlaceOfferDetails { get { throw null; } } + public string PartnerId { get { throw null; } } + public string PartnerTenantId { get { throw null; } } + public string SaasApplicationId { get { throw null; } } + public string SolutionId { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AgriculturePlatform.Models.DataManagerForAgricultureSolution System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AgriculturePlatform.Models.DataManagerForAgricultureSolution System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class InstalledSolutionMap : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public InstalledSolutionMap(string key, Azure.ResourceManager.AgriculturePlatform.Models.Solution value) { } + public string Key { get { throw null; } set { } } + public Azure.ResourceManager.AgriculturePlatform.Models.Solution Value { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AgriculturePlatform.Models.InstalledSolutionMap System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AgriculturePlatform.Models.InstalledSolutionMap System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class MarketPlaceOfferDetails : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal MarketPlaceOfferDetails() { } + public string PublisherId { get { throw null; } } + public string SaasOfferId { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AgriculturePlatform.Models.MarketPlaceOfferDetails System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AgriculturePlatform.Models.MarketPlaceOfferDetails System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct ProvisioningState : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public ProvisioningState(string value) { throw null; } + public static Azure.ResourceManager.AgriculturePlatform.Models.ProvisioningState Accepted { get { throw null; } } + public static Azure.ResourceManager.AgriculturePlatform.Models.ProvisioningState Canceled { get { throw null; } } + public static Azure.ResourceManager.AgriculturePlatform.Models.ProvisioningState Deleting { get { throw null; } } + public static Azure.ResourceManager.AgriculturePlatform.Models.ProvisioningState Failed { get { throw null; } } + public static Azure.ResourceManager.AgriculturePlatform.Models.ProvisioningState Provisioning { get { throw null; } } + public static Azure.ResourceManager.AgriculturePlatform.Models.ProvisioningState Succeeded { get { throw null; } } + public static Azure.ResourceManager.AgriculturePlatform.Models.ProvisioningState Updating { get { throw null; } } + public bool Equals(Azure.ResourceManager.AgriculturePlatform.Models.ProvisioningState other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.AgriculturePlatform.Models.ProvisioningState left, Azure.ResourceManager.AgriculturePlatform.Models.ProvisioningState right) { throw null; } + public static implicit operator Azure.ResourceManager.AgriculturePlatform.Models.ProvisioningState (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.AgriculturePlatform.Models.ProvisioningState left, Azure.ResourceManager.AgriculturePlatform.Models.ProvisioningState right) { throw null; } + public override string ToString() { throw null; } + } + public partial class Solution : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public Solution() { } + public string ApplicationName { get { throw null; } set { } } + public string MarketPlacePublisherId { get { throw null; } set { } } + public string PartnerId { get { throw null; } set { } } + public string PlanId { get { throw null; } set { } } + public string SaasSubscriptionId { get { throw null; } set { } } + public string SaasSubscriptionName { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AgriculturePlatform.Models.Solution System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AgriculturePlatform.Models.Solution System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } +} diff --git a/sdk/agricultureplatform/Azure.ResourceManager.AgriculturePlatform/assets.json b/sdk/agricultureplatform/Azure.ResourceManager.AgriculturePlatform/assets.json new file mode 100644 index 000000000000..86863301e28a --- /dev/null +++ b/sdk/agricultureplatform/Azure.ResourceManager.AgriculturePlatform/assets.json @@ -0,0 +1,7 @@ + +{ + "AssetsRepo": "Azure/azure-sdk-assets", + "AssetsRepoPrefixPath": "net", + "TagPrefix": "net/agricultureplatform/Azure.ResourceManager.AgriculturePlatform", + "Tag": "" +} diff --git a/sdk/agricultureplatform/Azure.ResourceManager.AgriculturePlatform/samples/Azure.ResourceManager.AgriculturePlatform.Samples.csproj b/sdk/agricultureplatform/Azure.ResourceManager.AgriculturePlatform/samples/Azure.ResourceManager.AgriculturePlatform.Samples.csproj new file mode 100644 index 000000000000..7142d3cd9660 --- /dev/null +++ b/sdk/agricultureplatform/Azure.ResourceManager.AgriculturePlatform/samples/Azure.ResourceManager.AgriculturePlatform.Samples.csproj @@ -0,0 +1,13 @@ + + + + + + + + + + + + + diff --git a/sdk/agricultureplatform/Azure.ResourceManager.AgriculturePlatform/samples/Generated/Samples/Sample_AgriServiceResource.cs b/sdk/agricultureplatform/Azure.ResourceManager.AgriculturePlatform/samples/Generated/Samples/Sample_AgriServiceResource.cs new file mode 100644 index 000000000000..2d941722fee5 --- /dev/null +++ b/sdk/agricultureplatform/Azure.ResourceManager.AgriculturePlatform/samples/Generated/Samples/Sample_AgriServiceResource.cs @@ -0,0 +1,166 @@ +// 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.AgriculturePlatform.Models; +using Azure.ResourceManager.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.AgriculturePlatform.Samples +{ + public partial class Sample_AgriServiceResource + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_AgriServiceGet() + { + // Generated from example definition: 2024-06-01-preview/AgriService_Get_MaximumSet_Gen.json + // this example is just showing the usage of "AgriServiceResource_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 AgriServiceResource created on azure + // for more information of creating AgriServiceResource, please refer to the document of AgriServiceResource + string subscriptionId = "83D293F5-DEFD-4D48-B120-1DC713BE338A"; + string resourceGroupName = "rgopenapi"; + string agriServiceResourceName = "abc123"; + ResourceIdentifier agriServiceResourceId = AgriServiceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, agriServiceResourceName); + AgriServiceResource agriServiceResource = client.GetAgriServiceResource(agriServiceResourceId); + + // invoke the operation + AgriServiceResource result = await agriServiceResource.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 + AgriServiceResourceData 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_AgriServiceDelete() + { + // Generated from example definition: 2024-06-01-preview/AgriService_Delete_MaximumSet_Gen.json + // this example is just showing the usage of "AgriServiceResource_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 AgriServiceResource created on azure + // for more information of creating AgriServiceResource, please refer to the document of AgriServiceResource + string subscriptionId = "83D293F5-DEFD-4D48-B120-1DC713BE338A"; + string resourceGroupName = "rgopenapi"; + string agriServiceResourceName = "abc123"; + ResourceIdentifier agriServiceResourceId = AgriServiceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, agriServiceResourceName); + AgriServiceResource agriServiceResource = client.GetAgriServiceResource(agriServiceResourceId); + + // invoke the operation + await agriServiceResource.DeleteAsync(WaitUntil.Completed); + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Update_AgriServiceUpdate() + { + // Generated from example definition: 2024-06-01-preview/AgriService_Update_MaximumSet_Gen.json + // this example is just showing the usage of "AgriServiceResource_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 AgriServiceResource created on azure + // for more information of creating AgriServiceResource, please refer to the document of AgriServiceResource + string subscriptionId = "83D293F5-DEFD-4D48-B120-1DC713BE338A"; + string resourceGroupName = "rgopenapi"; + string agriServiceResourceName = "abc123"; + ResourceIdentifier agriServiceResourceId = AgriServiceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, agriServiceResourceName); + AgriServiceResource agriServiceResource = client.GetAgriServiceResource(agriServiceResourceId); + + // invoke the operation + AgriServiceResourcePatch patch = new AgriServiceResourcePatch + { + Identity = new ManagedServiceIdentity("None") + { + UserAssignedIdentities = +{ +[new ResourceIdentifier("key4771")] = new UserAssignedIdentity() +}, + }, + Sku = new AgriculturePlatformSku("tbdtdfffkar") + { + Tier = AgriculturePlatformSkuTier.Free, + Size = "iusaqqj", + Family = "hxojswlgs", + Capacity = 22, + }, + Tags = +{ +["key9006"] = "kuzlwpujbql" +}, + Properties = new AgriServiceResourceUpdateProperties + { + Config = new AgriServiceConfig(), + DataConnectorCredentials = {new DataConnectorCredentialMap("BackendAADApplicationCredentials", new DataConnectorCredentials +{ +ClientId = "dce298a8-1eec-481a-a8f9-a3cd5a8257b2", +})}, + InstalledSolutions = {new InstalledSolutionMap("bayerAgPowered.cwum", new Solution +{ +ApplicationName = "bayerAgPowered.cwum", +})}, + }, + }; + ArmOperation lro = await agriServiceResource.UpdateAsync(WaitUntil.Completed, patch); + AgriServiceResource 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 + AgriServiceResourceData 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 GetAvailableSolutions_AgriServiceListAvailableSolutions() + { + // Generated from example definition: 2024-06-01-preview/AgriService_ListAvailableSolutions_MaximumSet_Gen.json + // this example is just showing the usage of "AgriService_ListAvailableSolutions" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details 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 AgriServiceResource created on azure + // for more information of creating AgriServiceResource, please refer to the document of AgriServiceResource + string subscriptionId = "83D293F5-DEFD-4D48-B120-1DC713BE338A"; + string resourceGroupName = "rgopenapi"; + string agriServiceResourceName = "abc123"; + ResourceIdentifier agriServiceResourceId = AgriServiceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, agriServiceResourceName); + AgriServiceResource agriServiceResource = client.GetAgriServiceResource(agriServiceResourceId); + + // invoke the operation + AvailableAgriSolutionListResult result = await agriServiceResource.GetAvailableSolutionsAsync(); + + Console.WriteLine($"Succeeded: {result}"); + } + } +} diff --git a/sdk/agricultureplatform/Azure.ResourceManager.AgriculturePlatform/samples/Generated/Samples/Sample_AgriServiceResourceCollection.cs b/sdk/agricultureplatform/Azure.ResourceManager.AgriculturePlatform/samples/Generated/Samples/Sample_AgriServiceResourceCollection.cs new file mode 100644 index 000000000000..a5e4402a6fc6 --- /dev/null +++ b/sdk/agricultureplatform/Azure.ResourceManager.AgriculturePlatform/samples/Generated/Samples/Sample_AgriServiceResourceCollection.cs @@ -0,0 +1,226 @@ +// 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.AgriculturePlatform.Models; +using Azure.ResourceManager.Models; +using Azure.ResourceManager.Resources; +using NUnit.Framework; + +namespace Azure.ResourceManager.AgriculturePlatform.Samples +{ + public partial class Sample_AgriServiceResourceCollection + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task CreateOrUpdate_AgriServiceCreateOrUpdate() + { + // Generated from example definition: 2024-06-01-preview/AgriService_CreateOrUpdate_MaximumSet_Gen.json + // this example is just showing the usage of "AgriServiceResource_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "83D293F5-DEFD-4D48-B120-1DC713BE338A"; + string resourceGroupName = "rgopenapi"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this AgriServiceResource + AgriServiceResourceCollection collection = resourceGroupResource.GetAgriServiceResources(); + + // invoke the operation + string agriServiceResourceName = "abc123"; + AgriServiceResourceData data = new AgriServiceResourceData(new AzureLocation("pkneuknooprpqirnugzwbkiie")) + { + Properties = new AgriServiceResourceProperties + { + Config = new AgriServiceConfig(), + DataConnectorCredentials = {new DataConnectorCredentialMap("BackendAADApplicationCredentials", new DataConnectorCredentials +{ +ClientId = "dce298a8-1eec-481a-a8f9-a3cd5a8257b2", +})}, + InstalledSolutions = {new InstalledSolutionMap("bayerAgPowered.cwum", new Solution +{ +ApplicationName = "bayerAgPowered.cwum", +})}, + }, + Identity = new ManagedServiceIdentity("None") + { + UserAssignedIdentities = +{ +[new ResourceIdentifier("key4955")] = new UserAssignedIdentity() +}, + }, + Sku = new AgriculturePlatformSku("kfl") + { + Tier = AgriculturePlatformSkuTier.Free, + Size = "r", + Family = "xerdhxyjwrypvxphavgrtjphtohf", + Capacity = 20, + }, + Tags = +{ +["key137"] = "oxwansfetzzgdwl" +}, + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, agriServiceResourceName, data); + AgriServiceResource 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 + AgriServiceResourceData 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_AgriServiceGet() + { + // Generated from example definition: 2024-06-01-preview/AgriService_Get_MaximumSet_Gen.json + // this example is just showing the usage of "AgriServiceResource_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 = "83D293F5-DEFD-4D48-B120-1DC713BE338A"; + string resourceGroupName = "rgopenapi"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this AgriServiceResource + AgriServiceResourceCollection collection = resourceGroupResource.GetAgriServiceResources(); + + // invoke the operation + string agriServiceResourceName = "abc123"; + AgriServiceResource result = await collection.GetAsync(agriServiceResourceName); + + // 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 + AgriServiceResourceData 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_AgriServiceListByResourceGroup() + { + // Generated from example definition: 2024-06-01-preview/AgriService_ListByResourceGroup_MaximumSet_Gen.json + // this example is just showing the usage of "AgriServiceResource_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 = "83D293F5-DEFD-4D48-B120-1DC713BE338A"; + string resourceGroupName = "rgopenapi"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this AgriServiceResource + AgriServiceResourceCollection collection = resourceGroupResource.GetAgriServiceResources(); + + // invoke the operation and iterate over the result + await foreach (AgriServiceResource 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 + AgriServiceResourceData 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_AgriServiceGet() + { + // Generated from example definition: 2024-06-01-preview/AgriService_Get_MaximumSet_Gen.json + // this example is just showing the usage of "AgriServiceResource_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 = "83D293F5-DEFD-4D48-B120-1DC713BE338A"; + string resourceGroupName = "rgopenapi"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this AgriServiceResource + AgriServiceResourceCollection collection = resourceGroupResource.GetAgriServiceResources(); + + // invoke the operation + string agriServiceResourceName = "abc123"; + bool result = await collection.ExistsAsync(agriServiceResourceName); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetIfExists_AgriServiceGet() + { + // Generated from example definition: 2024-06-01-preview/AgriService_Get_MaximumSet_Gen.json + // this example is just showing the usage of "AgriServiceResource_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 = "83D293F5-DEFD-4D48-B120-1DC713BE338A"; + string resourceGroupName = "rgopenapi"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this AgriServiceResource + AgriServiceResourceCollection collection = resourceGroupResource.GetAgriServiceResources(); + + // invoke the operation + string agriServiceResourceName = "abc123"; + NullableResponse response = await collection.GetIfExistsAsync(agriServiceResourceName); + AgriServiceResource 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 + AgriServiceResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + } +} diff --git a/sdk/agricultureplatform/Azure.ResourceManager.AgriculturePlatform/samples/Generated/Samples/Sample_SubscriptionResourceExtensions.cs b/sdk/agricultureplatform/Azure.ResourceManager.AgriculturePlatform/samples/Generated/Samples/Sample_SubscriptionResourceExtensions.cs new file mode 100644 index 000000000000..8d080e7ae6c5 --- /dev/null +++ b/sdk/agricultureplatform/Azure.ResourceManager.AgriculturePlatform/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.AgriculturePlatform.Samples +{ + public partial class Sample_SubscriptionResourceExtensions + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetAgriServiceResources_AgriServiceListBySubscription() + { + // Generated from example definition: 2024-06-01-preview/AgriService_ListBySubscription_MaximumSet_Gen.json + // this example is just showing the usage of "AgriServiceResource_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 = "83D293F5-DEFD-4D48-B120-1DC713BE338A"; + ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(subscriptionId); + SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId); + + // invoke the operation and iterate over the result + await foreach (AgriServiceResource item in subscriptionResource.GetAgriServiceResourcesAsync()) + { + // 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 + AgriServiceResourceData 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/agricultureplatform/Azure.ResourceManager.AgriculturePlatform/src/Azure.ResourceManager.AgriculturePlatform.csproj b/sdk/agricultureplatform/Azure.ResourceManager.AgriculturePlatform/src/Azure.ResourceManager.AgriculturePlatform.csproj new file mode 100644 index 000000000000..d8d4e6fdf5ce --- /dev/null +++ b/sdk/agricultureplatform/Azure.ResourceManager.AgriculturePlatform/src/Azure.ResourceManager.AgriculturePlatform.csproj @@ -0,0 +1,8 @@ + + + Azure Resource Manager client SDK for Azure resource provider AgriculturePlatform. + 1.0.0-beta.1 + azure;management;arm;resource manager;agricultureplatform + Azure.ResourceManager.AgriculturePlatform + + diff --git a/sdk/agricultureplatform/Azure.ResourceManager.AgriculturePlatform/src/Generated/AgriServiceResource.Serialization.cs b/sdk/agricultureplatform/Azure.ResourceManager.AgriculturePlatform/src/Generated/AgriServiceResource.Serialization.cs new file mode 100644 index 000000000000..05af6e329d2a --- /dev/null +++ b/sdk/agricultureplatform/Azure.ResourceManager.AgriculturePlatform/src/Generated/AgriServiceResource.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.AgriculturePlatform +{ + public partial class AgriServiceResource : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); + + AgriServiceResourceData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options); + + AgriServiceResourceData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options); + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); + } +} diff --git a/sdk/agricultureplatform/Azure.ResourceManager.AgriculturePlatform/src/Generated/AgriServiceResource.cs b/sdk/agricultureplatform/Azure.ResourceManager.AgriculturePlatform/src/Generated/AgriServiceResource.cs new file mode 100644 index 000000000000..c38415ebc19b --- /dev/null +++ b/sdk/agricultureplatform/Azure.ResourceManager.AgriculturePlatform/src/Generated/AgriServiceResource.cs @@ -0,0 +1,783 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.AgriculturePlatform.Models; +using Azure.ResourceManager.Resources; + +namespace Azure.ResourceManager.AgriculturePlatform +{ + /// + /// A Class representing an AgriServiceResource 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 GetAgriServiceResource method. + /// Otherwise you can get one from its parent resource using the GetAgriServiceResource method. + /// + public partial class AgriServiceResource : ArmResource + { + /// Generate the resource identifier of a instance. + /// The subscriptionId. + /// The resourceGroupName. + /// The agriServiceResourceName. + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string agriServiceResourceName) + { + var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AgriculturePlatform/agriServices/{agriServiceResourceName}"; + return new ResourceIdentifier(resourceId); + } + + private readonly ClientDiagnostics _agriServiceResourceAgriServiceClientDiagnostics; + private readonly AgriServiceRestOperations _agriServiceResourceAgriServiceRestClient; + private readonly AgriServiceResourceData _data; + + /// Gets the resource type for the operations. + public static readonly ResourceType ResourceType = "Microsoft.AgriculturePlatform/agriServices"; + + /// Initializes a new instance of the class for mocking. + protected AgriServiceResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal AgriServiceResource(ArmClient client, AgriServiceResourceData 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 AgriServiceResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _agriServiceResourceAgriServiceClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.AgriculturePlatform", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string agriServiceResourceAgriServiceApiVersion); + _agriServiceResourceAgriServiceRestClient = new AgriServiceRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, agriServiceResourceAgriServiceApiVersion); +#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 AgriServiceResourceData 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 AgriServiceResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AgriculturePlatform/agriServices/{agriServiceResourceName} + /// + /// + /// Operation Id + /// AgriServiceResource_Get + /// + /// + /// Default Api Version + /// 2024-06-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _agriServiceResourceAgriServiceClientDiagnostics.CreateScope("AgriServiceResource.Get"); + scope.Start(); + try + { + var response = await _agriServiceResourceAgriServiceRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new AgriServiceResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a AgriServiceResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AgriculturePlatform/agriServices/{agriServiceResourceName} + /// + /// + /// Operation Id + /// AgriServiceResource_Get + /// + /// + /// Default Api Version + /// 2024-06-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _agriServiceResourceAgriServiceClientDiagnostics.CreateScope("AgriServiceResource.Get"); + scope.Start(); + try + { + var response = _agriServiceResourceAgriServiceRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new AgriServiceResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Delete a AgriServiceResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AgriculturePlatform/agriServices/{agriServiceResourceName} + /// + /// + /// Operation Id + /// AgriServiceResource_Delete + /// + /// + /// Default Api Version + /// 2024-06-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 = _agriServiceResourceAgriServiceClientDiagnostics.CreateScope("AgriServiceResource.Delete"); + scope.Start(); + try + { + var response = await _agriServiceResourceAgriServiceRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + var operation = new AgriculturePlatformArmOperation(_agriServiceResourceAgriServiceClientDiagnostics, Pipeline, _agriServiceResourceAgriServiceRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Delete a AgriServiceResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AgriculturePlatform/agriServices/{agriServiceResourceName} + /// + /// + /// Operation Id + /// AgriServiceResource_Delete + /// + /// + /// Default Api Version + /// 2024-06-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 = _agriServiceResourceAgriServiceClientDiagnostics.CreateScope("AgriServiceResource.Delete"); + scope.Start(); + try + { + var response = _agriServiceResourceAgriServiceRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + var operation = new AgriculturePlatformArmOperation(_agriServiceResourceAgriServiceClientDiagnostics, Pipeline, _agriServiceResourceAgriServiceRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletionResponse(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Update a AgriServiceResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AgriculturePlatform/agriServices/{agriServiceResourceName} + /// + /// + /// Operation Id + /// AgriServiceResource_Update + /// + /// + /// Default Api Version + /// 2024-06-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 resource properties to be updated. + /// The cancellation token to use. + /// is null. + public virtual async Task> UpdateAsync(WaitUntil waitUntil, AgriServiceResourcePatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(patch, nameof(patch)); + + using var scope = _agriServiceResourceAgriServiceClientDiagnostics.CreateScope("AgriServiceResource.Update"); + scope.Start(); + try + { + var response = await _agriServiceResourceAgriServiceRestClient.UpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch, cancellationToken).ConfigureAwait(false); + var operation = new AgriculturePlatformArmOperation(new AgriServiceResourceOperationSource(Client), _agriServiceResourceAgriServiceClientDiagnostics, Pipeline, _agriServiceResourceAgriServiceRestClient.CreateUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Update a AgriServiceResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AgriculturePlatform/agriServices/{agriServiceResourceName} + /// + /// + /// Operation Id + /// AgriServiceResource_Update + /// + /// + /// Default Api Version + /// 2024-06-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 resource properties to be updated. + /// The cancellation token to use. + /// is null. + public virtual ArmOperation Update(WaitUntil waitUntil, AgriServiceResourcePatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(patch, nameof(patch)); + + using var scope = _agriServiceResourceAgriServiceClientDiagnostics.CreateScope("AgriServiceResource.Update"); + scope.Start(); + try + { + var response = _agriServiceResourceAgriServiceRestClient.Update(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch, cancellationToken); + var operation = new AgriculturePlatformArmOperation(new AgriServiceResourceOperationSource(Client), _agriServiceResourceAgriServiceClientDiagnostics, Pipeline, _agriServiceResourceAgriServiceRestClient.CreateUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Returns the list of available agri solutions. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AgriculturePlatform/agriServices/{agriServiceResourceName}/listAvailableSolutions + /// + /// + /// Operation Id + /// AgriService_ListAvailableSolutions + /// + /// + /// Default Api Version + /// 2024-06-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetAvailableSolutionsAsync(CancellationToken cancellationToken = default) + { + using var scope = _agriServiceResourceAgriServiceClientDiagnostics.CreateScope("AgriServiceResource.GetAvailableSolutions"); + scope.Start(); + try + { + var response = await _agriServiceResourceAgriServiceRestClient.ListAvailableSolutionsAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + return response; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Returns the list of available agri solutions. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AgriculturePlatform/agriServices/{agriServiceResourceName}/listAvailableSolutions + /// + /// + /// Operation Id + /// AgriService_ListAvailableSolutions + /// + /// + /// Default Api Version + /// 2024-06-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual Response GetAvailableSolutions(CancellationToken cancellationToken = default) + { + using var scope = _agriServiceResourceAgriServiceClientDiagnostics.CreateScope("AgriServiceResource.GetAvailableSolutions"); + scope.Start(); + try + { + var response = _agriServiceResourceAgriServiceRestClient.ListAvailableSolutions(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + return response; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Add a tag to the current resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AgriculturePlatform/agriServices/{agriServiceResourceName} + /// + /// + /// Operation Id + /// AgriServiceResource_Get + /// + /// + /// Default Api Version + /// 2024-06-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The key for the tag. + /// The value for the tag. + /// The cancellation token to use. + /// or is null. + public virtual async Task> AddTagAsync(string key, string value, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(key, nameof(key)); + Argument.AssertNotNull(value, nameof(value)); + + using var scope = _agriServiceResourceAgriServiceClientDiagnostics.CreateScope("AgriServiceResource.AddTag"); + scope.Start(); + try + { + if (await CanUseTagResourceAsync(cancellationToken: cancellationToken).ConfigureAwait(false)) + { + var originalTags = await GetTagResource().GetAsync(cancellationToken).ConfigureAwait(false); + originalTags.Value.Data.TagValues[key] = value; + await GetTagResource().CreateOrUpdateAsync(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken).ConfigureAwait(false); + var originalResponse = await _agriServiceResourceAgriServiceRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new AgriServiceResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; + var patch = new AgriServiceResourcePatch(); + foreach (var tag in current.Tags) + { + patch.Tags.Add(tag); + } + patch.Tags[key] = value; + var result = await UpdateAsync(WaitUntil.Completed, patch, cancellationToken: cancellationToken).ConfigureAwait(false); + return Response.FromValue(result.Value, result.GetRawResponse()); + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Add a tag to the current resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AgriculturePlatform/agriServices/{agriServiceResourceName} + /// + /// + /// Operation Id + /// AgriServiceResource_Get + /// + /// + /// Default Api Version + /// 2024-06-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The key for the tag. + /// The value for the tag. + /// The cancellation token to use. + /// or is null. + public virtual Response AddTag(string key, string value, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(key, nameof(key)); + Argument.AssertNotNull(value, nameof(value)); + + using var scope = _agriServiceResourceAgriServiceClientDiagnostics.CreateScope("AgriServiceResource.AddTag"); + scope.Start(); + try + { + if (CanUseTagResource(cancellationToken: cancellationToken)) + { + var originalTags = GetTagResource().Get(cancellationToken); + originalTags.Value.Data.TagValues[key] = value; + GetTagResource().CreateOrUpdate(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken); + var originalResponse = _agriServiceResourceAgriServiceRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + return Response.FromValue(new AgriServiceResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = Get(cancellationToken: cancellationToken).Value.Data; + var patch = new AgriServiceResourcePatch(); + foreach (var tag in current.Tags) + { + patch.Tags.Add(tag); + } + patch.Tags[key] = value; + var result = Update(WaitUntil.Completed, patch, cancellationToken: cancellationToken); + return Response.FromValue(result.Value, result.GetRawResponse()); + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Replace the tags on the resource with the given set. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AgriculturePlatform/agriServices/{agriServiceResourceName} + /// + /// + /// Operation Id + /// AgriServiceResource_Get + /// + /// + /// Default Api Version + /// 2024-06-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The set of tags to use as replacement. + /// The cancellation token to use. + /// is null. + public virtual async Task> SetTagsAsync(IDictionary tags, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(tags, nameof(tags)); + + using var scope = _agriServiceResourceAgriServiceClientDiagnostics.CreateScope("AgriServiceResource.SetTags"); + scope.Start(); + try + { + if (await CanUseTagResourceAsync(cancellationToken: cancellationToken).ConfigureAwait(false)) + { + await GetTagResource().DeleteAsync(WaitUntil.Completed, cancellationToken: cancellationToken).ConfigureAwait(false); + var originalTags = await GetTagResource().GetAsync(cancellationToken).ConfigureAwait(false); + originalTags.Value.Data.TagValues.ReplaceWith(tags); + await GetTagResource().CreateOrUpdateAsync(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken).ConfigureAwait(false); + var originalResponse = await _agriServiceResourceAgriServiceRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new AgriServiceResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; + var patch = new AgriServiceResourcePatch(); + patch.Tags.ReplaceWith(tags); + var result = await UpdateAsync(WaitUntil.Completed, patch, cancellationToken: cancellationToken).ConfigureAwait(false); + return Response.FromValue(result.Value, result.GetRawResponse()); + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Replace the tags on the resource with the given set. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AgriculturePlatform/agriServices/{agriServiceResourceName} + /// + /// + /// Operation Id + /// AgriServiceResource_Get + /// + /// + /// Default Api Version + /// 2024-06-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The set of tags to use as replacement. + /// The cancellation token to use. + /// is null. + public virtual Response SetTags(IDictionary tags, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(tags, nameof(tags)); + + using var scope = _agriServiceResourceAgriServiceClientDiagnostics.CreateScope("AgriServiceResource.SetTags"); + scope.Start(); + try + { + if (CanUseTagResource(cancellationToken: cancellationToken)) + { + GetTagResource().Delete(WaitUntil.Completed, cancellationToken: cancellationToken); + var originalTags = GetTagResource().Get(cancellationToken); + originalTags.Value.Data.TagValues.ReplaceWith(tags); + GetTagResource().CreateOrUpdate(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken); + var originalResponse = _agriServiceResourceAgriServiceRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + return Response.FromValue(new AgriServiceResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = Get(cancellationToken: cancellationToken).Value.Data; + var patch = new AgriServiceResourcePatch(); + patch.Tags.ReplaceWith(tags); + var result = Update(WaitUntil.Completed, patch, cancellationToken: cancellationToken); + return Response.FromValue(result.Value, result.GetRawResponse()); + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Removes a tag by key from the resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AgriculturePlatform/agriServices/{agriServiceResourceName} + /// + /// + /// Operation Id + /// AgriServiceResource_Get + /// + /// + /// Default Api Version + /// 2024-06-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The key for the tag. + /// The cancellation token to use. + /// is null. + public virtual async Task> RemoveTagAsync(string key, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(key, nameof(key)); + + using var scope = _agriServiceResourceAgriServiceClientDiagnostics.CreateScope("AgriServiceResource.RemoveTag"); + scope.Start(); + try + { + if (await CanUseTagResourceAsync(cancellationToken: cancellationToken).ConfigureAwait(false)) + { + var originalTags = await GetTagResource().GetAsync(cancellationToken).ConfigureAwait(false); + originalTags.Value.Data.TagValues.Remove(key); + await GetTagResource().CreateOrUpdateAsync(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken).ConfigureAwait(false); + var originalResponse = await _agriServiceResourceAgriServiceRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new AgriServiceResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; + var patch = new AgriServiceResourcePatch(); + foreach (var tag in current.Tags) + { + patch.Tags.Add(tag); + } + patch.Tags.Remove(key); + var result = await UpdateAsync(WaitUntil.Completed, patch, cancellationToken: cancellationToken).ConfigureAwait(false); + return Response.FromValue(result.Value, result.GetRawResponse()); + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Removes a tag by key from the resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AgriculturePlatform/agriServices/{agriServiceResourceName} + /// + /// + /// Operation Id + /// AgriServiceResource_Get + /// + /// + /// Default Api Version + /// 2024-06-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The key for the tag. + /// The cancellation token to use. + /// is null. + public virtual Response RemoveTag(string key, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(key, nameof(key)); + + using var scope = _agriServiceResourceAgriServiceClientDiagnostics.CreateScope("AgriServiceResource.RemoveTag"); + scope.Start(); + try + { + if (CanUseTagResource(cancellationToken: cancellationToken)) + { + var originalTags = GetTagResource().Get(cancellationToken); + originalTags.Value.Data.TagValues.Remove(key); + GetTagResource().CreateOrUpdate(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken); + var originalResponse = _agriServiceResourceAgriServiceRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + return Response.FromValue(new AgriServiceResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = Get(cancellationToken: cancellationToken).Value.Data; + var patch = new AgriServiceResourcePatch(); + foreach (var tag in current.Tags) + { + patch.Tags.Add(tag); + } + patch.Tags.Remove(key); + var result = Update(WaitUntil.Completed, patch, cancellationToken: cancellationToken); + return Response.FromValue(result.Value, result.GetRawResponse()); + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/agricultureplatform/Azure.ResourceManager.AgriculturePlatform/src/Generated/AgriServiceResourceCollection.cs b/sdk/agricultureplatform/Azure.ResourceManager.AgriculturePlatform/src/Generated/AgriServiceResourceCollection.cs new file mode 100644 index 000000000000..42b85f8af389 --- /dev/null +++ b/sdk/agricultureplatform/Azure.ResourceManager.AgriculturePlatform/src/Generated/AgriServiceResourceCollection.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.AgriculturePlatform +{ + /// + /// 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 GetAgriServiceResources method from an instance of . + /// + public partial class AgriServiceResourceCollection : ArmCollection, IEnumerable, IAsyncEnumerable + { + private readonly ClientDiagnostics _agriServiceResourceAgriServiceClientDiagnostics; + private readonly AgriServiceRestOperations _agriServiceResourceAgriServiceRestClient; + + /// Initializes a new instance of the class for mocking. + protected AgriServiceResourceCollection() + { + } + + /// 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 AgriServiceResourceCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _agriServiceResourceAgriServiceClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.AgriculturePlatform", AgriServiceResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(AgriServiceResource.ResourceType, out string agriServiceResourceAgriServiceApiVersion); + _agriServiceResourceAgriServiceRestClient = new AgriServiceRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, agriServiceResourceAgriServiceApiVersion); +#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 AgriServiceResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AgriculturePlatform/agriServices/{agriServiceResourceName} + /// + /// + /// Operation Id + /// AgriServiceResource_CreateOrUpdate + /// + /// + /// Default Api Version + /// 2024-06-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 name of the AgriService 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 agriServiceResourceName, AgriServiceResourceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(agriServiceResourceName, nameof(agriServiceResourceName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _agriServiceResourceAgriServiceClientDiagnostics.CreateScope("AgriServiceResourceCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = await _agriServiceResourceAgriServiceRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, agriServiceResourceName, data, cancellationToken).ConfigureAwait(false); + var operation = new AgriculturePlatformArmOperation(new AgriServiceResourceOperationSource(Client), _agriServiceResourceAgriServiceClientDiagnostics, Pipeline, _agriServiceResourceAgriServiceRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, agriServiceResourceName, 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 AgriServiceResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AgriculturePlatform/agriServices/{agriServiceResourceName} + /// + /// + /// Operation Id + /// AgriServiceResource_CreateOrUpdate + /// + /// + /// Default Api Version + /// 2024-06-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 name of the AgriService 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 agriServiceResourceName, AgriServiceResourceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(agriServiceResourceName, nameof(agriServiceResourceName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _agriServiceResourceAgriServiceClientDiagnostics.CreateScope("AgriServiceResourceCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = _agriServiceResourceAgriServiceRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, agriServiceResourceName, data, cancellationToken); + var operation = new AgriculturePlatformArmOperation(new AgriServiceResourceOperationSource(Client), _agriServiceResourceAgriServiceClientDiagnostics, Pipeline, _agriServiceResourceAgriServiceRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, agriServiceResourceName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a AgriServiceResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AgriculturePlatform/agriServices/{agriServiceResourceName} + /// + /// + /// Operation Id + /// AgriServiceResource_Get + /// + /// + /// Default Api Version + /// 2024-06-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the AgriService 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 agriServiceResourceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(agriServiceResourceName, nameof(agriServiceResourceName)); + + using var scope = _agriServiceResourceAgriServiceClientDiagnostics.CreateScope("AgriServiceResourceCollection.Get"); + scope.Start(); + try + { + var response = await _agriServiceResourceAgriServiceRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, agriServiceResourceName, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new AgriServiceResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a AgriServiceResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AgriculturePlatform/agriServices/{agriServiceResourceName} + /// + /// + /// Operation Id + /// AgriServiceResource_Get + /// + /// + /// Default Api Version + /// 2024-06-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the AgriService resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Get(string agriServiceResourceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(agriServiceResourceName, nameof(agriServiceResourceName)); + + using var scope = _agriServiceResourceAgriServiceClientDiagnostics.CreateScope("AgriServiceResourceCollection.Get"); + scope.Start(); + try + { + var response = _agriServiceResourceAgriServiceRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, agriServiceResourceName, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new AgriServiceResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// List AgriServiceResource resources by resource group + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AgriculturePlatform/agriServices + /// + /// + /// Operation Id + /// AgriServiceResource_ListByResourceGroup + /// + /// + /// Default Api Version + /// 2024-06-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) => _agriServiceResourceAgriServiceRestClient.CreateListByResourceGroupRequest(Id.SubscriptionId, Id.ResourceGroupName); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _agriServiceResourceAgriServiceRestClient.CreateListByResourceGroupNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new AgriServiceResource(Client, AgriServiceResourceData.DeserializeAgriServiceResourceData(e)), _agriServiceResourceAgriServiceClientDiagnostics, Pipeline, "AgriServiceResourceCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// List AgriServiceResource resources by resource group + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AgriculturePlatform/agriServices + /// + /// + /// Operation Id + /// AgriServiceResource_ListByResourceGroup + /// + /// + /// Default Api Version + /// 2024-06-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) => _agriServiceResourceAgriServiceRestClient.CreateListByResourceGroupRequest(Id.SubscriptionId, Id.ResourceGroupName); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _agriServiceResourceAgriServiceRestClient.CreateListByResourceGroupNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new AgriServiceResource(Client, AgriServiceResourceData.DeserializeAgriServiceResourceData(e)), _agriServiceResourceAgriServiceClientDiagnostics, Pipeline, "AgriServiceResourceCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AgriculturePlatform/agriServices/{agriServiceResourceName} + /// + /// + /// Operation Id + /// AgriServiceResource_Get + /// + /// + /// Default Api Version + /// 2024-06-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the AgriService 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 agriServiceResourceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(agriServiceResourceName, nameof(agriServiceResourceName)); + + using var scope = _agriServiceResourceAgriServiceClientDiagnostics.CreateScope("AgriServiceResourceCollection.Exists"); + scope.Start(); + try + { + var response = await _agriServiceResourceAgriServiceRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, agriServiceResourceName, 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.AgriculturePlatform/agriServices/{agriServiceResourceName} + /// + /// + /// Operation Id + /// AgriServiceResource_Get + /// + /// + /// Default Api Version + /// 2024-06-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the AgriService resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Exists(string agriServiceResourceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(agriServiceResourceName, nameof(agriServiceResourceName)); + + using var scope = _agriServiceResourceAgriServiceClientDiagnostics.CreateScope("AgriServiceResourceCollection.Exists"); + scope.Start(); + try + { + var response = _agriServiceResourceAgriServiceRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, agriServiceResourceName, 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.AgriculturePlatform/agriServices/{agriServiceResourceName} + /// + /// + /// Operation Id + /// AgriServiceResource_Get + /// + /// + /// Default Api Version + /// 2024-06-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the AgriService 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 agriServiceResourceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(agriServiceResourceName, nameof(agriServiceResourceName)); + + using var scope = _agriServiceResourceAgriServiceClientDiagnostics.CreateScope("AgriServiceResourceCollection.GetIfExists"); + scope.Start(); + try + { + var response = await _agriServiceResourceAgriServiceRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, agriServiceResourceName, cancellationToken: cancellationToken).ConfigureAwait(false); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new AgriServiceResource(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.AgriculturePlatform/agriServices/{agriServiceResourceName} + /// + /// + /// Operation Id + /// AgriServiceResource_Get + /// + /// + /// Default Api Version + /// 2024-06-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the AgriService resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual NullableResponse GetIfExists(string agriServiceResourceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(agriServiceResourceName, nameof(agriServiceResourceName)); + + using var scope = _agriServiceResourceAgriServiceClientDiagnostics.CreateScope("AgriServiceResourceCollection.GetIfExists"); + scope.Start(); + try + { + var response = _agriServiceResourceAgriServiceRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, agriServiceResourceName, cancellationToken: cancellationToken); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new AgriServiceResource(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/agricultureplatform/Azure.ResourceManager.AgriculturePlatform/src/Generated/AgriServiceResourceData.Serialization.cs b/sdk/agricultureplatform/Azure.ResourceManager.AgriculturePlatform/src/Generated/AgriServiceResourceData.Serialization.cs new file mode 100644 index 000000000000..6631566e5cc9 --- /dev/null +++ b/sdk/agricultureplatform/Azure.ResourceManager.AgriculturePlatform/src/Generated/AgriServiceResourceData.Serialization.cs @@ -0,0 +1,212 @@ +// 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.AgriculturePlatform.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.AgriculturePlatform +{ + public partial class AgriServiceResourceData : 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(AgriServiceResourceData)} 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); + } + if (Optional.IsDefined(Sku)) + { + writer.WritePropertyName("sku"u8); + writer.WriteObjectValue(Sku, options); + } + } + + AgriServiceResourceData 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(AgriServiceResourceData)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAgriServiceResourceData(document.RootElement, options); + } + + internal static AgriServiceResourceData DeserializeAgriServiceResourceData(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + AgriServiceResourceProperties properties = default; + ManagedServiceIdentity identity = default; + AgriculturePlatformSku sku = 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 = AgriServiceResourceProperties.DeserializeAgriServiceResourceProperties(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("sku"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + sku = AgriculturePlatformSku.DeserializeAgriculturePlatformSku(property.Value, options); + 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 AgriServiceResourceData( + id, + name, + type, + systemData, + tags ?? new ChangeTrackingDictionary(), + location, + properties, + identity, + sku, + 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(AgriServiceResourceData)} does not support writing '{options.Format}' format."); + } + } + + AgriServiceResourceData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeAgriServiceResourceData(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(AgriServiceResourceData)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/agricultureplatform/Azure.ResourceManager.AgriculturePlatform/src/Generated/AgriServiceResourceData.cs b/sdk/agricultureplatform/Azure.ResourceManager.AgriculturePlatform/src/Generated/AgriServiceResourceData.cs new file mode 100644 index 000000000000..7feaf9b7fd31 --- /dev/null +++ b/sdk/agricultureplatform/Azure.ResourceManager.AgriculturePlatform/src/Generated/AgriServiceResourceData.cs @@ -0,0 +1,91 @@ +// 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.AgriculturePlatform.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.AgriculturePlatform +{ + /// + /// A class representing the AgriServiceResource data model. + /// Schema of the AgriService resource from Microsoft.AgriculturePlatform resource provider. + /// + public partial class AgriServiceResourceData : 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 AgriServiceResourceData(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. + /// The SKU (Stock Keeping Unit) assigned to this resource. + /// Keeps track of any properties unknown to the library. + internal AgriServiceResourceData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, AgriServiceResourceProperties properties, ManagedServiceIdentity identity, AgriculturePlatformSku sku, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) + { + Properties = properties; + Identity = identity; + Sku = sku; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal AgriServiceResourceData() + { + } + + /// The resource-specific properties for this resource. + public AgriServiceResourceProperties Properties { get; set; } + /// The managed service identities assigned to this resource. + public ManagedServiceIdentity Identity { get; set; } + /// The SKU (Stock Keeping Unit) assigned to this resource. + public AgriculturePlatformSku Sku { get; set; } + } +} diff --git a/sdk/agricultureplatform/Azure.ResourceManager.AgriculturePlatform/src/Generated/ArmAgriculturePlatformModelFactory.cs b/sdk/agricultureplatform/Azure.ResourceManager.AgriculturePlatform/src/Generated/ArmAgriculturePlatformModelFactory.cs new file mode 100644 index 000000000000..5c942e4abb78 --- /dev/null +++ b/sdk/agricultureplatform/Azure.ResourceManager.AgriculturePlatform/src/Generated/ArmAgriculturePlatformModelFactory.cs @@ -0,0 +1,139 @@ +// 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; +using Azure.ResourceManager.Resources.Models; + +namespace Azure.ResourceManager.AgriculturePlatform.Models +{ + /// Model factory for models. + public static partial class ArmAgriculturePlatformModelFactory + { + /// 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. + /// The SKU (Stock Keeping Unit) assigned to this resource. + /// A new instance for mocking. + public static AgriServiceResourceData AgriServiceResourceData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, AgriServiceResourceProperties properties = null, ManagedServiceIdentity identity = null, AgriculturePlatformSku sku = null) + { + tags ??= new Dictionary(); + + return new AgriServiceResourceData( + id, + name, + resourceType, + systemData, + tags, + location, + properties, + identity, + sku, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The status of the last operation. + /// Config of the AgriService instance. + /// Managed On Behalf Of Configuration. + /// Data connector credentials of AgriService instance. + /// AgriService installed solutions. + /// A new instance for mocking. + public static AgriServiceResourceProperties AgriServiceResourceProperties(ProvisioningState? provisioningState = null, AgriServiceConfig config = null, IEnumerable managedOnBehalfOfMoboBrokerResources = null, IEnumerable dataConnectorCredentials = null, IEnumerable installedSolutions = null) + { + managedOnBehalfOfMoboBrokerResources ??= new List(); + dataConnectorCredentials ??= new List(); + installedSolutions ??= new List(); + + return new AgriServiceResourceProperties( + provisioningState, + config, + managedOnBehalfOfMoboBrokerResources != null ? new ManagedOnBehalfOfConfiguration(managedOnBehalfOfMoboBrokerResources?.ToList(), serializedAdditionalRawData: null) : null, + dataConnectorCredentials?.ToList(), + installedSolutions?.ToList(), + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Instance URI of the AgriService instance. + /// Version of AgriService instance. + /// App service resource Id. + /// Cosmos Db resource Id. + /// Storage account resource Id. + /// Key vault resource Id. + /// Redis cache resource Id. + /// A new instance for mocking. + public static AgriServiceConfig AgriServiceConfig(string instanceUri = null, string version = null, string appServiceResourceId = null, string cosmosDbResourceId = null, string storageAccountResourceId = null, string keyVaultResourceId = null, string redisCacheResourceId = null) + { + return new AgriServiceConfig( + instanceUri, + version, + appServiceResourceId, + cosmosDbResourceId, + storageAccountResourceId, + keyVaultResourceId, + redisCacheResourceId, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Agri solutions list. + /// A new instance for mocking. + public static AvailableAgriSolutionListResult AvailableAgriSolutionListResult(IEnumerable solutions = null) + { + solutions ??= new List(); + + return new AvailableAgriSolutionListResult(solutions?.ToList(), serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Partner Id. + /// Solution Id. + /// Partner tenant Id. + /// Data access scopes. + /// Marketplace offer details. + /// Saas application Id. + /// Entra application Id used to access azure data manager for agriculture instance. + /// Entra application name used to access azure data manager for agriculture instance. + /// Whether solution inference will validate input. + /// A new instance for mocking. + public static DataManagerForAgricultureSolution DataManagerForAgricultureSolution(string partnerId = null, string solutionId = null, string partnerTenantId = null, IEnumerable dataAccessScopes = null, MarketPlaceOfferDetails marketPlaceOfferDetails = null, string saasApplicationId = null, string accessAzureDataManagerForAgricultureApplicationId = null, string accessAzureDataManagerForAgricultureApplicationName = null, bool isValidateInput = default) + { + dataAccessScopes ??= new List(); + + return new DataManagerForAgricultureSolution( + partnerId, + solutionId, + partnerTenantId, + dataAccessScopes?.ToList(), + marketPlaceOfferDetails, + saasApplicationId, + accessAzureDataManagerForAgricultureApplicationId, + accessAzureDataManagerForAgricultureApplicationName, + isValidateInput, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Saas offer Id. + /// Publisher Id. + /// A new instance for mocking. + public static MarketPlaceOfferDetails MarketPlaceOfferDetails(string saasOfferId = null, string publisherId = null) + { + return new MarketPlaceOfferDetails(saasOfferId, publisherId, serializedAdditionalRawData: null); + } + } +} diff --git a/sdk/agricultureplatform/Azure.ResourceManager.AgriculturePlatform/src/Generated/Extensions/AgriculturePlatformExtensions.cs b/sdk/agricultureplatform/Azure.ResourceManager.AgriculturePlatform/src/Generated/Extensions/AgriculturePlatformExtensions.cs new file mode 100644 index 000000000000..33278862927b --- /dev/null +++ b/sdk/agricultureplatform/Azure.ResourceManager.AgriculturePlatform/src/Generated/Extensions/AgriculturePlatformExtensions.cs @@ -0,0 +1,219 @@ +// 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.AgriculturePlatform.Mocking; +using Azure.ResourceManager.Resources; + +namespace Azure.ResourceManager.AgriculturePlatform +{ + /// A class to add extension methods to Azure.ResourceManager.AgriculturePlatform. + public static partial class AgriculturePlatformExtensions + { + private static MockableAgriculturePlatformArmClient GetMockableAgriculturePlatformArmClient(ArmClient client) + { + return client.GetCachedClient(client0 => new MockableAgriculturePlatformArmClient(client0)); + } + + private static MockableAgriculturePlatformResourceGroupResource GetMockableAgriculturePlatformResourceGroupResource(ArmResource resource) + { + return resource.GetCachedClient(client => new MockableAgriculturePlatformResourceGroupResource(client, resource.Id)); + } + + private static MockableAgriculturePlatformSubscriptionResource GetMockableAgriculturePlatformSubscriptionResource(ArmResource resource) + { + return resource.GetCachedClient(client => new MockableAgriculturePlatformSubscriptionResource(client, resource.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 AgriServiceResource GetAgriServiceResource(this ArmClient client, ResourceIdentifier id) + { + Argument.AssertNotNull(client, nameof(client)); + + return GetMockableAgriculturePlatformArmClient(client).GetAgriServiceResource(id); + } + + /// + /// Gets a collection of AgriServiceResources 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 AgriServiceResources and their operations over a AgriServiceResource. + public static AgriServiceResourceCollection GetAgriServiceResources(this ResourceGroupResource resourceGroupResource) + { + Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource)); + + return GetMockableAgriculturePlatformResourceGroupResource(resourceGroupResource).GetAgriServiceResources(); + } + + /// + /// Get a AgriServiceResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AgriculturePlatform/agriServices/{agriServiceResourceName} + /// + /// + /// Operation Id + /// AgriServiceResource_Get + /// + /// + /// Default Api Version + /// 2024-06-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The name of the AgriService 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> GetAgriServiceResourceAsync(this ResourceGroupResource resourceGroupResource, string agriServiceResourceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource)); + + return await GetMockableAgriculturePlatformResourceGroupResource(resourceGroupResource).GetAgriServiceResourceAsync(agriServiceResourceName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get a AgriServiceResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AgriculturePlatform/agriServices/{agriServiceResourceName} + /// + /// + /// Operation Id + /// AgriServiceResource_Get + /// + /// + /// Default Api Version + /// 2024-06-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The name of the AgriService resource. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public static Response GetAgriServiceResource(this ResourceGroupResource resourceGroupResource, string agriServiceResourceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource)); + + return GetMockableAgriculturePlatformResourceGroupResource(resourceGroupResource).GetAgriServiceResource(agriServiceResourceName, cancellationToken); + } + + /// + /// List AgriServiceResource resources by subscription ID + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.AgriculturePlatform/agriServices + /// + /// + /// Operation Id + /// AgriServiceResource_ListBySubscription + /// + /// + /// Default Api Version + /// 2024-06-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 GetAgriServiceResourcesAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); + + return GetMockableAgriculturePlatformSubscriptionResource(subscriptionResource).GetAgriServiceResourcesAsync(cancellationToken); + } + + /// + /// List AgriServiceResource resources by subscription ID + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.AgriculturePlatform/agriServices + /// + /// + /// Operation Id + /// AgriServiceResource_ListBySubscription + /// + /// + /// Default Api Version + /// 2024-06-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 GetAgriServiceResources(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); + + return GetMockableAgriculturePlatformSubscriptionResource(subscriptionResource).GetAgriServiceResources(cancellationToken); + } + } +} diff --git a/sdk/agricultureplatform/Azure.ResourceManager.AgriculturePlatform/src/Generated/Extensions/MockableAgriculturePlatformArmClient.cs b/sdk/agricultureplatform/Azure.ResourceManager.AgriculturePlatform/src/Generated/Extensions/MockableAgriculturePlatformArmClient.cs new file mode 100644 index 000000000000..47524282c73e --- /dev/null +++ b/sdk/agricultureplatform/Azure.ResourceManager.AgriculturePlatform/src/Generated/Extensions/MockableAgriculturePlatformArmClient.cs @@ -0,0 +1,49 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using Azure.Core; + +namespace Azure.ResourceManager.AgriculturePlatform.Mocking +{ + /// A class to add extension methods to ArmClient. + public partial class MockableAgriculturePlatformArmClient : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected MockableAgriculturePlatformArmClient() + { + } + + /// 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 MockableAgriculturePlatformArmClient(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + internal MockableAgriculturePlatformArmClient(ArmClient client) : this(client, ResourceIdentifier.Root) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// + /// 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 AgriServiceResource GetAgriServiceResource(ResourceIdentifier id) + { + AgriServiceResource.ValidateResourceId(id); + return new AgriServiceResource(Client, id); + } + } +} diff --git a/sdk/agricultureplatform/Azure.ResourceManager.AgriculturePlatform/src/Generated/Extensions/MockableAgriculturePlatformResourceGroupResource.cs b/sdk/agricultureplatform/Azure.ResourceManager.AgriculturePlatform/src/Generated/Extensions/MockableAgriculturePlatformResourceGroupResource.cs new file mode 100644 index 000000000000..560b8c722fbe --- /dev/null +++ b/sdk/agricultureplatform/Azure.ResourceManager.AgriculturePlatform/src/Generated/Extensions/MockableAgriculturePlatformResourceGroupResource.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.AgriculturePlatform.Mocking +{ + /// A class to add extension methods to ResourceGroupResource. + public partial class MockableAgriculturePlatformResourceGroupResource : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected MockableAgriculturePlatformResourceGroupResource() + { + } + + /// 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 MockableAgriculturePlatformResourceGroupResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// Gets a collection of AgriServiceResources in the ResourceGroupResource. + /// An object representing collection of AgriServiceResources and their operations over a AgriServiceResource. + public virtual AgriServiceResourceCollection GetAgriServiceResources() + { + return GetCachedClient(client => new AgriServiceResourceCollection(client, Id)); + } + + /// + /// Get a AgriServiceResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AgriculturePlatform/agriServices/{agriServiceResourceName} + /// + /// + /// Operation Id + /// AgriServiceResource_Get + /// + /// + /// Default Api Version + /// 2024-06-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the AgriService resource. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetAgriServiceResourceAsync(string agriServiceResourceName, CancellationToken cancellationToken = default) + { + return await GetAgriServiceResources().GetAsync(agriServiceResourceName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get a AgriServiceResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AgriculturePlatform/agriServices/{agriServiceResourceName} + /// + /// + /// Operation Id + /// AgriServiceResource_Get + /// + /// + /// Default Api Version + /// 2024-06-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the AgriService resource. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetAgriServiceResource(string agriServiceResourceName, CancellationToken cancellationToken = default) + { + return GetAgriServiceResources().Get(agriServiceResourceName, cancellationToken); + } + } +} diff --git a/sdk/agricultureplatform/Azure.ResourceManager.AgriculturePlatform/src/Generated/Extensions/MockableAgriculturePlatformSubscriptionResource.cs b/sdk/agricultureplatform/Azure.ResourceManager.AgriculturePlatform/src/Generated/Extensions/MockableAgriculturePlatformSubscriptionResource.cs new file mode 100644 index 000000000000..fe872ab6c746 --- /dev/null +++ b/sdk/agricultureplatform/Azure.ResourceManager.AgriculturePlatform/src/Generated/Extensions/MockableAgriculturePlatformSubscriptionResource.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.AgriculturePlatform.Mocking +{ + /// A class to add extension methods to SubscriptionResource. + public partial class MockableAgriculturePlatformSubscriptionResource : ArmResource + { + private ClientDiagnostics _agriServiceResourceAgriServiceClientDiagnostics; + private AgriServiceRestOperations _agriServiceResourceAgriServiceRestClient; + + /// Initializes a new instance of the class for mocking. + protected MockableAgriculturePlatformSubscriptionResource() + { + } + + /// 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 MockableAgriculturePlatformSubscriptionResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + private ClientDiagnostics AgriServiceResourceAgriServiceClientDiagnostics => _agriServiceResourceAgriServiceClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.AgriculturePlatform", AgriServiceResource.ResourceType.Namespace, Diagnostics); + private AgriServiceRestOperations AgriServiceResourceAgriServiceRestClient => _agriServiceResourceAgriServiceRestClient ??= new AgriServiceRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, GetApiVersionOrNull(AgriServiceResource.ResourceType)); + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// + /// List AgriServiceResource resources by subscription ID + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.AgriculturePlatform/agriServices + /// + /// + /// Operation Id + /// AgriServiceResource_ListBySubscription + /// + /// + /// Default Api Version + /// 2024-06-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetAgriServiceResourcesAsync(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => AgriServiceResourceAgriServiceRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => AgriServiceResourceAgriServiceRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new AgriServiceResource(Client, AgriServiceResourceData.DeserializeAgriServiceResourceData(e)), AgriServiceResourceAgriServiceClientDiagnostics, Pipeline, "MockableAgriculturePlatformSubscriptionResource.GetAgriServiceResources", "value", "nextLink", cancellationToken); + } + + /// + /// List AgriServiceResource resources by subscription ID + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.AgriculturePlatform/agriServices + /// + /// + /// Operation Id + /// AgriServiceResource_ListBySubscription + /// + /// + /// Default Api Version + /// 2024-06-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetAgriServiceResources(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => AgriServiceResourceAgriServiceRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => AgriServiceResourceAgriServiceRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new AgriServiceResource(Client, AgriServiceResourceData.DeserializeAgriServiceResourceData(e)), AgriServiceResourceAgriServiceClientDiagnostics, Pipeline, "MockableAgriculturePlatformSubscriptionResource.GetAgriServiceResources", "value", "nextLink", cancellationToken); + } + } +} diff --git a/sdk/agricultureplatform/Azure.ResourceManager.AgriculturePlatform/src/Generated/Internal/Argument.cs b/sdk/agricultureplatform/Azure.ResourceManager.AgriculturePlatform/src/Generated/Internal/Argument.cs new file mode 100644 index 000000000000..179c68864933 --- /dev/null +++ b/sdk/agricultureplatform/Azure.ResourceManager.AgriculturePlatform/src/Generated/Internal/Argument.cs @@ -0,0 +1,129 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections; +using System.Collections.Generic; + +namespace Azure.ResourceManager.AgriculturePlatform +{ + internal static class Argument + { + public static void AssertNotNull(T value, string name) + { + if (value is null) + { + throw new ArgumentNullException(name); + } + } + + public static void AssertNotNull(T? value, string name) + where T : struct + { + if (!value.HasValue) + { + throw new ArgumentNullException(name); + } + } + + public static void AssertNotNullOrEmpty(IEnumerable value, string name) + { + if (value is null) + { + throw new ArgumentNullException(name); + } + if (value is ICollection collectionOfT && collectionOfT.Count == 0) + { + throw new ArgumentException("Value cannot be an empty collection.", name); + } + if (value is ICollection collection && collection.Count == 0) + { + throw new ArgumentException("Value cannot be an empty collection.", name); + } + using IEnumerator e = value.GetEnumerator(); + if (!e.MoveNext()) + { + throw new ArgumentException("Value cannot be an empty collection.", name); + } + } + + public static void AssertNotNullOrEmpty(string value, string name) + { + if (value is null) + { + throw new ArgumentNullException(name); + } + if (value.Length == 0) + { + throw new ArgumentException("Value cannot be an empty string.", name); + } + } + + public static void AssertNotNullOrWhiteSpace(string value, string name) + { + if (value is null) + { + throw new ArgumentNullException(name); + } + if (string.IsNullOrWhiteSpace(value)) + { + throw new ArgumentException("Value cannot be empty or contain only white-space characters.", name); + } + } + + public static void AssertNotDefault(ref T value, string name) + where T : struct, IEquatable + { + if (value.Equals(default)) + { + throw new ArgumentException("Value cannot be empty.", name); + } + } + + public static void AssertInRange(T value, T minimum, T maximum, string name) + where T : notnull, IComparable + { + if (minimum.CompareTo(value) > 0) + { + throw new ArgumentOutOfRangeException(name, "Value is less than the minimum allowed."); + } + if (maximum.CompareTo(value) < 0) + { + throw new ArgumentOutOfRangeException(name, "Value is greater than the maximum allowed."); + } + } + + public static void AssertEnumDefined(Type enumType, object value, string name) + { + if (!Enum.IsDefined(enumType, value)) + { + throw new ArgumentException($"Value not defined for {enumType.FullName}.", name); + } + } + + public static T CheckNotNull(T value, string name) + where T : class + { + AssertNotNull(value, name); + return value; + } + + public static string CheckNotNullOrEmpty(string value, string name) + { + AssertNotNullOrEmpty(value, name); + return value; + } + + public static void AssertNull(T value, string name, string message = null) + { + if (value != null) + { + throw new ArgumentException(message ?? "Value must be null.", name); + } + } + } +} diff --git a/sdk/agricultureplatform/Azure.ResourceManager.AgriculturePlatform/src/Generated/Internal/ChangeTrackingDictionary.cs b/sdk/agricultureplatform/Azure.ResourceManager.AgriculturePlatform/src/Generated/Internal/ChangeTrackingDictionary.cs new file mode 100644 index 000000000000..ecea3d3eef83 --- /dev/null +++ b/sdk/agricultureplatform/Azure.ResourceManager.AgriculturePlatform/src/Generated/Internal/ChangeTrackingDictionary.cs @@ -0,0 +1,167 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections; +using System.Collections.Generic; + +namespace Azure.ResourceManager.AgriculturePlatform +{ + internal class ChangeTrackingDictionary : IDictionary, IReadOnlyDictionary where TKey : notnull + { + private IDictionary _innerDictionary; + + public ChangeTrackingDictionary() + { + } + + public ChangeTrackingDictionary(IDictionary dictionary) + { + if (dictionary == null) + { + return; + } + _innerDictionary = new Dictionary(dictionary); + } + + public ChangeTrackingDictionary(IReadOnlyDictionary dictionary) + { + if (dictionary == null) + { + return; + } + _innerDictionary = new Dictionary(); + foreach (var pair in dictionary) + { + _innerDictionary.Add(pair); + } + } + + public bool IsUndefined => _innerDictionary == null; + + public int Count => IsUndefined ? 0 : EnsureDictionary().Count; + + public bool IsReadOnly => IsUndefined ? false : EnsureDictionary().IsReadOnly; + + public ICollection Keys => IsUndefined ? Array.Empty() : EnsureDictionary().Keys; + + public ICollection Values => IsUndefined ? Array.Empty() : EnsureDictionary().Values; + + public TValue this[TKey key] + { + get + { + if (IsUndefined) + { + throw new KeyNotFoundException(nameof(key)); + } + return EnsureDictionary()[key]; + } + set + { + EnsureDictionary()[key] = value; + } + } + + IEnumerable IReadOnlyDictionary.Keys => Keys; + + IEnumerable IReadOnlyDictionary.Values => Values; + + public IEnumerator> GetEnumerator() + { + if (IsUndefined) + { + IEnumerator> enumerateEmpty() + { + yield break; + } + return enumerateEmpty(); + } + return EnsureDictionary().GetEnumerator(); + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetEnumerator(); + } + + public void Add(KeyValuePair item) + { + EnsureDictionary().Add(item); + } + + public void Clear() + { + EnsureDictionary().Clear(); + } + + public bool Contains(KeyValuePair item) + { + if (IsUndefined) + { + return false; + } + return EnsureDictionary().Contains(item); + } + + public void CopyTo(KeyValuePair[] array, int index) + { + if (IsUndefined) + { + return; + } + EnsureDictionary().CopyTo(array, index); + } + + public bool Remove(KeyValuePair item) + { + if (IsUndefined) + { + return false; + } + return EnsureDictionary().Remove(item); + } + + public void Add(TKey key, TValue value) + { + EnsureDictionary().Add(key, value); + } + + public bool ContainsKey(TKey key) + { + if (IsUndefined) + { + return false; + } + return EnsureDictionary().ContainsKey(key); + } + + public bool Remove(TKey key) + { + if (IsUndefined) + { + return false; + } + return EnsureDictionary().Remove(key); + } + + public bool TryGetValue(TKey key, out TValue value) + { + if (IsUndefined) + { + value = default; + return false; + } + return EnsureDictionary().TryGetValue(key, out value); + } + + public IDictionary EnsureDictionary() + { + return _innerDictionary ??= new Dictionary(); + } + } +} diff --git a/sdk/agricultureplatform/Azure.ResourceManager.AgriculturePlatform/src/Generated/Internal/ChangeTrackingList.cs b/sdk/agricultureplatform/Azure.ResourceManager.AgriculturePlatform/src/Generated/Internal/ChangeTrackingList.cs new file mode 100644 index 000000000000..3d961834ccb2 --- /dev/null +++ b/sdk/agricultureplatform/Azure.ResourceManager.AgriculturePlatform/src/Generated/Internal/ChangeTrackingList.cs @@ -0,0 +1,153 @@ +// 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.Linq; + +namespace Azure.ResourceManager.AgriculturePlatform +{ + internal class ChangeTrackingList : IList, IReadOnlyList + { + private IList _innerList; + + public ChangeTrackingList() + { + } + + public ChangeTrackingList(IList innerList) + { + if (innerList != null) + { + _innerList = innerList; + } + } + + public ChangeTrackingList(IReadOnlyList innerList) + { + if (innerList != null) + { + _innerList = innerList.ToList(); + } + } + + public bool IsUndefined => _innerList == null; + + public int Count => IsUndefined ? 0 : EnsureList().Count; + + public bool IsReadOnly => IsUndefined ? false : EnsureList().IsReadOnly; + + public T this[int index] + { + get + { + if (IsUndefined) + { + throw new ArgumentOutOfRangeException(nameof(index)); + } + return EnsureList()[index]; + } + set + { + if (IsUndefined) + { + throw new ArgumentOutOfRangeException(nameof(index)); + } + EnsureList()[index] = value; + } + } + + public void Reset() + { + _innerList = null; + } + + public IEnumerator GetEnumerator() + { + if (IsUndefined) + { + IEnumerator enumerateEmpty() + { + yield break; + } + return enumerateEmpty(); + } + return EnsureList().GetEnumerator(); + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetEnumerator(); + } + + public void Add(T item) + { + EnsureList().Add(item); + } + + public void Clear() + { + EnsureList().Clear(); + } + + public bool Contains(T item) + { + if (IsUndefined) + { + return false; + } + return EnsureList().Contains(item); + } + + public void CopyTo(T[] array, int arrayIndex) + { + if (IsUndefined) + { + return; + } + EnsureList().CopyTo(array, arrayIndex); + } + + public bool Remove(T item) + { + if (IsUndefined) + { + return false; + } + return EnsureList().Remove(item); + } + + public int IndexOf(T item) + { + if (IsUndefined) + { + return -1; + } + return EnsureList().IndexOf(item); + } + + public void Insert(int index, T item) + { + EnsureList().Insert(index, item); + } + + public void RemoveAt(int index) + { + if (IsUndefined) + { + throw new ArgumentOutOfRangeException(nameof(index)); + } + EnsureList().RemoveAt(index); + } + + public IList EnsureList() + { + return _innerList ??= new List(); + } + } +} diff --git a/sdk/agricultureplatform/Azure.ResourceManager.AgriculturePlatform/src/Generated/Internal/ModelSerializationExtensions.cs b/sdk/agricultureplatform/Azure.ResourceManager.AgriculturePlatform/src/Generated/Internal/ModelSerializationExtensions.cs new file mode 100644 index 000000000000..f5b82d28d75e --- /dev/null +++ b/sdk/agricultureplatform/Azure.ResourceManager.AgriculturePlatform/src/Generated/Internal/ModelSerializationExtensions.cs @@ -0,0 +1,398 @@ +// 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.Diagnostics; +using System.Globalization; +using System.Text.Json; +using System.Xml; +using Azure.Core; + +namespace Azure.ResourceManager.AgriculturePlatform +{ + internal static class ModelSerializationExtensions + { + internal static readonly ModelReaderWriterOptions WireOptions = new ModelReaderWriterOptions("W"); + + public static object GetObject(this JsonElement element) + { + switch (element.ValueKind) + { + case JsonValueKind.String: + return element.GetString(); + case JsonValueKind.Number: + if (element.TryGetInt32(out int intValue)) + { + return intValue; + } + if (element.TryGetInt64(out long longValue)) + { + return longValue; + } + return element.GetDouble(); + case JsonValueKind.True: + return true; + case JsonValueKind.False: + return false; + case JsonValueKind.Undefined: + case JsonValueKind.Null: + return null; + case JsonValueKind.Object: + var dictionary = new Dictionary(); + foreach (var jsonProperty in element.EnumerateObject()) + { + dictionary.Add(jsonProperty.Name, jsonProperty.Value.GetObject()); + } + return dictionary; + case JsonValueKind.Array: + var list = new List(); + foreach (var item in element.EnumerateArray()) + { + list.Add(item.GetObject()); + } + return list.ToArray(); + default: + throw new NotSupportedException($"Not supported value kind {element.ValueKind}"); + } + } + + public static byte[] GetBytesFromBase64(this JsonElement element, string format) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + + return format switch + { + "U" => TypeFormatters.FromBase64UrlString(element.GetRequiredString()), + "D" => element.GetBytesFromBase64(), + _ => throw new ArgumentException($"Format is not supported: '{format}'", nameof(format)) + }; + } + + public static DateTimeOffset GetDateTimeOffset(this JsonElement element, string format) => format switch + { + "U" when element.ValueKind == JsonValueKind.Number => DateTimeOffset.FromUnixTimeSeconds(element.GetInt64()), + _ => TypeFormatters.ParseDateTimeOffset(element.GetString(), format) + }; + + public static TimeSpan GetTimeSpan(this JsonElement element, string format) => TypeFormatters.ParseTimeSpan(element.GetString(), format); + + public static char GetChar(this JsonElement element) + { + if (element.ValueKind == JsonValueKind.String) + { + var text = element.GetString(); + if (text == null || text.Length != 1) + { + throw new NotSupportedException($"Cannot convert \"{text}\" to a char"); + } + return text[0]; + } + else + { + throw new NotSupportedException($"Cannot convert {element.ValueKind} to a char"); + } + } + + [Conditional("DEBUG")] + public static void ThrowNonNullablePropertyIsNull(this JsonProperty property) + { + throw new JsonException($"A property '{property.Name}' defined as non-nullable but received as null from the service. This exception only happens in DEBUG builds of the library and would be ignored in the release build"); + } + + public static string GetRequiredString(this JsonElement element) + { + var value = element.GetString(); + if (value == null) + { + throw new InvalidOperationException($"The requested operation requires an element of type 'String', but the target element has type '{element.ValueKind}'."); + } + return value; + } + + public static void WriteStringValue(this Utf8JsonWriter writer, DateTimeOffset value, string format) + { + writer.WriteStringValue(TypeFormatters.ToString(value, format)); + } + + public static void WriteStringValue(this Utf8JsonWriter writer, DateTime value, string format) + { + writer.WriteStringValue(TypeFormatters.ToString(value, format)); + } + + public static void WriteStringValue(this Utf8JsonWriter writer, TimeSpan value, string format) + { + writer.WriteStringValue(TypeFormatters.ToString(value, format)); + } + + public static void WriteStringValue(this Utf8JsonWriter writer, char value) + { + writer.WriteStringValue(value.ToString(CultureInfo.InvariantCulture)); + } + + public static void WriteBase64StringValue(this Utf8JsonWriter writer, byte[] value, string format) + { + if (value == null) + { + writer.WriteNullValue(); + return; + } + switch (format) + { + case "U": + writer.WriteStringValue(TypeFormatters.ToBase64UrlString(value)); + break; + case "D": + writer.WriteBase64StringValue(value); + break; + default: + throw new ArgumentException($"Format is not supported: '{format}'", nameof(format)); + } + } + + public static void WriteNumberValue(this Utf8JsonWriter writer, DateTimeOffset value, string format) + { + if (format != "U") + { + throw new ArgumentOutOfRangeException(nameof(format), "Only 'U' format is supported when writing a DateTimeOffset as a Number."); + } + writer.WriteNumberValue(value.ToUnixTimeSeconds()); + } + + public static void WriteObjectValue(this Utf8JsonWriter writer, T value, ModelReaderWriterOptions options = null) + { + switch (value) + { + case null: + writer.WriteNullValue(); + break; + case IJsonModel jsonModel: + jsonModel.Write(writer, options ?? WireOptions); + break; + case IUtf8JsonSerializable serializable: + serializable.Write(writer); + break; + case byte[] bytes: + writer.WriteBase64StringValue(bytes); + break; + case BinaryData bytes0: + writer.WriteBase64StringValue(bytes0); + break; + case JsonElement json: + json.WriteTo(writer); + break; + case int i: + writer.WriteNumberValue(i); + break; + case decimal d: + writer.WriteNumberValue(d); + break; + case double d0: + if (double.IsNaN(d0)) + { + writer.WriteStringValue("NaN"); + } + else + { + writer.WriteNumberValue(d0); + } + break; + case float f: + writer.WriteNumberValue(f); + break; + case long l: + writer.WriteNumberValue(l); + break; + case string s: + writer.WriteStringValue(s); + break; + case bool b: + writer.WriteBooleanValue(b); + break; + case Guid g: + writer.WriteStringValue(g); + break; + case DateTimeOffset dateTimeOffset: + writer.WriteStringValue(dateTimeOffset, "O"); + break; + case DateTime dateTime: + writer.WriteStringValue(dateTime, "O"); + break; + case IEnumerable> enumerable: + writer.WriteStartObject(); + foreach (var pair in enumerable) + { + writer.WritePropertyName(pair.Key); + writer.WriteObjectValue(pair.Value, options); + } + writer.WriteEndObject(); + break; + case IEnumerable objectEnumerable: + writer.WriteStartArray(); + foreach (var item in objectEnumerable) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + break; + case TimeSpan timeSpan: + writer.WriteStringValue(timeSpan, "P"); + break; + default: + throw new NotSupportedException($"Not supported type {value.GetType()}"); + } + } + + public static void WriteObjectValue(this Utf8JsonWriter writer, object value, ModelReaderWriterOptions options = null) + { + writer.WriteObjectValue(value, options); + } + + internal static class TypeFormatters + { + private const string RoundtripZFormat = "yyyy-MM-ddTHH:mm:ss.fffffffZ"; + public const string DefaultNumberFormat = "G"; + + public static string ToString(bool value) => value ? "true" : "false"; + + public static string ToString(DateTime value, string format) => value.Kind switch + { + DateTimeKind.Utc => ToString((DateTimeOffset)value, format), + _ => throw new NotSupportedException($"DateTime {value} has a Kind of {value.Kind}. Azure SDK requires it to be UTC. You can call DateTime.SpecifyKind to change Kind property value to DateTimeKind.Utc.") + }; + + public static string ToString(DateTimeOffset value, string format) => format switch + { + "D" => value.ToString("yyyy-MM-dd", CultureInfo.InvariantCulture), + "U" => value.ToUnixTimeSeconds().ToString(CultureInfo.InvariantCulture), + "O" => value.ToUniversalTime().ToString(RoundtripZFormat, CultureInfo.InvariantCulture), + "o" => value.ToUniversalTime().ToString(RoundtripZFormat, CultureInfo.InvariantCulture), + "R" => value.ToString("r", CultureInfo.InvariantCulture), + _ => value.ToString(format, CultureInfo.InvariantCulture) + }; + + public static string ToString(TimeSpan value, string format) => format switch + { + "P" => XmlConvert.ToString(value), + _ => value.ToString(format, CultureInfo.InvariantCulture) + }; + + public static string ToString(byte[] value, string format) => format switch + { + "U" => ToBase64UrlString(value), + "D" => Convert.ToBase64String(value), + _ => throw new ArgumentException($"Format is not supported: '{format}'", nameof(format)) + }; + + public static string ToBase64UrlString(byte[] value) + { + int numWholeOrPartialInputBlocks = checked(value.Length + 2) / 3; + int size = checked(numWholeOrPartialInputBlocks * 4); + char[] output = new char[size]; + + int numBase64Chars = Convert.ToBase64CharArray(value, 0, value.Length, output, 0); + + int i = 0; + for (; i < numBase64Chars; i++) + { + char ch = output[i]; + if (ch == '+') + { + output[i] = '-'; + } + else + { + if (ch == '/') + { + output[i] = '_'; + } + else + { + if (ch == '=') + { + break; + } + } + } + } + + return new string(output, 0, i); + } + + public static byte[] FromBase64UrlString(string value) + { + int paddingCharsToAdd = (value.Length % 4) switch + { + 0 => 0, + 2 => 2, + 3 => 1, + _ => throw new InvalidOperationException("Malformed input") + }; + char[] output = new char[(value.Length + paddingCharsToAdd)]; + int i = 0; + for (; i < value.Length; i++) + { + char ch = value[i]; + if (ch == '-') + { + output[i] = '+'; + } + else + { + if (ch == '_') + { + output[i] = '/'; + } + else + { + output[i] = ch; + } + } + } + + for (; i < output.Length; i++) + { + output[i] = '='; + } + + return Convert.FromBase64CharArray(output, 0, output.Length); + } + + public static DateTimeOffset ParseDateTimeOffset(string value, string format) => format switch + { + "U" => DateTimeOffset.FromUnixTimeSeconds(long.Parse(value, CultureInfo.InvariantCulture)), + _ => DateTimeOffset.Parse(value, CultureInfo.InvariantCulture, DateTimeStyles.AssumeUniversal) + }; + + public static TimeSpan ParseTimeSpan(string value, string format) => format switch + { + "P" => XmlConvert.ToTimeSpan(value), + _ => TimeSpan.ParseExact(value, format, CultureInfo.InvariantCulture) + }; + + public static string ConvertToString(object value, string format = null) => value switch + { + null => "null", + string s => s, + bool b => ToString(b), + int or float or double or long or decimal => ((IFormattable)value).ToString(DefaultNumberFormat, CultureInfo.InvariantCulture), + byte[] b0 when format != null => ToString(b0, format), + IEnumerable s0 => string.Join(",", s0), + DateTimeOffset dateTime when format != null => ToString(dateTime, format), + TimeSpan timeSpan when format != null => ToString(timeSpan, format), + TimeSpan timeSpan0 => XmlConvert.ToString(timeSpan0), + Guid guid => guid.ToString(), + BinaryData binaryData => ConvertToString(binaryData.ToArray(), format), + _ => value.ToString() + }; + } + } +} diff --git a/sdk/agricultureplatform/Azure.ResourceManager.AgriculturePlatform/src/Generated/Internal/Optional.cs b/sdk/agricultureplatform/Azure.ResourceManager.AgriculturePlatform/src/Generated/Internal/Optional.cs new file mode 100644 index 000000000000..edc449f09f8a --- /dev/null +++ b/sdk/agricultureplatform/Azure.ResourceManager.AgriculturePlatform/src/Generated/Internal/Optional.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; + +namespace Azure.ResourceManager.AgriculturePlatform +{ + internal static class Optional + { + public static bool IsCollectionDefined(IEnumerable collection) + { + return !(collection is ChangeTrackingList changeTrackingList && changeTrackingList.IsUndefined); + } + + public static bool IsCollectionDefined(IDictionary collection) + { + return !(collection is ChangeTrackingDictionary changeTrackingDictionary && changeTrackingDictionary.IsUndefined); + } + + public static bool IsCollectionDefined(IReadOnlyDictionary collection) + { + return !(collection is ChangeTrackingDictionary changeTrackingDictionary && changeTrackingDictionary.IsUndefined); + } + + public static bool IsDefined(T? value) + where T : struct + { + return value.HasValue; + } + + public static bool IsDefined(object value) + { + return value != null; + } + + public static bool IsDefined(JsonElement value) + { + return value.ValueKind != JsonValueKind.Undefined; + } + + public static bool IsDefined(string value) + { + return value != null; + } + } +} diff --git a/sdk/agricultureplatform/Azure.ResourceManager.AgriculturePlatform/src/Generated/Internal/Utf8JsonRequestContent.cs b/sdk/agricultureplatform/Azure.ResourceManager.AgriculturePlatform/src/Generated/Internal/Utf8JsonRequestContent.cs new file mode 100644 index 000000000000..829294f41cb2 --- /dev/null +++ b/sdk/agricultureplatform/Azure.ResourceManager.AgriculturePlatform/src/Generated/Internal/Utf8JsonRequestContent.cs @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.IO; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; + +namespace Azure.ResourceManager.AgriculturePlatform +{ + internal class Utf8JsonRequestContent : RequestContent + { + private readonly MemoryStream _stream; + private readonly RequestContent _content; + + public Utf8JsonRequestContent() + { + _stream = new MemoryStream(); + _content = Create(_stream); + JsonWriter = new Utf8JsonWriter(_stream); + } + + public Utf8JsonWriter JsonWriter { get; } + + public override async Task WriteToAsync(Stream stream, CancellationToken cancellationToken = default) + { + await JsonWriter.FlushAsync().ConfigureAwait(false); + await _content.WriteToAsync(stream, cancellationToken).ConfigureAwait(false); + } + + public override void WriteTo(Stream stream, CancellationToken cancellationToken = default) + { + JsonWriter.Flush(); + _content.WriteTo(stream, cancellationToken); + } + + public override bool TryComputeLength(out long length) + { + length = JsonWriter.BytesCommitted + JsonWriter.BytesPending; + return true; + } + + public override void Dispose() + { + JsonWriter.Dispose(); + _content.Dispose(); + _stream.Dispose(); + } + } +} diff --git a/sdk/agricultureplatform/Azure.ResourceManager.AgriculturePlatform/src/Generated/LongRunningOperation/AgriServiceResourceOperationSource.cs b/sdk/agricultureplatform/Azure.ResourceManager.AgriculturePlatform/src/Generated/LongRunningOperation/AgriServiceResourceOperationSource.cs new file mode 100644 index 000000000000..54bd815dce3c --- /dev/null +++ b/sdk/agricultureplatform/Azure.ResourceManager.AgriculturePlatform/src/Generated/LongRunningOperation/AgriServiceResourceOperationSource.cs @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; + +namespace Azure.ResourceManager.AgriculturePlatform +{ + internal class AgriServiceResourceOperationSource : IOperationSource + { + private readonly ArmClient _client; + + internal AgriServiceResourceOperationSource(ArmClient client) + { + _client = client; + } + + AgriServiceResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) + { + using var document = JsonDocument.Parse(response.ContentStream); + var data = AgriServiceResourceData.DeserializeAgriServiceResourceData(document.RootElement); + return new AgriServiceResource(_client, data); + } + + async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) + { + using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false); + var data = AgriServiceResourceData.DeserializeAgriServiceResourceData(document.RootElement); + return new AgriServiceResource(_client, data); + } + } +} diff --git a/sdk/agricultureplatform/Azure.ResourceManager.AgriculturePlatform/src/Generated/LongRunningOperation/AgriculturePlatformArmOperation.cs b/sdk/agricultureplatform/Azure.ResourceManager.AgriculturePlatform/src/Generated/LongRunningOperation/AgriculturePlatformArmOperation.cs new file mode 100644 index 000000000000..4a50bda8752b --- /dev/null +++ b/sdk/agricultureplatform/Azure.ResourceManager.AgriculturePlatform/src/Generated/LongRunningOperation/AgriculturePlatformArmOperation.cs @@ -0,0 +1,94 @@ +// 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.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.AgriculturePlatform +{ +#pragma warning disable SA1649 // File name should match first type name + internal class AgriculturePlatformArmOperation : ArmOperation +#pragma warning restore SA1649 // File name should match first type name + { + private readonly OperationInternal _operation; + private readonly RehydrationToken? _completeRehydrationToken; + private readonly NextLinkOperationImplementation _nextLinkOperation; + private readonly string _operationId; + + /// Initializes a new instance of AgriculturePlatformArmOperation for mocking. + protected AgriculturePlatformArmOperation() + { + } + + internal AgriculturePlatformArmOperation(Response response, RehydrationToken? rehydrationToken = null) + { + _operation = OperationInternal.Succeeded(response); + _completeRehydrationToken = rehydrationToken; + _operationId = GetOperationId(rehydrationToken); + } + + internal AgriculturePlatformArmOperation(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, Request request, Response response, OperationFinalStateVia finalStateVia, bool skipApiVersionOverride = false, string apiVersionOverrideValue = null) + { + var nextLinkOperation = NextLinkOperationImplementation.Create(pipeline, request.Method, request.Uri.ToUri(), response, finalStateVia, skipApiVersionOverride, apiVersionOverrideValue); + if (nextLinkOperation is NextLinkOperationImplementation nextLinkOperationValue) + { + _nextLinkOperation = nextLinkOperationValue; + _operationId = _nextLinkOperation.OperationId; + } + else + { + _completeRehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(request.Method, request.Uri.ToUri(), response, finalStateVia); + _operationId = GetOperationId(_completeRehydrationToken); + } + _operation = new OperationInternal(nextLinkOperation, clientDiagnostics, response, "AgriculturePlatformArmOperation", fallbackStrategy: new SequentialDelayStrategy()); + } + + private string GetOperationId(RehydrationToken? rehydrationToken) + { + if (rehydrationToken is null) + { + return null; + } + var lroDetails = ModelReaderWriter.Write(rehydrationToken, ModelReaderWriterOptions.Json).ToObjectFromJson>(); + return lroDetails["id"]; + } + /// + public override string Id => _operationId ?? NextLinkOperationImplementation.NotSet; + + /// + public override RehydrationToken? GetRehydrationToken() => _nextLinkOperation?.GetRehydrationToken() ?? _completeRehydrationToken; + + /// + public override bool HasCompleted => _operation.HasCompleted; + + /// + public override Response GetRawResponse() => _operation.RawResponse; + + /// + public override Response UpdateStatus(CancellationToken cancellationToken = default) => _operation.UpdateStatus(cancellationToken); + + /// + public override ValueTask UpdateStatusAsync(CancellationToken cancellationToken = default) => _operation.UpdateStatusAsync(cancellationToken); + + /// + public override Response WaitForCompletionResponse(CancellationToken cancellationToken = default) => _operation.WaitForCompletionResponse(cancellationToken); + + /// + public override Response WaitForCompletionResponse(TimeSpan pollingInterval, CancellationToken cancellationToken = default) => _operation.WaitForCompletionResponse(pollingInterval, cancellationToken); + + /// + public override ValueTask WaitForCompletionResponseAsync(CancellationToken cancellationToken = default) => _operation.WaitForCompletionResponseAsync(cancellationToken); + + /// + public override ValueTask WaitForCompletionResponseAsync(TimeSpan pollingInterval, CancellationToken cancellationToken = default) => _operation.WaitForCompletionResponseAsync(pollingInterval, cancellationToken); + } +} diff --git a/sdk/agricultureplatform/Azure.ResourceManager.AgriculturePlatform/src/Generated/LongRunningOperation/AgriculturePlatformArmOperationOfT.cs b/sdk/agricultureplatform/Azure.ResourceManager.AgriculturePlatform/src/Generated/LongRunningOperation/AgriculturePlatformArmOperationOfT.cs new file mode 100644 index 000000000000..29ae9cc5c8ec --- /dev/null +++ b/sdk/agricultureplatform/Azure.ResourceManager.AgriculturePlatform/src/Generated/LongRunningOperation/AgriculturePlatformArmOperationOfT.cs @@ -0,0 +1,100 @@ +// 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.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.AgriculturePlatform +{ +#pragma warning disable SA1649 // File name should match first type name + internal class AgriculturePlatformArmOperation : ArmOperation +#pragma warning restore SA1649 // File name should match first type name + { + private readonly OperationInternal _operation; + private readonly RehydrationToken? _completeRehydrationToken; + private readonly NextLinkOperationImplementation _nextLinkOperation; + private readonly string _operationId; + + /// Initializes a new instance of AgriculturePlatformArmOperation for mocking. + protected AgriculturePlatformArmOperation() + { + } + + internal AgriculturePlatformArmOperation(Response response, RehydrationToken? rehydrationToken = null) + { + _operation = OperationInternal.Succeeded(response.GetRawResponse(), response.Value); + _completeRehydrationToken = rehydrationToken; + _operationId = GetOperationId(rehydrationToken); + } + + internal AgriculturePlatformArmOperation(IOperationSource source, ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, Request request, Response response, OperationFinalStateVia finalStateVia, bool skipApiVersionOverride = false, string apiVersionOverrideValue = null) + { + var nextLinkOperation = NextLinkOperationImplementation.Create(pipeline, request.Method, request.Uri.ToUri(), response, finalStateVia, skipApiVersionOverride, apiVersionOverrideValue); + if (nextLinkOperation is NextLinkOperationImplementation nextLinkOperationValue) + { + _nextLinkOperation = nextLinkOperationValue; + _operationId = _nextLinkOperation.OperationId; + } + else + { + _completeRehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(request.Method, request.Uri.ToUri(), response, finalStateVia); + _operationId = GetOperationId(_completeRehydrationToken); + } + _operation = new OperationInternal(NextLinkOperationImplementation.Create(source, nextLinkOperation), clientDiagnostics, response, "AgriculturePlatformArmOperation", fallbackStrategy: new SequentialDelayStrategy()); + } + + private string GetOperationId(RehydrationToken? rehydrationToken) + { + if (rehydrationToken is null) + { + return null; + } + var lroDetails = ModelReaderWriter.Write(rehydrationToken, ModelReaderWriterOptions.Json).ToObjectFromJson>(); + return lroDetails["id"]; + } + /// + public override string Id => _operationId ?? NextLinkOperationImplementation.NotSet; + + /// + public override RehydrationToken? GetRehydrationToken() => _nextLinkOperation?.GetRehydrationToken() ?? _completeRehydrationToken; + + /// + public override T Value => _operation.Value; + + /// + public override bool HasValue => _operation.HasValue; + + /// + public override bool HasCompleted => _operation.HasCompleted; + + /// + public override Response GetRawResponse() => _operation.RawResponse; + + /// + public override Response UpdateStatus(CancellationToken cancellationToken = default) => _operation.UpdateStatus(cancellationToken); + + /// + public override ValueTask UpdateStatusAsync(CancellationToken cancellationToken = default) => _operation.UpdateStatusAsync(cancellationToken); + + /// + public override Response WaitForCompletion(CancellationToken cancellationToken = default) => _operation.WaitForCompletion(cancellationToken); + + /// + public override Response WaitForCompletion(TimeSpan pollingInterval, CancellationToken cancellationToken = default) => _operation.WaitForCompletion(pollingInterval, cancellationToken); + + /// + public override ValueTask> WaitForCompletionAsync(CancellationToken cancellationToken = default) => _operation.WaitForCompletionAsync(cancellationToken); + + /// + public override ValueTask> WaitForCompletionAsync(TimeSpan pollingInterval, CancellationToken cancellationToken = default) => _operation.WaitForCompletionAsync(pollingInterval, cancellationToken); + } +} diff --git a/sdk/agricultureplatform/Azure.ResourceManager.AgriculturePlatform/src/Generated/Models/AgriServiceConfig.Serialization.cs b/sdk/agricultureplatform/Azure.ResourceManager.AgriculturePlatform/src/Generated/Models/AgriServiceConfig.Serialization.cs new file mode 100644 index 000000000000..f3247e7fd907 --- /dev/null +++ b/sdk/agricultureplatform/Azure.ResourceManager.AgriculturePlatform/src/Generated/Models/AgriServiceConfig.Serialization.cs @@ -0,0 +1,203 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.AgriculturePlatform.Models +{ + public partial class AgriServiceConfig : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AgriServiceConfig)} does not support writing '{format}' format."); + } + + if (options.Format != "W" && Optional.IsDefined(InstanceUri)) + { + writer.WritePropertyName("instanceUri"u8); + writer.WriteStringValue(InstanceUri); + } + if (options.Format != "W" && Optional.IsDefined(Version)) + { + writer.WritePropertyName("version"u8); + writer.WriteStringValue(Version); + } + if (options.Format != "W" && Optional.IsDefined(AppServiceResourceId)) + { + writer.WritePropertyName("appServiceResourceId"u8); + writer.WriteStringValue(AppServiceResourceId); + } + if (options.Format != "W" && Optional.IsDefined(CosmosDbResourceId)) + { + writer.WritePropertyName("cosmosDbResourceId"u8); + writer.WriteStringValue(CosmosDbResourceId); + } + if (options.Format != "W" && Optional.IsDefined(StorageAccountResourceId)) + { + writer.WritePropertyName("storageAccountResourceId"u8); + writer.WriteStringValue(StorageAccountResourceId); + } + if (options.Format != "W" && Optional.IsDefined(KeyVaultResourceId)) + { + writer.WritePropertyName("keyVaultResourceId"u8); + writer.WriteStringValue(KeyVaultResourceId); + } + if (options.Format != "W" && Optional.IsDefined(RedisCacheResourceId)) + { + writer.WritePropertyName("redisCacheResourceId"u8); + writer.WriteStringValue(RedisCacheResourceId); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + AgriServiceConfig 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(AgriServiceConfig)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAgriServiceConfig(document.RootElement, options); + } + + internal static AgriServiceConfig DeserializeAgriServiceConfig(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string instanceUri = default; + string version = default; + string appServiceResourceId = default; + string cosmosDbResourceId = default; + string storageAccountResourceId = default; + string keyVaultResourceId = default; + string redisCacheResourceId = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("instanceUri"u8)) + { + instanceUri = property.Value.GetString(); + continue; + } + if (property.NameEquals("version"u8)) + { + version = property.Value.GetString(); + continue; + } + if (property.NameEquals("appServiceResourceId"u8)) + { + appServiceResourceId = property.Value.GetString(); + continue; + } + if (property.NameEquals("cosmosDbResourceId"u8)) + { + cosmosDbResourceId = property.Value.GetString(); + continue; + } + if (property.NameEquals("storageAccountResourceId"u8)) + { + storageAccountResourceId = property.Value.GetString(); + continue; + } + if (property.NameEquals("keyVaultResourceId"u8)) + { + keyVaultResourceId = property.Value.GetString(); + continue; + } + if (property.NameEquals("redisCacheResourceId"u8)) + { + redisCacheResourceId = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new AgriServiceConfig( + instanceUri, + version, + appServiceResourceId, + cosmosDbResourceId, + storageAccountResourceId, + keyVaultResourceId, + redisCacheResourceId, + 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(AgriServiceConfig)} does not support writing '{options.Format}' format."); + } + } + + AgriServiceConfig IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeAgriServiceConfig(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(AgriServiceConfig)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/agricultureplatform/Azure.ResourceManager.AgriculturePlatform/src/Generated/Models/AgriServiceConfig.cs b/sdk/agricultureplatform/Azure.ResourceManager.AgriculturePlatform/src/Generated/Models/AgriServiceConfig.cs new file mode 100644 index 000000000000..46006fa91957 --- /dev/null +++ b/sdk/agricultureplatform/Azure.ResourceManager.AgriculturePlatform/src/Generated/Models/AgriServiceConfig.cs @@ -0,0 +1,89 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.AgriculturePlatform.Models +{ + /// Config of the AgriService resource instance. + public partial class AgriServiceConfig + { + /// + /// 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 AgriServiceConfig() + { + } + + /// Initializes a new instance of . + /// Instance URI of the AgriService instance. + /// Version of AgriService instance. + /// App service resource Id. + /// Cosmos Db resource Id. + /// Storage account resource Id. + /// Key vault resource Id. + /// Redis cache resource Id. + /// Keeps track of any properties unknown to the library. + internal AgriServiceConfig(string instanceUri, string version, string appServiceResourceId, string cosmosDbResourceId, string storageAccountResourceId, string keyVaultResourceId, string redisCacheResourceId, IDictionary serializedAdditionalRawData) + { + InstanceUri = instanceUri; + Version = version; + AppServiceResourceId = appServiceResourceId; + CosmosDbResourceId = cosmosDbResourceId; + StorageAccountResourceId = storageAccountResourceId; + KeyVaultResourceId = keyVaultResourceId; + RedisCacheResourceId = redisCacheResourceId; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Instance URI of the AgriService instance. + public string InstanceUri { get; } + /// Version of AgriService instance. + public string Version { get; } + /// App service resource Id. + public string AppServiceResourceId { get; } + /// Cosmos Db resource Id. + public string CosmosDbResourceId { get; } + /// Storage account resource Id. + public string StorageAccountResourceId { get; } + /// Key vault resource Id. + public string KeyVaultResourceId { get; } + /// Redis cache resource Id. + public string RedisCacheResourceId { get; } + } +} diff --git a/sdk/agricultureplatform/Azure.ResourceManager.AgriculturePlatform/src/Generated/Models/AgriServiceResourceListResult.Serialization.cs b/sdk/agricultureplatform/Azure.ResourceManager.AgriculturePlatform/src/Generated/Models/AgriServiceResourceListResult.Serialization.cs new file mode 100644 index 000000000000..133cfd29df12 --- /dev/null +++ b/sdk/agricultureplatform/Azure.ResourceManager.AgriculturePlatform/src/Generated/Models/AgriServiceResourceListResult.Serialization.cs @@ -0,0 +1,151 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.AgriculturePlatform.Models +{ + internal partial class AgriServiceResourceListResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AgriServiceResourceListResult)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var item in Value) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + if (Optional.IsDefined(NextLink)) + { + writer.WritePropertyName("nextLink"u8); + writer.WriteStringValue(NextLink.AbsoluteUri); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + AgriServiceResourceListResult 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(AgriServiceResourceListResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAgriServiceResourceListResult(document.RootElement, options); + } + + internal static AgriServiceResourceListResult DeserializeAgriServiceResourceListResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IReadOnlyList value = default; + Uri nextLink = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(AgriServiceResourceData.DeserializeAgriServiceResourceData(item, options)); + } + value = array; + continue; + } + if (property.NameEquals("nextLink"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + nextLink = new Uri(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new AgriServiceResourceListResult(value, nextLink, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(AgriServiceResourceListResult)} does not support writing '{options.Format}' format."); + } + } + + AgriServiceResourceListResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeAgriServiceResourceListResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(AgriServiceResourceListResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/agricultureplatform/Azure.ResourceManager.AgriculturePlatform/src/Generated/Models/AgriServiceResourceListResult.cs b/sdk/agricultureplatform/Azure.ResourceManager.AgriculturePlatform/src/Generated/Models/AgriServiceResourceListResult.cs new file mode 100644 index 000000000000..71dde4ca7105 --- /dev/null +++ b/sdk/agricultureplatform/Azure.ResourceManager.AgriculturePlatform/src/Generated/Models/AgriServiceResourceListResult.cs @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.ResourceManager.AgriculturePlatform.Models +{ + /// The response of a AgriServiceResource list operation. + internal partial class AgriServiceResourceListResult + { + /// + /// 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 AgriServiceResource items on this page. + /// is null. + internal AgriServiceResourceListResult(IEnumerable value) + { + Argument.AssertNotNull(value, nameof(value)); + + Value = value.ToList(); + } + + /// Initializes a new instance of . + /// The AgriServiceResource items on this page. + /// The link to the next page of items. + /// Keeps track of any properties unknown to the library. + internal AgriServiceResourceListResult(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) + { + Value = value; + NextLink = nextLink; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal AgriServiceResourceListResult() + { + } + + /// The AgriServiceResource items on this page. + public IReadOnlyList Value { get; } + /// The link to the next page of items. + public Uri NextLink { get; } + } +} diff --git a/sdk/agricultureplatform/Azure.ResourceManager.AgriculturePlatform/src/Generated/Models/AgriServiceResourcePatch.Serialization.cs b/sdk/agricultureplatform/Azure.ResourceManager.AgriculturePlatform/src/Generated/Models/AgriServiceResourcePatch.Serialization.cs new file mode 100644 index 000000000000..f13487f43c29 --- /dev/null +++ b/sdk/agricultureplatform/Azure.ResourceManager.AgriculturePlatform/src/Generated/Models/AgriServiceResourcePatch.Serialization.cs @@ -0,0 +1,192 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.AgriculturePlatform.Models +{ + public partial class AgriServiceResourcePatch : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AgriServiceResourcePatch)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(Identity)) + { + writer.WritePropertyName("identity"u8); + var serializeOptions = new JsonSerializerOptions { Converters = { new ManagedServiceIdentityTypeV3Converter() } }; + JsonSerializer.Serialize(writer, Identity, serializeOptions); + } + if (Optional.IsDefined(Sku)) + { + writer.WritePropertyName("sku"u8); + writer.WriteObjectValue(Sku, options); + } + if (Optional.IsCollectionDefined(Tags)) + { + writer.WritePropertyName("tags"u8); + writer.WriteStartObject(); + foreach (var item in Tags) + { + writer.WritePropertyName(item.Key); + writer.WriteStringValue(item.Value); + } + writer.WriteEndObject(); + } + if (Optional.IsDefined(Properties)) + { + writer.WritePropertyName("properties"u8); + writer.WriteObjectValue(Properties, options); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + AgriServiceResourcePatch 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(AgriServiceResourcePatch)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAgriServiceResourcePatch(document.RootElement, options); + } + + internal static AgriServiceResourcePatch DeserializeAgriServiceResourcePatch(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ManagedServiceIdentity identity = default; + AgriculturePlatformSku sku = default; + IDictionary tags = default; + AgriServiceResourceUpdateProperties properties = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + 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("sku"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + sku = AgriculturePlatformSku.DeserializeAgriculturePlatformSku(property.Value, options); + 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("properties"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + properties = AgriServiceResourceUpdateProperties.DeserializeAgriServiceResourceUpdateProperties(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new AgriServiceResourcePatch(identity, sku, tags ?? new ChangeTrackingDictionary(), 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(AgriServiceResourcePatch)} does not support writing '{options.Format}' format."); + } + } + + AgriServiceResourcePatch IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeAgriServiceResourcePatch(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(AgriServiceResourcePatch)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/agricultureplatform/Azure.ResourceManager.AgriculturePlatform/src/Generated/Models/AgriServiceResourcePatch.cs b/sdk/agricultureplatform/Azure.ResourceManager.AgriculturePlatform/src/Generated/Models/AgriServiceResourcePatch.cs new file mode 100644 index 000000000000..5cd7e2095d84 --- /dev/null +++ b/sdk/agricultureplatform/Azure.ResourceManager.AgriculturePlatform/src/Generated/Models/AgriServiceResourcePatch.cs @@ -0,0 +1,79 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.AgriculturePlatform.Models +{ + /// The type used for update operations of the AgriServiceResource. + public partial class AgriServiceResourcePatch + { + /// + /// 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 AgriServiceResourcePatch() + { + Tags = new ChangeTrackingDictionary(); + } + + /// Initializes a new instance of . + /// The managed service identities assigned to this resource. + /// The SKU (Stock Keeping Unit) assigned to this resource. + /// Resource tags. + /// The resource-specific properties for this resource. + /// Keeps track of any properties unknown to the library. + internal AgriServiceResourcePatch(ManagedServiceIdentity identity, AgriculturePlatformSku sku, IDictionary tags, AgriServiceResourceUpdateProperties properties, IDictionary serializedAdditionalRawData) + { + Identity = identity; + Sku = sku; + Tags = tags; + Properties = properties; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The managed service identities assigned to this resource. + public ManagedServiceIdentity Identity { get; set; } + /// The SKU (Stock Keeping Unit) assigned to this resource. + public AgriculturePlatformSku Sku { get; set; } + /// Resource tags. + public IDictionary Tags { get; } + /// The resource-specific properties for this resource. + public AgriServiceResourceUpdateProperties Properties { get; set; } + } +} diff --git a/sdk/agricultureplatform/Azure.ResourceManager.AgriculturePlatform/src/Generated/Models/AgriServiceResourceProperties.Serialization.cs b/sdk/agricultureplatform/Azure.ResourceManager.AgriculturePlatform/src/Generated/Models/AgriServiceResourceProperties.Serialization.cs new file mode 100644 index 000000000000..58ba404529d9 --- /dev/null +++ b/sdk/agricultureplatform/Azure.ResourceManager.AgriculturePlatform/src/Generated/Models/AgriServiceResourceProperties.Serialization.cs @@ -0,0 +1,219 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.AgriculturePlatform.Models +{ + public partial class AgriServiceResourceProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AgriServiceResourceProperties)} does not support writing '{format}' format."); + } + + if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) + { + writer.WritePropertyName("provisioningState"u8); + writer.WriteStringValue(ProvisioningState.Value.ToString()); + } + if (Optional.IsDefined(Config)) + { + writer.WritePropertyName("config"u8); + writer.WriteObjectValue(Config, options); + } + if (options.Format != "W" && Optional.IsDefined(ManagedOnBehalfOfConfiguration)) + { + writer.WritePropertyName("managedOnBehalfOfConfiguration"u8); + writer.WriteObjectValue(ManagedOnBehalfOfConfiguration, options); + } + if (Optional.IsCollectionDefined(DataConnectorCredentials)) + { + writer.WritePropertyName("dataConnectorCredentials"u8); + writer.WriteStartArray(); + foreach (var item in DataConnectorCredentials) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(InstalledSolutions)) + { + writer.WritePropertyName("installedSolutions"u8); + writer.WriteStartArray(); + foreach (var item in InstalledSolutions) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + AgriServiceResourceProperties 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(AgriServiceResourceProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAgriServiceResourceProperties(document.RootElement, options); + } + + internal static AgriServiceResourceProperties DeserializeAgriServiceResourceProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ProvisioningState? provisioningState = default; + AgriServiceConfig config = default; + ManagedOnBehalfOfConfiguration managedOnBehalfOfConfiguration = default; + IList dataConnectorCredentials = default; + IList installedSolutions = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("provisioningState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + provisioningState = new ProvisioningState(property.Value.GetString()); + continue; + } + if (property.NameEquals("config"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + config = AgriServiceConfig.DeserializeAgriServiceConfig(property.Value, options); + continue; + } + if (property.NameEquals("managedOnBehalfOfConfiguration"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + managedOnBehalfOfConfiguration = ManagedOnBehalfOfConfiguration.DeserializeManagedOnBehalfOfConfiguration(property.Value, options); + continue; + } + if (property.NameEquals("dataConnectorCredentials"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(DataConnectorCredentialMap.DeserializeDataConnectorCredentialMap(item, options)); + } + dataConnectorCredentials = array; + continue; + } + if (property.NameEquals("installedSolutions"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(InstalledSolutionMap.DeserializeInstalledSolutionMap(item, options)); + } + installedSolutions = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new AgriServiceResourceProperties( + provisioningState, + config, + managedOnBehalfOfConfiguration, + dataConnectorCredentials ?? new ChangeTrackingList(), + installedSolutions ?? new ChangeTrackingList(), + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(AgriServiceResourceProperties)} does not support writing '{options.Format}' format."); + } + } + + AgriServiceResourceProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeAgriServiceResourceProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(AgriServiceResourceProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/agricultureplatform/Azure.ResourceManager.AgriculturePlatform/src/Generated/Models/AgriServiceResourceProperties.cs b/sdk/agricultureplatform/Azure.ResourceManager.AgriculturePlatform/src/Generated/Models/AgriServiceResourceProperties.cs new file mode 100644 index 000000000000..306cb33b0b8c --- /dev/null +++ b/sdk/agricultureplatform/Azure.ResourceManager.AgriculturePlatform/src/Generated/Models/AgriServiceResourceProperties.cs @@ -0,0 +1,90 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.ResourceManager.Resources.Models; + +namespace Azure.ResourceManager.AgriculturePlatform.Models +{ + /// Details of the Agriculture AgriDataManager. + public partial class AgriServiceResourceProperties + { + /// + /// 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 AgriServiceResourceProperties() + { + DataConnectorCredentials = new ChangeTrackingList(); + InstalledSolutions = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// The status of the last operation. + /// Config of the AgriService instance. + /// Managed On Behalf Of Configuration. + /// Data connector credentials of AgriService instance. + /// AgriService installed solutions. + /// Keeps track of any properties unknown to the library. + internal AgriServiceResourceProperties(ProvisioningState? provisioningState, AgriServiceConfig config, ManagedOnBehalfOfConfiguration managedOnBehalfOfConfiguration, IList dataConnectorCredentials, IList installedSolutions, IDictionary serializedAdditionalRawData) + { + ProvisioningState = provisioningState; + Config = config; + ManagedOnBehalfOfConfiguration = managedOnBehalfOfConfiguration; + DataConnectorCredentials = dataConnectorCredentials; + InstalledSolutions = installedSolutions; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The status of the last operation. + public ProvisioningState? ProvisioningState { get; } + /// Config of the AgriService instance. + public AgriServiceConfig Config { get; set; } + /// Managed On Behalf Of Configuration. + internal ManagedOnBehalfOfConfiguration ManagedOnBehalfOfConfiguration { get; } + /// Associated MoboBrokerResources. + public IReadOnlyList ManagedOnBehalfOfMoboBrokerResources + { + get => ManagedOnBehalfOfConfiguration?.MoboBrokerResources; + } + + /// Data connector credentials of AgriService instance. + public IList DataConnectorCredentials { get; } + /// AgriService installed solutions. + public IList InstalledSolutions { get; } + } +} diff --git a/sdk/agricultureplatform/Azure.ResourceManager.AgriculturePlatform/src/Generated/Models/AgriServiceResourceUpdateProperties.Serialization.cs b/sdk/agricultureplatform/Azure.ResourceManager.AgriculturePlatform/src/Generated/Models/AgriServiceResourceUpdateProperties.Serialization.cs new file mode 100644 index 000000000000..b2361d9ff7e3 --- /dev/null +++ b/sdk/agricultureplatform/Azure.ResourceManager.AgriculturePlatform/src/Generated/Models/AgriServiceResourceUpdateProperties.Serialization.cs @@ -0,0 +1,183 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.AgriculturePlatform.Models +{ + public partial class AgriServiceResourceUpdateProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AgriServiceResourceUpdateProperties)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(Config)) + { + writer.WritePropertyName("config"u8); + writer.WriteObjectValue(Config, options); + } + if (Optional.IsCollectionDefined(DataConnectorCredentials)) + { + writer.WritePropertyName("dataConnectorCredentials"u8); + writer.WriteStartArray(); + foreach (var item in DataConnectorCredentials) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(InstalledSolutions)) + { + writer.WritePropertyName("installedSolutions"u8); + writer.WriteStartArray(); + foreach (var item in InstalledSolutions) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + AgriServiceResourceUpdateProperties 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(AgriServiceResourceUpdateProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAgriServiceResourceUpdateProperties(document.RootElement, options); + } + + internal static AgriServiceResourceUpdateProperties DeserializeAgriServiceResourceUpdateProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + AgriServiceConfig config = default; + IList dataConnectorCredentials = default; + IList installedSolutions = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("config"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + config = AgriServiceConfig.DeserializeAgriServiceConfig(property.Value, options); + continue; + } + if (property.NameEquals("dataConnectorCredentials"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(DataConnectorCredentialMap.DeserializeDataConnectorCredentialMap(item, options)); + } + dataConnectorCredentials = array; + continue; + } + if (property.NameEquals("installedSolutions"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(InstalledSolutionMap.DeserializeInstalledSolutionMap(item, options)); + } + installedSolutions = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new AgriServiceResourceUpdateProperties(config, dataConnectorCredentials ?? new ChangeTrackingList(), installedSolutions ?? new ChangeTrackingList(), serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(AgriServiceResourceUpdateProperties)} does not support writing '{options.Format}' format."); + } + } + + AgriServiceResourceUpdateProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeAgriServiceResourceUpdateProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(AgriServiceResourceUpdateProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/agricultureplatform/Azure.ResourceManager.AgriculturePlatform/src/Generated/Models/AgriServiceResourceUpdateProperties.cs b/sdk/agricultureplatform/Azure.ResourceManager.AgriculturePlatform/src/Generated/Models/AgriServiceResourceUpdateProperties.cs new file mode 100644 index 000000000000..e92065a9e3fb --- /dev/null +++ b/sdk/agricultureplatform/Azure.ResourceManager.AgriculturePlatform/src/Generated/Models/AgriServiceResourceUpdateProperties.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; + +namespace Azure.ResourceManager.AgriculturePlatform.Models +{ + /// The updatable properties of the AgriServiceResource. + public partial class AgriServiceResourceUpdateProperties + { + /// + /// 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 AgriServiceResourceUpdateProperties() + { + DataConnectorCredentials = new ChangeTrackingList(); + InstalledSolutions = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// Config of the AgriService instance. + /// Data connector credentials of AgriService instance. + /// AgriService installed solutions. + /// Keeps track of any properties unknown to the library. + internal AgriServiceResourceUpdateProperties(AgriServiceConfig config, IList dataConnectorCredentials, IList installedSolutions, IDictionary serializedAdditionalRawData) + { + Config = config; + DataConnectorCredentials = dataConnectorCredentials; + InstalledSolutions = installedSolutions; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Config of the AgriService instance. + public AgriServiceConfig Config { get; set; } + /// Data connector credentials of AgriService instance. + public IList DataConnectorCredentials { get; } + /// AgriService installed solutions. + public IList InstalledSolutions { get; } + } +} diff --git a/sdk/agricultureplatform/Azure.ResourceManager.AgriculturePlatform/src/Generated/Models/AgriculturePlatformSku.Serialization.cs b/sdk/agricultureplatform/Azure.ResourceManager.AgriculturePlatform/src/Generated/Models/AgriculturePlatformSku.Serialization.cs new file mode 100644 index 000000000000..ccc4205799e8 --- /dev/null +++ b/sdk/agricultureplatform/Azure.ResourceManager.AgriculturePlatform/src/Generated/Models/AgriculturePlatformSku.Serialization.cs @@ -0,0 +1,184 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.AgriculturePlatform.Models +{ + public partial class AgriculturePlatformSku : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AgriculturePlatformSku)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name); + if (Optional.IsDefined(Tier)) + { + writer.WritePropertyName("tier"u8); + writer.WriteStringValue(Tier.Value.ToSerialString()); + } + if (Optional.IsDefined(Size)) + { + writer.WritePropertyName("size"u8); + writer.WriteStringValue(Size); + } + if (Optional.IsDefined(Family)) + { + writer.WritePropertyName("family"u8); + writer.WriteStringValue(Family); + } + if (Optional.IsDefined(Capacity)) + { + writer.WritePropertyName("capacity"u8); + writer.WriteNumberValue(Capacity.Value); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + AgriculturePlatformSku 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(AgriculturePlatformSku)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAgriculturePlatformSku(document.RootElement, options); + } + + internal static AgriculturePlatformSku DeserializeAgriculturePlatformSku(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string name = default; + AgriculturePlatformSkuTier? tier = default; + string size = default; + string family = default; + int? capacity = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("tier"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + tier = property.Value.GetString().ToAgriculturePlatformSkuTier(); + continue; + } + if (property.NameEquals("size"u8)) + { + size = property.Value.GetString(); + continue; + } + if (property.NameEquals("family"u8)) + { + family = property.Value.GetString(); + continue; + } + if (property.NameEquals("capacity"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + capacity = property.Value.GetInt32(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new AgriculturePlatformSku( + name, + tier, + size, + family, + capacity, + 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(AgriculturePlatformSku)} does not support writing '{options.Format}' format."); + } + } + + AgriculturePlatformSku IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeAgriculturePlatformSku(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(AgriculturePlatformSku)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/agricultureplatform/Azure.ResourceManager.AgriculturePlatform/src/Generated/Models/AgriculturePlatformSku.cs b/sdk/agricultureplatform/Azure.ResourceManager.AgriculturePlatform/src/Generated/Models/AgriculturePlatformSku.cs new file mode 100644 index 000000000000..2d3161a91e82 --- /dev/null +++ b/sdk/agricultureplatform/Azure.ResourceManager.AgriculturePlatform/src/Generated/Models/AgriculturePlatformSku.cs @@ -0,0 +1,91 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.AgriculturePlatform.Models +{ + /// The resource model definition representing SKU. + public partial class AgriculturePlatformSku + { + /// + /// 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 name of the SKU. Ex - P3. It is typically a letter+number code. + /// is null. + public AgriculturePlatformSku(string name) + { + Argument.AssertNotNull(name, nameof(name)); + + Name = name; + } + + /// Initializes a new instance of . + /// The name of the SKU. Ex - P3. It is typically a letter+number code. + /// This field is required to be implemented by the Resource Provider if the service has more than one tier, but is not required on a PUT. + /// The SKU size. When the name field is the combination of tier and some other value, this would be the standalone code. + /// If the service has different generations of hardware, for the same SKU, then that can be captured here. + /// If the SKU supports scale out/in then the capacity integer should be included. If scale out/in is not possible for the resource this may be omitted. + /// Keeps track of any properties unknown to the library. + internal AgriculturePlatformSku(string name, AgriculturePlatformSkuTier? tier, string size, string family, int? capacity, IDictionary serializedAdditionalRawData) + { + Name = name; + Tier = tier; + Size = size; + Family = family; + Capacity = capacity; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal AgriculturePlatformSku() + { + } + + /// The name of the SKU. Ex - P3. It is typically a letter+number code. + public string Name { get; set; } + /// This field is required to be implemented by the Resource Provider if the service has more than one tier, but is not required on a PUT. + public AgriculturePlatformSkuTier? Tier { get; set; } + /// The SKU size. When the name field is the combination of tier and some other value, this would be the standalone code. + public string Size { get; set; } + /// If the service has different generations of hardware, for the same SKU, then that can be captured here. + public string Family { get; set; } + /// If the SKU supports scale out/in then the capacity integer should be included. If scale out/in is not possible for the resource this may be omitted. + public int? Capacity { get; set; } + } +} diff --git a/sdk/agricultureplatform/Azure.ResourceManager.AgriculturePlatform/src/Generated/Models/AgriculturePlatformSkuTier.Serialization.cs b/sdk/agricultureplatform/Azure.ResourceManager.AgriculturePlatform/src/Generated/Models/AgriculturePlatformSkuTier.Serialization.cs new file mode 100644 index 000000000000..69b2f10d444d --- /dev/null +++ b/sdk/agricultureplatform/Azure.ResourceManager.AgriculturePlatform/src/Generated/Models/AgriculturePlatformSkuTier.Serialization.cs @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Azure.ResourceManager.AgriculturePlatform.Models +{ + internal static partial class AgriculturePlatformSkuTierExtensions + { + public static string ToSerialString(this AgriculturePlatformSkuTier value) => value switch + { + AgriculturePlatformSkuTier.Free => "Free", + AgriculturePlatformSkuTier.Basic => "Basic", + AgriculturePlatformSkuTier.Standard => "Standard", + AgriculturePlatformSkuTier.Premium => "Premium", + _ => throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown AgriculturePlatformSkuTier value.") + }; + + public static AgriculturePlatformSkuTier ToAgriculturePlatformSkuTier(this string value) + { + if (StringComparer.OrdinalIgnoreCase.Equals(value, "Free")) return AgriculturePlatformSkuTier.Free; + if (StringComparer.OrdinalIgnoreCase.Equals(value, "Basic")) return AgriculturePlatformSkuTier.Basic; + if (StringComparer.OrdinalIgnoreCase.Equals(value, "Standard")) return AgriculturePlatformSkuTier.Standard; + if (StringComparer.OrdinalIgnoreCase.Equals(value, "Premium")) return AgriculturePlatformSkuTier.Premium; + throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown AgriculturePlatformSkuTier value."); + } + } +} diff --git a/sdk/agricultureplatform/Azure.ResourceManager.AgriculturePlatform/src/Generated/Models/AgriculturePlatformSkuTier.cs b/sdk/agricultureplatform/Azure.ResourceManager.AgriculturePlatform/src/Generated/Models/AgriculturePlatformSkuTier.cs new file mode 100644 index 000000000000..003792193cf8 --- /dev/null +++ b/sdk/agricultureplatform/Azure.ResourceManager.AgriculturePlatform/src/Generated/Models/AgriculturePlatformSkuTier.cs @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.ResourceManager.AgriculturePlatform.Models +{ + /// This field is required to be implemented by the Resource Provider if the service has more than one tier, but is not required on a PUT. + public enum AgriculturePlatformSkuTier + { + /// The Free service tier. + Free, + /// The Basic service tier. + Basic, + /// The Standard service tier. + Standard, + /// The Premium service tier. + Premium + } +} diff --git a/sdk/agricultureplatform/Azure.ResourceManager.AgriculturePlatform/src/Generated/Models/AuthCredentialsKind.cs b/sdk/agricultureplatform/Azure.ResourceManager.AgriculturePlatform/src/Generated/Models/AuthCredentialsKind.cs new file mode 100644 index 000000000000..b7984bad0c37 --- /dev/null +++ b/sdk/agricultureplatform/Azure.ResourceManager.AgriculturePlatform/src/Generated/Models/AuthCredentialsKind.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.AgriculturePlatform.Models +{ + /// Types of different kind of Data connector auth credentials supported. + public readonly partial struct AuthCredentialsKind : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public AuthCredentialsKind(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string OAuthClientCredentialsValue = "OAuthClientCredentials"; + private const string ApiKeyAuthCredentialsValue = "ApiKeyAuthCredentials"; + + /// OAuth Client Credential type. + public static AuthCredentialsKind OAuthClientCredentials { get; } = new AuthCredentialsKind(OAuthClientCredentialsValue); + /// API Key Auth Credential type. + public static AuthCredentialsKind ApiKeyAuthCredentials { get; } = new AuthCredentialsKind(ApiKeyAuthCredentialsValue); + /// Determines if two values are the same. + public static bool operator ==(AuthCredentialsKind left, AuthCredentialsKind right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(AuthCredentialsKind left, AuthCredentialsKind right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator AuthCredentialsKind(string value) => new AuthCredentialsKind(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is AuthCredentialsKind other && Equals(other); + /// + public bool Equals(AuthCredentialsKind other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/agricultureplatform/Azure.ResourceManager.AgriculturePlatform/src/Generated/Models/AvailableAgriSolutionListResult.Serialization.cs b/sdk/agricultureplatform/Azure.ResourceManager.AgriculturePlatform/src/Generated/Models/AvailableAgriSolutionListResult.Serialization.cs new file mode 100644 index 000000000000..f1f4b8462484 --- /dev/null +++ b/sdk/agricultureplatform/Azure.ResourceManager.AgriculturePlatform/src/Generated/Models/AvailableAgriSolutionListResult.Serialization.cs @@ -0,0 +1,136 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.AgriculturePlatform.Models +{ + public partial class AvailableAgriSolutionListResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AvailableAgriSolutionListResult)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("solutions"u8); + writer.WriteStartArray(); + foreach (var item in Solutions) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + AvailableAgriSolutionListResult 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(AvailableAgriSolutionListResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAvailableAgriSolutionListResult(document.RootElement, options); + } + + internal static AvailableAgriSolutionListResult DeserializeAvailableAgriSolutionListResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IReadOnlyList solutions = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("solutions"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(DataManagerForAgricultureSolution.DeserializeDataManagerForAgricultureSolution(item, options)); + } + solutions = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new AvailableAgriSolutionListResult(solutions, 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(AvailableAgriSolutionListResult)} does not support writing '{options.Format}' format."); + } + } + + AvailableAgriSolutionListResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeAvailableAgriSolutionListResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(AvailableAgriSolutionListResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/agricultureplatform/Azure.ResourceManager.AgriculturePlatform/src/Generated/Models/AvailableAgriSolutionListResult.cs b/sdk/agricultureplatform/Azure.ResourceManager.AgriculturePlatform/src/Generated/Models/AvailableAgriSolutionListResult.cs new file mode 100644 index 000000000000..1952a13cd701 --- /dev/null +++ b/sdk/agricultureplatform/Azure.ResourceManager.AgriculturePlatform/src/Generated/Models/AvailableAgriSolutionListResult.cs @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.ResourceManager.AgriculturePlatform.Models +{ + /// The list of available agri solutions. + public partial class AvailableAgriSolutionListResult + { + /// + /// 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 . + /// Agri solutions list. + /// is null. + internal AvailableAgriSolutionListResult(IEnumerable solutions) + { + Argument.AssertNotNull(solutions, nameof(solutions)); + + Solutions = solutions.ToList(); + } + + /// Initializes a new instance of . + /// Agri solutions list. + /// Keeps track of any properties unknown to the library. + internal AvailableAgriSolutionListResult(IReadOnlyList solutions, IDictionary serializedAdditionalRawData) + { + Solutions = solutions; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal AvailableAgriSolutionListResult() + { + } + + /// Agri solutions list. + public IReadOnlyList Solutions { get; } + } +} diff --git a/sdk/agricultureplatform/Azure.ResourceManager.AgriculturePlatform/src/Generated/Models/DataConnectorCredentialMap.Serialization.cs b/sdk/agricultureplatform/Azure.ResourceManager.AgriculturePlatform/src/Generated/Models/DataConnectorCredentialMap.Serialization.cs new file mode 100644 index 000000000000..2f376ca2fe6e --- /dev/null +++ b/sdk/agricultureplatform/Azure.ResourceManager.AgriculturePlatform/src/Generated/Models/DataConnectorCredentialMap.Serialization.cs @@ -0,0 +1,134 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.AgriculturePlatform.Models +{ + public partial class DataConnectorCredentialMap : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataConnectorCredentialMap)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("key"u8); + writer.WriteStringValue(Key); + writer.WritePropertyName("value"u8); + writer.WriteObjectValue(Value, options); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + DataConnectorCredentialMap 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(DataConnectorCredentialMap)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDataConnectorCredentialMap(document.RootElement, options); + } + + internal static DataConnectorCredentialMap DeserializeDataConnectorCredentialMap(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string key = default; + DataConnectorCredentials value = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("key"u8)) + { + key = property.Value.GetString(); + continue; + } + if (property.NameEquals("value"u8)) + { + value = DataConnectorCredentials.DeserializeDataConnectorCredentials(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DataConnectorCredentialMap(key, value, 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(DataConnectorCredentialMap)} does not support writing '{options.Format}' format."); + } + } + + DataConnectorCredentialMap IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeDataConnectorCredentialMap(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DataConnectorCredentialMap)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/agricultureplatform/Azure.ResourceManager.AgriculturePlatform/src/Generated/Models/DataConnectorCredentialMap.cs b/sdk/agricultureplatform/Azure.ResourceManager.AgriculturePlatform/src/Generated/Models/DataConnectorCredentialMap.cs new file mode 100644 index 000000000000..7ae5b121f387 --- /dev/null +++ b/sdk/agricultureplatform/Azure.ResourceManager.AgriculturePlatform/src/Generated/Models/DataConnectorCredentialMap.cs @@ -0,0 +1,82 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.AgriculturePlatform.Models +{ + /// Mapping of data connector credentials. + public partial class DataConnectorCredentialMap + { + /// + /// 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 key representing the credential. + /// The data connector credential value. + /// or is null. + public DataConnectorCredentialMap(string key, DataConnectorCredentials value) + { + Argument.AssertNotNull(key, nameof(key)); + Argument.AssertNotNull(value, nameof(value)); + + Key = key; + Value = value; + } + + /// Initializes a new instance of . + /// The key representing the credential. + /// The data connector credential value. + /// Keeps track of any properties unknown to the library. + internal DataConnectorCredentialMap(string key, DataConnectorCredentials value, IDictionary serializedAdditionalRawData) + { + Key = key; + Value = value; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal DataConnectorCredentialMap() + { + } + + /// The key representing the credential. + public string Key { get; set; } + /// The data connector credential value. + public DataConnectorCredentials Value { get; set; } + } +} diff --git a/sdk/agricultureplatform/Azure.ResourceManager.AgriculturePlatform/src/Generated/Models/DataConnectorCredentials.Serialization.cs b/sdk/agricultureplatform/Azure.ResourceManager.AgriculturePlatform/src/Generated/Models/DataConnectorCredentials.Serialization.cs new file mode 100644 index 000000000000..97aba179b648 --- /dev/null +++ b/sdk/agricultureplatform/Azure.ResourceManager.AgriculturePlatform/src/Generated/Models/DataConnectorCredentials.Serialization.cs @@ -0,0 +1,183 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.AgriculturePlatform.Models +{ + public partial class DataConnectorCredentials : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataConnectorCredentials)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(Kind)) + { + writer.WritePropertyName("kind"u8); + writer.WriteStringValue(Kind.Value.ToString()); + } + if (Optional.IsDefined(ClientId)) + { + writer.WritePropertyName("clientId"u8); + writer.WriteStringValue(ClientId); + } + if (Optional.IsDefined(KeyVaultUri)) + { + writer.WritePropertyName("keyVaultUri"u8); + writer.WriteStringValue(KeyVaultUri); + } + if (Optional.IsDefined(KeyName)) + { + writer.WritePropertyName("keyName"u8); + writer.WriteStringValue(KeyName); + } + if (Optional.IsDefined(KeyVersion)) + { + writer.WritePropertyName("keyVersion"u8); + writer.WriteStringValue(KeyVersion); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + DataConnectorCredentials 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(DataConnectorCredentials)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDataConnectorCredentials(document.RootElement, options); + } + + internal static DataConnectorCredentials DeserializeDataConnectorCredentials(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + AuthCredentialsKind? kind = default; + string clientId = default; + string keyVaultUri = default; + string keyName = default; + string keyVersion = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("kind"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + kind = new AuthCredentialsKind(property.Value.GetString()); + continue; + } + if (property.NameEquals("clientId"u8)) + { + clientId = property.Value.GetString(); + continue; + } + if (property.NameEquals("keyVaultUri"u8)) + { + keyVaultUri = property.Value.GetString(); + continue; + } + if (property.NameEquals("keyName"u8)) + { + keyName = property.Value.GetString(); + continue; + } + if (property.NameEquals("keyVersion"u8)) + { + keyVersion = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DataConnectorCredentials( + kind, + clientId, + keyVaultUri, + keyName, + keyVersion, + 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(DataConnectorCredentials)} does not support writing '{options.Format}' format."); + } + } + + DataConnectorCredentials IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeDataConnectorCredentials(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DataConnectorCredentials)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/agricultureplatform/Azure.ResourceManager.AgriculturePlatform/src/Generated/Models/DataConnectorCredentials.cs b/sdk/agricultureplatform/Azure.ResourceManager.AgriculturePlatform/src/Generated/Models/DataConnectorCredentials.cs new file mode 100644 index 000000000000..7ec398320298 --- /dev/null +++ b/sdk/agricultureplatform/Azure.ResourceManager.AgriculturePlatform/src/Generated/Models/DataConnectorCredentials.cs @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.AgriculturePlatform.Models +{ + /// The properties related to an AgriService data connector. + public partial class DataConnectorCredentials + { + /// + /// 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 DataConnectorCredentials() + { + } + + /// Initializes a new instance of . + /// Type of credential. + /// Client Id associated with the provider, if type of credentials is OAuthClientCredentials. + /// Uri of the key vault. + /// Name of the key vault key. + /// Version of the key vault key. + /// Keeps track of any properties unknown to the library. + internal DataConnectorCredentials(AuthCredentialsKind? kind, string clientId, string keyVaultUri, string keyName, string keyVersion, IDictionary serializedAdditionalRawData) + { + Kind = kind; + ClientId = clientId; + KeyVaultUri = keyVaultUri; + KeyName = keyName; + KeyVersion = keyVersion; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Type of credential. + public AuthCredentialsKind? Kind { get; set; } + /// Client Id associated with the provider, if type of credentials is OAuthClientCredentials. + public string ClientId { get; set; } + /// Uri of the key vault. + public string KeyVaultUri { get; set; } + /// Name of the key vault key. + public string KeyName { get; set; } + /// Version of the key vault key. + public string KeyVersion { get; set; } + } +} diff --git a/sdk/agricultureplatform/Azure.ResourceManager.AgriculturePlatform/src/Generated/Models/DataManagerForAgricultureSolution.Serialization.cs b/sdk/agricultureplatform/Azure.ResourceManager.AgriculturePlatform/src/Generated/Models/DataManagerForAgricultureSolution.Serialization.cs new file mode 100644 index 000000000000..c8f880fc20a4 --- /dev/null +++ b/sdk/agricultureplatform/Azure.ResourceManager.AgriculturePlatform/src/Generated/Models/DataManagerForAgricultureSolution.Serialization.cs @@ -0,0 +1,210 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.AgriculturePlatform.Models +{ + public partial class DataManagerForAgricultureSolution : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataManagerForAgricultureSolution)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("partnerId"u8); + writer.WriteStringValue(PartnerId); + writer.WritePropertyName("solutionId"u8); + writer.WriteStringValue(SolutionId); + writer.WritePropertyName("partnerTenantId"u8); + writer.WriteStringValue(PartnerTenantId); + writer.WritePropertyName("dataAccessScopes"u8); + writer.WriteStartArray(); + foreach (var item in DataAccessScopes) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + writer.WritePropertyName("marketPlaceOfferDetails"u8); + writer.WriteObjectValue(MarketPlaceOfferDetails, options); + writer.WritePropertyName("saasApplicationId"u8); + writer.WriteStringValue(SaasApplicationId); + writer.WritePropertyName("accessAzureDataManagerForAgricultureApplicationId"u8); + writer.WriteStringValue(AccessAzureDataManagerForAgricultureApplicationId); + writer.WritePropertyName("accessAzureDataManagerForAgricultureApplicationName"u8); + writer.WriteStringValue(AccessAzureDataManagerForAgricultureApplicationName); + writer.WritePropertyName("isValidateInput"u8); + writer.WriteBooleanValue(IsValidateInput); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + DataManagerForAgricultureSolution 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(DataManagerForAgricultureSolution)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDataManagerForAgricultureSolution(document.RootElement, options); + } + + internal static DataManagerForAgricultureSolution DeserializeDataManagerForAgricultureSolution(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string partnerId = default; + string solutionId = default; + string partnerTenantId = default; + IReadOnlyList dataAccessScopes = default; + MarketPlaceOfferDetails marketPlaceOfferDetails = default; + string saasApplicationId = default; + string accessAzureDataManagerForAgricultureApplicationId = default; + string accessAzureDataManagerForAgricultureApplicationName = default; + bool isValidateInput = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("partnerId"u8)) + { + partnerId = property.Value.GetString(); + continue; + } + if (property.NameEquals("solutionId"u8)) + { + solutionId = property.Value.GetString(); + continue; + } + if (property.NameEquals("partnerTenantId"u8)) + { + partnerTenantId = property.Value.GetString(); + continue; + } + if (property.NameEquals("dataAccessScopes"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + dataAccessScopes = array; + continue; + } + if (property.NameEquals("marketPlaceOfferDetails"u8)) + { + marketPlaceOfferDetails = MarketPlaceOfferDetails.DeserializeMarketPlaceOfferDetails(property.Value, options); + continue; + } + if (property.NameEquals("saasApplicationId"u8)) + { + saasApplicationId = property.Value.GetString(); + continue; + } + if (property.NameEquals("accessAzureDataManagerForAgricultureApplicationId"u8)) + { + accessAzureDataManagerForAgricultureApplicationId = property.Value.GetString(); + continue; + } + if (property.NameEquals("accessAzureDataManagerForAgricultureApplicationName"u8)) + { + accessAzureDataManagerForAgricultureApplicationName = property.Value.GetString(); + continue; + } + if (property.NameEquals("isValidateInput"u8)) + { + isValidateInput = property.Value.GetBoolean(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DataManagerForAgricultureSolution( + partnerId, + solutionId, + partnerTenantId, + dataAccessScopes, + marketPlaceOfferDetails, + saasApplicationId, + accessAzureDataManagerForAgricultureApplicationId, + accessAzureDataManagerForAgricultureApplicationName, + isValidateInput, + 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(DataManagerForAgricultureSolution)} does not support writing '{options.Format}' format."); + } + } + + DataManagerForAgricultureSolution IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeDataManagerForAgricultureSolution(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DataManagerForAgricultureSolution)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/agricultureplatform/Azure.ResourceManager.AgriculturePlatform/src/Generated/Models/DataManagerForAgricultureSolution.cs b/sdk/agricultureplatform/Azure.ResourceManager.AgriculturePlatform/src/Generated/Models/DataManagerForAgricultureSolution.cs new file mode 100644 index 000000000000..ee2b9d521dcf --- /dev/null +++ b/sdk/agricultureplatform/Azure.ResourceManager.AgriculturePlatform/src/Generated/Models/DataManagerForAgricultureSolution.cs @@ -0,0 +1,131 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.ResourceManager.AgriculturePlatform.Models +{ + /// Data Manager for Agriculture solution. + public partial class DataManagerForAgricultureSolution + { + /// + /// 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 . + /// Partner Id. + /// Solution Id. + /// Partner tenant Id. + /// Data access scopes. + /// Marketplace offer details. + /// Saas application Id. + /// Entra application Id used to access azure data manager for agriculture instance. + /// Entra application name used to access azure data manager for agriculture instance. + /// Whether solution inference will validate input. + /// , , , , , , or is null. + internal DataManagerForAgricultureSolution(string partnerId, string solutionId, string partnerTenantId, IEnumerable dataAccessScopes, MarketPlaceOfferDetails marketPlaceOfferDetails, string saasApplicationId, string accessAzureDataManagerForAgricultureApplicationId, string accessAzureDataManagerForAgricultureApplicationName, bool isValidateInput) + { + Argument.AssertNotNull(partnerId, nameof(partnerId)); + Argument.AssertNotNull(solutionId, nameof(solutionId)); + Argument.AssertNotNull(partnerTenantId, nameof(partnerTenantId)); + Argument.AssertNotNull(dataAccessScopes, nameof(dataAccessScopes)); + Argument.AssertNotNull(marketPlaceOfferDetails, nameof(marketPlaceOfferDetails)); + Argument.AssertNotNull(saasApplicationId, nameof(saasApplicationId)); + Argument.AssertNotNull(accessAzureDataManagerForAgricultureApplicationId, nameof(accessAzureDataManagerForAgricultureApplicationId)); + Argument.AssertNotNull(accessAzureDataManagerForAgricultureApplicationName, nameof(accessAzureDataManagerForAgricultureApplicationName)); + + PartnerId = partnerId; + SolutionId = solutionId; + PartnerTenantId = partnerTenantId; + DataAccessScopes = dataAccessScopes.ToList(); + MarketPlaceOfferDetails = marketPlaceOfferDetails; + SaasApplicationId = saasApplicationId; + AccessAzureDataManagerForAgricultureApplicationId = accessAzureDataManagerForAgricultureApplicationId; + AccessAzureDataManagerForAgricultureApplicationName = accessAzureDataManagerForAgricultureApplicationName; + IsValidateInput = isValidateInput; + } + + /// Initializes a new instance of . + /// Partner Id. + /// Solution Id. + /// Partner tenant Id. + /// Data access scopes. + /// Marketplace offer details. + /// Saas application Id. + /// Entra application Id used to access azure data manager for agriculture instance. + /// Entra application name used to access azure data manager for agriculture instance. + /// Whether solution inference will validate input. + /// Keeps track of any properties unknown to the library. + internal DataManagerForAgricultureSolution(string partnerId, string solutionId, string partnerTenantId, IReadOnlyList dataAccessScopes, MarketPlaceOfferDetails marketPlaceOfferDetails, string saasApplicationId, string accessAzureDataManagerForAgricultureApplicationId, string accessAzureDataManagerForAgricultureApplicationName, bool isValidateInput, IDictionary serializedAdditionalRawData) + { + PartnerId = partnerId; + SolutionId = solutionId; + PartnerTenantId = partnerTenantId; + DataAccessScopes = dataAccessScopes; + MarketPlaceOfferDetails = marketPlaceOfferDetails; + SaasApplicationId = saasApplicationId; + AccessAzureDataManagerForAgricultureApplicationId = accessAzureDataManagerForAgricultureApplicationId; + AccessAzureDataManagerForAgricultureApplicationName = accessAzureDataManagerForAgricultureApplicationName; + IsValidateInput = isValidateInput; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal DataManagerForAgricultureSolution() + { + } + + /// Partner Id. + public string PartnerId { get; } + /// Solution Id. + public string SolutionId { get; } + /// Partner tenant Id. + public string PartnerTenantId { get; } + /// Data access scopes. + public IReadOnlyList DataAccessScopes { get; } + /// Marketplace offer details. + public MarketPlaceOfferDetails MarketPlaceOfferDetails { get; } + /// Saas application Id. + public string SaasApplicationId { get; } + /// Entra application Id used to access azure data manager for agriculture instance. + public string AccessAzureDataManagerForAgricultureApplicationId { get; } + /// Entra application name used to access azure data manager for agriculture instance. + public string AccessAzureDataManagerForAgricultureApplicationName { get; } + /// Whether solution inference will validate input. + public bool IsValidateInput { get; } + } +} diff --git a/sdk/agricultureplatform/Azure.ResourceManager.AgriculturePlatform/src/Generated/Models/InstalledSolutionMap.Serialization.cs b/sdk/agricultureplatform/Azure.ResourceManager.AgriculturePlatform/src/Generated/Models/InstalledSolutionMap.Serialization.cs new file mode 100644 index 000000000000..8083746cf915 --- /dev/null +++ b/sdk/agricultureplatform/Azure.ResourceManager.AgriculturePlatform/src/Generated/Models/InstalledSolutionMap.Serialization.cs @@ -0,0 +1,134 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.AgriculturePlatform.Models +{ + public partial class InstalledSolutionMap : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(InstalledSolutionMap)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("key"u8); + writer.WriteStringValue(Key); + writer.WritePropertyName("value"u8); + writer.WriteObjectValue(Value, options); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + InstalledSolutionMap 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(InstalledSolutionMap)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeInstalledSolutionMap(document.RootElement, options); + } + + internal static InstalledSolutionMap DeserializeInstalledSolutionMap(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string key = default; + Solution value = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("key"u8)) + { + key = property.Value.GetString(); + continue; + } + if (property.NameEquals("value"u8)) + { + value = Solution.DeserializeSolution(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new InstalledSolutionMap(key, value, 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(InstalledSolutionMap)} does not support writing '{options.Format}' format."); + } + } + + InstalledSolutionMap IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeInstalledSolutionMap(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(InstalledSolutionMap)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/agricultureplatform/Azure.ResourceManager.AgriculturePlatform/src/Generated/Models/InstalledSolutionMap.cs b/sdk/agricultureplatform/Azure.ResourceManager.AgriculturePlatform/src/Generated/Models/InstalledSolutionMap.cs new file mode 100644 index 000000000000..bee5115cf2fd --- /dev/null +++ b/sdk/agricultureplatform/Azure.ResourceManager.AgriculturePlatform/src/Generated/Models/InstalledSolutionMap.cs @@ -0,0 +1,82 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.AgriculturePlatform.Models +{ + /// Mapping of installed solutions. + public partial class InstalledSolutionMap + { + /// + /// 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 key representing the installed solution. + /// The installed solution value. + /// or is null. + public InstalledSolutionMap(string key, Solution value) + { + Argument.AssertNotNull(key, nameof(key)); + Argument.AssertNotNull(value, nameof(value)); + + Key = key; + Value = value; + } + + /// Initializes a new instance of . + /// The key representing the installed solution. + /// The installed solution value. + /// Keeps track of any properties unknown to the library. + internal InstalledSolutionMap(string key, Solution value, IDictionary serializedAdditionalRawData) + { + Key = key; + Value = value; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal InstalledSolutionMap() + { + } + + /// The key representing the installed solution. + public string Key { get; set; } + /// The installed solution value. + public Solution Value { get; set; } + } +} diff --git a/sdk/agricultureplatform/Azure.ResourceManager.AgriculturePlatform/src/Generated/Models/ManagedOnBehalfOfConfiguration.Serialization.cs b/sdk/agricultureplatform/Azure.ResourceManager.AgriculturePlatform/src/Generated/Models/ManagedOnBehalfOfConfiguration.Serialization.cs new file mode 100644 index 000000000000..b7db0746cd61 --- /dev/null +++ b/sdk/agricultureplatform/Azure.ResourceManager.AgriculturePlatform/src/Generated/Models/ManagedOnBehalfOfConfiguration.Serialization.cs @@ -0,0 +1,140 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.Resources.Models; + +namespace Azure.ResourceManager.AgriculturePlatform.Models +{ + internal partial class ManagedOnBehalfOfConfiguration : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ManagedOnBehalfOfConfiguration)} does not support writing '{format}' format."); + } + + if (options.Format != "W") + { + writer.WritePropertyName("moboBrokerResources"u8); + writer.WriteStartArray(); + foreach (var item in MoboBrokerResources) + { + JsonSerializer.Serialize(writer, item); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + ManagedOnBehalfOfConfiguration 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(ManagedOnBehalfOfConfiguration)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeManagedOnBehalfOfConfiguration(document.RootElement, options); + } + + internal static ManagedOnBehalfOfConfiguration DeserializeManagedOnBehalfOfConfiguration(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IReadOnlyList moboBrokerResources = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("moboBrokerResources"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(JsonSerializer.Deserialize(item.GetRawText())); + } + moboBrokerResources = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ManagedOnBehalfOfConfiguration(moboBrokerResources, 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(ManagedOnBehalfOfConfiguration)} does not support writing '{options.Format}' format."); + } + } + + ManagedOnBehalfOfConfiguration IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeManagedOnBehalfOfConfiguration(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ManagedOnBehalfOfConfiguration)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/agricultureplatform/Azure.ResourceManager.AgriculturePlatform/src/Generated/Models/ManagedOnBehalfOfConfiguration.cs b/sdk/agricultureplatform/Azure.ResourceManager.AgriculturePlatform/src/Generated/Models/ManagedOnBehalfOfConfiguration.cs new file mode 100644 index 000000000000..bae2f95bef45 --- /dev/null +++ b/sdk/agricultureplatform/Azure.ResourceManager.AgriculturePlatform/src/Generated/Models/ManagedOnBehalfOfConfiguration.cs @@ -0,0 +1,74 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; +using Azure.ResourceManager.Resources.Models; + +namespace Azure.ResourceManager.AgriculturePlatform.Models +{ + /// Configuration of the managed on behalf of resource. + internal partial class ManagedOnBehalfOfConfiguration + { + /// + /// 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 . + /// Associated MoboBrokerResources. + internal ManagedOnBehalfOfConfiguration(IEnumerable moboBrokerResources) + { + MoboBrokerResources = moboBrokerResources.ToList(); + } + + /// Initializes a new instance of . + /// Associated MoboBrokerResources. + /// Keeps track of any properties unknown to the library. + internal ManagedOnBehalfOfConfiguration(IReadOnlyList moboBrokerResources, IDictionary serializedAdditionalRawData) + { + MoboBrokerResources = moboBrokerResources; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal ManagedOnBehalfOfConfiguration() + { + } + + /// Associated MoboBrokerResources. + public IReadOnlyList MoboBrokerResources { get; } + } +} diff --git a/sdk/agricultureplatform/Azure.ResourceManager.AgriculturePlatform/src/Generated/Models/MarketPlaceOfferDetails.Serialization.cs b/sdk/agricultureplatform/Azure.ResourceManager.AgriculturePlatform/src/Generated/Models/MarketPlaceOfferDetails.Serialization.cs new file mode 100644 index 000000000000..04e228ef4df8 --- /dev/null +++ b/sdk/agricultureplatform/Azure.ResourceManager.AgriculturePlatform/src/Generated/Models/MarketPlaceOfferDetails.Serialization.cs @@ -0,0 +1,134 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.AgriculturePlatform.Models +{ + public partial class MarketPlaceOfferDetails : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(MarketPlaceOfferDetails)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("saasOfferId"u8); + writer.WriteStringValue(SaasOfferId); + writer.WritePropertyName("publisherId"u8); + writer.WriteStringValue(PublisherId); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + MarketPlaceOfferDetails 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(MarketPlaceOfferDetails)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeMarketPlaceOfferDetails(document.RootElement, options); + } + + internal static MarketPlaceOfferDetails DeserializeMarketPlaceOfferDetails(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string saasOfferId = default; + string publisherId = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("saasOfferId"u8)) + { + saasOfferId = property.Value.GetString(); + continue; + } + if (property.NameEquals("publisherId"u8)) + { + publisherId = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new MarketPlaceOfferDetails(saasOfferId, publisherId, 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(MarketPlaceOfferDetails)} does not support writing '{options.Format}' format."); + } + } + + MarketPlaceOfferDetails IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeMarketPlaceOfferDetails(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(MarketPlaceOfferDetails)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/agricultureplatform/Azure.ResourceManager.AgriculturePlatform/src/Generated/Models/MarketPlaceOfferDetails.cs b/sdk/agricultureplatform/Azure.ResourceManager.AgriculturePlatform/src/Generated/Models/MarketPlaceOfferDetails.cs new file mode 100644 index 000000000000..73a83366055e --- /dev/null +++ b/sdk/agricultureplatform/Azure.ResourceManager.AgriculturePlatform/src/Generated/Models/MarketPlaceOfferDetails.cs @@ -0,0 +1,82 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.AgriculturePlatform.Models +{ + /// Marketplace offer details of Agri solution. + public partial class MarketPlaceOfferDetails + { + /// + /// 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 . + /// Saas offer Id. + /// Publisher Id. + /// or is null. + internal MarketPlaceOfferDetails(string saasOfferId, string publisherId) + { + Argument.AssertNotNull(saasOfferId, nameof(saasOfferId)); + Argument.AssertNotNull(publisherId, nameof(publisherId)); + + SaasOfferId = saasOfferId; + PublisherId = publisherId; + } + + /// Initializes a new instance of . + /// Saas offer Id. + /// Publisher Id. + /// Keeps track of any properties unknown to the library. + internal MarketPlaceOfferDetails(string saasOfferId, string publisherId, IDictionary serializedAdditionalRawData) + { + SaasOfferId = saasOfferId; + PublisherId = publisherId; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal MarketPlaceOfferDetails() + { + } + + /// Saas offer Id. + public string SaasOfferId { get; } + /// Publisher Id. + public string PublisherId { get; } + } +} diff --git a/sdk/agricultureplatform/Azure.ResourceManager.AgriculturePlatform/src/Generated/Models/ProvisioningState.cs b/sdk/agricultureplatform/Azure.ResourceManager.AgriculturePlatform/src/Generated/Models/ProvisioningState.cs new file mode 100644 index 000000000000..43d491e36cb2 --- /dev/null +++ b/sdk/agricultureplatform/Azure.ResourceManager.AgriculturePlatform/src/Generated/Models/ProvisioningState.cs @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.AgriculturePlatform.Models +{ + /// The status of the current operation. + public readonly partial struct ProvisioningState : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public ProvisioningState(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string SucceededValue = "Succeeded"; + private const string FailedValue = "Failed"; + private const string CanceledValue = "Canceled"; + private const string ProvisioningValue = "Provisioning"; + private const string UpdatingValue = "Updating"; + private const string DeletingValue = "Deleting"; + private const string AcceptedValue = "Accepted"; + + /// Resource has been created. + public static ProvisioningState Succeeded { get; } = new ProvisioningState(SucceededValue); + /// Resource creation failed. + public static ProvisioningState Failed { get; } = new ProvisioningState(FailedValue); + /// Resource creation was canceled. + public static ProvisioningState Canceled { get; } = new ProvisioningState(CanceledValue); + /// The resource is being provisioned. + public static ProvisioningState Provisioning { get; } = new ProvisioningState(ProvisioningValue); + /// The resource is updating. + public static ProvisioningState Updating { get; } = new ProvisioningState(UpdatingValue); + /// The resource is being deleted. + public static ProvisioningState Deleting { get; } = new ProvisioningState(DeletingValue); + /// The resource create request has been accepted. + public static ProvisioningState Accepted { get; } = new ProvisioningState(AcceptedValue); + /// Determines if two values are the same. + public static bool operator ==(ProvisioningState left, ProvisioningState right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(ProvisioningState left, ProvisioningState right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator ProvisioningState(string value) => new ProvisioningState(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is ProvisioningState other && Equals(other); + /// + public bool Equals(ProvisioningState other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/agricultureplatform/Azure.ResourceManager.AgriculturePlatform/src/Generated/Models/Solution.Serialization.cs b/sdk/agricultureplatform/Azure.ResourceManager.AgriculturePlatform/src/Generated/Models/Solution.Serialization.cs new file mode 100644 index 000000000000..8701f7f2667c --- /dev/null +++ b/sdk/agricultureplatform/Azure.ResourceManager.AgriculturePlatform/src/Generated/Models/Solution.Serialization.cs @@ -0,0 +1,191 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.AgriculturePlatform.Models +{ + public partial class Solution : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(Solution)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(ApplicationName)) + { + writer.WritePropertyName("applicationName"u8); + writer.WriteStringValue(ApplicationName); + } + if (Optional.IsDefined(PartnerId)) + { + writer.WritePropertyName("partnerId"u8); + writer.WriteStringValue(PartnerId); + } + if (Optional.IsDefined(MarketPlacePublisherId)) + { + writer.WritePropertyName("marketPlacePublisherId"u8); + writer.WriteStringValue(MarketPlacePublisherId); + } + if (Optional.IsDefined(SaasSubscriptionId)) + { + writer.WritePropertyName("saasSubscriptionId"u8); + writer.WriteStringValue(SaasSubscriptionId); + } + if (Optional.IsDefined(SaasSubscriptionName)) + { + writer.WritePropertyName("saasSubscriptionName"u8); + writer.WriteStringValue(SaasSubscriptionName); + } + if (Optional.IsDefined(PlanId)) + { + writer.WritePropertyName("planId"u8); + writer.WriteStringValue(PlanId); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + Solution 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(Solution)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeSolution(document.RootElement, options); + } + + internal static Solution DeserializeSolution(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string applicationName = default; + string partnerId = default; + string marketPlacePublisherId = default; + string saasSubscriptionId = default; + string saasSubscriptionName = default; + string planId = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("applicationName"u8)) + { + applicationName = property.Value.GetString(); + continue; + } + if (property.NameEquals("partnerId"u8)) + { + partnerId = property.Value.GetString(); + continue; + } + if (property.NameEquals("marketPlacePublisherId"u8)) + { + marketPlacePublisherId = property.Value.GetString(); + continue; + } + if (property.NameEquals("saasSubscriptionId"u8)) + { + saasSubscriptionId = property.Value.GetString(); + continue; + } + if (property.NameEquals("saasSubscriptionName"u8)) + { + saasSubscriptionName = property.Value.GetString(); + continue; + } + if (property.NameEquals("planId"u8)) + { + planId = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new Solution( + applicationName, + partnerId, + marketPlacePublisherId, + saasSubscriptionId, + saasSubscriptionName, + planId, + 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(Solution)} does not support writing '{options.Format}' format."); + } + } + + Solution IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeSolution(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(Solution)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/agricultureplatform/Azure.ResourceManager.AgriculturePlatform/src/Generated/Models/Solution.cs b/sdk/agricultureplatform/Azure.ResourceManager.AgriculturePlatform/src/Generated/Models/Solution.cs new file mode 100644 index 000000000000..854241ecedc5 --- /dev/null +++ b/sdk/agricultureplatform/Azure.ResourceManager.AgriculturePlatform/src/Generated/Models/Solution.cs @@ -0,0 +1,85 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.AgriculturePlatform.Models +{ + /// Installed data manager for Agriculture solution detail. + public partial class Solution + { + /// + /// 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 Solution() + { + } + + /// Initializes a new instance of . + /// Application name of the solution. + /// Partner Id. + /// Marketplace publisher Id. + /// Saas subscription Id. + /// Saas subscription name. + /// Plan Id. + /// Keeps track of any properties unknown to the library. + internal Solution(string applicationName, string partnerId, string marketPlacePublisherId, string saasSubscriptionId, string saasSubscriptionName, string planId, IDictionary serializedAdditionalRawData) + { + ApplicationName = applicationName; + PartnerId = partnerId; + MarketPlacePublisherId = marketPlacePublisherId; + SaasSubscriptionId = saasSubscriptionId; + SaasSubscriptionName = saasSubscriptionName; + PlanId = planId; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Application name of the solution. + public string ApplicationName { get; set; } + /// Partner Id. + public string PartnerId { get; set; } + /// Marketplace publisher Id. + public string MarketPlacePublisherId { get; set; } + /// Saas subscription Id. + public string SaasSubscriptionId { get; set; } + /// Saas subscription name. + public string SaasSubscriptionName { get; set; } + /// Plan Id. + public string PlanId { get; set; } + } +} diff --git a/sdk/agricultureplatform/Azure.ResourceManager.AgriculturePlatform/src/Generated/ProviderConstants.cs b/sdk/agricultureplatform/Azure.ResourceManager.AgriculturePlatform/src/Generated/ProviderConstants.cs new file mode 100644 index 000000000000..9fb5a17db4ac --- /dev/null +++ b/sdk/agricultureplatform/Azure.ResourceManager.AgriculturePlatform/src/Generated/ProviderConstants.cs @@ -0,0 +1,16 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.AgriculturePlatform +{ + internal static class ProviderConstants + { + public static string DefaultProviderNamespace { get; } = ClientDiagnostics.GetResourceProviderNamespace(typeof(ProviderConstants).Assembly); + } +} diff --git a/sdk/agricultureplatform/Azure.ResourceManager.AgriculturePlatform/src/Generated/RestOperations/AgriServiceRestOperations.cs b/sdk/agricultureplatform/Azure.ResourceManager.AgriculturePlatform/src/Generated/RestOperations/AgriServiceRestOperations.cs new file mode 100644 index 000000000000..6c4559b83544 --- /dev/null +++ b/sdk/agricultureplatform/Azure.ResourceManager.AgriculturePlatform/src/Generated/RestOperations/AgriServiceRestOperations.cs @@ -0,0 +1,817 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.AgriculturePlatform.Models; + +namespace Azure.ResourceManager.AgriculturePlatform +{ + internal partial class AgriServiceRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of AgriServiceRestOperations. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// The application id to use for user agent. + /// Service host. + /// The API version to use for this operation. + /// or is null. + public AgriServiceRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + { + _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); + _endpoint = endpoint ?? new Uri("https://management.azure.com"); + _apiVersion = apiVersion ?? "2024-06-01-preview"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string agriServiceResourceName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.AgriculturePlatform/agriServices/", false); + uri.AppendPath(agriServiceResourceName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string agriServiceResourceName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.AgriculturePlatform/agriServices/", false); + uri.AppendPath(agriServiceResourceName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Get a AgriServiceResource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the AgriService resource. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> GetAsync(string subscriptionId, string resourceGroupName, string agriServiceResourceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(agriServiceResourceName, nameof(agriServiceResourceName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, agriServiceResourceName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + AgriServiceResourceData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = AgriServiceResourceData.DeserializeAgriServiceResourceData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((AgriServiceResourceData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// Get a AgriServiceResource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the AgriService resource. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response Get(string subscriptionId, string resourceGroupName, string agriServiceResourceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(agriServiceResourceName, nameof(agriServiceResourceName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, agriServiceResourceName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + AgriServiceResourceData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = AgriServiceResourceData.DeserializeAgriServiceResourceData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((AgriServiceResourceData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateCreateOrUpdateRequestUri(string subscriptionId, string resourceGroupName, string agriServiceResourceName, AgriServiceResourceData data) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.AgriculturePlatform/agriServices/", false); + uri.AppendPath(agriServiceResourceName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string resourceGroupName, string agriServiceResourceName, AgriServiceResourceData data) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Put; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.AgriculturePlatform/agriServices/", false); + uri.AppendPath(agriServiceResourceName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(data, ModelSerializationExtensions.WireOptions); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Create a AgriServiceResource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the AgriService resource. + /// Resource create parameters. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task CreateOrUpdateAsync(string subscriptionId, string resourceGroupName, string agriServiceResourceName, AgriServiceResourceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(agriServiceResourceName, nameof(agriServiceResourceName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, agriServiceResourceName, data); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 201: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Create a AgriServiceResource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the AgriService resource. + /// Resource create parameters. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response CreateOrUpdate(string subscriptionId, string resourceGroupName, string agriServiceResourceName, AgriServiceResourceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(agriServiceResourceName, nameof(agriServiceResourceName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, agriServiceResourceName, data); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 201: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateUpdateRequestUri(string subscriptionId, string resourceGroupName, string agriServiceResourceName, AgriServiceResourcePatch patch) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.AgriculturePlatform/agriServices/", false); + uri.AppendPath(agriServiceResourceName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceGroupName, string agriServiceResourceName, AgriServiceResourcePatch patch) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Patch; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.AgriculturePlatform/agriServices/", false); + uri.AppendPath(agriServiceResourceName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(patch, ModelSerializationExtensions.WireOptions); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Update a AgriServiceResource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the AgriService resource. + /// The resource properties to be updated. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task UpdateAsync(string subscriptionId, string resourceGroupName, string agriServiceResourceName, AgriServiceResourcePatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(agriServiceResourceName, nameof(agriServiceResourceName)); + Argument.AssertNotNull(patch, nameof(patch)); + + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, agriServiceResourceName, patch); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Update a AgriServiceResource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the AgriService resource. + /// The resource properties to be updated. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response Update(string subscriptionId, string resourceGroupName, string agriServiceResourceName, AgriServiceResourcePatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(agriServiceResourceName, nameof(agriServiceResourceName)); + Argument.AssertNotNull(patch, nameof(patch)); + + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, agriServiceResourceName, patch); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string resourceGroupName, string agriServiceResourceName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.AgriculturePlatform/agriServices/", false); + uri.AppendPath(agriServiceResourceName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string agriServiceResourceName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Delete; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.AgriculturePlatform/agriServices/", false); + uri.AppendPath(agriServiceResourceName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Delete a AgriServiceResource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the AgriService resource. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task DeleteAsync(string subscriptionId, string resourceGroupName, string agriServiceResourceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(agriServiceResourceName, nameof(agriServiceResourceName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, agriServiceResourceName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Delete a AgriServiceResource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the AgriService resource. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response Delete(string subscriptionId, string resourceGroupName, string agriServiceResourceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(agriServiceResourceName, nameof(agriServiceResourceName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, agriServiceResourceName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListByResourceGroupRequestUri(string subscriptionId, string resourceGroupName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.AgriculturePlatform/agriServices", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateListByResourceGroupRequest(string subscriptionId, string resourceGroupName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.AgriculturePlatform/agriServices", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List AgriServiceResource resources by resource group. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + public async Task> ListByResourceGroupAsync(string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + + using var message = CreateListByResourceGroupRequest(subscriptionId, resourceGroupName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + AgriServiceResourceListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = AgriServiceResourceListResult.DeserializeAgriServiceResourceListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List AgriServiceResource resources by resource group. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + public Response ListByResourceGroup(string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + + using var message = CreateListByResourceGroupRequest(subscriptionId, resourceGroupName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + AgriServiceResourceListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = AgriServiceResourceListResult.DeserializeAgriServiceResourceListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListBySubscriptionRequestUri(string subscriptionId) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/providers/Microsoft.AgriculturePlatform/agriServices", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateListBySubscriptionRequest(string subscriptionId) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/providers/Microsoft.AgriculturePlatform/agriServices", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List AgriServiceResource resources by subscription ID. + /// The ID of the target subscription. The value must be an UUID. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + public async Task> ListBySubscriptionAsync(string subscriptionId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + + using var message = CreateListBySubscriptionRequest(subscriptionId); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + AgriServiceResourceListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = AgriServiceResourceListResult.DeserializeAgriServiceResourceListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List AgriServiceResource resources by subscription ID. + /// The ID of the target subscription. The value must be an UUID. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + public Response ListBySubscription(string subscriptionId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + + using var message = CreateListBySubscriptionRequest(subscriptionId); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + AgriServiceResourceListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = AgriServiceResourceListResult.DeserializeAgriServiceResourceListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListAvailableSolutionsRequestUri(string subscriptionId, string resourceGroupName, string agriServiceResourceName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.AgriculturePlatform/agriServices/", false); + uri.AppendPath(agriServiceResourceName, true); + uri.AppendPath("/listAvailableSolutions", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateListAvailableSolutionsRequest(string subscriptionId, string resourceGroupName, string agriServiceResourceName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.AgriculturePlatform/agriServices/", false); + uri.AppendPath(agriServiceResourceName, true); + uri.AppendPath("/listAvailableSolutions", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Returns the list of available agri solutions. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the AgriService resource. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> ListAvailableSolutionsAsync(string subscriptionId, string resourceGroupName, string agriServiceResourceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(agriServiceResourceName, nameof(agriServiceResourceName)); + + using var message = CreateListAvailableSolutionsRequest(subscriptionId, resourceGroupName, agriServiceResourceName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + AvailableAgriSolutionListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = AvailableAgriSolutionListResult.DeserializeAvailableAgriSolutionListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Returns the list of available agri solutions. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the AgriService resource. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response ListAvailableSolutions(string subscriptionId, string resourceGroupName, string agriServiceResourceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(agriServiceResourceName, nameof(agriServiceResourceName)); + + using var message = CreateListAvailableSolutionsRequest(subscriptionId, resourceGroupName, agriServiceResourceName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + AvailableAgriSolutionListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = AvailableAgriSolutionListResult.DeserializeAvailableAgriSolutionListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListByResourceGroupNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateListByResourceGroupNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List AgriServiceResource resources by resource group. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The cancellation token to use. + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + public async Task> ListByResourceGroupNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + + using var message = CreateListByResourceGroupNextPageRequest(nextLink, subscriptionId, resourceGroupName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + AgriServiceResourceListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = AgriServiceResourceListResult.DeserializeAgriServiceResourceListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List AgriServiceResource resources by resource group. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The cancellation token to use. + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + public Response ListByResourceGroupNextPage(string nextLink, string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + + using var message = CreateListByResourceGroupNextPageRequest(nextLink, subscriptionId, resourceGroupName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + AgriServiceResourceListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = AgriServiceResourceListResult.DeserializeAgriServiceResourceListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListBySubscriptionNextPageRequestUri(string nextLink, string subscriptionId) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateListBySubscriptionNextPageRequest(string nextLink, string subscriptionId) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List AgriServiceResource resources by subscription ID. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + public async Task> ListBySubscriptionNextPageAsync(string nextLink, string subscriptionId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + + using var message = CreateListBySubscriptionNextPageRequest(nextLink, subscriptionId); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + AgriServiceResourceListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = AgriServiceResourceListResult.DeserializeAgriServiceResourceListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List AgriServiceResource resources by subscription ID. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + public Response ListBySubscriptionNextPage(string nextLink, string subscriptionId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + + using var message = CreateListBySubscriptionNextPageRequest(nextLink, subscriptionId); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + AgriServiceResourceListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = AgriServiceResourceListResult.DeserializeAgriServiceResourceListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/agricultureplatform/Azure.ResourceManager.AgriculturePlatform/src/Properties/AssemblyInfo.cs b/sdk/agricultureplatform/Azure.ResourceManager.AgriculturePlatform/src/Properties/AssemblyInfo.cs new file mode 100644 index 000000000000..04cdc3b4b17d --- /dev/null +++ b/sdk/agricultureplatform/Azure.ResourceManager.AgriculturePlatform/src/Properties/AssemblyInfo.cs @@ -0,0 +1,11 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System.Runtime.CompilerServices; + +[assembly: InternalsVisibleTo("Azure.ResourceManager.AgriculturePlatform.Tests, PublicKey = 0024000004800000940000000602000000240000525341310004000001000100d15ddcb29688295338af4b7686603fe614abd555e09efba8fb88ee09e1f7b1ccaeed2e8f823fa9eef3fdd60217fc012ea67d2479751a0b8c087a4185541b851bd8b16f8d91b840e51b1cb0ba6fe647997e57429265e85ef62d565db50a69ae1647d54d7bd855e4db3d8a91510e5bcbd0edfbbecaa20a7bd9ae74593daa7b11b4")] + +// Replace Microsoft.Test with the correct resource provider namepace for your service and uncomment. +// See https://docs.microsoft.com/en-us/azure/azure-resource-manager/management/azure-services-resource-providers +// for the list of possible values. +[assembly: Azure.Core.AzureResourceProviderNamespace("AgriculturePlatform")] diff --git a/sdk/agricultureplatform/Azure.ResourceManager.AgriculturePlatform/tests/AgriculturePlatformManagementTestBase.cs b/sdk/agricultureplatform/Azure.ResourceManager.AgriculturePlatform/tests/AgriculturePlatformManagementTestBase.cs new file mode 100644 index 000000000000..dc2cbcb6ecaa --- /dev/null +++ b/sdk/agricultureplatform/Azure.ResourceManager.AgriculturePlatform/tests/AgriculturePlatformManagementTestBase.cs @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using Azure; +using Azure.Core; +using Azure.Core.TestFramework; +using Azure.ResourceManager; +using Azure.ResourceManager.Resources; +using Azure.ResourceManager.TestFramework; +using NUnit.Framework; +using System.Threading.Tasks; + +namespace Azure.ResourceManager.AgriculturePlatform.Tests +{ + public class AgriculturePlatformManagementTestBase : ManagementRecordedTestBase + { + protected ArmClient Client { get; private set; } + protected SubscriptionResource DefaultSubscription { get; private set; } + + protected AgriculturePlatformManagementTestBase(bool isAsync, RecordedTestMode mode) + : base(isAsync, mode) + { + } + + protected AgriculturePlatformManagementTestBase(bool isAsync) + : base(isAsync) + { + } + + [SetUp] + public async Task CreateCommonClient() + { + Client = GetArmClient(); + DefaultSubscription = await Client.GetDefaultSubscriptionAsync().ConfigureAwait(false); + } + + protected async Task CreateResourceGroup(SubscriptionResource subscription, string rgNamePrefix, AzureLocation location) + { + string rgName = Recording.GenerateAssetName(rgNamePrefix); + ResourceGroupData input = new ResourceGroupData(location); + var lro = await subscription.GetResourceGroups().CreateOrUpdateAsync(WaitUntil.Completed, rgName, input); + return lro.Value; + } + } +} diff --git a/sdk/agricultureplatform/Azure.ResourceManager.AgriculturePlatform/tests/AgriculturePlatformManagementTestEnvironment.cs b/sdk/agricultureplatform/Azure.ResourceManager.AgriculturePlatform/tests/AgriculturePlatformManagementTestEnvironment.cs new file mode 100644 index 000000000000..c74db678b879 --- /dev/null +++ b/sdk/agricultureplatform/Azure.ResourceManager.AgriculturePlatform/tests/AgriculturePlatformManagementTestEnvironment.cs @@ -0,0 +1,11 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using Azure.Core.TestFramework; + +namespace Azure.ResourceManager.AgriculturePlatform.Tests +{ + public class AgriculturePlatformManagementTestEnvironment : TestEnvironment + { + } +} diff --git a/sdk/agricultureplatform/Azure.ResourceManager.AgriculturePlatform/tests/Azure.ResourceManager.AgriculturePlatform.Tests.csproj b/sdk/agricultureplatform/Azure.ResourceManager.AgriculturePlatform/tests/Azure.ResourceManager.AgriculturePlatform.Tests.csproj new file mode 100644 index 000000000000..b2f75d13a0cf --- /dev/null +++ b/sdk/agricultureplatform/Azure.ResourceManager.AgriculturePlatform/tests/Azure.ResourceManager.AgriculturePlatform.Tests.csproj @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/sdk/agricultureplatform/Azure.ResourceManager.AgriculturePlatform/tsp-location.yaml b/sdk/agricultureplatform/Azure.ResourceManager.AgriculturePlatform/tsp-location.yaml new file mode 100644 index 000000000000..1c06b0d3d7d6 --- /dev/null +++ b/sdk/agricultureplatform/Azure.ResourceManager.AgriculturePlatform/tsp-location.yaml @@ -0,0 +1,4 @@ +directory: specification/agricultureplatform/AgriculturePlatform.Management +commit: 676334a284e5136f0a0721d6ae844bb04332f579 +repo: Azure/azure-rest-api-specs +additionalDirectories: diff --git a/sdk/agricultureplatform/ci.mgmt.yml b/sdk/agricultureplatform/ci.mgmt.yml new file mode 100644 index 000000000000..3b4a49c9c108 --- /dev/null +++ b/sdk/agricultureplatform/ci.mgmt.yml @@ -0,0 +1,26 @@ +# NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. + +trigger: none + +pr: + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/agricultureplatform /ci.mgmt.yml + - sdk/agricultureplatform /Azure.ResourceManager.AgriculturePlatform / + + +extends: + template: /eng/pipelines/templates/stages/archetype-sdk-client.yml + parameters: + ServiceDirectory: agricultureplatform + ArtifactName: packages + LimitForPullRequest: true + Artifacts: + - name: Azure.ResourceManager.AgriculturePlatform + safeName: AzureResourceManagerAgriculturePlatform diff --git a/sdk/chaos/Azure.ResourceManager.Chaos/Configuration.json b/sdk/chaos/Azure.ResourceManager.Chaos/Configuration.json new file mode 100644 index 000000000000..8d7b168e40df --- /dev/null +++ b/sdk/chaos/Azure.ResourceManager.Chaos/Configuration.json @@ -0,0 +1,13 @@ +{ + "output-folder": ".", + "namespace": "Azure.ResourceManager.Chaos", + "library-name": "Azure.ResourceManager.Chaos", + "flavor": "azure", + "use-model-reader-writer": true, + "shared-source-folders": [ + "../../TempTypeSpecFiles/node_modules/@autorest/csharp/Generator.Shared", + "../../TempTypeSpecFiles/node_modules/@autorest/csharp/Azure.Core.Shared" + ], + "model-namespace": false, + "azure-arm": true +} diff --git a/sdk/chaos/Azure.ResourceManager.Chaos/src/autorest.md b/sdk/chaos/Azure.ResourceManager.Chaos/src/autorest.md deleted file mode 100644 index 433ca7df8c96..000000000000 --- a/sdk/chaos/Azure.ResourceManager.Chaos/src/autorest.md +++ /dev/null @@ -1,81 +0,0 @@ -# Generated code configuration - -Run `dotnet build /t:GenerateCode` to generate code. - -```yaml -azure-arm: true -csharp: true -library-name: Chaos -namespace: Azure.ResourceManager.Chaos -#tag: package-2024-01 -require: https://github.com/Azure/azure-rest-api-specs/blob/f3cd6922dbe117d78b4f719bbf8b03db46b30808/specification/chaos/resource-manager/readme.md -output-folder: $(this-folder)/Generated -clear-output-folder: true -sample-gen: - output-folder: $(this-folder)/../samples/Generated - clear-output-folder: true -skip-csproj: true -modelerfour: - flatten-payloads: false -use-model-reader-writer: true - -#mgmt-debug: -# show-serialized-names: true - -rename-mapping: - ActionStatus: ChaosExperimentRunActionStatus - BranchStatus: ChaosExperimentRunBranchStatus - StepStatus: ChaosExperimentRunStepStatus - TargetReference.id: -|arm-id - CapabilityTypePropertiesRuntimeProperties: ChaosCapabilityTypeRuntimeProperties - ExperimentExecutionDetailsPropertiesRunInformation: ChaosExperimentRunInformation - -prepend-rp-prefix: - - Capability - - CapabilityType - - Experiment - - ExperimentExecution - - Target - - TargetType - - ProvisioningState - - ContinuousAction - - DelayAction - - DiscreteAction - - KeyValuePair - - TargetReference - - TargetReferenceType - -format-by-name-rules: - 'tenantId': 'uuid' - 'ETag': 'etag' - 'location': 'azure-location' - '*Uri': 'Uri' - '*Uris': 'Uri' - -acronym-mapping: - CPU: Cpu - CPUs: Cpus - Os: OS - Ip: IP - Ips: IPs|ips - ID: Id - IDs: Ids - VM: Vm - VMs: Vms - Vmos: VmOS - VMScaleSet: VmScaleSet - DNS: Dns - VPN: Vpn - NAT: Nat - WAN: Wan - Ipv4: IPv4|ipv4 - Ipv6: IPv6|ipv6 - Ipsec: IPsec|ipsec - SSO: Sso - URI: Uri - Etag: ETag|etag - -directive: - - remove-operation: 'OperationStatuses_Get' - -``` diff --git a/sdk/chaos/Azure.ResourceManager.Chaos/tsp-location.yaml b/sdk/chaos/Azure.ResourceManager.Chaos/tsp-location.yaml new file mode 100644 index 000000000000..d30e8f0a37f5 --- /dev/null +++ b/sdk/chaos/Azure.ResourceManager.Chaos/tsp-location.yaml @@ -0,0 +1,4 @@ +directory: specification/chaos/Chaos.Management +commit: 676334a284e5136f0a0721d6ae844bb04332f579 +repo: Azure/azure-rest-api-specs +additionalDirectories: diff --git a/sdk/chaos/Azure.ResourceManager.Chaos/tspCodeModel.json b/sdk/chaos/Azure.ResourceManager.Chaos/tspCodeModel.json new file mode 100644 index 000000000000..ea33f0554067 --- /dev/null +++ b/sdk/chaos/Azure.ResourceManager.Chaos/tspCodeModel.json @@ -0,0 +1,19184 @@ +{ + "$id": "1", + "Name": "Microsoft.Chaos", + "ApiVersions": [ + "2025-01-01" + ], + "Enums": [ + { + "$id": "2", + "kind": "enum", + "name": "createdByType", + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.createdByType", + "valueType": { + "$id": "3", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "4", + "kind": "enumvalue", + "name": "User", + "value": "User", + "valueType": { + "$id": "5", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "2" + }, + "doc": "The entity was created by a user.", + "decorators": [] + }, + { + "$id": "6", + "kind": "enumvalue", + "name": "Application", + "value": "Application", + "valueType": { + "$id": "7", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "2" + }, + "doc": "The entity was created by an application.", + "decorators": [] + }, + { + "$id": "8", + "kind": "enumvalue", + "name": "ManagedIdentity", + "value": "ManagedIdentity", + "valueType": { + "$id": "9", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "2" + }, + "doc": "The entity was created by a managed identity.", + "decorators": [] + }, + { + "$id": "10", + "kind": "enumvalue", + "name": "Key", + "value": "Key", + "valueType": { + "$id": "11", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "2" + }, + "doc": "The entity was created by a key.", + "decorators": [] + } + ], + "clientNamespace": "Azure.ResourceManager.CommonTypes", + "doc": "The kind of entity that created the resource.", + "isFixed": false, + "isFlags": false, + "usage": "Output,Json,LroInitial,LroFinalEnvelope", + "decorators": [] + }, + { + "$id": "12", + "kind": "enum", + "name": "ManagedServiceIdentityType", + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.ManagedServiceIdentityType", + "valueType": { + "$id": "13", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "14", + "kind": "enumvalue", + "name": "None", + "value": "None", + "valueType": { + "$id": "15", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "12" + }, + "doc": "No managed identity.", + "decorators": [] + }, + { + "$id": "16", + "kind": "enumvalue", + "name": "SystemAssigned", + "value": "SystemAssigned", + "valueType": { + "$id": "17", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "12" + }, + "doc": "System assigned managed identity.", + "decorators": [] + }, + { + "$id": "18", + "kind": "enumvalue", + "name": "UserAssigned", + "value": "UserAssigned", + "valueType": { + "$id": "19", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "12" + }, + "doc": "User assigned managed identity.", + "decorators": [] + }, + { + "$id": "20", + "kind": "enumvalue", + "name": "SystemAssigned,UserAssigned", + "value": "SystemAssigned,UserAssigned", + "valueType": { + "$id": "21", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "12" + }, + "doc": "System and user assigned managed identity.", + "decorators": [] + } + ], + "clientNamespace": "Azure.ResourceManager.CommonTypes", + "doc": "Type of managed service identity (where both SystemAssigned and UserAssigned types are allowed).", + "isFixed": false, + "isFlags": false, + "usage": "Input,Output,Json,LroInitial,LroFinalEnvelope", + "decorators": [] + }, + { + "$id": "22", + "kind": "enum", + "name": "ChaosProvisioningState", + "crossLanguageDefinitionId": "Microsoft.Chaos.ProvisioningState", + "valueType": { + "$id": "23", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "24", + "kind": "enumvalue", + "name": "Succeeded", + "value": "Succeeded", + "valueType": { + "$id": "25", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "22" + }, + "doc": "Resource has been created.", + "decorators": [] + }, + { + "$id": "26", + "kind": "enumvalue", + "name": "Failed", + "value": "Failed", + "valueType": { + "$id": "27", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "22" + }, + "doc": "Resource creation failed.", + "decorators": [] + }, + { + "$id": "28", + "kind": "enumvalue", + "name": "Canceled", + "value": "Canceled", + "valueType": { + "$id": "29", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "22" + }, + "doc": "Resource creation was canceled.", + "decorators": [] + }, + { + "$id": "30", + "kind": "enumvalue", + "name": "Creating", + "value": "Creating", + "valueType": { + "$id": "31", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "22" + }, + "doc": "Initial creation in progress.", + "decorators": [] + }, + { + "$id": "32", + "kind": "enumvalue", + "name": "Updating", + "value": "Updating", + "valueType": { + "$id": "33", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "22" + }, + "doc": "Update in progress.", + "decorators": [] + }, + { + "$id": "34", + "kind": "enumvalue", + "name": "Deleting", + "value": "Deleting", + "valueType": { + "$id": "35", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "22" + }, + "doc": "Deletion in progress.", + "decorators": [] + } + ], + "clientNamespace": "Microsoft.Chaos", + "doc": "Current provisioning state for a given Azure Chaos resource.", + "isFixed": false, + "isFlags": false, + "usage": "Output,Json,LroInitial,LroFinalEnvelope", + "decorators": [] + }, + { + "$id": "36", + "kind": "enum", + "name": "ExperimentActionType", + "crossLanguageDefinitionId": "Microsoft.Chaos.ExperimentActionType", + "valueType": { + "$id": "37", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "38", + "kind": "enumvalue", + "name": "delay", + "value": "delay", + "valueType": { + "$id": "39", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "36" + }, + "decorators": [] + }, + { + "$id": "40", + "kind": "enumvalue", + "name": "discrete", + "value": "discrete", + "valueType": { + "$id": "41", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "36" + }, + "decorators": [] + }, + { + "$id": "42", + "kind": "enumvalue", + "name": "continuous", + "value": "continuous", + "valueType": { + "$id": "43", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "36" + }, + "decorators": [] + } + ], + "clientNamespace": "Microsoft.Chaos", + "doc": "Enum union of Chaos experiment action types.", + "isFixed": false, + "isFlags": false, + "usage": "Input,Output,Json,LroInitial,LroFinalEnvelope", + "decorators": [] + }, + { + "$id": "44", + "kind": "enum", + "name": "SelectorType", + "crossLanguageDefinitionId": "Microsoft.Chaos.SelectorType", + "valueType": { + "$id": "45", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "46", + "kind": "enumvalue", + "name": "List", + "value": "List", + "valueType": { + "$id": "47", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "44" + }, + "doc": "List selector type.", + "decorators": [] + }, + { + "$id": "48", + "kind": "enumvalue", + "name": "Query", + "value": "Query", + "valueType": { + "$id": "49", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "44" + }, + "doc": "Query selector type.", + "decorators": [] + } + ], + "clientNamespace": "Microsoft.Chaos", + "doc": "Enum of the selector type.", + "isFixed": false, + "isFlags": false, + "usage": "Input,Output,Json,LroInitial,LroFinalEnvelope", + "decorators": [] + }, + { + "$id": "50", + "kind": "enum", + "name": "FilterType", + "crossLanguageDefinitionId": "Microsoft.Chaos.FilterType", + "valueType": { + "$id": "51", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "52", + "kind": "enumvalue", + "name": "Simple", + "value": "Simple", + "valueType": { + "$id": "53", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "50" + }, + "doc": "Simple filter type.", + "decorators": [] + } + ], + "clientNamespace": "Microsoft.Chaos", + "doc": "Enum that discriminates between filter types. Currently only `Simple` type is supported.", + "isFixed": false, + "isFlags": false, + "usage": "Input,Output,Json,LroInitial,LroFinalEnvelope", + "decorators": [] + }, + { + "$id": "54", + "kind": "enum", + "name": "ChaosTargetReferenceType", + "crossLanguageDefinitionId": "Microsoft.Chaos.TargetReferenceType", + "valueType": { + "$id": "55", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "56", + "kind": "enumvalue", + "name": "ChaosTarget", + "value": "ChaosTarget", + "valueType": { + "$id": "57", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "54" + }, + "doc": "Chaos target reference type.", + "decorators": [] + } + ], + "clientNamespace": "Microsoft.Chaos", + "doc": "Enum of the Target reference type.", + "isFixed": false, + "isFlags": false, + "usage": "Input,Output,Json,LroInitial,LroFinalEnvelope", + "decorators": [] + }, + { + "$id": "58", + "kind": "enum", + "name": "ResourceProvisioningState", + "crossLanguageDefinitionId": "Azure.ResourceManager.ResourceProvisioningState", + "valueType": { + "$id": "59", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "60", + "kind": "enumvalue", + "name": "Succeeded", + "value": "Succeeded", + "valueType": { + "$id": "61", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "58" + }, + "doc": "Resource has been created.", + "decorators": [] + }, + { + "$id": "62", + "kind": "enumvalue", + "name": "Failed", + "value": "Failed", + "valueType": { + "$id": "63", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "58" + }, + "doc": "Resource creation failed.", + "decorators": [] + }, + { + "$id": "64", + "kind": "enumvalue", + "name": "Canceled", + "value": "Canceled", + "valueType": { + "$id": "65", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "58" + }, + "doc": "Resource creation was canceled.", + "decorators": [] + } + ], + "clientNamespace": "Azure.ResourceManager", + "doc": "The provisioning state of a resource type.", + "isFixed": false, + "isFlags": false, + "usage": "LroPolling", + "decorators": [] + }, + { + "$id": "66", + "kind": "enum", + "name": "Origin", + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.Origin", + "valueType": { + "$id": "67", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "68", + "kind": "enumvalue", + "name": "user", + "value": "user", + "valueType": { + "$id": "69", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "66" + }, + "doc": "Indicates the operation is initiated by a user.", + "decorators": [] + }, + { + "$id": "70", + "kind": "enumvalue", + "name": "system", + "value": "system", + "valueType": { + "$id": "71", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "66" + }, + "doc": "Indicates the operation is initiated by a system.", + "decorators": [] + }, + { + "$id": "72", + "kind": "enumvalue", + "name": "user,system", + "value": "user,system", + "valueType": { + "$id": "73", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "66" + }, + "doc": "Indicates the operation is initiated by a user or system.", + "decorators": [] + } + ], + "clientNamespace": "Azure.ResourceManager.CommonTypes", + "doc": "The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default value is \"user,system\"", + "isFixed": false, + "isFlags": false, + "usage": "Output,Json", + "decorators": [] + }, + { + "$id": "74", + "kind": "enum", + "name": "ActionType", + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.ActionType", + "valueType": { + "$id": "75", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "76", + "kind": "enumvalue", + "name": "Internal", + "value": "Internal", + "valueType": { + "$id": "77", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "74" + }, + "doc": "Actions are for internal-only APIs.", + "decorators": [] + } + ], + "clientNamespace": "Azure.ResourceManager.CommonTypes", + "doc": "Extensible enum. Indicates the action type. \"Internal\" refers to actions that are for internal only APIs.", + "isFixed": false, + "isFlags": false, + "usage": "Output,Json", + "decorators": [] + }, + { + "$id": "78", + "kind": "enum", + "name": "Versions", + "crossLanguageDefinitionId": "Microsoft.Chaos.Versions", + "valueType": { + "$id": "79", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "80", + "kind": "enumvalue", + "name": "v2025_01_01", + "value": "2025-01-01", + "valueType": { + "$id": "81", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "78" + }, + "doc": "The 2025-01-01 API version.", + "decorators": [] + } + ], + "clientNamespace": "Microsoft.Chaos", + "doc": "The available API versions.", + "isFixed": true, + "isFlags": false, + "usage": "ApiVersionEnum", + "decorators": [] + } + ], + "Models": [ + { + "$id": "82", + "kind": "model", + "name": "OperationStatusResult", + "clientNamespace": "Azure.ResourceManager.CommonTypes", + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.OperationStatusResult", + "usage": "Output,Json", + "doc": "The current status of an async operation.", + "decorators": [], + "properties": [ + { + "$id": "83", + "kind": "property", + "name": "id", + "serializedName": "id", + "doc": "Fully qualified ID for the async operation.", + "type": { + "$id": "84", + "kind": "string", + "name": "armResourceIdentifier", + "crossLanguageDefinitionId": "Azure.Core.armResourceIdentifier", + "baseType": { + "$id": "85", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.OperationStatusResult.id", + "serializationOptions": { + "$id": "86", + "json": { + "$id": "87", + "name": "id" + } + } + }, + { + "$id": "88", + "kind": "property", + "name": "name", + "serializedName": "name", + "doc": "Name of the async operation.", + "type": { + "$id": "89", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.OperationStatusResult.name", + "serializationOptions": { + "$id": "90", + "json": { + "$id": "91", + "name": "name" + } + } + }, + { + "$id": "92", + "kind": "property", + "name": "status", + "serializedName": "status", + "doc": "Operation status.", + "type": { + "$id": "93", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.OperationStatusResult.status", + "serializationOptions": { + "$id": "94", + "json": { + "$id": "95", + "name": "status" + } + } + }, + { + "$id": "96", + "kind": "property", + "name": "percentComplete", + "serializedName": "percentComplete", + "doc": "Percent of the operation that is complete.", + "type": { + "$id": "97", + "kind": "float64", + "name": "float64", + "crossLanguageDefinitionId": "TypeSpec.float64", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.OperationStatusResult.percentComplete", + "serializationOptions": { + "$id": "98", + "json": { + "$id": "99", + "name": "percentComplete" + } + } + }, + { + "$id": "100", + "kind": "property", + "name": "startTime", + "serializedName": "startTime", + "doc": "The start time of the operation.", + "type": { + "$id": "101", + "kind": "utcDateTime", + "name": "utcDateTime", + "encode": "rfc3339", + "wireType": { + "$id": "102", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.utcDateTime", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.OperationStatusResult.startTime", + "serializationOptions": { + "$id": "103", + "json": { + "$id": "104", + "name": "startTime" + } + } + }, + { + "$id": "105", + "kind": "property", + "name": "endTime", + "serializedName": "endTime", + "doc": "The end time of the operation.", + "type": { + "$id": "106", + "kind": "utcDateTime", + "name": "utcDateTime", + "encode": "rfc3339", + "wireType": { + "$id": "107", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.utcDateTime", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.OperationStatusResult.endTime", + "serializationOptions": { + "$id": "108", + "json": { + "$id": "109", + "name": "endTime" + } + } + }, + { + "$id": "110", + "kind": "property", + "name": "operations", + "serializedName": "operations", + "doc": "The operations list.", + "type": { + "$id": "111", + "kind": "array", + "name": "ArrayOperationStatusResult", + "valueType": { + "$ref": "82" + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.OperationStatusResult.operations", + "serializationOptions": { + "$id": "112", + "json": { + "$id": "113", + "name": "operations" + } + } + }, + { + "$id": "114", + "kind": "property", + "name": "error", + "serializedName": "error", + "doc": "If present, details of the operation error.", + "type": { + "$id": "115", + "kind": "model", + "name": "ErrorDetail", + "clientNamespace": "Azure.ResourceManager.CommonTypes", + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.ErrorDetail", + "usage": "Output,Json,Exception,LroPolling", + "doc": "The error detail.", + "decorators": [], + "properties": [ + { + "$id": "116", + "kind": "property", + "name": "code", + "serializedName": "code", + "doc": "The error code.", + "type": { + "$id": "117", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.ErrorDetail.code", + "serializationOptions": { + "$id": "118", + "json": { + "$id": "119", + "name": "code" + } + } + }, + { + "$id": "120", + "kind": "property", + "name": "message", + "serializedName": "message", + "doc": "The error message.", + "type": { + "$id": "121", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.ErrorDetail.message", + "serializationOptions": { + "$id": "122", + "json": { + "$id": "123", + "name": "message" + } + } + }, + { + "$id": "124", + "kind": "property", + "name": "target", + "serializedName": "target", + "doc": "The error target.", + "type": { + "$id": "125", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.ErrorDetail.target", + "serializationOptions": { + "$id": "126", + "json": { + "$id": "127", + "name": "target" + } + } + }, + { + "$id": "128", + "kind": "property", + "name": "details", + "serializedName": "details", + "doc": "The error details.", + "type": { + "$id": "129", + "kind": "array", + "name": "ArrayErrorDetail", + "valueType": { + "$ref": "115" + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.ErrorDetail.details", + "serializationOptions": { + "$id": "130", + "json": { + "$id": "131", + "name": "details" + } + } + }, + { + "$id": "132", + "kind": "property", + "name": "additionalInfo", + "serializedName": "additionalInfo", + "doc": "The error additional info.", + "type": { + "$id": "133", + "kind": "array", + "name": "ArrayErrorAdditionalInfo", + "valueType": { + "$id": "134", + "kind": "model", + "name": "ErrorAdditionalInfo", + "clientNamespace": "Azure.ResourceManager.CommonTypes", + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.ErrorAdditionalInfo", + "usage": "Output,Json,Exception,LroPolling", + "doc": "The resource management error additional info.", + "decorators": [], + "properties": [ + { + "$id": "135", + "kind": "property", + "name": "type", + "serializedName": "type", + "doc": "The additional info type.", + "type": { + "$id": "136", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.ErrorAdditionalInfo.type", + "serializationOptions": { + "$id": "137", + "json": { + "$id": "138", + "name": "type" + } + } + }, + { + "$id": "139", + "kind": "property", + "name": "info", + "serializedName": "info", + "doc": "The additional info.", + "type": { + "$id": "140", + "kind": "model", + "name": "ErrorAdditionalInfoInfo", + "clientNamespace": "Azure.ResourceManager.CommonTypes", + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.ErrorAdditionalInfo.info.anonymous", + "usage": "Output,Json,Exception,LroPolling", + "decorators": [], + "properties": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.ErrorAdditionalInfo.info", + "serializationOptions": { + "$id": "141", + "json": { + "$id": "142", + "name": "info" + } + } + } + ] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.ErrorDetail.additionalInfo", + "serializationOptions": { + "$id": "143", + "json": { + "$id": "144", + "name": "additionalInfo" + } + } + } + ] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.OperationStatusResult.error", + "serializationOptions": { + "$id": "145", + "json": { + "$id": "146", + "name": "error" + } + } + }, + { + "$id": "147", + "kind": "property", + "name": "resourceId", + "serializedName": "resourceId", + "doc": "Fully qualified ID of the resource against which the original async operation was started.", + "type": { + "$id": "148", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.OperationStatusResult.resourceId", + "serializationOptions": { + "$id": "149", + "json": { + "$id": "150", + "name": "resourceId" + } + } + } + ] + }, + { + "$ref": "115" + }, + { + "$ref": "134" + }, + { + "$ref": "140" + }, + { + "$id": "151", + "kind": "model", + "name": "ErrorResponse", + "clientNamespace": "Azure.ResourceManager.CommonTypes", + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.ErrorResponse", + "usage": "Error,Json,Exception", + "doc": "Common error response for all Azure Resource Manager APIs to return error details for failed operations.", + "decorators": [], + "properties": [ + { + "$id": "152", + "kind": "property", + "name": "error", + "serializedName": "error", + "doc": "The error object.", + "type": { + "$ref": "115" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.ErrorResponse.error", + "serializationOptions": { + "$id": "153", + "json": { + "$id": "154", + "name": "error" + } + } + } + ] + }, + { + "$id": "155", + "kind": "model", + "name": "ChaosTargetMetadata", + "clientNamespace": "Microsoft.Chaos", + "crossLanguageDefinitionId": "Microsoft.Chaos.TargetType", + "usage": "Output,Json", + "doc": "Model that represents a Target Type resource.", + "decorators": [], + "baseModel": { + "$id": "156", + "kind": "model", + "name": "ProxyResource", + "clientNamespace": "Azure.ResourceManager.CommonTypes", + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.ProxyResource", + "usage": "Input,Output,Json", + "doc": "The resource model definition for a Azure Resource Manager proxy resource. It will not have tags and a location", + "decorators": [], + "baseModel": { + "$id": "157", + "kind": "model", + "name": "Resource", + "clientNamespace": "Azure.ResourceManager.CommonTypes", + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.Resource", + "usage": "Input,Output,Json,LroInitial,LroFinalEnvelope", + "doc": "Common fields that are returned in the response for all Azure Resource Manager resources", + "decorators": [], + "properties": [ + { + "$id": "158", + "kind": "property", + "name": "id", + "serializedName": "id", + "doc": "Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}", + "type": { + "$id": "159", + "kind": "string", + "name": "armResourceIdentifier", + "crossLanguageDefinitionId": "Azure.Core.armResourceIdentifier", + "baseType": { + "$id": "160", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.Resource.id", + "serializationOptions": { + "$id": "161", + "json": { + "$id": "162", + "name": "id" + } + } + }, + { + "$id": "163", + "kind": "property", + "name": "name", + "serializedName": "name", + "doc": "The name of the resource", + "type": { + "$id": "164", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.Resource.name", + "serializationOptions": { + "$id": "165", + "json": { + "$id": "166", + "name": "name" + } + } + }, + { + "$id": "167", + "kind": "property", + "name": "type", + "serializedName": "type", + "doc": "The type of the resource. E.g. \"Microsoft.Compute/virtualMachines\" or \"Microsoft.Storage/storageAccounts\"", + "type": { + "$id": "168", + "kind": "string", + "name": "armResourceType", + "crossLanguageDefinitionId": "Azure.Core.armResourceType", + "baseType": { + "$id": "169", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.Resource.type", + "serializationOptions": { + "$id": "170", + "json": { + "$id": "171", + "name": "type" + } + } + }, + { + "$id": "172", + "kind": "property", + "name": "systemData", + "serializedName": "systemData", + "doc": "Azure Resource Manager metadata containing createdBy and modifiedBy information.", + "type": { + "$id": "173", + "kind": "model", + "name": "SystemData", + "clientNamespace": "Azure.ResourceManager.CommonTypes", + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.SystemData", + "usage": "Output,Json,LroInitial,LroFinalEnvelope", + "doc": "Metadata pertaining to creation and last modification of the resource.", + "decorators": [], + "properties": [ + { + "$id": "174", + "kind": "property", + "name": "createdBy", + "serializedName": "createdBy", + "doc": "The identity that created the resource.", + "type": { + "$id": "175", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.SystemData.createdBy", + "serializationOptions": { + "$id": "176", + "json": { + "$id": "177", + "name": "createdBy" + } + } + }, + { + "$id": "178", + "kind": "property", + "name": "createdByType", + "serializedName": "createdByType", + "doc": "The type of identity that created the resource.", + "type": { + "$ref": "2" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.SystemData.createdByType", + "serializationOptions": { + "$id": "179", + "json": { + "$id": "180", + "name": "createdByType" + } + } + }, + { + "$id": "181", + "kind": "property", + "name": "createdAt", + "serializedName": "createdAt", + "doc": "The timestamp of resource creation (UTC).", + "type": { + "$id": "182", + "kind": "utcDateTime", + "name": "utcDateTime", + "encode": "rfc3339", + "wireType": { + "$id": "183", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.utcDateTime", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.SystemData.createdAt", + "serializationOptions": { + "$id": "184", + "json": { + "$id": "185", + "name": "createdAt" + } + } + }, + { + "$id": "186", + "kind": "property", + "name": "lastModifiedBy", + "serializedName": "lastModifiedBy", + "doc": "The identity that last modified the resource.", + "type": { + "$id": "187", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.SystemData.lastModifiedBy", + "serializationOptions": { + "$id": "188", + "json": { + "$id": "189", + "name": "lastModifiedBy" + } + } + }, + { + "$id": "190", + "kind": "property", + "name": "lastModifiedByType", + "serializedName": "lastModifiedByType", + "doc": "The type of identity that last modified the resource.", + "type": { + "$ref": "2" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.SystemData.lastModifiedByType", + "serializationOptions": { + "$id": "191", + "json": { + "$id": "192", + "name": "lastModifiedByType" + } + } + }, + { + "$id": "193", + "kind": "property", + "name": "lastModifiedAt", + "serializedName": "lastModifiedAt", + "doc": "The timestamp of resource last modification (UTC)", + "type": { + "$id": "194", + "kind": "utcDateTime", + "name": "utcDateTime", + "encode": "rfc3339", + "wireType": { + "$id": "195", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.utcDateTime", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.SystemData.lastModifiedAt", + "serializationOptions": { + "$id": "196", + "json": { + "$id": "197", + "name": "lastModifiedAt" + } + } + } + ] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.Resource.systemData", + "serializationOptions": { + "$id": "198", + "json": { + "$id": "199", + "name": "systemData" + } + } + } + ] + }, + "properties": [] + }, + "properties": [ + { + "$id": "200", + "kind": "property", + "name": "properties", + "serializedName": "properties", + "doc": "The properties of the target type resource.", + "type": { + "$id": "201", + "kind": "model", + "name": "TargetTypeProperties", + "clientNamespace": "Microsoft.Chaos", + "crossLanguageDefinitionId": "Microsoft.Chaos.TargetTypeProperties", + "usage": "Output,Json", + "doc": "Model that represents the base Target Type properties model.", + "decorators": [], + "properties": [ + { + "$id": "202", + "kind": "property", + "name": "displayName", + "serializedName": "displayName", + "doc": "Localized string of the display name.", + "type": { + "$id": "203", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.Chaos.TargetTypeProperties.displayName", + "serializationOptions": { + "$id": "204", + "json": { + "$id": "205", + "name": "displayName" + } + } + }, + { + "$id": "206", + "kind": "property", + "name": "description", + "serializedName": "description", + "doc": "Localized string of the description.", + "type": { + "$id": "207", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.Chaos.TargetTypeProperties.description", + "serializationOptions": { + "$id": "208", + "json": { + "$id": "209", + "name": "description" + } + } + }, + { + "$id": "210", + "kind": "property", + "name": "propertiesSchema", + "serializedName": "propertiesSchema", + "doc": "URL to retrieve JSON schema of the Target Type properties.", + "type": { + "$id": "211", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.Chaos.TargetTypeProperties.propertiesSchema", + "serializationOptions": { + "$id": "212", + "json": { + "$id": "213", + "name": "propertiesSchema" + } + } + }, + { + "$id": "214", + "kind": "property", + "name": "resourceTypes", + "serializedName": "resourceTypes", + "doc": "List of resource types this Target Type can extend.", + "type": { + "$id": "215", + "kind": "array", + "name": "Array", + "valueType": { + "$id": "216", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.Chaos.TargetTypeProperties.resourceTypes", + "serializationOptions": { + "$id": "217", + "json": { + "$id": "218", + "name": "resourceTypes" + } + } + } + ] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": true, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.Chaos.TargetType.properties", + "serializationOptions": { + "$id": "219", + "json": { + "$id": "220", + "name": "properties" + } + } + } + ] + }, + { + "$ref": "201" + }, + { + "$ref": "156" + }, + { + "$ref": "157" + }, + { + "$ref": "173" + }, + { + "$id": "221", + "kind": "model", + "name": "TargetTypeListResult", + "clientNamespace": "Microsoft.Chaos", + "crossLanguageDefinitionId": "Microsoft.Chaos.TargetTypeListResult", + "usage": "Output,Json", + "doc": "Model that represents a list of Target Type resources and a link for pagination.", + "decorators": [], + "properties": [ + { + "$id": "222", + "kind": "property", + "name": "value", + "serializedName": "value", + "doc": "The TargetType items on this page", + "type": { + "$id": "223", + "kind": "array", + "name": "ArrayTargetType", + "valueType": { + "$ref": "155" + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.Chaos.TargetTypeListResult.value", + "serializationOptions": { + "$id": "224", + "json": { + "$id": "225", + "name": "value" + } + } + }, + { + "$id": "226", + "kind": "property", + "name": "nextLink", + "serializedName": "nextLink", + "doc": "The link to the next page of items", + "type": { + "$id": "227", + "kind": "url", + "name": "ResourceLocation", + "crossLanguageDefinitionId": "TypeSpec.Rest.ResourceLocation", + "baseType": { + "$id": "228", + "kind": "url", + "name": "url", + "crossLanguageDefinitionId": "TypeSpec.url", + "decorators": [] + }, + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.Chaos.TargetTypeListResult.nextLink", + "serializationOptions": { + "$id": "229", + "json": { + "$id": "230", + "name": "nextLink" + } + } + } + ] + }, + { + "$id": "231", + "kind": "model", + "name": "ChaosExperimentExecution", + "clientNamespace": "Microsoft.Chaos", + "crossLanguageDefinitionId": "Microsoft.Chaos.ExperimentExecution", + "usage": "Output,Json", + "doc": "Model that represents the execution of a Experiment.", + "decorators": [], + "baseModel": { + "$ref": "156" + }, + "properties": [ + { + "$id": "232", + "kind": "property", + "name": "properties", + "serializedName": "properties", + "doc": "The properties of experiment execution status.", + "type": { + "$id": "233", + "kind": "model", + "name": "ExperimentExecutionProperties", + "clientNamespace": "Microsoft.Chaos", + "crossLanguageDefinitionId": "Microsoft.Chaos.ExperimentExecutionProperties", + "usage": "Output,Json", + "doc": "Model that represents the execution properties of an Experiment.", + "decorators": [], + "properties": [ + { + "$id": "234", + "kind": "property", + "name": "status", + "serializedName": "status", + "doc": "The status of the execution.", + "type": { + "$id": "235", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.Chaos.ExperimentExecutionProperties.status", + "serializationOptions": { + "$id": "236", + "json": { + "$id": "237", + "name": "status" + } + } + }, + { + "$id": "238", + "kind": "property", + "name": "startedAt", + "serializedName": "startedAt", + "doc": "String that represents the start date time.", + "type": { + "$id": "239", + "kind": "utcDateTime", + "name": "utcDateTime", + "encode": "rfc3339", + "wireType": { + "$id": "240", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.utcDateTime", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.Chaos.ExperimentExecutionProperties.startedAt", + "serializationOptions": { + "$id": "241", + "json": { + "$id": "242", + "name": "startedAt" + } + } + }, + { + "$id": "243", + "kind": "property", + "name": "stoppedAt", + "serializedName": "stoppedAt", + "doc": "String that represents the stop date time.", + "type": { + "$id": "244", + "kind": "utcDateTime", + "name": "utcDateTime", + "encode": "rfc3339", + "wireType": { + "$id": "245", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.utcDateTime", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.Chaos.ExperimentExecutionProperties.stoppedAt", + "serializationOptions": { + "$id": "246", + "json": { + "$id": "247", + "name": "stoppedAt" + } + } + } + ] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": true, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.Chaos.ExperimentExecution.properties", + "serializationOptions": { + "$id": "248", + "json": { + "$id": "249", + "name": "properties" + } + } + } + ] + }, + { + "$ref": "233" + }, + { + "$id": "250", + "kind": "model", + "name": "ExperimentExecutionListResult", + "clientNamespace": "Microsoft.Chaos", + "crossLanguageDefinitionId": "Microsoft.Chaos.ExperimentExecutionListResult", + "usage": "Output,Json", + "doc": "Model that represents a list of Experiment executions and a link for pagination.", + "decorators": [], + "properties": [ + { + "$id": "251", + "kind": "property", + "name": "value", + "serializedName": "value", + "doc": "The ExperimentExecution items on this page", + "type": { + "$id": "252", + "kind": "array", + "name": "ArrayExperimentExecution", + "valueType": { + "$ref": "231" + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.Chaos.ExperimentExecutionListResult.value", + "serializationOptions": { + "$id": "253", + "json": { + "$id": "254", + "name": "value" + } + } + }, + { + "$id": "255", + "kind": "property", + "name": "nextLink", + "serializedName": "nextLink", + "doc": "The link to the next page of items", + "type": { + "$id": "256", + "kind": "url", + "name": "ResourceLocation", + "crossLanguageDefinitionId": "TypeSpec.Rest.ResourceLocation", + "baseType": { + "$id": "257", + "kind": "url", + "name": "url", + "crossLanguageDefinitionId": "TypeSpec.url", + "decorators": [] + }, + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.Chaos.ExperimentExecutionListResult.nextLink", + "serializationOptions": { + "$id": "258", + "json": { + "$id": "259", + "name": "nextLink" + } + } + } + ] + }, + { + "$id": "260", + "kind": "model", + "name": "ExperimentExecutionDetails", + "clientNamespace": "Microsoft.Chaos", + "crossLanguageDefinitionId": "Microsoft.Chaos.ExperimentExecutionDetails", + "usage": "Output,Json", + "doc": "Model that represents the execution details of an Experiment.", + "decorators": [], + "properties": [ + { + "$id": "261", + "kind": "property", + "name": "type", + "serializedName": "type", + "doc": "String of the resource type.", + "type": { + "$id": "262", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.Chaos.ExperimentExecutionDetails.type", + "serializationOptions": { + "$id": "263", + "json": { + "$id": "264", + "name": "type" + } + } + }, + { + "$id": "265", + "kind": "property", + "name": "id", + "serializedName": "id", + "doc": "String of the fully qualified resource ID.", + "type": { + "$id": "266", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.Chaos.ExperimentExecutionDetails.id", + "serializationOptions": { + "$id": "267", + "json": { + "$id": "268", + "name": "id" + } + } + }, + { + "$id": "269", + "kind": "property", + "name": "name", + "serializedName": "name", + "doc": "String of the resource name.", + "type": { + "$id": "270", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.Chaos.ExperimentExecutionDetails.name", + "serializationOptions": { + "$id": "271", + "json": { + "$id": "272", + "name": "name" + } + } + }, + { + "$id": "273", + "kind": "property", + "name": "properties", + "serializedName": "properties", + "doc": "The properties of the experiment execution details.", + "type": { + "$id": "274", + "kind": "model", + "name": "ExperimentExecutionDetailsProperties", + "clientNamespace": "Microsoft.Chaos", + "crossLanguageDefinitionId": "Microsoft.Chaos.ExperimentExecutionDetailsProperties", + "usage": "Output,Json", + "doc": "Model that represents the extended properties of an experiment execution.", + "decorators": [], + "properties": [ + { + "$id": "275", + "kind": "property", + "name": "status", + "serializedName": "status", + "doc": "The status of the execution.", + "type": { + "$id": "276", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.Chaos.ExperimentExecutionDetailsProperties.status", + "serializationOptions": { + "$id": "277", + "json": { + "$id": "278", + "name": "status" + } + } + }, + { + "$id": "279", + "kind": "property", + "name": "startedAt", + "serializedName": "startedAt", + "doc": "String that represents the start date time.", + "type": { + "$id": "280", + "kind": "utcDateTime", + "name": "utcDateTime", + "encode": "rfc3339", + "wireType": { + "$id": "281", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.utcDateTime", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.Chaos.ExperimentExecutionDetailsProperties.startedAt", + "serializationOptions": { + "$id": "282", + "json": { + "$id": "283", + "name": "startedAt" + } + } + }, + { + "$id": "284", + "kind": "property", + "name": "stoppedAt", + "serializedName": "stoppedAt", + "doc": "String that represents the stop date time.", + "type": { + "$id": "285", + "kind": "utcDateTime", + "name": "utcDateTime", + "encode": "rfc3339", + "wireType": { + "$id": "286", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.utcDateTime", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.Chaos.ExperimentExecutionDetailsProperties.stoppedAt", + "serializationOptions": { + "$id": "287", + "json": { + "$id": "288", + "name": "stoppedAt" + } + } + }, + { + "$id": "289", + "kind": "property", + "name": "failureReason", + "serializedName": "failureReason", + "doc": "The reason why the execution failed.", + "type": { + "$id": "290", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.Chaos.ExperimentExecutionDetailsProperties.failureReason", + "serializationOptions": { + "$id": "291", + "json": { + "$id": "292", + "name": "failureReason" + } + } + }, + { + "$id": "293", + "kind": "property", + "name": "lastActionAt", + "serializedName": "lastActionAt", + "doc": "String that represents the last action date time.", + "type": { + "$id": "294", + "kind": "utcDateTime", + "name": "utcDateTime", + "encode": "rfc3339", + "wireType": { + "$id": "295", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.utcDateTime", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.Chaos.ExperimentExecutionDetailsProperties.lastActionAt", + "serializationOptions": { + "$id": "296", + "json": { + "$id": "297", + "name": "lastActionAt" + } + } + }, + { + "$id": "298", + "kind": "property", + "name": "runInformation", + "serializedName": "runInformation", + "doc": "The information of the experiment run.", + "type": { + "$id": "299", + "kind": "model", + "name": "ExperimentExecutionDetailsPropertiesRunInformation", + "clientNamespace": "Microsoft.Chaos", + "crossLanguageDefinitionId": "Microsoft.Chaos.ExperimentExecutionDetailsPropertiesRunInformation", + "usage": "Output,Json", + "doc": "The information of the experiment run.", + "decorators": [], + "properties": [ + { + "$id": "300", + "kind": "property", + "name": "steps", + "serializedName": "steps", + "doc": "The steps of the experiment run.", + "type": { + "$id": "301", + "kind": "array", + "name": "ArrayStepStatus", + "valueType": { + "$id": "302", + "kind": "model", + "name": "ChaosExperimentRunStepStatus", + "clientNamespace": "Microsoft.Chaos", + "crossLanguageDefinitionId": "Microsoft.Chaos.StepStatus", + "usage": "Output,Json", + "doc": "Model that represents the a list of branches and branch statuses.", + "decorators": [], + "properties": [ + { + "$id": "303", + "kind": "property", + "name": "stepName", + "serializedName": "stepName", + "doc": "The name of the step.", + "type": { + "$id": "304", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.Chaos.StepStatus.stepName", + "serializationOptions": { + "$id": "305", + "json": { + "$id": "306", + "name": "stepName" + } + } + }, + { + "$id": "307", + "kind": "property", + "name": "stepId", + "serializedName": "stepId", + "doc": "The id of the step.", + "type": { + "$id": "308", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.Chaos.StepStatus.stepId", + "serializationOptions": { + "$id": "309", + "json": { + "$id": "310", + "name": "stepId" + } + } + }, + { + "$id": "311", + "kind": "property", + "name": "status", + "serializedName": "status", + "doc": "The value of the status of the step.", + "type": { + "$id": "312", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.Chaos.StepStatus.status", + "serializationOptions": { + "$id": "313", + "json": { + "$id": "314", + "name": "status" + } + } + }, + { + "$id": "315", + "kind": "property", + "name": "branches", + "serializedName": "branches", + "doc": "The array of branches.", + "type": { + "$id": "316", + "kind": "array", + "name": "ArrayBranchStatus", + "valueType": { + "$id": "317", + "kind": "model", + "name": "ChaosExperimentRunBranchStatus", + "clientNamespace": "Microsoft.Chaos", + "crossLanguageDefinitionId": "Microsoft.Chaos.BranchStatus", + "usage": "Output,Json", + "doc": "Model that represents the a list of actions and action statuses.", + "decorators": [], + "properties": [ + { + "$id": "318", + "kind": "property", + "name": "branchName", + "serializedName": "branchName", + "doc": "The name of the branch status.", + "type": { + "$id": "319", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.Chaos.BranchStatus.branchName", + "serializationOptions": { + "$id": "320", + "json": { + "$id": "321", + "name": "branchName" + } + } + }, + { + "$id": "322", + "kind": "property", + "name": "branchId", + "serializedName": "branchId", + "doc": "The id of the branch status.", + "type": { + "$id": "323", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.Chaos.BranchStatus.branchId", + "serializationOptions": { + "$id": "324", + "json": { + "$id": "325", + "name": "branchId" + } + } + }, + { + "$id": "326", + "kind": "property", + "name": "status", + "serializedName": "status", + "doc": "The status of the branch.", + "type": { + "$id": "327", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.Chaos.BranchStatus.status", + "serializationOptions": { + "$id": "328", + "json": { + "$id": "329", + "name": "status" + } + } + }, + { + "$id": "330", + "kind": "property", + "name": "actions", + "serializedName": "actions", + "doc": "The array of actions.", + "type": { + "$id": "331", + "kind": "array", + "name": "ArrayActionStatus", + "valueType": { + "$id": "332", + "kind": "model", + "name": "ChaosExperimentRunActionStatus", + "clientNamespace": "Microsoft.Chaos", + "crossLanguageDefinitionId": "Microsoft.Chaos.ActionStatus", + "usage": "Output,Json", + "doc": "Model that represents the an action and its status.", + "decorators": [], + "properties": [ + { + "$id": "333", + "kind": "property", + "name": "actionName", + "serializedName": "actionName", + "doc": "The name of the action status.", + "type": { + "$id": "334", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.Chaos.ActionStatus.actionName", + "serializationOptions": { + "$id": "335", + "json": { + "$id": "336", + "name": "actionName" + } + } + }, + { + "$id": "337", + "kind": "property", + "name": "actionId", + "serializedName": "actionId", + "doc": "The id of the action status.", + "type": { + "$id": "338", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.Chaos.ActionStatus.actionId", + "serializationOptions": { + "$id": "339", + "json": { + "$id": "340", + "name": "actionId" + } + } + }, + { + "$id": "341", + "kind": "property", + "name": "status", + "serializedName": "status", + "doc": "The status of the action.", + "type": { + "$id": "342", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.Chaos.ActionStatus.status", + "serializationOptions": { + "$id": "343", + "json": { + "$id": "344", + "name": "status" + } + } + }, + { + "$id": "345", + "kind": "property", + "name": "startTime", + "serializedName": "startTime", + "doc": "String that represents the start time of the action.", + "type": { + "$id": "346", + "kind": "utcDateTime", + "name": "utcDateTime", + "encode": "rfc3339", + "wireType": { + "$id": "347", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.utcDateTime", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.Chaos.ActionStatus.startTime", + "serializationOptions": { + "$id": "348", + "json": { + "$id": "349", + "name": "startTime" + } + } + }, + { + "$id": "350", + "kind": "property", + "name": "endTime", + "serializedName": "endTime", + "doc": "String that represents the end time of the action.", + "type": { + "$id": "351", + "kind": "utcDateTime", + "name": "utcDateTime", + "encode": "rfc3339", + "wireType": { + "$id": "352", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.utcDateTime", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.Chaos.ActionStatus.endTime", + "serializationOptions": { + "$id": "353", + "json": { + "$id": "354", + "name": "endTime" + } + } + }, + { + "$id": "355", + "kind": "property", + "name": "targets", + "serializedName": "targets", + "doc": "The array of targets.", + "type": { + "$id": "356", + "kind": "array", + "name": "ArrayExperimentExecutionActionTargetDetailsProperties", + "valueType": { + "$id": "357", + "kind": "model", + "name": "ExperimentExecutionActionTargetDetailsProperties", + "clientNamespace": "Microsoft.Chaos", + "crossLanguageDefinitionId": "Microsoft.Chaos.ExperimentExecutionActionTargetDetailsProperties", + "usage": "Output,Json", + "doc": "Model that represents the Experiment action target details properties model.", + "decorators": [], + "properties": [ + { + "$id": "358", + "kind": "property", + "name": "status", + "serializedName": "status", + "doc": "The status of the execution.", + "type": { + "$id": "359", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.Chaos.ExperimentExecutionActionTargetDetailsProperties.status", + "serializationOptions": { + "$id": "360", + "json": { + "$id": "361", + "name": "status" + } + } + }, + { + "$id": "362", + "kind": "property", + "name": "target", + "serializedName": "target", + "doc": "The target for the action.", + "type": { + "$id": "363", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.Chaos.ExperimentExecutionActionTargetDetailsProperties.target", + "serializationOptions": { + "$id": "364", + "json": { + "$id": "365", + "name": "target" + } + } + }, + { + "$id": "366", + "kind": "property", + "name": "targetFailedTime", + "serializedName": "targetFailedTime", + "doc": "String that represents the failed date time.", + "type": { + "$id": "367", + "kind": "utcDateTime", + "name": "utcDateTime", + "encode": "rfc3339", + "wireType": { + "$id": "368", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.utcDateTime", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.Chaos.ExperimentExecutionActionTargetDetailsProperties.targetFailedTime", + "serializationOptions": { + "$id": "369", + "json": { + "$id": "370", + "name": "targetFailedTime" + } + } + }, + { + "$id": "371", + "kind": "property", + "name": "targetCompletedTime", + "serializedName": "targetCompletedTime", + "doc": "String that represents the completed date time.", + "type": { + "$id": "372", + "kind": "utcDateTime", + "name": "utcDateTime", + "encode": "rfc3339", + "wireType": { + "$id": "373", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.utcDateTime", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.Chaos.ExperimentExecutionActionTargetDetailsProperties.targetCompletedTime", + "serializationOptions": { + "$id": "374", + "json": { + "$id": "375", + "name": "targetCompletedTime" + } + } + }, + { + "$id": "376", + "kind": "property", + "name": "error", + "serializedName": "error", + "doc": "The error of the action.", + "type": { + "$id": "377", + "kind": "model", + "name": "ExperimentExecutionActionTargetDetailsError", + "clientNamespace": "Microsoft.Chaos", + "crossLanguageDefinitionId": "Microsoft.Chaos.ExperimentExecutionActionTargetDetailsError", + "usage": "Output,Json", + "doc": "Model that represents the Experiment action target details error model.", + "decorators": [], + "properties": [ + { + "$id": "378", + "kind": "property", + "name": "code", + "serializedName": "code", + "doc": "The error code.", + "type": { + "$id": "379", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.Chaos.ExperimentExecutionActionTargetDetailsError.code", + "serializationOptions": { + "$id": "380", + "json": { + "$id": "381", + "name": "code" + } + } + }, + { + "$id": "382", + "kind": "property", + "name": "message", + "serializedName": "message", + "doc": "The error message", + "type": { + "$id": "383", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.Chaos.ExperimentExecutionActionTargetDetailsError.message", + "serializationOptions": { + "$id": "384", + "json": { + "$id": "385", + "name": "message" + } + } + } + ] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.Chaos.ExperimentExecutionActionTargetDetailsProperties.error", + "serializationOptions": { + "$id": "386", + "json": { + "$id": "387", + "name": "error" + } + } + } + ] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.Chaos.ActionStatus.targets", + "serializationOptions": { + "$id": "388", + "json": { + "$id": "389", + "name": "targets" + } + } + } + ] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.Chaos.BranchStatus.actions", + "serializationOptions": { + "$id": "390", + "json": { + "$id": "391", + "name": "actions" + } + } + } + ] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.Chaos.StepStatus.branches", + "serializationOptions": { + "$id": "392", + "json": { + "$id": "393", + "name": "branches" + } + } + } + ] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.Chaos.ExperimentExecutionDetailsPropertiesRunInformation.steps", + "serializationOptions": { + "$id": "394", + "json": { + "$id": "395", + "name": "steps" + } + } + } + ] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.Chaos.ExperimentExecutionDetailsProperties.runInformation", + "serializationOptions": { + "$id": "396", + "json": { + "$id": "397", + "name": "runInformation" + } + } + } + ] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": true, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.Chaos.ExperimentExecutionDetails.properties", + "serializationOptions": { + "$id": "398", + "json": { + "$id": "399", + "name": "properties" + } + } + } + ] + }, + { + "$ref": "274" + }, + { + "$ref": "299" + }, + { + "$ref": "302" + }, + { + "$ref": "317" + }, + { + "$ref": "332" + }, + { + "$ref": "357" + }, + { + "$ref": "377" + }, + { + "$id": "400", + "kind": "model", + "name": "ChaosExperiment", + "clientNamespace": "Microsoft.Chaos", + "crossLanguageDefinitionId": "Microsoft.Chaos.Experiment", + "usage": "Input,Output,Json,LroInitial,LroFinalEnvelope", + "doc": "Model that represents a Experiment resource.", + "decorators": [], + "baseModel": { + "$id": "401", + "kind": "model", + "name": "TrackedResource", + "clientNamespace": "Azure.ResourceManager.CommonTypes", + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.TrackedResource", + "usage": "Input,Output,Json,LroInitial,LroFinalEnvelope", + "doc": "The resource model definition for an Azure Resource Manager tracked top level resource which has 'tags' and a 'location'", + "decorators": [], + "baseModel": { + "$ref": "157" + }, + "properties": [ + { + "$id": "402", + "kind": "property", + "name": "tags", + "serializedName": "tags", + "doc": "Resource tags.", + "type": { + "$id": "403", + "kind": "dict", + "keyType": { + "$id": "404", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "valueType": { + "$id": "405", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.TrackedResource.tags", + "serializationOptions": { + "$id": "406", + "json": { + "$id": "407", + "name": "tags" + } + } + }, + { + "$id": "408", + "kind": "property", + "name": "location", + "serializedName": "location", + "doc": "The geo-location where the resource lives", + "type": { + "$id": "409", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.TrackedResource.location", + "serializationOptions": { + "$id": "410", + "json": { + "$id": "411", + "name": "location" + } + } + } + ] + }, + "properties": [ + { + "$id": "412", + "kind": "property", + "name": "identity", + "serializedName": "identity", + "doc": "The managed service identities assigned to this resource.", + "type": { + "$id": "413", + "kind": "model", + "name": "ManagedServiceIdentity", + "clientNamespace": "Azure.ResourceManager.CommonTypes", + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.ManagedServiceIdentity", + "usage": "Input,Output,Json,LroInitial,LroFinalEnvelope", + "doc": "Managed service identity (system assigned and/or user assigned identities)", + "decorators": [], + "properties": [ + { + "$id": "414", + "kind": "property", + "name": "principalId", + "serializedName": "principalId", + "doc": "The service principal ID of the system assigned identity. This property will only be provided for a system assigned identity.", + "type": { + "$id": "415", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "416", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.ManagedServiceIdentity.principalId", + "serializationOptions": { + "$id": "417", + "json": { + "$id": "418", + "name": "principalId" + } + } + }, + { + "$id": "419", + "kind": "property", + "name": "tenantId", + "serializedName": "tenantId", + "doc": "The tenant ID of the system assigned identity. This property will only be provided for a system assigned identity.", + "type": { + "$id": "420", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "421", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.ManagedServiceIdentity.tenantId", + "serializationOptions": { + "$id": "422", + "json": { + "$id": "423", + "name": "tenantId" + } + } + }, + { + "$id": "424", + "kind": "property", + "name": "type", + "serializedName": "type", + "doc": "The type of managed identity assigned to this resource.", + "type": { + "$ref": "12" + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.ManagedServiceIdentity.type", + "serializationOptions": { + "$id": "425", + "json": { + "$id": "426", + "name": "type" + } + } + }, + { + "$id": "427", + "kind": "property", + "name": "userAssignedIdentities", + "serializedName": "userAssignedIdentities", + "doc": "The identities assigned to this resource by the user.", + "type": { + "$id": "428", + "kind": "dict", + "keyType": { + "$id": "429", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "valueType": { + "$id": "430", + "kind": "nullable", + "type": { + "$id": "431", + "kind": "model", + "name": "UserAssignedIdentity", + "clientNamespace": "Azure.ResourceManager.CommonTypes", + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.UserAssignedIdentity", + "usage": "Input,Output,Json,LroInitial,LroFinalEnvelope", + "doc": "User assigned identity properties", + "decorators": [], + "properties": [ + { + "$id": "432", + "kind": "property", + "name": "clientId", + "serializedName": "clientId", + "doc": "The client ID of the assigned identity.", + "type": { + "$id": "433", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "434", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.UserAssignedIdentity.clientId", + "serializationOptions": { + "$id": "435", + "json": { + "$id": "436", + "name": "clientId" + } + } + }, + { + "$id": "437", + "kind": "property", + "name": "principalId", + "serializedName": "principalId", + "doc": "The principal ID of the assigned identity.", + "type": { + "$id": "438", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "439", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.UserAssignedIdentity.principalId", + "serializationOptions": { + "$id": "440", + "json": { + "$id": "441", + "name": "principalId" + } + } + } + ] + }, + "clientNamespace": "" + }, + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.ManagedServiceIdentity.userAssignedIdentities", + "serializationOptions": { + "$id": "442", + "json": { + "$id": "443", + "name": "userAssignedIdentities" + } + } + } + ] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.Chaos.Experiment.identity", + "serializationOptions": { + "$id": "444", + "json": { + "$id": "445", + "name": "identity" + } + } + }, + { + "$id": "446", + "kind": "property", + "name": "properties", + "serializedName": "properties", + "doc": "The properties of the experiment resource.", + "type": { + "$id": "447", + "kind": "model", + "name": "ExperimentProperties", + "clientNamespace": "Microsoft.Chaos", + "crossLanguageDefinitionId": "Microsoft.Chaos.ExperimentProperties", + "usage": "Input,Output,Json,LroInitial,LroFinalEnvelope", + "doc": "Model that represents the Experiment properties model.", + "decorators": [], + "properties": [ + { + "$id": "448", + "kind": "property", + "name": "provisioningState", + "serializedName": "provisioningState", + "doc": "Most recent provisioning state for the given experiment resource.", + "type": { + "$ref": "22" + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.Chaos.ExperimentProperties.provisioningState", + "serializationOptions": { + "$id": "449", + "json": { + "$id": "450", + "name": "provisioningState" + } + } + }, + { + "$id": "451", + "kind": "property", + "name": "steps", + "serializedName": "steps", + "doc": "List of steps.", + "type": { + "$id": "452", + "kind": "array", + "name": "ArrayChaosExperimentStep", + "valueType": { + "$id": "453", + "kind": "model", + "name": "ChaosExperimentStep", + "clientNamespace": "Microsoft.Chaos", + "crossLanguageDefinitionId": "Microsoft.Chaos.ChaosExperimentStep", + "usage": "Input,Output,Json,LroInitial,LroFinalEnvelope", + "doc": "Model that represents a step in the Experiment resource.", + "decorators": [], + "properties": [ + { + "$id": "454", + "kind": "property", + "name": "name", + "serializedName": "name", + "doc": "String of the step name.", + "type": { + "$id": "455", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.Chaos.ChaosExperimentStep.name", + "serializationOptions": { + "$id": "456", + "json": { + "$id": "457", + "name": "name" + } + } + }, + { + "$id": "458", + "kind": "property", + "name": "branches", + "serializedName": "branches", + "doc": "List of branches.", + "type": { + "$id": "459", + "kind": "array", + "name": "ArrayChaosExperimentBranch", + "valueType": { + "$id": "460", + "kind": "model", + "name": "ChaosExperimentBranch", + "clientNamespace": "Microsoft.Chaos", + "crossLanguageDefinitionId": "Microsoft.Chaos.ChaosExperimentBranch", + "usage": "Input,Output,Json,LroInitial,LroFinalEnvelope", + "doc": "Model that represents a branch in the step. 9 total per experiment.", + "decorators": [], + "properties": [ + { + "$id": "461", + "kind": "property", + "name": "name", + "serializedName": "name", + "doc": "String of the branch name.", + "type": { + "$id": "462", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.Chaos.ChaosExperimentBranch.name", + "serializationOptions": { + "$id": "463", + "json": { + "$id": "464", + "name": "name" + } + } + }, + { + "$id": "465", + "kind": "property", + "name": "actions", + "serializedName": "actions", + "doc": "List of actions.", + "type": { + "$id": "466", + "kind": "array", + "name": "ArrayChaosExperimentAction", + "valueType": { + "$id": "467", + "kind": "model", + "name": "ChaosExperimentAction", + "clientNamespace": "Microsoft.Chaos", + "crossLanguageDefinitionId": "Microsoft.Chaos.ChaosExperimentAction", + "usage": "Input,Output,Json,LroInitial,LroFinalEnvelope", + "doc": "Model that represents the base action model. 9 total per experiment.", + "decorators": [], + "discriminatorProperty": { + "$id": "468", + "kind": "property", + "name": "type", + "serializedName": "type", + "doc": "Chaos experiment action discriminator type", + "type": { + "$ref": "36" + }, + "optional": false, + "readOnly": false, + "discriminator": true, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.Chaos.ChaosExperimentAction.type", + "serializationOptions": { + "$id": "469", + "json": { + "$id": "470", + "name": "type" + } + } + }, + "properties": [ + { + "$id": "471", + "kind": "property", + "name": "name", + "serializedName": "name", + "doc": "String that represents a Capability URN.", + "type": { + "$id": "472", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.Chaos.ChaosExperimentAction.name", + "serializationOptions": { + "$id": "473", + "json": { + "$id": "474", + "name": "name" + } + } + }, + { + "$ref": "468" + } + ], + "discriminatedSubtypes": { + "$id": "475", + "continuous": { + "$id": "476", + "kind": "model", + "name": "ChaosContinuousAction", + "clientNamespace": "Microsoft.Chaos", + "crossLanguageDefinitionId": "Microsoft.Chaos.ContinuousAction", + "usage": "Input,Output,Json,LroInitial,LroFinalEnvelope", + "doc": "Model that represents a continuous action.", + "discriminatorValue": "continuous", + "decorators": [], + "baseModel": { + "$ref": "467" + }, + "properties": [ + { + "$id": "477", + "kind": "property", + "name": "duration", + "serializedName": "duration", + "doc": "ISO8601 formatted string that represents a duration.", + "type": { + "$id": "478", + "kind": "duration", + "name": "duration", + "encode": "ISO8601", + "wireType": { + "$id": "479", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.duration", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.Chaos.ContinuousAction.duration", + "serializationOptions": { + "$id": "480", + "json": { + "$id": "481", + "name": "duration" + } + } + }, + { + "$id": "482", + "kind": "property", + "name": "parameters", + "serializedName": "parameters", + "doc": "List of key value pairs.", + "type": { + "$id": "483", + "kind": "array", + "name": "ArrayKeyValuePair", + "valueType": { + "$id": "484", + "kind": "model", + "name": "ChaosKeyValuePair", + "clientNamespace": "Microsoft.Chaos", + "crossLanguageDefinitionId": "Microsoft.Chaos.KeyValuePair", + "usage": "Input,Output,Json,LroInitial,LroFinalEnvelope", + "doc": "A map to describe the settings of an action.", + "decorators": [], + "properties": [ + { + "$id": "485", + "kind": "property", + "name": "key", + "serializedName": "key", + "doc": "The name of the setting for the action.", + "type": { + "$id": "486", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.Chaos.KeyValuePair.key", + "serializationOptions": { + "$id": "487", + "json": { + "$id": "488", + "name": "key" + } + } + }, + { + "$id": "489", + "kind": "property", + "name": "value", + "serializedName": "value", + "doc": "The value of the setting for the action.", + "type": { + "$id": "490", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.Chaos.KeyValuePair.value", + "serializationOptions": { + "$id": "491", + "json": { + "$id": "492", + "name": "value" + } + } + } + ] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.Chaos.ContinuousAction.parameters", + "serializationOptions": { + "$id": "493", + "json": { + "$id": "494", + "name": "parameters" + } + } + }, + { + "$id": "495", + "kind": "property", + "name": "selectorId", + "serializedName": "selectorId", + "doc": "String that represents a selector.", + "type": { + "$id": "496", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.Chaos.ContinuousAction.selectorId", + "serializationOptions": { + "$id": "497", + "json": { + "$id": "498", + "name": "selectorId" + } + } + }, + { + "$id": "499", + "kind": "property", + "name": "type", + "serializedName": "type", + "doc": "Enum that discriminates between action models.", + "type": { + "$id": "500", + "kind": "constant", + "valueType": { + "$id": "501", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "continuous", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": true, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.Chaos.ContinuousAction.type", + "serializationOptions": { + "$id": "502", + "json": { + "$id": "503", + "name": "type" + } + } + } + ] + }, + "delay": { + "$id": "504", + "kind": "model", + "name": "ChaosDelayAction", + "clientNamespace": "Microsoft.Chaos", + "crossLanguageDefinitionId": "Microsoft.Chaos.DelayAction", + "usage": "Input,Output,Json,LroInitial,LroFinalEnvelope", + "doc": "Model that represents a delay action.", + "discriminatorValue": "delay", + "decorators": [], + "baseModel": { + "$ref": "467" + }, + "properties": [ + { + "$id": "505", + "kind": "property", + "name": "duration", + "serializedName": "duration", + "doc": "ISO8601 formatted string that represents a duration.", + "type": { + "$id": "506", + "kind": "duration", + "name": "duration", + "encode": "ISO8601", + "wireType": { + "$id": "507", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.duration", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.Chaos.DelayAction.duration", + "serializationOptions": { + "$id": "508", + "json": { + "$id": "509", + "name": "duration" + } + } + }, + { + "$id": "510", + "kind": "property", + "name": "type", + "serializedName": "type", + "doc": "Enum that discriminates between action models.", + "type": { + "$id": "511", + "kind": "constant", + "valueType": { + "$id": "512", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "delay", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": true, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.Chaos.DelayAction.type", + "serializationOptions": { + "$id": "513", + "json": { + "$id": "514", + "name": "type" + } + } + } + ] + }, + "discrete": { + "$id": "515", + "kind": "model", + "name": "ChaosDiscreteAction", + "clientNamespace": "Microsoft.Chaos", + "crossLanguageDefinitionId": "Microsoft.Chaos.DiscreteAction", + "usage": "Input,Output,Json,LroInitial,LroFinalEnvelope", + "doc": "Model that represents a discrete action.", + "discriminatorValue": "discrete", + "decorators": [], + "baseModel": { + "$ref": "467" + }, + "properties": [ + { + "$id": "516", + "kind": "property", + "name": "parameters", + "serializedName": "parameters", + "doc": "List of key value pairs.", + "type": { + "$id": "517", + "kind": "array", + "name": "ArrayKeyValuePair", + "valueType": { + "$ref": "484" + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.Chaos.DiscreteAction.parameters", + "serializationOptions": { + "$id": "518", + "json": { + "$id": "519", + "name": "parameters" + } + } + }, + { + "$id": "520", + "kind": "property", + "name": "selectorId", + "serializedName": "selectorId", + "doc": "String that represents a selector.", + "type": { + "$id": "521", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.Chaos.DiscreteAction.selectorId", + "serializationOptions": { + "$id": "522", + "json": { + "$id": "523", + "name": "selectorId" + } + } + }, + { + "$id": "524", + "kind": "property", + "name": "type", + "serializedName": "type", + "doc": "Enum that discriminates between action models.", + "type": { + "$id": "525", + "kind": "constant", + "valueType": { + "$id": "526", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "discrete", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": true, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.Chaos.DiscreteAction.type", + "serializationOptions": { + "$id": "527", + "json": { + "$id": "528", + "name": "type" + } + } + } + ] + } + } + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.Chaos.ChaosExperimentBranch.actions", + "serializationOptions": { + "$id": "529", + "json": { + "$id": "530", + "name": "actions" + } + } + } + ] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.Chaos.ChaosExperimentStep.branches", + "serializationOptions": { + "$id": "531", + "json": { + "$id": "532", + "name": "branches" + } + } + } + ] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.Chaos.ExperimentProperties.steps", + "serializationOptions": { + "$id": "533", + "json": { + "$id": "534", + "name": "steps" + } + } + }, + { + "$id": "535", + "kind": "property", + "name": "selectors", + "serializedName": "selectors", + "doc": "List of selectors.", + "type": { + "$id": "536", + "kind": "array", + "name": "ArrayChaosTargetSelector", + "valueType": { + "$id": "537", + "kind": "model", + "name": "ChaosTargetSelector", + "clientNamespace": "Microsoft.Chaos", + "crossLanguageDefinitionId": "Microsoft.Chaos.ChaosTargetSelector", + "usage": "Input,Output,Json,LroInitial,LroFinalEnvelope", + "doc": "Model that represents a selector in the Experiment resource.", + "decorators": [], + "discriminatorProperty": { + "$id": "538", + "kind": "property", + "name": "type", + "serializedName": "type", + "doc": "Chaos target selector discriminator type", + "type": { + "$ref": "44" + }, + "optional": false, + "readOnly": false, + "discriminator": true, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.Chaos.ChaosTargetSelector.type", + "serializationOptions": { + "$id": "539", + "json": { + "$id": "540", + "name": "type" + } + } + }, + "properties": [ + { + "$id": "541", + "kind": "property", + "name": "id", + "serializedName": "id", + "doc": "String of the selector ID.", + "type": { + "$id": "542", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.Chaos.ChaosTargetSelector.id", + "serializationOptions": { + "$id": "543", + "json": { + "$id": "544", + "name": "id" + } + } + }, + { + "$ref": "538" + }, + { + "$id": "545", + "kind": "property", + "name": "filter", + "serializedName": "filter", + "doc": "Model that represents available filter types that can be applied to a targets list.", + "type": { + "$id": "546", + "kind": "model", + "name": "ChaosTargetFilter", + "clientNamespace": "Microsoft.Chaos", + "crossLanguageDefinitionId": "Microsoft.Chaos.ChaosTargetFilter", + "usage": "Input,Output,Json,LroInitial,LroFinalEnvelope", + "doc": "Model that represents available filter types that can be applied to a targets list.", + "decorators": [], + "discriminatorProperty": { + "$id": "547", + "kind": "property", + "name": "type", + "serializedName": "type", + "doc": "Chaos target filter discriminator type", + "type": { + "$ref": "50" + }, + "optional": false, + "readOnly": false, + "discriminator": true, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.Chaos.ChaosTargetFilter.type", + "serializationOptions": { + "$id": "548", + "json": { + "$id": "549", + "name": "type" + } + } + }, + "properties": [ + { + "$ref": "547" + } + ], + "discriminatedSubtypes": { + "$id": "550", + "Simple": { + "$id": "551", + "kind": "model", + "name": "ChaosTargetSimpleFilter", + "clientNamespace": "Microsoft.Chaos", + "crossLanguageDefinitionId": "Microsoft.Chaos.ChaosTargetSimpleFilter", + "usage": "Input,Output,Json,LroInitial,LroFinalEnvelope", + "doc": "Model that represents a simple target filter.", + "discriminatorValue": "Simple", + "decorators": [], + "baseModel": { + "$ref": "546" + }, + "properties": [ + { + "$id": "552", + "kind": "property", + "name": "parameters", + "serializedName": "parameters", + "doc": "Model that represents the Simple filter parameters.", + "type": { + "$id": "553", + "kind": "model", + "name": "ChaosTargetSimpleFilterParameters", + "clientNamespace": "Microsoft.Chaos", + "crossLanguageDefinitionId": "Microsoft.Chaos.ChaosTargetSimpleFilterParameters", + "usage": "Input,Output,Json,LroInitial,LroFinalEnvelope", + "doc": "Model that represents the Simple filter parameters.", + "decorators": [], + "properties": [ + { + "$id": "554", + "kind": "property", + "name": "zones", + "serializedName": "zones", + "doc": "List of Azure availability zones to filter targets by.", + "type": { + "$id": "555", + "kind": "array", + "name": "Array", + "valueType": { + "$id": "556", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.Chaos.ChaosTargetSimpleFilterParameters.zones", + "serializationOptions": { + "$id": "557", + "json": { + "$id": "558", + "name": "zones" + } + } + } + ] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.Chaos.ChaosTargetSimpleFilter.parameters", + "serializationOptions": { + "$id": "559", + "json": { + "$id": "560", + "name": "parameters" + } + } + }, + { + "$id": "561", + "kind": "property", + "name": "type", + "serializedName": "type", + "doc": "Enum that discriminates between filter types. Currently only `Simple` type is supported.", + "type": { + "$id": "562", + "kind": "constant", + "valueType": { + "$id": "563", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "Simple", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": true, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.Chaos.ChaosTargetSimpleFilter.type", + "serializationOptions": { + "$id": "564", + "json": { + "$id": "565", + "name": "type" + } + } + } + ] + } + } + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.Chaos.ChaosTargetSelector.filter", + "serializationOptions": { + "$id": "566", + "json": { + "$id": "567", + "name": "filter" + } + } + } + ], + "discriminatedSubtypes": { + "$id": "568", + "List": { + "$id": "569", + "kind": "model", + "name": "ChaosTargetListSelector", + "clientNamespace": "Microsoft.Chaos", + "crossLanguageDefinitionId": "Microsoft.Chaos.ChaosTargetListSelector", + "usage": "Input,Output,Json,LroInitial,LroFinalEnvelope", + "doc": "Model that represents a list selector.", + "discriminatorValue": "List", + "decorators": [], + "baseModel": { + "$ref": "537" + }, + "properties": [ + { + "$id": "570", + "kind": "property", + "name": "targets", + "serializedName": "targets", + "doc": "List of Target references.", + "type": { + "$id": "571", + "kind": "array", + "name": "ArrayTargetReference", + "valueType": { + "$id": "572", + "kind": "model", + "name": "ChaosTargetReference", + "clientNamespace": "Microsoft.Chaos", + "crossLanguageDefinitionId": "Microsoft.Chaos.TargetReference", + "usage": "Input,Output,Json,LroInitial,LroFinalEnvelope", + "doc": "Model that represents a reference to a Target in the selector.", + "decorators": [], + "properties": [ + { + "$id": "573", + "kind": "property", + "name": "ReferenceType", + "serializedName": "type", + "doc": "Enum of the Target reference type.", + "type": { + "$ref": "54" + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.Chaos.TargetReference.type", + "serializationOptions": { + "$id": "574", + "json": { + "$id": "575", + "name": "type" + } + } + }, + { + "$id": "576", + "kind": "property", + "name": "id", + "serializedName": "id", + "doc": "String of the resource ID of a Target resource.", + "type": { + "$id": "577", + "kind": "string", + "name": "armResourceIdentifier", + "crossLanguageDefinitionId": "Azure.Core.armResourceIdentifier", + "baseType": { + "$id": "578", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.Chaos.TargetReference.id", + "serializationOptions": { + "$id": "579", + "json": { + "$id": "580", + "name": "id" + } + } + } + ] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.Chaos.ChaosTargetListSelector.targets", + "serializationOptions": { + "$id": "581", + "json": { + "$id": "582", + "name": "targets" + } + } + }, + { + "$id": "583", + "kind": "property", + "name": "type", + "serializedName": "type", + "doc": "Enum of the selector type.", + "type": { + "$id": "584", + "kind": "constant", + "valueType": { + "$id": "585", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "List", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": true, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.Chaos.ChaosTargetListSelector.type", + "serializationOptions": { + "$id": "586", + "json": { + "$id": "587", + "name": "type" + } + } + } + ] + }, + "Query": { + "$id": "588", + "kind": "model", + "name": "ChaosTargetQuerySelector", + "clientNamespace": "Microsoft.Chaos", + "crossLanguageDefinitionId": "Microsoft.Chaos.ChaosTargetQuerySelector", + "usage": "Input,Output,Json,LroInitial,LroFinalEnvelope", + "doc": "Model that represents a query selector.", + "discriminatorValue": "Query", + "decorators": [], + "baseModel": { + "$ref": "537" + }, + "properties": [ + { + "$id": "589", + "kind": "property", + "name": "queryString", + "serializedName": "queryString", + "doc": "Azure Resource Graph (ARG) Query Language query for target resources.", + "type": { + "$id": "590", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.Chaos.ChaosTargetQuerySelector.queryString", + "serializationOptions": { + "$id": "591", + "json": { + "$id": "592", + "name": "queryString" + } + } + }, + { + "$id": "593", + "kind": "property", + "name": "subscriptionIds", + "serializedName": "subscriptionIds", + "doc": "Subscription id list to scope resource query.", + "type": { + "$id": "594", + "kind": "array", + "name": "Array", + "valueType": { + "$id": "595", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.Chaos.ChaosTargetQuerySelector.subscriptionIds", + "serializationOptions": { + "$id": "596", + "json": { + "$id": "597", + "name": "subscriptionIds" + } + } + }, + { + "$id": "598", + "kind": "property", + "name": "type", + "serializedName": "type", + "doc": "Enum of the selector type.", + "type": { + "$id": "599", + "kind": "constant", + "valueType": { + "$id": "600", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "Query", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": true, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.Chaos.ChaosTargetQuerySelector.type", + "serializationOptions": { + "$id": "601", + "json": { + "$id": "602", + "name": "type" + } + } + } + ] + } + } + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.Chaos.ExperimentProperties.selectors", + "serializationOptions": { + "$id": "603", + "json": { + "$id": "604", + "name": "selectors" + } + } + } + ] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": true, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.Chaos.Experiment.properties", + "serializationOptions": { + "$id": "605", + "json": { + "$id": "606", + "name": "properties" + } + } + } + ] + }, + { + "$ref": "413" + }, + { + "$ref": "431" + }, + { + "$ref": "447" + }, + { + "$ref": "453" + }, + { + "$ref": "460" + }, + { + "$ref": "467" + }, + { + "$ref": "476" + }, + { + "$ref": "484" + }, + { + "$ref": "504" + }, + { + "$ref": "515" + }, + { + "$ref": "537" + }, + { + "$ref": "546" + }, + { + "$ref": "551" + }, + { + "$ref": "553" + }, + { + "$ref": "569" + }, + { + "$ref": "572" + }, + { + "$ref": "588" + }, + { + "$ref": "401" + }, + { + "$id": "607", + "kind": "model", + "name": "ArmOperationStatusResourceProvisioningState", + "clientNamespace": "Azure.ResourceManager", + "crossLanguageDefinitionId": "Azure.ResourceManager.ArmOperationStatus", + "usage": "LroPolling", + "doc": "Standard Azure Resource Manager operation status response", + "decorators": [], + "properties": [ + { + "$id": "608", + "kind": "property", + "name": "status", + "serializedName": "status", + "doc": "The operation status", + "type": { + "$ref": "58" + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.ArmOperationStatus.status", + "serializationOptions": { + "$id": "609", + "json": { + "$id": "610", + "name": "status" + } + } + }, + { + "$id": "611", + "kind": "property", + "name": "name", + "serializedName": "name", + "doc": "The name of the operationStatus resource", + "type": { + "$id": "612", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.ArmOperationStatus.name", + "serializationOptions": { + "$id": "613", + "json": { + "$id": "614", + "name": "name" + } + } + }, + { + "$id": "615", + "kind": "property", + "name": "startTime", + "serializedName": "startTime", + "doc": "Operation start time", + "type": { + "$id": "616", + "kind": "utcDateTime", + "name": "utcDateTime", + "encode": "rfc3339", + "wireType": { + "$id": "617", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.utcDateTime", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.ArmOperationStatus.startTime", + "serializationOptions": { + "$id": "618", + "json": { + "$id": "619", + "name": "startTime" + } + } + }, + { + "$id": "620", + "kind": "property", + "name": "endTime", + "serializedName": "endTime", + "doc": "Operation complete time", + "type": { + "$id": "621", + "kind": "utcDateTime", + "name": "utcDateTime", + "encode": "rfc3339", + "wireType": { + "$id": "622", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.utcDateTime", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.ArmOperationStatus.endTime", + "serializationOptions": { + "$id": "623", + "json": { + "$id": "624", + "name": "endTime" + } + } + }, + { + "$id": "625", + "kind": "property", + "name": "percentComplete", + "serializedName": "percentComplete", + "doc": "The progress made toward completing the operation", + "type": { + "$id": "626", + "kind": "float64", + "name": "float64", + "crossLanguageDefinitionId": "TypeSpec.float64", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.ArmOperationStatus.percentComplete", + "serializationOptions": { + "$id": "627", + "json": { + "$id": "628", + "name": "percentComplete" + } + } + }, + { + "$id": "629", + "kind": "property", + "name": "error", + "serializedName": "error", + "doc": "Errors that occurred if the operation ended with Canceled or Failed status", + "type": { + "$ref": "115" + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.ArmOperationStatus.error", + "serializationOptions": { + "$id": "630", + "json": { + "$id": "631", + "name": "error" + } + } + } + ] + }, + { + "$id": "632", + "kind": "model", + "name": "ExperimentUpdate", + "clientNamespace": "Microsoft.Chaos", + "crossLanguageDefinitionId": "Microsoft.Chaos.ExperimentUpdate", + "usage": "Input,Json", + "doc": "Describes an experiment update.", + "decorators": [], + "properties": [ + { + "$id": "633", + "kind": "property", + "name": "tags", + "serializedName": "tags", + "doc": "Resource tags.", + "type": { + "$id": "634", + "kind": "dict", + "keyType": { + "$id": "635", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "valueType": { + "$id": "636", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.Chaos.ExperimentUpdate.tags", + "serializationOptions": { + "$id": "637", + "json": { + "$id": "638", + "name": "tags" + } + } + }, + { + "$id": "639", + "kind": "property", + "name": "identity", + "serializedName": "identity", + "doc": "The managed service identities assigned to this resource.", + "type": { + "$ref": "413" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.Chaos.ExperimentUpdate.identity", + "serializationOptions": { + "$id": "640", + "json": { + "$id": "641", + "name": "identity" + } + } + } + ] + }, + { + "$id": "642", + "kind": "model", + "name": "ExperimentListResult", + "clientNamespace": "Microsoft.Chaos", + "crossLanguageDefinitionId": "Microsoft.Chaos.ExperimentListResult", + "usage": "Output,Json", + "doc": "Model that represents a list of Experiment resources and a link for pagination.", + "decorators": [], + "properties": [ + { + "$id": "643", + "kind": "property", + "name": "value", + "serializedName": "value", + "doc": "The Experiment items on this page", + "type": { + "$id": "644", + "kind": "array", + "name": "ArrayExperiment", + "valueType": { + "$ref": "400" + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.Chaos.ExperimentListResult.value", + "serializationOptions": { + "$id": "645", + "json": { + "$id": "646", + "name": "value" + } + } + }, + { + "$id": "647", + "kind": "property", + "name": "nextLink", + "serializedName": "nextLink", + "doc": "The link to the next page of items", + "type": { + "$id": "648", + "kind": "url", + "name": "ResourceLocation", + "crossLanguageDefinitionId": "TypeSpec.Rest.ResourceLocation", + "baseType": { + "$id": "649", + "kind": "url", + "name": "url", + "crossLanguageDefinitionId": "TypeSpec.url", + "decorators": [] + }, + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.Chaos.ExperimentListResult.nextLink", + "serializationOptions": { + "$id": "650", + "json": { + "$id": "651", + "name": "nextLink" + } + } + } + ] + }, + { + "$id": "652", + "kind": "model", + "name": "ChaosCapabilityMetadata", + "clientNamespace": "Microsoft.Chaos", + "crossLanguageDefinitionId": "Microsoft.Chaos.CapabilityType", + "usage": "Output,Json", + "doc": "Model that represents a Capability Type resource.", + "decorators": [], + "baseModel": { + "$ref": "156" + }, + "properties": [ + { + "$id": "653", + "kind": "property", + "name": "properties", + "serializedName": "properties", + "doc": "The properties of the capability type resource.", + "type": { + "$id": "654", + "kind": "model", + "name": "CapabilityTypeProperties", + "clientNamespace": "Microsoft.Chaos", + "crossLanguageDefinitionId": "Microsoft.Chaos.CapabilityTypeProperties", + "usage": "Output,Json", + "doc": "Model that represents the Capability Type properties model.", + "decorators": [], + "properties": [ + { + "$id": "655", + "kind": "property", + "name": "publisher", + "serializedName": "publisher", + "doc": "String of the Publisher that this Capability Type extends.", + "type": { + "$id": "656", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.Chaos.CapabilityTypeProperties.publisher", + "serializationOptions": { + "$id": "657", + "json": { + "$id": "658", + "name": "publisher" + } + } + }, + { + "$id": "659", + "kind": "property", + "name": "targetType", + "serializedName": "targetType", + "doc": "String of the Target Type that this Capability Type extends.", + "type": { + "$id": "660", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.Chaos.CapabilityTypeProperties.targetType", + "serializationOptions": { + "$id": "661", + "json": { + "$id": "662", + "name": "targetType" + } + } + }, + { + "$id": "663", + "kind": "property", + "name": "displayName", + "serializedName": "displayName", + "doc": "Localized string of the display name.", + "type": { + "$id": "664", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.Chaos.CapabilityTypeProperties.displayName", + "serializationOptions": { + "$id": "665", + "json": { + "$id": "666", + "name": "displayName" + } + } + }, + { + "$id": "667", + "kind": "property", + "name": "description", + "serializedName": "description", + "doc": "Localized string of the description.", + "type": { + "$id": "668", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.Chaos.CapabilityTypeProperties.description", + "serializationOptions": { + "$id": "669", + "json": { + "$id": "670", + "name": "description" + } + } + }, + { + "$id": "671", + "kind": "property", + "name": "parametersSchema", + "serializedName": "parametersSchema", + "doc": "URL to retrieve JSON schema of the Capability Type parameters.", + "type": { + "$id": "672", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.Chaos.CapabilityTypeProperties.parametersSchema", + "serializationOptions": { + "$id": "673", + "json": { + "$id": "674", + "name": "parametersSchema" + } + } + }, + { + "$id": "675", + "kind": "property", + "name": "urn", + "serializedName": "urn", + "doc": "String of the URN for this Capability Type.", + "type": { + "$id": "676", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.Chaos.CapabilityTypeProperties.urn", + "serializationOptions": { + "$id": "677", + "json": { + "$id": "678", + "name": "urn" + } + } + }, + { + "$id": "679", + "kind": "property", + "name": "kind", + "serializedName": "kind", + "doc": "String of the kind of this Capability Type.", + "type": { + "$id": "680", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.Chaos.CapabilityTypeProperties.kind", + "serializationOptions": { + "$id": "681", + "json": { + "$id": "682", + "name": "kind" + } + } + }, + { + "$id": "683", + "kind": "property", + "name": "azureRbacActions", + "serializedName": "azureRbacActions", + "doc": "Control plane actions necessary to execute capability type.", + "type": { + "$id": "684", + "kind": "array", + "name": "Array", + "valueType": { + "$id": "685", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.Chaos.CapabilityTypeProperties.azureRbacActions", + "serializationOptions": { + "$id": "686", + "json": { + "$id": "687", + "name": "azureRbacActions" + } + } + }, + { + "$id": "688", + "kind": "property", + "name": "azureRbacDataActions", + "serializedName": "azureRbacDataActions", + "doc": "Data plane actions necessary to execute capability type.", + "type": { + "$id": "689", + "kind": "array", + "name": "Array", + "valueType": { + "$id": "690", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.Chaos.CapabilityTypeProperties.azureRbacDataActions", + "serializationOptions": { + "$id": "691", + "json": { + "$id": "692", + "name": "azureRbacDataActions" + } + } + }, + { + "$id": "693", + "kind": "property", + "name": "requiredAzureRoleDefinitionIds", + "serializedName": "requiredAzureRoleDefinitionIds", + "doc": "Required Azure Role Definition Ids to execute capability type.", + "type": { + "$id": "694", + "kind": "array", + "name": "Array", + "valueType": { + "$id": "695", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.Chaos.CapabilityTypeProperties.requiredAzureRoleDefinitionIds", + "serializationOptions": { + "$id": "696", + "json": { + "$id": "697", + "name": "requiredAzureRoleDefinitionIds" + } + } + }, + { + "$id": "698", + "kind": "property", + "name": "runtimeProperties", + "serializedName": "runtimeProperties", + "doc": "Runtime properties of this Capability Type.", + "type": { + "$id": "699", + "kind": "model", + "name": "ChaosCapabilityMetadataRuntimeProperties", + "clientNamespace": "Microsoft.Chaos", + "crossLanguageDefinitionId": "Microsoft.Chaos.CapabilityTypePropertiesRuntimeProperties", + "usage": "Output,Json", + "doc": "Runtime properties of this Capability Type.", + "decorators": [], + "properties": [ + { + "$id": "700", + "kind": "property", + "name": "kind", + "serializedName": "kind", + "doc": "String of the kind of the resource's action type (continuous or discrete).", + "type": { + "$id": "701", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.Chaos.CapabilityTypePropertiesRuntimeProperties.kind", + "serializationOptions": { + "$id": "702", + "json": { + "$id": "703", + "name": "kind" + } + } + } + ] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.Chaos.CapabilityTypeProperties.runtimeProperties", + "serializationOptions": { + "$id": "704", + "json": { + "$id": "705", + "name": "runtimeProperties" + } + } + } + ] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": true, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.Chaos.CapabilityType.properties", + "serializationOptions": { + "$id": "706", + "json": { + "$id": "707", + "name": "properties" + } + } + } + ] + }, + { + "$ref": "654" + }, + { + "$ref": "699" + }, + { + "$id": "708", + "kind": "model", + "name": "CapabilityTypeListResult", + "clientNamespace": "Microsoft.Chaos", + "crossLanguageDefinitionId": "Microsoft.Chaos.CapabilityTypeListResult", + "usage": "Output,Json", + "doc": "Model that represents a list of Capability Type resources and a link for pagination.", + "decorators": [], + "properties": [ + { + "$id": "709", + "kind": "property", + "name": "value", + "serializedName": "value", + "doc": "The CapabilityType items on this page", + "type": { + "$id": "710", + "kind": "array", + "name": "ArrayCapabilityType", + "valueType": { + "$ref": "652" + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.Chaos.CapabilityTypeListResult.value", + "serializationOptions": { + "$id": "711", + "json": { + "$id": "712", + "name": "value" + } + } + }, + { + "$id": "713", + "kind": "property", + "name": "nextLink", + "serializedName": "nextLink", + "doc": "The link to the next page of items", + "type": { + "$id": "714", + "kind": "url", + "name": "ResourceLocation", + "crossLanguageDefinitionId": "TypeSpec.Rest.ResourceLocation", + "baseType": { + "$id": "715", + "kind": "url", + "name": "url", + "crossLanguageDefinitionId": "TypeSpec.url", + "decorators": [] + }, + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.Chaos.CapabilityTypeListResult.nextLink", + "serializationOptions": { + "$id": "716", + "json": { + "$id": "717", + "name": "nextLink" + } + } + } + ] + }, + { + "$id": "718", + "kind": "model", + "name": "ChaosTarget", + "clientNamespace": "Microsoft.Chaos", + "crossLanguageDefinitionId": "Microsoft.Chaos.Target", + "usage": "Input,Output,Json", + "doc": "Model that represents a Target resource.", + "decorators": [], + "baseModel": { + "$ref": "156" + }, + "properties": [ + { + "$id": "719", + "kind": "property", + "name": "properties", + "serializedName": "properties", + "doc": "The properties of the target resource.", + "type": { + "$id": "720", + "kind": "dict", + "keyType": { + "$id": "721", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "valueType": { + "$id": "722", + "kind": "unknown", + "name": "unknown", + "crossLanguageDefinitionId": "", + "decorators": [] + }, + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.Chaos.Target.properties", + "serializationOptions": { + "$id": "723", + "json": { + "$id": "724", + "name": "properties" + } + } + }, + { + "$id": "725", + "kind": "property", + "name": "location", + "serializedName": "location", + "doc": "Azure resource location.", + "type": { + "$id": "726", + "kind": "string", + "name": "azureLocation", + "crossLanguageDefinitionId": "Azure.Core.azureLocation", + "baseType": { + "$id": "727", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.Chaos.Target.location", + "serializationOptions": { + "$id": "728", + "json": { + "$id": "729", + "name": "location" + } + } + } + ] + }, + { + "$id": "730", + "kind": "model", + "name": "TargetListResult", + "clientNamespace": "Microsoft.Chaos", + "crossLanguageDefinitionId": "Microsoft.Chaos.TargetListResult", + "usage": "Output,Json", + "doc": "Model that represents a list of Target resources and a link for pagination.", + "decorators": [], + "properties": [ + { + "$id": "731", + "kind": "property", + "name": "value", + "serializedName": "value", + "doc": "The Target items on this page", + "type": { + "$id": "732", + "kind": "array", + "name": "ArrayTarget", + "valueType": { + "$ref": "718" + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.Chaos.TargetListResult.value", + "serializationOptions": { + "$id": "733", + "json": { + "$id": "734", + "name": "value" + } + } + }, + { + "$id": "735", + "kind": "property", + "name": "nextLink", + "serializedName": "nextLink", + "doc": "The link to the next page of items", + "type": { + "$id": "736", + "kind": "url", + "name": "ResourceLocation", + "crossLanguageDefinitionId": "TypeSpec.Rest.ResourceLocation", + "baseType": { + "$id": "737", + "kind": "url", + "name": "url", + "crossLanguageDefinitionId": "TypeSpec.url", + "decorators": [] + }, + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.Chaos.TargetListResult.nextLink", + "serializationOptions": { + "$id": "738", + "json": { + "$id": "739", + "name": "nextLink" + } + } + } + ] + }, + { + "$id": "740", + "kind": "model", + "name": "OperationListResult", + "clientNamespace": "Azure.ResourceManager.CommonTypes", + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.OperationListResult", + "usage": "Output,Json", + "doc": "A list of REST API operations supported by an Azure Resource Provider. It contains an URL link to get the next set of results.", + "decorators": [], + "properties": [ + { + "$id": "741", + "kind": "property", + "name": "value", + "serializedName": "value", + "doc": "The Operation items on this page", + "type": { + "$id": "742", + "kind": "array", + "name": "ArrayOperation", + "valueType": { + "$id": "743", + "kind": "model", + "name": "Operation", + "clientNamespace": "Azure.ResourceManager.CommonTypes", + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.Operation", + "usage": "Output,Json", + "doc": "Details of a REST API operation, returned from the Resource Provider Operations API", + "decorators": [], + "properties": [ + { + "$id": "744", + "kind": "property", + "name": "name", + "serializedName": "name", + "doc": "The name of the operation, as per Resource-Based Access Control (RBAC). Examples: \"Microsoft.Compute/virtualMachines/write\", \"Microsoft.Compute/virtualMachines/capture/action\"", + "type": { + "$id": "745", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.Operation.name", + "serializationOptions": { + "$id": "746", + "json": { + "$id": "747", + "name": "name" + } + } + }, + { + "$id": "748", + "kind": "property", + "name": "isDataAction", + "serializedName": "isDataAction", + "doc": "Whether the operation applies to data-plane. This is \"true\" for data-plane operations and \"false\" for Azure Resource Manager/control-plane operations.", + "type": { + "$id": "749", + "kind": "boolean", + "name": "boolean", + "crossLanguageDefinitionId": "TypeSpec.boolean", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.Operation.isDataAction", + "serializationOptions": { + "$id": "750", + "json": { + "$id": "751", + "name": "isDataAction" + } + } + }, + { + "$id": "752", + "kind": "property", + "name": "display", + "serializedName": "display", + "doc": "Localized display information for this particular operation.", + "type": { + "$id": "753", + "kind": "model", + "name": "OperationDisplay", + "clientNamespace": "Azure.ResourceManager.CommonTypes", + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.OperationDisplay", + "usage": "Output,Json", + "doc": "Localized display information for and operation.", + "decorators": [], + "properties": [ + { + "$id": "754", + "kind": "property", + "name": "provider", + "serializedName": "provider", + "doc": "The localized friendly form of the resource provider name, e.g. \"Microsoft Monitoring Insights\" or \"Microsoft Compute\".", + "type": { + "$id": "755", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.OperationDisplay.provider", + "serializationOptions": { + "$id": "756", + "json": { + "$id": "757", + "name": "provider" + } + } + }, + { + "$id": "758", + "kind": "property", + "name": "resource", + "serializedName": "resource", + "doc": "The localized friendly name of the resource type related to this operation. E.g. \"Virtual Machines\" or \"Job Schedule Collections\".", + "type": { + "$id": "759", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.OperationDisplay.resource", + "serializationOptions": { + "$id": "760", + "json": { + "$id": "761", + "name": "resource" + } + } + }, + { + "$id": "762", + "kind": "property", + "name": "operation", + "serializedName": "operation", + "doc": "The concise, localized friendly name for the operation; suitable for dropdowns. E.g. \"Create or Update Virtual Machine\", \"Restart Virtual Machine\".", + "type": { + "$id": "763", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.OperationDisplay.operation", + "serializationOptions": { + "$id": "764", + "json": { + "$id": "765", + "name": "operation" + } + } + }, + { + "$id": "766", + "kind": "property", + "name": "description", + "serializedName": "description", + "doc": "The short, localized friendly description of the operation; suitable for tool tips and detailed views.", + "type": { + "$id": "767", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.OperationDisplay.description", + "serializationOptions": { + "$id": "768", + "json": { + "$id": "769", + "name": "description" + } + } + } + ] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.Operation.display", + "serializationOptions": { + "$id": "770", + "json": { + "$id": "771", + "name": "display" + } + } + }, + { + "$id": "772", + "kind": "property", + "name": "origin", + "serializedName": "origin", + "doc": "The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default value is \"user,system\"", + "type": { + "$ref": "66" + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.Operation.origin", + "serializationOptions": { + "$id": "773", + "json": { + "$id": "774", + "name": "origin" + } + } + }, + { + "$id": "775", + "kind": "property", + "name": "actionType", + "serializedName": "actionType", + "doc": "Extensible enum. Indicates the action type. \"Internal\" refers to actions that are for internal only APIs.", + "type": { + "$ref": "74" + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.Operation.actionType", + "serializationOptions": { + "$id": "776", + "json": { + "$id": "777", + "name": "actionType" + } + } + } + ] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.OperationListResult.value", + "serializationOptions": { + "$id": "778", + "json": { + "$id": "779", + "name": "value" + } + } + }, + { + "$id": "780", + "kind": "property", + "name": "nextLink", + "serializedName": "nextLink", + "doc": "The link to the next page of items", + "type": { + "$id": "781", + "kind": "url", + "name": "ResourceLocation", + "crossLanguageDefinitionId": "TypeSpec.Rest.ResourceLocation", + "baseType": { + "$id": "782", + "kind": "url", + "name": "url", + "crossLanguageDefinitionId": "TypeSpec.url", + "decorators": [] + }, + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.OperationListResult.nextLink", + "serializationOptions": { + "$id": "783", + "json": { + "$id": "784", + "name": "nextLink" + } + } + } + ] + }, + { + "$ref": "743" + }, + { + "$ref": "753" + }, + { + "$id": "785", + "kind": "model", + "name": "ChaosCapability", + "clientNamespace": "Microsoft.Chaos", + "crossLanguageDefinitionId": "Microsoft.Chaos.Capability", + "usage": "Input,Output,Json", + "doc": "Model that represents a Capability resource.", + "decorators": [], + "baseModel": { + "$ref": "156" + }, + "properties": [ + { + "$id": "786", + "kind": "property", + "name": "properties", + "serializedName": "properties", + "doc": "The properties of a capability resource.", + "type": { + "$id": "787", + "kind": "model", + "name": "CapabilityProperties", + "clientNamespace": "Microsoft.Chaos", + "crossLanguageDefinitionId": "Microsoft.Chaos.CapabilityProperties", + "usage": "Input,Output,Json", + "doc": "Model that represents the Capability properties model.", + "decorators": [], + "properties": [ + { + "$id": "788", + "kind": "property", + "name": "publisher", + "serializedName": "publisher", + "doc": "String of the Publisher that this Capability extends.", + "type": { + "$id": "789", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.Chaos.CapabilityProperties.publisher", + "serializationOptions": { + "$id": "790", + "json": { + "$id": "791", + "name": "publisher" + } + } + }, + { + "$id": "792", + "kind": "property", + "name": "targetType", + "serializedName": "targetType", + "doc": "String of the Target Type that this Capability extends.", + "type": { + "$id": "793", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.Chaos.CapabilityProperties.targetType", + "serializationOptions": { + "$id": "794", + "json": { + "$id": "795", + "name": "targetType" + } + } + }, + { + "$id": "796", + "kind": "property", + "name": "description", + "serializedName": "description", + "doc": "Localized string of the description.", + "type": { + "$id": "797", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.Chaos.CapabilityProperties.description", + "serializationOptions": { + "$id": "798", + "json": { + "$id": "799", + "name": "description" + } + } + }, + { + "$id": "800", + "kind": "property", + "name": "parametersSchema", + "serializedName": "parametersSchema", + "doc": "URL to retrieve JSON schema of the Capability parameters.", + "type": { + "$id": "801", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.Chaos.CapabilityProperties.parametersSchema", + "serializationOptions": { + "$id": "802", + "json": { + "$id": "803", + "name": "parametersSchema" + } + } + }, + { + "$id": "804", + "kind": "property", + "name": "urn", + "serializedName": "urn", + "doc": "String of the URN for this Capability Type.", + "type": { + "$id": "805", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.Chaos.CapabilityProperties.urn", + "serializationOptions": { + "$id": "806", + "json": { + "$id": "807", + "name": "urn" + } + } + } + ] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": true, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.Chaos.Capability.properties", + "serializationOptions": { + "$id": "808", + "json": { + "$id": "809", + "name": "properties" + } + } + } + ] + }, + { + "$ref": "787" + }, + { + "$id": "810", + "kind": "model", + "name": "CapabilityListResult", + "clientNamespace": "Microsoft.Chaos", + "crossLanguageDefinitionId": "Microsoft.Chaos.CapabilityListResult", + "usage": "Output,Json", + "doc": "Model that represents a list of Capability resources and a link for pagination.", + "decorators": [], + "properties": [ + { + "$id": "811", + "kind": "property", + "name": "value", + "serializedName": "value", + "doc": "The Capability items on this page", + "type": { + "$id": "812", + "kind": "array", + "name": "ArrayCapability", + "valueType": { + "$ref": "785" + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.Chaos.CapabilityListResult.value", + "serializationOptions": { + "$id": "813", + "json": { + "$id": "814", + "name": "value" + } + } + }, + { + "$id": "815", + "kind": "property", + "name": "nextLink", + "serializedName": "nextLink", + "doc": "The link to the next page of items", + "type": { + "$id": "816", + "kind": "url", + "name": "ResourceLocation", + "crossLanguageDefinitionId": "TypeSpec.Rest.ResourceLocation", + "baseType": { + "$id": "817", + "kind": "url", + "name": "url", + "crossLanguageDefinitionId": "TypeSpec.url", + "decorators": [] + }, + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.Chaos.CapabilityListResult.nextLink", + "serializationOptions": { + "$id": "818", + "json": { + "$id": "819", + "name": "nextLink" + } + } + } + ] + }, + { + "$id": "820", + "kind": "model", + "name": "OperationStatus", + "clientNamespace": "Microsoft.Chaos", + "crossLanguageDefinitionId": "Microsoft.Chaos.OperationStatus", + "usage": "Error", + "doc": "The status of operation.", + "decorators": [], + "baseModel": { + "$ref": "151" + }, + "properties": [ + { + "$id": "821", + "kind": "property", + "name": "id", + "serializedName": "id", + "doc": "The operation Id.", + "type": { + "$id": "822", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.Chaos.OperationStatus.id", + "serializationOptions": { + "$id": "823" + } + }, + { + "$id": "824", + "kind": "property", + "name": "name", + "serializedName": "name", + "doc": "The operation name.", + "type": { + "$id": "825", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.Chaos.OperationStatus.name", + "serializationOptions": { + "$id": "826" + } + }, + { + "$id": "827", + "kind": "property", + "name": "startTime", + "serializedName": "startTime", + "doc": "The start time of the operation.", + "type": { + "$id": "828", + "kind": "utcDateTime", + "name": "utcDateTime", + "encode": "rfc3339", + "wireType": { + "$id": "829", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.utcDateTime", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.Chaos.OperationStatus.startTime", + "serializationOptions": { + "$id": "830" + } + }, + { + "$id": "831", + "kind": "property", + "name": "endTime", + "serializedName": "endTime", + "doc": "The end time of the operation.", + "type": { + "$id": "832", + "kind": "utcDateTime", + "name": "utcDateTime", + "encode": "rfc3339", + "wireType": { + "$id": "833", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.utcDateTime", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.Chaos.OperationStatus.endTime", + "serializationOptions": { + "$id": "834" + } + }, + { + "$id": "835", + "kind": "property", + "name": "status", + "serializedName": "status", + "doc": "The status of the operation.", + "type": { + "$id": "836", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.Chaos.OperationStatus.status", + "serializationOptions": { + "$id": "837" + } + } + ] + } + ], + "Clients": [ + { + "$id": "838", + "Name": "ChaosClient", + "ClientNamespace": "Microsoft.Chaos", + "Doc": "Chaos Management Client", + "Operations": [], + "Protocol": { + "$id": "839" + }, + "Parameters": [ + { + "$id": "840", + "Name": "endpoint", + "NameInRequest": "endpoint", + "Doc": "Service host", + "Type": { + "$id": "841", + "kind": "url", + "name": "url", + "crossLanguageDefinitionId": "TypeSpec.url" + }, + "Location": "Uri", + "IsApiVersion": false, + "IsResourceParameter": false, + "IsContentType": false, + "IsRequired": true, + "IsEndpoint": true, + "SkipUrlEncoding": false, + "Explode": false, + "Kind": "Client", + "DefaultValue": { + "$id": "842", + "Type": { + "$id": "843", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "https://management.azure.com" + } + } + ], + "Decorators": [] + }, + { + "$id": "844", + "Name": "Capabilities", + "ClientNamespace": "Microsoft.Chaos", + "Operations": [ + { + "$id": "845", + "Name": "get", + "ResourceName": "Capability", + "Doc": "Get a Capability resource that extends a Target resource.", + "Accessibility": "public", + "Parameters": [ + { + "$id": "846", + "Name": "apiVersion", + "NameInRequest": "api-version", + "Doc": "The API version to use for this operation.", + "Type": { + "$id": "847", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": true, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "DefaultValue": { + "$id": "848", + "Type": { + "$id": "849", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "2025-01-01" + }, + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "850", + "Name": "subscriptionId", + "NameInRequest": "subscriptionId", + "Doc": "The ID of the target subscription. The value must be an UUID.", + "Type": { + "$id": "851", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "852", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "853", + "Name": "resourceGroupName", + "NameInRequest": "resourceGroupName", + "Doc": "The name of the resource group. The name is case insensitive.", + "Type": { + "$id": "854", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "855", + "Name": "parentProviderNamespace", + "NameInRequest": "parentProviderNamespace", + "Doc": "The parent resource provider namespace.", + "Type": { + "$id": "856", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "857", + "Name": "parentResourceType", + "NameInRequest": "parentResourceType", + "Doc": "The parent resource type.", + "Type": { + "$id": "858", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "859", + "Name": "parentResourceName", + "NameInRequest": "parentResourceName", + "Doc": "The parent resource name.", + "Type": { + "$id": "860", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "861", + "Name": "targetName", + "NameInRequest": "targetName", + "Doc": "String that represents a Target resource name.", + "Type": { + "$id": "862", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "863", + "Name": "capabilityName", + "NameInRequest": "capabilityName", + "Doc": "String that represents a Capability resource name.", + "Type": { + "$id": "864", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "865", + "Name": "accept", + "NameInRequest": "Accept", + "Type": { + "$id": "866", + "kind": "constant", + "valueType": { + "$id": "867", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "868", + "StatusCodes": [ + 200 + ], + "BodyType": { + "$ref": "785" + }, + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false, + "ContentTypes": [ + "application/json" + ] + } + ], + "HttpMethod": "GET", + "RequestBodyMediaType": "None", + "Uri": "{endpoint}", + "Path": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{parentProviderNamespace}/{parentResourceType}/{parentResourceName}/providers/Microsoft.Chaos/targets/{targetName}/capabilities/{capabilityName}", + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Microsoft.Chaos.Capabilities.get", + "Decorators": [], + "Examples": [ + { + "$id": "869", + "kind": "http", + "name": "Get a Capability that extends a virtual machine Target resource.", + "description": "Get a Capability that extends a virtual machine Target resource.", + "filePath": "2025-01-01/Capabilities_Get.json", + "parameters": [ + { + "$id": "870", + "parameter": { + "$ref": "846" + }, + "value": { + "$id": "871", + "kind": "string", + "type": { + "$ref": "847" + }, + "value": "2025-01-01" + } + }, + { + "$id": "872", + "parameter": { + "$ref": "863" + }, + "value": { + "$id": "873", + "kind": "string", + "type": { + "$ref": "864" + }, + "value": "Shutdown-1.0" + } + }, + { + "$id": "874", + "parameter": { + "$ref": "855" + }, + "value": { + "$id": "875", + "kind": "string", + "type": { + "$ref": "856" + }, + "value": "Microsoft.Compute" + } + }, + { + "$id": "876", + "parameter": { + "$ref": "859" + }, + "value": { + "$id": "877", + "kind": "string", + "type": { + "$ref": "860" + }, + "value": "exampleVM" + } + }, + { + "$id": "878", + "parameter": { + "$ref": "857" + }, + "value": { + "$id": "879", + "kind": "string", + "type": { + "$ref": "858" + }, + "value": "virtualMachines" + } + }, + { + "$id": "880", + "parameter": { + "$ref": "853" + }, + "value": { + "$id": "881", + "kind": "string", + "type": { + "$ref": "854" + }, + "value": "exampleRG" + } + }, + { + "$id": "882", + "parameter": { + "$ref": "850" + }, + "value": { + "$id": "883", + "kind": "string", + "type": { + "$ref": "851" + }, + "value": "6b052e15-03d3-4f17-b2e1-be7f07588291" + } + }, + { + "$id": "884", + "parameter": { + "$ref": "861" + }, + "value": { + "$id": "885", + "kind": "string", + "type": { + "$ref": "862" + }, + "value": "Microsoft-VirtualMachine" + } + } + ], + "responses": [ + { + "$id": "886", + "response": { + "$ref": "868" + }, + "statusCode": 200, + "bodyValue": { + "$id": "887", + "kind": "model", + "type": { + "$ref": "785" + }, + "value": { + "$id": "888", + "name": { + "$id": "889", + "kind": "string", + "type": { + "$ref": "164" + }, + "value": "Shutdown-1.0" + }, + "type": { + "$id": "890", + "kind": "string", + "type": { + "$ref": "168" + }, + "value": "Microsoft.Chaos/targets/capabilities" + }, + "id": { + "$id": "891", + "kind": "string", + "type": { + "$ref": "159" + }, + "value": "/subscriptions/6b052e15-03d3-4f17-b2e1-be7f07588291/resourceGroups/exampleRG/providers/Microsoft.Compute/virtualMachines/exampleVM/providers/Microsoft.Chaos/targets/Microsoft-VirtualMachine/capabilities/Shutdown-1.0" + }, + "properties": { + "$id": "892", + "kind": "model", + "type": { + "$ref": "787" + }, + "value": { + "$id": "893", + "description": { + "$id": "894", + "kind": "string", + "type": { + "$ref": "797" + }, + "value": "Shutdown an Azure Virtual Machine for a defined period of time." + }, + "parametersSchema": { + "$id": "895", + "kind": "string", + "type": { + "$ref": "801" + }, + "value": "https://schema.centralus.chaos-prod.azure.com/targets/Microsoft-VirtualMachine/capabilities/Shutdown-1.0.json" + }, + "publisher": { + "$id": "896", + "kind": "string", + "type": { + "$ref": "789" + }, + "value": "Microsoft" + }, + "targetType": { + "$id": "897", + "kind": "string", + "type": { + "$ref": "793" + }, + "value": "VirtualMachine" + }, + "urn": { + "$id": "898", + "kind": "string", + "type": { + "$ref": "805" + }, + "value": "urn:csci:microsoft:virtualMachine:shutdown/1.0" + } + } + }, + "systemData": { + "$id": "899", + "kind": "model", + "type": { + "$ref": "173" + }, + "value": { + "$id": "900", + "createdAt": { + "$id": "901", + "kind": "string", + "type": { + "$ref": "182" + }, + "value": "2020-05-14T05:08:38.4662189Z" + }, + "lastModifiedAt": { + "$id": "902", + "kind": "string", + "type": { + "$ref": "194" + }, + "value": "2020-05-14T05:08:38.4662189Z" + } + } + } + } + } + } + ] + } + ] + }, + { + "$id": "903", + "Name": "createOrUpdate", + "ResourceName": "Capability", + "Doc": "Create or update a Capability resource that extends a Target resource.", + "Accessibility": "public", + "Parameters": [ + { + "$id": "904", + "Name": "apiVersion", + "NameInRequest": "api-version", + "Doc": "The API version to use for this operation.", + "Type": { + "$id": "905", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": true, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "DefaultValue": { + "$id": "906", + "Type": { + "$id": "907", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "2025-01-01" + }, + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "908", + "Name": "subscriptionId", + "NameInRequest": "subscriptionId", + "Doc": "The ID of the target subscription. The value must be an UUID.", + "Type": { + "$id": "909", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "910", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "911", + "Name": "resourceGroupName", + "NameInRequest": "resourceGroupName", + "Doc": "The name of the resource group. The name is case insensitive.", + "Type": { + "$id": "912", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "913", + "Name": "parentProviderNamespace", + "NameInRequest": "parentProviderNamespace", + "Doc": "The parent resource provider namespace.", + "Type": { + "$id": "914", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "915", + "Name": "parentResourceType", + "NameInRequest": "parentResourceType", + "Doc": "The parent resource type.", + "Type": { + "$id": "916", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "917", + "Name": "parentResourceName", + "NameInRequest": "parentResourceName", + "Doc": "The parent resource name.", + "Type": { + "$id": "918", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "919", + "Name": "targetName", + "NameInRequest": "targetName", + "Doc": "String that represents a Target resource name.", + "Type": { + "$id": "920", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "921", + "Name": "capabilityName", + "NameInRequest": "capabilityName", + "Doc": "String that represents a Capability resource name.", + "Type": { + "$id": "922", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "923", + "Name": "contentType", + "NameInRequest": "Content-Type", + "Doc": "Body parameter's content type. Known values are application/json", + "Type": { + "$id": "924", + "kind": "constant", + "valueType": { + "$id": "925", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": true, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "926", + "Name": "accept", + "NameInRequest": "Accept", + "Type": { + "$id": "927", + "kind": "constant", + "valueType": { + "$id": "928", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "929", + "Name": "resource", + "NameInRequest": "resource", + "Doc": "Capability resource to be created or updated.", + "Type": { + "$ref": "785" + }, + "Location": "Body", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "930", + "StatusCodes": [ + 200 + ], + "BodyType": { + "$ref": "785" + }, + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false, + "ContentTypes": [ + "application/json" + ] + }, + { + "$id": "931", + "StatusCodes": [ + 201 + ], + "BodyType": { + "$ref": "785" + }, + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false, + "ContentTypes": [ + "application/json" + ] + } + ], + "HttpMethod": "PUT", + "RequestBodyMediaType": "Json", + "Uri": "{endpoint}", + "Path": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{parentProviderNamespace}/{parentResourceType}/{parentResourceName}/providers/Microsoft.Chaos/targets/{targetName}/capabilities/{capabilityName}", + "RequestMediaTypes": [ + "application/json" + ], + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Microsoft.Chaos.Capabilities.createOrUpdate", + "Decorators": [], + "Examples": [ + { + "$id": "932", + "kind": "http", + "name": "Create/update a Capability that extends a virtual machine Target resource.", + "description": "Create/update a Capability that extends a virtual machine Target resource.", + "filePath": "2025-01-01/Capabilities_CreateOrUpdate.json", + "parameters": [ + { + "$id": "933", + "parameter": { + "$ref": "904" + }, + "value": { + "$id": "934", + "kind": "string", + "type": { + "$ref": "905" + }, + "value": "2025-01-01" + } + }, + { + "$id": "935", + "parameter": { + "$ref": "929" + }, + "value": { + "$id": "936", + "kind": "model", + "type": { + "$ref": "785" + }, + "value": { + "$id": "937", + "properties": { + "$id": "938", + "kind": "model", + "type": { + "$ref": "787" + }, + "value": { + "$id": "939" + } + } + } + } + }, + { + "$id": "940", + "parameter": { + "$ref": "921" + }, + "value": { + "$id": "941", + "kind": "string", + "type": { + "$ref": "922" + }, + "value": "Shutdown-1.0" + } + }, + { + "$id": "942", + "parameter": { + "$ref": "913" + }, + "value": { + "$id": "943", + "kind": "string", + "type": { + "$ref": "914" + }, + "value": "Microsoft.Compute" + } + }, + { + "$id": "944", + "parameter": { + "$ref": "917" + }, + "value": { + "$id": "945", + "kind": "string", + "type": { + "$ref": "918" + }, + "value": "exampleVM" + } + }, + { + "$id": "946", + "parameter": { + "$ref": "915" + }, + "value": { + "$id": "947", + "kind": "string", + "type": { + "$ref": "916" + }, + "value": "virtualMachines" + } + }, + { + "$id": "948", + "parameter": { + "$ref": "911" + }, + "value": { + "$id": "949", + "kind": "string", + "type": { + "$ref": "912" + }, + "value": "exampleRG" + } + }, + { + "$id": "950", + "parameter": { + "$ref": "908" + }, + "value": { + "$id": "951", + "kind": "string", + "type": { + "$ref": "909" + }, + "value": "6b052e15-03d3-4f17-b2e1-be7f07588291" + } + }, + { + "$id": "952", + "parameter": { + "$ref": "919" + }, + "value": { + "$id": "953", + "kind": "string", + "type": { + "$ref": "920" + }, + "value": "Microsoft-VirtualMachine" + } + } + ], + "responses": [ + { + "$id": "954", + "response": { + "$ref": "930" + }, + "statusCode": 200, + "bodyValue": { + "$id": "955", + "kind": "model", + "type": { + "$ref": "785" + }, + "value": { + "$id": "956", + "name": { + "$id": "957", + "kind": "string", + "type": { + "$ref": "164" + }, + "value": "Shutdown-1.0" + }, + "type": { + "$id": "958", + "kind": "string", + "type": { + "$ref": "168" + }, + "value": "Microsoft.Chaos/targets/capabilities" + }, + "id": { + "$id": "959", + "kind": "string", + "type": { + "$ref": "159" + }, + "value": "/subscriptions/6b052e15-03d3-4f17-b2e1-be7f07588291/resourceGroups/exampleRG/providers/Microsoft.Compute/virtualMachines/exampleVM/providers/Microsoft.Chaos/targets/Microsoft-VirtualMachine/capabilities/Shutdown-1.0" + }, + "properties": { + "$id": "960", + "kind": "model", + "type": { + "$ref": "787" + }, + "value": { + "$id": "961", + "description": { + "$id": "962", + "kind": "string", + "type": { + "$ref": "797" + }, + "value": "Shutdown an Azure Virtual Machine for a defined period of time." + }, + "parametersSchema": { + "$id": "963", + "kind": "string", + "type": { + "$ref": "801" + }, + "value": "https://schema.centralus.chaos-prod.azure.com/targets/Microsoft-VirtualMachine/capabilities/Shutdown-1.0.json" + }, + "publisher": { + "$id": "964", + "kind": "string", + "type": { + "$ref": "789" + }, + "value": "Microsoft" + }, + "targetType": { + "$id": "965", + "kind": "string", + "type": { + "$ref": "793" + }, + "value": "VirtualMachine" + }, + "urn": { + "$id": "966", + "kind": "string", + "type": { + "$ref": "805" + }, + "value": "urn:csci:microsoft:virtualMachine:shutdown/1.0" + } + } + }, + "systemData": { + "$id": "967", + "kind": "model", + "type": { + "$ref": "173" + }, + "value": { + "$id": "968", + "createdAt": { + "$id": "969", + "kind": "string", + "type": { + "$ref": "182" + }, + "value": "2020-05-14T05:08:38.4662189Z" + }, + "lastModifiedAt": { + "$id": "970", + "kind": "string", + "type": { + "$ref": "194" + }, + "value": "2020-05-14T05:08:38.4662189Z" + } + } + } + } + } + }, + { + "$id": "971", + "response": { + "$ref": "931" + }, + "statusCode": 201, + "bodyValue": { + "$id": "972", + "kind": "model", + "type": { + "$ref": "785" + }, + "value": { + "$id": "973", + "name": { + "$id": "974", + "kind": "string", + "type": { + "$ref": "164" + }, + "value": "Shutdown-1.0" + }, + "type": { + "$id": "975", + "kind": "string", + "type": { + "$ref": "168" + }, + "value": "Microsoft.Chaos/targets/capabilities" + }, + "id": { + "$id": "976", + "kind": "string", + "type": { + "$ref": "159" + }, + "value": "/subscriptions/6b052e15-03d3-4f17-b2e1-be7f07588291/resourceGroups/exampleRG/providers/Microsoft.Compute/virtualMachines/exampleVM/providers/Microsoft.Chaos/targets/Microsoft-VirtualMachine/capabilities/Shutdown-1.0" + }, + "properties": { + "$id": "977", + "kind": "model", + "type": { + "$ref": "787" + }, + "value": { + "$id": "978", + "description": { + "$id": "979", + "kind": "string", + "type": { + "$ref": "797" + }, + "value": "Shutdown an Azure Virtual Machine for a defined period of time." + }, + "parametersSchema": { + "$id": "980", + "kind": "string", + "type": { + "$ref": "801" + }, + "value": "https://schema.centralus.chaos-prod.azure.com/targets/Microsoft-VirtualMachine/capabilities/Shutdown-1.0.json" + }, + "publisher": { + "$id": "981", + "kind": "string", + "type": { + "$ref": "789" + }, + "value": "Microsoft" + }, + "targetType": { + "$id": "982", + "kind": "string", + "type": { + "$ref": "793" + }, + "value": "VirtualMachine" + }, + "urn": { + "$id": "983", + "kind": "string", + "type": { + "$ref": "805" + }, + "value": "urn:csci:microsoft:virtualMachine:shutdown/1.0" + } + } + }, + "systemData": { + "$id": "984", + "kind": "model", + "type": { + "$ref": "173" + }, + "value": { + "$id": "985", + "createdAt": { + "$id": "986", + "kind": "string", + "type": { + "$ref": "182" + }, + "value": "2020-05-14T05:08:38.4662189Z" + }, + "lastModifiedAt": { + "$id": "987", + "kind": "string", + "type": { + "$ref": "194" + }, + "value": "2020-05-14T05:08:38.4662189Z" + } + } + } + } + } + } + ] + } + ] + }, + { + "$id": "988", + "Name": "delete", + "ResourceName": "Capability", + "Doc": "Delete a Capability that extends a Target resource.", + "Accessibility": "public", + "Parameters": [ + { + "$id": "989", + "Name": "apiVersion", + "NameInRequest": "api-version", + "Doc": "The API version to use for this operation.", + "Type": { + "$id": "990", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": true, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "DefaultValue": { + "$id": "991", + "Type": { + "$id": "992", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "2025-01-01" + }, + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "993", + "Name": "subscriptionId", + "NameInRequest": "subscriptionId", + "Doc": "The ID of the target subscription. The value must be an UUID.", + "Type": { + "$id": "994", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "995", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "996", + "Name": "resourceGroupName", + "NameInRequest": "resourceGroupName", + "Doc": "The name of the resource group. The name is case insensitive.", + "Type": { + "$id": "997", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "998", + "Name": "parentProviderNamespace", + "NameInRequest": "parentProviderNamespace", + "Doc": "The parent resource provider namespace.", + "Type": { + "$id": "999", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1000", + "Name": "parentResourceType", + "NameInRequest": "parentResourceType", + "Doc": "The parent resource type.", + "Type": { + "$id": "1001", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1002", + "Name": "parentResourceName", + "NameInRequest": "parentResourceName", + "Doc": "The parent resource name.", + "Type": { + "$id": "1003", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1004", + "Name": "targetName", + "NameInRequest": "targetName", + "Doc": "String that represents a Target resource name.", + "Type": { + "$id": "1005", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1006", + "Name": "capabilityName", + "NameInRequest": "capabilityName", + "Doc": "String that represents a Capability resource name.", + "Type": { + "$id": "1007", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1008", + "Name": "accept", + "NameInRequest": "Accept", + "Type": { + "$id": "1009", + "kind": "constant", + "valueType": { + "$id": "1010", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "1011", + "StatusCodes": [ + 200 + ], + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false + }, + { + "$id": "1012", + "StatusCodes": [ + 204 + ], + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false + } + ], + "HttpMethod": "DELETE", + "RequestBodyMediaType": "None", + "Uri": "{endpoint}", + "Path": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{parentProviderNamespace}/{parentResourceType}/{parentResourceName}/providers/Microsoft.Chaos/targets/{targetName}/capabilities/{capabilityName}", + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Microsoft.Chaos.Capabilities.delete", + "Decorators": [], + "Examples": [ + { + "$id": "1013", + "kind": "http", + "name": "Delete a Capability that extends a virtual machine Target resource.", + "description": "Delete a Capability that extends a virtual machine Target resource.", + "filePath": "2025-01-01/Capabilities_Delete.json", + "parameters": [ + { + "$id": "1014", + "parameter": { + "$ref": "989" + }, + "value": { + "$id": "1015", + "kind": "string", + "type": { + "$ref": "990" + }, + "value": "2025-01-01" + } + }, + { + "$id": "1016", + "parameter": { + "$ref": "1006" + }, + "value": { + "$id": "1017", + "kind": "string", + "type": { + "$ref": "1007" + }, + "value": "Shutdown-1.0" + } + }, + { + "$id": "1018", + "parameter": { + "$ref": "998" + }, + "value": { + "$id": "1019", + "kind": "string", + "type": { + "$ref": "999" + }, + "value": "Microsoft.Compute" + } + }, + { + "$id": "1020", + "parameter": { + "$ref": "1002" + }, + "value": { + "$id": "1021", + "kind": "string", + "type": { + "$ref": "1003" + }, + "value": "exampleVM" + } + }, + { + "$id": "1022", + "parameter": { + "$ref": "1000" + }, + "value": { + "$id": "1023", + "kind": "string", + "type": { + "$ref": "1001" + }, + "value": "virtualMachines" + } + }, + { + "$id": "1024", + "parameter": { + "$ref": "996" + }, + "value": { + "$id": "1025", + "kind": "string", + "type": { + "$ref": "997" + }, + "value": "exampleRG" + } + }, + { + "$id": "1026", + "parameter": { + "$ref": "993" + }, + "value": { + "$id": "1027", + "kind": "string", + "type": { + "$ref": "994" + }, + "value": "6b052e15-03d3-4f17-b2e1-be7f07588291" + } + }, + { + "$id": "1028", + "parameter": { + "$ref": "1004" + }, + "value": { + "$id": "1029", + "kind": "string", + "type": { + "$ref": "1005" + }, + "value": "Microsoft-VirtualMachine" + } + } + ], + "responses": [ + { + "$id": "1030", + "response": { + "$ref": "1011" + }, + "statusCode": 200 + }, + { + "$id": "1031", + "response": { + "$ref": "1012" + }, + "statusCode": 204 + } + ] + } + ] + }, + { + "$id": "1032", + "Name": "list", + "ResourceName": "Capability", + "Doc": "Get a list of Capability resources that extend a Target resource.", + "Accessibility": "public", + "Parameters": [ + { + "$id": "1033", + "Name": "apiVersion", + "NameInRequest": "api-version", + "Doc": "The API version to use for this operation.", + "Type": { + "$id": "1034", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": true, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "DefaultValue": { + "$id": "1035", + "Type": { + "$id": "1036", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "2025-01-01" + }, + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1037", + "Name": "subscriptionId", + "NameInRequest": "subscriptionId", + "Doc": "The ID of the target subscription. The value must be an UUID.", + "Type": { + "$id": "1038", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "1039", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1040", + "Name": "resourceGroupName", + "NameInRequest": "resourceGroupName", + "Doc": "The name of the resource group. The name is case insensitive.", + "Type": { + "$id": "1041", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1042", + "Name": "parentProviderNamespace", + "NameInRequest": "parentProviderNamespace", + "Doc": "The parent resource provider namespace.", + "Type": { + "$id": "1043", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1044", + "Name": "parentResourceType", + "NameInRequest": "parentResourceType", + "Doc": "The parent resource type.", + "Type": { + "$id": "1045", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1046", + "Name": "parentResourceName", + "NameInRequest": "parentResourceName", + "Doc": "The parent resource name.", + "Type": { + "$id": "1047", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1048", + "Name": "continuationToken", + "NameInRequest": "continuationToken", + "Doc": "String that sets the continuation token.", + "Type": { + "$id": "1049", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": false, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1050", + "Name": "targetName", + "NameInRequest": "targetName", + "Doc": "String that represents a Target resource name.", + "Type": { + "$id": "1051", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1052", + "Name": "accept", + "NameInRequest": "Accept", + "Type": { + "$id": "1053", + "kind": "constant", + "valueType": { + "$id": "1054", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "1055", + "StatusCodes": [ + 200 + ], + "BodyType": { + "$ref": "810" + }, + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false, + "ContentTypes": [ + "application/json" + ] + } + ], + "HttpMethod": "GET", + "RequestBodyMediaType": "None", + "Uri": "{endpoint}", + "Path": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{parentProviderNamespace}/{parentResourceType}/{parentResourceName}/providers/Microsoft.Chaos/targets/{targetName}/capabilities", + "BufferResponse": true, + "Paging": { + "$id": "1056", + "ItemName": "value", + "NextLinkName": "nextLink" + }, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Microsoft.Chaos.Capabilities.list", + "Decorators": [], + "Examples": [ + { + "$id": "1057", + "kind": "http", + "name": "List all Capabilities that extend a virtual machine Target resource.", + "description": "List all Capabilities that extend a virtual machine Target resource.", + "filePath": "2025-01-01/Capabilities_List.json", + "parameters": [ + { + "$id": "1058", + "parameter": { + "$ref": "1033" + }, + "value": { + "$id": "1059", + "kind": "string", + "type": { + "$ref": "1034" + }, + "value": "2025-01-01" + } + }, + { + "$id": "1060", + "parameter": { + "$ref": "1042" + }, + "value": { + "$id": "1061", + "kind": "string", + "type": { + "$ref": "1043" + }, + "value": "Microsoft.Compute" + } + }, + { + "$id": "1062", + "parameter": { + "$ref": "1046" + }, + "value": { + "$id": "1063", + "kind": "string", + "type": { + "$ref": "1047" + }, + "value": "exampleVM" + } + }, + { + "$id": "1064", + "parameter": { + "$ref": "1044" + }, + "value": { + "$id": "1065", + "kind": "string", + "type": { + "$ref": "1045" + }, + "value": "virtualMachines" + } + }, + { + "$id": "1066", + "parameter": { + "$ref": "1040" + }, + "value": { + "$id": "1067", + "kind": "string", + "type": { + "$ref": "1041" + }, + "value": "exampleRG" + } + }, + { + "$id": "1068", + "parameter": { + "$ref": "1037" + }, + "value": { + "$id": "1069", + "kind": "string", + "type": { + "$ref": "1038" + }, + "value": "6b052e15-03d3-4f17-b2e1-be7f07588291" + } + }, + { + "$id": "1070", + "parameter": { + "$ref": "1050" + }, + "value": { + "$id": "1071", + "kind": "string", + "type": { + "$ref": "1051" + }, + "value": "Microsoft-VirtualMachine" + } + } + ], + "responses": [ + { + "$id": "1072", + "response": { + "$ref": "1055" + }, + "statusCode": 200, + "bodyValue": { + "$id": "1073", + "kind": "model", + "type": { + "$ref": "810" + }, + "value": { + "$id": "1074", + "nextLink": { + "$id": "1075", + "kind": "string", + "type": { + "$ref": "816" + }, + "value": "https://management.azure.com/subscriptions/6b052e15-03d3-4f17-b2e1-be7f07588291/resourceGroups/exampleRG/providers/Microsoft.Compute/virtualMachines/exampleVM/providers/Microsoft.Chaos/targets/Microsoft-VirtualMachine/capabilities?continuationToken=&api-version=2024-11-01-preview" + }, + "value": { + "$id": "1076", + "kind": "array", + "type": { + "$ref": "812" + }, + "value": [ + { + "$id": "1077", + "kind": "model", + "type": { + "$ref": "785" + }, + "value": { + "$id": "1078", + "name": { + "$id": "1079", + "kind": "string", + "type": { + "$ref": "164" + }, + "value": "Shutdown-1.0" + }, + "type": { + "$id": "1080", + "kind": "string", + "type": { + "$ref": "168" + }, + "value": "Microsoft.Chaos/targets/capabilities" + }, + "id": { + "$id": "1081", + "kind": "string", + "type": { + "$ref": "159" + }, + "value": "/subscriptions/6b052e15-03d3-4f17-b2e1-be7f07588291/resourceGroups/exampleRG/providers/Microsoft.Compute/virtualMachines/exampleVM/providers/Microsoft.Chaos/targets/Microsoft-VirtualMachine/capabilities/Shutdown-1.0" + }, + "properties": { + "$id": "1082", + "kind": "model", + "type": { + "$ref": "787" + }, + "value": { + "$id": "1083", + "description": { + "$id": "1084", + "kind": "string", + "type": { + "$ref": "797" + }, + "value": "Shutdown an Azure Virtual Machine for a defined period of time." + }, + "parametersSchema": { + "$id": "1085", + "kind": "string", + "type": { + "$ref": "801" + }, + "value": "https://schema.centralus.chaos-prod.azure.com/targets/Microsoft-VirtualMachine/capabilities/Shutdown-1.0.json" + }, + "publisher": { + "$id": "1086", + "kind": "string", + "type": { + "$ref": "789" + }, + "value": "Microsoft" + }, + "targetType": { + "$id": "1087", + "kind": "string", + "type": { + "$ref": "793" + }, + "value": "VirtualMachine" + }, + "urn": { + "$id": "1088", + "kind": "string", + "type": { + "$ref": "805" + }, + "value": "urn:csci:microsoft:virtualMachine:shutdown/1.0" + } + } + }, + "systemData": { + "$id": "1089", + "kind": "model", + "type": { + "$ref": "173" + }, + "value": { + "$id": "1090", + "createdAt": { + "$id": "1091", + "kind": "string", + "type": { + "$ref": "182" + }, + "value": "2020-05-14T05:08:38.4662189Z" + }, + "lastModifiedAt": { + "$id": "1092", + "kind": "string", + "type": { + "$ref": "194" + }, + "value": "2020-05-14T05:08:38.4662189Z" + } + } + } + } + } + ] + } + } + } + } + ] + } + ] + } + ], + "Protocol": { + "$id": "1093" + }, + "Parent": "ChaosClient", + "Parameters": [ + { + "$id": "1094", + "Name": "endpoint", + "NameInRequest": "endpoint", + "Doc": "Service host", + "Type": { + "$id": "1095", + "kind": "url", + "name": "url", + "crossLanguageDefinitionId": "TypeSpec.url" + }, + "Location": "Uri", + "IsApiVersion": false, + "IsResourceParameter": false, + "IsContentType": false, + "IsRequired": true, + "IsEndpoint": true, + "SkipUrlEncoding": false, + "Explode": false, + "Kind": "Client", + "DefaultValue": { + "$id": "1096", + "Type": { + "$id": "1097", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "https://management.azure.com" + } + } + ], + "Decorators": [] + }, + { + "$id": "1098", + "Name": "Operations", + "ClientNamespace": "Microsoft.Chaos", + "Operations": [ + { + "$id": "1099", + "Name": "list", + "ResourceName": "Operations", + "Doc": "List the operations for the provider", + "Accessibility": "public", + "Parameters": [ + { + "$id": "1100", + "Name": "apiVersion", + "NameInRequest": "api-version", + "Doc": "The API version to use for this operation.", + "Type": { + "$id": "1101", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": true, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "DefaultValue": { + "$id": "1102", + "Type": { + "$id": "1103", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "2025-01-01" + }, + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1104", + "Name": "accept", + "NameInRequest": "Accept", + "Type": { + "$id": "1105", + "kind": "constant", + "valueType": { + "$id": "1106", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "1107", + "StatusCodes": [ + 200 + ], + "BodyType": { + "$ref": "740" + }, + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false, + "ContentTypes": [ + "application/json" + ] + } + ], + "HttpMethod": "GET", + "RequestBodyMediaType": "None", + "Uri": "{endpoint}", + "Path": "/providers/Microsoft.Chaos/operations", + "BufferResponse": true, + "Paging": { + "$id": "1108", + "ItemName": "value", + "NextLinkName": "nextLink" + }, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Azure.ResourceManager.Operations.list", + "Decorators": [], + "Examples": [ + { + "$id": "1109", + "kind": "http", + "name": "Lists all Chaos Studio operations.", + "description": "Lists all Chaos Studio operations.", + "filePath": "2025-01-01/Operations_List.json", + "parameters": [ + { + "$id": "1110", + "parameter": { + "$ref": "1100" + }, + "value": { + "$id": "1111", + "kind": "string", + "type": { + "$ref": "1101" + }, + "value": "2025-01-01" + } + } + ], + "responses": [ + { + "$id": "1112", + "response": { + "$ref": "1107" + }, + "statusCode": 200, + "bodyValue": { + "$id": "1113", + "kind": "model", + "type": { + "$ref": "740" + }, + "value": { + "$id": "1114", + "nextLink": { + "$id": "1115", + "kind": "string", + "type": { + "$ref": "781" + }, + "value": "https://management.azure.com/providers/Microsoft.Chaos/operations?continuationToken=myContinuationToken&api-version=2024-11-01-preview" + }, + "value": { + "$id": "1116", + "kind": "array", + "type": { + "$ref": "742" + }, + "value": [ + { + "$id": "1117", + "kind": "model", + "type": { + "$ref": "743" + }, + "value": { + "$id": "1118", + "name": { + "$id": "1119", + "kind": "string", + "type": { + "$ref": "745" + }, + "value": "Microsoft.Chaos/experiments/read" + }, + "display": { + "$id": "1120", + "kind": "model", + "type": { + "$ref": "753" + }, + "value": { + "$id": "1121", + "provider": { + "$id": "1122", + "kind": "string", + "type": { + "$ref": "755" + }, + "value": "Microsoft Chaos" + }, + "resource": { + "$id": "1123", + "kind": "string", + "type": { + "$ref": "759" + }, + "value": "Chaos Experiment" + }, + "operation": { + "$id": "1124", + "kind": "string", + "type": { + "$ref": "763" + }, + "value": "Gets all Chaos Experiments." + }, + "description": { + "$id": "1125", + "kind": "string", + "type": { + "$ref": "767" + }, + "value": "Gets all Chaos Experiments in a resource group." + } + } + }, + "isDataAction": { + "$id": "1126", + "kind": "boolean", + "type": { + "$ref": "749" + }, + "value": false + }, + "origin": { + "$id": "1127", + "kind": "string", + "type": { + "$ref": "66" + }, + "value": "user,system" + } + } + } + ] + } + } + } + } + ] + } + ] + } + ], + "Protocol": { + "$id": "1128" + }, + "Parent": "ChaosClient", + "Parameters": [ + { + "$id": "1129", + "Name": "endpoint", + "NameInRequest": "endpoint", + "Doc": "Service host", + "Type": { + "$id": "1130", + "kind": "url", + "name": "url", + "crossLanguageDefinitionId": "TypeSpec.url" + }, + "Location": "Uri", + "IsApiVersion": false, + "IsResourceParameter": false, + "IsContentType": false, + "IsRequired": true, + "IsEndpoint": true, + "SkipUrlEncoding": false, + "Explode": false, + "Kind": "Client", + "DefaultValue": { + "$id": "1131", + "Type": { + "$id": "1132", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "https://management.azure.com" + } + } + ], + "Decorators": [] + }, + { + "$id": "1133", + "Name": "Targets", + "ClientNamespace": "Microsoft.Chaos", + "Operations": [ + { + "$id": "1134", + "Name": "get", + "ResourceName": "Target", + "Doc": "Get a Target resource that extends a tracked regional resource.", + "Accessibility": "public", + "Parameters": [ + { + "$id": "1135", + "Name": "apiVersion", + "NameInRequest": "api-version", + "Doc": "The API version to use for this operation.", + "Type": { + "$id": "1136", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": true, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "DefaultValue": { + "$id": "1137", + "Type": { + "$id": "1138", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "2025-01-01" + }, + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1139", + "Name": "subscriptionId", + "NameInRequest": "subscriptionId", + "Doc": "The ID of the target subscription. The value must be an UUID.", + "Type": { + "$id": "1140", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "1141", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1142", + "Name": "resourceGroupName", + "NameInRequest": "resourceGroupName", + "Doc": "The name of the resource group. The name is case insensitive.", + "Type": { + "$id": "1143", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1144", + "Name": "parentProviderNamespace", + "NameInRequest": "parentProviderNamespace", + "Doc": "The parent resource provider namespace.", + "Type": { + "$id": "1145", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1146", + "Name": "parentResourceType", + "NameInRequest": "parentResourceType", + "Doc": "The parent resource type.", + "Type": { + "$id": "1147", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1148", + "Name": "parentResourceName", + "NameInRequest": "parentResourceName", + "Doc": "The parent resource name.", + "Type": { + "$id": "1149", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1150", + "Name": "targetName", + "NameInRequest": "targetName", + "Doc": "String that represents a Target resource name.", + "Type": { + "$id": "1151", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1152", + "Name": "accept", + "NameInRequest": "Accept", + "Type": { + "$id": "1153", + "kind": "constant", + "valueType": { + "$id": "1154", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "1155", + "StatusCodes": [ + 200 + ], + "BodyType": { + "$ref": "718" + }, + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false, + "ContentTypes": [ + "application/json" + ] + } + ], + "HttpMethod": "GET", + "RequestBodyMediaType": "None", + "Uri": "{endpoint}", + "Path": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{parentProviderNamespace}/{parentResourceType}/{parentResourceName}/providers/Microsoft.Chaos/targets/{targetName}", + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Microsoft.Chaos.Targets.get", + "Decorators": [], + "Examples": [ + { + "$id": "1156", + "kind": "http", + "name": "Get a Target that extends a virtual machine resource.", + "description": "Get a Target that extends a virtual machine resource.", + "filePath": "2025-01-01/Targets_Get.json", + "parameters": [ + { + "$id": "1157", + "parameter": { + "$ref": "1135" + }, + "value": { + "$id": "1158", + "kind": "string", + "type": { + "$ref": "1136" + }, + "value": "2025-01-01" + } + }, + { + "$id": "1159", + "parameter": { + "$ref": "1144" + }, + "value": { + "$id": "1160", + "kind": "string", + "type": { + "$ref": "1145" + }, + "value": "Microsoft.Compute" + } + }, + { + "$id": "1161", + "parameter": { + "$ref": "1148" + }, + "value": { + "$id": "1162", + "kind": "string", + "type": { + "$ref": "1149" + }, + "value": "exampleVM" + } + }, + { + "$id": "1163", + "parameter": { + "$ref": "1146" + }, + "value": { + "$id": "1164", + "kind": "string", + "type": { + "$ref": "1147" + }, + "value": "virtualMachines" + } + }, + { + "$id": "1165", + "parameter": { + "$ref": "1142" + }, + "value": { + "$id": "1166", + "kind": "string", + "type": { + "$ref": "1143" + }, + "value": "exampleRG" + } + }, + { + "$id": "1167", + "parameter": { + "$ref": "1139" + }, + "value": { + "$id": "1168", + "kind": "string", + "type": { + "$ref": "1140" + }, + "value": "6b052e15-03d3-4f17-b2e1-be7f07588291" + } + }, + { + "$id": "1169", + "parameter": { + "$ref": "1150" + }, + "value": { + "$id": "1170", + "kind": "string", + "type": { + "$ref": "1151" + }, + "value": "Microsoft-Agent" + } + } + ], + "responses": [ + { + "$id": "1171", + "response": { + "$ref": "1155" + }, + "statusCode": 200, + "bodyValue": { + "$id": "1172", + "kind": "model", + "type": { + "$ref": "718" + }, + "value": { + "$id": "1173", + "name": { + "$id": "1174", + "kind": "string", + "type": { + "$ref": "164" + }, + "value": "Microsoft-Agent" + }, + "type": { + "$id": "1175", + "kind": "string", + "type": { + "$ref": "168" + }, + "value": "Microsoft.Chaos/targets" + }, + "id": { + "$id": "1176", + "kind": "string", + "type": { + "$ref": "159" + }, + "value": "/subscriptions/6b052e15-03d3-4f17-b2e1-be7f07588291/resourceGroups/exampleRG/providers/Microsoft.Compute/virtualMachines/exampleVM/providers/Microsoft.Chaos/targets/Microsoft-Agent" + }, + "location": { + "$id": "1177", + "kind": "string", + "type": { + "$ref": "726" + }, + "value": "centraluseuap" + }, + "properties": { + "$id": "1178", + "kind": "dict", + "type": { + "$ref": "720" + }, + "value": { + "$id": "1179", + "agentProfileId": { + "$id": "1180", + "kind": "unknown", + "type": { + "$ref": "722" + }, + "value": "ac4e8251-fdc9-4277-8e87-dc57fe5794cf" + }, + "identities": { + "$id": "1181", + "kind": "unknown", + "type": { + "$ref": "722" + }, + "value": [ + { + "$id": "1182", + "type": "CertificateSubjectIssuer", + "subject": "CN=example.subject" + } + ] + } + } + }, + "systemData": { + "$id": "1183", + "kind": "model", + "type": { + "$ref": "173" + }, + "value": { + "$id": "1184", + "createdAt": { + "$id": "1185", + "kind": "string", + "type": { + "$ref": "182" + }, + "value": "2021-07-01T00:00:00.0Z" + }, + "lastModifiedAt": { + "$id": "1186", + "kind": "string", + "type": { + "$ref": "194" + }, + "value": "2021-07-01T00:00:00.0Z" + } + } + } + } + } + } + ] + } + ] + }, + { + "$id": "1187", + "Name": "createOrUpdate", + "ResourceName": "Target", + "Doc": "Create or update a Target resource that extends a tracked regional resource.", + "Accessibility": "public", + "Parameters": [ + { + "$id": "1188", + "Name": "apiVersion", + "NameInRequest": "api-version", + "Doc": "The API version to use for this operation.", + "Type": { + "$id": "1189", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": true, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "DefaultValue": { + "$id": "1190", + "Type": { + "$id": "1191", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "2025-01-01" + }, + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1192", + "Name": "subscriptionId", + "NameInRequest": "subscriptionId", + "Doc": "The ID of the target subscription. The value must be an UUID.", + "Type": { + "$id": "1193", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "1194", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1195", + "Name": "resourceGroupName", + "NameInRequest": "resourceGroupName", + "Doc": "The name of the resource group. The name is case insensitive.", + "Type": { + "$id": "1196", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1197", + "Name": "parentProviderNamespace", + "NameInRequest": "parentProviderNamespace", + "Doc": "The parent resource provider namespace.", + "Type": { + "$id": "1198", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1199", + "Name": "parentResourceType", + "NameInRequest": "parentResourceType", + "Doc": "The parent resource type.", + "Type": { + "$id": "1200", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1201", + "Name": "parentResourceName", + "NameInRequest": "parentResourceName", + "Doc": "The parent resource name.", + "Type": { + "$id": "1202", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1203", + "Name": "targetName", + "NameInRequest": "targetName", + "Doc": "String that represents a Target resource name.", + "Type": { + "$id": "1204", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1205", + "Name": "contentType", + "NameInRequest": "Content-Type", + "Doc": "Body parameter's content type. Known values are application/json", + "Type": { + "$id": "1206", + "kind": "constant", + "valueType": { + "$id": "1207", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": true, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1208", + "Name": "accept", + "NameInRequest": "Accept", + "Type": { + "$id": "1209", + "kind": "constant", + "valueType": { + "$id": "1210", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1211", + "Name": "resource", + "NameInRequest": "resource", + "Doc": "Target resource to be created or updated.", + "Type": { + "$ref": "718" + }, + "Location": "Body", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "1212", + "StatusCodes": [ + 200 + ], + "BodyType": { + "$ref": "718" + }, + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false, + "ContentTypes": [ + "application/json" + ] + }, + { + "$id": "1213", + "StatusCodes": [ + 201 + ], + "BodyType": { + "$ref": "718" + }, + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false, + "ContentTypes": [ + "application/json" + ] + } + ], + "HttpMethod": "PUT", + "RequestBodyMediaType": "Json", + "Uri": "{endpoint}", + "Path": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{parentProviderNamespace}/{parentResourceType}/{parentResourceName}/providers/Microsoft.Chaos/targets/{targetName}", + "RequestMediaTypes": [ + "application/json" + ], + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Microsoft.Chaos.Targets.createOrUpdate", + "Decorators": [], + "Examples": [ + { + "$id": "1214", + "kind": "http", + "name": "Create/update a Target that extends a virtual machine resource.", + "description": "Create/update a Target that extends a virtual machine resource.", + "filePath": "2025-01-01/Targets_CreateOrUpdate.json", + "parameters": [ + { + "$id": "1215", + "parameter": { + "$ref": "1188" + }, + "value": { + "$id": "1216", + "kind": "string", + "type": { + "$ref": "1189" + }, + "value": "2025-01-01" + } + }, + { + "$id": "1217", + "parameter": { + "$ref": "1197" + }, + "value": { + "$id": "1218", + "kind": "string", + "type": { + "$ref": "1198" + }, + "value": "Microsoft.Compute" + } + }, + { + "$id": "1219", + "parameter": { + "$ref": "1201" + }, + "value": { + "$id": "1220", + "kind": "string", + "type": { + "$ref": "1202" + }, + "value": "exampleVM" + } + }, + { + "$id": "1221", + "parameter": { + "$ref": "1199" + }, + "value": { + "$id": "1222", + "kind": "string", + "type": { + "$ref": "1200" + }, + "value": "virtualMachines" + } + }, + { + "$id": "1223", + "parameter": { + "$ref": "1195" + }, + "value": { + "$id": "1224", + "kind": "string", + "type": { + "$ref": "1196" + }, + "value": "exampleRG" + } + }, + { + "$id": "1225", + "parameter": { + "$ref": "1192" + }, + "value": { + "$id": "1226", + "kind": "string", + "type": { + "$ref": "1193" + }, + "value": "6b052e15-03d3-4f17-b2e1-be7f07588291" + } + }, + { + "$id": "1227", + "parameter": { + "$ref": "1211" + }, + "value": { + "$id": "1228", + "kind": "model", + "type": { + "$ref": "718" + }, + "value": { + "$id": "1229", + "properties": { + "$id": "1230", + "kind": "dict", + "type": { + "$ref": "720" + }, + "value": { + "$id": "1231" + } + } + } + } + }, + { + "$id": "1232", + "parameter": { + "$ref": "1203" + }, + "value": { + "$id": "1233", + "kind": "string", + "type": { + "$ref": "1204" + }, + "value": "Microsoft-VirtualMachine" + } + } + ], + "responses": [ + { + "$id": "1234", + "response": { + "$ref": "1212" + }, + "statusCode": 200, + "bodyValue": { + "$id": "1235", + "kind": "model", + "type": { + "$ref": "718" + }, + "value": { + "$id": "1236", + "name": { + "$id": "1237", + "kind": "string", + "type": { + "$ref": "164" + }, + "value": "Microsoft-VirtualMachine" + }, + "type": { + "$id": "1238", + "kind": "string", + "type": { + "$ref": "168" + }, + "value": "Microsoft.Chaos/targets" + }, + "id": { + "$id": "1239", + "kind": "string", + "type": { + "$ref": "159" + }, + "value": "/subscriptions/6b052e15-03d3-4f17-b2e1-be7f07588291/resourceGroups/exampleRG/providers/Microsoft.Compute/virtualMachines/exampleVM/providers/Microsoft.Chaos/targets/Microsoft-VirtualMachine" + }, + "properties": { + "$id": "1240", + "kind": "dict", + "type": { + "$ref": "720" + }, + "value": { + "$id": "1241" + } + }, + "systemData": { + "$id": "1242", + "kind": "model", + "type": { + "$ref": "173" + }, + "value": { + "$id": "1243", + "createdAt": { + "$id": "1244", + "kind": "string", + "type": { + "$ref": "182" + }, + "value": "2021-07-01T00:00:00.0Z" + }, + "lastModifiedAt": { + "$id": "1245", + "kind": "string", + "type": { + "$ref": "194" + }, + "value": "2021-07-01T00:00:00.0Z" + } + } + } + } + } + }, + { + "$id": "1246", + "response": { + "$ref": "1213" + }, + "statusCode": 201, + "bodyValue": { + "$id": "1247", + "kind": "model", + "type": { + "$ref": "718" + }, + "value": { + "$id": "1248", + "name": { + "$id": "1249", + "kind": "string", + "type": { + "$ref": "164" + }, + "value": "Microsoft-VirtualMachine" + }, + "type": { + "$id": "1250", + "kind": "string", + "type": { + "$ref": "168" + }, + "value": "Microsoft.Chaos/targets" + }, + "id": { + "$id": "1251", + "kind": "string", + "type": { + "$ref": "159" + }, + "value": "/subscriptions/6b052e15-03d3-4f17-b2e1-be7f07588291/resourceGroups/exampleRG/providers/Microsoft.Compute/virtualMachines/exampleVM/providers/Microsoft.Chaos/targets/Microsoft-VirtualMachine" + }, + "properties": { + "$id": "1252", + "kind": "dict", + "type": { + "$ref": "720" + }, + "value": { + "$id": "1253" + } + }, + "systemData": { + "$id": "1254", + "kind": "model", + "type": { + "$ref": "173" + }, + "value": { + "$id": "1255", + "createdAt": { + "$id": "1256", + "kind": "string", + "type": { + "$ref": "182" + }, + "value": "2021-07-01T00:00:00.0Z" + }, + "lastModifiedAt": { + "$id": "1257", + "kind": "string", + "type": { + "$ref": "194" + }, + "value": "2021-07-01T00:00:00.0Z" + } + } + } + } + } + } + ] + } + ] + }, + { + "$id": "1258", + "Name": "delete", + "ResourceName": "Target", + "Doc": "Delete a Target resource that extends a tracked regional resource.", + "Accessibility": "public", + "Parameters": [ + { + "$id": "1259", + "Name": "apiVersion", + "NameInRequest": "api-version", + "Doc": "The API version to use for this operation.", + "Type": { + "$id": "1260", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": true, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "DefaultValue": { + "$id": "1261", + "Type": { + "$id": "1262", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "2025-01-01" + }, + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1263", + "Name": "subscriptionId", + "NameInRequest": "subscriptionId", + "Doc": "The ID of the target subscription. The value must be an UUID.", + "Type": { + "$id": "1264", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "1265", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1266", + "Name": "resourceGroupName", + "NameInRequest": "resourceGroupName", + "Doc": "The name of the resource group. The name is case insensitive.", + "Type": { + "$id": "1267", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1268", + "Name": "parentProviderNamespace", + "NameInRequest": "parentProviderNamespace", + "Doc": "The parent resource provider namespace.", + "Type": { + "$id": "1269", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1270", + "Name": "parentResourceType", + "NameInRequest": "parentResourceType", + "Doc": "The parent resource type.", + "Type": { + "$id": "1271", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1272", + "Name": "parentResourceName", + "NameInRequest": "parentResourceName", + "Doc": "The parent resource name.", + "Type": { + "$id": "1273", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1274", + "Name": "targetName", + "NameInRequest": "targetName", + "Doc": "String that represents a Target resource name.", + "Type": { + "$id": "1275", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1276", + "Name": "accept", + "NameInRequest": "Accept", + "Type": { + "$id": "1277", + "kind": "constant", + "valueType": { + "$id": "1278", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "1279", + "StatusCodes": [ + 200 + ], + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false + }, + { + "$id": "1280", + "StatusCodes": [ + 204 + ], + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false + } + ], + "HttpMethod": "DELETE", + "RequestBodyMediaType": "None", + "Uri": "{endpoint}", + "Path": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{parentProviderNamespace}/{parentResourceType}/{parentResourceName}/providers/Microsoft.Chaos/targets/{targetName}", + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Microsoft.Chaos.Targets.delete", + "Decorators": [], + "Examples": [ + { + "$id": "1281", + "kind": "http", + "name": "Delete a Target that extends a virtual machine resource.", + "description": "Delete a Target that extends a virtual machine resource.", + "filePath": "2025-01-01/Targets_Delete.json", + "parameters": [ + { + "$id": "1282", + "parameter": { + "$ref": "1259" + }, + "value": { + "$id": "1283", + "kind": "string", + "type": { + "$ref": "1260" + }, + "value": "2025-01-01" + } + }, + { + "$id": "1284", + "parameter": { + "$ref": "1268" + }, + "value": { + "$id": "1285", + "kind": "string", + "type": { + "$ref": "1269" + }, + "value": "Microsoft.Compute" + } + }, + { + "$id": "1286", + "parameter": { + "$ref": "1272" + }, + "value": { + "$id": "1287", + "kind": "string", + "type": { + "$ref": "1273" + }, + "value": "exampleVM" + } + }, + { + "$id": "1288", + "parameter": { + "$ref": "1270" + }, + "value": { + "$id": "1289", + "kind": "string", + "type": { + "$ref": "1271" + }, + "value": "virtualMachines" + } + }, + { + "$id": "1290", + "parameter": { + "$ref": "1266" + }, + "value": { + "$id": "1291", + "kind": "string", + "type": { + "$ref": "1267" + }, + "value": "exampleRG" + } + }, + { + "$id": "1292", + "parameter": { + "$ref": "1263" + }, + "value": { + "$id": "1293", + "kind": "string", + "type": { + "$ref": "1264" + }, + "value": "6b052e15-03d3-4f17-b2e1-be7f07588291" + } + }, + { + "$id": "1294", + "parameter": { + "$ref": "1274" + }, + "value": { + "$id": "1295", + "kind": "string", + "type": { + "$ref": "1275" + }, + "value": "Microsoft-Agent" + } + } + ], + "responses": [ + { + "$id": "1296", + "response": { + "$ref": "1279" + }, + "statusCode": 200 + }, + { + "$id": "1297", + "response": { + "$ref": "1280" + }, + "statusCode": 204 + } + ] + } + ] + }, + { + "$id": "1298", + "Name": "list", + "ResourceName": "Target", + "Doc": "Get a list of Target resources that extend a tracked regional resource.", + "Accessibility": "public", + "Parameters": [ + { + "$id": "1299", + "Name": "apiVersion", + "NameInRequest": "api-version", + "Doc": "The API version to use for this operation.", + "Type": { + "$id": "1300", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": true, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "DefaultValue": { + "$id": "1301", + "Type": { + "$id": "1302", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "2025-01-01" + }, + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1303", + "Name": "subscriptionId", + "NameInRequest": "subscriptionId", + "Doc": "The ID of the target subscription. The value must be an UUID.", + "Type": { + "$id": "1304", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "1305", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1306", + "Name": "resourceGroupName", + "NameInRequest": "resourceGroupName", + "Doc": "The name of the resource group. The name is case insensitive.", + "Type": { + "$id": "1307", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1308", + "Name": "parentProviderNamespace", + "NameInRequest": "parentProviderNamespace", + "Doc": "The parent resource provider namespace.", + "Type": { + "$id": "1309", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1310", + "Name": "parentResourceType", + "NameInRequest": "parentResourceType", + "Doc": "The parent resource type.", + "Type": { + "$id": "1311", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1312", + "Name": "parentResourceName", + "NameInRequest": "parentResourceName", + "Doc": "The parent resource name.", + "Type": { + "$id": "1313", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1314", + "Name": "continuationToken", + "NameInRequest": "continuationToken", + "Doc": "String that sets the continuation token.", + "Type": { + "$id": "1315", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": false, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1316", + "Name": "accept", + "NameInRequest": "Accept", + "Type": { + "$id": "1317", + "kind": "constant", + "valueType": { + "$id": "1318", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "1319", + "StatusCodes": [ + 200 + ], + "BodyType": { + "$ref": "730" + }, + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false, + "ContentTypes": [ + "application/json" + ] + } + ], + "HttpMethod": "GET", + "RequestBodyMediaType": "None", + "Uri": "{endpoint}", + "Path": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{parentProviderNamespace}/{parentResourceType}/{parentResourceName}/providers/Microsoft.Chaos/targets", + "BufferResponse": true, + "Paging": { + "$id": "1320", + "ItemName": "value", + "NextLinkName": "nextLink" + }, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Microsoft.Chaos.Targets.list", + "Decorators": [], + "Examples": [ + { + "$id": "1321", + "kind": "http", + "name": "List all Targets that extend a virtual machine resource.", + "description": "List all Targets that extend a virtual machine resource.", + "filePath": "2025-01-01/Targets_List.json", + "parameters": [ + { + "$id": "1322", + "parameter": { + "$ref": "1299" + }, + "value": { + "$id": "1323", + "kind": "string", + "type": { + "$ref": "1300" + }, + "value": "2025-01-01" + } + }, + { + "$id": "1324", + "parameter": { + "$ref": "1308" + }, + "value": { + "$id": "1325", + "kind": "string", + "type": { + "$ref": "1309" + }, + "value": "Microsoft.Compute" + } + }, + { + "$id": "1326", + "parameter": { + "$ref": "1312" + }, + "value": { + "$id": "1327", + "kind": "string", + "type": { + "$ref": "1313" + }, + "value": "exampleVM" + } + }, + { + "$id": "1328", + "parameter": { + "$ref": "1310" + }, + "value": { + "$id": "1329", + "kind": "string", + "type": { + "$ref": "1311" + }, + "value": "virtualMachines" + } + }, + { + "$id": "1330", + "parameter": { + "$ref": "1306" + }, + "value": { + "$id": "1331", + "kind": "string", + "type": { + "$ref": "1307" + }, + "value": "exampleRG" + } + }, + { + "$id": "1332", + "parameter": { + "$ref": "1303" + }, + "value": { + "$id": "1333", + "kind": "string", + "type": { + "$ref": "1304" + }, + "value": "6b052e15-03d3-4f17-b2e1-be7f07588291" + } + } + ], + "responses": [ + { + "$id": "1334", + "response": { + "$ref": "1319" + }, + "statusCode": 200, + "bodyValue": { + "$id": "1335", + "kind": "model", + "type": { + "$ref": "730" + }, + "value": { + "$id": "1336", + "nextLink": { + "$id": "1337", + "kind": "string", + "type": { + "$ref": "736" + }, + "value": "https://management.azure.com/subscriptions/6b052e15-03d3-4f17-b2e1-be7f07588291/resourceGroups/exampleRG/providers/Microsoft.Compute/virtualMachines/exampleVM/providers/Microsoft.Chaos/targets?continuationToken=&api-version=2024-11-01-preview" + }, + "value": { + "$id": "1338", + "kind": "array", + "type": { + "$ref": "732" + }, + "value": [ + { + "$id": "1339", + "kind": "model", + "type": { + "$ref": "718" + }, + "value": { + "$id": "1340", + "name": { + "$id": "1341", + "kind": "string", + "type": { + "$ref": "164" + }, + "value": "Microsoft-Agent" + }, + "type": { + "$id": "1342", + "kind": "string", + "type": { + "$ref": "168" + }, + "value": "Microsoft.Chaos/targets" + }, + "id": { + "$id": "1343", + "kind": "string", + "type": { + "$ref": "159" + }, + "value": "/subscriptions/6b052e15-03d3-4f17-b2e1-be7f07588291/resourceGroups/exampleRG/providers/Microsoft.Compute/virtualMachines/exampleVM/providers/Microsoft.Chaos/targets/Microsoft-Agent" + }, + "location": { + "$id": "1344", + "kind": "string", + "type": { + "$ref": "726" + }, + "value": "centraluseuap" + }, + "properties": { + "$id": "1345", + "kind": "dict", + "type": { + "$ref": "720" + }, + "value": { + "$id": "1346", + "agentProfileId": { + "$id": "1347", + "kind": "unknown", + "type": { + "$ref": "722" + }, + "value": "ac4e8251-fdc9-4277-8e87-dc57fe5794cf" + }, + "identities": { + "$id": "1348", + "kind": "unknown", + "type": { + "$ref": "722" + }, + "value": [ + { + "$id": "1349", + "type": "CertificateSubjectIssuer", + "subject": "CN=example.subject" + } + ] + } + } + }, + "systemData": { + "$id": "1350", + "kind": "model", + "type": { + "$ref": "173" + }, + "value": { + "$id": "1351", + "createdAt": { + "$id": "1352", + "kind": "string", + "type": { + "$ref": "182" + }, + "value": "2021-07-01T00:00:00.0Z" + }, + "lastModifiedAt": { + "$id": "1353", + "kind": "string", + "type": { + "$ref": "194" + }, + "value": "2021-07-01T00:00:00.0Z" + } + } + } + } + } + ] + } + } + } + } + ] + } + ] + } + ], + "Protocol": { + "$id": "1354" + }, + "Parent": "ChaosClient", + "Parameters": [ + { + "$id": "1355", + "Name": "endpoint", + "NameInRequest": "endpoint", + "Doc": "Service host", + "Type": { + "$id": "1356", + "kind": "url", + "name": "url", + "crossLanguageDefinitionId": "TypeSpec.url" + }, + "Location": "Uri", + "IsApiVersion": false, + "IsResourceParameter": false, + "IsContentType": false, + "IsRequired": true, + "IsEndpoint": true, + "SkipUrlEncoding": false, + "Explode": false, + "Kind": "Client", + "DefaultValue": { + "$id": "1357", + "Type": { + "$id": "1358", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "https://management.azure.com" + } + } + ], + "Decorators": [] + }, + { + "$id": "1359", + "Name": "CapabilityTypes", + "ClientNamespace": "Microsoft.Chaos", + "Operations": [ + { + "$id": "1360", + "Name": "get", + "ResourceName": "CapabilityType", + "Doc": "Get a Capability Type resource for given Target Type and location.", + "Accessibility": "public", + "Parameters": [ + { + "$id": "1361", + "Name": "apiVersion", + "NameInRequest": "api-version", + "Doc": "The API version to use for this operation.", + "Type": { + "$id": "1362", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": true, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "DefaultValue": { + "$id": "1363", + "Type": { + "$id": "1364", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "2025-01-01" + }, + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1365", + "Name": "subscriptionId", + "NameInRequest": "subscriptionId", + "Doc": "The ID of the target subscription. The value must be an UUID.", + "Type": { + "$id": "1366", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "1367", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1368", + "Name": "location", + "NameInRequest": "location", + "Doc": "The name of the Azure region.", + "Type": { + "$id": "1369", + "kind": "string", + "name": "azureLocation", + "crossLanguageDefinitionId": "Azure.Core.azureLocation", + "baseType": { + "$id": "1370", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1371", + "Name": "targetTypeName", + "NameInRequest": "targetTypeName", + "Doc": "String that represents a Target Type resource name.", + "Type": { + "$id": "1372", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1373", + "Name": "capabilityTypeName", + "NameInRequest": "capabilityTypeName", + "Doc": "String that represents a Capability Type resource name.", + "Type": { + "$id": "1374", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1375", + "Name": "accept", + "NameInRequest": "Accept", + "Type": { + "$id": "1376", + "kind": "constant", + "valueType": { + "$id": "1377", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "1378", + "StatusCodes": [ + 200 + ], + "BodyType": { + "$ref": "652" + }, + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false, + "ContentTypes": [ + "application/json" + ] + } + ], + "HttpMethod": "GET", + "RequestBodyMediaType": "None", + "Uri": "{endpoint}", + "Path": "/subscriptions/{subscriptionId}/providers/Microsoft.Chaos/locations/{location}/targetTypes/{targetTypeName}/capabilityTypes/{capabilityTypeName}", + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Microsoft.Chaos.CapabilityTypes.get", + "Decorators": [], + "Examples": [ + { + "$id": "1379", + "kind": "http", + "name": "Get a Capability Type for a virtual machine Target resource on westus2 location.", + "description": "Get a Capability Type for a virtual machine Target resource on westus2 location.", + "filePath": "2025-01-01/CapabilityTypes_Get.json", + "parameters": [ + { + "$id": "1380", + "parameter": { + "$ref": "1361" + }, + "value": { + "$id": "1381", + "kind": "string", + "type": { + "$ref": "1362" + }, + "value": "2025-01-01" + } + }, + { + "$id": "1382", + "parameter": { + "$ref": "1373" + }, + "value": { + "$id": "1383", + "kind": "string", + "type": { + "$ref": "1374" + }, + "value": "Shutdown-1.0" + } + }, + { + "$id": "1384", + "parameter": { + "$ref": "1368" + }, + "value": { + "$id": "1385", + "kind": "string", + "type": { + "$ref": "1369" + }, + "value": "westus2" + } + }, + { + "$id": "1386", + "parameter": { + "$ref": "1365" + }, + "value": { + "$id": "1387", + "kind": "string", + "type": { + "$ref": "1366" + }, + "value": "6b052e15-03d3-4f17-b2e1-be7f07588291" + } + }, + { + "$id": "1388", + "parameter": { + "$ref": "1371" + }, + "value": { + "$id": "1389", + "kind": "string", + "type": { + "$ref": "1372" + }, + "value": "Microsoft-VirtualMachine" + } + } + ], + "responses": [ + { + "$id": "1390", + "response": { + "$ref": "1378" + }, + "statusCode": 200, + "bodyValue": { + "$id": "1391", + "kind": "model", + "type": { + "$ref": "652" + }, + "value": { + "$id": "1392", + "name": { + "$id": "1393", + "kind": "string", + "type": { + "$ref": "164" + }, + "value": "Shutdown-1.0" + }, + "type": { + "$id": "1394", + "kind": "string", + "type": { + "$ref": "168" + }, + "value": "Microsoft.Chaos/locations/targetTypes/capabilityTypes" + }, + "id": { + "$id": "1395", + "kind": "string", + "type": { + "$ref": "159" + }, + "value": "/subscriptions/6b052e15-03d3-4f17-b2e1-be7f07588291/providers/Microsoft.Chaos/locations/westus2/targetTypes/Microsoft-VirtualMachine/capabilityTypes/Shutdown-1.0" + }, + "properties": { + "$id": "1396", + "kind": "model", + "type": { + "$ref": "654" + }, + "value": { + "$id": "1397", + "description": { + "$id": "1398", + "kind": "string", + "type": { + "$ref": "668" + }, + "value": "Shutdown an Azure Virtual Machine for a defined period of time." + }, + "displayName": { + "$id": "1399", + "kind": "string", + "type": { + "$ref": "664" + }, + "value": "Shutdown VM" + }, + "kind": { + "$id": "1400", + "kind": "string", + "type": { + "$ref": "680" + }, + "value": "fault" + }, + "parametersSchema": { + "$id": "1401", + "kind": "string", + "type": { + "$ref": "672" + }, + "value": "https://schema.centralus.chaos-prod.azure.com/targets/Microsoft-VirtualMachine/capabilities/Shutdown-1.0.json" + }, + "publisher": { + "$id": "1402", + "kind": "string", + "type": { + "$ref": "656" + }, + "value": "Microsoft" + }, + "runtimeProperties": { + "$id": "1403", + "kind": "model", + "type": { + "$ref": "699" + }, + "value": { + "$id": "1404", + "kind": { + "$id": "1405", + "kind": "string", + "type": { + "$ref": "701" + }, + "value": "continuous" + } + } + }, + "targetType": { + "$id": "1406", + "kind": "string", + "type": { + "$ref": "660" + }, + "value": "VirtualMachine" + }, + "urn": { + "$id": "1407", + "kind": "string", + "type": { + "$ref": "676" + }, + "value": "urn:csci:microsoft:virtualMachine:shutdown/1.0" + }, + "azureRbacActions": { + "$id": "1408", + "kind": "array", + "type": { + "$ref": "684" + }, + "value": [ + { + "$id": "1409", + "kind": "string", + "type": { + "$ref": "685" + }, + "value": "Microsoft.Compute/virtualMachines/poweroff/action" + }, + { + "$id": "1410", + "kind": "string", + "type": { + "$ref": "685" + }, + "value": "Microsoft.Compute/virtualMachines/start/action" + }, + { + "$id": "1411", + "kind": "string", + "type": { + "$ref": "685" + }, + "value": "Microsoft.Compute/virtualMachines/instanceView/read" + }, + { + "$id": "1412", + "kind": "string", + "type": { + "$ref": "685" + }, + "value": "Microsoft.Compute/virtualMachines/read" + }, + { + "$id": "1413", + "kind": "string", + "type": { + "$ref": "685" + }, + "value": "Microsoft.Compute/locations/operations/read" + } + ] + }, + "requiredAzureRoleDefinitionIds": { + "$id": "1414", + "kind": "array", + "type": { + "$ref": "694" + }, + "value": [ + { + "$id": "1415", + "kind": "string", + "type": { + "$ref": "695" + }, + "value": "acdd72a7-3385-48ef-bd42-f606fba81ae0" + } + ] + } + } + } + } + } + } + ] + } + ] + }, + { + "$id": "1416", + "Name": "list", + "ResourceName": "CapabilityType", + "Doc": "Get a list of Capability Type resources for given Target Type and location.", + "Accessibility": "public", + "Parameters": [ + { + "$id": "1417", + "Name": "apiVersion", + "NameInRequest": "api-version", + "Doc": "The API version to use for this operation.", + "Type": { + "$id": "1418", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": true, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "DefaultValue": { + "$id": "1419", + "Type": { + "$id": "1420", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "2025-01-01" + }, + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1421", + "Name": "subscriptionId", + "NameInRequest": "subscriptionId", + "Doc": "The ID of the target subscription. The value must be an UUID.", + "Type": { + "$id": "1422", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "1423", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1424", + "Name": "location", + "NameInRequest": "location", + "Doc": "The name of the Azure region.", + "Type": { + "$id": "1425", + "kind": "string", + "name": "azureLocation", + "crossLanguageDefinitionId": "Azure.Core.azureLocation", + "baseType": { + "$id": "1426", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1427", + "Name": "targetTypeName", + "NameInRequest": "targetTypeName", + "Doc": "String that represents a Target Type resource name.", + "Type": { + "$id": "1428", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1429", + "Name": "continuationToken", + "NameInRequest": "continuationToken", + "Doc": "String that sets the continuation token.", + "Type": { + "$id": "1430", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": false, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1431", + "Name": "accept", + "NameInRequest": "Accept", + "Type": { + "$id": "1432", + "kind": "constant", + "valueType": { + "$id": "1433", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "1434", + "StatusCodes": [ + 200 + ], + "BodyType": { + "$ref": "708" + }, + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false, + "ContentTypes": [ + "application/json" + ] + } + ], + "HttpMethod": "GET", + "RequestBodyMediaType": "None", + "Uri": "{endpoint}", + "Path": "/subscriptions/{subscriptionId}/providers/Microsoft.Chaos/locations/{location}/targetTypes/{targetTypeName}/capabilityTypes", + "BufferResponse": true, + "Paging": { + "$id": "1435", + "ItemName": "value", + "NextLinkName": "nextLink" + }, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Microsoft.Chaos.CapabilityTypes.list", + "Decorators": [], + "Examples": [ + { + "$id": "1436", + "kind": "http", + "name": "List all Capability Types for a virtual machine Target resource on westus2 location.", + "description": "List all Capability Types for a virtual machine Target resource on westus2 location.", + "filePath": "2025-01-01/CapabilityTypes_List.json", + "parameters": [ + { + "$id": "1437", + "parameter": { + "$ref": "1417" + }, + "value": { + "$id": "1438", + "kind": "string", + "type": { + "$ref": "1418" + }, + "value": "2025-01-01" + } + }, + { + "$id": "1439", + "parameter": { + "$ref": "1424" + }, + "value": { + "$id": "1440", + "kind": "string", + "type": { + "$ref": "1425" + }, + "value": "westus2" + } + }, + { + "$id": "1441", + "parameter": { + "$ref": "1421" + }, + "value": { + "$id": "1442", + "kind": "string", + "type": { + "$ref": "1422" + }, + "value": "6b052e15-03d3-4f17-b2e1-be7f07588291" + } + }, + { + "$id": "1443", + "parameter": { + "$ref": "1427" + }, + "value": { + "$id": "1444", + "kind": "string", + "type": { + "$ref": "1428" + }, + "value": "Microsoft-VirtualMachine" + } + } + ], + "responses": [ + { + "$id": "1445", + "response": { + "$ref": "1434" + }, + "statusCode": 200, + "bodyValue": { + "$id": "1446", + "kind": "model", + "type": { + "$ref": "708" + }, + "value": { + "$id": "1447", + "nextLink": { + "$id": "1448", + "kind": "string", + "type": { + "$ref": "714" + }, + "value": "https://management.azure.com/subscriptions/6b052e15-03d3-4f17-b2e1-be7f07588291/providers/Microsoft.Chaos/locations/westus2/targetTypes/Microsoft-VirtualMachine/capabilityTypes?continuationToken=&api-version=2024-11-01-preview" + }, + "value": { + "$id": "1449", + "kind": "array", + "type": { + "$ref": "710" + }, + "value": [ + { + "$id": "1450", + "kind": "model", + "type": { + "$ref": "652" + }, + "value": { + "$id": "1451", + "name": { + "$id": "1452", + "kind": "string", + "type": { + "$ref": "164" + }, + "value": "Shutdown-1.0" + }, + "type": { + "$id": "1453", + "kind": "string", + "type": { + "$ref": "168" + }, + "value": "Microsoft.Chaos/locations/targetTypes/capabilityTypes" + }, + "id": { + "$id": "1454", + "kind": "string", + "type": { + "$ref": "159" + }, + "value": "/subscriptions/6b052e15-03d3-4f17-b2e1-be7f07588291/providers/Microsoft.Chaos/locations/westus2/targetTypes/Microsoft-VirtualMachine/capabilityTypes/Shutdown-1.0" + }, + "properties": { + "$id": "1455", + "kind": "model", + "type": { + "$ref": "654" + }, + "value": { + "$id": "1456", + "description": { + "$id": "1457", + "kind": "string", + "type": { + "$ref": "668" + }, + "value": "Shutdown an Azure Virtual Machine for a defined period of time." + }, + "displayName": { + "$id": "1458", + "kind": "string", + "type": { + "$ref": "664" + }, + "value": "Shutdown VM" + }, + "kind": { + "$id": "1459", + "kind": "string", + "type": { + "$ref": "680" + }, + "value": "fault" + }, + "parametersSchema": { + "$id": "1460", + "kind": "string", + "type": { + "$ref": "672" + }, + "value": "https://schema.centralus.chaos-prod.azure.com/targets/Microsoft-VirtualMachine/capabilities/Shutdown-1.0.json" + }, + "publisher": { + "$id": "1461", + "kind": "string", + "type": { + "$ref": "656" + }, + "value": "Microsoft" + }, + "runtimeProperties": { + "$id": "1462", + "kind": "model", + "type": { + "$ref": "699" + }, + "value": { + "$id": "1463", + "kind": { + "$id": "1464", + "kind": "string", + "type": { + "$ref": "701" + }, + "value": "continuous" + } + } + }, + "targetType": { + "$id": "1465", + "kind": "string", + "type": { + "$ref": "660" + }, + "value": "VirtualMachine" + }, + "urn": { + "$id": "1466", + "kind": "string", + "type": { + "$ref": "676" + }, + "value": "urn:csci:microsoft:virtualMachine:shutdown/1.0" + }, + "azureRbacActions": { + "$id": "1467", + "kind": "array", + "type": { + "$ref": "684" + }, + "value": [ + { + "$id": "1468", + "kind": "string", + "type": { + "$ref": "685" + }, + "value": "Microsoft.Compute/virtualMachines/poweroff/action" + }, + { + "$id": "1469", + "kind": "string", + "type": { + "$ref": "685" + }, + "value": "Microsoft.Compute/virtualMachines/start/action" + }, + { + "$id": "1470", + "kind": "string", + "type": { + "$ref": "685" + }, + "value": "Microsoft.Compute/virtualMachines/instanceView/read" + }, + { + "$id": "1471", + "kind": "string", + "type": { + "$ref": "685" + }, + "value": "Microsoft.Compute/virtualMachines/read" + }, + { + "$id": "1472", + "kind": "string", + "type": { + "$ref": "685" + }, + "value": "Microsoft.Compute/locations/operations/read" + } + ] + }, + "requiredAzureRoleDefinitionIds": { + "$id": "1473", + "kind": "array", + "type": { + "$ref": "694" + }, + "value": [ + { + "$id": "1474", + "kind": "string", + "type": { + "$ref": "695" + }, + "value": "acdd72a7-3385-48ef-bd42-f606fba81ae0" + } + ] + } + } + } + } + } + ] + } + } + } + } + ] + } + ] + } + ], + "Protocol": { + "$id": "1475" + }, + "Parent": "ChaosClient", + "Parameters": [ + { + "$id": "1476", + "Name": "endpoint", + "NameInRequest": "endpoint", + "Doc": "Service host", + "Type": { + "$id": "1477", + "kind": "url", + "name": "url", + "crossLanguageDefinitionId": "TypeSpec.url" + }, + "Location": "Uri", + "IsApiVersion": false, + "IsResourceParameter": false, + "IsContentType": false, + "IsRequired": true, + "IsEndpoint": true, + "SkipUrlEncoding": false, + "Explode": false, + "Kind": "Client", + "DefaultValue": { + "$id": "1478", + "Type": { + "$id": "1479", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "https://management.azure.com" + } + } + ], + "Decorators": [] + }, + { + "$id": "1480", + "Name": "Experiments", + "ClientNamespace": "Microsoft.Chaos", + "Operations": [ + { + "$id": "1481", + "Name": "get", + "ResourceName": "Experiment", + "Doc": "Get a Experiment resource.", + "Accessibility": "public", + "Parameters": [ + { + "$id": "1482", + "Name": "apiVersion", + "NameInRequest": "api-version", + "Doc": "The API version to use for this operation.", + "Type": { + "$id": "1483", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": true, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "DefaultValue": { + "$id": "1484", + "Type": { + "$id": "1485", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "2025-01-01" + }, + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1486", + "Name": "subscriptionId", + "NameInRequest": "subscriptionId", + "Doc": "The ID of the target subscription. The value must be an UUID.", + "Type": { + "$id": "1487", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "1488", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1489", + "Name": "resourceGroupName", + "NameInRequest": "resourceGroupName", + "Doc": "The name of the resource group. The name is case insensitive.", + "Type": { + "$id": "1490", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1491", + "Name": "experimentName", + "NameInRequest": "experimentName", + "Doc": "String that represents a Experiment resource name.", + "Type": { + "$id": "1492", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1493", + "Name": "accept", + "NameInRequest": "Accept", + "Type": { + "$id": "1494", + "kind": "constant", + "valueType": { + "$id": "1495", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "1496", + "StatusCodes": [ + 200 + ], + "BodyType": { + "$ref": "400" + }, + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false, + "ContentTypes": [ + "application/json" + ] + } + ], + "HttpMethod": "GET", + "RequestBodyMediaType": "None", + "Uri": "{endpoint}", + "Path": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Chaos/experiments/{experimentName}", + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Microsoft.Chaos.Experiments.get", + "Decorators": [], + "Examples": [ + { + "$id": "1497", + "kind": "http", + "name": "Get a Experiment in a resource group.", + "description": "Get a Experiment in a resource group.", + "filePath": "2025-01-01/Experiments_Get.json", + "parameters": [ + { + "$id": "1498", + "parameter": { + "$ref": "1482" + }, + "value": { + "$id": "1499", + "kind": "string", + "type": { + "$ref": "1483" + }, + "value": "2025-01-01" + } + }, + { + "$id": "1500", + "parameter": { + "$ref": "1491" + }, + "value": { + "$id": "1501", + "kind": "string", + "type": { + "$ref": "1492" + }, + "value": "exampleExperiment" + } + }, + { + "$id": "1502", + "parameter": { + "$ref": "1489" + }, + "value": { + "$id": "1503", + "kind": "string", + "type": { + "$ref": "1490" + }, + "value": "exampleRG" + } + }, + { + "$id": "1504", + "parameter": { + "$ref": "1486" + }, + "value": { + "$id": "1505", + "kind": "string", + "type": { + "$ref": "1487" + }, + "value": "6b052e15-03d3-4f17-b2e1-be7f07588291" + } + } + ], + "responses": [ + { + "$id": "1506", + "response": { + "$ref": "1496" + }, + "statusCode": 200, + "bodyValue": { + "$id": "1507", + "kind": "model", + "type": { + "$ref": "400" + }, + "value": { + "$id": "1508", + "name": { + "$id": "1509", + "kind": "string", + "type": { + "$ref": "164" + }, + "value": "exampleExperiment" + }, + "type": { + "$id": "1510", + "kind": "string", + "type": { + "$ref": "168" + }, + "value": "Microsoft.Chaos/experiments" + }, + "id": { + "$id": "1511", + "kind": "string", + "type": { + "$ref": "159" + }, + "value": "/subscriptions/6b052e15-03d3-4f17-b2e1-be7f07588291/resourceGroups/exampleRG/providers/Microsoft.Chaos/experiments/exampleExperiment" + }, + "identity": { + "$id": "1512", + "kind": "model", + "type": { + "$ref": "413" + }, + "value": { + "$id": "1513", + "type": { + "$id": "1514", + "kind": "string", + "type": { + "$ref": "12" + }, + "value": "SystemAssigned" + }, + "principalId": { + "$id": "1515", + "kind": "string", + "type": { + "$ref": "415" + }, + "value": "d04ab567-2c07-43ef-a7f4-4527626b7f56" + }, + "tenantId": { + "$id": "1516", + "kind": "string", + "type": { + "$ref": "420" + }, + "value": "8c3e2fb2-fe7a-4bf1-b779-d73990782fe6" + } + } + }, + "location": { + "$id": "1517", + "kind": "string", + "type": { + "$ref": "409" + }, + "value": "centraluseuap" + }, + "properties": { + "$id": "1518", + "kind": "model", + "type": { + "$ref": "447" + }, + "value": { + "$id": "1519", + "selectors": { + "$id": "1520", + "kind": "array", + "type": { + "$ref": "536" + }, + "value": [ + { + "$id": "1521", + "kind": "model", + "type": { + "$ref": "569" + }, + "value": { + "$id": "1522", + "type": { + "$id": "1523", + "kind": "string", + "type": { + "$ref": "584" + }, + "value": "List" + }, + "id": { + "$id": "1524", + "kind": "string", + "type": { + "$ref": "542" + }, + "value": "selector1" + }, + "targets": { + "$id": "1525", + "kind": "array", + "type": { + "$ref": "571" + }, + "value": [ + { + "$id": "1526", + "kind": "model", + "type": { + "$ref": "572" + }, + "value": { + "$id": "1527", + "type": { + "$id": "1528", + "kind": "string", + "type": { + "$ref": "54" + }, + "value": "ChaosTarget" + }, + "id": { + "$id": "1529", + "kind": "string", + "type": { + "$ref": "577" + }, + "value": "/subscriptions/6b052e15-03d3-4f17-b2e1-be7f07588291/resourceGroups/exampleRG/providers/Microsoft.Compute/virtualMachines/exampleVM/providers/Microsoft.Chaos/targets/Microsoft-VirtualMachine" + } + } + } + ] + } + } + } + ] + }, + "steps": { + "$id": "1530", + "kind": "array", + "type": { + "$ref": "452" + }, + "value": [ + { + "$id": "1531", + "kind": "model", + "type": { + "$ref": "453" + }, + "value": { + "$id": "1532", + "name": { + "$id": "1533", + "kind": "string", + "type": { + "$ref": "455" + }, + "value": "step1" + }, + "branches": { + "$id": "1534", + "kind": "array", + "type": { + "$ref": "459" + }, + "value": [ + { + "$id": "1535", + "kind": "model", + "type": { + "$ref": "460" + }, + "value": { + "$id": "1536", + "name": { + "$id": "1537", + "kind": "string", + "type": { + "$ref": "462" + }, + "value": "branch1" + }, + "actions": { + "$id": "1538", + "kind": "array", + "type": { + "$ref": "466" + }, + "value": [ + { + "$id": "1539", + "kind": "model", + "type": { + "$ref": "476" + }, + "value": { + "$id": "1540", + "name": { + "$id": "1541", + "kind": "string", + "type": { + "$ref": "472" + }, + "value": "urn:csci:provider:providername:Shutdown/1.0" + }, + "type": { + "$id": "1542", + "kind": "string", + "type": { + "$ref": "500" + }, + "value": "continuous" + }, + "duration": { + "$id": "1543", + "kind": "string", + "type": { + "$ref": "478" + }, + "value": "PT10M" + }, + "parameters": { + "$id": "1544", + "kind": "array", + "type": { + "$ref": "483" + }, + "value": [ + { + "$id": "1545", + "kind": "model", + "type": { + "$ref": "484" + }, + "value": { + "$id": "1546", + "key": { + "$id": "1547", + "kind": "string", + "type": { + "$ref": "486" + }, + "value": "abruptShutdown" + }, + "value": { + "$id": "1548", + "kind": "string", + "type": { + "$ref": "490" + }, + "value": "false" + } + } + } + ] + }, + "selectorId": { + "$id": "1549", + "kind": "string", + "type": { + "$ref": "496" + }, + "value": "selector1" + } + } + } + ] + } + } + } + ] + } + } + } + ] + } + } + }, + "systemData": { + "$id": "1550", + "kind": "model", + "type": { + "$ref": "173" + }, + "value": { + "$id": "1551", + "createdAt": { + "$id": "1552", + "kind": "string", + "type": { + "$ref": "182" + }, + "value": "2021-07-01T00:00:00.0Z" + }, + "createdBy": { + "$id": "1553", + "kind": "string", + "type": { + "$ref": "175" + }, + "value": "User" + }, + "lastModifiedAt": { + "$id": "1554", + "kind": "string", + "type": { + "$ref": "194" + }, + "value": "2021-07-01T00:00:00.0Z" + }, + "lastModifiedBy": { + "$id": "1555", + "kind": "string", + "type": { + "$ref": "187" + }, + "value": "User" + } + } + } + } + } + } + ] + } + ] + }, + { + "$id": "1556", + "Name": "createOrUpdate", + "ResourceName": "Experiment", + "Doc": "Create or update a Experiment resource.", + "Accessibility": "public", + "Parameters": [ + { + "$id": "1557", + "Name": "apiVersion", + "NameInRequest": "api-version", + "Doc": "The API version to use for this operation.", + "Type": { + "$id": "1558", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": true, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "DefaultValue": { + "$id": "1559", + "Type": { + "$id": "1560", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "2025-01-01" + }, + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1561", + "Name": "subscriptionId", + "NameInRequest": "subscriptionId", + "Doc": "The ID of the target subscription. The value must be an UUID.", + "Type": { + "$id": "1562", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "1563", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1564", + "Name": "resourceGroupName", + "NameInRequest": "resourceGroupName", + "Doc": "The name of the resource group. The name is case insensitive.", + "Type": { + "$id": "1565", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1566", + "Name": "experimentName", + "NameInRequest": "experimentName", + "Doc": "String that represents a Experiment resource name.", + "Type": { + "$id": "1567", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1568", + "Name": "contentType", + "NameInRequest": "Content-Type", + "Doc": "Body parameter's content type. Known values are application/json", + "Type": { + "$id": "1569", + "kind": "constant", + "valueType": { + "$id": "1570", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": true, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1571", + "Name": "accept", + "NameInRequest": "Accept", + "Type": { + "$id": "1572", + "kind": "constant", + "valueType": { + "$id": "1573", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1574", + "Name": "resource", + "NameInRequest": "resource", + "Doc": "Experiment resource to be created or updated.", + "Type": { + "$ref": "400" + }, + "Location": "Body", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "1575", + "StatusCodes": [ + 200 + ], + "BodyType": { + "$ref": "400" + }, + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false, + "ContentTypes": [ + "application/json" + ] + }, + { + "$id": "1576", + "StatusCodes": [ + 201 + ], + "BodyType": { + "$ref": "400" + }, + "BodyMediaType": "Json", + "Headers": [ + { + "$id": "1577", + "Name": "azureAsyncOperation", + "NameInResponse": "Azure-AsyncOperation", + "Doc": "A link to the status monitor", + "Type": { + "$id": "1578", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + } + }, + { + "$id": "1579", + "Name": "retryAfter", + "NameInResponse": "Retry-After", + "Doc": "The Retry-After header can indicate how long the client should wait before polling the operation status.", + "Type": { + "$id": "1580", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + } + } + ], + "IsErrorResponse": false, + "ContentTypes": [ + "application/json" + ] + } + ], + "HttpMethod": "PUT", + "RequestBodyMediaType": "Json", + "Uri": "{endpoint}", + "Path": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Chaos/experiments/{experimentName}", + "RequestMediaTypes": [ + "application/json" + ], + "BufferResponse": true, + "LongRunning": { + "$id": "1581", + "FinalStateVia": 0, + "FinalResponse": { + "$id": "1582", + "StatusCodes": [ + 200 + ], + "BodyType": { + "$ref": "400" + }, + "BodyMediaType": "Json" + } + }, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Microsoft.Chaos.Experiments.createOrUpdate", + "Decorators": [], + "Examples": [ + { + "$id": "1583", + "kind": "http", + "name": "Create/update a Experiment in a resource group.", + "description": "Create/update a Experiment in a resource group.", + "filePath": "2025-01-01/Experiments_CreateOrUpdate.json", + "parameters": [ + { + "$id": "1584", + "parameter": { + "$ref": "1557" + }, + "value": { + "$id": "1585", + "kind": "string", + "type": { + "$ref": "1558" + }, + "value": "2025-01-01" + } + }, + { + "$id": "1586", + "parameter": { + "$ref": "1574" + }, + "value": { + "$id": "1587", + "kind": "model", + "type": { + "$ref": "400" + }, + "value": { + "$id": "1588", + "identity": { + "$id": "1589", + "kind": "model", + "type": { + "$ref": "413" + }, + "value": { + "$id": "1590", + "type": { + "$id": "1591", + "kind": "string", + "type": { + "$ref": "12" + }, + "value": "SystemAssigned" + } + } + }, + "tags": { + "$id": "1592", + "kind": "dict", + "type": { + "$ref": "403" + }, + "value": { + "$id": "1593", + "key7131": { + "$id": "1594", + "kind": "string", + "type": { + "$ref": "405" + }, + "value": "ryohwcoiccwsnewjigfmijz" + }, + "key2138": { + "$id": "1595", + "kind": "string", + "type": { + "$ref": "405" + }, + "value": "fjaeecgnvqd" + } + } + }, + "location": { + "$id": "1596", + "kind": "string", + "type": { + "$ref": "409" + }, + "value": "eastus2euap" + }, + "properties": { + "$id": "1597", + "kind": "model", + "type": { + "$ref": "447" + }, + "value": { + "$id": "1598", + "selectors": { + "$id": "1599", + "kind": "array", + "type": { + "$ref": "536" + }, + "value": [ + { + "$id": "1600", + "kind": "model", + "type": { + "$ref": "569" + }, + "value": { + "$id": "1601", + "type": { + "$id": "1602", + "kind": "string", + "type": { + "$ref": "584" + }, + "value": "List" + }, + "id": { + "$id": "1603", + "kind": "string", + "type": { + "$ref": "542" + }, + "value": "selector1" + }, + "targets": { + "$id": "1604", + "kind": "array", + "type": { + "$ref": "571" + }, + "value": [ + { + "$id": "1605", + "kind": "model", + "type": { + "$ref": "572" + }, + "value": { + "$id": "1606", + "type": { + "$id": "1607", + "kind": "string", + "type": { + "$ref": "54" + }, + "value": "ChaosTarget" + }, + "id": { + "$id": "1608", + "kind": "string", + "type": { + "$ref": "577" + }, + "value": "/subscriptions/6b052e15-03d3-4f17-b2e1-be7f07588291/resourceGroups/exampleRG/providers/Microsoft.Compute/virtualMachines/exampleVM/providers/Microsoft.Chaos/targets/Microsoft-VirtualMachine" + } + } + } + ] + } + } + } + ] + }, + "steps": { + "$id": "1609", + "kind": "array", + "type": { + "$ref": "452" + }, + "value": [ + { + "$id": "1610", + "kind": "model", + "type": { + "$ref": "453" + }, + "value": { + "$id": "1611", + "name": { + "$id": "1612", + "kind": "string", + "type": { + "$ref": "455" + }, + "value": "step1" + }, + "branches": { + "$id": "1613", + "kind": "array", + "type": { + "$ref": "459" + }, + "value": [ + { + "$id": "1614", + "kind": "model", + "type": { + "$ref": "460" + }, + "value": { + "$id": "1615", + "name": { + "$id": "1616", + "kind": "string", + "type": { + "$ref": "462" + }, + "value": "branch1" + }, + "actions": { + "$id": "1617", + "kind": "array", + "type": { + "$ref": "466" + }, + "value": [ + { + "$id": "1618", + "kind": "model", + "type": { + "$ref": "476" + }, + "value": { + "$id": "1619", + "name": { + "$id": "1620", + "kind": "string", + "type": { + "$ref": "472" + }, + "value": "urn:csci:microsoft:virtualMachine:shutdown/1.0" + }, + "type": { + "$id": "1621", + "kind": "string", + "type": { + "$ref": "500" + }, + "value": "continuous" + }, + "duration": { + "$id": "1622", + "kind": "string", + "type": { + "$ref": "478" + }, + "value": "PT10M" + }, + "parameters": { + "$id": "1623", + "kind": "array", + "type": { + "$ref": "483" + }, + "value": [ + { + "$id": "1624", + "kind": "model", + "type": { + "$ref": "484" + }, + "value": { + "$id": "1625", + "key": { + "$id": "1626", + "kind": "string", + "type": { + "$ref": "486" + }, + "value": "abruptShutdown" + }, + "value": { + "$id": "1627", + "kind": "string", + "type": { + "$ref": "490" + }, + "value": "false" + } + } + } + ] + }, + "selectorId": { + "$id": "1628", + "kind": "string", + "type": { + "$ref": "496" + }, + "value": "selector1" + } + } + } + ] + } + } + } + ] + } + } + } + ] + } + } + } + } + } + }, + { + "$id": "1629", + "parameter": { + "$ref": "1566" + }, + "value": { + "$id": "1630", + "kind": "string", + "type": { + "$ref": "1567" + }, + "value": "exampleExperiment" + } + }, + { + "$id": "1631", + "parameter": { + "$ref": "1564" + }, + "value": { + "$id": "1632", + "kind": "string", + "type": { + "$ref": "1565" + }, + "value": "exampleRG" + } + }, + { + "$id": "1633", + "parameter": { + "$ref": "1561" + }, + "value": { + "$id": "1634", + "kind": "string", + "type": { + "$ref": "1562" + }, + "value": "6b052e15-03d3-4f17-b2e1-be7f07588291" + } + } + ], + "responses": [ + { + "$id": "1635", + "response": { + "$ref": "1575" + }, + "statusCode": 200, + "bodyValue": { + "$id": "1636", + "kind": "model", + "type": { + "$ref": "400" + }, + "value": { + "$id": "1637", + "name": { + "$id": "1638", + "kind": "string", + "type": { + "$ref": "164" + }, + "value": "exampleExperiment" + }, + "type": { + "$id": "1639", + "kind": "string", + "type": { + "$ref": "168" + }, + "value": "Microsoft.Chaos/experiments" + }, + "id": { + "$id": "1640", + "kind": "string", + "type": { + "$ref": "159" + }, + "value": "/subscriptions/6b052e15-03d3-4f17-b2e1-be7f07588291/resourceGroups/exampleRG/providers/Microsoft.Chaos/experiments/exampleExperiment" + }, + "identity": { + "$id": "1641", + "kind": "model", + "type": { + "$ref": "413" + }, + "value": { + "$id": "1642", + "type": { + "$id": "1643", + "kind": "string", + "type": { + "$ref": "12" + }, + "value": "SystemAssigned" + }, + "principalId": { + "$id": "1644", + "kind": "string", + "type": { + "$ref": "415" + }, + "value": "d04ab567-2c07-43ef-a7f4-4527626b7f56" + }, + "tenantId": { + "$id": "1645", + "kind": "string", + "type": { + "$ref": "420" + }, + "value": "8c3e2fb2-fe7a-4bf1-b779-d73990782fe6" + } + } + }, + "tags": { + "$id": "1646", + "kind": "dict", + "type": { + "$ref": "403" + }, + "value": { + "$id": "1647", + "key7131": { + "$id": "1648", + "kind": "string", + "type": { + "$ref": "405" + }, + "value": "ryohwcoiccwsnewjigfmijz" + }, + "key2138": { + "$id": "1649", + "kind": "string", + "type": { + "$ref": "405" + }, + "value": "fjaeecgnvqd" + } + } + }, + "location": { + "$id": "1650", + "kind": "string", + "type": { + "$ref": "409" + }, + "value": "eastus2euap" + }, + "properties": { + "$id": "1651", + "kind": "model", + "type": { + "$ref": "447" + }, + "value": { + "$id": "1652", + "provisioningState": { + "$id": "1653", + "kind": "string", + "type": { + "$ref": "22" + }, + "value": "Updating" + }, + "selectors": { + "$id": "1654", + "kind": "array", + "type": { + "$ref": "536" + }, + "value": [ + { + "$id": "1655", + "kind": "model", + "type": { + "$ref": "569" + }, + "value": { + "$id": "1656", + "type": { + "$id": "1657", + "kind": "string", + "type": { + "$ref": "584" + }, + "value": "List" + }, + "id": { + "$id": "1658", + "kind": "string", + "type": { + "$ref": "542" + }, + "value": "selector1" + }, + "targets": { + "$id": "1659", + "kind": "array", + "type": { + "$ref": "571" + }, + "value": [ + { + "$id": "1660", + "kind": "model", + "type": { + "$ref": "572" + }, + "value": { + "$id": "1661", + "type": { + "$id": "1662", + "kind": "string", + "type": { + "$ref": "54" + }, + "value": "ChaosTarget" + }, + "id": { + "$id": "1663", + "kind": "string", + "type": { + "$ref": "577" + }, + "value": "/subscriptions/6b052e15-03d3-4f17-b2e1-be7f07588291/resourceGroups/exampleRG/providers/Microsoft.Compute/virtualMachines/exampleVM/providers/Microsoft.Chaos/targets/Microsoft-VirtualMachine" + } + } + } + ] + } + } + } + ] + }, + "steps": { + "$id": "1664", + "kind": "array", + "type": { + "$ref": "452" + }, + "value": [ + { + "$id": "1665", + "kind": "model", + "type": { + "$ref": "453" + }, + "value": { + "$id": "1666", + "name": { + "$id": "1667", + "kind": "string", + "type": { + "$ref": "455" + }, + "value": "step1" + }, + "branches": { + "$id": "1668", + "kind": "array", + "type": { + "$ref": "459" + }, + "value": [ + { + "$id": "1669", + "kind": "model", + "type": { + "$ref": "460" + }, + "value": { + "$id": "1670", + "name": { + "$id": "1671", + "kind": "string", + "type": { + "$ref": "462" + }, + "value": "branch1" + }, + "actions": { + "$id": "1672", + "kind": "array", + "type": { + "$ref": "466" + }, + "value": [ + { + "$id": "1673", + "kind": "model", + "type": { + "$ref": "476" + }, + "value": { + "$id": "1674", + "name": { + "$id": "1675", + "kind": "string", + "type": { + "$ref": "472" + }, + "value": "urn:csci:microsoft:virtualMachine:shutdown/1.0" + }, + "type": { + "$id": "1676", + "kind": "string", + "type": { + "$ref": "500" + }, + "value": "continuous" + }, + "duration": { + "$id": "1677", + "kind": "string", + "type": { + "$ref": "478" + }, + "value": "PT10M" + }, + "parameters": { + "$id": "1678", + "kind": "array", + "type": { + "$ref": "483" + }, + "value": [ + { + "$id": "1679", + "kind": "model", + "type": { + "$ref": "484" + }, + "value": { + "$id": "1680", + "key": { + "$id": "1681", + "kind": "string", + "type": { + "$ref": "486" + }, + "value": "abruptShutdown" + }, + "value": { + "$id": "1682", + "kind": "string", + "type": { + "$ref": "490" + }, + "value": "false" + } + } + } + ] + }, + "selectorId": { + "$id": "1683", + "kind": "string", + "type": { + "$ref": "496" + }, + "value": "selector1" + } + } + } + ] + } + } + } + ] + } + } + } + ] + } + } + }, + "systemData": { + "$id": "1684", + "kind": "model", + "type": { + "$ref": "173" + }, + "value": { + "$id": "1685", + "createdAt": { + "$id": "1686", + "kind": "string", + "type": { + "$ref": "182" + }, + "value": "2021-07-01T00:00:00.0Z" + }, + "createdBy": { + "$id": "1687", + "kind": "string", + "type": { + "$ref": "175" + }, + "value": "User" + }, + "lastModifiedAt": { + "$id": "1688", + "kind": "string", + "type": { + "$ref": "194" + }, + "value": "2021-07-01T00:00:00.0Z" + }, + "lastModifiedBy": { + "$id": "1689", + "kind": "string", + "type": { + "$ref": "187" + }, + "value": "User" + } + } + } + } + } + }, + { + "$id": "1690", + "response": { + "$ref": "1576" + }, + "statusCode": 201, + "bodyValue": { + "$id": "1691", + "kind": "model", + "type": { + "$ref": "400" + }, + "value": { + "$id": "1692", + "name": { + "$id": "1693", + "kind": "string", + "type": { + "$ref": "164" + }, + "value": "exampleExperiment" + }, + "type": { + "$id": "1694", + "kind": "string", + "type": { + "$ref": "168" + }, + "value": "Microsoft.Chaos/experiments" + }, + "id": { + "$id": "1695", + "kind": "string", + "type": { + "$ref": "159" + }, + "value": "/subscriptions/6b052e15-03d3-4f17-b2e1-be7f07588291/resourceGroups/exampleRG/providers/Microsoft.Chaos/experiments/exampleExperiment" + }, + "identity": { + "$id": "1696", + "kind": "model", + "type": { + "$ref": "413" + }, + "value": { + "$id": "1697", + "type": { + "$id": "1698", + "kind": "string", + "type": { + "$ref": "12" + }, + "value": "SystemAssigned" + }, + "principalId": { + "$id": "1699", + "kind": "string", + "type": { + "$ref": "415" + }, + "value": "d04ab567-2c07-43ef-a7f4-4527626b7f56" + }, + "tenantId": { + "$id": "1700", + "kind": "string", + "type": { + "$ref": "420" + }, + "value": "8c3e2fb2-fe7a-4bf1-b779-d73990782fe6" + } + } + }, + "tags": { + "$id": "1701", + "kind": "dict", + "type": { + "$ref": "403" + }, + "value": { + "$id": "1702", + "key7131": { + "$id": "1703", + "kind": "string", + "type": { + "$ref": "405" + }, + "value": "ryohwcoiccwsnewjigfmijz" + }, + "key2138": { + "$id": "1704", + "kind": "string", + "type": { + "$ref": "405" + }, + "value": "fjaeecgnvqd" + } + } + }, + "location": { + "$id": "1705", + "kind": "string", + "type": { + "$ref": "409" + }, + "value": "eastus2euap" + }, + "properties": { + "$id": "1706", + "kind": "model", + "type": { + "$ref": "447" + }, + "value": { + "$id": "1707", + "provisioningState": { + "$id": "1708", + "kind": "string", + "type": { + "$ref": "22" + }, + "value": "Creating" + }, + "selectors": { + "$id": "1709", + "kind": "array", + "type": { + "$ref": "536" + }, + "value": [ + { + "$id": "1710", + "kind": "model", + "type": { + "$ref": "569" + }, + "value": { + "$id": "1711", + "type": { + "$id": "1712", + "kind": "string", + "type": { + "$ref": "584" + }, + "value": "List" + }, + "id": { + "$id": "1713", + "kind": "string", + "type": { + "$ref": "542" + }, + "value": "selector1" + }, + "targets": { + "$id": "1714", + "kind": "array", + "type": { + "$ref": "571" + }, + "value": [ + { + "$id": "1715", + "kind": "model", + "type": { + "$ref": "572" + }, + "value": { + "$id": "1716", + "type": { + "$id": "1717", + "kind": "string", + "type": { + "$ref": "54" + }, + "value": "ChaosTarget" + }, + "id": { + "$id": "1718", + "kind": "string", + "type": { + "$ref": "577" + }, + "value": "/subscriptions/6b052e15-03d3-4f17-b2e1-be7f07588291/resourceGroups/exampleRG/providers/Microsoft.Compute/virtualMachines/exampleVM/providers/Microsoft.Chaos/targets/Microsoft-VirtualMachine" + } + } + } + ] + } + } + } + ] + }, + "steps": { + "$id": "1719", + "kind": "array", + "type": { + "$ref": "452" + }, + "value": [ + { + "$id": "1720", + "kind": "model", + "type": { + "$ref": "453" + }, + "value": { + "$id": "1721", + "name": { + "$id": "1722", + "kind": "string", + "type": { + "$ref": "455" + }, + "value": "step1" + }, + "branches": { + "$id": "1723", + "kind": "array", + "type": { + "$ref": "459" + }, + "value": [ + { + "$id": "1724", + "kind": "model", + "type": { + "$ref": "460" + }, + "value": { + "$id": "1725", + "name": { + "$id": "1726", + "kind": "string", + "type": { + "$ref": "462" + }, + "value": "branch1" + }, + "actions": { + "$id": "1727", + "kind": "array", + "type": { + "$ref": "466" + }, + "value": [ + { + "$id": "1728", + "kind": "model", + "type": { + "$ref": "476" + }, + "value": { + "$id": "1729", + "name": { + "$id": "1730", + "kind": "string", + "type": { + "$ref": "472" + }, + "value": "urn:csci:microsoft:virtualMachine:shutdown/1.0" + }, + "type": { + "$id": "1731", + "kind": "string", + "type": { + "$ref": "500" + }, + "value": "continuous" + }, + "duration": { + "$id": "1732", + "kind": "string", + "type": { + "$ref": "478" + }, + "value": "PT10M" + }, + "parameters": { + "$id": "1733", + "kind": "array", + "type": { + "$ref": "483" + }, + "value": [ + { + "$id": "1734", + "kind": "model", + "type": { + "$ref": "484" + }, + "value": { + "$id": "1735", + "key": { + "$id": "1736", + "kind": "string", + "type": { + "$ref": "486" + }, + "value": "abruptShutdown" + }, + "value": { + "$id": "1737", + "kind": "string", + "type": { + "$ref": "490" + }, + "value": "false" + } + } + } + ] + }, + "selectorId": { + "$id": "1738", + "kind": "string", + "type": { + "$ref": "496" + }, + "value": "selector1" + } + } + } + ] + } + } + } + ] + } + } + } + ] + } + } + }, + "systemData": { + "$id": "1739", + "kind": "model", + "type": { + "$ref": "173" + }, + "value": { + "$id": "1740", + "createdAt": { + "$id": "1741", + "kind": "string", + "type": { + "$ref": "182" + }, + "value": "2021-07-01T00:00:00.0Z" + }, + "createdBy": { + "$id": "1742", + "kind": "string", + "type": { + "$ref": "175" + }, + "value": "User" + }, + "lastModifiedAt": { + "$id": "1743", + "kind": "string", + "type": { + "$ref": "194" + }, + "value": "2021-07-01T00:00:00.0Z" + }, + "lastModifiedBy": { + "$id": "1744", + "kind": "string", + "type": { + "$ref": "187" + }, + "value": "User" + } + } + } + } + } + } + ] + } + ] + }, + { + "$id": "1745", + "Name": "update", + "ResourceName": "Experiment", + "Doc": "The operation to update an experiment.", + "Accessibility": "public", + "Parameters": [ + { + "$id": "1746", + "Name": "apiVersion", + "NameInRequest": "api-version", + "Doc": "The API version to use for this operation.", + "Type": { + "$id": "1747", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": true, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "DefaultValue": { + "$id": "1748", + "Type": { + "$id": "1749", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "2025-01-01" + }, + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1750", + "Name": "subscriptionId", + "NameInRequest": "subscriptionId", + "Doc": "The ID of the target subscription. The value must be an UUID.", + "Type": { + "$id": "1751", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "1752", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1753", + "Name": "resourceGroupName", + "NameInRequest": "resourceGroupName", + "Doc": "The name of the resource group. The name is case insensitive.", + "Type": { + "$id": "1754", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1755", + "Name": "experimentName", + "NameInRequest": "experimentName", + "Doc": "String that represents a Experiment resource name.", + "Type": { + "$id": "1756", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1757", + "Name": "contentType", + "NameInRequest": "Content-Type", + "Doc": "Body parameter's content type. Known values are application/json", + "Type": { + "$id": "1758", + "kind": "constant", + "valueType": { + "$id": "1759", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": true, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1760", + "Name": "accept", + "NameInRequest": "Accept", + "Type": { + "$id": "1761", + "kind": "constant", + "valueType": { + "$id": "1762", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1763", + "Name": "properties", + "NameInRequest": "properties", + "Doc": "Parameters supplied to the Update experiment operation.", + "Type": { + "$ref": "632" + }, + "Location": "Body", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "1764", + "StatusCodes": [ + 200 + ], + "BodyType": { + "$ref": "400" + }, + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false, + "ContentTypes": [ + "application/json" + ] + }, + { + "$id": "1765", + "StatusCodes": [ + 202 + ], + "BodyMediaType": "Json", + "Headers": [ + { + "$id": "1766", + "Name": "location", + "NameInResponse": "Location", + "Doc": "The Location header contains the URL where the status of the long running operation can be checked.", + "Type": { + "$id": "1767", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + } + }, + { + "$id": "1768", + "Name": "retryAfter", + "NameInResponse": "Retry-After", + "Doc": "The Retry-After header can indicate how long the client should wait before polling the operation status.", + "Type": { + "$id": "1769", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + } + } + ], + "IsErrorResponse": false + } + ], + "HttpMethod": "PATCH", + "RequestBodyMediaType": "Json", + "Uri": "{endpoint}", + "Path": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Chaos/experiments/{experimentName}", + "RequestMediaTypes": [ + "application/json" + ], + "BufferResponse": true, + "LongRunning": { + "$id": "1770", + "FinalStateVia": 1, + "FinalResponse": { + "$id": "1771", + "StatusCodes": [ + 200 + ], + "BodyType": { + "$ref": "400" + }, + "BodyMediaType": "Json" + } + }, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": false, + "CrossLanguageDefinitionId": "Microsoft.Chaos.Experiments.update", + "Decorators": [], + "Examples": [ + { + "$id": "1772", + "kind": "http", + "name": "Update an Experiment in a resource group.", + "description": "Update an Experiment in a resource group.", + "filePath": "2025-01-01/Experiments_Update.json", + "parameters": [ + { + "$id": "1773", + "parameter": { + "$ref": "1746" + }, + "value": { + "$id": "1774", + "kind": "string", + "type": { + "$ref": "1747" + }, + "value": "2025-01-01" + } + }, + { + "$id": "1775", + "parameter": { + "$ref": "1763" + }, + "value": { + "$id": "1776", + "kind": "model", + "type": { + "$ref": "632" + }, + "value": { + "$id": "1777", + "identity": { + "$id": "1778", + "kind": "model", + "type": { + "$ref": "413" + }, + "value": { + "$id": "1779", + "type": { + "$id": "1780", + "kind": "string", + "type": { + "$ref": "12" + }, + "value": "UserAssigned" + }, + "userAssignedIdentities": { + "$id": "1781", + "kind": "dict", + "type": { + "$ref": "428" + }, + "value": { + "$id": "1782", + "/subscriptions/6b052e15-03d3-4f17-b2e1-be7f07588291/resourceGroups/exampleRG/providers/Microsoft.ManagedIdentity/userAssignedIdentity/exampleUMI": { + "$id": "1783", + "kind": "model", + "type": { + "$ref": "431" + }, + "value": { + "$id": "1784" + } + } + } + } + } + }, + "tags": { + "$id": "1785", + "kind": "dict", + "type": { + "$ref": "634" + }, + "value": { + "$id": "1786", + "key1": { + "$id": "1787", + "kind": "string", + "type": { + "$ref": "636" + }, + "value": "value1" + }, + "key2": { + "$id": "1788", + "kind": "string", + "type": { + "$ref": "636" + }, + "value": "value2" + } + } + } + } + } + }, + { + "$id": "1789", + "parameter": { + "$ref": "1755" + }, + "value": { + "$id": "1790", + "kind": "string", + "type": { + "$ref": "1756" + }, + "value": "exampleExperiment" + } + }, + { + "$id": "1791", + "parameter": { + "$ref": "1753" + }, + "value": { + "$id": "1792", + "kind": "string", + "type": { + "$ref": "1754" + }, + "value": "exampleRG" + } + }, + { + "$id": "1793", + "parameter": { + "$ref": "1750" + }, + "value": { + "$id": "1794", + "kind": "string", + "type": { + "$ref": "1751" + }, + "value": "6b052e15-03d3-4f17-b2e1-be7f07588291" + } + } + ], + "responses": [ + { + "$id": "1795", + "response": { + "$ref": "1764" + }, + "statusCode": 200, + "bodyValue": { + "$id": "1796", + "kind": "model", + "type": { + "$ref": "400" + }, + "value": { + "$id": "1797", + "name": { + "$id": "1798", + "kind": "string", + "type": { + "$ref": "164" + }, + "value": "exampleExperiment" + }, + "type": { + "$id": "1799", + "kind": "string", + "type": { + "$ref": "168" + }, + "value": "Microsoft.Chaos/experiments" + }, + "id": { + "$id": "1800", + "kind": "string", + "type": { + "$ref": "159" + }, + "value": "/subscriptions/6b052e15-03d3-4f17-b2e1-be7f07588291/resourceGroups/exampleRG/providers/Microsoft.Chaos/experiments/exampleExperiment" + }, + "identity": { + "$id": "1801", + "kind": "model", + "type": { + "$ref": "413" + }, + "value": { + "$id": "1802", + "type": { + "$id": "1803", + "kind": "string", + "type": { + "$ref": "12" + }, + "value": "UserAssigned" + }, + "principalId": { + "$id": "1804", + "kind": "string", + "type": { + "$ref": "415" + }, + "value": "d04ab567-2c07-43ef-a7f4-4527626b7f56" + }, + "tenantId": { + "$id": "1805", + "kind": "string", + "type": { + "$ref": "420" + }, + "value": "8c3e2fb2-fe7a-4bf1-b779-d73990782fe6" + }, + "userAssignedIdentities": { + "$id": "1806", + "kind": "dict", + "type": { + "$ref": "428" + }, + "value": { + "$id": "1807", + "/subscriptions/6b052e15-03d3-4f17-b2e1-be7f07588291/resourceGroups/exampleRG/providers/Microsoft.ManagedIdentity/userAssignedIdentity/exampleUMI": { + "$id": "1808", + "kind": "model", + "type": { + "$ref": "431" + }, + "value": { + "$id": "1809" + } + } + } + } + } + }, + "location": { + "$id": "1810", + "kind": "string", + "type": { + "$ref": "409" + }, + "value": "centraluseuap" + }, + "properties": { + "$id": "1811", + "kind": "model", + "type": { + "$ref": "447" + }, + "value": { + "$id": "1812", + "selectors": { + "$id": "1813", + "kind": "array", + "type": { + "$ref": "536" + }, + "value": [ + { + "$id": "1814", + "kind": "model", + "type": { + "$ref": "569" + }, + "value": { + "$id": "1815", + "type": { + "$id": "1816", + "kind": "string", + "type": { + "$ref": "584" + }, + "value": "List" + }, + "id": { + "$id": "1817", + "kind": "string", + "type": { + "$ref": "542" + }, + "value": "selector1" + }, + "targets": { + "$id": "1818", + "kind": "array", + "type": { + "$ref": "571" + }, + "value": [ + { + "$id": "1819", + "kind": "model", + "type": { + "$ref": "572" + }, + "value": { + "$id": "1820", + "type": { + "$id": "1821", + "kind": "string", + "type": { + "$ref": "54" + }, + "value": "ChaosTarget" + }, + "id": { + "$id": "1822", + "kind": "string", + "type": { + "$ref": "577" + }, + "value": "/subscriptions/6b052e15-03d3-4f17-b2e1-be7f07588291/resourceGroups/exampleRG/providers/Microsoft.Compute/virtualMachines/exampleVM/providers/Microsoft.Chaos/targets/Microsoft-VirtualMachine" + } + } + } + ] + } + } + } + ] + }, + "steps": { + "$id": "1823", + "kind": "array", + "type": { + "$ref": "452" + }, + "value": [ + { + "$id": "1824", + "kind": "model", + "type": { + "$ref": "453" + }, + "value": { + "$id": "1825", + "name": { + "$id": "1826", + "kind": "string", + "type": { + "$ref": "455" + }, + "value": "step1" + }, + "branches": { + "$id": "1827", + "kind": "array", + "type": { + "$ref": "459" + }, + "value": [ + { + "$id": "1828", + "kind": "model", + "type": { + "$ref": "460" + }, + "value": { + "$id": "1829", + "name": { + "$id": "1830", + "kind": "string", + "type": { + "$ref": "462" + }, + "value": "branch1" + }, + "actions": { + "$id": "1831", + "kind": "array", + "type": { + "$ref": "466" + }, + "value": [ + { + "$id": "1832", + "kind": "model", + "type": { + "$ref": "476" + }, + "value": { + "$id": "1833", + "name": { + "$id": "1834", + "kind": "string", + "type": { + "$ref": "472" + }, + "value": "urn:csci:provider:providername:Shutdown/1.0" + }, + "type": { + "$id": "1835", + "kind": "string", + "type": { + "$ref": "500" + }, + "value": "continuous" + }, + "duration": { + "$id": "1836", + "kind": "string", + "type": { + "$ref": "478" + }, + "value": "PT10M" + }, + "parameters": { + "$id": "1837", + "kind": "array", + "type": { + "$ref": "483" + }, + "value": [ + { + "$id": "1838", + "kind": "model", + "type": { + "$ref": "484" + }, + "value": { + "$id": "1839", + "key": { + "$id": "1840", + "kind": "string", + "type": { + "$ref": "486" + }, + "value": "abruptShutdown" + }, + "value": { + "$id": "1841", + "kind": "string", + "type": { + "$ref": "490" + }, + "value": "false" + } + } + } + ] + }, + "selectorId": { + "$id": "1842", + "kind": "string", + "type": { + "$ref": "496" + }, + "value": "selector1" + } + } + } + ] + } + } + } + ] + } + } + } + ] + } + } + }, + "systemData": { + "$id": "1843", + "kind": "model", + "type": { + "$ref": "173" + }, + "value": { + "$id": "1844", + "createdAt": { + "$id": "1845", + "kind": "string", + "type": { + "$ref": "182" + }, + "value": "2021-07-01T00:00:00.0Z" + }, + "createdBy": { + "$id": "1846", + "kind": "string", + "type": { + "$ref": "175" + }, + "value": "User" + }, + "lastModifiedAt": { + "$id": "1847", + "kind": "string", + "type": { + "$ref": "194" + }, + "value": "2021-07-01T00:00:00.0Z" + }, + "lastModifiedBy": { + "$id": "1848", + "kind": "string", + "type": { + "$ref": "187" + }, + "value": "User" + } + } + }, + "tags": { + "$id": "1849", + "kind": "dict", + "type": { + "$ref": "403" + }, + "value": { + "$id": "1850", + "key1": { + "$id": "1851", + "kind": "string", + "type": { + "$ref": "405" + }, + "value": "value1" + }, + "key2": { + "$id": "1852", + "kind": "string", + "type": { + "$ref": "405" + }, + "value": "value2" + } + } + } + } + } + }, + { + "$id": "1853", + "response": { + "$ref": "1765" + }, + "statusCode": 202 + } + ] + } + ] + }, + { + "$id": "1854", + "Name": "delete", + "ResourceName": "Experiment", + "Doc": "Delete a Experiment resource.", + "Accessibility": "public", + "Parameters": [ + { + "$id": "1855", + "Name": "apiVersion", + "NameInRequest": "api-version", + "Doc": "The API version to use for this operation.", + "Type": { + "$id": "1856", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": true, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "DefaultValue": { + "$id": "1857", + "Type": { + "$id": "1858", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "2025-01-01" + }, + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1859", + "Name": "subscriptionId", + "NameInRequest": "subscriptionId", + "Doc": "The ID of the target subscription. The value must be an UUID.", + "Type": { + "$id": "1860", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "1861", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1862", + "Name": "resourceGroupName", + "NameInRequest": "resourceGroupName", + "Doc": "The name of the resource group. The name is case insensitive.", + "Type": { + "$id": "1863", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1864", + "Name": "experimentName", + "NameInRequest": "experimentName", + "Doc": "String that represents a Experiment resource name.", + "Type": { + "$id": "1865", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1866", + "Name": "accept", + "NameInRequest": "Accept", + "Type": { + "$id": "1867", + "kind": "constant", + "valueType": { + "$id": "1868", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "1869", + "StatusCodes": [ + 202 + ], + "BodyMediaType": "Json", + "Headers": [ + { + "$id": "1870", + "Name": "location", + "NameInResponse": "Location", + "Doc": "The Location header contains the URL where the status of the long running operation can be checked.", + "Type": { + "$id": "1871", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + } + }, + { + "$id": "1872", + "Name": "retryAfter", + "NameInResponse": "Retry-After", + "Doc": "The Retry-After header can indicate how long the client should wait before polling the operation status.", + "Type": { + "$id": "1873", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + } + } + ], + "IsErrorResponse": false + }, + { + "$id": "1874", + "StatusCodes": [ + 204 + ], + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false + } + ], + "HttpMethod": "DELETE", + "RequestBodyMediaType": "None", + "Uri": "{endpoint}", + "Path": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Chaos/experiments/{experimentName}", + "BufferResponse": true, + "LongRunning": { + "$id": "1875", + "FinalStateVia": 1, + "FinalResponse": { + "$id": "1876", + "StatusCodes": [ + 204 + ], + "BodyMediaType": "Json" + } + }, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Microsoft.Chaos.Experiments.delete", + "Decorators": [], + "Examples": [ + { + "$id": "1877", + "kind": "http", + "name": "Delete a Experiment in a resource group.", + "description": "Delete a Experiment in a resource group.", + "filePath": "2025-01-01/Experiments_Delete.json", + "parameters": [ + { + "$id": "1878", + "parameter": { + "$ref": "1855" + }, + "value": { + "$id": "1879", + "kind": "string", + "type": { + "$ref": "1856" + }, + "value": "2025-01-01" + } + }, + { + "$id": "1880", + "parameter": { + "$ref": "1864" + }, + "value": { + "$id": "1881", + "kind": "string", + "type": { + "$ref": "1865" + }, + "value": "exampleExperiment" + } + }, + { + "$id": "1882", + "parameter": { + "$ref": "1862" + }, + "value": { + "$id": "1883", + "kind": "string", + "type": { + "$ref": "1863" + }, + "value": "exampleRG" + } + }, + { + "$id": "1884", + "parameter": { + "$ref": "1859" + }, + "value": { + "$id": "1885", + "kind": "string", + "type": { + "$ref": "1860" + }, + "value": "6b052e15-03d3-4f17-b2e1-be7f07588291" + } + } + ], + "responses": [ + { + "$id": "1886", + "response": { + "$ref": "1869" + }, + "statusCode": 202 + }, + { + "$id": "1887", + "response": { + "$ref": "1874" + }, + "statusCode": 204 + } + ] + } + ] + }, + { + "$id": "1888", + "Name": "list", + "ResourceName": "Experiment", + "Doc": "Get a list of Experiment resources in a resource group.", + "Accessibility": "public", + "Parameters": [ + { + "$id": "1889", + "Name": "apiVersion", + "NameInRequest": "api-version", + "Doc": "The API version to use for this operation.", + "Type": { + "$id": "1890", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": true, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "DefaultValue": { + "$id": "1891", + "Type": { + "$id": "1892", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "2025-01-01" + }, + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1893", + "Name": "subscriptionId", + "NameInRequest": "subscriptionId", + "Doc": "The ID of the target subscription. The value must be an UUID.", + "Type": { + "$id": "1894", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "1895", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1896", + "Name": "resourceGroupName", + "NameInRequest": "resourceGroupName", + "Doc": "The name of the resource group. The name is case insensitive.", + "Type": { + "$id": "1897", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1898", + "Name": "running", + "NameInRequest": "running", + "Doc": "Optional value that indicates whether to filter results based on if the Experiment is currently running. If null, then the results will not be filtered.", + "Type": { + "$id": "1899", + "kind": "boolean", + "name": "boolean", + "crossLanguageDefinitionId": "TypeSpec.boolean", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": false, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1900", + "Name": "continuationToken", + "NameInRequest": "continuationToken", + "Doc": "String that sets the continuation token.", + "Type": { + "$id": "1901", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": false, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1902", + "Name": "accept", + "NameInRequest": "Accept", + "Type": { + "$id": "1903", + "kind": "constant", + "valueType": { + "$id": "1904", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "1905", + "StatusCodes": [ + 200 + ], + "BodyType": { + "$ref": "642" + }, + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false, + "ContentTypes": [ + "application/json" + ] + } + ], + "HttpMethod": "GET", + "RequestBodyMediaType": "None", + "Uri": "{endpoint}", + "Path": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Chaos/experiments", + "BufferResponse": true, + "Paging": { + "$id": "1906", + "ItemName": "value", + "NextLinkName": "nextLink" + }, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Microsoft.Chaos.Experiments.list", + "Decorators": [], + "Examples": [ + { + "$id": "1907", + "kind": "http", + "name": "List all Experiments in a resource group.", + "description": "List all Experiments in a resource group.", + "filePath": "2025-01-01/Experiments_List.json", + "parameters": [ + { + "$id": "1908", + "parameter": { + "$ref": "1889" + }, + "value": { + "$id": "1909", + "kind": "string", + "type": { + "$ref": "1890" + }, + "value": "2025-01-01" + } + }, + { + "$id": "1910", + "parameter": { + "$ref": "1896" + }, + "value": { + "$id": "1911", + "kind": "string", + "type": { + "$ref": "1897" + }, + "value": "exampleRG" + } + }, + { + "$id": "1912", + "parameter": { + "$ref": "1893" + }, + "value": { + "$id": "1913", + "kind": "string", + "type": { + "$ref": "1894" + }, + "value": "6b052e15-03d3-4f17-b2e1-be7f07588291" + } + } + ], + "responses": [ + { + "$id": "1914", + "response": { + "$ref": "1905" + }, + "statusCode": 200, + "bodyValue": { + "$id": "1915", + "kind": "model", + "type": { + "$ref": "642" + }, + "value": { + "$id": "1916", + "nextLink": { + "$id": "1917", + "kind": "string", + "type": { + "$ref": "648" + }, + "value": "https://management.azure.com/subscriptions/6b052e15-03d3-4f17-b2e1-be7f07588291/resourceGroups/exampleRG/providers/Microsoft.Chaos/experiments?continuationToken=&api-version=2024-11-01-preview" + }, + "value": { + "$id": "1918", + "kind": "array", + "type": { + "$ref": "644" + }, + "value": [ + { + "$id": "1919", + "kind": "model", + "type": { + "$ref": "400" + }, + "value": { + "$id": "1920", + "name": { + "$id": "1921", + "kind": "string", + "type": { + "$ref": "164" + }, + "value": "exampleExperiment" + }, + "type": { + "$id": "1922", + "kind": "string", + "type": { + "$ref": "168" + }, + "value": "Microsoft.Chaos/experiments" + }, + "id": { + "$id": "1923", + "kind": "string", + "type": { + "$ref": "159" + }, + "value": "/subscriptions/6b052e15-03d3-4f17-b2e1-be7f07588291/resourceGroups/exampleRG/providers/Microsoft.Chaos/experiments/exampleExperiment" + }, + "identity": { + "$id": "1924", + "kind": "model", + "type": { + "$ref": "413" + }, + "value": { + "$id": "1925", + "type": { + "$id": "1926", + "kind": "string", + "type": { + "$ref": "12" + }, + "value": "SystemAssigned" + }, + "principalId": { + "$id": "1927", + "kind": "string", + "type": { + "$ref": "415" + }, + "value": "d04ab567-2c07-43ef-a7f4-4527626b7f56" + }, + "tenantId": { + "$id": "1928", + "kind": "string", + "type": { + "$ref": "420" + }, + "value": "8c3e2fb2-fe7a-4bf1-b779-d73990782fe6" + } + } + }, + "location": { + "$id": "1929", + "kind": "string", + "type": { + "$ref": "409" + }, + "value": "centraluseuap" + }, + "properties": { + "$id": "1930", + "kind": "model", + "type": { + "$ref": "447" + }, + "value": { + "$id": "1931", + "selectors": { + "$id": "1932", + "kind": "array", + "type": { + "$ref": "536" + }, + "value": [ + { + "$id": "1933", + "kind": "model", + "type": { + "$ref": "569" + }, + "value": { + "$id": "1934", + "type": { + "$id": "1935", + "kind": "string", + "type": { + "$ref": "584" + }, + "value": "List" + }, + "id": { + "$id": "1936", + "kind": "string", + "type": { + "$ref": "542" + }, + "value": "selector1" + }, + "targets": { + "$id": "1937", + "kind": "array", + "type": { + "$ref": "571" + }, + "value": [ + { + "$id": "1938", + "kind": "model", + "type": { + "$ref": "572" + }, + "value": { + "$id": "1939", + "type": { + "$id": "1940", + "kind": "string", + "type": { + "$ref": "54" + }, + "value": "ChaosTarget" + }, + "id": { + "$id": "1941", + "kind": "string", + "type": { + "$ref": "577" + }, + "value": "/subscriptions/6b052e15-03d3-4f17-b2e1-be7f07588291/resourceGroups/exampleRG/providers/Microsoft.Compute/virtualMachines/exampleVM/providers/Microsoft.Chaos/targets/Microsoft-VirtualMachine" + } + } + } + ] + } + } + } + ] + }, + "steps": { + "$id": "1942", + "kind": "array", + "type": { + "$ref": "452" + }, + "value": [ + { + "$id": "1943", + "kind": "model", + "type": { + "$ref": "453" + }, + "value": { + "$id": "1944", + "name": { + "$id": "1945", + "kind": "string", + "type": { + "$ref": "455" + }, + "value": "step1" + }, + "branches": { + "$id": "1946", + "kind": "array", + "type": { + "$ref": "459" + }, + "value": [ + { + "$id": "1947", + "kind": "model", + "type": { + "$ref": "460" + }, + "value": { + "$id": "1948", + "name": { + "$id": "1949", + "kind": "string", + "type": { + "$ref": "462" + }, + "value": "branch1" + }, + "actions": { + "$id": "1950", + "kind": "array", + "type": { + "$ref": "466" + }, + "value": [ + { + "$id": "1951", + "kind": "model", + "type": { + "$ref": "476" + }, + "value": { + "$id": "1952", + "name": { + "$id": "1953", + "kind": "string", + "type": { + "$ref": "472" + }, + "value": "urn:csci:provider:providername:Shutdown/1.0" + }, + "type": { + "$id": "1954", + "kind": "string", + "type": { + "$ref": "500" + }, + "value": "continuous" + }, + "duration": { + "$id": "1955", + "kind": "string", + "type": { + "$ref": "478" + }, + "value": "PT10M" + }, + "parameters": { + "$id": "1956", + "kind": "array", + "type": { + "$ref": "483" + }, + "value": [ + { + "$id": "1957", + "kind": "model", + "type": { + "$ref": "484" + }, + "value": { + "$id": "1958", + "key": { + "$id": "1959", + "kind": "string", + "type": { + "$ref": "486" + }, + "value": "abruptShutdown" + }, + "value": { + "$id": "1960", + "kind": "string", + "type": { + "$ref": "490" + }, + "value": "false" + } + } + } + ] + }, + "selectorId": { + "$id": "1961", + "kind": "string", + "type": { + "$ref": "496" + }, + "value": "selector1" + } + } + } + ] + } + } + } + ] + } + } + } + ] + } + } + }, + "systemData": { + "$id": "1962", + "kind": "model", + "type": { + "$ref": "173" + }, + "value": { + "$id": "1963", + "createdAt": { + "$id": "1964", + "kind": "string", + "type": { + "$ref": "182" + }, + "value": "2021-07-01T00:00:00.0Z" + }, + "createdBy": { + "$id": "1965", + "kind": "string", + "type": { + "$ref": "175" + }, + "value": "User" + }, + "lastModifiedAt": { + "$id": "1966", + "kind": "string", + "type": { + "$ref": "194" + }, + "value": "2021-07-01T00:00:00.0Z" + }, + "lastModifiedBy": { + "$id": "1967", + "kind": "string", + "type": { + "$ref": "187" + }, + "value": "User" + } + } + } + } + } + ] + } + } + } + } + ] + } + ] + }, + { + "$id": "1968", + "Name": "listAll", + "ResourceName": "Experiment", + "Doc": "Get a list of Experiment resources in a subscription.", + "Accessibility": "public", + "Parameters": [ + { + "$id": "1969", + "Name": "apiVersion", + "NameInRequest": "api-version", + "Doc": "The API version to use for this operation.", + "Type": { + "$id": "1970", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": true, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "DefaultValue": { + "$id": "1971", + "Type": { + "$id": "1972", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "2025-01-01" + }, + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1973", + "Name": "subscriptionId", + "NameInRequest": "subscriptionId", + "Doc": "The ID of the target subscription. The value must be an UUID.", + "Type": { + "$id": "1974", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "1975", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1976", + "Name": "running", + "NameInRequest": "running", + "Doc": "Optional value that indicates whether to filter results based on if the Experiment is currently running. If null, then the results will not be filtered.", + "Type": { + "$id": "1977", + "kind": "boolean", + "name": "boolean", + "crossLanguageDefinitionId": "TypeSpec.boolean", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": false, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1978", + "Name": "continuationToken", + "NameInRequest": "continuationToken", + "Doc": "String that sets the continuation token.", + "Type": { + "$id": "1979", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": false, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1980", + "Name": "accept", + "NameInRequest": "Accept", + "Type": { + "$id": "1981", + "kind": "constant", + "valueType": { + "$id": "1982", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "1983", + "StatusCodes": [ + 200 + ], + "BodyType": { + "$ref": "642" + }, + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false, + "ContentTypes": [ + "application/json" + ] + } + ], + "HttpMethod": "GET", + "RequestBodyMediaType": "None", + "Uri": "{endpoint}", + "Path": "/subscriptions/{subscriptionId}/providers/Microsoft.Chaos/experiments", + "BufferResponse": true, + "Paging": { + "$id": "1984", + "ItemName": "value", + "NextLinkName": "nextLink" + }, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Microsoft.Chaos.Experiments.listAll", + "Decorators": [], + "Examples": [ + { + "$id": "1985", + "kind": "http", + "name": "List all Experiments in a subscription.", + "description": "List all Experiments in a subscription.", + "filePath": "2025-01-01/Experiments_ListAll.json", + "parameters": [ + { + "$id": "1986", + "parameter": { + "$ref": "1969" + }, + "value": { + "$id": "1987", + "kind": "string", + "type": { + "$ref": "1970" + }, + "value": "2025-01-01" + } + }, + { + "$id": "1988", + "parameter": { + "$ref": "1973" + }, + "value": { + "$id": "1989", + "kind": "string", + "type": { + "$ref": "1974" + }, + "value": "6b052e15-03d3-4f17-b2e1-be7f07588291" + } + } + ], + "responses": [ + { + "$id": "1990", + "response": { + "$ref": "1983" + }, + "statusCode": 200, + "bodyValue": { + "$id": "1991", + "kind": "model", + "type": { + "$ref": "642" + }, + "value": { + "$id": "1992", + "nextLink": { + "$id": "1993", + "kind": "string", + "type": { + "$ref": "648" + }, + "value": "https://management.azure.com/subscriptions/6b052e15-03d3-4f17-b2e1-be7f07588291/providers/Microsoft.Chaos/experiments?continuationToken=&api-version=2024-11-01-preview" + }, + "value": { + "$id": "1994", + "kind": "array", + "type": { + "$ref": "644" + }, + "value": [ + { + "$id": "1995", + "kind": "model", + "type": { + "$ref": "400" + }, + "value": { + "$id": "1996", + "name": { + "$id": "1997", + "kind": "string", + "type": { + "$ref": "164" + }, + "value": "exampleExperiment" + }, + "type": { + "$id": "1998", + "kind": "string", + "type": { + "$ref": "168" + }, + "value": "Microsoft.Chaos/experiments" + }, + "id": { + "$id": "1999", + "kind": "string", + "type": { + "$ref": "159" + }, + "value": "/subscriptions/6b052e15-03d3-4f17-b2e1-be7f07588291/resourceGroups/exampleRG/providers/Microsoft.Chaos/experiments/exampleExperiment" + }, + "identity": { + "$id": "2000", + "kind": "model", + "type": { + "$ref": "413" + }, + "value": { + "$id": "2001", + "type": { + "$id": "2002", + "kind": "string", + "type": { + "$ref": "12" + }, + "value": "SystemAssigned" + }, + "principalId": { + "$id": "2003", + "kind": "string", + "type": { + "$ref": "415" + }, + "value": "d04ab567-2c07-43ef-a7f4-4527626b7f56" + }, + "tenantId": { + "$id": "2004", + "kind": "string", + "type": { + "$ref": "420" + }, + "value": "8c3e2fb2-fe7a-4bf1-b779-d73990782fe6" + } + } + }, + "location": { + "$id": "2005", + "kind": "string", + "type": { + "$ref": "409" + }, + "value": "centraluseuap" + }, + "properties": { + "$id": "2006", + "kind": "model", + "type": { + "$ref": "447" + }, + "value": { + "$id": "2007", + "selectors": { + "$id": "2008", + "kind": "array", + "type": { + "$ref": "536" + }, + "value": [ + { + "$id": "2009", + "kind": "model", + "type": { + "$ref": "569" + }, + "value": { + "$id": "2010", + "type": { + "$id": "2011", + "kind": "string", + "type": { + "$ref": "584" + }, + "value": "List" + }, + "id": { + "$id": "2012", + "kind": "string", + "type": { + "$ref": "542" + }, + "value": "selector1" + }, + "targets": { + "$id": "2013", + "kind": "array", + "type": { + "$ref": "571" + }, + "value": [ + { + "$id": "2014", + "kind": "model", + "type": { + "$ref": "572" + }, + "value": { + "$id": "2015", + "type": { + "$id": "2016", + "kind": "string", + "type": { + "$ref": "54" + }, + "value": "ChaosTarget" + }, + "id": { + "$id": "2017", + "kind": "string", + "type": { + "$ref": "577" + }, + "value": "/subscriptions/6b052e15-03d3-4f17-b2e1-be7f07588291/resourceGroups/exampleRG/providers/Microsoft.Compute/virtualMachines/exampleVM/providers/Microsoft.Chaos/targets/Microsoft-VirtualMachine" + } + } + } + ] + } + } + } + ] + }, + "steps": { + "$id": "2018", + "kind": "array", + "type": { + "$ref": "452" + }, + "value": [ + { + "$id": "2019", + "kind": "model", + "type": { + "$ref": "453" + }, + "value": { + "$id": "2020", + "name": { + "$id": "2021", + "kind": "string", + "type": { + "$ref": "455" + }, + "value": "step1" + }, + "branches": { + "$id": "2022", + "kind": "array", + "type": { + "$ref": "459" + }, + "value": [ + { + "$id": "2023", + "kind": "model", + "type": { + "$ref": "460" + }, + "value": { + "$id": "2024", + "name": { + "$id": "2025", + "kind": "string", + "type": { + "$ref": "462" + }, + "value": "branch1" + }, + "actions": { + "$id": "2026", + "kind": "array", + "type": { + "$ref": "466" + }, + "value": [ + { + "$id": "2027", + "kind": "model", + "type": { + "$ref": "476" + }, + "value": { + "$id": "2028", + "name": { + "$id": "2029", + "kind": "string", + "type": { + "$ref": "472" + }, + "value": "urn:csci:provider:providername:Shutdown/1.0" + }, + "type": { + "$id": "2030", + "kind": "string", + "type": { + "$ref": "500" + }, + "value": "continuous" + }, + "duration": { + "$id": "2031", + "kind": "string", + "type": { + "$ref": "478" + }, + "value": "PT10M" + }, + "parameters": { + "$id": "2032", + "kind": "array", + "type": { + "$ref": "483" + }, + "value": [ + { + "$id": "2033", + "kind": "model", + "type": { + "$ref": "484" + }, + "value": { + "$id": "2034", + "key": { + "$id": "2035", + "kind": "string", + "type": { + "$ref": "486" + }, + "value": "abruptShutdown" + }, + "value": { + "$id": "2036", + "kind": "string", + "type": { + "$ref": "490" + }, + "value": "false" + } + } + } + ] + }, + "selectorId": { + "$id": "2037", + "kind": "string", + "type": { + "$ref": "496" + }, + "value": "selector1" + } + } + } + ] + } + } + } + ] + } + } + } + ] + } + } + }, + "systemData": { + "$id": "2038", + "kind": "model", + "type": { + "$ref": "173" + }, + "value": { + "$id": "2039", + "createdAt": { + "$id": "2040", + "kind": "string", + "type": { + "$ref": "182" + }, + "value": "2021-07-01T00:00:00.0Z" + }, + "createdBy": { + "$id": "2041", + "kind": "string", + "type": { + "$ref": "175" + }, + "value": "User" + }, + "lastModifiedAt": { + "$id": "2042", + "kind": "string", + "type": { + "$ref": "194" + }, + "value": "2021-07-01T00:00:00.0Z" + }, + "lastModifiedBy": { + "$id": "2043", + "kind": "string", + "type": { + "$ref": "187" + }, + "value": "User" + } + } + } + } + } + ] + } + } + } + } + ] + } + ] + }, + { + "$id": "2044", + "Name": "cancel", + "ResourceName": "Experiments", + "Doc": "Cancel a running Experiment resource.", + "Accessibility": "public", + "Parameters": [ + { + "$id": "2045", + "Name": "apiVersion", + "NameInRequest": "api-version", + "Doc": "The API version to use for this operation.", + "Type": { + "$id": "2046", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": true, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "DefaultValue": { + "$id": "2047", + "Type": { + "$id": "2048", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "2025-01-01" + }, + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "2049", + "Name": "subscriptionId", + "NameInRequest": "subscriptionId", + "Doc": "The ID of the target subscription. The value must be an UUID.", + "Type": { + "$id": "2050", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "2051", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "2052", + "Name": "resourceGroupName", + "NameInRequest": "resourceGroupName", + "Doc": "The name of the resource group. The name is case insensitive.", + "Type": { + "$id": "2053", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "2054", + "Name": "experimentName", + "NameInRequest": "experimentName", + "Doc": "String that represents a Experiment resource name.", + "Type": { + "$id": "2055", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "2056", + "Name": "accept", + "NameInRequest": "Accept", + "Type": { + "$id": "2057", + "kind": "constant", + "valueType": { + "$id": "2058", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "2059", + "StatusCodes": [ + 202 + ], + "BodyMediaType": "Json", + "Headers": [ + { + "$id": "2060", + "Name": "location", + "NameInResponse": "Location", + "Doc": "The Location header contains the URL where the status of the long running operation can be checked.", + "Type": { + "$id": "2061", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + } + }, + { + "$id": "2062", + "Name": "retryAfter", + "NameInResponse": "Retry-After", + "Doc": "The Retry-After header can indicate how long the client should wait before polling the operation status.", + "Type": { + "$id": "2063", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + } + } + ], + "IsErrorResponse": false + } + ], + "HttpMethod": "POST", + "RequestBodyMediaType": "None", + "Uri": "{endpoint}", + "Path": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Chaos/experiments/{experimentName}/cancel", + "BufferResponse": true, + "LongRunning": { + "$id": "2064", + "FinalStateVia": 1, + "FinalResponse": { + "$id": "2065", + "StatusCodes": [ + 200 + ], + "BodyMediaType": "Json" + } + }, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Microsoft.Chaos.Experiments.cancel", + "Decorators": [], + "Examples": [ + { + "$id": "2066", + "kind": "http", + "name": "Cancel a running Experiment.", + "description": "Cancel a running Experiment.", + "filePath": "2025-01-01/Experiments_Cancel.json", + "parameters": [ + { + "$id": "2067", + "parameter": { + "$ref": "2045" + }, + "value": { + "$id": "2068", + "kind": "string", + "type": { + "$ref": "2046" + }, + "value": "2025-01-01" + } + }, + { + "$id": "2069", + "parameter": { + "$ref": "2054" + }, + "value": { + "$id": "2070", + "kind": "string", + "type": { + "$ref": "2055" + }, + "value": "exampleExperiment" + } + }, + { + "$id": "2071", + "parameter": { + "$ref": "2052" + }, + "value": { + "$id": "2072", + "kind": "string", + "type": { + "$ref": "2053" + }, + "value": "exampleRG" + } + }, + { + "$id": "2073", + "parameter": { + "$ref": "2049" + }, + "value": { + "$id": "2074", + "kind": "string", + "type": { + "$ref": "2050" + }, + "value": "6b052e15-03d3-4f17-b2e1-be7f07588291" + } + } + ], + "responses": [ + { + "$id": "2075", + "response": { + "$ref": "2059" + }, + "statusCode": 202 + } + ] + } + ] + }, + { + "$id": "2076", + "Name": "start", + "ResourceName": "Experiments", + "Doc": "Start a Experiment resource.", + "Accessibility": "public", + "Parameters": [ + { + "$id": "2077", + "Name": "apiVersion", + "NameInRequest": "api-version", + "Doc": "The API version to use for this operation.", + "Type": { + "$id": "2078", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": true, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "DefaultValue": { + "$id": "2079", + "Type": { + "$id": "2080", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "2025-01-01" + }, + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "2081", + "Name": "subscriptionId", + "NameInRequest": "subscriptionId", + "Doc": "The ID of the target subscription. The value must be an UUID.", + "Type": { + "$id": "2082", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "2083", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "2084", + "Name": "resourceGroupName", + "NameInRequest": "resourceGroupName", + "Doc": "The name of the resource group. The name is case insensitive.", + "Type": { + "$id": "2085", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "2086", + "Name": "experimentName", + "NameInRequest": "experimentName", + "Doc": "String that represents a Experiment resource name.", + "Type": { + "$id": "2087", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "2088", + "Name": "accept", + "NameInRequest": "Accept", + "Type": { + "$id": "2089", + "kind": "constant", + "valueType": { + "$id": "2090", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "2091", + "StatusCodes": [ + 202 + ], + "BodyMediaType": "Json", + "Headers": [ + { + "$id": "2092", + "Name": "location", + "NameInResponse": "Location", + "Doc": "The Location header contains the URL where the status of the long running operation can be checked.", + "Type": { + "$id": "2093", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + } + }, + { + "$id": "2094", + "Name": "retryAfter", + "NameInResponse": "Retry-After", + "Doc": "The Retry-After header can indicate how long the client should wait before polling the operation status.", + "Type": { + "$id": "2095", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + } + } + ], + "IsErrorResponse": false + } + ], + "HttpMethod": "POST", + "RequestBodyMediaType": "None", + "Uri": "{endpoint}", + "Path": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Chaos/experiments/{experimentName}/start", + "BufferResponse": true, + "LongRunning": { + "$id": "2096", + "FinalStateVia": 1, + "FinalResponse": { + "$id": "2097", + "StatusCodes": [ + 200 + ], + "BodyMediaType": "Json" + } + }, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Microsoft.Chaos.Experiments.start", + "Decorators": [], + "Examples": [ + { + "$id": "2098", + "kind": "http", + "name": "Start a Experiment.", + "description": "Start a Experiment.", + "filePath": "2025-01-01/Experiments_Start.json", + "parameters": [ + { + "$id": "2099", + "parameter": { + "$ref": "2077" + }, + "value": { + "$id": "2100", + "kind": "string", + "type": { + "$ref": "2078" + }, + "value": "2025-01-01" + } + }, + { + "$id": "2101", + "parameter": { + "$ref": "2086" + }, + "value": { + "$id": "2102", + "kind": "string", + "type": { + "$ref": "2087" + }, + "value": "exampleExperiment" + } + }, + { + "$id": "2103", + "parameter": { + "$ref": "2084" + }, + "value": { + "$id": "2104", + "kind": "string", + "type": { + "$ref": "2085" + }, + "value": "exampleRG" + } + }, + { + "$id": "2105", + "parameter": { + "$ref": "2081" + }, + "value": { + "$id": "2106", + "kind": "string", + "type": { + "$ref": "2082" + }, + "value": "6b052e15-03d3-4f17-b2e1-be7f07588291" + } + } + ], + "responses": [ + { + "$id": "2107", + "response": { + "$ref": "2091" + }, + "statusCode": 202 + } + ] + } + ] + } + ], + "Protocol": { + "$id": "2108" + }, + "Parent": "ChaosClient", + "Parameters": [ + { + "$id": "2109", + "Name": "endpoint", + "NameInRequest": "endpoint", + "Doc": "Service host", + "Type": { + "$id": "2110", + "kind": "url", + "name": "url", + "crossLanguageDefinitionId": "TypeSpec.url" + }, + "Location": "Uri", + "IsApiVersion": false, + "IsResourceParameter": false, + "IsContentType": false, + "IsRequired": true, + "IsEndpoint": true, + "SkipUrlEncoding": false, + "Explode": false, + "Kind": "Client", + "DefaultValue": { + "$id": "2111", + "Type": { + "$id": "2112", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "https://management.azure.com" + } + } + ], + "Decorators": [] + }, + { + "$id": "2113", + "Name": "ExperimentExecutions", + "ClientNamespace": "Microsoft.Chaos", + "Operations": [ + { + "$id": "2114", + "Name": "getExecution", + "ResourceName": "ExperimentExecution", + "Doc": "Get an execution of an Experiment resource.", + "Accessibility": "public", + "Parameters": [ + { + "$id": "2115", + "Name": "apiVersion", + "NameInRequest": "api-version", + "Doc": "The API version to use for this operation.", + "Type": { + "$id": "2116", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": true, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "DefaultValue": { + "$id": "2117", + "Type": { + "$id": "2118", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "2025-01-01" + }, + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "2119", + "Name": "subscriptionId", + "NameInRequest": "subscriptionId", + "Doc": "The ID of the target subscription. The value must be an UUID.", + "Type": { + "$id": "2120", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "2121", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "2122", + "Name": "resourceGroupName", + "NameInRequest": "resourceGroupName", + "Doc": "The name of the resource group. The name is case insensitive.", + "Type": { + "$id": "2123", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "2124", + "Name": "experimentName", + "NameInRequest": "experimentName", + "Doc": "String that represents a Experiment resource name.", + "Type": { + "$id": "2125", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "2126", + "Name": "executionId", + "NameInRequest": "executionId", + "Doc": "GUID that represents a Experiment execution detail.", + "Type": { + "$id": "2127", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "2128", + "Name": "accept", + "NameInRequest": "Accept", + "Type": { + "$id": "2129", + "kind": "constant", + "valueType": { + "$id": "2130", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "2131", + "StatusCodes": [ + 200 + ], + "BodyType": { + "$ref": "231" + }, + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false, + "ContentTypes": [ + "application/json" + ] + } + ], + "HttpMethod": "GET", + "RequestBodyMediaType": "None", + "Uri": "{endpoint}", + "Path": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Chaos/experiments/{experimentName}/executions/{executionId}", + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Microsoft.Chaos.ExperimentExecutions.getExecution", + "Decorators": [], + "Examples": [ + { + "$id": "2132", + "kind": "http", + "name": "Get the execution of a Experiment.", + "description": "Get the execution of a Experiment.", + "filePath": "2025-01-01/Experiments_GetExecution.json", + "parameters": [ + { + "$id": "2133", + "parameter": { + "$ref": "2115" + }, + "value": { + "$id": "2134", + "kind": "string", + "type": { + "$ref": "2116" + }, + "value": "2025-01-01" + } + }, + { + "$id": "2135", + "parameter": { + "$ref": "2126" + }, + "value": { + "$id": "2136", + "kind": "string", + "type": { + "$ref": "2127" + }, + "value": "f24500ad-744e-4a26-864b-b76199eac333" + } + }, + { + "$id": "2137", + "parameter": { + "$ref": "2124" + }, + "value": { + "$id": "2138", + "kind": "string", + "type": { + "$ref": "2125" + }, + "value": "exampleExperiment" + } + }, + { + "$id": "2139", + "parameter": { + "$ref": "2122" + }, + "value": { + "$id": "2140", + "kind": "string", + "type": { + "$ref": "2123" + }, + "value": "exampleRG" + } + }, + { + "$id": "2141", + "parameter": { + "$ref": "2119" + }, + "value": { + "$id": "2142", + "kind": "string", + "type": { + "$ref": "2120" + }, + "value": "6b052e15-03d3-4f17-b2e1-be7f07588291" + } + } + ], + "responses": [ + { + "$id": "2143", + "response": { + "$ref": "2131" + }, + "statusCode": 200, + "bodyValue": { + "$id": "2144", + "kind": "model", + "type": { + "$ref": "231" + }, + "value": { + "$id": "2145", + "name": { + "$id": "2146", + "kind": "string", + "type": { + "$ref": "164" + }, + "value": "f24500ad-744e-4a26-864b-b76199eac333" + }, + "type": { + "$id": "2147", + "kind": "string", + "type": { + "$ref": "168" + }, + "value": "Microsoft.Chaos/experiments/executions" + }, + "id": { + "$id": "2148", + "kind": "string", + "type": { + "$ref": "159" + }, + "value": "/subscriptions/6b052e15-03d3-4f17-b2e1-be7f07588291/resourceGroups/exampleRG/providers/Microsoft.Chaos/experiments/exampleExperiment/executions/f24500ad-744e-4a26-864b-b76199eac333" + }, + "properties": { + "$id": "2149", + "kind": "model", + "type": { + "$ref": "233" + }, + "value": { + "$id": "2150", + "startedAt": { + "$id": "2151", + "kind": "string", + "type": { + "$ref": "239" + }, + "value": "2020-12-14T21:52:52.2552574Z" + }, + "status": { + "$id": "2152", + "kind": "string", + "type": { + "$ref": "235" + }, + "value": "failed" + }, + "stoppedAt": { + "$id": "2153", + "kind": "string", + "type": { + "$ref": "244" + }, + "value": "2020-12-14T21:56:18.9281956Z" + } + } + } + } + } + } + ] + } + ] + }, + { + "$id": "2154", + "Name": "listAllExecutions", + "ResourceName": "ExperimentExecution", + "Doc": "Get a list of executions of an Experiment resource.", + "Accessibility": "public", + "Parameters": [ + { + "$id": "2155", + "Name": "apiVersion", + "NameInRequest": "api-version", + "Doc": "The API version to use for this operation.", + "Type": { + "$id": "2156", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": true, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "DefaultValue": { + "$id": "2157", + "Type": { + "$id": "2158", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "2025-01-01" + }, + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "2159", + "Name": "subscriptionId", + "NameInRequest": "subscriptionId", + "Doc": "The ID of the target subscription. The value must be an UUID.", + "Type": { + "$id": "2160", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "2161", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "2162", + "Name": "resourceGroupName", + "NameInRequest": "resourceGroupName", + "Doc": "The name of the resource group. The name is case insensitive.", + "Type": { + "$id": "2163", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "2164", + "Name": "experimentName", + "NameInRequest": "experimentName", + "Doc": "String that represents a Experiment resource name.", + "Type": { + "$id": "2165", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "2166", + "Name": "accept", + "NameInRequest": "Accept", + "Type": { + "$id": "2167", + "kind": "constant", + "valueType": { + "$id": "2168", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "2169", + "StatusCodes": [ + 200 + ], + "BodyType": { + "$ref": "250" + }, + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false, + "ContentTypes": [ + "application/json" + ] + } + ], + "HttpMethod": "GET", + "RequestBodyMediaType": "None", + "Uri": "{endpoint}", + "Path": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Chaos/experiments/{experimentName}/executions", + "BufferResponse": true, + "Paging": { + "$id": "2170", + "ItemName": "value", + "NextLinkName": "nextLink" + }, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Microsoft.Chaos.ExperimentExecutions.listAllExecutions", + "Decorators": [], + "Examples": [ + { + "$id": "2171", + "kind": "http", + "name": "List all executions of an Experiment.", + "description": "List all executions of an Experiment.", + "filePath": "2025-01-01/Experiments_ListAllExecutions.json", + "parameters": [ + { + "$id": "2172", + "parameter": { + "$ref": "2155" + }, + "value": { + "$id": "2173", + "kind": "string", + "type": { + "$ref": "2156" + }, + "value": "2025-01-01" + } + }, + { + "$id": "2174", + "parameter": { + "$ref": "2164" + }, + "value": { + "$id": "2175", + "kind": "string", + "type": { + "$ref": "2165" + }, + "value": "exampleExperiment" + } + }, + { + "$id": "2176", + "parameter": { + "$ref": "2162" + }, + "value": { + "$id": "2177", + "kind": "string", + "type": { + "$ref": "2163" + }, + "value": "exampleRG" + } + }, + { + "$id": "2178", + "parameter": { + "$ref": "2159" + }, + "value": { + "$id": "2179", + "kind": "string", + "type": { + "$ref": "2160" + }, + "value": "6b052e15-03d3-4f17-b2e1-be7f07588291" + } + } + ], + "responses": [ + { + "$id": "2180", + "response": { + "$ref": "2169" + }, + "statusCode": 200, + "bodyValue": { + "$id": "2181", + "kind": "model", + "type": { + "$ref": "250" + }, + "value": { + "$id": "2182", + "nextLink": { + "$id": "2183", + "kind": "string", + "type": { + "$ref": "256" + }, + "value": "https://management.azure.com/subscriptions/6b052e15-03d3-4f17-b2e1-be7f07588291/resourceGroups/exampleRG/providers/Microsoft.Chaos/experiments/exampleExperiment/executionDetails?continuationToken=&api-version=2025-01-01" + }, + "value": { + "$id": "2184", + "kind": "array", + "type": { + "$ref": "252" + }, + "value": [ + { + "$id": "2185", + "kind": "model", + "type": { + "$ref": "231" + }, + "value": { + "$id": "2186", + "name": { + "$id": "2187", + "kind": "string", + "type": { + "$ref": "164" + }, + "value": "f24500ad-744e-4a26-864b-b76199eac333" + }, + "type": { + "$id": "2188", + "kind": "string", + "type": { + "$ref": "168" + }, + "value": "Microsoft.Chaos/experiments/executions" + }, + "id": { + "$id": "2189", + "kind": "string", + "type": { + "$ref": "159" + }, + "value": "/subscriptions/6b052e15-03d3-4f17-b2e1-be7f07588291/resourceGroups/exampleRG/providers/Microsoft.Chaos/experiments/exampleExperiment/executions/f24500ad-744e-4a26-864b-b76199eac333" + }, + "properties": { + "$id": "2190", + "kind": "model", + "type": { + "$ref": "233" + }, + "value": { + "$id": "2191", + "startedAt": { + "$id": "2192", + "kind": "string", + "type": { + "$ref": "239" + }, + "value": "2020-12-14T21:52:52.2552574Z" + }, + "status": { + "$id": "2193", + "kind": "string", + "type": { + "$ref": "235" + }, + "value": "failed" + }, + "stoppedAt": { + "$id": "2194", + "kind": "string", + "type": { + "$ref": "244" + }, + "value": "2020-12-14T21:56:18.9281956Z" + } + } + } + } + }, + { + "$id": "2195", + "kind": "model", + "type": { + "$ref": "231" + }, + "value": { + "$id": "2196", + "name": { + "$id": "2197", + "kind": "string", + "type": { + "$ref": "164" + }, + "value": "14d98367-52ef-4596-be4f-53fc81bbfc33" + }, + "type": { + "$id": "2198", + "kind": "string", + "type": { + "$ref": "168" + }, + "value": "Microsoft.Chaos/experiments/executions" + }, + "id": { + "$id": "2199", + "kind": "string", + "type": { + "$ref": "159" + }, + "value": "/subscriptions/6b052e15-03d3-4f17-b2e1-be7f07588291/resourceGroups/exampleRG/providers/Microsoft.Chaos/experiments/exampleExperiment/executions/14d98367-52ef-4596-be4f-53fc81bbfc33" + }, + "properties": { + "$id": "2200", + "kind": "model", + "type": { + "$ref": "233" + }, + "value": { + "$id": "2201", + "startedAt": { + "$id": "2202", + "kind": "string", + "type": { + "$ref": "239" + }, + "value": "2020-12-14T21:52:52.2552574Z" + }, + "status": { + "$id": "2203", + "kind": "string", + "type": { + "$ref": "235" + }, + "value": "success" + }, + "stoppedAt": { + "$id": "2204", + "kind": "string", + "type": { + "$ref": "244" + }, + "value": "2020-12-14T21:56:18.9281956Z" + } + } + } + } + } + ] + } + } + } + } + ] + } + ] + }, + { + "$id": "2205", + "Name": "ExecutionDetails", + "ResourceName": "ExperimentExecutions", + "Doc": "Execution details of an experiment resource.", + "Accessibility": "public", + "Parameters": [ + { + "$id": "2206", + "Name": "apiVersion", + "NameInRequest": "api-version", + "Doc": "The API version to use for this operation.", + "Type": { + "$id": "2207", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": true, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "DefaultValue": { + "$id": "2208", + "Type": { + "$id": "2209", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "2025-01-01" + }, + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "2210", + "Name": "subscriptionId", + "NameInRequest": "subscriptionId", + "Doc": "The ID of the target subscription. The value must be an UUID.", + "Type": { + "$id": "2211", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "2212", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "2213", + "Name": "resourceGroupName", + "NameInRequest": "resourceGroupName", + "Doc": "The name of the resource group. The name is case insensitive.", + "Type": { + "$id": "2214", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "2215", + "Name": "experimentName", + "NameInRequest": "experimentName", + "Doc": "String that represents a Experiment resource name.", + "Type": { + "$id": "2216", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "2217", + "Name": "executionId", + "NameInRequest": "executionId", + "Doc": "GUID that represents a Experiment execution detail.", + "Type": { + "$id": "2218", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "2219", + "Name": "accept", + "NameInRequest": "Accept", + "Type": { + "$id": "2220", + "kind": "constant", + "valueType": { + "$id": "2221", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "2222", + "StatusCodes": [ + 200 + ], + "BodyType": { + "$ref": "260" + }, + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false, + "ContentTypes": [ + "application/json" + ] + } + ], + "HttpMethod": "POST", + "RequestBodyMediaType": "None", + "Uri": "{endpoint}", + "Path": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Chaos/experiments/{experimentName}/executions/{executionId}/getExecutionDetails", + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Microsoft.Chaos.ExperimentExecutions.getExecutionDetails", + "Decorators": [], + "Examples": [ + { + "$id": "2223", + "kind": "http", + "name": "Get experiment execution details.", + "description": "Get experiment execution details.", + "filePath": "2025-01-01/Experiments_ExecutionDetails.json", + "parameters": [ + { + "$id": "2224", + "parameter": { + "$ref": "2206" + }, + "value": { + "$id": "2225", + "kind": "string", + "type": { + "$ref": "2207" + }, + "value": "2025-01-01" + } + }, + { + "$id": "2226", + "parameter": { + "$ref": "2217" + }, + "value": { + "$id": "2227", + "kind": "string", + "type": { + "$ref": "2218" + }, + "value": "f24500ad-744e-4a26-864b-b76199eac333" + } + }, + { + "$id": "2228", + "parameter": { + "$ref": "2215" + }, + "value": { + "$id": "2229", + "kind": "string", + "type": { + "$ref": "2216" + }, + "value": "exampleExperiment" + } + }, + { + "$id": "2230", + "parameter": { + "$ref": "2213" + }, + "value": { + "$id": "2231", + "kind": "string", + "type": { + "$ref": "2214" + }, + "value": "exampleRG" + } + }, + { + "$id": "2232", + "parameter": { + "$ref": "2210" + }, + "value": { + "$id": "2233", + "kind": "string", + "type": { + "$ref": "2211" + }, + "value": "6b052e15-03d3-4f17-b2e1-be7f07588291" + } + } + ], + "responses": [ + { + "$id": "2234", + "response": { + "$ref": "2222" + }, + "statusCode": 200, + "bodyValue": { + "$id": "2235", + "kind": "model", + "type": { + "$ref": "260" + }, + "value": { + "$id": "2236", + "name": { + "$id": "2237", + "kind": "string", + "type": { + "$ref": "270" + }, + "value": "f24500ad-744e-4a26-864b-b76199eac333" + }, + "type": { + "$id": "2238", + "kind": "string", + "type": { + "$ref": "262" + }, + "value": "Microsoft.Chaos/experiments/executions/getExecutionDetails" + }, + "id": { + "$id": "2239", + "kind": "string", + "type": { + "$ref": "266" + }, + "value": "/subscriptions/6b052e15-03d3-4f17-b2e1-be7f07588291/resourceGroups/exampleRG/providers/Microsoft.Chaos/experiments/exampleExperiment/executions/f24500ad-744e-4a26-864b-b76199eac333/getExecutionDetails" + }, + "properties": { + "$id": "2240", + "kind": "model", + "type": { + "$ref": "274" + }, + "value": { + "$id": "2241", + "failureReason": { + "$id": "2242", + "kind": "string", + "type": { + "$ref": "290" + }, + "value": "Dependency failure" + }, + "lastActionAt": { + "$id": "2243", + "kind": "string", + "type": { + "$ref": "294" + }, + "value": "2020-12-14T21:52:52.2552574Z" + }, + "runInformation": { + "$id": "2244", + "kind": "model", + "type": { + "$ref": "299" + }, + "value": { + "$id": "2245", + "steps": { + "$id": "2246", + "kind": "array", + "type": { + "$ref": "301" + }, + "value": [ + { + "$id": "2247", + "kind": "model", + "type": { + "$ref": "302" + }, + "value": { + "$id": "2248", + "branches": { + "$id": "2249", + "kind": "array", + "type": { + "$ref": "316" + }, + "value": [ + { + "$id": "2250", + "kind": "model", + "type": { + "$ref": "317" + }, + "value": { + "$id": "2251", + "actions": { + "$id": "2252", + "kind": "array", + "type": { + "$ref": "331" + }, + "value": [ + { + "$id": "2253", + "kind": "model", + "type": { + "$ref": "332" + }, + "value": { + "$id": "2254", + "actionId": { + "$id": "2255", + "kind": "string", + "type": { + "$ref": "338" + }, + "value": "59499d33-6751-4b6e-a1f6-58f4d56a040a" + }, + "actionName": { + "$id": "2256", + "kind": "string", + "type": { + "$ref": "334" + }, + "value": "urn:provider:agent-v2:Microsoft.Azure.Chaos.Fault.CPUPressureAllProcessors" + }, + "endTime": { + "$id": "2257", + "kind": "string", + "type": { + "$ref": "351" + }, + "value": "2020-12-14T13:56:13.6270153-08:00" + }, + "startTime": { + "$id": "2258", + "kind": "string", + "type": { + "$ref": "346" + }, + "value": "2020-12-14T13:56:13.6270153-08:00" + }, + "status": { + "$id": "2259", + "kind": "string", + "type": { + "$ref": "342" + }, + "value": "failed" + }, + "targets": { + "$id": "2260", + "kind": "array", + "type": { + "$ref": "356" + }, + "value": [ + { + "$id": "2261", + "kind": "model", + "type": { + "$ref": "357" + }, + "value": { + "$id": "2262", + "status": { + "$id": "2263", + "kind": "string", + "type": { + "$ref": "359" + }, + "value": "succeeded" + }, + "target": { + "$id": "2264", + "kind": "string", + "type": { + "$ref": "363" + }, + "value": "/subscriptions/6b052e15-03d3-4f17-b2e1-be7f07588291/resourceGroups/exampleRG/providers/Microsoft.Compute/virtualMachines/VM1" + }, + "targetCompletedTime": { + "$id": "2265", + "kind": "string", + "type": { + "$ref": "372" + }, + "value": "2021-04-02T17:30:55+00:00" + }, + "targetFailedTime": { + "$id": "2266", + "kind": "string", + "type": { + "$ref": "367" + }, + "value": "2021-04-02T16:30:55+00:00" + } + } + }, + { + "$id": "2267", + "kind": "model", + "type": { + "$ref": "357" + }, + "value": { + "$id": "2268", + "status": { + "$id": "2269", + "kind": "string", + "type": { + "$ref": "359" + }, + "value": "failed" + }, + "target": { + "$id": "2270", + "kind": "string", + "type": { + "$ref": "363" + }, + "value": "/subscriptions/6b052e15-03d3-4f17-b2e1-be7f07588291/resourceGroups/exampleRG/providers/Microsoft.Compute/virtualMachines/VM1" + }, + "targetCompletedTime": { + "$id": "2271", + "kind": "string", + "type": { + "$ref": "372" + }, + "value": "2021-04-02T17:30:55+00:00" + }, + "targetFailedTime": { + "$id": "2272", + "kind": "string", + "type": { + "$ref": "367" + }, + "value": "2021-04-02T16:30:55+00:00" + } + } + } + ] + } + } + } + ] + }, + "branchId": { + "$id": "2273", + "kind": "string", + "type": { + "$ref": "323" + }, + "value": "FirstBranch" + }, + "branchName": { + "$id": "2274", + "kind": "string", + "type": { + "$ref": "319" + }, + "value": "FirstBranch" + }, + "status": { + "$id": "2275", + "kind": "string", + "type": { + "$ref": "327" + }, + "value": "failed" + } + } + } + ] + }, + "status": { + "$id": "2276", + "kind": "string", + "type": { + "$ref": "312" + }, + "value": "failed" + }, + "stepId": { + "$id": "2277", + "kind": "string", + "type": { + "$ref": "308" + }, + "value": "FirstStep" + }, + "stepName": { + "$id": "2278", + "kind": "string", + "type": { + "$ref": "304" + }, + "value": "FirstStep" + } + } + } + ] + } + } + }, + "startedAt": { + "$id": "2279", + "kind": "string", + "type": { + "$ref": "280" + }, + "value": "2020-12-14T21:52:52.2552574Z" + }, + "status": { + "$id": "2280", + "kind": "string", + "type": { + "$ref": "276" + }, + "value": "failed" + }, + "stoppedAt": { + "$id": "2281", + "kind": "string", + "type": { + "$ref": "285" + }, + "value": "2020-12-14T21:56:18.9281956Z" + } + } + } + } + } + } + ] + } + ] + } + ], + "Protocol": { + "$id": "2282" + }, + "Parent": "ChaosClient", + "Parameters": [ + { + "$id": "2283", + "Name": "endpoint", + "NameInRequest": "endpoint", + "Doc": "Service host", + "Type": { + "$id": "2284", + "kind": "url", + "name": "url", + "crossLanguageDefinitionId": "TypeSpec.url" + }, + "Location": "Uri", + "IsApiVersion": false, + "IsResourceParameter": false, + "IsContentType": false, + "IsRequired": true, + "IsEndpoint": true, + "SkipUrlEncoding": false, + "Explode": false, + "Kind": "Client", + "DefaultValue": { + "$id": "2285", + "Type": { + "$id": "2286", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "https://management.azure.com" + } + } + ], + "Decorators": [] + }, + { + "$id": "2287", + "Name": "TargetTypes", + "ClientNamespace": "Microsoft.Chaos", + "Operations": [ + { + "$id": "2288", + "Name": "get", + "ResourceName": "TargetType", + "Doc": "Get a Target Type resources for given location.", + "Accessibility": "public", + "Parameters": [ + { + "$id": "2289", + "Name": "apiVersion", + "NameInRequest": "api-version", + "Doc": "The API version to use for this operation.", + "Type": { + "$id": "2290", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": true, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "DefaultValue": { + "$id": "2291", + "Type": { + "$id": "2292", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "2025-01-01" + }, + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "2293", + "Name": "subscriptionId", + "NameInRequest": "subscriptionId", + "Doc": "The ID of the target subscription. The value must be an UUID.", + "Type": { + "$id": "2294", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "2295", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "2296", + "Name": "location", + "NameInRequest": "location", + "Doc": "The name of the Azure region.", + "Type": { + "$id": "2297", + "kind": "string", + "name": "azureLocation", + "crossLanguageDefinitionId": "Azure.Core.azureLocation", + "baseType": { + "$id": "2298", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "2299", + "Name": "targetTypeName", + "NameInRequest": "targetTypeName", + "Doc": "String that represents a Target Type resource name.", + "Type": { + "$id": "2300", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "2301", + "Name": "accept", + "NameInRequest": "Accept", + "Type": { + "$id": "2302", + "kind": "constant", + "valueType": { + "$id": "2303", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "2304", + "StatusCodes": [ + 200 + ], + "BodyType": { + "$ref": "155" + }, + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false, + "ContentTypes": [ + "application/json" + ] + } + ], + "HttpMethod": "GET", + "RequestBodyMediaType": "None", + "Uri": "{endpoint}", + "Path": "/subscriptions/{subscriptionId}/providers/Microsoft.Chaos/locations/{location}/targetTypes/{targetTypeName}", + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Microsoft.Chaos.TargetTypes.get", + "Decorators": [], + "Examples": [ + { + "$id": "2305", + "kind": "http", + "name": "Get a Target Type for westus2 location", + "description": "Get a Target Type for westus2 location", + "filePath": "2025-01-01/TargetTypes_Get.json", + "parameters": [ + { + "$id": "2306", + "parameter": { + "$ref": "2289" + }, + "value": { + "$id": "2307", + "kind": "string", + "type": { + "$ref": "2290" + }, + "value": "2025-01-01" + } + }, + { + "$id": "2308", + "parameter": { + "$ref": "2296" + }, + "value": { + "$id": "2309", + "kind": "string", + "type": { + "$ref": "2297" + }, + "value": "westus2" + } + }, + { + "$id": "2310", + "parameter": { + "$ref": "2293" + }, + "value": { + "$id": "2311", + "kind": "string", + "type": { + "$ref": "2294" + }, + "value": "6b052e15-03d3-4f17-b2e1-be7f07588291" + } + }, + { + "$id": "2312", + "parameter": { + "$ref": "2299" + }, + "value": { + "$id": "2313", + "kind": "string", + "type": { + "$ref": "2300" + }, + "value": "Microsoft-Agent" + } + } + ], + "responses": [ + { + "$id": "2314", + "response": { + "$ref": "2304" + }, + "statusCode": 200, + "bodyValue": { + "$id": "2315", + "kind": "model", + "type": { + "$ref": "155" + }, + "value": { + "$id": "2316", + "name": { + "$id": "2317", + "kind": "string", + "type": { + "$ref": "164" + }, + "value": "Microsoft-Agent" + }, + "type": { + "$id": "2318", + "kind": "string", + "type": { + "$ref": "168" + }, + "value": "Microsoft.Chaos/locations/targetTypes" + }, + "id": { + "$id": "2319", + "kind": "string", + "type": { + "$ref": "159" + }, + "value": "/subscriptions/6b052e15-03d3-4f17-b2e1-be7f07588291/providers/Microsoft.Chaos/locations/westus2/targetTypes/Microsoft-Agent" + }, + "properties": { + "$id": "2320", + "kind": "model", + "type": { + "$ref": "201" + }, + "value": { + "$id": "2321", + "description": { + "$id": "2322", + "kind": "string", + "type": { + "$ref": "207" + }, + "value": "A target represents Chaos Agent." + }, + "displayName": { + "$id": "2323", + "kind": "string", + "type": { + "$ref": "203" + }, + "value": "Chaos Agent" + }, + "propertiesSchema": { + "$id": "2324", + "kind": "string", + "type": { + "$ref": "211" + }, + "value": "https://schema.centralus.chaos-prod.azure.com/targets/Microsoft-VirtualMachine.json" + }, + "resourceTypes": { + "$id": "2325", + "kind": "array", + "type": { + "$ref": "215" + }, + "value": [ + { + "$id": "2326", + "kind": "string", + "type": { + "$ref": "216" + }, + "value": "Microsoft.Compute/virtualMachines" + }, + { + "$id": "2327", + "kind": "string", + "type": { + "$ref": "216" + }, + "value": "Microsoft.Compute/virtualMachineScaleSets" + } + ] + } + } + } + } + } + } + ] + } + ] + }, + { + "$id": "2328", + "Name": "list", + "ResourceName": "TargetType", + "Doc": "Get a list of Target Type resources for given location.", + "Accessibility": "public", + "Parameters": [ + { + "$id": "2329", + "Name": "apiVersion", + "NameInRequest": "api-version", + "Doc": "The API version to use for this operation.", + "Type": { + "$id": "2330", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": true, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "DefaultValue": { + "$id": "2331", + "Type": { + "$id": "2332", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "2025-01-01" + }, + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "2333", + "Name": "subscriptionId", + "NameInRequest": "subscriptionId", + "Doc": "The ID of the target subscription. The value must be an UUID.", + "Type": { + "$id": "2334", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "2335", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "2336", + "Name": "location", + "NameInRequest": "location", + "Doc": "The name of the Azure region.", + "Type": { + "$id": "2337", + "kind": "string", + "name": "azureLocation", + "crossLanguageDefinitionId": "Azure.Core.azureLocation", + "baseType": { + "$id": "2338", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "2339", + "Name": "continuationToken", + "NameInRequest": "continuationToken", + "Doc": "String that sets the continuation token.", + "Type": { + "$id": "2340", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": false, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "2341", + "Name": "accept", + "NameInRequest": "Accept", + "Type": { + "$id": "2342", + "kind": "constant", + "valueType": { + "$id": "2343", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "2344", + "StatusCodes": [ + 200 + ], + "BodyType": { + "$ref": "221" + }, + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false, + "ContentTypes": [ + "application/json" + ] + } + ], + "HttpMethod": "GET", + "RequestBodyMediaType": "None", + "Uri": "{endpoint}", + "Path": "/subscriptions/{subscriptionId}/providers/Microsoft.Chaos/locations/{location}/targetTypes", + "BufferResponse": true, + "Paging": { + "$id": "2345", + "ItemName": "value", + "NextLinkName": "nextLink" + }, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Microsoft.Chaos.TargetTypes.list", + "Decorators": [], + "Examples": [ + { + "$id": "2346", + "kind": "http", + "name": "List all Target Types for westus2 location.", + "description": "List all Target Types for westus2 location.", + "filePath": "2025-01-01/TargetTypes_List.json", + "parameters": [ + { + "$id": "2347", + "parameter": { + "$ref": "2329" + }, + "value": { + "$id": "2348", + "kind": "string", + "type": { + "$ref": "2330" + }, + "value": "2025-01-01" + } + }, + { + "$id": "2349", + "parameter": { + "$ref": "2336" + }, + "value": { + "$id": "2350", + "kind": "string", + "type": { + "$ref": "2337" + }, + "value": "westus2" + } + }, + { + "$id": "2351", + "parameter": { + "$ref": "2333" + }, + "value": { + "$id": "2352", + "kind": "string", + "type": { + "$ref": "2334" + }, + "value": "6b052e15-03d3-4f17-b2e1-be7f07588291" + } + } + ], + "responses": [ + { + "$id": "2353", + "response": { + "$ref": "2344" + }, + "statusCode": 200, + "bodyValue": { + "$id": "2354", + "kind": "model", + "type": { + "$ref": "221" + }, + "value": { + "$id": "2355", + "nextLink": { + "$id": "2356", + "kind": "string", + "type": { + "$ref": "227" + }, + "value": "https://management.azure.com/subscriptions/6b052e15-03d3-4f17-b2e1-be7f07588291/providers/Microsoft.Chaos/locations/westus2/targetTypes?continuationToken=&api-version=2024-11-01-preview" + }, + "value": { + "$id": "2357", + "kind": "array", + "type": { + "$ref": "223" + }, + "value": [ + { + "$id": "2358", + "kind": "model", + "type": { + "$ref": "155" + }, + "value": { + "$id": "2359", + "name": { + "$id": "2360", + "kind": "string", + "type": { + "$ref": "164" + }, + "value": "Microsoft-Agent" + }, + "type": { + "$id": "2361", + "kind": "string", + "type": { + "$ref": "168" + }, + "value": "Microsoft.Chaos/locations/targetTypes" + }, + "id": { + "$id": "2362", + "kind": "string", + "type": { + "$ref": "159" + }, + "value": "/subscriptions/6b052e15-03d3-4f17-b2e1-be7f07588291/providers/Microsoft.Chaos/locations/westus2/targetTypes/Microsoft-Agent" + }, + "properties": { + "$id": "2363", + "kind": "model", + "type": { + "$ref": "201" + }, + "value": { + "$id": "2364", + "description": { + "$id": "2365", + "kind": "string", + "type": { + "$ref": "207" + }, + "value": "A target represents Chaos Agent." + }, + "displayName": { + "$id": "2366", + "kind": "string", + "type": { + "$ref": "203" + }, + "value": "Chaos Agent" + }, + "propertiesSchema": { + "$id": "2367", + "kind": "string", + "type": { + "$ref": "211" + }, + "value": "https://schema.centralus.chaos-prod.azure.com/targets/Microsoft-VirtualMachine.json" + }, + "resourceTypes": { + "$id": "2368", + "kind": "array", + "type": { + "$ref": "215" + }, + "value": [ + { + "$id": "2369", + "kind": "string", + "type": { + "$ref": "216" + }, + "value": "Microsoft.Compute/virtualMachines" + }, + { + "$id": "2370", + "kind": "string", + "type": { + "$ref": "216" + }, + "value": "Microsoft.Compute/virtualMachineScaleSets" + } + ] + } + } + } + } + } + ] + } + } + } + } + ] + } + ] + } + ], + "Protocol": { + "$id": "2371" + }, + "Parent": "ChaosClient", + "Parameters": [ + { + "$id": "2372", + "Name": "endpoint", + "NameInRequest": "endpoint", + "Doc": "Service host", + "Type": { + "$id": "2373", + "kind": "url", + "name": "url", + "crossLanguageDefinitionId": "TypeSpec.url" + }, + "Location": "Uri", + "IsApiVersion": false, + "IsResourceParameter": false, + "IsContentType": false, + "IsRequired": true, + "IsEndpoint": true, + "SkipUrlEncoding": false, + "Explode": false, + "Kind": "Client", + "DefaultValue": { + "$id": "2374", + "Type": { + "$id": "2375", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "https://management.azure.com" + } + } + ], + "Decorators": [] + }, + { + "$id": "2376", + "Name": "OperationStatuses", + "ClientNamespace": "Microsoft.Chaos", + "Doc": "Chaos Studio async operation status resource operations.", + "Operations": [ + { + "$id": "2377", + "Name": "get", + "ResourceName": "OperationStatuses", + "Doc": "Returns the current status of an async operation.", + "Accessibility": "public", + "Parameters": [ + { + "$id": "2378", + "Name": "apiVersion", + "NameInRequest": "api-version", + "Doc": "The API version to use for this operation.", + "Type": { + "$id": "2379", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": true, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "DefaultValue": { + "$id": "2380", + "Type": { + "$id": "2381", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "2025-01-01" + }, + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "2382", + "Name": "subscriptionId", + "NameInRequest": "subscriptionId", + "Doc": "The ID of the target subscription. The value must be an UUID.", + "Type": { + "$id": "2383", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "2384", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "2385", + "Name": "location", + "NameInRequest": "location", + "Doc": "The location name.", + "Type": { + "$id": "2386", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "2387", + "Name": "operationId", + "NameInRequest": "operationId", + "Doc": "The ID of an ongoing async operation.", + "Type": { + "$id": "2388", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "2389", + "Name": "accept", + "NameInRequest": "Accept", + "Type": { + "$id": "2390", + "kind": "constant", + "valueType": { + "$id": "2391", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "2392", + "StatusCodes": [ + 200 + ], + "BodyType": { + "$ref": "82" + }, + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false, + "ContentTypes": [ + "application/json" + ] + } + ], + "HttpMethod": "GET", + "RequestBodyMediaType": "None", + "Uri": "{endpoint}", + "Path": "/subscriptions/{subscriptionId}/providers/Microsoft.Chaos/locations/{location}/operationStatuses/{operationId}", + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Microsoft.Chaos.OperationStatuses.get", + "Decorators": [], + "Examples": [ + { + "$id": "2393", + "kind": "http", + "name": "Gets Chaos Studio async operation status.", + "description": "Gets Chaos Studio async operation status.", + "filePath": "2025-01-01/OperationStatuses_Get.json", + "parameters": [ + { + "$id": "2394", + "parameter": { + "$ref": "2378" + }, + "value": { + "$id": "2395", + "kind": "string", + "type": { + "$ref": "2379" + }, + "value": "2025-01-01" + } + }, + { + "$id": "2396", + "parameter": { + "$ref": "2382" + }, + "value": { + "$id": "2397", + "kind": "string", + "type": { + "$ref": "2383" + }, + "value": "e25c0d12-0335-4fec-8ef8-3b4f9a10649e" + } + }, + { + "$id": "2398", + "parameter": { + "$ref": "2385" + }, + "value": { + "$id": "2399", + "kind": "string", + "type": { + "$ref": "2386" + }, + "value": "westus2" + } + }, + { + "$id": "2400", + "parameter": { + "$ref": "2387" + }, + "value": { + "$id": "2401", + "kind": "string", + "type": { + "$ref": "2388" + }, + "value": "4bdadd97-207c-4de8-9bba-08339ae099c7" + } + } + ], + "responses": [ + { + "$id": "2402", + "response": { + "$ref": "2392" + }, + "statusCode": 200, + "bodyValue": { + "$id": "2403", + "kind": "model", + "type": { + "$ref": "82" + }, + "value": { + "$id": "2404", + "id": { + "$id": "2405", + "kind": "string", + "type": { + "$ref": "84" + }, + "value": "/subscriptions/e25c0d12-0335-4fec-8ef8-3b4f9a10649e/providers/Microsoft.Chaos/locations/westus2/operationStatuses/4bdadd97-207c-4de8-9bba-08339ae099c7" + }, + "name": { + "$id": "2406", + "kind": "string", + "type": { + "$ref": "89" + }, + "value": "4bdadd97-207c-4de8-9bba-08339ae099c7" + }, + "startTime": { + "$id": "2407", + "kind": "string", + "type": { + "$ref": "101" + }, + "value": "2024-11-14T21:52:52.2552574Z" + }, + "status": { + "$id": "2408", + "kind": "string", + "type": { + "$ref": "93" + }, + "value": "Creating" + } + } + } + } + ] + } + ] + } + ], + "Protocol": { + "$id": "2409" + }, + "Parent": "ChaosClient", + "Parameters": [ + { + "$id": "2410", + "Name": "endpoint", + "NameInRequest": "endpoint", + "Doc": "Service host", + "Type": { + "$id": "2411", + "kind": "url", + "name": "url", + "crossLanguageDefinitionId": "TypeSpec.url" + }, + "Location": "Uri", + "IsApiVersion": false, + "IsResourceParameter": false, + "IsContentType": false, + "IsRequired": true, + "IsEndpoint": true, + "SkipUrlEncoding": false, + "Explode": false, + "Kind": "Client", + "DefaultValue": { + "$id": "2412", + "Type": { + "$id": "2413", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "https://management.azure.com" + } + } + ], + "Decorators": [] + } + ], + "Auth": { + "$id": "2414", + "OAuth2": { + "$id": "2415", + "Scopes": [ + "user_impersonation" + ] + } + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/Configuration.json b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/Configuration.json new file mode 100644 index 000000000000..950808ed35b8 --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/Configuration.json @@ -0,0 +1,13 @@ +{ + "output-folder": ".", + "namespace": "Azure.ResourceManager.ComputeFleet", + "library-name": "Azure.ResourceManager.ComputeFleet", + "flavor": "azure", + "use-model-reader-writer": true, + "shared-source-folders": [ + "../../TempTypeSpecFiles/node_modules/@autorest/csharp/Generator.Shared", + "../../TempTypeSpecFiles/node_modules/@autorest/csharp/Azure.Core.Shared" + ], + "model-namespace": false, + "azure-arm": true +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/tsp-location.yaml b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/tsp-location.yaml index 33e2a8ab89cd..c1f6689e7adb 100644 --- a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/tsp-location.yaml +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/tsp-location.yaml @@ -1,4 +1,4 @@ directory: specification/azurefleet/AzureFleet.Management -commit: 7e22a66617633d162735fe65388c2852127b4aac +commit: 676334a284e5136f0a0721d6ae844bb04332f579 repo: Azure/azure-rest-api-specs - +additionalDirectories: diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/tspCodeModel.json b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/tspCodeModel.json new file mode 100644 index 000000000000..97275ebf2a02 --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/tspCodeModel.json @@ -0,0 +1,37357 @@ +{ + "$id": "1", + "Name": "Microsoft.AzureFleet", + "ApiVersions": [ + "2024-11-01" + ], + "Enums": [ + { + "$id": "2", + "kind": "enum", + "name": "ComputeFleetProvisioningState", + "crossLanguageDefinitionId": "Microsoft.AzureFleet.ProvisioningState", + "valueType": { + "$id": "3", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "4", + "kind": "enumvalue", + "name": "Succeeded", + "value": "Succeeded", + "valueType": { + "$id": "5", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "2" + }, + "doc": "Resource has been created.", + "decorators": [] + }, + { + "$id": "6", + "kind": "enumvalue", + "name": "Failed", + "value": "Failed", + "valueType": { + "$id": "7", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "2" + }, + "doc": "Resource creation failed.", + "decorators": [] + }, + { + "$id": "8", + "kind": "enumvalue", + "name": "Canceled", + "value": "Canceled", + "valueType": { + "$id": "9", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "2" + }, + "doc": "Resource creation was canceled.", + "decorators": [] + }, + { + "$id": "10", + "kind": "enumvalue", + "name": "Creating", + "value": "Creating", + "valueType": { + "$id": "11", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "2" + }, + "doc": "Initial creation in progress.", + "decorators": [] + }, + { + "$id": "12", + "kind": "enumvalue", + "name": "Updating", + "value": "Updating", + "valueType": { + "$id": "13", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "2" + }, + "doc": "Update in progress.", + "decorators": [] + }, + { + "$id": "14", + "kind": "enumvalue", + "name": "Deleting", + "value": "Deleting", + "valueType": { + "$id": "15", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "2" + }, + "doc": "Deletion in progress.", + "decorators": [] + }, + { + "$id": "16", + "kind": "enumvalue", + "name": "Migrating", + "value": "Migrating", + "valueType": { + "$id": "17", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "2" + }, + "doc": "Resource is being migrated from one subscription or resource group to another.", + "decorators": [] + } + ], + "clientNamespace": "Microsoft.AzureFleet", + "doc": "The status of the current operation.", + "isFixed": false, + "isFlags": false, + "usage": "Output,Json,LroInitial,LroPolling,LroFinalEnvelope", + "decorators": [] + }, + { + "$id": "18", + "kind": "enum", + "name": "ComputeFleetEvictionPolicy", + "crossLanguageDefinitionId": "Microsoft.AzureFleet.EvictionPolicy", + "valueType": { + "$id": "19", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "20", + "kind": "enumvalue", + "name": "Delete", + "value": "Delete", + "valueType": { + "$id": "21", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "18" + }, + "doc": "When evicted, the Spot VM will be deleted and the corresponding capacity will be updated to reflect this.", + "decorators": [] + }, + { + "$id": "22", + "kind": "enumvalue", + "name": "Deallocate", + "value": "Deallocate", + "valueType": { + "$id": "23", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "18" + }, + "doc": "When evicted, the Spot VM will be deallocated/stopped", + "decorators": [] + } + ], + "clientNamespace": "Microsoft.AzureFleet", + "doc": "Different kind of eviction policies", + "isFixed": false, + "isFlags": false, + "usage": "Input,Output,Json,LroInitial,LroPolling,LroFinalEnvelope", + "decorators": [] + }, + { + "$id": "24", + "kind": "enum", + "name": "SpotAllocationStrategy", + "crossLanguageDefinitionId": "Microsoft.AzureFleet.SpotAllocationStrategy", + "valueType": { + "$id": "25", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "26", + "kind": "enumvalue", + "name": "PriceCapacityOptimized", + "value": "PriceCapacityOptimized", + "valueType": { + "$id": "27", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "24" + }, + "doc": "Default. VM sizes distribution will be determined to optimize for both price and capacity.", + "decorators": [] + }, + { + "$id": "28", + "kind": "enumvalue", + "name": "LowestPrice", + "value": "LowestPrice", + "valueType": { + "$id": "29", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "24" + }, + "doc": "VM sizes distribution will be determined to optimize for price. Note: Capacity will still be considered here but will be given much less weight.", + "decorators": [] + }, + { + "$id": "30", + "kind": "enumvalue", + "name": "CapacityOptimized", + "value": "CapacityOptimized", + "valueType": { + "$id": "31", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "24" + }, + "doc": "VM sizes distribution will be determined to optimize for capacity.", + "decorators": [] + } + ], + "clientNamespace": "Microsoft.AzureFleet", + "doc": "Spot allocation strategy types for Compute Fleet", + "isFixed": false, + "isFlags": false, + "usage": "Input,Output,Json,LroInitial,LroPolling,LroFinalEnvelope", + "decorators": [] + }, + { + "$id": "32", + "kind": "enum", + "name": "RegularPriorityAllocationStrategy", + "crossLanguageDefinitionId": "Microsoft.AzureFleet.RegularPriorityAllocationStrategy", + "valueType": { + "$id": "33", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "34", + "kind": "enumvalue", + "name": "LowestPrice", + "value": "LowestPrice", + "valueType": { + "$id": "35", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "32" + }, + "doc": "Default. VM sizes distribution will be determined to optimize for price.", + "decorators": [] + }, + { + "$id": "36", + "kind": "enumvalue", + "name": "Prioritized", + "value": "Prioritized", + "valueType": { + "$id": "37", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "32" + }, + "doc": "VM sizes distribution will be determined to optimize for the 'priority' as specified for each vm size.", + "decorators": [] + } + ], + "clientNamespace": "Microsoft.AzureFleet", + "doc": "Regular VM Allocation strategy types for Compute Fleet", + "isFixed": false, + "isFlags": false, + "usage": "Input,Output,Json,LroInitial,LroPolling,LroFinalEnvelope", + "decorators": [] + }, + { + "$id": "38", + "kind": "enum", + "name": "ComputeFleetVMAttributeSupport", + "crossLanguageDefinitionId": "Microsoft.AzureFleet.VMAttributeSupport", + "valueType": { + "$id": "39", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "40", + "kind": "enumvalue", + "name": "Excluded", + "value": "Excluded", + "valueType": { + "$id": "41", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "38" + }, + "doc": "All VMSizes having the feature support will be excluded.", + "decorators": [] + }, + { + "$id": "42", + "kind": "enumvalue", + "name": "Included", + "value": "Included", + "valueType": { + "$id": "43", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "38" + }, + "doc": " VMSizes that have the feature support and that do not have the feature support will be used. Included is a union of Excluded and Required.", + "decorators": [] + }, + { + "$id": "44", + "kind": "enumvalue", + "name": "Required", + "value": "Required", + "valueType": { + "$id": "45", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "38" + }, + "doc": "Only the VMSizes having the feature support will be used.", + "decorators": [] + } + ], + "clientNamespace": "Microsoft.AzureFleet", + "doc": "VMSizes supported by Azure VMs. Included is a union of Excluded and Required.", + "isFixed": false, + "isFlags": false, + "usage": "Input,Output,Json,LroInitial,LroPolling,LroFinalEnvelope", + "decorators": [] + }, + { + "$id": "46", + "kind": "enum", + "name": "LocalStorageDiskType", + "crossLanguageDefinitionId": "Microsoft.AzureFleet.LocalStorageDiskType", + "valueType": { + "$id": "47", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "48", + "kind": "enumvalue", + "name": "HDD", + "value": "HDD", + "valueType": { + "$id": "49", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "46" + }, + "doc": "HDD DiskType.", + "decorators": [] + }, + { + "$id": "50", + "kind": "enumvalue", + "name": "SSD", + "value": "SSD", + "valueType": { + "$id": "51", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "46" + }, + "doc": "SDD DiskType.", + "decorators": [] + } + ], + "clientNamespace": "Microsoft.AzureFleet", + "doc": "Different kind of Local storage disk types supported by Azure VMs.", + "isFixed": false, + "isFlags": false, + "usage": "Input,Output,Json,LroInitial,LroPolling,LroFinalEnvelope", + "decorators": [] + }, + { + "$id": "52", + "kind": "enum", + "name": "AcceleratorManufacturer", + "crossLanguageDefinitionId": "Microsoft.AzureFleet.AcceleratorManufacturer", + "valueType": { + "$id": "53", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "54", + "kind": "enumvalue", + "name": "AMD", + "value": "AMD", + "valueType": { + "$id": "55", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "52" + }, + "doc": "AMD GpuType", + "decorators": [] + }, + { + "$id": "56", + "kind": "enumvalue", + "name": "Nvidia", + "value": "Nvidia", + "valueType": { + "$id": "57", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "52" + }, + "doc": "Nvidia GpuType", + "decorators": [] + }, + { + "$id": "58", + "kind": "enumvalue", + "name": "Xilinx", + "value": "Xilinx", + "valueType": { + "$id": "59", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "52" + }, + "doc": "Xilinx GpuType", + "decorators": [] + } + ], + "clientNamespace": "Microsoft.AzureFleet", + "doc": "Accelerator manufacturers supported by Azure VMs.", + "isFixed": false, + "isFlags": false, + "usage": "Input,Output,Json,LroInitial,LroPolling,LroFinalEnvelope", + "decorators": [] + }, + { + "$id": "60", + "kind": "enum", + "name": "AcceleratorType", + "crossLanguageDefinitionId": "Microsoft.AzureFleet.AcceleratorType", + "valueType": { + "$id": "61", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "62", + "kind": "enumvalue", + "name": "GPU", + "value": "GPU", + "valueType": { + "$id": "63", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "60" + }, + "doc": "GPU Accelerator", + "decorators": [] + }, + { + "$id": "64", + "kind": "enumvalue", + "name": "FPGA", + "value": "FPGA", + "valueType": { + "$id": "65", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "60" + }, + "doc": "FPGA Accelerator", + "decorators": [] + } + ], + "clientNamespace": "Microsoft.AzureFleet", + "doc": "Accelerator types supported by Azure VMs.", + "isFixed": false, + "isFlags": false, + "usage": "Input,Output,Json,LroInitial,LroPolling,LroFinalEnvelope", + "decorators": [] + }, + { + "$id": "66", + "kind": "enum", + "name": "ComputeFleetVmCategory", + "crossLanguageDefinitionId": "Microsoft.AzureFleet.VMCategory", + "valueType": { + "$id": "67", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "68", + "kind": "enumvalue", + "name": "GeneralPurpose", + "value": "GeneralPurpose", + "valueType": { + "$id": "69", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "66" + }, + "doc": "General purpose VM sizes provide balanced CPU-to-memory ratio. Ideal for testing and development, small to medium databases, and low to medium traffic web servers.", + "decorators": [] + }, + { + "$id": "70", + "kind": "enumvalue", + "name": "ComputeOptimized", + "value": "ComputeOptimized", + "valueType": { + "$id": "71", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "66" + }, + "doc": "Compute optimized VM sizes have a high CPU-to-memory ratio. These sizes are good for medium traffic web servers, network appliances, batch processes, and application servers.", + "decorators": [] + }, + { + "$id": "72", + "kind": "enumvalue", + "name": "MemoryOptimized", + "value": "MemoryOptimized", + "valueType": { + "$id": "73", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "66" + }, + "doc": "Memory optimized VM sizes offer a high memory-to-CPU ratio that is great for relational database servers, medium to large caches, and in-memory analytics.", + "decorators": [] + }, + { + "$id": "74", + "kind": "enumvalue", + "name": "StorageOptimized", + "value": "StorageOptimized", + "valueType": { + "$id": "75", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "66" + }, + "doc": "Storage optimized virtual machine (VM) sizes offer high disk throughput and IO, and are ideal for Big Data, SQL, NoSQL databases, data warehousing, and large transactional databases. \nExamples include Cassandra, MongoDB, Cloudera, and Redis.", + "decorators": [] + }, + { + "$id": "76", + "kind": "enumvalue", + "name": "GpuAccelerated", + "value": "GpuAccelerated", + "valueType": { + "$id": "77", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "66" + }, + "doc": "GPU optimized VM sizes are specialized virtual machines available with single, multiple, or fractional GPUs. \nThese sizes are designed for compute-intensive, graphics-intensive, and visualization workloads.", + "decorators": [] + }, + { + "$id": "78", + "kind": "enumvalue", + "name": "FpgaAccelerated", + "value": "FpgaAccelerated", + "valueType": { + "$id": "79", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "66" + }, + "doc": "FPGA optimized VM sizes are specialized virtual machines available with single or multiple FPGA. \nThese sizes are designed for compute-intensive workloads. This article provides information about the number and type of FPGA, vCPUs, data disks, and NICs. \nStorage throughput and network bandwidth are also included for each size in this grouping.", + "decorators": [] + }, + { + "$id": "80", + "kind": "enumvalue", + "name": "HighPerformanceCompute", + "value": "HighPerformanceCompute", + "valueType": { + "$id": "81", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "66" + }, + "doc": "Azure High Performance Compute VMs are optimized for various HPC workloads such as computational fluid dynamics, finite element analysis, frontend and backend EDA, \nrendering, molecular dynamics, computational geo science, weather simulation, and financial risk analysis.", + "decorators": [] + } + ], + "clientNamespace": "Microsoft.AzureFleet", + "doc": "VMCategories defined for Azure VMs.\nSee: https://learn.microsoft.com/en-us/azure/virtual-machines/sizes/overview?tabs=breakdownseries%2Cgeneralsizelist%2Ccomputesizelist%2Cmemorysizelist%2Cstoragesizelist%2Cgpusizelist%2Cfpgasizelist%2Chpcsizelist#general-purpose", + "isFixed": false, + "isFlags": false, + "usage": "Input,Output,Json,LroInitial,LroPolling,LroFinalEnvelope", + "decorators": [] + }, + { + "$id": "82", + "kind": "enum", + "name": "ArchitectureType", + "crossLanguageDefinitionId": "Microsoft.AzureFleet.ArchitectureType", + "valueType": { + "$id": "83", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "84", + "kind": "enumvalue", + "name": "ARM64", + "value": "ARM64", + "valueType": { + "$id": "85", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "82" + }, + "doc": "ARM64 Architecture", + "decorators": [] + }, + { + "$id": "86", + "kind": "enumvalue", + "name": "X64", + "value": "X64", + "valueType": { + "$id": "87", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "82" + }, + "doc": "X64 Architecture", + "decorators": [] + } + ], + "clientNamespace": "Microsoft.AzureFleet", + "doc": "Architecture types supported by Azure VMs.", + "isFixed": false, + "isFlags": false, + "usage": "Input,Output,Json,LroInitial,LroPolling,LroFinalEnvelope", + "decorators": [] + }, + { + "$id": "88", + "kind": "enum", + "name": "CpuManufacturer", + "crossLanguageDefinitionId": "Microsoft.AzureFleet.CpuManufacturer", + "valueType": { + "$id": "89", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "90", + "kind": "enumvalue", + "name": "Intel", + "value": "Intel", + "valueType": { + "$id": "91", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "88" + }, + "doc": "Intel CPU.", + "decorators": [] + }, + { + "$id": "92", + "kind": "enumvalue", + "name": "AMD", + "value": "AMD", + "valueType": { + "$id": "93", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "88" + }, + "doc": "AMD CPU.", + "decorators": [] + }, + { + "$id": "94", + "kind": "enumvalue", + "name": "Microsoft", + "value": "Microsoft", + "valueType": { + "$id": "95", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "88" + }, + "doc": "Microsoft CPU.", + "decorators": [] + }, + { + "$id": "96", + "kind": "enumvalue", + "name": "Ampere", + "value": "Ampere", + "valueType": { + "$id": "97", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "88" + }, + "doc": "Ampere CPU.", + "decorators": [] + } + ], + "clientNamespace": "Microsoft.AzureFleet", + "doc": "Cpu Manufacturers supported by Azure VMs.", + "isFixed": false, + "isFlags": false, + "usage": "Input,Output,Json,LroInitial,LroPolling,LroFinalEnvelope", + "decorators": [] + }, + { + "$id": "98", + "kind": "enum", + "name": "WindowsSetupAdditionalInformation_passName", + "valueType": { + "$id": "99", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "100", + "kind": "enumvalue", + "name": "OobeSystem", + "value": "OobeSystem", + "doc": "OobeSystem", + "valueType": { + "$ref": "99" + }, + "enumType": { + "$ref": "98" + } + } + ], + "crossLanguageDefinitionId": "", + "clientNamespace": "Microsoft.AzureFleet", + "doc": "The WindowsSetupAdditionalInformation_passName", + "isFixed": false, + "isFlags": false, + "usage": "Input,Output,Json,LroInitial,LroPolling,LroFinalEnvelope", + "decorators": [] + }, + { + "$id": "101", + "kind": "enum", + "name": "WindowsSetupAdditionalInformation_componentName", + "valueType": { + "$id": "102", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "103", + "kind": "enumvalue", + "name": "Microsoft-Windows-Shell-Setup", + "value": "Microsoft-Windows-Shell-Setup", + "doc": "Microsoft-Windows-Shell-Setup", + "valueType": { + "$ref": "102" + }, + "enumType": { + "$ref": "101" + } + } + ], + "crossLanguageDefinitionId": "", + "clientNamespace": "Microsoft.AzureFleet", + "doc": "The WindowsSetupAdditionalInformation_componentName", + "isFixed": false, + "isFlags": false, + "usage": "Input,Output,Json,LroInitial,LroPolling,LroFinalEnvelope", + "decorators": [] + }, + { + "$id": "104", + "kind": "enum", + "name": "AdditionalInformationSettingNames", + "crossLanguageDefinitionId": "Microsoft.AzureFleet.SettingNames", + "valueType": { + "$id": "105", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "106", + "kind": "enumvalue", + "name": "AutoLogon", + "value": "AutoLogon", + "valueType": { + "$id": "107", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "104" + }, + "doc": "AutoLogon setting", + "decorators": [] + }, + { + "$id": "108", + "kind": "enumvalue", + "name": "FirstLogonCommands", + "value": "FirstLogonCommands", + "valueType": { + "$id": "109", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "104" + }, + "doc": "FirstLogonCommands setting", + "decorators": [] + } + ], + "clientNamespace": "Microsoft.AzureFleet", + "doc": "Specifies the name of the setting to which the content applies. Possible values\nare: FirstLogonCommands and AutoLogon.", + "isFixed": false, + "isFlags": false, + "usage": "Input,Output,Json,LroInitial,LroPolling,LroFinalEnvelope", + "decorators": [] + }, + { + "$id": "110", + "kind": "enum", + "name": "ComputeFleetWindowsVMGuestPatchMode", + "crossLanguageDefinitionId": "Microsoft.AzureFleet.WindowsVMGuestPatchMode", + "valueType": { + "$id": "111", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "112", + "kind": "enumvalue", + "name": "Manual", + "value": "Manual", + "valueType": { + "$id": "113", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "110" + }, + "doc": "You control the application of patches to a virtual machine.\nYou do this by applying patches manually inside the VM. In this mode,\nautomatic updates are disabled; the property WindowsConfiguration.enableAutomaticUpdates\nmust be false", + "decorators": [] + }, + { + "$id": "114", + "kind": "enumvalue", + "name": "AutomaticByOS", + "value": "AutomaticByOS", + "valueType": { + "$id": "115", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "110" + }, + "doc": "The virtual machine will automatically be updated by the OS.\nThe property WindowsConfiguration.enableAutomaticUpdates must be true.", + "decorators": [] + }, + { + "$id": "116", + "kind": "enumvalue", + "name": "AutomaticByPlatform", + "value": "AutomaticByPlatform", + "valueType": { + "$id": "117", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "110" + }, + "doc": "The virtual machine will automatically updated by the platform. The properties\nprovisionVMAgent and WindowsConfiguration.enableAutomaticUpdates must be true.", + "decorators": [] + } + ], + "clientNamespace": "Microsoft.AzureFleet", + "doc": "Specifies the mode of VM Guest Patching to IaaS virtual machine or virtual\nmachines associated to virtual machine scale set with OrchestrationMode as\nFlexible.", + "isFixed": false, + "isFlags": false, + "usage": "Input,Output,Json,LroInitial,LroPolling,LroFinalEnvelope", + "decorators": [] + }, + { + "$id": "118", + "kind": "enum", + "name": "ComputeFleetWindowsPatchAssessmentMode", + "crossLanguageDefinitionId": "Microsoft.AzureFleet.WindowsPatchAssessmentMode", + "valueType": { + "$id": "119", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "120", + "kind": "enumvalue", + "name": "ImageDefault", + "value": "ImageDefault", + "valueType": { + "$id": "121", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "118" + }, + "doc": "You control the timing of patch assessments on a virtual machine.", + "decorators": [] + }, + { + "$id": "122", + "kind": "enumvalue", + "name": "AutomaticByPlatform", + "value": "AutomaticByPlatform", + "valueType": { + "$id": "123", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "118" + }, + "doc": "The platform will trigger periodic patch assessments. The property provisionVMAgent must be true.", + "decorators": [] + } + ], + "clientNamespace": "Microsoft.AzureFleet", + "doc": "Specifies the mode of VM Guest patch assessment for the IaaS virtual machine.", + "isFixed": false, + "isFlags": false, + "usage": "Input,Output,Json,LroInitial,LroPolling,LroFinalEnvelope", + "decorators": [] + }, + { + "$id": "124", + "kind": "enum", + "name": "ComputeFleetWindowsVMGuestPatchAutomaticByPlatformRebootSetting", + "crossLanguageDefinitionId": "Microsoft.AzureFleet.WindowsVMGuestPatchAutomaticByPlatformRebootSetting", + "valueType": { + "$id": "125", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "126", + "kind": "enumvalue", + "name": "Unknown", + "value": "Unknown", + "valueType": { + "$id": "127", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "124" + }, + "doc": "Unknown Reboot setting", + "decorators": [] + }, + { + "$id": "128", + "kind": "enumvalue", + "name": "IfRequired", + "value": "IfRequired", + "valueType": { + "$id": "129", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "124" + }, + "doc": "IfRequired Reboot setting", + "decorators": [] + }, + { + "$id": "130", + "kind": "enumvalue", + "name": "Never", + "value": "Never", + "valueType": { + "$id": "131", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "124" + }, + "doc": "Never Reboot setting", + "decorators": [] + }, + { + "$id": "132", + "kind": "enumvalue", + "name": "Always", + "value": "Always", + "valueType": { + "$id": "133", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "124" + }, + "doc": "Always Reboot setting", + "decorators": [] + } + ], + "clientNamespace": "Microsoft.AzureFleet", + "doc": "Specifies the reboot setting for all AutomaticByPlatform patch installation operations.", + "isFixed": false, + "isFlags": false, + "usage": "Input,Output,Json,LroInitial,LroPolling,LroFinalEnvelope", + "decorators": [] + }, + { + "$id": "134", + "kind": "enum", + "name": "ComputeFleetProtocolTypes", + "crossLanguageDefinitionId": "Microsoft.AzureFleet.ProtocolTypes", + "valueType": { + "$id": "135", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "136", + "kind": "enumvalue", + "name": "Http", + "value": "Http", + "valueType": { + "$id": "137", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "134" + }, + "doc": "Http protocol", + "decorators": [] + }, + { + "$id": "138", + "kind": "enumvalue", + "name": "Https", + "value": "Https", + "valueType": { + "$id": "139", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "134" + }, + "doc": "Https protocol", + "decorators": [] + } + ], + "clientNamespace": "Microsoft.AzureFleet", + "doc": "Specifies the protocol of WinRM listener. Possible values are: **http,**\n**https.**", + "isFixed": false, + "isFlags": false, + "usage": "Input,Output,Json,LroInitial,LroPolling,LroFinalEnvelope", + "decorators": [] + }, + { + "$id": "140", + "kind": "enum", + "name": "ComputeFleetLinuxVMGuestPatchMode", + "crossLanguageDefinitionId": "Microsoft.AzureFleet.LinuxVMGuestPatchMode", + "valueType": { + "$id": "141", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "142", + "kind": "enumvalue", + "name": "ImageDefault", + "value": "ImageDefault", + "valueType": { + "$id": "143", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "140" + }, + "doc": "The virtual machine's default patching configuration is used.", + "decorators": [] + }, + { + "$id": "144", + "kind": "enumvalue", + "name": "AutomaticByPlatform", + "value": "AutomaticByPlatform", + "valueType": { + "$id": "145", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "140" + }, + "doc": "The virtual machine will be automatically updated by the platform. The property provisionVMAgent must be true.", + "decorators": [] + } + ], + "clientNamespace": "Microsoft.AzureFleet", + "doc": "Specifies the mode of VM Guest Patching to IaaS virtual machine or virtual\nmachines associated to virtual machine scale set with OrchestrationMode as\nFlexible.", + "isFixed": false, + "isFlags": false, + "usage": "Input,Output,Json,LroInitial,LroPolling,LroFinalEnvelope", + "decorators": [] + }, + { + "$id": "146", + "kind": "enum", + "name": "ComputeFleetLinuxPatchAssessmentMode", + "crossLanguageDefinitionId": "Microsoft.AzureFleet.LinuxPatchAssessmentMode", + "valueType": { + "$id": "147", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "148", + "kind": "enumvalue", + "name": "ImageDefault", + "value": "ImageDefault", + "valueType": { + "$id": "149", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "146" + }, + "doc": "You control the timing of patch assessments on a virtual machine.", + "decorators": [] + }, + { + "$id": "150", + "kind": "enumvalue", + "name": "AutomaticByPlatform", + "value": "AutomaticByPlatform", + "valueType": { + "$id": "151", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "146" + }, + "doc": "The platform will trigger periodic patch assessments.The property provisionVMAgent must be true.", + "decorators": [] + } + ], + "clientNamespace": "Microsoft.AzureFleet", + "doc": "Specifies the mode of VM Guest Patch Assessment for the IaaS virtual\nmachine.

Possible values are:

**ImageDefault** - You\ncontrol the timing of patch assessments on a virtual machine.

\n**AutomaticByPlatform** - The platform will trigger periodic patch assessments.\nThe property provisionVMAgent must be true.", + "isFixed": false, + "isFlags": false, + "usage": "Input,Output,Json,LroInitial,LroPolling,LroFinalEnvelope", + "decorators": [] + }, + { + "$id": "152", + "kind": "enum", + "name": "ComputeFleetLinuxVMGuestPatchAutomaticByPlatformRebootSetting", + "crossLanguageDefinitionId": "Microsoft.AzureFleet.LinuxVMGuestPatchAutomaticByPlatformRebootSetting", + "valueType": { + "$id": "153", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "154", + "kind": "enumvalue", + "name": "Unknown", + "value": "Unknown", + "valueType": { + "$id": "155", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "152" + }, + "doc": "Unknown Reboot setting", + "decorators": [] + }, + { + "$id": "156", + "kind": "enumvalue", + "name": "IfRequired", + "value": "IfRequired", + "valueType": { + "$id": "157", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "152" + }, + "doc": "IfRequired Reboot setting", + "decorators": [] + }, + { + "$id": "158", + "kind": "enumvalue", + "name": "Never", + "value": "Never", + "valueType": { + "$id": "159", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "152" + }, + "doc": "Never Reboot setting", + "decorators": [] + }, + { + "$id": "160", + "kind": "enumvalue", + "name": "Always", + "value": "Always", + "valueType": { + "$id": "161", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "152" + }, + "doc": "Always Reboot setting", + "decorators": [] + } + ], + "clientNamespace": "Microsoft.AzureFleet", + "doc": "Specifies the reboot setting for all AutomaticByPlatform patch installation\noperations.", + "isFixed": false, + "isFlags": false, + "usage": "Input,Output,Json,LroInitial,LroPolling,LroFinalEnvelope", + "decorators": [] + }, + { + "$id": "162", + "kind": "enum", + "name": "ComputeFleetCachingTypes", + "crossLanguageDefinitionId": "Microsoft.AzureFleet.CachingTypes", + "valueType": { + "$id": "163", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "164", + "kind": "enumvalue", + "name": "None", + "value": "None", + "valueType": { + "$id": "165", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "162" + }, + "doc": "'None' is default for Standard Storage", + "decorators": [] + }, + { + "$id": "166", + "kind": "enumvalue", + "name": "ReadOnly", + "value": "ReadOnly", + "valueType": { + "$id": "167", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "162" + }, + "doc": "'ReadOnly' is default for Premium Storage", + "decorators": [] + }, + { + "$id": "168", + "kind": "enumvalue", + "name": "ReadWrite", + "value": "ReadWrite", + "valueType": { + "$id": "169", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "162" + }, + "doc": "'ReadWrite' is default for OS Disk", + "decorators": [] + } + ], + "clientNamespace": "Microsoft.AzureFleet", + "doc": "Specifies the caching requirements.", + "isFixed": false, + "isFlags": false, + "usage": "Input,Output,Json,LroInitial,LroPolling,LroFinalEnvelope", + "decorators": [] + }, + { + "$id": "170", + "kind": "enum", + "name": "ComputeFleetDiskCreateOptionTypes", + "crossLanguageDefinitionId": "Microsoft.AzureFleet.DiskCreateOptionTypes", + "valueType": { + "$id": "171", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "172", + "kind": "enumvalue", + "name": "FromImage", + "value": "FromImage", + "valueType": { + "$id": "173", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "170" + }, + "doc": "This value is used when you are using an image to create the virtual machine.\nIf you are using a platform image, you also use the imageReference element\ndescribed above. If you are using a marketplace image, you also use the\nplan element previously described.", + "decorators": [] + }, + { + "$id": "174", + "kind": "enumvalue", + "name": "Empty", + "value": "Empty", + "valueType": { + "$id": "175", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "170" + }, + "doc": "This value is used when creating an empty data disk.", + "decorators": [] + }, + { + "$id": "176", + "kind": "enumvalue", + "name": "Attach", + "value": "Attach", + "valueType": { + "$id": "177", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "170" + }, + "doc": "This value is used when you are using a specialized disk to create the virtual machine.", + "decorators": [] + }, + { + "$id": "178", + "kind": "enumvalue", + "name": "Copy", + "value": "Copy", + "valueType": { + "$id": "179", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "170" + }, + "doc": "This value is used to create a data disk from a snapshot or another disk.", + "decorators": [] + }, + { + "$id": "180", + "kind": "enumvalue", + "name": "Restore", + "value": "Restore", + "valueType": { + "$id": "181", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "170" + }, + "doc": "This value is used to create a data disk from a disk restore point.", + "decorators": [] + } + ], + "clientNamespace": "Microsoft.AzureFleet", + "doc": "Specifies how the virtual machine should be created.", + "isFixed": false, + "isFlags": false, + "usage": "Input,Output,Json,LroInitial,LroPolling,LroFinalEnvelope", + "decorators": [] + }, + { + "$id": "182", + "kind": "enum", + "name": "ComputeFleetDiffDiskOptions", + "crossLanguageDefinitionId": "Microsoft.AzureFleet.DiffDiskOptions", + "valueType": { + "$id": "183", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "184", + "kind": "enumvalue", + "name": "Local", + "value": "Local", + "valueType": { + "$id": "185", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "182" + }, + "doc": "Local Option.", + "decorators": [] + } + ], + "clientNamespace": "Microsoft.AzureFleet", + "doc": "Specifies the ephemeral disk option for operating system disk.", + "isFixed": false, + "isFlags": false, + "usage": "Input,Output,Json,LroInitial,LroPolling,LroFinalEnvelope", + "decorators": [] + }, + { + "$id": "186", + "kind": "enum", + "name": "ComputeFleetDiffDiskPlacement", + "crossLanguageDefinitionId": "Microsoft.AzureFleet.DiffDiskPlacement", + "valueType": { + "$id": "187", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "188", + "kind": "enumvalue", + "name": "CacheDisk", + "value": "CacheDisk", + "valueType": { + "$id": "189", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "186" + }, + "doc": "CacheDisk option.", + "decorators": [] + }, + { + "$id": "190", + "kind": "enumvalue", + "name": "ResourceDisk", + "value": "ResourceDisk", + "valueType": { + "$id": "191", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "186" + }, + "doc": "Resource Disk option.", + "decorators": [] + }, + { + "$id": "192", + "kind": "enumvalue", + "name": "NvmeDisk", + "value": "NvmeDisk", + "valueType": { + "$id": "193", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "186" + }, + "doc": "NvmeDisk option.", + "decorators": [] + } + ], + "clientNamespace": "Microsoft.AzureFleet", + "doc": "Specifies the ephemeral disk placement for operating system disk. This property\ncan be used by user in the request to choose the location i.e, cache disk or\nresource disk space for Ephemeral OS disk provisioning. For more information on\nEphemeral OS disk size requirements, please refer Ephemeral OS disk size\nrequirements for Windows VM at\nhttps://learn.microsoft.com/azure/virtual-machines/windows/ephemeral-os-disks#size-requirements\nand Linux VM at\nhttps://learn.microsoft.com/azure/virtual-machines/linux/ephemeral-os-disks#size-requirements\nMinimum api-version for NvmeDisk: 2024-03-01.", + "isFixed": false, + "isFlags": false, + "usage": "Input,Output,Json,LroInitial,LroPolling,LroFinalEnvelope", + "decorators": [] + }, + { + "$id": "194", + "kind": "enum", + "name": "ComputeFleetOperatingSystemTypes", + "crossLanguageDefinitionId": "Microsoft.AzureFleet.OperatingSystemTypes", + "valueType": { + "$id": "195", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "196", + "kind": "enumvalue", + "name": "Windows", + "value": "Windows", + "valueType": { + "$id": "197", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "194" + }, + "doc": "Windows OS type", + "decorators": [] + }, + { + "$id": "198", + "kind": "enumvalue", + "name": "Linux", + "value": "Linux", + "valueType": { + "$id": "199", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "194" + }, + "doc": "Linux OS type", + "decorators": [] + } + ], + "clientNamespace": "Microsoft.AzureFleet", + "doc": "This property allows you to specify the type of the OS that is included in the\ndisk if creating a VM from user-image or a specialized VHD. Possible values\nare: **Windows,** **Linux.**", + "isFixed": false, + "isFlags": false, + "usage": "Input,Output,Json,LroInitial,LroPolling,LroFinalEnvelope", + "decorators": [] + }, + { + "$id": "200", + "kind": "enum", + "name": "ComputeFleetStorageAccountTypes", + "crossLanguageDefinitionId": "Microsoft.AzureFleet.StorageAccountTypes", + "valueType": { + "$id": "201", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "202", + "kind": "enumvalue", + "name": "StandardLrs", + "value": "Standard_LRS", + "valueType": { + "$id": "203", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "200" + }, + "doc": "Standard_LRS option.", + "decorators": [] + }, + { + "$id": "204", + "kind": "enumvalue", + "name": "PremiumLrs", + "value": "Premium_LRS", + "valueType": { + "$id": "205", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "200" + }, + "doc": "Premium_LRS option.", + "decorators": [] + }, + { + "$id": "206", + "kind": "enumvalue", + "name": "StandardSsdLrd", + "value": "StandardSSD_LRS", + "valueType": { + "$id": "207", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "200" + }, + "doc": "StandardSSD_LRS option.", + "decorators": [] + }, + { + "$id": "208", + "kind": "enumvalue", + "name": "UltraSsdLrs", + "value": "UltraSSD_LRS", + "valueType": { + "$id": "209", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "200" + }, + "doc": "UltraSSD_LRS option.", + "decorators": [] + }, + { + "$id": "210", + "kind": "enumvalue", + "name": "PremiumZrs", + "value": "Premium_ZRS", + "valueType": { + "$id": "211", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "200" + }, + "doc": "Premium_ZRS option.", + "decorators": [] + }, + { + "$id": "212", + "kind": "enumvalue", + "name": "StandardSsdZrs", + "value": "StandardSSD_ZRS", + "valueType": { + "$id": "213", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "200" + }, + "doc": "StandardSSD_ZRS option.", + "decorators": [] + }, + { + "$id": "214", + "kind": "enumvalue", + "name": "PremiumV2_LRS", + "value": "PremiumV2_LRS", + "valueType": { + "$id": "215", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "200" + }, + "doc": "PremiumV2_LRS option.", + "decorators": [] + } + ], + "clientNamespace": "Microsoft.AzureFleet", + "doc": "Specifies the storage account type for the managed disk. Managed OS disk\nstorage account type can only be set when you create the scale set. NOTE:\nUltraSSD_LRS can only be used with data disks. It cannot be used with OS Disk.\nStandard_LRS uses Standard HDD. StandardSSD_LRS uses Standard SSD. Premium_LRS\nuses Premium SSD. UltraSSD_LRS uses Ultra disk. Premium_ZRS uses Premium SSD\nzone redundant storage. StandardSSD_ZRS uses Standard SSD zone redundant\nstorage. For more information regarding disks supported for Windows Virtual\nMachines, refer to\nhttps://learn.microsoft.com/azure/virtual-machines/windows/disks-types and, for\nLinux Virtual Machines, refer to\nhttps://learn.microsoft.com/azure/virtual-machines/linux/disks-types", + "isFixed": false, + "isFlags": false, + "usage": "Input,Output,Json,LroInitial,LroPolling,LroFinalEnvelope", + "decorators": [] + }, + { + "$id": "216", + "kind": "enum", + "name": "ComputeFleetSecurityEncryptionTypes", + "crossLanguageDefinitionId": "Microsoft.AzureFleet.SecurityEncryptionTypes", + "valueType": { + "$id": "217", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "218", + "kind": "enumvalue", + "name": "VMGuestStateOnly", + "value": "VMGuestStateOnly", + "valueType": { + "$id": "219", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "216" + }, + "doc": "EncryptionType of the managed disk is set to VMGuestStateOnly for encryption\nof just the VMGuestState blob.", + "decorators": [] + }, + { + "$id": "220", + "kind": "enumvalue", + "name": "DiskWithVMGuestState", + "value": "DiskWithVMGuestState", + "valueType": { + "$id": "221", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "216" + }, + "doc": "EncryptionType of the managed disk is set to DiskWithVMGuestState for encryption\nof the managed disk along with VMGuestState blob.", + "decorators": [] + }, + { + "$id": "222", + "kind": "enumvalue", + "name": "NonPersistedTpm", + "value": "NonPersistedTPM", + "valueType": { + "$id": "223", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "216" + }, + "doc": "EncryptionType of the managed disk is set to NonPersistedTPM for not persisting\nfirmware state in the VMGuestState blob.", + "decorators": [] + } + ], + "clientNamespace": "Microsoft.AzureFleet", + "doc": "Specifies the EncryptionType of the managed disk.\n**Note:** It can be set for only Confidential VMs.", + "isFixed": false, + "isFlags": false, + "usage": "Input,Output,Json,LroInitial,LroPolling,LroFinalEnvelope", + "decorators": [] + }, + { + "$id": "224", + "kind": "enum", + "name": "ComputeFleetDiskDeleteOptionTypes", + "crossLanguageDefinitionId": "Microsoft.AzureFleet.DiskDeleteOptionTypes", + "valueType": { + "$id": "225", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "226", + "kind": "enumvalue", + "name": "Delete", + "value": "Delete", + "valueType": { + "$id": "227", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "224" + }, + "doc": "If this value is used, the managed disk is deleted when VM gets deleted.", + "decorators": [] + }, + { + "$id": "228", + "kind": "enumvalue", + "name": "Detach", + "value": "Detach", + "valueType": { + "$id": "229", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "224" + }, + "doc": "If this value is used, the managed disk is retained after VM gets deleted.", + "decorators": [] + } + ], + "clientNamespace": "Microsoft.AzureFleet", + "doc": "Specifies the behavior of the managed disk when the VM gets deleted, for\nexample whether the managed disk is deleted or detached. Supported values are:\n**Delete.** If this value is used, the managed disk is deleted when VM gets\ndeleted. **Detach.** If this value is used, the managed disk is retained after\nVM gets deleted. Minimum api-version: 2021-03-01.", + "isFixed": false, + "isFlags": false, + "usage": "Input,Output,Json,LroInitial,LroPolling,LroFinalEnvelope", + "decorators": [] + }, + { + "$id": "230", + "kind": "enum", + "name": "ComputeFleetDiskControllerTypes", + "crossLanguageDefinitionId": "Microsoft.AzureFleet.DiskControllerTypes", + "valueType": { + "$id": "231", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "232", + "kind": "enumvalue", + "name": "Scsi", + "value": "SCSI", + "valueType": { + "$id": "233", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "230" + }, + "doc": "SCSI disk type", + "decorators": [] + }, + { + "$id": "234", + "kind": "enumvalue", + "name": "Nvme", + "value": "NVMe", + "valueType": { + "$id": "235", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "230" + }, + "doc": "NVMe disk type", + "decorators": [] + } + ], + "clientNamespace": "Microsoft.AzureFleet", + "doc": "Specifies the disk controller type configured for the VM and\nVirtualMachineScaleSet. This property is only supported for virtual machines\nwhose operating system disk and VM sku supports Generation 2\n(https://learn.microsoft.com/en-us/azure/virtual-machines/generation-2), please\ncheck the HyperVGenerations capability returned as part of VM sku capabilities\nin the response of Microsoft.Compute SKUs api for the region contains V2\n(https://learn.microsoft.com/rest/api/compute/resourceskus/list). For more\ninformation about Disk Controller Types supported please refer to\nhttps://aka.ms/azure-diskcontrollertypes.", + "isFixed": false, + "isFlags": false, + "usage": "Input,Output,Json,LroInitial,LroPolling,LroFinalEnvelope", + "decorators": [] + }, + { + "$id": "236", + "kind": "enum", + "name": "ComputeFleetDomainNameLabelScopeTypes", + "crossLanguageDefinitionId": "Microsoft.AzureFleet.DomainNameLabelScopeTypes", + "valueType": { + "$id": "237", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "238", + "kind": "enumvalue", + "name": "TenantReuse", + "value": "TenantReuse", + "valueType": { + "$id": "239", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "236" + }, + "doc": "TenantReuse type", + "decorators": [] + }, + { + "$id": "240", + "kind": "enumvalue", + "name": "SubscriptionReuse", + "value": "SubscriptionReuse", + "valueType": { + "$id": "241", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "236" + }, + "doc": "SubscriptionReuse type", + "decorators": [] + }, + { + "$id": "242", + "kind": "enumvalue", + "name": "ResourceGroupReuse", + "value": "ResourceGroupReuse", + "valueType": { + "$id": "243", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "236" + }, + "doc": "ResourceGroupReuse type", + "decorators": [] + }, + { + "$id": "244", + "kind": "enumvalue", + "name": "NoReuse", + "value": "NoReuse", + "valueType": { + "$id": "245", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "236" + }, + "doc": "NoReuse type", + "decorators": [] + } + ], + "clientNamespace": "Microsoft.AzureFleet", + "doc": "The Domain name label scope.The concatenation of the hashed domain name label\nthat generated according to the policy from domain name label scope and vm\nindex will be the domain name labels of the PublicIPAddress resources that will\nbe created", + "isFixed": false, + "isFlags": false, + "usage": "Input,Output,Json,LroInitial,LroPolling,LroFinalEnvelope", + "decorators": [] + }, + { + "$id": "246", + "kind": "enum", + "name": "ComputeFleetIPVersion", + "crossLanguageDefinitionId": "Microsoft.AzureFleet.IPVersion", + "valueType": { + "$id": "247", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "248", + "kind": "enumvalue", + "name": "IPv4", + "value": "IPv4", + "valueType": { + "$id": "249", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "246" + }, + "doc": "IPv4 version", + "decorators": [] + }, + { + "$id": "250", + "kind": "enumvalue", + "name": "IPv6", + "value": "IPv6", + "valueType": { + "$id": "251", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "246" + }, + "doc": "IPv6 version", + "decorators": [] + } + ], + "clientNamespace": "Microsoft.AzureFleet", + "doc": "Available from Api-Version 2017-03-30 onwards, it represents whether the\nspecific ipconfiguration is IPv4 or IPv6. Default is taken as IPv4. Possible\nvalues are: 'IPv4' and 'IPv6'.", + "isFixed": false, + "isFlags": false, + "usage": "Input,Output,Json,LroInitial,LroPolling,LroFinalEnvelope", + "decorators": [] + }, + { + "$id": "252", + "kind": "enum", + "name": "ComputeFleetVmDeleteOptions", + "crossLanguageDefinitionId": "Microsoft.AzureFleet.DeleteOptions", + "valueType": { + "$id": "253", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "254", + "kind": "enumvalue", + "name": "Delete", + "value": "Delete", + "valueType": { + "$id": "255", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "252" + }, + "doc": "Delete Option", + "decorators": [] + }, + { + "$id": "256", + "kind": "enumvalue", + "name": "Detach", + "value": "Detach", + "valueType": { + "$id": "257", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "252" + }, + "doc": "Detach Option", + "decorators": [] + } + ], + "clientNamespace": "Microsoft.AzureFleet", + "doc": "Specify what happens to the network interface when the VM is deleted", + "isFixed": false, + "isFlags": false, + "usage": "Input,Output,Json,LroInitial,LroPolling,LroFinalEnvelope", + "decorators": [] + }, + { + "$id": "258", + "kind": "enum", + "name": "ComputeFleetPublicIPAddressSkuName", + "crossLanguageDefinitionId": "Microsoft.AzureFleet.PublicIPAddressSkuName", + "valueType": { + "$id": "259", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "260", + "kind": "enumvalue", + "name": "Basic", + "value": "Basic", + "valueType": { + "$id": "261", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "258" + }, + "doc": "Basic sku name", + "decorators": [] + }, + { + "$id": "262", + "kind": "enumvalue", + "name": "Standard", + "value": "Standard", + "valueType": { + "$id": "263", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "258" + }, + "doc": "Standard sku name", + "decorators": [] + } + ], + "clientNamespace": "Microsoft.AzureFleet", + "doc": "Specify public IP sku name.", + "isFixed": false, + "isFlags": false, + "usage": "Input,Output,Json,LroInitial,LroPolling,LroFinalEnvelope", + "decorators": [] + }, + { + "$id": "264", + "kind": "enum", + "name": "ComputeFleetPublicIPAddressSkuTier", + "crossLanguageDefinitionId": "Microsoft.AzureFleet.PublicIPAddressSkuTier", + "valueType": { + "$id": "265", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "266", + "kind": "enumvalue", + "name": "Regional", + "value": "Regional", + "valueType": { + "$id": "267", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "264" + }, + "doc": "Regional sku tier", + "decorators": [] + }, + { + "$id": "268", + "kind": "enumvalue", + "name": "Global", + "value": "Global", + "valueType": { + "$id": "269", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "264" + }, + "doc": "Global sku tier", + "decorators": [] + } + ], + "clientNamespace": "Microsoft.AzureFleet", + "doc": "Specify public IP sku tier", + "isFixed": false, + "isFlags": false, + "usage": "Input,Output,Json,LroInitial,LroPolling,LroFinalEnvelope", + "decorators": [] + }, + { + "$id": "270", + "kind": "enum", + "name": "ComputeFleetNetworkInterfaceAuxiliaryMode", + "crossLanguageDefinitionId": "Microsoft.AzureFleet.NetworkInterfaceAuxiliaryMode", + "valueType": { + "$id": "271", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "272", + "kind": "enumvalue", + "name": "None", + "value": "None", + "valueType": { + "$id": "273", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "270" + }, + "doc": "None Mode", + "decorators": [] + }, + { + "$id": "274", + "kind": "enumvalue", + "name": "AcceleratedConnections", + "value": "AcceleratedConnections", + "valueType": { + "$id": "275", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "270" + }, + "doc": "AcceleratedConnections Mode", + "decorators": [] + }, + { + "$id": "276", + "kind": "enumvalue", + "name": "Floating", + "value": "Floating", + "valueType": { + "$id": "277", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "270" + }, + "doc": "Floating Mode", + "decorators": [] + } + ], + "clientNamespace": "Microsoft.AzureFleet", + "doc": "Specifies whether the Auxiliary mode is enabled for the Network Interface\nresource.", + "isFixed": false, + "isFlags": false, + "usage": "Input,Output,Json,LroInitial,LroPolling,LroFinalEnvelope", + "decorators": [] + }, + { + "$id": "278", + "kind": "enum", + "name": "ComputeFleetNetworkInterfaceAuxiliarySku", + "crossLanguageDefinitionId": "Microsoft.AzureFleet.NetworkInterfaceAuxiliarySku", + "valueType": { + "$id": "279", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "280", + "kind": "enumvalue", + "name": "None", + "value": "None", + "valueType": { + "$id": "281", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "278" + }, + "doc": "no sku", + "decorators": [] + }, + { + "$id": "282", + "kind": "enumvalue", + "name": "A1", + "value": "A1", + "valueType": { + "$id": "283", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "278" + }, + "doc": "A1 sku", + "decorators": [] + }, + { + "$id": "284", + "kind": "enumvalue", + "name": "A2", + "value": "A2", + "valueType": { + "$id": "285", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "278" + }, + "doc": "A2 sku", + "decorators": [] + }, + { + "$id": "286", + "kind": "enumvalue", + "name": "A4", + "value": "A4", + "valueType": { + "$id": "287", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "278" + }, + "doc": "A4 sku", + "decorators": [] + }, + { + "$id": "288", + "kind": "enumvalue", + "name": "A8", + "value": "A8", + "valueType": { + "$id": "289", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "278" + }, + "doc": "A8 sku", + "decorators": [] + } + ], + "clientNamespace": "Microsoft.AzureFleet", + "doc": "Specifies whether the Auxiliary sku is enabled for the Network Interface\nresource.", + "isFixed": false, + "isFlags": false, + "usage": "Input,Output,Json,LroInitial,LroPolling,LroFinalEnvelope", + "decorators": [] + }, + { + "$id": "290", + "kind": "enum", + "name": "ComputeFleetNetworkApiVersion", + "crossLanguageDefinitionId": "Microsoft.AzureFleet.NetworkApiVersion", + "valueType": { + "$id": "291", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "292", + "kind": "enumvalue", + "name": "v2020_11_01", + "value": "2020-11-01", + "valueType": { + "$id": "293", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "290" + }, + "doc": "Initial version supported. Later versions are supported as well.", + "decorators": [] + } + ], + "clientNamespace": "Microsoft.AzureFleet", + "doc": "specifies the Microsoft.Network API version used when creating networking\nresources in the Network Interface Configurations for Virtual Machine Scale Set\nwith orchestration mode 'Flexible'", + "isFixed": false, + "isFlags": false, + "usage": "Input,Output,Json,LroInitial,LroPolling,LroFinalEnvelope", + "decorators": [] + }, + { + "$id": "294", + "kind": "enum", + "name": "ComputeFleetSecurityTypes", + "crossLanguageDefinitionId": "Microsoft.AzureFleet.SecurityTypes", + "valueType": { + "$id": "295", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "296", + "kind": "enumvalue", + "name": "TrustedLaunch", + "value": "TrustedLaunch", + "valueType": { + "$id": "297", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "294" + }, + "doc": "TrustedLaunch security type", + "decorators": [] + }, + { + "$id": "298", + "kind": "enumvalue", + "name": "ConfidentialVM", + "value": "ConfidentialVM", + "valueType": { + "$id": "299", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "294" + }, + "doc": "ConfidentialVM security type", + "decorators": [] + } + ], + "clientNamespace": "Microsoft.AzureFleet", + "doc": "Specifies the SecurityType of the virtual machine. It has to be set to any\nspecified value to enable UefiSettings. The default behavior is: UefiSettings\nwill not be enabled unless this property is set.", + "isFixed": false, + "isFlags": false, + "usage": "Input,Output,Json,LroInitial,LroPolling,LroFinalEnvelope", + "decorators": [] + }, + { + "$id": "300", + "kind": "enum", + "name": "ProxyAgentExecuteMode", + "crossLanguageDefinitionId": "Microsoft.AzureFleet.Mode", + "valueType": { + "$id": "301", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "302", + "kind": "enumvalue", + "name": "Audit", + "value": "Audit", + "valueType": { + "$id": "303", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "300" + }, + "doc": "Audit Mode", + "decorators": [] + }, + { + "$id": "304", + "kind": "enumvalue", + "name": "Enforce", + "value": "Enforce", + "valueType": { + "$id": "305", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "300" + }, + "doc": "Enforce Mode", + "decorators": [] + } + ], + "clientNamespace": "Microsoft.AzureFleet", + "doc": "Specifies the mode that ProxyAgent will execute on if the feature is enabled.\nProxyAgent will start to audit or monitor but not enforce access control over\nrequests to host endpoints in Audit mode, while in Enforce mode it will enforce\naccess control. The default value is Enforce mode.", + "isFixed": false, + "isFlags": false, + "usage": "Input,Output,Json,LroInitial,LroPolling,LroFinalEnvelope", + "decorators": [] + }, + { + "$id": "306", + "kind": "enum", + "name": "ManagedServiceIdentityType", + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.ManagedServiceIdentityType", + "valueType": { + "$id": "307", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "308", + "kind": "enumvalue", + "name": "None", + "value": "None", + "valueType": { + "$id": "309", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "306" + }, + "doc": "No managed identity.", + "decorators": [] + }, + { + "$id": "310", + "kind": "enumvalue", + "name": "SystemAssigned", + "value": "SystemAssigned", + "valueType": { + "$id": "311", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "306" + }, + "doc": "System assigned managed identity.", + "decorators": [] + }, + { + "$id": "312", + "kind": "enumvalue", + "name": "UserAssigned", + "value": "UserAssigned", + "valueType": { + "$id": "313", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "306" + }, + "doc": "User assigned managed identity.", + "decorators": [] + }, + { + "$id": "314", + "kind": "enumvalue", + "name": "SystemAssigned,UserAssigned", + "value": "SystemAssigned,UserAssigned", + "valueType": { + "$id": "315", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "306" + }, + "doc": "System and user assigned managed identity.", + "decorators": [] + } + ], + "clientNamespace": "Azure.ResourceManager.CommonTypes", + "doc": "Type of managed service identity (where both SystemAssigned and UserAssigned types are allowed).", + "isFixed": false, + "isFlags": false, + "usage": "Input,Output,Json,LroInitial,LroPolling,LroFinalEnvelope", + "decorators": [] + }, + { + "$id": "316", + "kind": "enum", + "name": "createdByType", + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.createdByType", + "valueType": { + "$id": "317", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "318", + "kind": "enumvalue", + "name": "User", + "value": "User", + "valueType": { + "$id": "319", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "316" + }, + "doc": "The entity was created by a user.", + "decorators": [] + }, + { + "$id": "320", + "kind": "enumvalue", + "name": "Application", + "value": "Application", + "valueType": { + "$id": "321", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "316" + }, + "doc": "The entity was created by an application.", + "decorators": [] + }, + { + "$id": "322", + "kind": "enumvalue", + "name": "ManagedIdentity", + "value": "ManagedIdentity", + "valueType": { + "$id": "323", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "316" + }, + "doc": "The entity was created by a managed identity.", + "decorators": [] + }, + { + "$id": "324", + "kind": "enumvalue", + "name": "Key", + "value": "Key", + "valueType": { + "$id": "325", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "316" + }, + "doc": "The entity was created by a key.", + "decorators": [] + } + ], + "clientNamespace": "Azure.ResourceManager.CommonTypes", + "doc": "The kind of entity that created the resource.", + "isFixed": false, + "isFlags": false, + "usage": "Output,Json,LroInitial,LroPolling,LroFinalEnvelope", + "decorators": [] + }, + { + "$id": "326", + "kind": "enum", + "name": "ResourceProvisioningState", + "crossLanguageDefinitionId": "Azure.ResourceManager.ResourceProvisioningState", + "valueType": { + "$id": "327", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "328", + "kind": "enumvalue", + "name": "Succeeded", + "value": "Succeeded", + "valueType": { + "$id": "329", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "326" + }, + "doc": "Resource has been created.", + "decorators": [] + }, + { + "$id": "330", + "kind": "enumvalue", + "name": "Failed", + "value": "Failed", + "valueType": { + "$id": "331", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "326" + }, + "doc": "Resource creation failed.", + "decorators": [] + }, + { + "$id": "332", + "kind": "enumvalue", + "name": "Canceled", + "value": "Canceled", + "valueType": { + "$id": "333", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "326" + }, + "doc": "Resource creation was canceled.", + "decorators": [] + } + ], + "clientNamespace": "Azure.ResourceManager", + "doc": "The provisioning state of a resource type.", + "isFixed": false, + "isFlags": false, + "usage": "LroPolling", + "decorators": [] + }, + { + "$id": "334", + "kind": "enum", + "name": "Origin", + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.Origin", + "valueType": { + "$id": "335", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "336", + "kind": "enumvalue", + "name": "user", + "value": "user", + "valueType": { + "$id": "337", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "334" + }, + "doc": "Indicates the operation is initiated by a user.", + "decorators": [] + }, + { + "$id": "338", + "kind": "enumvalue", + "name": "system", + "value": "system", + "valueType": { + "$id": "339", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "334" + }, + "doc": "Indicates the operation is initiated by a system.", + "decorators": [] + }, + { + "$id": "340", + "kind": "enumvalue", + "name": "user,system", + "value": "user,system", + "valueType": { + "$id": "341", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "334" + }, + "doc": "Indicates the operation is initiated by a user or system.", + "decorators": [] + } + ], + "clientNamespace": "Azure.ResourceManager.CommonTypes", + "doc": "The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default value is \"user,system\"", + "isFixed": false, + "isFlags": false, + "usage": "Output,Json", + "decorators": [] + }, + { + "$id": "342", + "kind": "enum", + "name": "ActionType", + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.ActionType", + "valueType": { + "$id": "343", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "344", + "kind": "enumvalue", + "name": "Internal", + "value": "Internal", + "valueType": { + "$id": "345", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "342" + }, + "doc": "Actions are for internal-only APIs.", + "decorators": [] + } + ], + "clientNamespace": "Azure.ResourceManager.CommonTypes", + "doc": "Extensible enum. Indicates the action type. \"Internal\" refers to actions that are for internal only APIs.", + "isFixed": false, + "isFlags": false, + "usage": "Output,Json", + "decorators": [] + }, + { + "$id": "346", + "kind": "enum", + "name": "Versions", + "crossLanguageDefinitionId": "Microsoft.AzureFleet.Versions", + "valueType": { + "$id": "347", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "348", + "kind": "enumvalue", + "name": "v2024_11_01", + "value": "2024-11-01", + "valueType": { + "$id": "349", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "346" + }, + "doc": "Public Api version", + "decorators": [] + } + ], + "clientNamespace": "Microsoft.AzureFleet", + "doc": "Api versions", + "isFixed": true, + "isFlags": false, + "usage": "ApiVersionEnum", + "decorators": [] + } + ], + "Models": [ + { + "$id": "350", + "kind": "model", + "name": "ComputeFleet", + "clientNamespace": "Microsoft.AzureFleet", + "crossLanguageDefinitionId": "Microsoft.AzureFleet.Fleet", + "usage": "Input,Output,Json,LroInitial,LroPolling,LroFinalEnvelope", + "doc": "An Compute Fleet resource", + "decorators": [], + "baseModel": { + "$id": "351", + "kind": "model", + "name": "TrackedResource", + "clientNamespace": "Azure.ResourceManager.CommonTypes", + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.TrackedResource", + "usage": "Input,Output,Json,LroInitial,LroPolling,LroFinalEnvelope", + "doc": "The resource model definition for an Azure Resource Manager tracked top level resource which has 'tags' and a 'location'", + "decorators": [], + "baseModel": { + "$id": "352", + "kind": "model", + "name": "Resource", + "clientNamespace": "Azure.ResourceManager.CommonTypes", + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.Resource", + "usage": "Input,Output,Json,LroInitial,LroPolling,LroFinalEnvelope", + "doc": "Common fields that are returned in the response for all Azure Resource Manager resources", + "decorators": [], + "properties": [ + { + "$id": "353", + "kind": "property", + "name": "id", + "serializedName": "id", + "doc": "Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}", + "type": { + "$id": "354", + "kind": "string", + "name": "armResourceIdentifier", + "crossLanguageDefinitionId": "Azure.Core.armResourceIdentifier", + "baseType": { + "$id": "355", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.Resource.id", + "serializationOptions": { + "$id": "356", + "json": { + "$id": "357", + "name": "id" + } + } + }, + { + "$id": "358", + "kind": "property", + "name": "name", + "serializedName": "name", + "doc": "The name of the resource", + "type": { + "$id": "359", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.Resource.name", + "serializationOptions": { + "$id": "360", + "json": { + "$id": "361", + "name": "name" + } + } + }, + { + "$id": "362", + "kind": "property", + "name": "type", + "serializedName": "type", + "doc": "The type of the resource. E.g. \"Microsoft.Compute/virtualMachines\" or \"Microsoft.Storage/storageAccounts\"", + "type": { + "$id": "363", + "kind": "string", + "name": "armResourceType", + "crossLanguageDefinitionId": "Azure.Core.armResourceType", + "baseType": { + "$id": "364", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.Resource.type", + "serializationOptions": { + "$id": "365", + "json": { + "$id": "366", + "name": "type" + } + } + }, + { + "$id": "367", + "kind": "property", + "name": "systemData", + "serializedName": "systemData", + "doc": "Azure Resource Manager metadata containing createdBy and modifiedBy information.", + "type": { + "$id": "368", + "kind": "model", + "name": "SystemData", + "clientNamespace": "Azure.ResourceManager.CommonTypes", + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.SystemData", + "usage": "Output,Json,LroInitial,LroPolling,LroFinalEnvelope", + "doc": "Metadata pertaining to creation and last modification of the resource.", + "decorators": [], + "properties": [ + { + "$id": "369", + "kind": "property", + "name": "createdBy", + "serializedName": "createdBy", + "doc": "The identity that created the resource.", + "type": { + "$id": "370", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.SystemData.createdBy", + "serializationOptions": { + "$id": "371", + "json": { + "$id": "372", + "name": "createdBy" + } + } + }, + { + "$id": "373", + "kind": "property", + "name": "createdByType", + "serializedName": "createdByType", + "doc": "The type of identity that created the resource.", + "type": { + "$ref": "316" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.SystemData.createdByType", + "serializationOptions": { + "$id": "374", + "json": { + "$id": "375", + "name": "createdByType" + } + } + }, + { + "$id": "376", + "kind": "property", + "name": "createdAt", + "serializedName": "createdAt", + "doc": "The timestamp of resource creation (UTC).", + "type": { + "$id": "377", + "kind": "utcDateTime", + "name": "utcDateTime", + "encode": "rfc3339", + "wireType": { + "$id": "378", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.utcDateTime", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.SystemData.createdAt", + "serializationOptions": { + "$id": "379", + "json": { + "$id": "380", + "name": "createdAt" + } + } + }, + { + "$id": "381", + "kind": "property", + "name": "lastModifiedBy", + "serializedName": "lastModifiedBy", + "doc": "The identity that last modified the resource.", + "type": { + "$id": "382", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.SystemData.lastModifiedBy", + "serializationOptions": { + "$id": "383", + "json": { + "$id": "384", + "name": "lastModifiedBy" + } + } + }, + { + "$id": "385", + "kind": "property", + "name": "lastModifiedByType", + "serializedName": "lastModifiedByType", + "doc": "The type of identity that last modified the resource.", + "type": { + "$ref": "316" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.SystemData.lastModifiedByType", + "serializationOptions": { + "$id": "386", + "json": { + "$id": "387", + "name": "lastModifiedByType" + } + } + }, + { + "$id": "388", + "kind": "property", + "name": "lastModifiedAt", + "serializedName": "lastModifiedAt", + "doc": "The timestamp of resource last modification (UTC)", + "type": { + "$id": "389", + "kind": "utcDateTime", + "name": "utcDateTime", + "encode": "rfc3339", + "wireType": { + "$id": "390", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.utcDateTime", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.SystemData.lastModifiedAt", + "serializationOptions": { + "$id": "391", + "json": { + "$id": "392", + "name": "lastModifiedAt" + } + } + } + ] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.Resource.systemData", + "serializationOptions": { + "$id": "393", + "json": { + "$id": "394", + "name": "systemData" + } + } + } + ] + }, + "properties": [ + { + "$id": "395", + "kind": "property", + "name": "tags", + "serializedName": "tags", + "doc": "Resource tags.", + "type": { + "$id": "396", + "kind": "dict", + "keyType": { + "$id": "397", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "valueType": { + "$id": "398", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.TrackedResource.tags", + "serializationOptions": { + "$id": "399", + "json": { + "$id": "400", + "name": "tags" + } + } + }, + { + "$id": "401", + "kind": "property", + "name": "location", + "serializedName": "location", + "doc": "The geo-location where the resource lives", + "type": { + "$id": "402", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.TrackedResource.location", + "serializationOptions": { + "$id": "403", + "json": { + "$id": "404", + "name": "location" + } + } + } + ] + }, + "properties": [ + { + "$id": "405", + "kind": "property", + "name": "properties", + "serializedName": "properties", + "doc": "The resource-specific properties for this resource.", + "type": { + "$id": "406", + "kind": "model", + "name": "ComputeFleetProperties", + "clientNamespace": "Microsoft.AzureFleet", + "crossLanguageDefinitionId": "Microsoft.AzureFleet.FleetProperties", + "usage": "Input,Output,Json,LroInitial,LroPolling,LroFinalEnvelope", + "doc": "Details of the Compute Fleet.", + "decorators": [], + "properties": [ + { + "$id": "407", + "kind": "property", + "name": "provisioningState", + "serializedName": "provisioningState", + "doc": "The status of the last operation.", + "type": { + "$ref": "2" + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.AzureFleet.FleetProperties.provisioningState", + "serializationOptions": { + "$id": "408", + "json": { + "$id": "409", + "name": "provisioningState" + } + } + }, + { + "$id": "410", + "kind": "property", + "name": "spotPriorityProfile", + "serializedName": "spotPriorityProfile", + "doc": "Configuration Options for Spot instances in Compute Fleet.", + "type": { + "$id": "411", + "kind": "model", + "name": "SpotPriorityProfile", + "clientNamespace": "Microsoft.AzureFleet", + "crossLanguageDefinitionId": "Microsoft.AzureFleet.SpotPriorityProfile", + "usage": "Input,Output,Json,LroInitial,LroPolling,LroFinalEnvelope", + "doc": "Configuration Options for Spot instances in Compute Fleet.", + "decorators": [], + "properties": [ + { + "$id": "412", + "kind": "property", + "name": "capacity", + "serializedName": "capacity", + "doc": "Total capacity to achieve. It is currently in terms of number of VMs.", + "type": { + "$id": "413", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.AzureFleet.SpotPriorityProfile.capacity", + "serializationOptions": { + "$id": "414", + "json": { + "$id": "415", + "name": "capacity" + } + } + }, + { + "$id": "416", + "kind": "property", + "name": "minCapacity", + "serializedName": "minCapacity", + "doc": "Minimum capacity to achieve which cannot be updated. If we will not be able to \"guarantee\" minimum capacity, we will reject the request in the sync path itself.", + "type": { + "$id": "417", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.AzureFleet.SpotPriorityProfile.minCapacity", + "serializationOptions": { + "$id": "418", + "json": { + "$id": "419", + "name": "minCapacity" + } + } + }, + { + "$id": "420", + "kind": "property", + "name": "maxPricePerVM", + "serializedName": "maxPricePerVM", + "doc": "Price per hour of each Spot VM will never exceed this.", + "type": { + "$id": "421", + "kind": "float32", + "name": "float32", + "crossLanguageDefinitionId": "TypeSpec.float32", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.AzureFleet.SpotPriorityProfile.maxPricePerVM", + "serializationOptions": { + "$id": "422", + "json": { + "$id": "423", + "name": "maxPricePerVM" + } + } + }, + { + "$id": "424", + "kind": "property", + "name": "evictionPolicy", + "serializedName": "evictionPolicy", + "doc": "Eviction Policy to follow when evicting Spot VMs.", + "type": { + "$ref": "18" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.AzureFleet.SpotPriorityProfile.evictionPolicy", + "serializationOptions": { + "$id": "425", + "json": { + "$id": "426", + "name": "evictionPolicy" + } + } + }, + { + "$id": "427", + "kind": "property", + "name": "allocationStrategy", + "serializedName": "allocationStrategy", + "doc": "Allocation strategy to follow when determining the VM sizes distribution for Spot VMs.", + "type": { + "$ref": "24" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.AzureFleet.SpotPriorityProfile.allocationStrategy", + "serializationOptions": { + "$id": "428", + "json": { + "$id": "429", + "name": "allocationStrategy" + } + } + }, + { + "$id": "430", + "kind": "property", + "name": "IsMaintainEnabled", + "serializedName": "maintain", + "doc": "Flag to enable/disable continuous goal seeking for the desired capacity and restoration of evicted Spot VMs.\nIf maintain is enabled, AzureFleetRP will use all VM sizes in vmSizesProfile to create new VMs (if VMs are evicted deleted)\nor update existing VMs with new VM sizes (if VMs are evicted deallocated or failed to allocate due to capacity constraint) in order to achieve the desired capacity.\nMaintain is enabled by default.", + "type": { + "$id": "431", + "kind": "boolean", + "name": "boolean", + "crossLanguageDefinitionId": "TypeSpec.boolean", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.AzureFleet.SpotPriorityProfile.maintain", + "serializationOptions": { + "$id": "432", + "json": { + "$id": "433", + "name": "maintain" + } + } + } + ] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.AzureFleet.FleetProperties.spotPriorityProfile", + "serializationOptions": { + "$id": "434", + "json": { + "$id": "435", + "name": "spotPriorityProfile" + } + } + }, + { + "$id": "436", + "kind": "property", + "name": "regularPriorityProfile", + "serializedName": "regularPriorityProfile", + "doc": "Configuration Options for Regular instances in Compute Fleet.", + "type": { + "$id": "437", + "kind": "model", + "name": "RegularPriorityProfile", + "clientNamespace": "Microsoft.AzureFleet", + "crossLanguageDefinitionId": "Microsoft.AzureFleet.RegularPriorityProfile", + "usage": "Input,Output,Json,LroInitial,LroPolling,LroFinalEnvelope", + "doc": "Configuration Options for Regular instances in Compute Fleet.", + "decorators": [], + "properties": [ + { + "$id": "438", + "kind": "property", + "name": "capacity", + "serializedName": "capacity", + "doc": "Total capacity to achieve. It is currently in terms of number of VMs.", + "type": { + "$id": "439", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.AzureFleet.RegularPriorityProfile.capacity", + "serializationOptions": { + "$id": "440", + "json": { + "$id": "441", + "name": "capacity" + } + } + }, + { + "$id": "442", + "kind": "property", + "name": "minCapacity", + "serializedName": "minCapacity", + "doc": "Minimum capacity to achieve which cannot be updated. If we will not be able to \"guarantee\" minimum capacity, we will reject the request in the sync path itself.", + "type": { + "$id": "443", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.AzureFleet.RegularPriorityProfile.minCapacity", + "serializationOptions": { + "$id": "444", + "json": { + "$id": "445", + "name": "minCapacity" + } + } + }, + { + "$id": "446", + "kind": "property", + "name": "allocationStrategy", + "serializedName": "allocationStrategy", + "doc": "Allocation strategy to follow when determining the VM sizes distribution for Regular VMs.", + "type": { + "$ref": "32" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.AzureFleet.RegularPriorityProfile.allocationStrategy", + "serializationOptions": { + "$id": "447", + "json": { + "$id": "448", + "name": "allocationStrategy" + } + } + } + ] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.AzureFleet.FleetProperties.regularPriorityProfile", + "serializationOptions": { + "$id": "449", + "json": { + "$id": "450", + "name": "regularPriorityProfile" + } + } + }, + { + "$id": "451", + "kind": "property", + "name": "vmSizesProfile", + "serializedName": "vmSizesProfile", + "doc": "List of VM sizes supported for Compute Fleet", + "type": { + "$id": "452", + "kind": "array", + "name": "ArrayVmSizeProfile", + "valueType": { + "$id": "453", + "kind": "model", + "name": "ComputeFleetVmSizeProfile", + "clientNamespace": "Microsoft.AzureFleet", + "crossLanguageDefinitionId": "Microsoft.AzureFleet.VmSizeProfile", + "usage": "Input,Output,Json,LroInitial,LroPolling,LroFinalEnvelope", + "doc": "Specifications about a VM Size. This will also contain the corresponding rank and weight in future.", + "decorators": [], + "properties": [ + { + "$id": "454", + "kind": "property", + "name": "name", + "serializedName": "name", + "doc": "The Sku name (e.g. 'Standard_DS1_v2')", + "type": { + "$id": "455", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.AzureFleet.VmSizeProfile.name", + "serializationOptions": { + "$id": "456", + "json": { + "$id": "457", + "name": "name" + } + } + }, + { + "$id": "458", + "kind": "property", + "name": "rank", + "serializedName": "rank", + "doc": "The rank of the VM size. This is used with 'RegularPriorityAllocationStrategy.Prioritized'\nThe lower the number, the higher the priority. Starting with 0.", + "type": { + "$id": "459", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.AzureFleet.VmSizeProfile.rank", + "serializationOptions": { + "$id": "460", + "json": { + "$id": "461", + "name": "rank" + } + } + } + ] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.AzureFleet.FleetProperties.vmSizesProfile", + "serializationOptions": { + "$id": "462", + "json": { + "$id": "463", + "name": "vmSizesProfile" + } + } + }, + { + "$id": "464", + "kind": "property", + "name": "vmAttributes", + "serializedName": "vmAttributes", + "doc": "Attribute based Fleet.", + "type": { + "$id": "465", + "kind": "model", + "name": "ComputeFleetVMAttributes", + "clientNamespace": "Microsoft.AzureFleet", + "crossLanguageDefinitionId": "Microsoft.AzureFleet.VMAttributes", + "usage": "Input,Output,Json,LroInitial,LroPolling,LroFinalEnvelope", + "doc": "VMAttributes that will be used to filter VMSizes which will be used to build Fleet.", + "decorators": [], + "properties": [ + { + "$id": "466", + "kind": "property", + "name": "vCpuCount", + "serializedName": "vCpuCount", + "doc": "The range of vCpuCount specified from Min to Max. Must be specified if VMAttributes are specified, either Min or Max is required if specified.", + "type": { + "$id": "467", + "kind": "model", + "name": "ComputeFleetVmAttributeMinMaxInteger", + "clientNamespace": "Microsoft.AzureFleet", + "crossLanguageDefinitionId": "Microsoft.AzureFleet.VMAttributeMinMaxInteger", + "usage": "Input,Output,Json,LroInitial,LroPolling,LroFinalEnvelope", + "doc": "While retrieving VMSizes from CRS, Min = 0 (uint.MinValue) if not specified, Max = 4294967295 (uint.MaxValue) if not specified. This allows to filter VMAttributes on all available VMSizes.", + "decorators": [], + "properties": [ + { + "$id": "468", + "kind": "property", + "name": "min", + "serializedName": "min", + "doc": "Min VMSize from CRS, Min = 0 (uint.MinValue) if not specified.", + "type": { + "$id": "469", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.AzureFleet.VMAttributeMinMaxInteger.min", + "serializationOptions": { + "$id": "470", + "json": { + "$id": "471", + "name": "min" + } + } + }, + { + "$id": "472", + "kind": "property", + "name": "max", + "serializedName": "max", + "doc": "Max VMSize from CRS, Max = 4294967295 (uint.MaxValue) if not specified.", + "type": { + "$id": "473", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.AzureFleet.VMAttributeMinMaxInteger.max", + "serializationOptions": { + "$id": "474", + "json": { + "$id": "475", + "name": "max" + } + } + } + ] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.AzureFleet.VMAttributes.vCpuCount", + "serializationOptions": { + "$id": "476", + "json": { + "$id": "477", + "name": "vCpuCount" + } + } + }, + { + "$id": "478", + "kind": "property", + "name": "memoryInGiB", + "serializedName": "memoryInGiB", + "doc": "The range of memory specified from Min to Max. Must be specified if VMAttributes are specified, either Min or Max is required if specified.", + "type": { + "$id": "479", + "kind": "model", + "name": "ComputeFleetVmAttributeMinMaxDouble", + "clientNamespace": "Microsoft.AzureFleet", + "crossLanguageDefinitionId": "Microsoft.AzureFleet.VMAttributeMinMaxDouble", + "usage": "Input,Output,Json,LroInitial,LroPolling,LroFinalEnvelope", + "doc": "VMAttributes using double values.", + "decorators": [], + "properties": [ + { + "$id": "480", + "kind": "property", + "name": "min", + "serializedName": "min", + "doc": "Minimum value. default 0. Double.MinValue()", + "type": { + "$id": "481", + "kind": "float64", + "name": "float64", + "crossLanguageDefinitionId": "TypeSpec.float64", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.AzureFleet.VMAttributeMinMaxDouble.min", + "serializationOptions": { + "$id": "482", + "json": { + "$id": "483", + "name": "min" + } + } + }, + { + "$id": "484", + "kind": "property", + "name": "max", + "serializedName": "max", + "doc": "Maximum value. Double.MaxValue(1.7976931348623157E+308)", + "type": { + "$id": "485", + "kind": "float64", + "name": "float64", + "crossLanguageDefinitionId": "TypeSpec.float64", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.AzureFleet.VMAttributeMinMaxDouble.max", + "serializationOptions": { + "$id": "486", + "json": { + "$id": "487", + "name": "max" + } + } + } + ] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.AzureFleet.VMAttributes.memoryInGiB", + "serializationOptions": { + "$id": "488", + "json": { + "$id": "489", + "name": "memoryInGiB" + } + } + }, + { + "$id": "490", + "kind": "property", + "name": "memoryInGiBPerVCpu", + "serializedName": "memoryInGiBPerVCpu", + "doc": "The range of memory in GiB per vCPU specified from min to max. Optional parameter. Either Min or Max is required if specified.", + "type": { + "$ref": "479" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.AzureFleet.VMAttributes.memoryInGiBPerVCpu", + "serializationOptions": { + "$id": "491", + "json": { + "$id": "492", + "name": "memoryInGiBPerVCpu" + } + } + }, + { + "$id": "493", + "kind": "property", + "name": "localStorageSupport", + "serializedName": "localStorageSupport", + "doc": "Specifies whether the VMSize supporting local storage should be used to build Fleet or not.\nIncluded - Default if not specified as most Azure VMs support local storage.", + "type": { + "$ref": "38" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.AzureFleet.VMAttributes.localStorageSupport", + "serializationOptions": { + "$id": "494", + "json": { + "$id": "495", + "name": "localStorageSupport" + } + } + }, + { + "$id": "496", + "kind": "property", + "name": "localStorageInGiB", + "serializedName": "localStorageInGiB", + "doc": "LocalStorageSupport should be set to \"Included\" or \"Required\" to use this VMAttribute. \nIf localStorageSupport is \"Excluded\", this VMAttribute can not be used.", + "type": { + "$ref": "479" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.AzureFleet.VMAttributes.localStorageInGiB", + "serializationOptions": { + "$id": "497", + "json": { + "$id": "498", + "name": "localStorageInGiB" + } + } + }, + { + "$id": "499", + "kind": "property", + "name": "localStorageDiskTypes", + "serializedName": "localStorageDiskTypes", + "doc": "The local storage disk types specified as a list. LocalStorageSupport should be set to \"Included\" or \"Required\" to use this VMAttribute. \nIf localStorageSupport is \"Excluded\", this VMAttribute can not be used.", + "type": { + "$id": "500", + "kind": "array", + "name": "ArrayLocalStorageDiskType", + "valueType": { + "$ref": "46" + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.AzureFleet.VMAttributes.localStorageDiskTypes", + "serializationOptions": { + "$id": "501", + "json": { + "$id": "502", + "name": "localStorageDiskTypes" + } + } + }, + { + "$id": "503", + "kind": "property", + "name": "dataDiskCount", + "serializedName": "dataDiskCount", + "doc": "The range of data disk count specified from Min to Max. Optional parameter. Either Min or Max is required if specified.", + "type": { + "$ref": "467" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.AzureFleet.VMAttributes.dataDiskCount", + "serializationOptions": { + "$id": "504", + "json": { + "$id": "505", + "name": "dataDiskCount" + } + } + }, + { + "$id": "506", + "kind": "property", + "name": "networkInterfaceCount", + "serializedName": "networkInterfaceCount", + "doc": "The range of network interface count specified from Min to Max. Optional parameter. Either Min or Max is required if specified.", + "type": { + "$ref": "467" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.AzureFleet.VMAttributes.networkInterfaceCount", + "serializationOptions": { + "$id": "507", + "json": { + "$id": "508", + "name": "networkInterfaceCount" + } + } + }, + { + "$id": "509", + "kind": "property", + "name": "networkBandwidthInMbps", + "serializedName": "networkBandwidthInMbps", + "doc": "The range of network bandwidth in Mbps specified from Min to Max. Optional parameter. Either Min or Max is required if specified.", + "type": { + "$ref": "479" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.AzureFleet.VMAttributes.networkBandwidthInMbps", + "serializationOptions": { + "$id": "510", + "json": { + "$id": "511", + "name": "networkBandwidthInMbps" + } + } + }, + { + "$id": "512", + "kind": "property", + "name": "rdmaSupport", + "serializedName": "rdmaSupport", + "doc": "Specifies whether the VMSize supporting RDMA (Remote Direct Memory Access) should be used to build Fleet or not.", + "type": { + "$ref": "38" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.AzureFleet.VMAttributes.rdmaSupport", + "serializationOptions": { + "$id": "513", + "json": { + "$id": "514", + "name": "rdmaSupport" + } + } + }, + { + "$id": "515", + "kind": "property", + "name": "rdmaNetworkInterfaceCount", + "serializedName": "rdmaNetworkInterfaceCount", + "doc": "The range of RDMA (Remote Direct Memory Access) network interface count specified from Min to Max. Optional parameter. Either Min or Max is required if specified.\nrdmaSupport should be set to \"Included\" or \"Required\" to use this VMAttribute. \nIf rdmaSupport is \"Excluded\", this VMAttribute can not be used.", + "type": { + "$ref": "467" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.AzureFleet.VMAttributes.rdmaNetworkInterfaceCount", + "serializationOptions": { + "$id": "516", + "json": { + "$id": "517", + "name": "rdmaNetworkInterfaceCount" + } + } + }, + { + "$id": "518", + "kind": "property", + "name": "acceleratorSupport", + "serializedName": "acceleratorSupport", + "doc": "Specifies whether the VMSize supporting accelerator should be used to build Fleet or not.\nacceleratorSupport should be set to \"Included\" or \"Required\" to use this VMAttribute. \nIf acceleratorSupport is \"Excluded\", this VMAttribute can not be used.", + "type": { + "$ref": "38" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.AzureFleet.VMAttributes.acceleratorSupport", + "serializationOptions": { + "$id": "519", + "json": { + "$id": "520", + "name": "acceleratorSupport" + } + } + }, + { + "$id": "521", + "kind": "property", + "name": "acceleratorManufacturers", + "serializedName": "acceleratorManufacturers", + "doc": "The accelerator manufacturers specified as a list. \nacceleratorSupport should be set to \"Included\" or \"Required\" to use this VMAttribute. \nIf acceleratorSupport is \"Excluded\", this VMAttribute can not be used.", + "type": { + "$id": "522", + "kind": "array", + "name": "ArrayAcceleratorManufacturer", + "valueType": { + "$ref": "52" + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.AzureFleet.VMAttributes.acceleratorManufacturers", + "serializationOptions": { + "$id": "523", + "json": { + "$id": "524", + "name": "acceleratorManufacturers" + } + } + }, + { + "$id": "525", + "kind": "property", + "name": "acceleratorTypes", + "serializedName": "acceleratorTypes", + "doc": "The accelerator types specified as a list. acceleratorSupport should be set to \"Included\" or \"Required\" to use this VMAttribute. \nIf acceleratorSupport is \"Excluded\", this VMAttribute can not be used.", + "type": { + "$id": "526", + "kind": "array", + "name": "ArrayAcceleratorType", + "valueType": { + "$ref": "60" + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.AzureFleet.VMAttributes.acceleratorTypes", + "serializationOptions": { + "$id": "527", + "json": { + "$id": "528", + "name": "acceleratorTypes" + } + } + }, + { + "$id": "529", + "kind": "property", + "name": "acceleratorCount", + "serializedName": "acceleratorCount", + "doc": "The range of accelerator count specified from min to max. Optional parameter. Either Min or Max is required if specified.\nacceleratorSupport should be set to \"Included\" or \"Required\" to use this VMAttribute. \nIf acceleratorSupport is \"Excluded\", this VMAttribute can not be used.", + "type": { + "$ref": "467" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.AzureFleet.VMAttributes.acceleratorCount", + "serializationOptions": { + "$id": "530", + "json": { + "$id": "531", + "name": "acceleratorCount" + } + } + }, + { + "$id": "532", + "kind": "property", + "name": "vmCategories", + "serializedName": "vmCategories", + "doc": "The VM category specified as a list. Optional parameter.", + "type": { + "$id": "533", + "kind": "array", + "name": "ArrayVmCategory", + "valueType": { + "$ref": "66" + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.AzureFleet.VMAttributes.vmCategories", + "serializationOptions": { + "$id": "534", + "json": { + "$id": "535", + "name": "vmCategories" + } + } + }, + { + "$id": "536", + "kind": "property", + "name": "architectureTypes", + "serializedName": "architectureTypes", + "doc": "The VM architecture types specified as a list. Optional parameter.", + "type": { + "$id": "537", + "kind": "array", + "name": "ArrayArchitectureType", + "valueType": { + "$ref": "82" + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.AzureFleet.VMAttributes.architectureTypes", + "serializationOptions": { + "$id": "538", + "json": { + "$id": "539", + "name": "architectureTypes" + } + } + }, + { + "$id": "540", + "kind": "property", + "name": "cpuManufacturers", + "serializedName": "cpuManufacturers", + "doc": "The VM CPU manufacturers specified as a list. Optional parameter.", + "type": { + "$id": "541", + "kind": "array", + "name": "ArrayCpuManufacturer", + "valueType": { + "$ref": "88" + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.AzureFleet.VMAttributes.cpuManufacturers", + "serializationOptions": { + "$id": "542", + "json": { + "$id": "543", + "name": "cpuManufacturers" + } + } + }, + { + "$id": "544", + "kind": "property", + "name": "burstableSupport", + "serializedName": "burstableSupport", + "doc": "Specifies whether the VMSize supporting burstable capability should be used to build Fleet or not.", + "type": { + "$ref": "38" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.AzureFleet.VMAttributes.burstableSupport", + "serializationOptions": { + "$id": "545", + "json": { + "$id": "546", + "name": "burstableSupport" + } + } + }, + { + "$id": "547", + "kind": "property", + "name": "excludedVMSizes", + "serializedName": "excludedVMSizes", + "doc": "Specifies which VMSizes should be excluded while building Fleet. Optional parameter.", + "type": { + "$id": "548", + "kind": "array", + "name": "Array", + "valueType": { + "$id": "549", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.AzureFleet.VMAttributes.excludedVMSizes", + "serializationOptions": { + "$id": "550", + "json": { + "$id": "551", + "name": "excludedVMSizes" + } + } + } + ] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.AzureFleet.FleetProperties.vmAttributes", + "serializationOptions": { + "$id": "552", + "json": { + "$id": "553", + "name": "vmAttributes" + } + } + }, + { + "$id": "554", + "kind": "property", + "name": "additionalLocationsProfile", + "serializedName": "additionalLocationsProfile", + "doc": "Represents the configuration for additional locations where Fleet resources may be deployed.", + "type": { + "$id": "555", + "kind": "model", + "name": "AdditionalLocationsProfile", + "clientNamespace": "Microsoft.AzureFleet", + "crossLanguageDefinitionId": "Microsoft.AzureFleet.AdditionalLocationsProfile", + "usage": "Input,Output,Json,LroInitial,LroPolling,LroFinalEnvelope", + "doc": "Represents the configuration for additional locations where Fleet resources may be deployed.", + "decorators": [], + "properties": [ + { + "$id": "556", + "kind": "property", + "name": "locationProfiles", + "serializedName": "locationProfiles", + "doc": "The list of location profiles.", + "type": { + "$id": "557", + "kind": "array", + "name": "ArrayLocationProfile", + "valueType": { + "$id": "558", + "kind": "model", + "name": "LocationProfile", + "clientNamespace": "Microsoft.AzureFleet", + "crossLanguageDefinitionId": "Microsoft.AzureFleet.LocationProfile", + "usage": "Input,Output,Json,LroInitial,LroPolling,LroFinalEnvelope", + "doc": "Represents the profile for a single additional location in the Fleet. The location and the virtualMachineProfileOverride (optional).", + "decorators": [], + "properties": [ + { + "$id": "559", + "kind": "property", + "name": "location", + "serializedName": "location", + "doc": "The ARM location name of the additional region. If LocationProfile is specified, then location is required.", + "type": { + "$id": "560", + "kind": "string", + "name": "azureLocation", + "crossLanguageDefinitionId": "Azure.Core.azureLocation", + "baseType": { + "$id": "561", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.AzureFleet.LocationProfile.location", + "serializationOptions": { + "$id": "562", + "json": { + "$id": "563", + "name": "location" + } + } + }, + { + "$id": "564", + "kind": "property", + "name": "virtualMachineProfileOverride", + "serializedName": "virtualMachineProfileOverride", + "doc": "An override for computeProfile.baseVirtualMachineProfile specific to this region. \nThis override is merged with the base virtual machine profile to define the final virtual machine profile for the resources deployed in this location.", + "type": { + "$id": "565", + "kind": "model", + "name": "ComputeFleetVmProfile", + "clientNamespace": "Microsoft.AzureFleet", + "crossLanguageDefinitionId": "Microsoft.AzureFleet.BaseVirtualMachineProfile", + "usage": "Input,Output,Json,LroInitial,LroPolling,LroFinalEnvelope", + "doc": "Describes the base virtual machine profile for fleet", + "decorators": [], + "properties": [ + { + "$id": "566", + "kind": "property", + "name": "osProfile", + "serializedName": "osProfile", + "doc": "Specifies the operating system settings for the virtual machines in the scale\nset.", + "type": { + "$id": "567", + "kind": "model", + "name": "ComputeFleetVmssOSProfile", + "clientNamespace": "Microsoft.AzureFleet", + "crossLanguageDefinitionId": "Microsoft.AzureFleet.VirtualMachineScaleSetOSProfile", + "usage": "Input,Output,Json,LroInitial,LroPolling,LroFinalEnvelope", + "doc": "Describes a virtual machine scale set OS profile.", + "decorators": [], + "properties": [ + { + "$id": "568", + "kind": "property", + "name": "computerNamePrefix", + "serializedName": "computerNamePrefix", + "doc": "Specifies the computer name prefix for all of the virtual machines in the scale\nset. Computer name prefixes must be 1 to 15 characters long.", + "type": { + "$id": "569", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.AzureFleet.VirtualMachineScaleSetOSProfile.computerNamePrefix", + "serializationOptions": { + "$id": "570", + "json": { + "$id": "571", + "name": "computerNamePrefix" + } + } + }, + { + "$id": "572", + "kind": "property", + "name": "adminUsername", + "serializedName": "adminUsername", + "doc": "Specifies the name of the administrator account.

**Windows-only\nrestriction:** Cannot end in \".\"

**Disallowed values:**\n\"administrator\", \"admin\", \"user\", \"user1\", \"test\", \"user2\", \"test1\", \"user3\",\n\"admin1\", \"1\", \"123\", \"a\", \"actuser\", \"adm\", \"admin2\", \"aspnet\", \"backup\",\n\"console\", \"david\", \"guest\", \"john\", \"owner\", \"root\", \"server\", \"sql\",\n\"support\", \"support_388945a0\", \"sys\", \"test2\", \"test3\", \"user4\", \"user5\".\n

**Minimum-length (Linux):** 1 character

**Max-length\n(Linux):** 64 characters

**Max-length (Windows):** 20 characters", + "type": { + "$id": "573", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.AzureFleet.VirtualMachineScaleSetOSProfile.adminUsername", + "serializationOptions": { + "$id": "574", + "json": { + "$id": "575", + "name": "adminUsername" + } + } + }, + { + "$id": "576", + "kind": "property", + "name": "adminPassword", + "serializedName": "adminPassword", + "doc": "Specifies the password of the administrator account.

**Minimum-length\n(Windows):** 8 characters

**Minimum-length (Linux):** 6 characters\n

**Max-length (Windows):** 123 characters

**Max-length\n(Linux):** 72 characters

**Complexity requirements:** 3 out of 4\nconditions below need to be fulfilled
Has lower characters
Has upper\ncharacters
Has a digit
Has a special character (Regex match [\\W_])\n

**Disallowed values:** \"abc@123\", \"P@$$w0rd\", \"P@ssw0rd\",\n\"P@ssword123\", \"Pa$$word\", \"pass@word1\", \"Password!\", \"Password1\",\n\"Password22\", \"iloveyou!\"

For resetting the password, see [How to\nreset the Remote Desktop service or its login password in a Windows\nVM](https://learn.microsoft.com/troubleshoot/azure/virtual-machines/reset-rdp)\n

For resetting root password, see [Manage users, SSH, and check or\nrepair disks on Azure Linux VMs using the VMAccess\nExtension](https://learn.microsoft.com/troubleshoot/azure/virtual-machines/troubleshoot-ssh-connection)", + "type": { + "$id": "577", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.AzureFleet.VirtualMachineScaleSetOSProfile.adminPassword", + "serializationOptions": { + "$id": "578", + "json": { + "$id": "579", + "name": "adminPassword" + } + } + }, + { + "$id": "580", + "kind": "property", + "name": "customData", + "serializedName": "customData", + "doc": "Specifies a base-64 encoded string of custom data. The base-64 encoded string\nis decoded to a binary array that is saved as a file on the Virtual Machine.\nThe maximum length of the binary array is 65535 bytes. For using cloud-init for\nyour VM, see [Using cloud-init to customize a Linux VM during\ncreation](https://learn.microsoft.com/azure/virtual-machines/linux/using-cloud-init)", + "type": { + "$id": "581", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.AzureFleet.VirtualMachineScaleSetOSProfile.customData", + "serializationOptions": { + "$id": "582", + "json": { + "$id": "583", + "name": "customData" + } + } + }, + { + "$id": "584", + "kind": "property", + "name": "windowsConfiguration", + "serializedName": "windowsConfiguration", + "doc": "Specifies Windows operating system settings on the virtual machine.", + "type": { + "$id": "585", + "kind": "model", + "name": "ComputeFleetWindowsConfiguration", + "clientNamespace": "Microsoft.AzureFleet", + "crossLanguageDefinitionId": "Microsoft.AzureFleet.WindowsConfiguration", + "usage": "Input,Output,Json,LroInitial,LroPolling,LroFinalEnvelope", + "doc": "Specifies Windows operating system settings on the virtual machine.", + "decorators": [], + "properties": [ + { + "$id": "586", + "kind": "property", + "name": "IsVmAgentProvisioned", + "serializedName": "provisionVMAgent", + "doc": "Indicates whether virtual machine agent should be provisioned on the virtual\nmachine. When this property is not specified in the request body, it is set to\ntrue by default. This will ensure that VM Agent is installed on the VM so that\nextensions can be added to the VM later.", + "type": { + "$id": "587", + "kind": "boolean", + "name": "boolean", + "crossLanguageDefinitionId": "TypeSpec.boolean", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.AzureFleet.WindowsConfiguration.provisionVMAgent", + "serializationOptions": { + "$id": "588", + "json": { + "$id": "589", + "name": "provisionVMAgent" + } + } + }, + { + "$id": "590", + "kind": "property", + "name": "IsAutomaticUpdatesEnabled", + "serializedName": "enableAutomaticUpdates", + "doc": "Indicates whether Automatic Updates is enabled for the Windows virtual machine.\nDefault value is true. For virtual machine scale sets, this property can be\nupdated and updates will take effect on OS reprovisioning.", + "type": { + "$id": "591", + "kind": "boolean", + "name": "boolean", + "crossLanguageDefinitionId": "TypeSpec.boolean", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.AzureFleet.WindowsConfiguration.enableAutomaticUpdates", + "serializationOptions": { + "$id": "592", + "json": { + "$id": "593", + "name": "enableAutomaticUpdates" + } + } + }, + { + "$id": "594", + "kind": "property", + "name": "timeZone", + "serializedName": "timeZone", + "doc": "Specifies the time zone of the virtual machine. e.g. \"Pacific Standard Time\".\nPossible values can be\n[TimeZoneInfo.Id](https://learn.microsoft.com/dotnet/api/system.timezoneinfo.id?#System_TimeZoneInfo_Id)\nvalue from time zones returned by\n[TimeZoneInfo.GetSystemTimeZones](https://learn.microsoft.com/dotnet/api/system.timezoneinfo.getsystemtimezones).", + "type": { + "$id": "595", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.AzureFleet.WindowsConfiguration.timeZone", + "serializationOptions": { + "$id": "596", + "json": { + "$id": "597", + "name": "timeZone" + } + } + }, + { + "$id": "598", + "kind": "property", + "name": "additionalUnattendContent", + "serializedName": "additionalUnattendContent", + "doc": "Specifies additional base-64 encoded XML formatted information that can be\nincluded in the Unattend.xml file, which is used by Windows Setup.", + "type": { + "$id": "599", + "kind": "array", + "name": "ArrayAdditionalUnattendContent", + "valueType": { + "$id": "600", + "kind": "model", + "name": "WindowsSetupAdditionalInformation", + "clientNamespace": "Microsoft.AzureFleet", + "crossLanguageDefinitionId": "Microsoft.AzureFleet.AdditionalUnattendContent", + "usage": "Input,Output,Json,LroInitial,LroPolling,LroFinalEnvelope", + "doc": "Specifies additional XML formatted information that can be included in the\nUnattend.xml file, which is used by Windows Setup. Contents are defined by\nsetting name, component name, and the pass in which the content is applied.", + "decorators": [], + "properties": [ + { + "$id": "601", + "kind": "property", + "name": "passName", + "serializedName": "passName", + "doc": "The pass name. Currently, the only allowable value is OobeSystem.", + "type": { + "$id": "602", + "kind": "constant", + "valueType": { + "$ref": "98" + }, + "value": "OobeSystem", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.AzureFleet.AdditionalUnattendContent.passName", + "serializationOptions": { + "$id": "603", + "json": { + "$id": "604", + "name": "passName" + } + } + }, + { + "$id": "605", + "kind": "property", + "name": "componentName", + "serializedName": "componentName", + "doc": "The component name. Currently, the only allowable value is\nMicrosoft-Windows-Shell-Setup.", + "type": { + "$id": "606", + "kind": "constant", + "valueType": { + "$ref": "101" + }, + "value": "Microsoft-Windows-Shell-Setup", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.AzureFleet.AdditionalUnattendContent.componentName", + "serializationOptions": { + "$id": "607", + "json": { + "$id": "608", + "name": "componentName" + } + } + }, + { + "$id": "609", + "kind": "property", + "name": "settingName", + "serializedName": "settingName", + "doc": "Specifies the name of the setting to which the content applies. Possible values\nare: FirstLogonCommands and AutoLogon.", + "type": { + "$ref": "104" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.AzureFleet.AdditionalUnattendContent.settingName", + "serializationOptions": { + "$id": "610", + "json": { + "$id": "611", + "name": "settingName" + } + } + }, + { + "$id": "612", + "kind": "property", + "name": "content", + "serializedName": "content", + "doc": "Specifies the XML formatted content that is added to the unattend.xml file for\nthe specified path and component. The XML must be less than 4KB and must\ninclude the root element for the setting or feature that is being inserted.", + "type": { + "$id": "613", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.AzureFleet.AdditionalUnattendContent.content", + "serializationOptions": { + "$id": "614", + "json": { + "$id": "615", + "name": "content" + } + } + } + ] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.AzureFleet.WindowsConfiguration.additionalUnattendContent", + "serializationOptions": { + "$id": "616", + "json": { + "$id": "617", + "name": "additionalUnattendContent" + } + } + }, + { + "$id": "618", + "kind": "property", + "name": "patchSettings", + "serializedName": "patchSettings", + "doc": "[Preview Feature] Specifies settings related to VM Guest Patching on Windows.", + "type": { + "$id": "619", + "kind": "model", + "name": "ComputeFleetVmGuestPatchSettings", + "clientNamespace": "Microsoft.AzureFleet", + "crossLanguageDefinitionId": "Microsoft.AzureFleet.PatchSettings", + "usage": "Input,Output,Json,LroInitial,LroPolling,LroFinalEnvelope", + "doc": "Specifies settings related to VM Guest Patching on Windows.", + "decorators": [], + "properties": [ + { + "$id": "620", + "kind": "property", + "name": "patchMode", + "serializedName": "patchMode", + "doc": "Specifies the mode of VM Guest Patching to IaaS virtual machine or virtual\nmachines associated to virtual machine scale set with OrchestrationMode as\nFlexible.

Possible values are:

**Manual** - You\ncontrol the application of patches to a virtual machine. You do this by\napplying patches manually inside the VM. In this mode, automatic updates are\ndisabled; the property WindowsConfiguration.enableAutomaticUpdates must be\nfalse

**AutomaticByOS** - The virtual machine will automatically be\nupdated by the OS. The property WindowsConfiguration.enableAutomaticUpdates\nmust be true.

**AutomaticByPlatform** - the virtual machine will\nautomatically updated by the platform. The properties provisionVMAgent and\nWindowsConfiguration.enableAutomaticUpdates must be true", + "type": { + "$ref": "110" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.AzureFleet.PatchSettings.patchMode", + "serializationOptions": { + "$id": "621", + "json": { + "$id": "622", + "name": "patchMode" + } + } + }, + { + "$id": "623", + "kind": "property", + "name": "IsHotPatchingEnabled", + "serializedName": "enableHotpatching", + "doc": "Enables customers to patch their Azure VMs without requiring a reboot. For\nenableHotpatching, the 'provisionVMAgent' must be set to true and 'patchMode'\nmust be set to 'AutomaticByPlatform'.", + "type": { + "$id": "624", + "kind": "boolean", + "name": "boolean", + "crossLanguageDefinitionId": "TypeSpec.boolean", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.AzureFleet.PatchSettings.enableHotpatching", + "serializationOptions": { + "$id": "625", + "json": { + "$id": "626", + "name": "enableHotpatching" + } + } + }, + { + "$id": "627", + "kind": "property", + "name": "assessmentMode", + "serializedName": "assessmentMode", + "doc": "Specifies the mode of VM Guest patch assessment for the IaaS virtual\nmachine.

Possible values are:

**ImageDefault** - You\ncontrol the timing of patch assessments on a virtual machine.

\n**AutomaticByPlatform** - The platform will trigger periodic patch assessments.\nThe property provisionVMAgent must be true.", + "type": { + "$ref": "118" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.AzureFleet.PatchSettings.assessmentMode", + "serializationOptions": { + "$id": "628", + "json": { + "$id": "629", + "name": "assessmentMode" + } + } + }, + { + "$id": "630", + "kind": "property", + "name": "automaticByPlatformSettings", + "serializedName": "automaticByPlatformSettings", + "doc": "Specifies additional settings for patch mode AutomaticByPlatform in VM Guest\nPatching on Windows.", + "type": { + "$id": "631", + "kind": "model", + "name": "ComputeFleetWindowsVMGuestPatchAutomaticByPlatformSettings", + "clientNamespace": "Microsoft.AzureFleet", + "crossLanguageDefinitionId": "Microsoft.AzureFleet.WindowsVMGuestPatchAutomaticByPlatformSettings", + "usage": "Input,Output,Json,LroInitial,LroPolling,LroFinalEnvelope", + "doc": "Specifies additional settings to be applied when patch mode AutomaticByPlatform\nis selected in Windows patch settings.", + "decorators": [], + "properties": [ + { + "$id": "632", + "kind": "property", + "name": "rebootSetting", + "serializedName": "rebootSetting", + "doc": "Specifies the reboot setting for all AutomaticByPlatform patch installation\noperations.", + "type": { + "$ref": "124" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.AzureFleet.WindowsVMGuestPatchAutomaticByPlatformSettings.rebootSetting", + "serializationOptions": { + "$id": "633", + "json": { + "$id": "634", + "name": "rebootSetting" + } + } + }, + { + "$id": "635", + "kind": "property", + "name": "IsBypassPlatformSafetyChecksOnUserScheduleEnabled", + "serializedName": "bypassPlatformSafetyChecksOnUserSchedule", + "doc": "Enables customer to schedule patching without accidental upgrades", + "type": { + "$id": "636", + "kind": "boolean", + "name": "boolean", + "crossLanguageDefinitionId": "TypeSpec.boolean", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.AzureFleet.WindowsVMGuestPatchAutomaticByPlatformSettings.bypassPlatformSafetyChecksOnUserSchedule", + "serializationOptions": { + "$id": "637", + "json": { + "$id": "638", + "name": "bypassPlatformSafetyChecksOnUserSchedule" + } + } + } + ] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.AzureFleet.PatchSettings.automaticByPlatformSettings", + "serializationOptions": { + "$id": "639", + "json": { + "$id": "640", + "name": "automaticByPlatformSettings" + } + } + } + ] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.AzureFleet.WindowsConfiguration.patchSettings", + "serializationOptions": { + "$id": "641", + "json": { + "$id": "642", + "name": "patchSettings" + } + } + }, + { + "$id": "643", + "kind": "property", + "name": "winRM", + "serializedName": "winRM", + "doc": "Specifies the Windows Remote Management listeners. This enables remote Windows\nPowerShell.", + "type": { + "$id": "644", + "kind": "model", + "name": "WinRMConfiguration", + "clientNamespace": "Microsoft.AzureFleet", + "crossLanguageDefinitionId": "Microsoft.AzureFleet.WinRMConfiguration", + "usage": "Input,Output,Json,LroInitial,LroPolling,LroFinalEnvelope", + "doc": "Describes Windows Remote Management configuration of the VM", + "decorators": [], + "properties": [ + { + "$id": "645", + "kind": "property", + "name": "listeners", + "serializedName": "listeners", + "doc": "The list of Windows Remote Management listeners", + "type": { + "$id": "646", + "kind": "array", + "name": "ArrayWinRmListener", + "valueType": { + "$id": "647", + "kind": "model", + "name": "ComputeFleetWinRMListener", + "clientNamespace": "Microsoft.AzureFleet", + "crossLanguageDefinitionId": "Microsoft.AzureFleet.WinRMListener", + "usage": "Input,Output,Json,LroInitial,LroPolling,LroFinalEnvelope", + "doc": "Describes Protocol and thumbprint of Windows Remote Management listener", + "decorators": [], + "properties": [ + { + "$id": "648", + "kind": "property", + "name": "protocol", + "serializedName": "protocol", + "doc": "Specifies the protocol of WinRM listener. Possible values are: **http,**\n**https.**", + "type": { + "$ref": "134" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.AzureFleet.WinRMListener.protocol", + "serializationOptions": { + "$id": "649", + "json": { + "$id": "650", + "name": "protocol" + } + } + }, + { + "$id": "651", + "kind": "property", + "name": "certificateUrl", + "serializedName": "certificateUrl", + "doc": "This is the URL of a certificate that has been uploaded to Key Vault as a\nsecret. For adding a secret to the Key Vault, see [Add a key or secret to the\nkey\nvault](https://learn.microsoft.com/azure/key-vault/key-vault-get-started/#add).\nIn this case, your certificate needs to be the Base64 encoding of the following\nJSON Object which is encoded in UTF-8:

{
\n\"data\":\"\",
\"dataType\":\"pfx\",
\n\"password\":\"\"
}
To install certificates on a virtual\nmachine it is recommended to use the [Azure Key Vault virtual machine extension\nfor\nLinux](https://learn.microsoft.com/azure/virtual-machines/extensions/key-vault-linux)\nor the [Azure Key Vault virtual machine extension for\nWindows](https://learn.microsoft.com/azure/virtual-machines/extensions/key-vault-windows).", + "type": { + "$id": "652", + "kind": "url", + "name": "url", + "crossLanguageDefinitionId": "TypeSpec.url", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.AzureFleet.WinRMListener.certificateUrl", + "serializationOptions": { + "$id": "653", + "json": { + "$id": "654", + "name": "certificateUrl" + } + } + } + ] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.AzureFleet.WinRMConfiguration.listeners", + "serializationOptions": { + "$id": "655", + "json": { + "$id": "656", + "name": "listeners" + } + } + } + ] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.AzureFleet.WindowsConfiguration.winRM", + "serializationOptions": { + "$id": "657", + "json": { + "$id": "658", + "name": "winRM" + } + } + }, + { + "$id": "659", + "kind": "property", + "name": "IsVmAgentPlatformUpdatesEnabled", + "serializedName": "enableVMAgentPlatformUpdates", + "doc": "Indicates whether VMAgent Platform Updates is enabled for the Windows virtual\nmachine. Default value is false.", + "type": { + "$id": "660", + "kind": "boolean", + "name": "boolean", + "crossLanguageDefinitionId": "TypeSpec.boolean", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.AzureFleet.WindowsConfiguration.enableVMAgentPlatformUpdates", + "serializationOptions": { + "$id": "661", + "json": { + "$id": "662", + "name": "enableVMAgentPlatformUpdates" + } + } + } + ] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.AzureFleet.VirtualMachineScaleSetOSProfile.windowsConfiguration", + "serializationOptions": { + "$id": "663", + "json": { + "$id": "664", + "name": "windowsConfiguration" + } + } + }, + { + "$id": "665", + "kind": "property", + "name": "linuxConfiguration", + "serializedName": "linuxConfiguration", + "doc": "Specifies the Linux operating system settings on the virtual machine. For a\nlist of supported Linux distributions, see [Linux on Azure-Endorsed\nDistributions](https://learn.microsoft.com/azure/virtual-machines/linux/endorsed-distros).", + "type": { + "$id": "666", + "kind": "model", + "name": "ComputeFleetLinuxConfiguration", + "clientNamespace": "Microsoft.AzureFleet", + "crossLanguageDefinitionId": "Microsoft.AzureFleet.LinuxConfiguration", + "usage": "Input,Output,Json,LroInitial,LroPolling,LroFinalEnvelope", + "doc": "Specifies the Linux operating system settings on the virtual machine. For a\nlist of supported Linux distributions, see [Linux on Azure-Endorsed\nDistributions](https://learn.microsoft.com/azure/virtual-machines/linux/endorsed-distros).", + "decorators": [], + "properties": [ + { + "$id": "667", + "kind": "property", + "name": "IsPasswordAuthenticationDisabled", + "serializedName": "disablePasswordAuthentication", + "doc": "Specifies whether password authentication should be disabled.", + "type": { + "$id": "668", + "kind": "boolean", + "name": "boolean", + "crossLanguageDefinitionId": "TypeSpec.boolean", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.AzureFleet.LinuxConfiguration.disablePasswordAuthentication", + "serializationOptions": { + "$id": "669", + "json": { + "$id": "670", + "name": "disablePasswordAuthentication" + } + } + }, + { + "$id": "671", + "kind": "property", + "name": "ssh", + "serializedName": "ssh", + "doc": "Specifies the ssh key configuration for a Linux OS.", + "type": { + "$id": "672", + "kind": "model", + "name": "ComputeFleetSshConfiguration", + "clientNamespace": "Microsoft.AzureFleet", + "crossLanguageDefinitionId": "Microsoft.AzureFleet.SshConfiguration", + "usage": "Input,Output,Json,LroInitial,LroPolling,LroFinalEnvelope", + "doc": "SSH configuration for Linux based VMs running on Azure", + "decorators": [], + "properties": [ + { + "$id": "673", + "kind": "property", + "name": "publicKeys", + "serializedName": "publicKeys", + "doc": "The list of SSH public keys used to authenticate with linux based VMs.", + "type": { + "$id": "674", + "kind": "array", + "name": "ArraySshPublicKey", + "valueType": { + "$id": "675", + "kind": "model", + "name": "ComputeFleetSshPublicKey", + "clientNamespace": "Microsoft.AzureFleet", + "crossLanguageDefinitionId": "Microsoft.AzureFleet.SshPublicKey", + "usage": "Input,Output,Json,LroInitial,LroPolling,LroFinalEnvelope", + "doc": "Contains information about SSH certificate public key and the path on the Linux\nVM where the public key is placed.", + "decorators": [], + "properties": [ + { + "$id": "676", + "kind": "property", + "name": "path", + "serializedName": "path", + "doc": "Specifies the full path on the created VM where ssh public key is stored. If\nthe file already exists, the specified key is appended to the file. Example:\n/home/user/.ssh/authorized_keys", + "type": { + "$id": "677", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.AzureFleet.SshPublicKey.path", + "serializationOptions": { + "$id": "678", + "json": { + "$id": "679", + "name": "path" + } + } + }, + { + "$id": "680", + "kind": "property", + "name": "keyData", + "serializedName": "keyData", + "doc": "SSH public key certificate used to authenticate with the VM through ssh. The\nkey needs to be at least 2048-bit and in ssh-rsa format. For creating ssh keys,\nsee [Create SSH keys on Linux and Mac for Linux VMs in\nAzure]https://learn.microsoft.com/azure/virtual-machines/linux/create-ssh-keys-detailed).", + "type": { + "$id": "681", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.AzureFleet.SshPublicKey.keyData", + "serializationOptions": { + "$id": "682", + "json": { + "$id": "683", + "name": "keyData" + } + } + } + ] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.AzureFleet.SshConfiguration.publicKeys", + "serializationOptions": { + "$id": "684", + "json": { + "$id": "685", + "name": "publicKeys" + } + } + } + ] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.AzureFleet.LinuxConfiguration.ssh", + "serializationOptions": { + "$id": "686", + "json": { + "$id": "687", + "name": "ssh" + } + } + }, + { + "$id": "688", + "kind": "property", + "name": "IsVmAgentProvisioned", + "serializedName": "provisionVMAgent", + "doc": "Indicates whether virtual machine agent should be provisioned on the virtual\nmachine. When this property is not specified in the request body, default\nbehavior is to set it to true. This will ensure that VM Agent is installed on\nthe VM so that extensions can be added to the VM later.", + "type": { + "$id": "689", + "kind": "boolean", + "name": "boolean", + "crossLanguageDefinitionId": "TypeSpec.boolean", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.AzureFleet.LinuxConfiguration.provisionVMAgent", + "serializationOptions": { + "$id": "690", + "json": { + "$id": "691", + "name": "provisionVMAgent" + } + } + }, + { + "$id": "692", + "kind": "property", + "name": "patchSettings", + "serializedName": "patchSettings", + "doc": "[Preview Feature] Specifies settings related to VM Guest Patching on Linux.", + "type": { + "$id": "693", + "kind": "model", + "name": "ComputeFleetLinuxPatchSettings", + "clientNamespace": "Microsoft.AzureFleet", + "crossLanguageDefinitionId": "Microsoft.AzureFleet.LinuxPatchSettings", + "usage": "Input,Output,Json,LroInitial,LroPolling,LroFinalEnvelope", + "doc": "Specifies settings related to VM Guest Patching on Linux.", + "decorators": [], + "properties": [ + { + "$id": "694", + "kind": "property", + "name": "patchMode", + "serializedName": "patchMode", + "doc": "Specifies the mode of VM Guest Patching to IaaS virtual machine or virtual\nmachines associated to virtual machine scale set with OrchestrationMode as\nFlexible.

Possible values are:

**ImageDefault** - The\nvirtual machine's default patching configuration is used.

\n**AutomaticByPlatform** - The virtual machine will be automatically updated by\nthe platform. The property provisionVMAgent must be true", + "type": { + "$ref": "140" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.AzureFleet.LinuxPatchSettings.patchMode", + "serializationOptions": { + "$id": "695", + "json": { + "$id": "696", + "name": "patchMode" + } + } + }, + { + "$id": "697", + "kind": "property", + "name": "assessmentMode", + "serializedName": "assessmentMode", + "doc": "Specifies the mode of VM Guest Patch Assessment for the IaaS virtual\nmachine.

Possible values are:

**ImageDefault** - You\ncontrol the timing of patch assessments on a virtual machine.

\n**AutomaticByPlatform** - The platform will trigger periodic patch assessments.\nThe property provisionVMAgent must be true.", + "type": { + "$ref": "146" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.AzureFleet.LinuxPatchSettings.assessmentMode", + "serializationOptions": { + "$id": "698", + "json": { + "$id": "699", + "name": "assessmentMode" + } + } + }, + { + "$id": "700", + "kind": "property", + "name": "automaticByPlatformSettings", + "serializedName": "automaticByPlatformSettings", + "doc": "Specifies additional settings for patch mode AutomaticByPlatform in VM Guest\nPatching on Linux.", + "type": { + "$id": "701", + "kind": "model", + "name": "ComputeFleetLinuxVMGuestPatchAutomaticByPlatformSettings", + "clientNamespace": "Microsoft.AzureFleet", + "crossLanguageDefinitionId": "Microsoft.AzureFleet.LinuxVMGuestPatchAutomaticByPlatformSettings", + "usage": "Input,Output,Json,LroInitial,LroPolling,LroFinalEnvelope", + "doc": "Specifies additional settings to be applied when patch mode AutomaticByPlatform\nis selected in Linux patch settings.", + "decorators": [], + "properties": [ + { + "$id": "702", + "kind": "property", + "name": "rebootSetting", + "serializedName": "rebootSetting", + "doc": "Specifies the reboot setting for all AutomaticByPlatform patch installation\noperations.", + "type": { + "$ref": "152" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.AzureFleet.LinuxVMGuestPatchAutomaticByPlatformSettings.rebootSetting", + "serializationOptions": { + "$id": "703", + "json": { + "$id": "704", + "name": "rebootSetting" + } + } + }, + { + "$id": "705", + "kind": "property", + "name": "IsBypassPlatformSafetyChecksOnUserScheduleEnabled", + "serializedName": "bypassPlatformSafetyChecksOnUserSchedule", + "doc": "Enables customer to schedule patching without accidental upgrades", + "type": { + "$id": "706", + "kind": "boolean", + "name": "boolean", + "crossLanguageDefinitionId": "TypeSpec.boolean", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.AzureFleet.LinuxVMGuestPatchAutomaticByPlatformSettings.bypassPlatformSafetyChecksOnUserSchedule", + "serializationOptions": { + "$id": "707", + "json": { + "$id": "708", + "name": "bypassPlatformSafetyChecksOnUserSchedule" + } + } + } + ] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.AzureFleet.LinuxPatchSettings.automaticByPlatformSettings", + "serializationOptions": { + "$id": "709", + "json": { + "$id": "710", + "name": "automaticByPlatformSettings" + } + } + } + ] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.AzureFleet.LinuxConfiguration.patchSettings", + "serializationOptions": { + "$id": "711", + "json": { + "$id": "712", + "name": "patchSettings" + } + } + }, + { + "$id": "713", + "kind": "property", + "name": "IsVmAgentPlatformUpdatesEnabled", + "serializedName": "enableVMAgentPlatformUpdates", + "doc": "Indicates whether VMAgent Platform Updates is enabled for the Linux virtual\nmachine. Default value is false.", + "type": { + "$id": "714", + "kind": "boolean", + "name": "boolean", + "crossLanguageDefinitionId": "TypeSpec.boolean", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.AzureFleet.LinuxConfiguration.enableVMAgentPlatformUpdates", + "serializationOptions": { + "$id": "715", + "json": { + "$id": "716", + "name": "enableVMAgentPlatformUpdates" + } + } + } + ] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.AzureFleet.VirtualMachineScaleSetOSProfile.linuxConfiguration", + "serializationOptions": { + "$id": "717", + "json": { + "$id": "718", + "name": "linuxConfiguration" + } + } + }, + { + "$id": "719", + "kind": "property", + "name": "secrets", + "serializedName": "secrets", + "doc": "Specifies set of certificates that should be installed onto the virtual\nmachines in the scale set. To install certificates on a virtual machine it is\nrecommended to use the [Azure Key Vault virtual machine extension for\nLinux](https://learn.microsoft.com/azure/virtual-machines/extensions/key-vault-linux)\nor the [Azure Key Vault virtual machine extension for\nWindows](https://learn.microsoft.com/azure/virtual-machines/extensions/key-vault-windows).", + "type": { + "$id": "720", + "kind": "array", + "name": "ArrayVaultSecretGroup", + "valueType": { + "$id": "721", + "kind": "model", + "name": "ComputeFleetVaultSecretGroup", + "clientNamespace": "Microsoft.AzureFleet", + "crossLanguageDefinitionId": "Microsoft.AzureFleet.VaultSecretGroup", + "usage": "Input,Output,Json,LroInitial,LroPolling,LroFinalEnvelope", + "doc": "Describes a set of certificates which are all in the same Key Vault.", + "decorators": [], + "properties": [ + { + "$id": "722", + "kind": "property", + "name": "sourceVault", + "serializedName": "sourceVault", + "doc": "The relative URL of the Key Vault containing all of the certificates in\nVaultCertificates.", + "type": { + "$id": "723", + "kind": "model", + "name": "SubResource", + "clientNamespace": "Microsoft.AzureFleet", + "crossLanguageDefinitionId": "Microsoft.AzureFleet.SubResource", + "usage": "Input,Output,Json,LroInitial,LroPolling,LroFinalEnvelope", + "doc": "Describes SubResource", + "decorators": [], + "properties": [ + { + "$id": "724", + "kind": "property", + "name": "id", + "serializedName": "id", + "doc": "Resource Id", + "type": { + "$id": "725", + "kind": "string", + "name": "armResourceIdentifier", + "crossLanguageDefinitionId": "Azure.Core.armResourceIdentifier", + "baseType": { + "$id": "726", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.AzureFleet.SubResource.id", + "serializationOptions": { + "$id": "727", + "json": { + "$id": "728", + "name": "id" + } + } + } + ] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.AzureFleet.VaultSecretGroup.sourceVault", + "serializationOptions": { + "$id": "729", + "json": { + "$id": "730", + "name": "sourceVault" + } + } + }, + { + "$id": "731", + "kind": "property", + "name": "vaultCertificates", + "serializedName": "vaultCertificates", + "doc": "The list of key vault references in SourceVault which contain certificates.", + "type": { + "$id": "732", + "kind": "array", + "name": "ArrayVaultCertificate", + "valueType": { + "$id": "733", + "kind": "model", + "name": "ComputeFleetVaultCertificate", + "clientNamespace": "Microsoft.AzureFleet", + "crossLanguageDefinitionId": "Microsoft.AzureFleet.VaultCertificate", + "usage": "Input,Output,Json,LroInitial,LroPolling,LroFinalEnvelope", + "doc": "Describes a single certificate reference in a Key Vault, and where the\ncertificate should reside on the VM.", + "decorators": [], + "properties": [ + { + "$id": "734", + "kind": "property", + "name": "certificateUrl", + "serializedName": "certificateUrl", + "doc": "This is the URL of a certificate that has been uploaded to Key Vault as a\nsecret. For adding a secret to the Key Vault, see [Add a key or secret to the\nkey\nvault](https://learn.microsoft.com/azure/key-vault/key-vault-get-started/#add).\nIn this case, your certificate needs to be It is the Base64 encoding of the\nfollowing JSON Object which is encoded in UTF-8:

{
\n\"data\":\"\",
\"dataType\":\"pfx\",
\n\"password\":\"\"
}
To install certificates on a virtual\nmachine it is recommended to use the [Azure Key Vault virtual machine extension\nfor\nLinux](https://learn.microsoft.com/azure/virtual-machines/extensions/key-vault-linux)\nor the [Azure Key Vault virtual machine extension for\nWindows](https://learn.microsoft.com/azure/virtual-machines/extensions/key-vault-windows).", + "type": { + "$id": "735", + "kind": "url", + "name": "url", + "crossLanguageDefinitionId": "TypeSpec.url", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.AzureFleet.VaultCertificate.certificateUrl", + "serializationOptions": { + "$id": "736", + "json": { + "$id": "737", + "name": "certificateUrl" + } + } + }, + { + "$id": "738", + "kind": "property", + "name": "certificateStore", + "serializedName": "certificateStore", + "doc": "For Windows VMs, specifies the certificate store on the Virtual Machine to\nwhich the certificate should be added. The specified certificate store is\nimplicitly in the LocalMachine account. For Linux VMs, the certificate file is\nplaced under the /var/lib/waagent directory, with the file name\n<UppercaseThumbprint>.crt for the X509 certificate file and\n<UppercaseThumbprint>.prv for private key. Both of these files are .pem\nformatted.", + "type": { + "$id": "739", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.AzureFleet.VaultCertificate.certificateStore", + "serializationOptions": { + "$id": "740", + "json": { + "$id": "741", + "name": "certificateStore" + } + } + } + ] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.AzureFleet.VaultSecretGroup.vaultCertificates", + "serializationOptions": { + "$id": "742", + "json": { + "$id": "743", + "name": "vaultCertificates" + } + } + } + ] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.AzureFleet.VirtualMachineScaleSetOSProfile.secrets", + "serializationOptions": { + "$id": "744", + "json": { + "$id": "745", + "name": "secrets" + } + } + }, + { + "$id": "746", + "kind": "property", + "name": "AreExtensionOperationsAllowed", + "serializedName": "allowExtensionOperations", + "doc": "Specifies whether extension operations should be allowed on the virtual machine\nscale set. This may only be set to False when no extensions are present on the\nvirtual machine scale set.", + "type": { + "$id": "747", + "kind": "boolean", + "name": "boolean", + "crossLanguageDefinitionId": "TypeSpec.boolean", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.AzureFleet.VirtualMachineScaleSetOSProfile.allowExtensionOperations", + "serializationOptions": { + "$id": "748", + "json": { + "$id": "749", + "name": "allowExtensionOperations" + } + } + }, + { + "$id": "750", + "kind": "property", + "name": "IsGuestProvisionSignalRequired", + "serializedName": "requireGuestProvisionSignal", + "doc": "Optional property which must either be set to True or omitted.", + "type": { + "$id": "751", + "kind": "boolean", + "name": "boolean", + "crossLanguageDefinitionId": "TypeSpec.boolean", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.AzureFleet.VirtualMachineScaleSetOSProfile.requireGuestProvisionSignal", + "serializationOptions": { + "$id": "752", + "json": { + "$id": "753", + "name": "requireGuestProvisionSignal" + } + } + } + ] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.AzureFleet.BaseVirtualMachineProfile.osProfile", + "serializationOptions": { + "$id": "754", + "json": { + "$id": "755", + "name": "osProfile" + } + } + }, + { + "$id": "756", + "kind": "property", + "name": "storageProfile", + "serializedName": "storageProfile", + "doc": "Specifies the storage settings for the virtual machine disks.", + "type": { + "$id": "757", + "kind": "model", + "name": "ComputeFleetVmssStorageProfile", + "clientNamespace": "Microsoft.AzureFleet", + "crossLanguageDefinitionId": "Microsoft.AzureFleet.VirtualMachineScaleSetStorageProfile", + "usage": "Input,Output,Json,LroInitial,LroPolling,LroFinalEnvelope", + "doc": "Describes a virtual machine scale set storage profile.", + "decorators": [], + "properties": [ + { + "$id": "758", + "kind": "property", + "name": "imageReference", + "serializedName": "imageReference", + "doc": "Specifies information about the image to use. You can specify information about\nplatform images, marketplace images, or virtual machine images. This element is\nrequired when you want to use a platform image, marketplace image, or virtual\nmachine image, but is not used in other creation operations.", + "type": { + "$id": "759", + "kind": "model", + "name": "ComputeFleetImageReference", + "clientNamespace": "Microsoft.AzureFleet", + "crossLanguageDefinitionId": "Microsoft.AzureFleet.ImageReference", + "usage": "Input,Output,Json,LroInitial,LroPolling,LroFinalEnvelope", + "doc": "Specifies information about the image to use. You can specify information about\nplatform images, marketplace images, or virtual machine images. This element is\nrequired when you want to use a platform image, marketplace image, or virtual\nmachine image, but is not used in other creation operations. NOTE: Image\nreference publisher and offer can only be set when you create the scale set.", + "decorators": [], + "properties": [ + { + "$id": "760", + "kind": "property", + "name": "id", + "serializedName": "id", + "doc": "Resource Id", + "type": { + "$id": "761", + "kind": "string", + "name": "armResourceIdentifier", + "crossLanguageDefinitionId": "Azure.Core.armResourceIdentifier", + "baseType": { + "$id": "762", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.AzureFleet.ImageReference.id", + "serializationOptions": { + "$id": "763", + "json": { + "$id": "764", + "name": "id" + } + } + }, + { + "$id": "765", + "kind": "property", + "name": "publisher", + "serializedName": "publisher", + "doc": "The image publisher.", + "type": { + "$id": "766", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.AzureFleet.ImageReference.publisher", + "serializationOptions": { + "$id": "767", + "json": { + "$id": "768", + "name": "publisher" + } + } + }, + { + "$id": "769", + "kind": "property", + "name": "offer", + "serializedName": "offer", + "doc": "Specifies the offer of the platform image or marketplace image used to create\nthe virtual machine.", + "type": { + "$id": "770", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.AzureFleet.ImageReference.offer", + "serializationOptions": { + "$id": "771", + "json": { + "$id": "772", + "name": "offer" + } + } + }, + { + "$id": "773", + "kind": "property", + "name": "sku", + "serializedName": "sku", + "doc": "The image SKU.", + "type": { + "$id": "774", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.AzureFleet.ImageReference.sku", + "serializationOptions": { + "$id": "775", + "json": { + "$id": "776", + "name": "sku" + } + } + }, + { + "$id": "777", + "kind": "property", + "name": "version", + "serializedName": "version", + "doc": "Specifies the version of the platform image or marketplace image used to create\nthe virtual machine. The allowed formats are Major.Minor.Build or 'latest'.\nMajor, Minor, and Build are decimal numbers. Specify 'latest' to use the latest\nversion of an image available at deploy time. Even if you use 'latest', the VM\nimage will not automatically update after deploy time even if a new version\nbecomes available. Please do not use field 'version' for gallery image\ndeployment, gallery image should always use 'id' field for deployment, to use 'latest'\nversion of gallery image, just set\n'/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/images/{imageName}'\nin the 'id' field without version input.", + "type": { + "$id": "778", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.AzureFleet.ImageReference.version", + "serializationOptions": { + "$id": "779", + "json": { + "$id": "780", + "name": "version" + } + } + }, + { + "$id": "781", + "kind": "property", + "name": "exactVersion", + "serializedName": "exactVersion", + "doc": "Specifies in decimal numbers, the version of platform image or marketplace\nimage used to create the virtual machine. This readonly field differs from 'version',\nonly if the value specified in 'version' field is 'latest'.", + "type": { + "$id": "782", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.AzureFleet.ImageReference.exactVersion", + "serializationOptions": { + "$id": "783", + "json": { + "$id": "784", + "name": "exactVersion" + } + } + }, + { + "$id": "785", + "kind": "property", + "name": "sharedGalleryImageId", + "serializedName": "sharedGalleryImageId", + "doc": "Specified the shared gallery image unique id for vm deployment. This can be\nfetched from shared gallery image GET call.", + "type": { + "$id": "786", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.AzureFleet.ImageReference.sharedGalleryImageId", + "serializationOptions": { + "$id": "787", + "json": { + "$id": "788", + "name": "sharedGalleryImageId" + } + } + }, + { + "$id": "789", + "kind": "property", + "name": "communityGalleryImageId", + "serializedName": "communityGalleryImageId", + "doc": "Specified the community gallery image unique id for vm deployment. This can be\nfetched from community gallery image GET call.", + "type": { + "$id": "790", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.AzureFleet.ImageReference.communityGalleryImageId", + "serializationOptions": { + "$id": "791", + "json": { + "$id": "792", + "name": "communityGalleryImageId" + } + } + } + ] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.AzureFleet.VirtualMachineScaleSetStorageProfile.imageReference", + "serializationOptions": { + "$id": "793", + "json": { + "$id": "794", + "name": "imageReference" + } + } + }, + { + "$id": "795", + "kind": "property", + "name": "osDisk", + "serializedName": "osDisk", + "doc": "Specifies information about the operating system disk used by the virtual\nmachines in the scale set. For more information about disks, see [About disks\nand VHDs for Azure virtual\nmachines](https://learn.microsoft.com/azure/virtual-machines/managed-disks-overview).", + "type": { + "$id": "796", + "kind": "model", + "name": "ComputeFleetVmssOSDisk", + "clientNamespace": "Microsoft.AzureFleet", + "crossLanguageDefinitionId": "Microsoft.AzureFleet.VirtualMachineScaleSetOSDisk", + "usage": "Input,Output,Json,LroInitial,LroPolling,LroFinalEnvelope", + "doc": "Describes a virtual machine scale set operating system disk.", + "decorators": [], + "properties": [ + { + "$id": "797", + "kind": "property", + "name": "name", + "serializedName": "name", + "doc": "The disk name.", + "type": { + "$id": "798", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.AzureFleet.VirtualMachineScaleSetOSDisk.name", + "serializationOptions": { + "$id": "799", + "json": { + "$id": "800", + "name": "name" + } + } + }, + { + "$id": "801", + "kind": "property", + "name": "caching", + "serializedName": "caching", + "doc": "Specifies the caching requirements. Possible values are: **None,**\n**ReadOnly,** **ReadWrite.** The default values are: **None for Standard\nstorage. ReadOnly for Premium storage.**", + "type": { + "$ref": "162" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.AzureFleet.VirtualMachineScaleSetOSDisk.caching", + "serializationOptions": { + "$id": "802", + "json": { + "$id": "803", + "name": "caching" + } + } + }, + { + "$id": "804", + "kind": "property", + "name": "IsWriteAcceleratorEnabled", + "serializedName": "writeAcceleratorEnabled", + "doc": "Specifies whether writeAccelerator should be enabled or disabled on the disk.", + "type": { + "$id": "805", + "kind": "boolean", + "name": "boolean", + "crossLanguageDefinitionId": "TypeSpec.boolean", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.AzureFleet.VirtualMachineScaleSetOSDisk.writeAcceleratorEnabled", + "serializationOptions": { + "$id": "806", + "json": { + "$id": "807", + "name": "writeAcceleratorEnabled" + } + } + }, + { + "$id": "808", + "kind": "property", + "name": "createOption", + "serializedName": "createOption", + "doc": "Specifies how the virtual machines in the scale set should be created. The only\nallowed value is: **FromImage.** This value is used when you are using an image\nto create the virtual machine. If you are using a platform image, you also use\nthe imageReference element described above. If you are using a marketplace\nimage, you also use the plan element previously described.", + "type": { + "$ref": "170" + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.AzureFleet.VirtualMachineScaleSetOSDisk.createOption", + "serializationOptions": { + "$id": "809", + "json": { + "$id": "810", + "name": "createOption" + } + } + }, + { + "$id": "811", + "kind": "property", + "name": "diffDiskSettings", + "serializedName": "diffDiskSettings", + "doc": "Specifies the ephemeral disk Settings for the operating system disk used by the\nvirtual machine scale set.", + "type": { + "$id": "812", + "kind": "model", + "name": "ComputeFleetDiffDiskSettings", + "clientNamespace": "Microsoft.AzureFleet", + "crossLanguageDefinitionId": "Microsoft.AzureFleet.DiffDiskSettings", + "usage": "Input,Output,Json,LroInitial,LroPolling,LroFinalEnvelope", + "doc": "Describes the parameters of ephemeral disk settings that can be specified for\noperating system disk. **Note:** The ephemeral disk settings can only be\nspecified for managed disk.", + "decorators": [], + "properties": [ + { + "$id": "813", + "kind": "property", + "name": "option", + "serializedName": "option", + "doc": "Specifies the ephemeral disk settings for operating system disk.", + "type": { + "$ref": "182" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.AzureFleet.DiffDiskSettings.option", + "serializationOptions": { + "$id": "814", + "json": { + "$id": "815", + "name": "option" + } + } + }, + { + "$id": "816", + "kind": "property", + "name": "placement", + "serializedName": "placement", + "doc": "Specifies the ephemeral disk placement for operating system disk. Possible\nvalues are: **CacheDisk,** **ResourceDisk.** The defaulting behavior is:\n**CacheDisk** if one is configured for the VM size otherwise **ResourceDisk**\nis used. Refer to the VM size documentation for Windows VM at\nhttps://learn.microsoft.com/azure/virtual-machines/windows/sizes and Linux VM at\nhttps://learn.microsoft.com/azure/virtual-machines/linux/sizes to check which VM\nsizes exposes a cache disk.", + "type": { + "$ref": "186" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.AzureFleet.DiffDiskSettings.placement", + "serializationOptions": { + "$id": "817", + "json": { + "$id": "818", + "name": "placement" + } + } + } + ] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.AzureFleet.VirtualMachineScaleSetOSDisk.diffDiskSettings", + "serializationOptions": { + "$id": "819", + "json": { + "$id": "820", + "name": "diffDiskSettings" + } + } + }, + { + "$id": "821", + "kind": "property", + "name": "diskSizeGB", + "serializedName": "diskSizeGB", + "doc": "Specifies the size of an empty data disk in gigabytes. This element can be used\nto overwrite the size of the disk in a virtual machine image. The property 'diskSizeGB'\nis the number of bytes x 1024^3 for the disk and the value cannot\nbe larger than 1023.", + "type": { + "$id": "822", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.AzureFleet.VirtualMachineScaleSetOSDisk.diskSizeGB", + "serializationOptions": { + "$id": "823", + "json": { + "$id": "824", + "name": "diskSizeGB" + } + } + }, + { + "$id": "825", + "kind": "property", + "name": "osType", + "serializedName": "osType", + "doc": "This property allows you to specify the type of the OS that is included in the\ndisk if creating a VM from user-image or a specialized VHD. Possible values\nare: **Windows,** **Linux.**", + "type": { + "$ref": "194" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.AzureFleet.VirtualMachineScaleSetOSDisk.osType", + "serializationOptions": { + "$id": "826", + "json": { + "$id": "827", + "name": "osType" + } + } + }, + { + "$id": "828", + "kind": "property", + "name": "image", + "serializedName": "image", + "doc": "Specifies information about the unmanaged user image to base the scale set on.", + "type": { + "$id": "829", + "kind": "model", + "name": "ComputeFleetVirtualHardDisk", + "clientNamespace": "Microsoft.AzureFleet", + "crossLanguageDefinitionId": "Microsoft.AzureFleet.VirtualHardDisk", + "usage": "Input,Output,Json,LroInitial,LroPolling,LroFinalEnvelope", + "doc": "Describes the uri of a disk.", + "decorators": [], + "properties": [ + { + "$id": "830", + "kind": "property", + "name": "uri", + "serializedName": "uri", + "doc": "Specifies the virtual hard disk's uri.", + "type": { + "$id": "831", + "kind": "url", + "name": "url", + "crossLanguageDefinitionId": "TypeSpec.url", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.AzureFleet.VirtualHardDisk.uri", + "serializationOptions": { + "$id": "832", + "json": { + "$id": "833", + "name": "uri" + } + } + } + ] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.AzureFleet.VirtualMachineScaleSetOSDisk.image", + "serializationOptions": { + "$id": "834", + "json": { + "$id": "835", + "name": "image" + } + } + }, + { + "$id": "836", + "kind": "property", + "name": "vhdContainers", + "serializedName": "vhdContainers", + "doc": "Specifies the container urls that are used to store operating system disks for\nthe scale set.", + "type": { + "$id": "837", + "kind": "array", + "name": "Array", + "valueType": { + "$id": "838", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.AzureFleet.VirtualMachineScaleSetOSDisk.vhdContainers", + "serializationOptions": { + "$id": "839", + "json": { + "$id": "840", + "name": "vhdContainers" + } + } + }, + { + "$id": "841", + "kind": "property", + "name": "managedDisk", + "serializedName": "managedDisk", + "doc": "The managed disk parameters.", + "type": { + "$id": "842", + "kind": "model", + "name": "ComputeFleetVmssManagedDisk", + "clientNamespace": "Microsoft.AzureFleet", + "crossLanguageDefinitionId": "Microsoft.AzureFleet.VirtualMachineScaleSetManagedDiskParameters", + "usage": "Input,Output,Json,LroInitial,LroPolling,LroFinalEnvelope", + "doc": "Describes the parameters of a ScaleSet managed disk.", + "decorators": [], + "properties": [ + { + "$id": "843", + "kind": "property", + "name": "storageAccountType", + "serializedName": "storageAccountType", + "doc": "Specifies the storage account type for the managed disk. NOTE: UltraSSD_LRS can\nonly be used with data disks, it cannot be used with OS Disk.", + "type": { + "$ref": "200" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.AzureFleet.VirtualMachineScaleSetManagedDiskParameters.storageAccountType", + "serializationOptions": { + "$id": "844", + "json": { + "$id": "845", + "name": "storageAccountType" + } + } + }, + { + "$id": "846", + "kind": "property", + "name": "diskEncryptionSet", + "serializedName": "diskEncryptionSet", + "doc": "Specifies the customer managed disk encryption set resource id for the managed\ndisk.", + "type": { + "$id": "847", + "kind": "model", + "name": "DiskEncryptionSetParameters", + "clientNamespace": "Microsoft.AzureFleet", + "crossLanguageDefinitionId": "Microsoft.AzureFleet.DiskEncryptionSetParameters", + "usage": "Input,Output,Json,LroInitial,LroPolling,LroFinalEnvelope", + "doc": "Describes the parameter of customer managed disk encryption set resource id\nthat can be specified for disk. **Note:** The disk encryption set resource id\ncan only be specified for managed disk. Please refer\nhttps://aka.ms/mdssewithcmkoverview for more details.", + "decorators": [], + "properties": [ + { + "$id": "848", + "kind": "property", + "name": "id", + "serializedName": "id", + "doc": "Resource Id", + "type": { + "$id": "849", + "kind": "string", + "name": "armResourceIdentifier", + "crossLanguageDefinitionId": "Azure.Core.armResourceIdentifier", + "baseType": { + "$id": "850", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.AzureFleet.DiskEncryptionSetParameters.id", + "serializationOptions": { + "$id": "851", + "json": { + "$id": "852", + "name": "id" + } + } + } + ] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.AzureFleet.VirtualMachineScaleSetManagedDiskParameters.diskEncryptionSet", + "serializationOptions": { + "$id": "853", + "json": { + "$id": "854", + "name": "diskEncryptionSet" + } + } + }, + { + "$id": "855", + "kind": "property", + "name": "securityProfile", + "serializedName": "securityProfile", + "doc": "Specifies the security profile for the managed disk.", + "type": { + "$id": "856", + "kind": "model", + "name": "ComputeFleetVMDiskSecurityProfile", + "clientNamespace": "Microsoft.AzureFleet", + "crossLanguageDefinitionId": "Microsoft.AzureFleet.VMDiskSecurityProfile", + "usage": "Input,Output,Json,LroInitial,LroPolling,LroFinalEnvelope", + "doc": "Specifies the security profile settings for the managed disk. **Note:** It can\nonly be set for Confidential VMs.", + "decorators": [], + "properties": [ + { + "$id": "857", + "kind": "property", + "name": "securityEncryptionType", + "serializedName": "securityEncryptionType", + "doc": "Specifies the EncryptionType of the managed disk. It is set to\nDiskWithVMGuestState for encryption of the managed disk along with VMGuestState\nblob, VMGuestStateOnly for encryption of just the VMGuestState blob, and\nNonPersistedTPM for not persisting firmware state in the VMGuestState blob..\n**Note:** It can be set for only Confidential VMs.", + "type": { + "$ref": "216" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.AzureFleet.VMDiskSecurityProfile.securityEncryptionType", + "serializationOptions": { + "$id": "858", + "json": { + "$id": "859", + "name": "securityEncryptionType" + } + } + }, + { + "$id": "860", + "kind": "property", + "name": "diskEncryptionSet", + "serializedName": "diskEncryptionSet", + "doc": "Specifies the customer managed disk encryption set resource id for the managed\ndisk that is used for Customer Managed Key encrypted ConfidentialVM OS Disk and\nVMGuest blob.", + "type": { + "$ref": "847" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.AzureFleet.VMDiskSecurityProfile.diskEncryptionSet", + "serializationOptions": { + "$id": "861", + "json": { + "$id": "862", + "name": "diskEncryptionSet" + } + } + } + ] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.AzureFleet.VirtualMachineScaleSetManagedDiskParameters.securityProfile", + "serializationOptions": { + "$id": "863", + "json": { + "$id": "864", + "name": "securityProfile" + } + } + } + ] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.AzureFleet.VirtualMachineScaleSetOSDisk.managedDisk", + "serializationOptions": { + "$id": "865", + "json": { + "$id": "866", + "name": "managedDisk" + } + } + }, + { + "$id": "867", + "kind": "property", + "name": "deleteOption", + "serializedName": "deleteOption", + "doc": "Specifies whether OS Disk should be deleted or detached upon VMSS Flex deletion\n(This feature is available for VMSS with Flexible OrchestrationMode only).\n

Possible values:

**Delete** If this value is used, the OS\ndisk is deleted when VMSS Flex VM is deleted.

**Detach** If this value\nis used, the OS disk is retained after VMSS Flex VM is deleted.

The\ndefault value is set to **Delete**. For an Ephemeral OS Disk, the default value\nis set to **Delete**. User cannot change the delete option for Ephemeral OS\nDisk.", + "type": { + "$ref": "224" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.AzureFleet.VirtualMachineScaleSetOSDisk.deleteOption", + "serializationOptions": { + "$id": "868", + "json": { + "$id": "869", + "name": "deleteOption" + } + } + } + ] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.AzureFleet.VirtualMachineScaleSetStorageProfile.osDisk", + "serializationOptions": { + "$id": "870", + "json": { + "$id": "871", + "name": "osDisk" + } + } + }, + { + "$id": "872", + "kind": "property", + "name": "dataDisks", + "serializedName": "dataDisks", + "doc": "Specifies the parameters that are used to add data disks to the virtual\nmachines in the scale set. For more information about disks, see [About disks\nand VHDs for Azure virtual\nmachines](https://learn.microsoft.com/azure/virtual-machines/managed-disks-overview).", + "type": { + "$id": "873", + "kind": "array", + "name": "ArrayVirtualMachineScaleSetDataDisk", + "valueType": { + "$id": "874", + "kind": "model", + "name": "ComputeFleetVmssDataDisk", + "clientNamespace": "Microsoft.AzureFleet", + "crossLanguageDefinitionId": "Microsoft.AzureFleet.VirtualMachineScaleSetDataDisk", + "usage": "Input,Output,Json,LroInitial,LroPolling,LroFinalEnvelope", + "doc": "Describes a virtual machine scale set data disk.", + "decorators": [], + "properties": [ + { + "$id": "875", + "kind": "property", + "name": "name", + "serializedName": "name", + "doc": "The disk name.", + "type": { + "$id": "876", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.AzureFleet.VirtualMachineScaleSetDataDisk.name", + "serializationOptions": { + "$id": "877", + "json": { + "$id": "878", + "name": "name" + } + } + }, + { + "$id": "879", + "kind": "property", + "name": "lun", + "serializedName": "lun", + "doc": "Specifies the logical unit number of the data disk. This value is used to\nidentify data disks within the VM and therefore must be unique for each data\ndisk attached to a VM.", + "type": { + "$id": "880", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.AzureFleet.VirtualMachineScaleSetDataDisk.lun", + "serializationOptions": { + "$id": "881", + "json": { + "$id": "882", + "name": "lun" + } + } + }, + { + "$id": "883", + "kind": "property", + "name": "caching", + "serializedName": "caching", + "doc": "Specifies the caching requirements. Possible values are: **None,**\n**ReadOnly,** **ReadWrite.** The default values are: **None for Standard\nstorage. ReadOnly for Premium storage.**", + "type": { + "$ref": "162" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.AzureFleet.VirtualMachineScaleSetDataDisk.caching", + "serializationOptions": { + "$id": "884", + "json": { + "$id": "885", + "name": "caching" + } + } + }, + { + "$id": "886", + "kind": "property", + "name": "IsWriteAcceleratorEnabled", + "serializedName": "writeAcceleratorEnabled", + "doc": "Specifies whether writeAccelerator should be enabled or disabled on the disk.", + "type": { + "$id": "887", + "kind": "boolean", + "name": "boolean", + "crossLanguageDefinitionId": "TypeSpec.boolean", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.AzureFleet.VirtualMachineScaleSetDataDisk.writeAcceleratorEnabled", + "serializationOptions": { + "$id": "888", + "json": { + "$id": "889", + "name": "writeAcceleratorEnabled" + } + } + }, + { + "$id": "890", + "kind": "property", + "name": "createOption", + "serializedName": "createOption", + "doc": "The create option.", + "type": { + "$ref": "170" + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.AzureFleet.VirtualMachineScaleSetDataDisk.createOption", + "serializationOptions": { + "$id": "891", + "json": { + "$id": "892", + "name": "createOption" + } + } + }, + { + "$id": "893", + "kind": "property", + "name": "diskSizeGB", + "serializedName": "diskSizeGB", + "doc": "Specifies the size of an empty data disk in gigabytes. This element can be used\nto overwrite the size of the disk in a virtual machine image. The property\ndiskSizeGB is the number of bytes x 1024^3 for the disk and the value cannot be\nlarger than 1023.", + "type": { + "$id": "894", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.AzureFleet.VirtualMachineScaleSetDataDisk.diskSizeGB", + "serializationOptions": { + "$id": "895", + "json": { + "$id": "896", + "name": "diskSizeGB" + } + } + }, + { + "$id": "897", + "kind": "property", + "name": "managedDisk", + "serializedName": "managedDisk", + "doc": "The managed disk parameters.", + "type": { + "$ref": "842" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.AzureFleet.VirtualMachineScaleSetDataDisk.managedDisk", + "serializationOptions": { + "$id": "898", + "json": { + "$id": "899", + "name": "managedDisk" + } + } + }, + { + "$id": "900", + "kind": "property", + "name": "DiskIopsReadWrite", + "serializedName": "diskIOPSReadWrite", + "doc": "Specifies the Read-Write IOPS for the managed disk. Should be used only when\nStorageAccountType is UltraSSD_LRS. If not specified, a default value would be\nassigned based on diskSizeGB.", + "type": { + "$id": "901", + "kind": "int64", + "name": "int64", + "crossLanguageDefinitionId": "TypeSpec.int64", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.AzureFleet.VirtualMachineScaleSetDataDisk.diskIOPSReadWrite", + "serializationOptions": { + "$id": "902", + "json": { + "$id": "903", + "name": "diskIOPSReadWrite" + } + } + }, + { + "$id": "904", + "kind": "property", + "name": "DiskMbpsReadWrite", + "serializedName": "diskMBpsReadWrite", + "doc": "Specifies the bandwidth in MB per second for the managed disk. Should be used\nonly when StorageAccountType is UltraSSD_LRS. If not specified, a default value\nwould be assigned based on diskSizeGB.", + "type": { + "$id": "905", + "kind": "int64", + "name": "int64", + "crossLanguageDefinitionId": "TypeSpec.int64", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.AzureFleet.VirtualMachineScaleSetDataDisk.diskMBpsReadWrite", + "serializationOptions": { + "$id": "906", + "json": { + "$id": "907", + "name": "diskMBpsReadWrite" + } + } + }, + { + "$id": "908", + "kind": "property", + "name": "deleteOption", + "serializedName": "deleteOption", + "doc": "Specifies whether data disk should be deleted or detached upon VMSS Flex\ndeletion (This feature is available for VMSS with Flexible OrchestrationMode\nonly).

Possible values:

**Delete** If this value is used, the\ndata disk is deleted when the VMSS Flex VM is deleted.

**Detach** If\nthis value is used, the data disk is retained after VMSS Flex VM is\ndeleted.

The default value is set to **Delete**.", + "type": { + "$ref": "224" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.AzureFleet.VirtualMachineScaleSetDataDisk.deleteOption", + "serializationOptions": { + "$id": "909", + "json": { + "$id": "910", + "name": "deleteOption" + } + } + } + ] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.AzureFleet.VirtualMachineScaleSetStorageProfile.dataDisks", + "serializationOptions": { + "$id": "911", + "json": { + "$id": "912", + "name": "dataDisks" + } + } + }, + { + "$id": "913", + "kind": "property", + "name": "diskControllerType", + "serializedName": "diskControllerType", + "doc": "Specifies the disk controller type configured for the virtual machines in the scale set. Minimum api-version: 2022-08-01", + "type": { + "$ref": "230" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.AzureFleet.VirtualMachineScaleSetStorageProfile.diskControllerType", + "serializationOptions": { + "$id": "914", + "json": { + "$id": "915", + "name": "diskControllerType" + } + } + } + ] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.AzureFleet.BaseVirtualMachineProfile.storageProfile", + "serializationOptions": { + "$id": "916", + "json": { + "$id": "917", + "name": "storageProfile" + } + } + }, + { + "$id": "918", + "kind": "property", + "name": "networkProfile", + "serializedName": "networkProfile", + "doc": "Specifies properties of the network interfaces of the virtual machines in the\nscale set.", + "type": { + "$id": "919", + "kind": "model", + "name": "ComputeFleetVmssNetworkProfile", + "clientNamespace": "Microsoft.AzureFleet", + "crossLanguageDefinitionId": "Microsoft.AzureFleet.VirtualMachineScaleSetNetworkProfile", + "usage": "Input,Output,Json,LroInitial,LroPolling,LroFinalEnvelope", + "doc": "Describes a virtual machine scale set network profile.", + "decorators": [], + "properties": [ + { + "$id": "920", + "kind": "property", + "name": "healthProbe", + "serializedName": "healthProbe", + "doc": "A reference to a load balancer probe used to determine the health of an\ninstance in the virtual machine scale set. The reference will be in the form:\n'/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/probes/{probeName}'.", + "type": { + "$id": "921", + "kind": "model", + "name": "ApiEntityReference", + "clientNamespace": "Microsoft.AzureFleet", + "crossLanguageDefinitionId": "Microsoft.AzureFleet.ApiEntityReference", + "usage": "Input,Output,Json,LroInitial,LroPolling,LroFinalEnvelope", + "doc": "The API entity reference.", + "decorators": [], + "properties": [ + { + "$id": "922", + "kind": "property", + "name": "id", + "serializedName": "id", + "doc": "The ARM resource id in the form of\n/subscriptions/{SubscriptionId}/resourceGroups/{ResourceGroupName}/...", + "type": { + "$id": "923", + "kind": "string", + "name": "armResourceIdentifier", + "crossLanguageDefinitionId": "Azure.Core.armResourceIdentifier", + "baseType": { + "$id": "924", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.AzureFleet.ApiEntityReference.id", + "serializationOptions": { + "$id": "925", + "json": { + "$id": "926", + "name": "id" + } + } + } + ] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.AzureFleet.VirtualMachineScaleSetNetworkProfile.healthProbe", + "serializationOptions": { + "$id": "927", + "json": { + "$id": "928", + "name": "healthProbe" + } + } + }, + { + "$id": "929", + "kind": "property", + "name": "networkInterfaceConfigurations", + "serializedName": "networkInterfaceConfigurations", + "doc": "The list of network configurations.", + "type": { + "$id": "930", + "kind": "array", + "name": "ArrayVirtualMachineScaleSetNetworkConfiguration", + "valueType": { + "$id": "931", + "kind": "model", + "name": "ComputeFleetVmssNetworkConfiguration", + "clientNamespace": "Microsoft.AzureFleet", + "crossLanguageDefinitionId": "Microsoft.AzureFleet.VirtualMachineScaleSetNetworkConfiguration", + "usage": "Input,Output,Json,LroInitial,LroPolling,LroFinalEnvelope", + "doc": "Describes a virtual machine scale set network profile's network configurations.", + "decorators": [], + "properties": [ + { + "$id": "932", + "kind": "property", + "name": "name", + "serializedName": "name", + "doc": "The network configuration name.", + "type": { + "$id": "933", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.AzureFleet.VirtualMachineScaleSetNetworkConfiguration.name", + "serializationOptions": { + "$id": "934", + "json": { + "$id": "935", + "name": "name" + } + } + }, + { + "$id": "936", + "kind": "property", + "name": "properties", + "serializedName": "properties", + "doc": "Describes a virtual machine scale set network profile's IP configuration.", + "type": { + "$id": "937", + "kind": "model", + "name": "ComputeFleetVmssNetworkConfigurationProperties", + "clientNamespace": "Microsoft.AzureFleet", + "crossLanguageDefinitionId": "Microsoft.AzureFleet.VirtualMachineScaleSetNetworkConfigurationProperties", + "usage": "Input,Output,Json,LroInitial,LroPolling,LroFinalEnvelope", + "doc": "Describes a virtual machine scale set network profile's IP configuration.", + "decorators": [], + "properties": [ + { + "$id": "938", + "kind": "property", + "name": "IsPrimary", + "serializedName": "primary", + "doc": "Specifies the primary network interface in case the virtual machine has more\nthan 1 network interface.", + "type": { + "$id": "939", + "kind": "boolean", + "name": "boolean", + "crossLanguageDefinitionId": "TypeSpec.boolean", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.AzureFleet.VirtualMachineScaleSetNetworkConfigurationProperties.primary", + "serializationOptions": { + "$id": "940", + "json": { + "$id": "941", + "name": "primary" + } + } + }, + { + "$id": "942", + "kind": "property", + "name": "IsAcceleratedNetworkingEnabled", + "serializedName": "enableAcceleratedNetworking", + "doc": "Specifies whether the network interface is accelerated networking-enabled.", + "type": { + "$id": "943", + "kind": "boolean", + "name": "boolean", + "crossLanguageDefinitionId": "TypeSpec.boolean", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.AzureFleet.VirtualMachineScaleSetNetworkConfigurationProperties.enableAcceleratedNetworking", + "serializationOptions": { + "$id": "944", + "json": { + "$id": "945", + "name": "enableAcceleratedNetworking" + } + } + }, + { + "$id": "946", + "kind": "property", + "name": "IsTcpStateTrackingDisabled", + "serializedName": "disableTcpStateTracking", + "doc": "Specifies whether the network interface is disabled for tcp state tracking.", + "type": { + "$id": "947", + "kind": "boolean", + "name": "boolean", + "crossLanguageDefinitionId": "TypeSpec.boolean", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.AzureFleet.VirtualMachineScaleSetNetworkConfigurationProperties.disableTcpStateTracking", + "serializationOptions": { + "$id": "948", + "json": { + "$id": "949", + "name": "disableTcpStateTracking" + } + } + }, + { + "$id": "950", + "kind": "property", + "name": "IsFpgaEnabled", + "serializedName": "enableFpga", + "doc": "Specifies whether the network interface is FPGA networking-enabled.", + "type": { + "$id": "951", + "kind": "boolean", + "name": "boolean", + "crossLanguageDefinitionId": "TypeSpec.boolean", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.AzureFleet.VirtualMachineScaleSetNetworkConfigurationProperties.enableFpga", + "serializationOptions": { + "$id": "952", + "json": { + "$id": "953", + "name": "enableFpga" + } + } + }, + { + "$id": "954", + "kind": "property", + "name": "networkSecurityGroup", + "serializedName": "networkSecurityGroup", + "doc": "The network security group.", + "type": { + "$ref": "723" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.AzureFleet.VirtualMachineScaleSetNetworkConfigurationProperties.networkSecurityGroup", + "serializationOptions": { + "$id": "955", + "json": { + "$id": "956", + "name": "networkSecurityGroup" + } + } + }, + { + "$id": "957", + "kind": "property", + "name": "dnsSettings", + "serializedName": "dnsSettings", + "doc": "The dns settings to be applied on the network interfaces.", + "type": { + "$id": "958", + "kind": "model", + "name": "ComputeFleetVmssNetworkDnsSettings", + "clientNamespace": "Microsoft.AzureFleet", + "crossLanguageDefinitionId": "Microsoft.AzureFleet.VirtualMachineScaleSetNetworkConfigurationDnsSettings", + "usage": "Input,Output,Json,LroInitial,LroPolling,LroFinalEnvelope", + "doc": "Describes a virtual machines scale sets network configuration's DNS settings.", + "decorators": [], + "properties": [ + { + "$id": "959", + "kind": "property", + "name": "dnsServers", + "serializedName": "dnsServers", + "doc": "List of DNS servers IP addresses", + "type": { + "$id": "960", + "kind": "array", + "name": "Array", + "valueType": { + "$id": "961", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.AzureFleet.VirtualMachineScaleSetNetworkConfigurationDnsSettings.dnsServers", + "serializationOptions": { + "$id": "962", + "json": { + "$id": "963", + "name": "dnsServers" + } + } + } + ] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.AzureFleet.VirtualMachineScaleSetNetworkConfigurationProperties.dnsSettings", + "serializationOptions": { + "$id": "964", + "json": { + "$id": "965", + "name": "dnsSettings" + } + } + }, + { + "$id": "966", + "kind": "property", + "name": "ipConfigurations", + "serializedName": "ipConfigurations", + "doc": "Specifies the IP configurations of the network interface.", + "type": { + "$id": "967", + "kind": "array", + "name": "ArrayVirtualMachineScaleSetIpConfiguration", + "valueType": { + "$id": "968", + "kind": "model", + "name": "ComputeFleetVmssIPConfiguration", + "clientNamespace": "Microsoft.AzureFleet", + "crossLanguageDefinitionId": "Microsoft.AzureFleet.VirtualMachineScaleSetIPConfiguration", + "usage": "Input,Output,Json,LroInitial,LroPolling,LroFinalEnvelope", + "doc": "Describes a virtual machine scale set network profile's IP configuration.", + "decorators": [], + "properties": [ + { + "$id": "969", + "kind": "property", + "name": "name", + "serializedName": "name", + "doc": "The IP configuration name.", + "type": { + "$id": "970", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.AzureFleet.VirtualMachineScaleSetIPConfiguration.name", + "serializationOptions": { + "$id": "971", + "json": { + "$id": "972", + "name": "name" + } + } + }, + { + "$id": "973", + "kind": "property", + "name": "properties", + "serializedName": "properties", + "doc": "Describes a virtual machine scale set network profile's IP configuration\nproperties.", + "type": { + "$id": "974", + "kind": "model", + "name": "ComputeFleetVmssIPConfigurationProperties", + "clientNamespace": "Microsoft.AzureFleet", + "crossLanguageDefinitionId": "Microsoft.AzureFleet.VirtualMachineScaleSetIPConfigurationProperties", + "usage": "Input,Output,Json,LroInitial,LroPolling,LroFinalEnvelope", + "doc": "Describes a virtual machine scale set network profile's IP configuration\nproperties.", + "decorators": [], + "properties": [ + { + "$id": "975", + "kind": "property", + "name": "subnet", + "serializedName": "subnet", + "doc": "Specifies the identifier of the subnet.", + "type": { + "$ref": "921" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.AzureFleet.VirtualMachineScaleSetIPConfigurationProperties.subnet", + "serializationOptions": { + "$id": "976", + "json": { + "$id": "977", + "name": "subnet" + } + } + }, + { + "$id": "978", + "kind": "property", + "name": "IsPrimary", + "serializedName": "primary", + "doc": "Specifies the primary network interface in case the virtual machine has more\nthan 1 network interface.", + "type": { + "$id": "979", + "kind": "boolean", + "name": "boolean", + "crossLanguageDefinitionId": "TypeSpec.boolean", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.AzureFleet.VirtualMachineScaleSetIPConfigurationProperties.primary", + "serializationOptions": { + "$id": "980", + "json": { + "$id": "981", + "name": "primary" + } + } + }, + { + "$id": "982", + "kind": "property", + "name": "publicIPAddressConfiguration", + "serializedName": "publicIPAddressConfiguration", + "doc": "The publicIPAddressConfiguration.", + "type": { + "$id": "983", + "kind": "model", + "name": "ComputeFleetVmssPublicIPAddressConfiguration", + "clientNamespace": "Microsoft.AzureFleet", + "crossLanguageDefinitionId": "Microsoft.AzureFleet.VirtualMachineScaleSetPublicIPAddressConfiguration", + "usage": "Input,Output,Json,LroInitial,LroPolling,LroFinalEnvelope", + "doc": "Describes a virtual machines scale set IP Configuration's PublicIPAddress\nconfiguration", + "decorators": [], + "properties": [ + { + "$id": "984", + "kind": "property", + "name": "name", + "serializedName": "name", + "doc": "The publicIP address configuration name.", + "type": { + "$id": "985", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.AzureFleet.VirtualMachineScaleSetPublicIPAddressConfiguration.name", + "serializationOptions": { + "$id": "986", + "json": { + "$id": "987", + "name": "name" + } + } + }, + { + "$id": "988", + "kind": "property", + "name": "properties", + "serializedName": "properties", + "doc": "Describes a virtual machines scale set IP Configuration's PublicIPAddress\nconfiguration", + "type": { + "$id": "989", + "kind": "model", + "name": "ComputeFleetVmssPublicIPAddressConfigurationProperties", + "clientNamespace": "Microsoft.AzureFleet", + "crossLanguageDefinitionId": "Microsoft.AzureFleet.VirtualMachineScaleSetPublicIPAddressConfigurationProperties", + "usage": "Input,Output,Json,LroInitial,LroPolling,LroFinalEnvelope", + "doc": "Describes a virtual machines scale set IP Configuration's PublicIPAddress\nconfiguration", + "decorators": [], + "properties": [ + { + "$id": "990", + "kind": "property", + "name": "idleTimeoutInMinutes", + "serializedName": "idleTimeoutInMinutes", + "doc": "The idle timeout of the public IP address.", + "type": { + "$id": "991", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.AzureFleet.VirtualMachineScaleSetPublicIPAddressConfigurationProperties.idleTimeoutInMinutes", + "serializationOptions": { + "$id": "992", + "json": { + "$id": "993", + "name": "idleTimeoutInMinutes" + } + } + }, + { + "$id": "994", + "kind": "property", + "name": "dnsSettings", + "serializedName": "dnsSettings", + "doc": "The dns settings to be applied on the publicIP addresses .", + "type": { + "$id": "995", + "kind": "model", + "name": "ComputeFleetVmssPublicIPAddressDnsSettings", + "clientNamespace": "Microsoft.AzureFleet", + "crossLanguageDefinitionId": "Microsoft.AzureFleet.VirtualMachineScaleSetPublicIPAddressConfigurationDnsSettings", + "usage": "Input,Output,Json,LroInitial,LroPolling,LroFinalEnvelope", + "doc": "Describes a virtual machines scale sets network configuration's DNS settings.", + "decorators": [], + "properties": [ + { + "$id": "996", + "kind": "property", + "name": "domainNameLabel", + "serializedName": "domainNameLabel", + "doc": "The Domain name label.The concatenation of the domain name label and vm index\nwill be the domain name labels of the PublicIPAddress resources that will be\ncreated", + "type": { + "$id": "997", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.AzureFleet.VirtualMachineScaleSetPublicIPAddressConfigurationDnsSettings.domainNameLabel", + "serializationOptions": { + "$id": "998", + "json": { + "$id": "999", + "name": "domainNameLabel" + } + } + }, + { + "$id": "1000", + "kind": "property", + "name": "domainNameLabelScope", + "serializedName": "domainNameLabelScope", + "doc": "The Domain name label scope.The concatenation of the hashed domain name label\nthat generated according to the policy from domain name label scope and vm\nindex will be the domain name labels of the PublicIPAddress resources that will\nbe created", + "type": { + "$ref": "236" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.AzureFleet.VirtualMachineScaleSetPublicIPAddressConfigurationDnsSettings.domainNameLabelScope", + "serializationOptions": { + "$id": "1001", + "json": { + "$id": "1002", + "name": "domainNameLabelScope" + } + } + } + ] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.AzureFleet.VirtualMachineScaleSetPublicIPAddressConfigurationProperties.dnsSettings", + "serializationOptions": { + "$id": "1003", + "json": { + "$id": "1004", + "name": "dnsSettings" + } + } + }, + { + "$id": "1005", + "kind": "property", + "name": "ipTags", + "serializedName": "ipTags", + "doc": "The list of IP tags associated with the public IP address.", + "type": { + "$id": "1006", + "kind": "array", + "name": "ArrayVirtualMachineScaleSetIpTag", + "valueType": { + "$id": "1007", + "kind": "model", + "name": "ComputeFleetVmssIPTag", + "clientNamespace": "Microsoft.AzureFleet", + "crossLanguageDefinitionId": "Microsoft.AzureFleet.VirtualMachineScaleSetIpTag", + "usage": "Input,Output,Json,LroInitial,LroPolling,LroFinalEnvelope", + "doc": "Contains the IP tag associated with the public IP address.", + "decorators": [], + "properties": [ + { + "$id": "1008", + "kind": "property", + "name": "ipTagType", + "serializedName": "ipTagType", + "doc": "IP tag type. Example: FirstPartyUsage.", + "type": { + "$id": "1009", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.AzureFleet.VirtualMachineScaleSetIpTag.ipTagType", + "serializationOptions": { + "$id": "1010", + "json": { + "$id": "1011", + "name": "ipTagType" + } + } + }, + { + "$id": "1012", + "kind": "property", + "name": "tag", + "serializedName": "tag", + "doc": "IP tag associated with the public IP. Example: SQL, Storage etc.", + "type": { + "$id": "1013", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.AzureFleet.VirtualMachineScaleSetIpTag.tag", + "serializationOptions": { + "$id": "1014", + "json": { + "$id": "1015", + "name": "tag" + } + } + } + ] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.AzureFleet.VirtualMachineScaleSetPublicIPAddressConfigurationProperties.ipTags", + "serializationOptions": { + "$id": "1016", + "json": { + "$id": "1017", + "name": "ipTags" + } + } + }, + { + "$id": "1018", + "kind": "property", + "name": "publicIPPrefix", + "serializedName": "publicIPPrefix", + "doc": "The PublicIPPrefix from which to allocate publicIP addresses.", + "type": { + "$ref": "723" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.AzureFleet.VirtualMachineScaleSetPublicIPAddressConfigurationProperties.publicIPPrefix", + "serializationOptions": { + "$id": "1019", + "json": { + "$id": "1020", + "name": "publicIPPrefix" + } + } + }, + { + "$id": "1021", + "kind": "property", + "name": "publicIPAddressVersion", + "serializedName": "publicIPAddressVersion", + "doc": "Available from Api-Version 2019-07-01 onwards, it represents whether the\nspecific ipconfiguration is IPv4 or IPv6. Default is taken as IPv4. Possible\nvalues are: 'IPv4' and 'IPv6'.", + "type": { + "$ref": "246" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.AzureFleet.VirtualMachineScaleSetPublicIPAddressConfigurationProperties.publicIPAddressVersion", + "serializationOptions": { + "$id": "1022", + "json": { + "$id": "1023", + "name": "publicIPAddressVersion" + } + } + }, + { + "$id": "1024", + "kind": "property", + "name": "deleteOption", + "serializedName": "deleteOption", + "doc": "Specify what happens to the public IP when the VM is deleted", + "type": { + "$ref": "252" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.AzureFleet.VirtualMachineScaleSetPublicIPAddressConfigurationProperties.deleteOption", + "serializationOptions": { + "$id": "1025", + "json": { + "$id": "1026", + "name": "deleteOption" + } + } + } + ] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.AzureFleet.VirtualMachineScaleSetPublicIPAddressConfiguration.properties", + "serializationOptions": { + "$id": "1027", + "json": { + "$id": "1028", + "name": "properties" + } + } + }, + { + "$id": "1029", + "kind": "property", + "name": "sku", + "serializedName": "sku", + "doc": "Describes the public IP Sku. It can only be set with OrchestrationMode as\nFlexible.", + "type": { + "$id": "1030", + "kind": "model", + "name": "ComputeFleetPublicIPAddressSku", + "clientNamespace": "Microsoft.AzureFleet", + "crossLanguageDefinitionId": "Microsoft.AzureFleet.PublicIPAddressSku", + "usage": "Input,Output,Json,LroInitial,LroPolling,LroFinalEnvelope", + "doc": "Describes the public IP Sku. It can only be set with OrchestrationMode as\nFlexible.", + "decorators": [], + "properties": [ + { + "$id": "1031", + "kind": "property", + "name": "name", + "serializedName": "name", + "doc": "Specify public IP sku name", + "type": { + "$ref": "258" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.AzureFleet.PublicIPAddressSku.name", + "serializationOptions": { + "$id": "1032", + "json": { + "$id": "1033", + "name": "name" + } + } + }, + { + "$id": "1034", + "kind": "property", + "name": "tier", + "serializedName": "tier", + "doc": "Specify public IP sku tier", + "type": { + "$ref": "264" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.AzureFleet.PublicIPAddressSku.tier", + "serializationOptions": { + "$id": "1035", + "json": { + "$id": "1036", + "name": "tier" + } + } + } + ] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.AzureFleet.VirtualMachineScaleSetPublicIPAddressConfiguration.sku", + "serializationOptions": { + "$id": "1037", + "json": { + "$id": "1038", + "name": "sku" + } + } + } + ] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.AzureFleet.VirtualMachineScaleSetIPConfigurationProperties.publicIPAddressConfiguration", + "serializationOptions": { + "$id": "1039", + "json": { + "$id": "1040", + "name": "publicIPAddressConfiguration" + } + } + }, + { + "$id": "1041", + "kind": "property", + "name": "privateIPAddressVersion", + "serializedName": "privateIPAddressVersion", + "doc": "Available from Api-Version 2017-03-30 onwards, it represents whether the\nspecific ipconfiguration is IPv4 or IPv6. Default is taken as IPv4. Possible\nvalues are: 'IPv4' and 'IPv6'.", + "type": { + "$ref": "246" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.AzureFleet.VirtualMachineScaleSetIPConfigurationProperties.privateIPAddressVersion", + "serializationOptions": { + "$id": "1042", + "json": { + "$id": "1043", + "name": "privateIPAddressVersion" + } + } + }, + { + "$id": "1044", + "kind": "property", + "name": "applicationGatewayBackendAddressPools", + "serializedName": "applicationGatewayBackendAddressPools", + "doc": "Specifies an array of references to backend address pools of application\ngateways. A scale set can reference backend address pools of multiple\napplication gateways. Multiple scale sets cannot use the same application\ngateway.", + "type": { + "$id": "1045", + "kind": "array", + "name": "ArraySubResource", + "valueType": { + "$ref": "723" + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.AzureFleet.VirtualMachineScaleSetIPConfigurationProperties.applicationGatewayBackendAddressPools", + "serializationOptions": { + "$id": "1046", + "json": { + "$id": "1047", + "name": "applicationGatewayBackendAddressPools" + } + } + }, + { + "$id": "1048", + "kind": "property", + "name": "applicationSecurityGroups", + "serializedName": "applicationSecurityGroups", + "doc": "Specifies an array of references to application security group.", + "type": { + "$id": "1049", + "kind": "array", + "name": "ArraySubResource", + "valueType": { + "$ref": "723" + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.AzureFleet.VirtualMachineScaleSetIPConfigurationProperties.applicationSecurityGroups", + "serializationOptions": { + "$id": "1050", + "json": { + "$id": "1051", + "name": "applicationSecurityGroups" + } + } + }, + { + "$id": "1052", + "kind": "property", + "name": "loadBalancerBackendAddressPools", + "serializedName": "loadBalancerBackendAddressPools", + "doc": "Specifies an array of references to backend address pools of load balancers. A\nscale set can reference backend address pools of one public and one internal\nload balancer. Multiple scale sets cannot use the same basic sku load balancer.", + "type": { + "$id": "1053", + "kind": "array", + "name": "ArraySubResource", + "valueType": { + "$ref": "723" + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.AzureFleet.VirtualMachineScaleSetIPConfigurationProperties.loadBalancerBackendAddressPools", + "serializationOptions": { + "$id": "1054", + "json": { + "$id": "1055", + "name": "loadBalancerBackendAddressPools" + } + } + }, + { + "$id": "1056", + "kind": "property", + "name": "loadBalancerInboundNatPools", + "serializedName": "loadBalancerInboundNatPools", + "doc": "Specifies an array of references to inbound Nat pools of the load balancers. A\nscale set can reference inbound nat pools of one public and one internal load\nbalancer. Multiple scale sets cannot use the same basic sku load balancer.", + "type": { + "$id": "1057", + "kind": "array", + "name": "ArraySubResource", + "valueType": { + "$ref": "723" + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.AzureFleet.VirtualMachineScaleSetIPConfigurationProperties.loadBalancerInboundNatPools", + "serializationOptions": { + "$id": "1058", + "json": { + "$id": "1059", + "name": "loadBalancerInboundNatPools" + } + } + } + ] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.AzureFleet.VirtualMachineScaleSetIPConfiguration.properties", + "serializationOptions": { + "$id": "1060", + "json": { + "$id": "1061", + "name": "properties" + } + } + } + ] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.AzureFleet.VirtualMachineScaleSetNetworkConfigurationProperties.ipConfigurations", + "serializationOptions": { + "$id": "1062", + "json": { + "$id": "1063", + "name": "ipConfigurations" + } + } + }, + { + "$id": "1064", + "kind": "property", + "name": "IsIPForwardingEnabled", + "serializedName": "enableIPForwarding", + "doc": "Whether IP forwarding enabled on this NIC.", + "type": { + "$id": "1065", + "kind": "boolean", + "name": "boolean", + "crossLanguageDefinitionId": "TypeSpec.boolean", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.AzureFleet.VirtualMachineScaleSetNetworkConfigurationProperties.enableIPForwarding", + "serializationOptions": { + "$id": "1066", + "json": { + "$id": "1067", + "name": "enableIPForwarding" + } + } + }, + { + "$id": "1068", + "kind": "property", + "name": "deleteOption", + "serializedName": "deleteOption", + "doc": "Specify what happens to the network interface when the VM is deleted", + "type": { + "$ref": "252" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.AzureFleet.VirtualMachineScaleSetNetworkConfigurationProperties.deleteOption", + "serializationOptions": { + "$id": "1069", + "json": { + "$id": "1070", + "name": "deleteOption" + } + } + }, + { + "$id": "1071", + "kind": "property", + "name": "auxiliaryMode", + "serializedName": "auxiliaryMode", + "doc": "Specifies whether the Auxiliary mode is enabled for the Network Interface\nresource.", + "type": { + "$ref": "270" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.AzureFleet.VirtualMachineScaleSetNetworkConfigurationProperties.auxiliaryMode", + "serializationOptions": { + "$id": "1072", + "json": { + "$id": "1073", + "name": "auxiliaryMode" + } + } + }, + { + "$id": "1074", + "kind": "property", + "name": "auxiliarySku", + "serializedName": "auxiliarySku", + "doc": "Specifies whether the Auxiliary sku is enabled for the Network Interface\nresource.", + "type": { + "$ref": "278" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.AzureFleet.VirtualMachineScaleSetNetworkConfigurationProperties.auxiliarySku", + "serializationOptions": { + "$id": "1075", + "json": { + "$id": "1076", + "name": "auxiliarySku" + } + } + } + ] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.AzureFleet.VirtualMachineScaleSetNetworkConfiguration.properties", + "serializationOptions": { + "$id": "1077", + "json": { + "$id": "1078", + "name": "properties" + } + } + } + ] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.AzureFleet.VirtualMachineScaleSetNetworkProfile.networkInterfaceConfigurations", + "serializationOptions": { + "$id": "1079", + "json": { + "$id": "1080", + "name": "networkInterfaceConfigurations" + } + } + }, + { + "$id": "1081", + "kind": "property", + "name": "networkApiVersion", + "serializedName": "networkApiVersion", + "doc": "specifies the Microsoft.Network API version used when creating networking\nresources in the Network Interface Configurations for Virtual Machine Scale Set\nwith orchestration mode 'Flexible'", + "type": { + "$ref": "290" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.AzureFleet.VirtualMachineScaleSetNetworkProfile.networkApiVersion", + "serializationOptions": { + "$id": "1082", + "json": { + "$id": "1083", + "name": "networkApiVersion" + } + } + } + ] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.AzureFleet.BaseVirtualMachineProfile.networkProfile", + "serializationOptions": { + "$id": "1084", + "json": { + "$id": "1085", + "name": "networkProfile" + } + } + }, + { + "$id": "1086", + "kind": "property", + "name": "securityProfile", + "serializedName": "securityProfile", + "doc": "Specifies the Security related profile settings for the virtual machines in the\nscale set.", + "type": { + "$id": "1087", + "kind": "model", + "name": "ComputeFleetSecurityProfile", + "clientNamespace": "Microsoft.AzureFleet", + "crossLanguageDefinitionId": "Microsoft.AzureFleet.SecurityProfile", + "usage": "Input,Output,Json,LroInitial,LroPolling,LroFinalEnvelope", + "doc": "Specifies the Security profile settings for the virtual machine or virtual\nmachine scale set.", + "decorators": [], + "properties": [ + { + "$id": "1088", + "kind": "property", + "name": "uefiSettings", + "serializedName": "uefiSettings", + "doc": "Specifies the security settings like secure boot and vTPM used while creating\nthe virtual machine. Minimum api-version: 2020-12-01.", + "type": { + "$id": "1089", + "kind": "model", + "name": "ComputeFleetUefiSettings", + "clientNamespace": "Microsoft.AzureFleet", + "crossLanguageDefinitionId": "Microsoft.AzureFleet.UefiSettings", + "usage": "Input,Output,Json,LroInitial,LroPolling,LroFinalEnvelope", + "doc": "Specifies the security settings like secure boot and vTPM used while creating\nthe virtual machine. Minimum api-version: 2020-12-01.", + "decorators": [], + "properties": [ + { + "$id": "1090", + "kind": "property", + "name": "IsSecureBootEnabled", + "serializedName": "secureBootEnabled", + "doc": "Specifies whether secure boot should be enabled on the virtual machine. Minimum\napi-version: 2020-12-01.", + "type": { + "$id": "1091", + "kind": "boolean", + "name": "boolean", + "crossLanguageDefinitionId": "TypeSpec.boolean", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.AzureFleet.UefiSettings.secureBootEnabled", + "serializationOptions": { + "$id": "1092", + "json": { + "$id": "1093", + "name": "secureBootEnabled" + } + } + }, + { + "$id": "1094", + "kind": "property", + "name": "IsVTpmEnabled", + "serializedName": "vTpmEnabled", + "doc": "Specifies whether vTPM should be enabled on the virtual machine. Minimum\napi-version: 2020-12-01.", + "type": { + "$id": "1095", + "kind": "boolean", + "name": "boolean", + "crossLanguageDefinitionId": "TypeSpec.boolean", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.AzureFleet.UefiSettings.vTpmEnabled", + "serializationOptions": { + "$id": "1096", + "json": { + "$id": "1097", + "name": "vTpmEnabled" + } + } + } + ] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.AzureFleet.SecurityProfile.uefiSettings", + "serializationOptions": { + "$id": "1098", + "json": { + "$id": "1099", + "name": "uefiSettings" + } + } + }, + { + "$id": "1100", + "kind": "property", + "name": "IsEncryptionAtHostEnabled", + "serializedName": "encryptionAtHost", + "doc": "This property can be used by user in the request to enable or disable the Host\nEncryption for the virtual machine or virtual machine scale set. This will\nenable the encryption for all the disks including Resource/Temp disk at host\nitself. The default behavior is: The Encryption at host will be disabled unless\nthis property is set to true for the resource.", + "type": { + "$id": "1101", + "kind": "boolean", + "name": "boolean", + "crossLanguageDefinitionId": "TypeSpec.boolean", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.AzureFleet.SecurityProfile.encryptionAtHost", + "serializationOptions": { + "$id": "1102", + "json": { + "$id": "1103", + "name": "encryptionAtHost" + } + } + }, + { + "$id": "1104", + "kind": "property", + "name": "securityType", + "serializedName": "securityType", + "doc": "Specifies the SecurityType of the virtual machine. It has to be set to any\nspecified value to enable UefiSettings. The default behavior is: UefiSettings\nwill not be enabled unless this property is set.", + "type": { + "$ref": "294" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.AzureFleet.SecurityProfile.securityType", + "serializationOptions": { + "$id": "1105", + "json": { + "$id": "1106", + "name": "securityType" + } + } + }, + { + "$id": "1107", + "kind": "property", + "name": "encryptionIdentity", + "serializedName": "encryptionIdentity", + "doc": "Specifies the Managed Identity used by ADE to get access token for keyvault\noperations.", + "type": { + "$id": "1108", + "kind": "model", + "name": "ComputeFleetEncryptionIdentity", + "clientNamespace": "Microsoft.AzureFleet", + "crossLanguageDefinitionId": "Microsoft.AzureFleet.EncryptionIdentity", + "usage": "Input,Output,Json,LroInitial,LroPolling,LroFinalEnvelope", + "doc": "Specifies the Managed Identity used by ADE to get access token for keyvault\noperations.", + "decorators": [], + "properties": [ + { + "$id": "1109", + "kind": "property", + "name": "userAssignedIdentityResourceId", + "serializedName": "userAssignedIdentityResourceId", + "doc": "Specifies ARM Resource ID of one of the user identities associated with the VM.", + "type": { + "$id": "1110", + "kind": "string", + "name": "armResourceIdentifier", + "crossLanguageDefinitionId": "Azure.Core.armResourceIdentifier", + "baseType": { + "$id": "1111", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.AzureFleet.EncryptionIdentity.userAssignedIdentityResourceId", + "serializationOptions": { + "$id": "1112", + "json": { + "$id": "1113", + "name": "userAssignedIdentityResourceId" + } + } + } + ] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.AzureFleet.SecurityProfile.encryptionIdentity", + "serializationOptions": { + "$id": "1114", + "json": { + "$id": "1115", + "name": "encryptionIdentity" + } + } + }, + { + "$id": "1116", + "kind": "property", + "name": "proxyAgentSettings", + "serializedName": "proxyAgentSettings", + "doc": "Specifies ProxyAgent settings while creating the virtual machine. Minimum\napi-version: 2023-09-01.", + "type": { + "$id": "1117", + "kind": "model", + "name": "ComputeFleetProxyAgentSettings", + "clientNamespace": "Microsoft.AzureFleet", + "crossLanguageDefinitionId": "Microsoft.AzureFleet.ProxyAgentSettings", + "usage": "Input,Output,Json,LroInitial,LroPolling,LroFinalEnvelope", + "doc": "Specifies ProxyAgent settings while creating the virtual machine. Minimum\napi-version: 2023-09-01.", + "decorators": [], + "properties": [ + { + "$id": "1118", + "kind": "property", + "name": "IsEnabled", + "serializedName": "enabled", + "doc": "Specifies whether ProxyAgent feature should be enabled on the virtual machine\nor virtual machine scale set.", + "type": { + "$id": "1119", + "kind": "boolean", + "name": "boolean", + "crossLanguageDefinitionId": "TypeSpec.boolean", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.AzureFleet.ProxyAgentSettings.enabled", + "serializationOptions": { + "$id": "1120", + "json": { + "$id": "1121", + "name": "enabled" + } + } + }, + { + "$id": "1122", + "kind": "property", + "name": "mode", + "serializedName": "mode", + "doc": "Specifies the mode that ProxyAgent will execute on if the feature is enabled.\nProxyAgent will start to audit or monitor but not enforce access control over\nrequests to host endpoints in Audit mode, while in Enforce mode it will enforce\naccess control. The default value is Enforce mode.", + "type": { + "$ref": "300" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.AzureFleet.ProxyAgentSettings.mode", + "serializationOptions": { + "$id": "1123", + "json": { + "$id": "1124", + "name": "mode" + } + } + }, + { + "$id": "1125", + "kind": "property", + "name": "keyIncarnationId", + "serializedName": "keyIncarnationId", + "doc": "Increase the value of this property allows user to reset the key used for\nsecuring communication channel between guest and host.", + "type": { + "$id": "1126", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.AzureFleet.ProxyAgentSettings.keyIncarnationId", + "serializationOptions": { + "$id": "1127", + "json": { + "$id": "1128", + "name": "keyIncarnationId" + } + } + } + ] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.AzureFleet.SecurityProfile.proxyAgentSettings", + "serializationOptions": { + "$id": "1129", + "json": { + "$id": "1130", + "name": "proxyAgentSettings" + } + } + } + ] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.AzureFleet.BaseVirtualMachineProfile.securityProfile", + "serializationOptions": { + "$id": "1131", + "json": { + "$id": "1132", + "name": "securityProfile" + } + } + }, + { + "$id": "1133", + "kind": "property", + "name": "diagnosticsProfile", + "serializedName": "diagnosticsProfile", + "doc": "Specifies the boot diagnostic settings state.", + "type": { + "$id": "1134", + "kind": "model", + "name": "ComputeFleetDiagnosticsProfile", + "clientNamespace": "Microsoft.AzureFleet", + "crossLanguageDefinitionId": "Microsoft.AzureFleet.DiagnosticsProfile", + "usage": "Input,Output,Json,LroInitial,LroPolling,LroFinalEnvelope", + "doc": "Specifies the boot diagnostic settings state. Minimum api-version: 2015-06-15.", + "decorators": [], + "properties": [ + { + "$id": "1135", + "kind": "property", + "name": "bootDiagnostics", + "serializedName": "bootDiagnostics", + "doc": "Boot Diagnostics is a debugging feature which allows you to view Console Output\nand Screenshot to diagnose VM status. **NOTE**: If storageUri is being\nspecified then ensure that the storage account is in the same region and\nsubscription as the VM. You can easily view the output of your console log.\nAzure also enables you to see a screenshot of the VM from the hypervisor.", + "type": { + "$id": "1136", + "kind": "model", + "name": "ComputeFleetBootDiagnostics", + "clientNamespace": "Microsoft.AzureFleet", + "crossLanguageDefinitionId": "Microsoft.AzureFleet.BootDiagnostics", + "usage": "Input,Output,Json,LroInitial,LroPolling,LroFinalEnvelope", + "doc": "Boot Diagnostics is a debugging feature which allows you to view Console Output\nand Screenshot to diagnose VM status. You can easily view the output of your\nconsole log. Azure also enables you to see a screenshot of the VM from the\nhypervisor.", + "decorators": [], + "properties": [ + { + "$id": "1137", + "kind": "property", + "name": "IsEnabled", + "serializedName": "enabled", + "doc": "Whether boot diagnostics should be enabled on the Virtual Machine.", + "type": { + "$id": "1138", + "kind": "boolean", + "name": "boolean", + "crossLanguageDefinitionId": "TypeSpec.boolean", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.AzureFleet.BootDiagnostics.enabled", + "serializationOptions": { + "$id": "1139", + "json": { + "$id": "1140", + "name": "enabled" + } + } + }, + { + "$id": "1141", + "kind": "property", + "name": "storageUri", + "serializedName": "storageUri", + "doc": "Uri of the storage account to use for placing the console output and\nscreenshot. If storageUri is not specified while enabling boot diagnostics,\nmanaged storage will be used.", + "type": { + "$id": "1142", + "kind": "url", + "name": "url", + "crossLanguageDefinitionId": "TypeSpec.url", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.AzureFleet.BootDiagnostics.storageUri", + "serializationOptions": { + "$id": "1143", + "json": { + "$id": "1144", + "name": "storageUri" + } + } + } + ] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.AzureFleet.DiagnosticsProfile.bootDiagnostics", + "serializationOptions": { + "$id": "1145", + "json": { + "$id": "1146", + "name": "bootDiagnostics" + } + } + } + ] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.AzureFleet.BaseVirtualMachineProfile.diagnosticsProfile", + "serializationOptions": { + "$id": "1147", + "json": { + "$id": "1148", + "name": "diagnosticsProfile" + } + } + }, + { + "$id": "1149", + "kind": "property", + "name": "extensionProfile", + "serializedName": "extensionProfile", + "doc": "Specifies a collection of settings for extensions installed on virtual machines\nin the scale set.", + "type": { + "$id": "1150", + "kind": "model", + "name": "ComputeFleetVmssExtensionProfile", + "clientNamespace": "Microsoft.AzureFleet", + "crossLanguageDefinitionId": "Microsoft.AzureFleet.VirtualMachineScaleSetExtensionProfile", + "usage": "Input,Output,Json,LroInitial,LroPolling,LroFinalEnvelope", + "doc": "Describes a virtual machine scale set extension profile.", + "decorators": [], + "properties": [ + { + "$id": "1151", + "kind": "property", + "name": "extensions", + "serializedName": "extensions", + "doc": "The virtual machine scale set child extension resources.", + "type": { + "$id": "1152", + "kind": "array", + "name": "ArrayVirtualMachineScaleSetExtension", + "valueType": { + "$id": "1153", + "kind": "model", + "name": "ComputeFleetVmssExtension", + "clientNamespace": "Microsoft.AzureFleet", + "crossLanguageDefinitionId": "Microsoft.AzureFleet.VirtualMachineScaleSetExtension", + "usage": "Input,Output,Json,LroInitial,LroPolling,LroFinalEnvelope", + "doc": "Describes a Virtual Machine Scale Set Extension.", + "decorators": [], + "properties": [ + { + "$id": "1154", + "kind": "property", + "name": "id", + "serializedName": "id", + "doc": "Resource Id", + "type": { + "$id": "1155", + "kind": "string", + "name": "armResourceIdentifier", + "crossLanguageDefinitionId": "Azure.Core.armResourceIdentifier", + "baseType": { + "$id": "1156", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.AzureFleet.VirtualMachineScaleSetExtension.id", + "serializationOptions": { + "$id": "1157", + "json": { + "$id": "1158", + "name": "id" + } + } + }, + { + "$id": "1159", + "kind": "property", + "name": "name", + "serializedName": "name", + "doc": "The name of the extension.", + "type": { + "$id": "1160", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.AzureFleet.VirtualMachineScaleSetExtension.name", + "serializationOptions": { + "$id": "1161", + "json": { + "$id": "1162", + "name": "name" + } + } + }, + { + "$id": "1163", + "kind": "property", + "name": "ExtensionType", + "serializedName": "type", + "doc": "Resource type", + "type": { + "$id": "1164", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.AzureFleet.VirtualMachineScaleSetExtension.type", + "serializationOptions": { + "$id": "1165", + "json": { + "$id": "1166", + "name": "type" + } + } + }, + { + "$id": "1167", + "kind": "property", + "name": "properties", + "serializedName": "properties", + "doc": "Describes the properties of a Virtual Machine Scale Set Extension.", + "type": { + "$id": "1168", + "kind": "model", + "name": "ComputeFleetVmssExtensionProperties", + "clientNamespace": "Microsoft.AzureFleet", + "crossLanguageDefinitionId": "Microsoft.AzureFleet.VirtualMachineScaleSetExtensionProperties", + "usage": "Input,Output,Json,LroInitial,LroPolling,LroFinalEnvelope", + "doc": "Describes the properties of a Virtual Machine Scale Set Extension.", + "decorators": [], + "properties": [ + { + "$id": "1169", + "kind": "property", + "name": "forceUpdateTag", + "serializedName": "forceUpdateTag", + "doc": "If a value is provided and is different from the previous value, the extension\nhandler will be forced to update even if the extension configuration has not\nchanged.", + "type": { + "$id": "1170", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.AzureFleet.VirtualMachineScaleSetExtensionProperties.forceUpdateTag", + "serializationOptions": { + "$id": "1171", + "json": { + "$id": "1172", + "name": "forceUpdateTag" + } + } + }, + { + "$id": "1173", + "kind": "property", + "name": "publisher", + "serializedName": "publisher", + "doc": "The name of the extension handler publisher.", + "type": { + "$id": "1174", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.AzureFleet.VirtualMachineScaleSetExtensionProperties.publisher", + "serializationOptions": { + "$id": "1175", + "json": { + "$id": "1176", + "name": "publisher" + } + } + }, + { + "$id": "1177", + "kind": "property", + "name": "ExtensionType", + "serializedName": "type", + "doc": "Specifies the type of the extension; an example is \"CustomScriptExtension\".", + "type": { + "$id": "1178", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.AzureFleet.VirtualMachineScaleSetExtensionProperties.type", + "serializationOptions": { + "$id": "1179", + "json": { + "$id": "1180", + "name": "type" + } + } + }, + { + "$id": "1181", + "kind": "property", + "name": "typeHandlerVersion", + "serializedName": "typeHandlerVersion", + "doc": "Specifies the version of the script handler.", + "type": { + "$id": "1182", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.AzureFleet.VirtualMachineScaleSetExtensionProperties.typeHandlerVersion", + "serializationOptions": { + "$id": "1183", + "json": { + "$id": "1184", + "name": "typeHandlerVersion" + } + } + }, + { + "$id": "1185", + "kind": "property", + "name": "ShouldAutoUpgradeMinorVersion", + "serializedName": "autoUpgradeMinorVersion", + "doc": "Indicates whether the extension should use a newer minor version if one is\navailable at deployment time. Once deployed, however, the extension will not\nupgrade minor versions unless redeployed, even with this property set to true.", + "type": { + "$id": "1186", + "kind": "boolean", + "name": "boolean", + "crossLanguageDefinitionId": "TypeSpec.boolean", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.AzureFleet.VirtualMachineScaleSetExtensionProperties.autoUpgradeMinorVersion", + "serializationOptions": { + "$id": "1187", + "json": { + "$id": "1188", + "name": "autoUpgradeMinorVersion" + } + } + }, + { + "$id": "1189", + "kind": "property", + "name": "IsAutomaticUpgradeEnabled", + "serializedName": "enableAutomaticUpgrade", + "doc": "Indicates whether the extension should be automatically upgraded by the\nplatform if there is a newer version of the extension available.", + "type": { + "$id": "1190", + "kind": "boolean", + "name": "boolean", + "crossLanguageDefinitionId": "TypeSpec.boolean", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.AzureFleet.VirtualMachineScaleSetExtensionProperties.enableAutomaticUpgrade", + "serializationOptions": { + "$id": "1191", + "json": { + "$id": "1192", + "name": "enableAutomaticUpgrade" + } + } + }, + { + "$id": "1193", + "kind": "property", + "name": "settings", + "serializedName": "settings", + "doc": "Json formatted public settings for the extension.", + "type": { + "$id": "1194", + "kind": "dict", + "keyType": { + "$id": "1195", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "valueType": { + "$id": "1196", + "kind": "unknown", + "name": "unknown", + "crossLanguageDefinitionId": "", + "decorators": [] + }, + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.AzureFleet.VirtualMachineScaleSetExtensionProperties.settings", + "serializationOptions": { + "$id": "1197", + "json": { + "$id": "1198", + "name": "settings" + } + } + }, + { + "$id": "1199", + "kind": "property", + "name": "protectedSettings", + "serializedName": "protectedSettings", + "doc": "The extension can contain either protectedSettings or\nprotectedSettingsFromKeyVault or no protected settings at all.", + "type": { + "$id": "1200", + "kind": "dict", + "keyType": { + "$id": "1201", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "valueType": { + "$id": "1202", + "kind": "unknown", + "name": "unknown", + "crossLanguageDefinitionId": "", + "decorators": [] + }, + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.AzureFleet.VirtualMachineScaleSetExtensionProperties.protectedSettings", + "serializationOptions": { + "$id": "1203", + "json": { + "$id": "1204", + "name": "protectedSettings" + } + } + }, + { + "$id": "1205", + "kind": "property", + "name": "provisioningState", + "serializedName": "provisioningState", + "doc": "The provisioning state, which only appears in the response.", + "type": { + "$id": "1206", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.AzureFleet.VirtualMachineScaleSetExtensionProperties.provisioningState", + "serializationOptions": { + "$id": "1207", + "json": { + "$id": "1208", + "name": "provisioningState" + } + } + }, + { + "$id": "1209", + "kind": "property", + "name": "provisionAfterExtensions", + "serializedName": "provisionAfterExtensions", + "doc": "Collection of extension names after which this extension needs to be\nprovisioned.", + "type": { + "$id": "1210", + "kind": "array", + "name": "Array", + "valueType": { + "$id": "1211", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.AzureFleet.VirtualMachineScaleSetExtensionProperties.provisionAfterExtensions", + "serializationOptions": { + "$id": "1212", + "json": { + "$id": "1213", + "name": "provisionAfterExtensions" + } + } + }, + { + "$id": "1214", + "kind": "property", + "name": "IsSuppressFailuresEnabled", + "serializedName": "suppressFailures", + "doc": "Indicates whether failures stemming from the extension will be suppressed\n(Operational failures such as not connecting to the VM will not be suppressed\nregardless of this value). The default is false.", + "type": { + "$id": "1215", + "kind": "boolean", + "name": "boolean", + "crossLanguageDefinitionId": "TypeSpec.boolean", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.AzureFleet.VirtualMachineScaleSetExtensionProperties.suppressFailures", + "serializationOptions": { + "$id": "1216", + "json": { + "$id": "1217", + "name": "suppressFailures" + } + } + }, + { + "$id": "1218", + "kind": "property", + "name": "protectedSettingsFromKeyVault", + "serializedName": "protectedSettingsFromKeyVault", + "doc": "The extensions protected settings that are passed by reference, and consumed\nfrom key vault", + "type": { + "$id": "1219", + "kind": "model", + "name": "ComputeFleetKeyVaultSecretReference", + "clientNamespace": "Microsoft.AzureFleet", + "crossLanguageDefinitionId": "Microsoft.AzureFleet.KeyVaultSecretReference", + "usage": "Input,Output,Json,LroInitial,LroPolling,LroFinalEnvelope", + "doc": "Describes a reference to Key Vault Secret", + "decorators": [], + "properties": [ + { + "$id": "1220", + "kind": "property", + "name": "secretUrl", + "serializedName": "secretUrl", + "doc": "The URL referencing a secret in a Key Vault.", + "type": { + "$id": "1221", + "kind": "url", + "name": "url", + "crossLanguageDefinitionId": "TypeSpec.url", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.AzureFleet.KeyVaultSecretReference.secretUrl", + "serializationOptions": { + "$id": "1222", + "json": { + "$id": "1223", + "name": "secretUrl" + } + } + }, + { + "$id": "1224", + "kind": "property", + "name": "sourceVault", + "serializedName": "sourceVault", + "doc": "The relative URL of the Key Vault containing the secret.", + "type": { + "$ref": "723" + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.AzureFleet.KeyVaultSecretReference.sourceVault", + "serializationOptions": { + "$id": "1225", + "json": { + "$id": "1226", + "name": "sourceVault" + } + } + } + ] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.AzureFleet.VirtualMachineScaleSetExtensionProperties.protectedSettingsFromKeyVault", + "serializationOptions": { + "$id": "1227", + "json": { + "$id": "1228", + "name": "protectedSettingsFromKeyVault" + } + } + } + ] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.AzureFleet.VirtualMachineScaleSetExtension.properties", + "serializationOptions": { + "$id": "1229", + "json": { + "$id": "1230", + "name": "properties" + } + } + } + ] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.AzureFleet.VirtualMachineScaleSetExtensionProfile.extensions", + "serializationOptions": { + "$id": "1231", + "json": { + "$id": "1232", + "name": "extensions" + } + } + }, + { + "$id": "1233", + "kind": "property", + "name": "extensionsTimeBudget", + "serializedName": "extensionsTimeBudget", + "doc": "Specifies the time alloted for all extensions to start. The time duration\nshould be between 15 minutes and 120 minutes (inclusive) and should be\nspecified in ISO 8601 format. The default value is 90 minutes (PT1H30M).\nMinimum api-version: 2020-06-01.", + "type": { + "$id": "1234", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.AzureFleet.VirtualMachineScaleSetExtensionProfile.extensionsTimeBudget", + "serializationOptions": { + "$id": "1235", + "json": { + "$id": "1236", + "name": "extensionsTimeBudget" + } + } + } + ] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.AzureFleet.BaseVirtualMachineProfile.extensionProfile", + "serializationOptions": { + "$id": "1237", + "json": { + "$id": "1238", + "name": "extensionProfile" + } + } + }, + { + "$id": "1239", + "kind": "property", + "name": "licenseType", + "serializedName": "licenseType", + "doc": "Specifies that the image or disk that is being used was licensed on-premises.\n

Possible values for Windows Server operating system are:

\nWindows_Client

Windows_Server

Possible values for Linux\nServer operating system are:

RHEL_BYOS (for RHEL)

SLES_BYOS\n(for SUSE)

For more information, see [Azure Hybrid Use Benefit for\nWindows\nServer](https://learn.microsoft.com/azure/virtual-machines/windows/hybrid-use-benefit-licensing)\n

[Azure Hybrid Use Benefit for Linux\nServer](https://learn.microsoft.com/azure/virtual-machines/linux/azure-hybrid-benefit-linux)\n

Minimum api-version: 2015-06-15", + "type": { + "$id": "1240", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.AzureFleet.BaseVirtualMachineProfile.licenseType", + "serializationOptions": { + "$id": "1241", + "json": { + "$id": "1242", + "name": "licenseType" + } + } + }, + { + "$id": "1243", + "kind": "property", + "name": "scheduledEventsProfile", + "serializedName": "scheduledEventsProfile", + "doc": "Specifies Scheduled Event related configurations.", + "type": { + "$id": "1244", + "kind": "model", + "name": "ComputeFleetScheduledEventsProfile", + "clientNamespace": "Microsoft.AzureFleet", + "crossLanguageDefinitionId": "Microsoft.AzureFleet.ScheduledEventsProfile", + "usage": "Input,Output,Json,LroInitial,LroPolling,LroFinalEnvelope", + "doc": "Specifies Scheduled Event related configurations.", + "decorators": [], + "properties": [ + { + "$id": "1245", + "kind": "property", + "name": "terminateNotificationProfile", + "serializedName": "terminateNotificationProfile", + "doc": "Specifies Terminate Scheduled Event related configurations.", + "type": { + "$id": "1246", + "kind": "model", + "name": "ComputeFleetTerminateNotificationProfile", + "clientNamespace": "Microsoft.AzureFleet", + "crossLanguageDefinitionId": "Microsoft.AzureFleet.TerminateNotificationProfile", + "usage": "Input,Output,Json,LroInitial,LroPolling,LroFinalEnvelope", + "doc": "Specifies Terminate Scheduled Event related configurations.", + "decorators": [], + "properties": [ + { + "$id": "1247", + "kind": "property", + "name": "notBeforeTimeout", + "serializedName": "notBeforeTimeout", + "doc": "Configurable length of time a Virtual Machine being deleted will have to\npotentially approve the Terminate Scheduled Event before the event is auto\napproved (timed out). The configuration must be specified in ISO 8601 format,\nthe default value is 5 minutes (PT5M)", + "type": { + "$id": "1248", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.AzureFleet.TerminateNotificationProfile.notBeforeTimeout", + "serializationOptions": { + "$id": "1249", + "json": { + "$id": "1250", + "name": "notBeforeTimeout" + } + } + }, + { + "$id": "1251", + "kind": "property", + "name": "IsEnabled", + "serializedName": "enable", + "doc": "Specifies whether the Terminate Scheduled event is enabled or disabled.", + "type": { + "$id": "1252", + "kind": "boolean", + "name": "boolean", + "crossLanguageDefinitionId": "TypeSpec.boolean", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.AzureFleet.TerminateNotificationProfile.enable", + "serializationOptions": { + "$id": "1253", + "json": { + "$id": "1254", + "name": "enable" + } + } + } + ] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.AzureFleet.ScheduledEventsProfile.terminateNotificationProfile", + "serializationOptions": { + "$id": "1255", + "json": { + "$id": "1256", + "name": "terminateNotificationProfile" + } + } + }, + { + "$id": "1257", + "kind": "property", + "name": "osImageNotificationProfile", + "serializedName": "osImageNotificationProfile", + "doc": "Specifies OS Image Scheduled Event related configurations.", + "type": { + "$id": "1258", + "kind": "model", + "name": "ComputeFleetOSImageNotificationProfile", + "clientNamespace": "Microsoft.AzureFleet", + "crossLanguageDefinitionId": "Microsoft.AzureFleet.OSImageNotificationProfile", + "usage": "Input,Output,Json,LroInitial,LroPolling,LroFinalEnvelope", + "doc": "Specifies OS Image Scheduled Event related configurations.", + "decorators": [], + "properties": [ + { + "$id": "1259", + "kind": "property", + "name": "notBeforeTimeout", + "serializedName": "notBeforeTimeout", + "doc": "Length of time a Virtual Machine being reimaged or having its OS upgraded will\nhave to potentially approve the OS Image Scheduled Event before the event is\nauto approved (timed out). The configuration is specified in ISO 8601 format,\nand the value must not exceed 15 minutes (PT15M)", + "type": { + "$id": "1260", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.AzureFleet.OSImageNotificationProfile.notBeforeTimeout", + "serializationOptions": { + "$id": "1261", + "json": { + "$id": "1262", + "name": "notBeforeTimeout" + } + } + }, + { + "$id": "1263", + "kind": "property", + "name": "IsEnabled", + "serializedName": "enable", + "doc": "Specifies whether the OS Image Scheduled event is enabled or disabled.", + "type": { + "$id": "1264", + "kind": "boolean", + "name": "boolean", + "crossLanguageDefinitionId": "TypeSpec.boolean", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.AzureFleet.OSImageNotificationProfile.enable", + "serializationOptions": { + "$id": "1265", + "json": { + "$id": "1266", + "name": "enable" + } + } + } + ] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.AzureFleet.ScheduledEventsProfile.osImageNotificationProfile", + "serializationOptions": { + "$id": "1267", + "json": { + "$id": "1268", + "name": "osImageNotificationProfile" + } + } + } + ] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.AzureFleet.BaseVirtualMachineProfile.scheduledEventsProfile", + "serializationOptions": { + "$id": "1269", + "json": { + "$id": "1270", + "name": "scheduledEventsProfile" + } + } + }, + { + "$id": "1271", + "kind": "property", + "name": "userData", + "serializedName": "userData", + "doc": "UserData for the virtual machines in the scale set, which must be base-64\nencoded. Customer should not pass any secrets in here. Minimum api-version:\n2021-03-01.", + "type": { + "$id": "1272", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.AzureFleet.BaseVirtualMachineProfile.userData", + "serializationOptions": { + "$id": "1273", + "json": { + "$id": "1274", + "name": "userData" + } + } + }, + { + "$id": "1275", + "kind": "property", + "name": "capacityReservation", + "serializedName": "capacityReservation", + "doc": "Specifies the capacity reservation related details of a scale set. Minimum\napi-version: 2021-04-01.", + "type": { + "$id": "1276", + "kind": "model", + "name": "CapacityReservationProfile", + "clientNamespace": "Microsoft.AzureFleet", + "crossLanguageDefinitionId": "Microsoft.AzureFleet.CapacityReservationProfile", + "usage": "Input,Output,Json,LroInitial,LroPolling,LroFinalEnvelope", + "doc": "The parameters of a capacity reservation Profile.", + "decorators": [], + "properties": [ + { + "$id": "1277", + "kind": "property", + "name": "capacityReservationGroup", + "serializedName": "capacityReservationGroup", + "doc": "Specifies the capacity reservation group resource id that should be used for\nallocating the virtual machine or scaleset vm instances provided enough\ncapacity has been reserved. Please refer to https://aka.ms/CapacityReservation\nfor more details.", + "type": { + "$ref": "723" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.AzureFleet.CapacityReservationProfile.capacityReservationGroup", + "serializationOptions": { + "$id": "1278", + "json": { + "$id": "1279", + "name": "capacityReservationGroup" + } + } + } + ] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.AzureFleet.BaseVirtualMachineProfile.capacityReservation", + "serializationOptions": { + "$id": "1280", + "json": { + "$id": "1281", + "name": "capacityReservation" + } + } + }, + { + "$id": "1282", + "kind": "property", + "name": "applicationProfile", + "serializedName": "applicationProfile", + "doc": "Specifies the gallery applications that should be made available to the VM/VMSS", + "type": { + "$id": "1283", + "kind": "model", + "name": "ComputeFleetApplicationProfile", + "clientNamespace": "Microsoft.AzureFleet", + "crossLanguageDefinitionId": "Microsoft.AzureFleet.ApplicationProfile", + "usage": "Input,Output,Json,LroInitial,LroPolling,LroFinalEnvelope", + "doc": "Contains the list of gallery applications that should be made available to the\nVM/VMSS", + "decorators": [], + "properties": [ + { + "$id": "1284", + "kind": "property", + "name": "galleryApplications", + "serializedName": "galleryApplications", + "doc": "Specifies the gallery applications that should be made available to the VM/VMSS", + "type": { + "$id": "1285", + "kind": "array", + "name": "ArrayVmGalleryApplication", + "valueType": { + "$id": "1286", + "kind": "model", + "name": "ComputeFleetVMGalleryApplication", + "clientNamespace": "Microsoft.AzureFleet", + "crossLanguageDefinitionId": "Microsoft.AzureFleet.VMGalleryApplication", + "usage": "Input,Output,Json,LroInitial,LroPolling,LroFinalEnvelope", + "doc": "Specifies the required information to reference a compute gallery application\nversion", + "decorators": [], + "properties": [ + { + "$id": "1287", + "kind": "property", + "name": "tags", + "serializedName": "tags", + "doc": "Optional, Specifies a passthrough value for more generic context.", + "type": { + "$id": "1288", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.AzureFleet.VMGalleryApplication.tags", + "serializationOptions": { + "$id": "1289", + "json": { + "$id": "1290", + "name": "tags" + } + } + }, + { + "$id": "1291", + "kind": "property", + "name": "order", + "serializedName": "order", + "doc": "Optional, Specifies the order in which the packages have to be installed", + "type": { + "$id": "1292", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.AzureFleet.VMGalleryApplication.order", + "serializationOptions": { + "$id": "1293", + "json": { + "$id": "1294", + "name": "order" + } + } + }, + { + "$id": "1295", + "kind": "property", + "name": "packageReferenceId", + "serializedName": "packageReferenceId", + "doc": "Specifies the GalleryApplicationVersion resource id on the form of\n/subscriptions/{SubscriptionId}/resourceGroups/{ResourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/applications/{application}/versions/{version}", + "type": { + "$id": "1296", + "kind": "string", + "name": "armResourceIdentifier", + "crossLanguageDefinitionId": "Azure.Core.armResourceIdentifier", + "baseType": { + "$id": "1297", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.AzureFleet.VMGalleryApplication.packageReferenceId", + "serializationOptions": { + "$id": "1298", + "json": { + "$id": "1299", + "name": "packageReferenceId" + } + } + }, + { + "$id": "1300", + "kind": "property", + "name": "configurationReference", + "serializedName": "configurationReference", + "doc": "Optional, Specifies the uri to an azure blob that will replace the default\nconfiguration for the package if provided", + "type": { + "$id": "1301", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.AzureFleet.VMGalleryApplication.configurationReference", + "serializationOptions": { + "$id": "1302", + "json": { + "$id": "1303", + "name": "configurationReference" + } + } + }, + { + "$id": "1304", + "kind": "property", + "name": "IsTreatFailureAsDeploymentFailureEnabled", + "serializedName": "treatFailureAsDeploymentFailure", + "doc": "Optional, If true, any failure for any operation in the VmApplication will fail\nthe deployment", + "type": { + "$id": "1305", + "kind": "boolean", + "name": "boolean", + "crossLanguageDefinitionId": "TypeSpec.boolean", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.AzureFleet.VMGalleryApplication.treatFailureAsDeploymentFailure", + "serializationOptions": { + "$id": "1306", + "json": { + "$id": "1307", + "name": "treatFailureAsDeploymentFailure" + } + } + }, + { + "$id": "1308", + "kind": "property", + "name": "IsAutomaticUpgradeEnabled", + "serializedName": "enableAutomaticUpgrade", + "doc": "If set to true, when a new Gallery Application version is available in PIR/SIG,\nit will be automatically updated for the VM/VMSS", + "type": { + "$id": "1309", + "kind": "boolean", + "name": "boolean", + "crossLanguageDefinitionId": "TypeSpec.boolean", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.AzureFleet.VMGalleryApplication.enableAutomaticUpgrade", + "serializationOptions": { + "$id": "1310", + "json": { + "$id": "1311", + "name": "enableAutomaticUpgrade" + } + } + } + ] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.AzureFleet.ApplicationProfile.galleryApplications", + "serializationOptions": { + "$id": "1312", + "json": { + "$id": "1313", + "name": "galleryApplications" + } + } + } + ] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.AzureFleet.BaseVirtualMachineProfile.applicationProfile", + "serializationOptions": { + "$id": "1314", + "json": { + "$id": "1315", + "name": "applicationProfile" + } + } + }, + { + "$id": "1316", + "kind": "property", + "name": "hardwareProfile", + "serializedName": "hardwareProfile", + "doc": "Specifies the hardware profile related details of a scale set. Minimum\napi-version: 2021-11-01.", + "type": { + "$id": "1317", + "kind": "model", + "name": "ComputeFleetVmssHardwareProfile", + "clientNamespace": "Microsoft.AzureFleet", + "crossLanguageDefinitionId": "Microsoft.AzureFleet.VirtualMachineScaleSetHardwareProfile", + "usage": "Input,Output,Json,LroInitial,LroPolling,LroFinalEnvelope", + "doc": "Specifies the hardware settings for the virtual machine scale set.", + "decorators": [], + "properties": [ + { + "$id": "1318", + "kind": "property", + "name": "vmSizeProperties", + "serializedName": "vmSizeProperties", + "doc": "Specifies the properties for customizing the size of the virtual machine.\nMinimum api-version: 2021-11-01. Please follow the instructions in [VM\nCustomization](https://aka.ms/vmcustomization) for more details.", + "type": { + "$id": "1319", + "kind": "model", + "name": "ComputeFleetVMSizeProperties", + "clientNamespace": "Microsoft.AzureFleet", + "crossLanguageDefinitionId": "Microsoft.AzureFleet.VMSizeProperties", + "usage": "Input,Output,Json,LroInitial,LroPolling,LroFinalEnvelope", + "doc": "Specifies VM Size Property settings on the virtual machine.", + "decorators": [], + "properties": [ + { + "$id": "1320", + "kind": "property", + "name": "vCPUsAvailable", + "serializedName": "vCPUsAvailable", + "doc": "Specifies the number of vCPUs available for the VM. When this property is not\nspecified in the request body the default behavior is to set it to the value of\nvCPUs available for that VM size exposed in api response of [List all available\nvirtual machine sizes in a\nregion](https://learn.microsoft.com/en-us/rest/api/compute/resource-skus/list).", + "type": { + "$id": "1321", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.AzureFleet.VMSizeProperties.vCPUsAvailable", + "serializationOptions": { + "$id": "1322", + "json": { + "$id": "1323", + "name": "vCPUsAvailable" + } + } + }, + { + "$id": "1324", + "kind": "property", + "name": "vCPUsPerCore", + "serializedName": "vCPUsPerCore", + "doc": "Specifies the vCPU to physical core ratio. When this property is not specified\nin the request body the default behavior is set to the value of vCPUsPerCore\nfor the VM Size exposed in api response of [List all available virtual machine\nsizes in a\nregion](https://learn.microsoft.com/en-us/rest/api/compute/resource-skus/list).\n**Setting this property to 1 also means that hyper-threading is disabled.**", + "type": { + "$id": "1325", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.AzureFleet.VMSizeProperties.vCPUsPerCore", + "serializationOptions": { + "$id": "1326", + "json": { + "$id": "1327", + "name": "vCPUsPerCore" + } + } + } + ] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.AzureFleet.VirtualMachineScaleSetHardwareProfile.vmSizeProperties", + "serializationOptions": { + "$id": "1328", + "json": { + "$id": "1329", + "name": "vmSizeProperties" + } + } + } + ] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.AzureFleet.BaseVirtualMachineProfile.hardwareProfile", + "serializationOptions": { + "$id": "1330", + "json": { + "$id": "1331", + "name": "hardwareProfile" + } + } + }, + { + "$id": "1332", + "kind": "property", + "name": "serviceArtifactReference", + "serializedName": "serviceArtifactReference", + "doc": "Specifies the service artifact reference id used to set same image version for\nall virtual machines in the scale set when using 'latest' image version.\nMinimum api-version: 2022-11-01", + "type": { + "$id": "1333", + "kind": "model", + "name": "ServiceArtifactReference", + "clientNamespace": "Microsoft.AzureFleet", + "crossLanguageDefinitionId": "Microsoft.AzureFleet.ServiceArtifactReference", + "usage": "Input,Output,Json,LroInitial,LroPolling,LroFinalEnvelope", + "doc": "Specifies the service artifact reference id used to set same image version for\nall virtual machines in the scale set when using 'latest' image version.\nMinimum api-version: 2022-11-01", + "decorators": [], + "properties": [ + { + "$id": "1334", + "kind": "property", + "name": "id", + "serializedName": "id", + "doc": "The service artifact reference id in the form of\n/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Compute/galleries/{galleryName}/serviceArtifacts/{serviceArtifactName}/vmArtifactsProfiles/{vmArtifactsProfilesName}", + "type": { + "$id": "1335", + "kind": "string", + "name": "armResourceIdentifier", + "crossLanguageDefinitionId": "Azure.Core.armResourceIdentifier", + "baseType": { + "$id": "1336", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.AzureFleet.ServiceArtifactReference.id", + "serializationOptions": { + "$id": "1337", + "json": { + "$id": "1338", + "name": "id" + } + } + } + ] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.AzureFleet.BaseVirtualMachineProfile.serviceArtifactReference", + "serializationOptions": { + "$id": "1339", + "json": { + "$id": "1340", + "name": "serviceArtifactReference" + } + } + }, + { + "$id": "1341", + "kind": "property", + "name": "securityPostureReference", + "serializedName": "securityPostureReference", + "doc": "Specifies the security posture to be used for all virtual machines in the scale\nset. Minimum api-version: 2023-03-01", + "type": { + "$id": "1342", + "kind": "model", + "name": "ComputeFleetSecurityPostureReference", + "clientNamespace": "Microsoft.AzureFleet", + "crossLanguageDefinitionId": "Microsoft.AzureFleet.SecurityPostureReference", + "usage": "Input,Output,Json,LroInitial,LroPolling,LroFinalEnvelope", + "doc": "Specifies the security posture to be used for all virtual machines in the scale\nset. Minimum api-version: 2023-03-01", + "decorators": [], + "properties": [ + { + "$id": "1343", + "kind": "property", + "name": "id", + "serializedName": "id", + "doc": "The security posture reference id in the form of\n/CommunityGalleries/{communityGalleryName}/securityPostures/{securityPostureName}/versions/{major.minor.patch}|{major.*}|latest", + "type": { + "$id": "1344", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.AzureFleet.SecurityPostureReference.id", + "serializationOptions": { + "$id": "1345", + "json": { + "$id": "1346", + "name": "id" + } + } + }, + { + "$id": "1347", + "kind": "property", + "name": "excludeExtensions", + "serializedName": "excludeExtensions", + "doc": "List of virtual machine extension names to exclude when applying the security\nposture.", + "type": { + "$id": "1348", + "kind": "array", + "name": "Array", + "valueType": { + "$id": "1349", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.AzureFleet.SecurityPostureReference.excludeExtensions", + "serializationOptions": { + "$id": "1350", + "json": { + "$id": "1351", + "name": "excludeExtensions" + } + } + }, + { + "$id": "1352", + "kind": "property", + "name": "isOverridable", + "serializedName": "isOverridable", + "doc": "Whether the security posture can be overridden by the user.", + "type": { + "$id": "1353", + "kind": "boolean", + "name": "boolean", + "crossLanguageDefinitionId": "TypeSpec.boolean", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.AzureFleet.SecurityPostureReference.isOverridable", + "serializationOptions": { + "$id": "1354", + "json": { + "$id": "1355", + "name": "isOverridable" + } + } + } + ] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.AzureFleet.BaseVirtualMachineProfile.securityPostureReference", + "serializationOptions": { + "$id": "1356", + "json": { + "$id": "1357", + "name": "securityPostureReference" + } + } + }, + { + "$id": "1358", + "kind": "property", + "name": "CreatedOn", + "serializedName": "timeCreated", + "doc": "Specifies the time in which this VM profile for the Virtual Machine Scale Set\nwas created. Minimum API version for this property is 2023-09-01. This value\nwill be added to VMSS Flex VM tags when creating/updating the VMSS VM Profile\nwith minimum api-version 2023-09-01. Examples: \"2024-07-01T00:00:01.1234567+00:00\"", + "type": { + "$id": "1359", + "kind": "utcDateTime", + "name": "utcDateTime", + "encode": "rfc3339", + "wireType": { + "$id": "1360", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.utcDateTime", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.AzureFleet.BaseVirtualMachineProfile.timeCreated", + "serializationOptions": { + "$id": "1361", + "json": { + "$id": "1362", + "name": "timeCreated" + } + } + } + ] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.AzureFleet.LocationProfile.virtualMachineProfileOverride", + "serializationOptions": { + "$id": "1363", + "json": { + "$id": "1364", + "name": "virtualMachineProfileOverride" + } + } + } + ] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.AzureFleet.AdditionalLocationsProfile.locationProfiles", + "serializationOptions": { + "$id": "1365", + "json": { + "$id": "1366", + "name": "locationProfiles" + } + } + } + ] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.AzureFleet.FleetProperties.additionalLocationsProfile", + "serializationOptions": { + "$id": "1367", + "json": { + "$id": "1368", + "name": "additionalLocationsProfile" + } + } + }, + { + "$id": "1369", + "kind": "property", + "name": "computeProfile", + "serializedName": "computeProfile", + "doc": "Compute Profile to use for running user's workloads.", + "type": { + "$id": "1370", + "kind": "model", + "name": "ComputeFleetComputeProfile", + "clientNamespace": "Microsoft.AzureFleet", + "crossLanguageDefinitionId": "Microsoft.AzureFleet.ComputeProfile", + "usage": "Input,Output,Json,LroInitial,LroPolling,LroFinalEnvelope", + "doc": "Compute Profile to use for running user's workloads.", + "decorators": [], + "properties": [ + { + "$id": "1371", + "kind": "property", + "name": "baseVirtualMachineProfile", + "serializedName": "baseVirtualMachineProfile", + "doc": "Base Virtual Machine Profile Properties to be specified according to \"specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/{computeApiVersion}/virtualMachineScaleSet.json#/definitions/VirtualMachineScaleSetVMProfile\"", + "type": { + "$ref": "565" + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.AzureFleet.ComputeProfile.baseVirtualMachineProfile", + "serializationOptions": { + "$id": "1372", + "json": { + "$id": "1373", + "name": "baseVirtualMachineProfile" + } + } + }, + { + "$id": "1374", + "kind": "property", + "name": "computeApiVersion", + "serializedName": "computeApiVersion", + "doc": "Specifies the Microsoft.Compute API version to use when creating underlying Virtual Machine scale sets and Virtual Machines.\nThe default value will be the latest supported computeApiVersion by Compute Fleet.", + "type": { + "$id": "1375", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.AzureFleet.ComputeProfile.computeApiVersion", + "serializationOptions": { + "$id": "1376", + "json": { + "$id": "1377", + "name": "computeApiVersion" + } + } + }, + { + "$id": "1378", + "kind": "property", + "name": "platformFaultDomainCount", + "serializedName": "platformFaultDomainCount", + "doc": "Specifies the number of fault domains to use when creating the underlying VMSS.\nA fault domain is a logical group of hardware within an Azure datacenter.\nVMs in the same fault domain share a common power source and network switch.\nIf not specified, defaults to 1, which represents \"Max Spreading\" (using as many fault domains as possible).\nThis property cannot be updated.", + "type": { + "$id": "1379", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.AzureFleet.ComputeProfile.platformFaultDomainCount", + "serializationOptions": { + "$id": "1380", + "json": { + "$id": "1381", + "name": "platformFaultDomainCount" + } + } + }, + { + "$id": "1382", + "kind": "property", + "name": "additionalVirtualMachineCapabilities", + "serializedName": "additionalVirtualMachineCapabilities", + "doc": "Specifies VMSS and VM API entity models support two additional capabilities as of today: ultraSSDEnabled and hibernationEnabled.\nultraSSDEnabled: Enables UltraSSD_LRS storage account type on the VMSS VMs.\nhibernationEnabled: Enables the hibernation capability on the VMSS VMs.\nDefault value is null if not specified. This property cannot be updated once set.", + "type": { + "$id": "1383", + "kind": "model", + "name": "AdditionalCapabilities", + "clientNamespace": "Microsoft.AzureFleet", + "crossLanguageDefinitionId": "Microsoft.AzureFleet.AdditionalCapabilities", + "usage": "Input,Output,Json,LroInitial,LroPolling,LroFinalEnvelope", + "doc": "AdditionalCapabilities for VM.", + "decorators": [], + "properties": [ + { + "$id": "1384", + "kind": "property", + "name": "isUltraSSDEnabled", + "serializedName": "ultraSSDEnabled", + "doc": "The flag that enables or disables a capability to have one or more managed data disks with UltraSSD_LRS storage account type on the VM or VMSS.\nManaged disks with storage account type UltraSSD_LRS can be added to a virtual machine or virtual machine scale set only if this property is enabled.", + "type": { + "$id": "1385", + "kind": "boolean", + "name": "boolean", + "crossLanguageDefinitionId": "TypeSpec.boolean", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.AzureFleet.AdditionalCapabilities.ultraSSDEnabled", + "serializationOptions": { + "$id": "1386", + "json": { + "$id": "1387", + "name": "ultraSSDEnabled" + } + } + }, + { + "$id": "1388", + "kind": "property", + "name": "isHibernationEnabled", + "serializedName": "hibernationEnabled", + "doc": "The flag that enables or disables hibernation capability on the VM.", + "type": { + "$id": "1389", + "kind": "boolean", + "name": "boolean", + "crossLanguageDefinitionId": "TypeSpec.boolean", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.AzureFleet.AdditionalCapabilities.hibernationEnabled", + "serializationOptions": { + "$id": "1390", + "json": { + "$id": "1391", + "name": "hibernationEnabled" + } + } + } + ] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.AzureFleet.ComputeProfile.additionalVirtualMachineCapabilities", + "serializationOptions": { + "$id": "1392", + "json": { + "$id": "1393", + "name": "additionalVirtualMachineCapabilities" + } + } + } + ] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.AzureFleet.FleetProperties.computeProfile", + "serializationOptions": { + "$id": "1394", + "json": { + "$id": "1395", + "name": "computeProfile" + } + } + }, + { + "$id": "1396", + "kind": "property", + "name": "CreatedOn", + "serializedName": "timeCreated", + "doc": "Specifies the time at which the Compute Fleet is created.", + "type": { + "$id": "1397", + "kind": "utcDateTime", + "name": "utcDateTime", + "encode": "rfc3339", + "wireType": { + "$id": "1398", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.utcDateTime", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.AzureFleet.FleetProperties.timeCreated", + "serializationOptions": { + "$id": "1399", + "json": { + "$id": "1400", + "name": "timeCreated" + } + } + }, + { + "$id": "1401", + "kind": "property", + "name": "uniqueId", + "serializedName": "uniqueId", + "doc": "Specifies the ID which uniquely identifies a Compute Fleet.", + "type": { + "$id": "1402", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.AzureFleet.FleetProperties.uniqueId", + "serializationOptions": { + "$id": "1403", + "json": { + "$id": "1404", + "name": "uniqueId" + } + } + } + ] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.AzureFleet.Fleet.properties", + "serializationOptions": { + "$id": "1405", + "json": { + "$id": "1406", + "name": "properties" + } + } + }, + { + "$id": "1407", + "kind": "property", + "name": "zones", + "serializedName": "zones", + "doc": "Zones in which the Compute Fleet is available", + "type": { + "$id": "1408", + "kind": "array", + "name": "Array", + "valueType": { + "$id": "1409", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.AzureFleet.Fleet.zones", + "serializationOptions": { + "$id": "1410", + "json": { + "$id": "1411", + "name": "zones" + } + } + }, + { + "$id": "1412", + "kind": "property", + "name": "identity", + "serializedName": "identity", + "doc": "The managed service identities assigned to this resource.", + "type": { + "$id": "1413", + "kind": "model", + "name": "ManagedServiceIdentity", + "clientNamespace": "Azure.ResourceManager.CommonTypes", + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.ManagedServiceIdentity", + "usage": "Input,Output,Json,LroInitial,LroPolling,LroFinalEnvelope", + "doc": "Managed service identity (system assigned and/or user assigned identities)", + "decorators": [], + "properties": [ + { + "$id": "1414", + "kind": "property", + "name": "principalId", + "serializedName": "principalId", + "doc": "The service principal ID of the system assigned identity. This property will only be provided for a system assigned identity.", + "type": { + "$id": "1415", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "1416", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.ManagedServiceIdentity.principalId", + "serializationOptions": { + "$id": "1417", + "json": { + "$id": "1418", + "name": "principalId" + } + } + }, + { + "$id": "1419", + "kind": "property", + "name": "tenantId", + "serializedName": "tenantId", + "doc": "The tenant ID of the system assigned identity. This property will only be provided for a system assigned identity.", + "type": { + "$id": "1420", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "1421", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.ManagedServiceIdentity.tenantId", + "serializationOptions": { + "$id": "1422", + "json": { + "$id": "1423", + "name": "tenantId" + } + } + }, + { + "$id": "1424", + "kind": "property", + "name": "type", + "serializedName": "type", + "doc": "The type of managed identity assigned to this resource.", + "type": { + "$ref": "306" + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.ManagedServiceIdentity.type", + "serializationOptions": { + "$id": "1425", + "json": { + "$id": "1426", + "name": "type" + } + } + }, + { + "$id": "1427", + "kind": "property", + "name": "userAssignedIdentities", + "serializedName": "userAssignedIdentities", + "doc": "The identities assigned to this resource by the user.", + "type": { + "$id": "1428", + "kind": "dict", + "keyType": { + "$id": "1429", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "valueType": { + "$id": "1430", + "kind": "nullable", + "type": { + "$id": "1431", + "kind": "model", + "name": "UserAssignedIdentity", + "clientNamespace": "Azure.ResourceManager.CommonTypes", + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.UserAssignedIdentity", + "usage": "Input,Output,Json,LroInitial,LroPolling,LroFinalEnvelope", + "doc": "User assigned identity properties", + "decorators": [], + "properties": [ + { + "$id": "1432", + "kind": "property", + "name": "clientId", + "serializedName": "clientId", + "doc": "The client ID of the assigned identity.", + "type": { + "$id": "1433", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "1434", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.UserAssignedIdentity.clientId", + "serializationOptions": { + "$id": "1435", + "json": { + "$id": "1436", + "name": "clientId" + } + } + }, + { + "$id": "1437", + "kind": "property", + "name": "principalId", + "serializedName": "principalId", + "doc": "The principal ID of the assigned identity.", + "type": { + "$id": "1438", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "1439", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.UserAssignedIdentity.principalId", + "serializationOptions": { + "$id": "1440", + "json": { + "$id": "1441", + "name": "principalId" + } + } + } + ] + }, + "clientNamespace": "" + }, + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.ManagedServiceIdentity.userAssignedIdentities", + "serializationOptions": { + "$id": "1442", + "json": { + "$id": "1443", + "name": "userAssignedIdentities" + } + } + } + ] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.AzureFleet.Fleet.identity", + "serializationOptions": { + "$id": "1444", + "json": { + "$id": "1445", + "name": "identity" + } + } + }, + { + "$id": "1446", + "kind": "property", + "name": "plan", + "serializedName": "plan", + "doc": "Details of the resource plan.", + "type": { + "$id": "1447", + "kind": "model", + "name": "Plan", + "clientNamespace": "Azure.ResourceManager.CommonTypes", + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.Plan", + "usage": "Input,Output,Json,LroInitial,LroPolling,LroFinalEnvelope", + "doc": "Plan for the resource.", + "decorators": [], + "properties": [ + { + "$id": "1448", + "kind": "property", + "name": "name", + "serializedName": "name", + "doc": "A user defined name of the 3rd Party Artifact that is being procured.", + "type": { + "$id": "1449", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.Plan.name", + "serializationOptions": { + "$id": "1450", + "json": { + "$id": "1451", + "name": "name" + } + } + }, + { + "$id": "1452", + "kind": "property", + "name": "publisher", + "serializedName": "publisher", + "doc": "The publisher of the 3rd Party Artifact that is being bought. E.g. NewRelic", + "type": { + "$id": "1453", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.Plan.publisher", + "serializationOptions": { + "$id": "1454", + "json": { + "$id": "1455", + "name": "publisher" + } + } + }, + { + "$id": "1456", + "kind": "property", + "name": "product", + "serializedName": "product", + "doc": "The 3rd Party artifact that is being procured. E.g. NewRelic. Product maps to the OfferID specified for the artifact at the time of Data Market onboarding.", + "type": { + "$id": "1457", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.Plan.product", + "serializationOptions": { + "$id": "1458", + "json": { + "$id": "1459", + "name": "product" + } + } + }, + { + "$id": "1460", + "kind": "property", + "name": "promotionCode", + "serializedName": "promotionCode", + "doc": "A publisher provided promotion code as provisioned in Data Market for the said product/artifact.", + "type": { + "$id": "1461", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.Plan.promotionCode", + "serializationOptions": { + "$id": "1462", + "json": { + "$id": "1463", + "name": "promotionCode" + } + } + }, + { + "$id": "1464", + "kind": "property", + "name": "version", + "serializedName": "version", + "doc": "The version of the desired product/artifact.", + "type": { + "$id": "1465", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.Plan.version", + "serializationOptions": { + "$id": "1466", + "json": { + "$id": "1467", + "name": "version" + } + } + } + ] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.AzureFleet.Fleet.plan", + "serializationOptions": { + "$id": "1468", + "json": { + "$id": "1469", + "name": "plan" + } + } + } + ] + }, + { + "$ref": "406" + }, + { + "$ref": "411" + }, + { + "$ref": "437" + }, + { + "$ref": "453" + }, + { + "$ref": "465" + }, + { + "$ref": "467" + }, + { + "$ref": "479" + }, + { + "$ref": "555" + }, + { + "$ref": "558" + }, + { + "$ref": "565" + }, + { + "$ref": "567" + }, + { + "$ref": "585" + }, + { + "$ref": "600" + }, + { + "$ref": "619" + }, + { + "$ref": "631" + }, + { + "$ref": "644" + }, + { + "$ref": "647" + }, + { + "$ref": "666" + }, + { + "$ref": "672" + }, + { + "$ref": "675" + }, + { + "$ref": "693" + }, + { + "$ref": "701" + }, + { + "$ref": "721" + }, + { + "$ref": "723" + }, + { + "$ref": "733" + }, + { + "$ref": "757" + }, + { + "$ref": "759" + }, + { + "$ref": "796" + }, + { + "$ref": "812" + }, + { + "$ref": "829" + }, + { + "$ref": "842" + }, + { + "$ref": "847" + }, + { + "$ref": "856" + }, + { + "$ref": "874" + }, + { + "$ref": "919" + }, + { + "$ref": "921" + }, + { + "$ref": "931" + }, + { + "$ref": "937" + }, + { + "$ref": "958" + }, + { + "$ref": "968" + }, + { + "$ref": "974" + }, + { + "$ref": "983" + }, + { + "$ref": "989" + }, + { + "$ref": "995" + }, + { + "$ref": "1007" + }, + { + "$ref": "1030" + }, + { + "$ref": "1087" + }, + { + "$ref": "1089" + }, + { + "$ref": "1108" + }, + { + "$ref": "1117" + }, + { + "$ref": "1134" + }, + { + "$ref": "1136" + }, + { + "$ref": "1150" + }, + { + "$ref": "1153" + }, + { + "$ref": "1168" + }, + { + "$ref": "1219" + }, + { + "$ref": "1244" + }, + { + "$ref": "1246" + }, + { + "$ref": "1258" + }, + { + "$ref": "1276" + }, + { + "$ref": "1283" + }, + { + "$ref": "1286" + }, + { + "$ref": "1317" + }, + { + "$ref": "1319" + }, + { + "$ref": "1333" + }, + { + "$ref": "1342" + }, + { + "$ref": "1370" + }, + { + "$ref": "1383" + }, + { + "$ref": "1413" + }, + { + "$ref": "1431" + }, + { + "$ref": "1447" + }, + { + "$ref": "351" + }, + { + "$ref": "352" + }, + { + "$ref": "368" + }, + { + "$id": "1470", + "kind": "model", + "name": "ErrorResponse", + "clientNamespace": "Azure.ResourceManager.CommonTypes", + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.ErrorResponse", + "usage": "Error,Json,Exception", + "doc": "Common error response for all Azure Resource Manager APIs to return error details for failed operations.", + "decorators": [], + "properties": [ + { + "$id": "1471", + "kind": "property", + "name": "error", + "serializedName": "error", + "doc": "The error object.", + "type": { + "$id": "1472", + "kind": "model", + "name": "ErrorDetail", + "clientNamespace": "Azure.ResourceManager.CommonTypes", + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.ErrorDetail", + "usage": "Json,Exception,LroPolling", + "doc": "The error detail.", + "decorators": [], + "properties": [ + { + "$id": "1473", + "kind": "property", + "name": "code", + "serializedName": "code", + "doc": "The error code.", + "type": { + "$id": "1474", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.ErrorDetail.code", + "serializationOptions": { + "$id": "1475", + "json": { + "$id": "1476", + "name": "code" + } + } + }, + { + "$id": "1477", + "kind": "property", + "name": "message", + "serializedName": "message", + "doc": "The error message.", + "type": { + "$id": "1478", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.ErrorDetail.message", + "serializationOptions": { + "$id": "1479", + "json": { + "$id": "1480", + "name": "message" + } + } + }, + { + "$id": "1481", + "kind": "property", + "name": "target", + "serializedName": "target", + "doc": "The error target.", + "type": { + "$id": "1482", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.ErrorDetail.target", + "serializationOptions": { + "$id": "1483", + "json": { + "$id": "1484", + "name": "target" + } + } + }, + { + "$id": "1485", + "kind": "property", + "name": "details", + "serializedName": "details", + "doc": "The error details.", + "type": { + "$id": "1486", + "kind": "array", + "name": "ArrayErrorDetail", + "valueType": { + "$ref": "1472" + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.ErrorDetail.details", + "serializationOptions": { + "$id": "1487", + "json": { + "$id": "1488", + "name": "details" + } + } + }, + { + "$id": "1489", + "kind": "property", + "name": "additionalInfo", + "serializedName": "additionalInfo", + "doc": "The error additional info.", + "type": { + "$id": "1490", + "kind": "array", + "name": "ArrayErrorAdditionalInfo", + "valueType": { + "$id": "1491", + "kind": "model", + "name": "ErrorAdditionalInfo", + "clientNamespace": "Azure.ResourceManager.CommonTypes", + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.ErrorAdditionalInfo", + "usage": "Json,Exception,LroPolling", + "doc": "The resource management error additional info.", + "decorators": [], + "properties": [ + { + "$id": "1492", + "kind": "property", + "name": "type", + "serializedName": "type", + "doc": "The additional info type.", + "type": { + "$id": "1493", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.ErrorAdditionalInfo.type", + "serializationOptions": { + "$id": "1494", + "json": { + "$id": "1495", + "name": "type" + } + } + }, + { + "$id": "1496", + "kind": "property", + "name": "info", + "serializedName": "info", + "doc": "The additional info.", + "type": { + "$id": "1497", + "kind": "model", + "name": "ErrorAdditionalInfoInfo", + "clientNamespace": "Azure.ResourceManager.CommonTypes", + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.ErrorAdditionalInfo.info.anonymous", + "usage": "Json,Exception,LroPolling", + "decorators": [], + "properties": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.ErrorAdditionalInfo.info", + "serializationOptions": { + "$id": "1498", + "json": { + "$id": "1499", + "name": "info" + } + } + } + ] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.ErrorDetail.additionalInfo", + "serializationOptions": { + "$id": "1500", + "json": { + "$id": "1501", + "name": "additionalInfo" + } + } + } + ] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.ErrorResponse.error", + "serializationOptions": { + "$id": "1502", + "json": { + "$id": "1503", + "name": "error" + } + } + } + ] + }, + { + "$ref": "1472" + }, + { + "$ref": "1491" + }, + { + "$ref": "1497" + }, + { + "$id": "1504", + "kind": "model", + "name": "FleetUpdate", + "clientNamespace": "Microsoft.AzureFleet", + "crossLanguageDefinitionId": "Microsoft.AzureFleet.FleetUpdate", + "usage": "Input,Json", + "doc": "Fleet Update Model", + "decorators": [], + "properties": [ + { + "$id": "1505", + "kind": "property", + "name": "tags", + "serializedName": "tags", + "doc": "Resource tags.", + "type": { + "$id": "1506", + "kind": "dict", + "keyType": { + "$id": "1507", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "valueType": { + "$id": "1508", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.AzureFleet.FleetUpdate.tags", + "serializationOptions": { + "$id": "1509", + "json": { + "$id": "1510", + "name": "tags" + } + } + }, + { + "$id": "1511", + "kind": "property", + "name": "identity", + "serializedName": "identity", + "doc": "Updatable managed service identity", + "type": { + "$id": "1512", + "kind": "model", + "name": "ManagedServiceIdentityUpdate", + "clientNamespace": "Microsoft.AzureFleet", + "crossLanguageDefinitionId": "Microsoft.AzureFleet.ManagedServiceIdentityUpdate", + "usage": "Input,Json", + "doc": "The template for adding optional properties.", + "decorators": [], + "properties": [ + { + "$id": "1513", + "kind": "property", + "name": "type", + "serializedName": "type", + "doc": "The type of managed identity assigned to this resource.", + "type": { + "$ref": "306" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.AzureFleet.ManagedServiceIdentityUpdate.type", + "serializationOptions": { + "$id": "1514", + "json": { + "$id": "1515", + "name": "type" + } + } + }, + { + "$id": "1516", + "kind": "property", + "name": "userAssignedIdentities", + "serializedName": "userAssignedIdentities", + "doc": "The identities assigned to this resource by the user.", + "type": { + "$id": "1517", + "kind": "dict", + "keyType": { + "$id": "1518", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "valueType": { + "$ref": "1430" + }, + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.AzureFleet.ManagedServiceIdentityUpdate.userAssignedIdentities", + "serializationOptions": { + "$id": "1519", + "json": { + "$id": "1520", + "name": "userAssignedIdentities" + } + } + } + ] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.AzureFleet.FleetUpdate.identity", + "serializationOptions": { + "$id": "1521", + "json": { + "$id": "1522", + "name": "identity" + } + } + }, + { + "$id": "1523", + "kind": "property", + "name": "plan", + "serializedName": "plan", + "doc": "Updatable resource plan", + "type": { + "$id": "1524", + "kind": "model", + "name": "ResourcePlanUpdate", + "clientNamespace": "Microsoft.AzureFleet", + "crossLanguageDefinitionId": "Microsoft.AzureFleet.ResourcePlanUpdate", + "usage": "Input,Json", + "doc": "The template for adding optional properties.", + "decorators": [], + "properties": [ + { + "$id": "1525", + "kind": "property", + "name": "name", + "serializedName": "name", + "doc": "A user defined name of the 3rd Party Artifact that is being procured.", + "type": { + "$id": "1526", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.AzureFleet.ResourcePlanUpdate.name", + "serializationOptions": { + "$id": "1527", + "json": { + "$id": "1528", + "name": "name" + } + } + }, + { + "$id": "1529", + "kind": "property", + "name": "publisher", + "serializedName": "publisher", + "doc": "The publisher of the 3rd Party Artifact that is being bought. E.g. NewRelic", + "type": { + "$id": "1530", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.AzureFleet.ResourcePlanUpdate.publisher", + "serializationOptions": { + "$id": "1531", + "json": { + "$id": "1532", + "name": "publisher" + } + } + }, + { + "$id": "1533", + "kind": "property", + "name": "product", + "serializedName": "product", + "doc": "The 3rd Party artifact that is being procured. E.g. NewRelic. Product maps to the OfferID specified for the artifact at the time of Data Market onboarding.", + "type": { + "$id": "1534", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.AzureFleet.ResourcePlanUpdate.product", + "serializationOptions": { + "$id": "1535", + "json": { + "$id": "1536", + "name": "product" + } + } + }, + { + "$id": "1537", + "kind": "property", + "name": "promotionCode", + "serializedName": "promotionCode", + "doc": "A publisher provided promotion code as provisioned in Data Market for the said product/artifact.", + "type": { + "$id": "1538", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.AzureFleet.ResourcePlanUpdate.promotionCode", + "serializationOptions": { + "$id": "1539", + "json": { + "$id": "1540", + "name": "promotionCode" + } + } + }, + { + "$id": "1541", + "kind": "property", + "name": "version", + "serializedName": "version", + "doc": "The version of the desired product/artifact.", + "type": { + "$id": "1542", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.AzureFleet.ResourcePlanUpdate.version", + "serializationOptions": { + "$id": "1543", + "json": { + "$id": "1544", + "name": "version" + } + } + } + ] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.AzureFleet.FleetUpdate.plan", + "serializationOptions": { + "$id": "1545", + "json": { + "$id": "1546", + "name": "plan" + } + } + }, + { + "$id": "1547", + "kind": "property", + "name": "properties", + "serializedName": "properties", + "doc": "RP-specific updatable properties", + "type": { + "$ref": "406" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.AzureFleet.FleetUpdate.properties", + "serializationOptions": { + "$id": "1548", + "json": { + "$id": "1549", + "name": "properties" + } + } + } + ] + }, + { + "$ref": "1512" + }, + { + "$ref": "1524" + }, + { + "$id": "1550", + "kind": "model", + "name": "ArmOperationStatusResourceProvisioningState", + "clientNamespace": "Azure.ResourceManager", + "crossLanguageDefinitionId": "Azure.ResourceManager.ArmOperationStatus", + "usage": "LroPolling", + "doc": "Standard Azure Resource Manager operation status response", + "decorators": [], + "properties": [ + { + "$id": "1551", + "kind": "property", + "name": "status", + "serializedName": "status", + "doc": "The operation status", + "type": { + "$ref": "326" + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.ArmOperationStatus.status", + "serializationOptions": { + "$id": "1552", + "json": { + "$id": "1553", + "name": "status" + } + } + }, + { + "$id": "1554", + "kind": "property", + "name": "name", + "serializedName": "name", + "doc": "The name of the operationStatus resource", + "type": { + "$id": "1555", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.ArmOperationStatus.name", + "serializationOptions": { + "$id": "1556", + "json": { + "$id": "1557", + "name": "name" + } + } + }, + { + "$id": "1558", + "kind": "property", + "name": "startTime", + "serializedName": "startTime", + "doc": "Operation start time", + "type": { + "$id": "1559", + "kind": "utcDateTime", + "name": "utcDateTime", + "encode": "rfc3339", + "wireType": { + "$id": "1560", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.utcDateTime", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.ArmOperationStatus.startTime", + "serializationOptions": { + "$id": "1561", + "json": { + "$id": "1562", + "name": "startTime" + } + } + }, + { + "$id": "1563", + "kind": "property", + "name": "endTime", + "serializedName": "endTime", + "doc": "Operation complete time", + "type": { + "$id": "1564", + "kind": "utcDateTime", + "name": "utcDateTime", + "encode": "rfc3339", + "wireType": { + "$id": "1565", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.utcDateTime", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.ArmOperationStatus.endTime", + "serializationOptions": { + "$id": "1566", + "json": { + "$id": "1567", + "name": "endTime" + } + } + }, + { + "$id": "1568", + "kind": "property", + "name": "percentComplete", + "serializedName": "percentComplete", + "doc": "The progress made toward completing the operation", + "type": { + "$id": "1569", + "kind": "float64", + "name": "float64", + "crossLanguageDefinitionId": "TypeSpec.float64", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.ArmOperationStatus.percentComplete", + "serializationOptions": { + "$id": "1570", + "json": { + "$id": "1571", + "name": "percentComplete" + } + } + }, + { + "$id": "1572", + "kind": "property", + "name": "error", + "serializedName": "error", + "doc": "Errors that occurred if the operation ended with Canceled or Failed status", + "type": { + "$ref": "1472" + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.ArmOperationStatus.error", + "serializationOptions": { + "$id": "1573", + "json": { + "$id": "1574", + "name": "error" + } + } + } + ] + }, + { + "$id": "1575", + "kind": "model", + "name": "FleetListResult", + "clientNamespace": "Azure.ResourceManager", + "crossLanguageDefinitionId": "Azure.ResourceManager.ResourceListResult", + "usage": "Output,Json", + "doc": "The response of a Fleet list operation.", + "decorators": [], + "properties": [ + { + "$id": "1576", + "kind": "property", + "name": "value", + "serializedName": "value", + "doc": "The Fleet items on this page", + "type": { + "$id": "1577", + "kind": "array", + "name": "ArrayFleet", + "valueType": { + "$ref": "350" + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.ResourceListResult.value", + "serializationOptions": { + "$id": "1578", + "json": { + "$id": "1579", + "name": "value" + } + } + }, + { + "$id": "1580", + "kind": "property", + "name": "nextLink", + "serializedName": "nextLink", + "doc": "The link to the next page of items", + "type": { + "$id": "1581", + "kind": "url", + "name": "ResourceLocation", + "crossLanguageDefinitionId": "TypeSpec.Rest.ResourceLocation", + "baseType": { + "$id": "1582", + "kind": "url", + "name": "url", + "crossLanguageDefinitionId": "TypeSpec.url", + "decorators": [] + }, + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.ResourceListResult.nextLink", + "serializationOptions": { + "$id": "1583", + "json": { + "$id": "1584", + "name": "nextLink" + } + } + } + ] + }, + { + "$id": "1585", + "kind": "model", + "name": "VirtualMachineScaleSetListResult", + "clientNamespace": "Microsoft.AzureFleet", + "crossLanguageDefinitionId": "Microsoft.AzureFleet.VirtualMachineScaleSetListResult", + "usage": "Output,Json", + "doc": "The response of a VirtualMachineScaleSet list operation.", + "decorators": [], + "properties": [ + { + "$id": "1586", + "kind": "property", + "name": "value", + "serializedName": "value", + "doc": "The VirtualMachineScaleSet items on this page", + "type": { + "$id": "1587", + "kind": "array", + "name": "ArrayVirtualMachineScaleSet", + "valueType": { + "$id": "1588", + "kind": "model", + "name": "ComputeFleetVmss", + "clientNamespace": "Microsoft.AzureFleet", + "crossLanguageDefinitionId": "Microsoft.AzureFleet.VirtualMachineScaleSet", + "usage": "Output,Json", + "doc": "An AzureFleet's virtualMachineScaleSet", + "decorators": [], + "properties": [ + { + "$id": "1589", + "kind": "property", + "name": "id", + "serializedName": "id", + "doc": "The compute RP resource id of the virtualMachineScaleSet \n\"subscriptions/{subId}/resourceGroups/{rgName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmssName}\"", + "type": { + "$id": "1590", + "kind": "string", + "name": "armResourceIdentifier", + "crossLanguageDefinitionId": "Azure.Core.armResourceIdentifier", + "baseType": { + "$id": "1591", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "optional": false, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.AzureFleet.VirtualMachineScaleSet.id", + "serializationOptions": { + "$id": "1592", + "json": { + "$id": "1593", + "name": "id" + } + } + }, + { + "$id": "1594", + "kind": "property", + "name": "type", + "serializedName": "type", + "doc": "Type of the virtualMachineScaleSet", + "type": { + "$id": "1595", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.AzureFleet.VirtualMachineScaleSet.type", + "serializationOptions": { + "$id": "1596", + "json": { + "$id": "1597", + "name": "type" + } + } + }, + { + "$id": "1598", + "kind": "property", + "name": "operationStatus", + "serializedName": "operationStatus", + "doc": "This represents the operationStatus of the VMSS in response to the last operation that was performed on it by Azure Fleet resource.", + "type": { + "$ref": "2" + }, + "optional": false, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.AzureFleet.VirtualMachineScaleSet.operationStatus", + "serializationOptions": { + "$id": "1599", + "json": { + "$id": "1600", + "name": "operationStatus" + } + } + }, + { + "$id": "1601", + "kind": "property", + "name": "error", + "serializedName": "error", + "doc": "Error Information when `operationStatus` is `Failed`", + "type": { + "$id": "1602", + "kind": "model", + "name": "ComputeFleetApiError", + "clientNamespace": "Microsoft.AzureFleet", + "crossLanguageDefinitionId": "Microsoft.AzureFleet.ApiError", + "usage": "Output,Json", + "doc": "ApiError for Fleet", + "decorators": [], + "properties": [ + { + "$id": "1603", + "kind": "property", + "name": "code", + "serializedName": "code", + "doc": "The error code.", + "type": { + "$id": "1604", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.AzureFleet.ApiError.code", + "serializationOptions": { + "$id": "1605", + "json": { + "$id": "1606", + "name": "code" + } + } + }, + { + "$id": "1607", + "kind": "property", + "name": "target", + "serializedName": "target", + "doc": "The target of the particular error.", + "type": { + "$id": "1608", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.AzureFleet.ApiError.target", + "serializationOptions": { + "$id": "1609", + "json": { + "$id": "1610", + "name": "target" + } + } + }, + { + "$id": "1611", + "kind": "property", + "name": "message", + "serializedName": "message", + "doc": "The error message.", + "type": { + "$id": "1612", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.AzureFleet.ApiError.message", + "serializationOptions": { + "$id": "1613", + "json": { + "$id": "1614", + "name": "message" + } + } + }, + { + "$id": "1615", + "kind": "property", + "name": "details", + "serializedName": "details", + "doc": "The API error details", + "type": { + "$id": "1616", + "kind": "array", + "name": "ArrayApiErrorBase", + "valueType": { + "$id": "1617", + "kind": "model", + "name": "ComputeFleetApiErrorInfo", + "clientNamespace": "Microsoft.AzureFleet", + "crossLanguageDefinitionId": "Microsoft.AzureFleet.ApiErrorBase", + "usage": "Output,Json", + "doc": "API error base.", + "decorators": [], + "properties": [ + { + "$id": "1618", + "kind": "property", + "name": "code", + "serializedName": "code", + "doc": "The error code.", + "type": { + "$id": "1619", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.AzureFleet.ApiErrorBase.code", + "serializationOptions": { + "$id": "1620", + "json": { + "$id": "1621", + "name": "code" + } + } + }, + { + "$id": "1622", + "kind": "property", + "name": "target", + "serializedName": "target", + "doc": "The target of the particular error.", + "type": { + "$id": "1623", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.AzureFleet.ApiErrorBase.target", + "serializationOptions": { + "$id": "1624", + "json": { + "$id": "1625", + "name": "target" + } + } + }, + { + "$id": "1626", + "kind": "property", + "name": "message", + "serializedName": "message", + "doc": "The error message.", + "type": { + "$id": "1627", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.AzureFleet.ApiErrorBase.message", + "serializationOptions": { + "$id": "1628", + "json": { + "$id": "1629", + "name": "message" + } + } + } + ] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.AzureFleet.ApiError.details", + "serializationOptions": { + "$id": "1630", + "json": { + "$id": "1631", + "name": "details" + } + } + }, + { + "$id": "1632", + "kind": "property", + "name": "innererror", + "serializedName": "innererror", + "doc": "The API inner error", + "type": { + "$id": "1633", + "kind": "model", + "name": "ComputeFleetInnerError", + "clientNamespace": "Microsoft.AzureFleet", + "crossLanguageDefinitionId": "Microsoft.AzureFleet.InnerError", + "usage": "Output,Json", + "doc": "Inner error details.", + "decorators": [], + "properties": [ + { + "$id": "1634", + "kind": "property", + "name": "exceptionType", + "serializedName": "exceptionType", + "doc": "The exception type.", + "type": { + "$id": "1635", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.AzureFleet.InnerError.exceptionType", + "serializationOptions": { + "$id": "1636", + "json": { + "$id": "1637", + "name": "exceptionType" + } + } + }, + { + "$id": "1638", + "kind": "property", + "name": "errorDetail", + "serializedName": "errorDetail", + "doc": "The internal error message or exception dump.", + "type": { + "$id": "1639", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.AzureFleet.InnerError.errorDetail", + "serializationOptions": { + "$id": "1640", + "json": { + "$id": "1641", + "name": "errorDetail" + } + } + } + ] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.AzureFleet.ApiError.innererror", + "serializationOptions": { + "$id": "1642", + "json": { + "$id": "1643", + "name": "innererror" + } + } + } + ] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.AzureFleet.VirtualMachineScaleSet.error", + "serializationOptions": { + "$id": "1644", + "json": { + "$id": "1645", + "name": "error" + } + } + } + ] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.AzureFleet.VirtualMachineScaleSetListResult.value", + "serializationOptions": { + "$id": "1646", + "json": { + "$id": "1647", + "name": "value" + } + } + }, + { + "$id": "1648", + "kind": "property", + "name": "nextLink", + "serializedName": "nextLink", + "doc": "The link to the next page of items", + "type": { + "$id": "1649", + "kind": "url", + "name": "url", + "crossLanguageDefinitionId": "TypeSpec.url", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.AzureFleet.VirtualMachineScaleSetListResult.nextLink", + "serializationOptions": { + "$id": "1650", + "json": { + "$id": "1651", + "name": "nextLink" + } + } + } + ] + }, + { + "$ref": "1588" + }, + { + "$ref": "1602" + }, + { + "$ref": "1617" + }, + { + "$ref": "1633" + }, + { + "$id": "1652", + "kind": "model", + "name": "OperationListResult", + "clientNamespace": "Azure.ResourceManager.CommonTypes", + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.OperationListResult", + "usage": "Output,Json", + "doc": "A list of REST API operations supported by an Azure Resource Provider. It contains an URL link to get the next set of results.", + "decorators": [], + "properties": [ + { + "$id": "1653", + "kind": "property", + "name": "value", + "serializedName": "value", + "doc": "The Operation items on this page", + "type": { + "$id": "1654", + "kind": "array", + "name": "ArrayOperation", + "valueType": { + "$id": "1655", + "kind": "model", + "name": "Operation", + "clientNamespace": "Azure.ResourceManager.CommonTypes", + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.Operation", + "usage": "Output,Json", + "doc": "Details of a REST API operation, returned from the Resource Provider Operations API", + "decorators": [], + "properties": [ + { + "$id": "1656", + "kind": "property", + "name": "name", + "serializedName": "name", + "doc": "The name of the operation, as per Resource-Based Access Control (RBAC). Examples: \"Microsoft.Compute/virtualMachines/write\", \"Microsoft.Compute/virtualMachines/capture/action\"", + "type": { + "$id": "1657", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.Operation.name", + "serializationOptions": { + "$id": "1658", + "json": { + "$id": "1659", + "name": "name" + } + } + }, + { + "$id": "1660", + "kind": "property", + "name": "isDataAction", + "serializedName": "isDataAction", + "doc": "Whether the operation applies to data-plane. This is \"true\" for data-plane operations and \"false\" for Azure Resource Manager/control-plane operations.", + "type": { + "$id": "1661", + "kind": "boolean", + "name": "boolean", + "crossLanguageDefinitionId": "TypeSpec.boolean", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.Operation.isDataAction", + "serializationOptions": { + "$id": "1662", + "json": { + "$id": "1663", + "name": "isDataAction" + } + } + }, + { + "$id": "1664", + "kind": "property", + "name": "display", + "serializedName": "display", + "doc": "Localized display information for this particular operation.", + "type": { + "$id": "1665", + "kind": "model", + "name": "OperationDisplay", + "clientNamespace": "Azure.ResourceManager.CommonTypes", + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.OperationDisplay", + "usage": "Output,Json", + "doc": "Localized display information for and operation.", + "decorators": [], + "properties": [ + { + "$id": "1666", + "kind": "property", + "name": "provider", + "serializedName": "provider", + "doc": "The localized friendly form of the resource provider name, e.g. \"Microsoft Monitoring Insights\" or \"Microsoft Compute\".", + "type": { + "$id": "1667", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.OperationDisplay.provider", + "serializationOptions": { + "$id": "1668", + "json": { + "$id": "1669", + "name": "provider" + } + } + }, + { + "$id": "1670", + "kind": "property", + "name": "resource", + "serializedName": "resource", + "doc": "The localized friendly name of the resource type related to this operation. E.g. \"Virtual Machines\" or \"Job Schedule Collections\".", + "type": { + "$id": "1671", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.OperationDisplay.resource", + "serializationOptions": { + "$id": "1672", + "json": { + "$id": "1673", + "name": "resource" + } + } + }, + { + "$id": "1674", + "kind": "property", + "name": "operation", + "serializedName": "operation", + "doc": "The concise, localized friendly name for the operation; suitable for dropdowns. E.g. \"Create or Update Virtual Machine\", \"Restart Virtual Machine\".", + "type": { + "$id": "1675", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.OperationDisplay.operation", + "serializationOptions": { + "$id": "1676", + "json": { + "$id": "1677", + "name": "operation" + } + } + }, + { + "$id": "1678", + "kind": "property", + "name": "description", + "serializedName": "description", + "doc": "The short, localized friendly description of the operation; suitable for tool tips and detailed views.", + "type": { + "$id": "1679", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.OperationDisplay.description", + "serializationOptions": { + "$id": "1680", + "json": { + "$id": "1681", + "name": "description" + } + } + } + ] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.Operation.display", + "serializationOptions": { + "$id": "1682", + "json": { + "$id": "1683", + "name": "display" + } + } + }, + { + "$id": "1684", + "kind": "property", + "name": "origin", + "serializedName": "origin", + "doc": "The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default value is \"user,system\"", + "type": { + "$ref": "334" + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.Operation.origin", + "serializationOptions": { + "$id": "1685", + "json": { + "$id": "1686", + "name": "origin" + } + } + }, + { + "$id": "1687", + "kind": "property", + "name": "actionType", + "serializedName": "actionType", + "doc": "Extensible enum. Indicates the action type. \"Internal\" refers to actions that are for internal only APIs.", + "type": { + "$ref": "342" + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.Operation.actionType", + "serializationOptions": { + "$id": "1688", + "json": { + "$id": "1689", + "name": "actionType" + } + } + } + ] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.OperationListResult.value", + "serializationOptions": { + "$id": "1690", + "json": { + "$id": "1691", + "name": "value" + } + } + }, + { + "$id": "1692", + "kind": "property", + "name": "nextLink", + "serializedName": "nextLink", + "doc": "The link to the next page of items", + "type": { + "$id": "1693", + "kind": "url", + "name": "ResourceLocation", + "crossLanguageDefinitionId": "TypeSpec.Rest.ResourceLocation", + "baseType": { + "$id": "1694", + "kind": "url", + "name": "url", + "crossLanguageDefinitionId": "TypeSpec.url", + "decorators": [] + }, + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.OperationListResult.nextLink", + "serializationOptions": { + "$id": "1695", + "json": { + "$id": "1696", + "name": "nextLink" + } + } + } + ] + }, + { + "$ref": "1655" + }, + { + "$ref": "1665" + } + ], + "Clients": [ + { + "$id": "1697", + "Name": "AzureFleetClient", + "ClientNamespace": "Microsoft.AzureFleet", + "Operations": [], + "Protocol": { + "$id": "1698" + }, + "Parameters": [ + { + "$id": "1699", + "Name": "endpoint", + "NameInRequest": "endpoint", + "Doc": "Service host", + "Type": { + "$id": "1700", + "kind": "url", + "name": "url", + "crossLanguageDefinitionId": "TypeSpec.url" + }, + "Location": "Uri", + "IsApiVersion": false, + "IsResourceParameter": false, + "IsContentType": false, + "IsRequired": true, + "IsEndpoint": true, + "SkipUrlEncoding": false, + "Explode": false, + "Kind": "Client", + "DefaultValue": { + "$id": "1701", + "Type": { + "$id": "1702", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "https://management.azure.com" + } + } + ], + "Decorators": [] + }, + { + "$id": "1703", + "Name": "Operations", + "ClientNamespace": "Microsoft.AzureFleet", + "Operations": [ + { + "$id": "1704", + "Name": "list", + "ResourceName": "Operations", + "Doc": "List the operations for the provider", + "Accessibility": "internal", + "Parameters": [ + { + "$id": "1705", + "Name": "apiVersion", + "NameInRequest": "api-version", + "Doc": "The API version to use for this operation.", + "Type": { + "$id": "1706", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": true, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "DefaultValue": { + "$id": "1707", + "Type": { + "$id": "1708", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "2024-11-01" + }, + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1709", + "Name": "accept", + "NameInRequest": "Accept", + "Type": { + "$id": "1710", + "kind": "constant", + "valueType": { + "$id": "1711", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "1712", + "StatusCodes": [ + 200 + ], + "BodyType": { + "$ref": "1652" + }, + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false, + "ContentTypes": [ + "application/json" + ] + } + ], + "HttpMethod": "GET", + "RequestBodyMediaType": "None", + "Uri": "{endpoint}", + "Path": "/providers/Microsoft.AzureFleet/operations", + "BufferResponse": true, + "Paging": { + "$id": "1713", + "ItemName": "value", + "NextLinkName": "nextLink" + }, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Azure.ResourceManager.Operations.list", + "Decorators": [], + "Examples": [ + { + "$id": "1714", + "kind": "http", + "name": "Operations_List", + "description": "Operations_List", + "filePath": "2024-11-01/Operations_List.json", + "parameters": [ + { + "$id": "1715", + "parameter": { + "$ref": "1705" + }, + "value": { + "$id": "1716", + "kind": "string", + "type": { + "$ref": "1706" + }, + "value": "2024-11-01" + } + } + ], + "responses": [ + { + "$id": "1717", + "response": { + "$ref": "1712" + }, + "statusCode": 200, + "bodyValue": { + "$id": "1718", + "kind": "model", + "type": { + "$ref": "1652" + }, + "value": { + "$id": "1719", + "value": { + "$id": "1720", + "kind": "array", + "type": { + "$ref": "1654" + }, + "value": [ + { + "$id": "1721", + "kind": "model", + "type": { + "$ref": "1655" + }, + "value": { + "$id": "1722", + "origin": { + "$id": "1723", + "kind": "string", + "type": { + "$ref": "334" + }, + "value": "user,system" + }, + "name": { + "$id": "1724", + "kind": "string", + "type": { + "$ref": "1657" + }, + "value": "Microsoft.AzureFleet/fleets/read" + }, + "isDataAction": { + "$id": "1725", + "kind": "boolean", + "type": { + "$ref": "1661" + }, + "value": false + }, + "display": { + "$id": "1726", + "kind": "model", + "type": { + "$ref": "1665" + }, + "value": { + "$id": "1727", + "provider": { + "$id": "1728", + "kind": "string", + "type": { + "$ref": "1667" + }, + "value": "Microsoft Azure Fleet" + }, + "resource": { + "$id": "1729", + "kind": "string", + "type": { + "$ref": "1671" + }, + "value": "Fleets" + }, + "operation": { + "$id": "1730", + "kind": "string", + "type": { + "$ref": "1675" + }, + "value": "Get Azure Fleet" + }, + "description": { + "$id": "1731", + "kind": "string", + "type": { + "$ref": "1679" + }, + "value": "Get properties of Azure Fleet resource" + } + } + } + } + }, + { + "$id": "1732", + "kind": "model", + "type": { + "$ref": "1655" + }, + "value": { + "$id": "1733", + "origin": { + "$id": "1734", + "kind": "string", + "type": { + "$ref": "334" + }, + "value": "user,system" + }, + "name": { + "$id": "1735", + "kind": "string", + "type": { + "$ref": "1657" + }, + "value": "Microsoft.AzureFleet/fleets/write" + }, + "isDataAction": { + "$id": "1736", + "kind": "boolean", + "type": { + "$ref": "1661" + }, + "value": false + }, + "display": { + "$id": "1737", + "kind": "model", + "type": { + "$ref": "1665" + }, + "value": { + "$id": "1738", + "provider": { + "$id": "1739", + "kind": "string", + "type": { + "$ref": "1667" + }, + "value": "Microsoft Azure Fleet" + }, + "resource": { + "$id": "1740", + "kind": "string", + "type": { + "$ref": "1671" + }, + "value": "Fleets" + }, + "operation": { + "$id": "1741", + "kind": "string", + "type": { + "$ref": "1675" + }, + "value": "Create or Update Azure Fleet" + }, + "description": { + "$id": "1742", + "kind": "string", + "type": { + "$ref": "1679" + }, + "value": "Creates a new Azure Fleet resource or updates an existing one" + } + } + } + } + }, + { + "$id": "1743", + "kind": "model", + "type": { + "$ref": "1655" + }, + "value": { + "$id": "1744", + "origin": { + "$id": "1745", + "kind": "string", + "type": { + "$ref": "334" + }, + "value": "user,system" + }, + "name": { + "$id": "1746", + "kind": "string", + "type": { + "$ref": "1657" + }, + "value": "Microsoft.AzureFleet/fleets/delete" + }, + "isDataAction": { + "$id": "1747", + "kind": "boolean", + "type": { + "$ref": "1661" + }, + "value": false + }, + "display": { + "$id": "1748", + "kind": "model", + "type": { + "$ref": "1665" + }, + "value": { + "$id": "1749", + "provider": { + "$id": "1750", + "kind": "string", + "type": { + "$ref": "1667" + }, + "value": "Microsoft Azure Fleet" + }, + "resource": { + "$id": "1751", + "kind": "string", + "type": { + "$ref": "1671" + }, + "value": "Fleets" + }, + "operation": { + "$id": "1752", + "kind": "string", + "type": { + "$ref": "1675" + }, + "value": "Delete Virtual Machine and Virtual Machine scale sets in a Azure Fleet resource" + }, + "description": { + "$id": "1753", + "kind": "string", + "type": { + "$ref": "1679" + }, + "value": "Deletes all compute resources of Azure Fleet resource" + } + } + } + } + }, + { + "$id": "1754", + "kind": "model", + "type": { + "$ref": "1655" + }, + "value": { + "$id": "1755", + "origin": { + "$id": "1756", + "kind": "string", + "type": { + "$ref": "334" + }, + "value": "user,system" + }, + "name": { + "$id": "1757", + "kind": "string", + "type": { + "$ref": "1657" + }, + "value": "Microsoft.AzureFleet/register/action" + }, + "isDataAction": { + "$id": "1758", + "kind": "boolean", + "type": { + "$ref": "1661" + }, + "value": false + }, + "display": { + "$id": "1759", + "kind": "model", + "type": { + "$ref": "1665" + }, + "value": { + "$id": "1760", + "provider": { + "$id": "1761", + "kind": "string", + "type": { + "$ref": "1667" + }, + "value": "Microsoft Azure Fleet" + }, + "resource": { + "$id": "1762", + "kind": "string", + "type": { + "$ref": "1671" + }, + "value": "Subscription" + }, + "operation": { + "$id": "1763", + "kind": "string", + "type": { + "$ref": "1675" + }, + "value": "Register subscription for Microsoft.AzureFleet" + }, + "description": { + "$id": "1764", + "kind": "string", + "type": { + "$ref": "1679" + }, + "value": "Registers Subscription with Microsoft.AzureFleet resource provider" + } + } + } + } + }, + { + "$id": "1765", + "kind": "model", + "type": { + "$ref": "1655" + }, + "value": { + "$id": "1766", + "origin": { + "$id": "1767", + "kind": "string", + "type": { + "$ref": "334" + }, + "value": "user,system" + }, + "name": { + "$id": "1768", + "kind": "string", + "type": { + "$ref": "1657" + }, + "value": "Microsoft.AzureFleet/unregister/action" + }, + "isDataAction": { + "$id": "1769", + "kind": "boolean", + "type": { + "$ref": "1661" + }, + "value": false + }, + "display": { + "$id": "1770", + "kind": "model", + "type": { + "$ref": "1665" + }, + "value": { + "$id": "1771", + "provider": { + "$id": "1772", + "kind": "string", + "type": { + "$ref": "1667" + }, + "value": "Microsoft Azure Fleet" + }, + "resource": { + "$id": "1773", + "kind": "string", + "type": { + "$ref": "1671" + }, + "value": "Subscription" + }, + "operation": { + "$id": "1774", + "kind": "string", + "type": { + "$ref": "1675" + }, + "value": "Unregister Subscription for Microsoft.AzureFleet" + }, + "description": { + "$id": "1775", + "kind": "string", + "type": { + "$ref": "1679" + }, + "value": "Unregisters Subscription with Microsoft.AzureFleet resource provider" + } + } + } + } + } + ] + } + } + } + } + ] + } + ] + } + ], + "Protocol": { + "$id": "1776" + }, + "Parent": "AzureFleetClient", + "Parameters": [ + { + "$id": "1777", + "Name": "endpoint", + "NameInRequest": "endpoint", + "Doc": "Service host", + "Type": { + "$id": "1778", + "kind": "url", + "name": "url", + "crossLanguageDefinitionId": "TypeSpec.url" + }, + "Location": "Uri", + "IsApiVersion": false, + "IsResourceParameter": false, + "IsContentType": false, + "IsRequired": true, + "IsEndpoint": true, + "SkipUrlEncoding": false, + "Explode": false, + "Kind": "Client", + "DefaultValue": { + "$id": "1779", + "Type": { + "$id": "1780", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "https://management.azure.com" + } + } + ], + "Decorators": [] + }, + { + "$id": "1781", + "Name": "Fleets", + "ClientNamespace": "Microsoft.AzureFleet", + "Operations": [ + { + "$id": "1782", + "Name": "get", + "ResourceName": "Fleet", + "Doc": "Get a Fleet", + "Accessibility": "public", + "Parameters": [ + { + "$id": "1783", + "Name": "apiVersion", + "NameInRequest": "api-version", + "Doc": "The API version to use for this operation.", + "Type": { + "$id": "1784", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": true, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "DefaultValue": { + "$id": "1785", + "Type": { + "$id": "1786", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "2024-11-01" + }, + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1787", + "Name": "subscriptionId", + "NameInRequest": "subscriptionId", + "Doc": "The ID of the target subscription. The value must be an UUID.", + "Type": { + "$id": "1788", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "1789", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1790", + "Name": "resourceGroupName", + "NameInRequest": "resourceGroupName", + "Doc": "The name of the resource group. The name is case insensitive.", + "Type": { + "$id": "1791", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1792", + "Name": "fleetName", + "NameInRequest": "fleetName", + "Doc": "The name of the Compute Fleet", + "Type": { + "$id": "1793", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1794", + "Name": "accept", + "NameInRequest": "Accept", + "Type": { + "$id": "1795", + "kind": "constant", + "valueType": { + "$id": "1796", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "1797", + "StatusCodes": [ + 200 + ], + "BodyType": { + "$ref": "350" + }, + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false, + "ContentTypes": [ + "application/json" + ] + } + ], + "HttpMethod": "GET", + "RequestBodyMediaType": "None", + "Uri": "{endpoint}", + "Path": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureFleet/fleets/{fleetName}", + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Microsoft.AzureFleet.Fleets.get", + "Decorators": [], + "Examples": [ + { + "$id": "1798", + "kind": "http", + "name": "Fleets_Get", + "description": "Fleets_Get", + "filePath": "2024-11-01/Fleets_Get.json", + "parameters": [ + { + "$id": "1799", + "parameter": { + "$ref": "1783" + }, + "value": { + "$id": "1800", + "kind": "string", + "type": { + "$ref": "1784" + }, + "value": "2024-11-01" + } + }, + { + "$id": "1801", + "parameter": { + "$ref": "1787" + }, + "value": { + "$id": "1802", + "kind": "string", + "type": { + "$ref": "1788" + }, + "value": "1DC2F28C-A625-4B0E-9748-9885A3C9E9EB" + } + }, + { + "$id": "1803", + "parameter": { + "$ref": "1790" + }, + "value": { + "$id": "1804", + "kind": "string", + "type": { + "$ref": "1791" + }, + "value": "rgazurefleet" + } + }, + { + "$id": "1805", + "parameter": { + "$ref": "1792" + }, + "value": { + "$id": "1806", + "kind": "string", + "type": { + "$ref": "1793" + }, + "value": "testFleet" + } + } + ], + "responses": [ + { + "$id": "1807", + "response": { + "$ref": "1797" + }, + "statusCode": 200, + "bodyValue": { + "$id": "1808", + "kind": "model", + "type": { + "$ref": "350" + }, + "value": { + "$id": "1809", + "properties": { + "$id": "1810", + "kind": "model", + "type": { + "$ref": "406" + }, + "value": { + "$id": "1811", + "provisioningState": { + "$id": "1812", + "kind": "string", + "type": { + "$ref": "2" + }, + "value": "Creating" + }, + "spotPriorityProfile": { + "$id": "1813", + "kind": "model", + "type": { + "$ref": "411" + }, + "value": { + "$id": "1814", + "capacity": { + "$id": "1815", + "kind": "number", + "type": { + "$ref": "413" + }, + "value": 20 + }, + "minCapacity": { + "$id": "1816", + "kind": "number", + "type": { + "$ref": "417" + }, + "value": 10 + }, + "maxPricePerVM": { + "$id": "1817", + "kind": "number", + "type": { + "$ref": "421" + }, + "value": 0.00865 + }, + "evictionPolicy": { + "$id": "1818", + "kind": "string", + "type": { + "$ref": "18" + }, + "value": "Delete" + }, + "allocationStrategy": { + "$id": "1819", + "kind": "string", + "type": { + "$ref": "24" + }, + "value": "PriceCapacityOptimized" + }, + "maintain": { + "$id": "1820", + "kind": "boolean", + "type": { + "$ref": "431" + }, + "value": true + } + } + }, + "regularPriorityProfile": { + "$id": "1821", + "kind": "model", + "type": { + "$ref": "437" + }, + "value": { + "$id": "1822", + "capacity": { + "$id": "1823", + "kind": "number", + "type": { + "$ref": "439" + }, + "value": 20 + }, + "minCapacity": { + "$id": "1824", + "kind": "number", + "type": { + "$ref": "443" + }, + "value": 10 + }, + "allocationStrategy": { + "$id": "1825", + "kind": "string", + "type": { + "$ref": "32" + }, + "value": "LowestPrice" + } + } + }, + "vmSizesProfile": { + "$id": "1826", + "kind": "array", + "type": { + "$ref": "452" + }, + "value": [ + { + "$id": "1827", + "kind": "model", + "type": { + "$ref": "453" + }, + "value": { + "$id": "1828", + "name": { + "$id": "1829", + "kind": "string", + "type": { + "$ref": "455" + }, + "value": "Standard_d1_v2" + }, + "rank": { + "$id": "1830", + "kind": "number", + "type": { + "$ref": "459" + }, + "value": 19225 + } + } + } + ] + }, + "computeProfile": { + "$id": "1831", + "kind": "model", + "type": { + "$ref": "1370" + }, + "value": { + "$id": "1832", + "baseVirtualMachineProfile": { + "$id": "1833", + "kind": "model", + "type": { + "$ref": "565" + }, + "value": { + "$id": "1834", + "osProfile": { + "$id": "1835", + "kind": "model", + "type": { + "$ref": "567" + }, + "value": { + "$id": "1836", + "computerNamePrefix": { + "$id": "1837", + "kind": "string", + "type": { + "$ref": "569" + }, + "value": "o" + }, + "adminUsername": { + "$id": "1838", + "kind": "string", + "type": { + "$ref": "573" + }, + "value": "nrgzqciiaaxjrqldbmjbqkyhntp" + }, + "windowsConfiguration": { + "$id": "1839", + "kind": "model", + "type": { + "$ref": "585" + }, + "value": { + "$id": "1840", + "provisionVMAgent": { + "$id": "1841", + "kind": "boolean", + "type": { + "$ref": "587" + }, + "value": true + }, + "enableAutomaticUpdates": { + "$id": "1842", + "kind": "boolean", + "type": { + "$ref": "591" + }, + "value": true + }, + "timeZone": { + "$id": "1843", + "kind": "string", + "type": { + "$ref": "595" + }, + "value": "hlyjiqcfksgrpjrct" + }, + "additionalUnattendContent": { + "$id": "1844", + "kind": "array", + "type": { + "$ref": "599" + }, + "value": [ + { + "$id": "1845", + "kind": "model", + "type": { + "$ref": "600" + }, + "value": { + "$id": "1846", + "passName": { + "$id": "1847", + "kind": "string", + "type": { + "$ref": "602" + }, + "value": "OobeSystem" + }, + "componentName": { + "$id": "1848", + "kind": "string", + "type": { + "$ref": "606" + }, + "value": "Microsoft-Windows-Shell-Setup" + }, + "settingName": { + "$id": "1849", + "kind": "string", + "type": { + "$ref": "104" + }, + "value": "AutoLogon" + } + } + } + ] + }, + "patchSettings": { + "$id": "1850", + "kind": "model", + "type": { + "$ref": "619" + }, + "value": { + "$id": "1851", + "patchMode": { + "$id": "1852", + "kind": "string", + "type": { + "$ref": "110" + }, + "value": "Manual" + }, + "enableHotpatching": { + "$id": "1853", + "kind": "boolean", + "type": { + "$ref": "624" + }, + "value": true + }, + "assessmentMode": { + "$id": "1854", + "kind": "string", + "type": { + "$ref": "118" + }, + "value": "ImageDefault" + }, + "automaticByPlatformSettings": { + "$id": "1855", + "kind": "model", + "type": { + "$ref": "631" + }, + "value": { + "$id": "1856", + "rebootSetting": { + "$id": "1857", + "kind": "string", + "type": { + "$ref": "124" + }, + "value": "Unknown" + }, + "bypassPlatformSafetyChecksOnUserSchedule": { + "$id": "1858", + "kind": "boolean", + "type": { + "$ref": "636" + }, + "value": true + } + } + } + } + }, + "winRM": { + "$id": "1859", + "kind": "model", + "type": { + "$ref": "644" + }, + "value": { + "$id": "1860", + "listeners": { + "$id": "1861", + "kind": "array", + "type": { + "$ref": "646" + }, + "value": [ + { + "$id": "1862", + "kind": "model", + "type": { + "$ref": "647" + }, + "value": { + "$id": "1863", + "protocol": { + "$id": "1864", + "kind": "string", + "type": { + "$ref": "134" + }, + "value": "Http" + }, + "certificateUrl": { + "$id": "1865", + "kind": "string", + "type": { + "$ref": "652" + }, + "value": "https://myVaultName.vault.azure.net/secrets/myCertName" + } + } + } + ] + } + } + }, + "enableVMAgentPlatformUpdates": { + "$id": "1866", + "kind": "boolean", + "type": { + "$ref": "660" + }, + "value": true + } + } + }, + "linuxConfiguration": { + "$id": "1867", + "kind": "model", + "type": { + "$ref": "666" + }, + "value": { + "$id": "1868", + "disablePasswordAuthentication": { + "$id": "1869", + "kind": "boolean", + "type": { + "$ref": "668" + }, + "value": true + }, + "ssh": { + "$id": "1870", + "kind": "model", + "type": { + "$ref": "672" + }, + "value": { + "$id": "1871", + "publicKeys": { + "$id": "1872", + "kind": "array", + "type": { + "$ref": "674" + }, + "value": [ + { + "$id": "1873", + "kind": "model", + "type": { + "$ref": "675" + }, + "value": { + "$id": "1874", + "path": { + "$id": "1875", + "kind": "string", + "type": { + "$ref": "677" + }, + "value": "kmqz" + }, + "keyData": { + "$id": "1876", + "kind": "string", + "type": { + "$ref": "681" + }, + "value": "kivgsubusvpprwqaqpjcmhsv" + } + } + } + ] + } + } + }, + "provisionVMAgent": { + "$id": "1877", + "kind": "boolean", + "type": { + "$ref": "689" + }, + "value": true + }, + "patchSettings": { + "$id": "1878", + "kind": "model", + "type": { + "$ref": "693" + }, + "value": { + "$id": "1879", + "patchMode": { + "$id": "1880", + "kind": "string", + "type": { + "$ref": "140" + }, + "value": "ImageDefault" + }, + "assessmentMode": { + "$id": "1881", + "kind": "string", + "type": { + "$ref": "146" + }, + "value": "ImageDefault" + }, + "automaticByPlatformSettings": { + "$id": "1882", + "kind": "model", + "type": { + "$ref": "701" + }, + "value": { + "$id": "1883", + "rebootSetting": { + "$id": "1884", + "kind": "string", + "type": { + "$ref": "152" + }, + "value": "Unknown" + }, + "bypassPlatformSafetyChecksOnUserSchedule": { + "$id": "1885", + "kind": "boolean", + "type": { + "$ref": "706" + }, + "value": true + } + } + } + } + }, + "enableVMAgentPlatformUpdates": { + "$id": "1886", + "kind": "boolean", + "type": { + "$ref": "714" + }, + "value": true + } + } + }, + "secrets": { + "$id": "1887", + "kind": "array", + "type": { + "$ref": "720" + }, + "value": [ + { + "$id": "1888", + "kind": "model", + "type": { + "$ref": "721" + }, + "value": { + "$id": "1889", + "sourceVault": { + "$id": "1890", + "kind": "model", + "type": { + "$ref": "723" + }, + "value": { + "$id": "1891", + "id": { + "$id": "1892", + "kind": "string", + "type": { + "$ref": "725" + }, + "value": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault/vaults/{vaultName}" + } + } + }, + "vaultCertificates": { + "$id": "1893", + "kind": "array", + "type": { + "$ref": "732" + }, + "value": [ + { + "$id": "1894", + "kind": "model", + "type": { + "$ref": "733" + }, + "value": { + "$id": "1895", + "certificateUrl": { + "$id": "1896", + "kind": "string", + "type": { + "$ref": "735" + }, + "value": "https://myVaultName.vault.azure.net/secrets/myCertName" + }, + "certificateStore": { + "$id": "1897", + "kind": "string", + "type": { + "$ref": "739" + }, + "value": "nlxrwavpzhueffxsshlun" + } + } + } + ] + } + } + } + ] + }, + "allowExtensionOperations": { + "$id": "1898", + "kind": "boolean", + "type": { + "$ref": "747" + }, + "value": true + }, + "requireGuestProvisionSignal": { + "$id": "1899", + "kind": "boolean", + "type": { + "$ref": "751" + }, + "value": true + } + } + }, + "storageProfile": { + "$id": "1900", + "kind": "model", + "type": { + "$ref": "757" + }, + "value": { + "$id": "1901", + "imageReference": { + "$id": "1902", + "kind": "model", + "type": { + "$ref": "759" + }, + "value": { + "$id": "1903", + "publisher": { + "$id": "1904", + "kind": "string", + "type": { + "$ref": "766" + }, + "value": "mqxgwbiyjzmxavhbkd" + }, + "offer": { + "$id": "1905", + "kind": "string", + "type": { + "$ref": "770" + }, + "value": "isxgumkarlkomp" + }, + "sku": { + "$id": "1906", + "kind": "string", + "type": { + "$ref": "774" + }, + "value": "eojmppqcrnpmxirtp" + }, + "version": { + "$id": "1907", + "kind": "string", + "type": { + "$ref": "778" + }, + "value": "wvpcqefgtmqdgltiuz" + }, + "exactVersion": { + "$id": "1908", + "kind": "string", + "type": { + "$ref": "782" + }, + "value": "zjbntmiskjexlr" + }, + "sharedGalleryImageId": { + "$id": "1909", + "kind": "string", + "type": { + "$ref": "786" + }, + "value": "kmkgihoxwlawuuhcinfirktdwkmx" + }, + "communityGalleryImageId": { + "$id": "1910", + "kind": "string", + "type": { + "$ref": "790" + }, + "value": "vlqe" + }, + "id": { + "$id": "1911", + "kind": "string", + "type": { + "$ref": "761" + }, + "value": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/images/{imageName}/versions/{versionName}" + } + } + }, + "osDisk": { + "$id": "1912", + "kind": "model", + "type": { + "$ref": "796" + }, + "value": { + "$id": "1913", + "name": { + "$id": "1914", + "kind": "string", + "type": { + "$ref": "798" + }, + "value": "wfttw" + }, + "caching": { + "$id": "1915", + "kind": "string", + "type": { + "$ref": "162" + }, + "value": "None" + }, + "writeAcceleratorEnabled": { + "$id": "1916", + "kind": "boolean", + "type": { + "$ref": "805" + }, + "value": true + }, + "createOption": { + "$id": "1917", + "kind": "string", + "type": { + "$ref": "170" + }, + "value": "FromImage" + }, + "diffDiskSettings": { + "$id": "1918", + "kind": "model", + "type": { + "$ref": "812" + }, + "value": { + "$id": "1919", + "option": { + "$id": "1920", + "kind": "string", + "type": { + "$ref": "182" + }, + "value": "Local" + }, + "placement": { + "$id": "1921", + "kind": "string", + "type": { + "$ref": "186" + }, + "value": "CacheDisk" + } + } + }, + "diskSizeGB": { + "$id": "1922", + "kind": "number", + "type": { + "$ref": "822" + }, + "value": 14 + }, + "osType": { + "$id": "1923", + "kind": "string", + "type": { + "$ref": "194" + }, + "value": "Windows" + }, + "image": { + "$id": "1924", + "kind": "model", + "type": { + "$ref": "829" + }, + "value": { + "$id": "1925", + "uri": { + "$id": "1926", + "kind": "string", + "type": { + "$ref": "831" + }, + "value": "https://myStorageAccountName.blob.core.windows.net/myContainerName/myVhdName.vhd" + } + } + }, + "vhdContainers": { + "$id": "1927", + "kind": "array", + "type": { + "$ref": "837" + }, + "value": [ + { + "$id": "1928", + "kind": "string", + "type": { + "$ref": "838" + }, + "value": "tkzcwddtinkfpnfklatw" + } + ] + }, + "managedDisk": { + "$id": "1929", + "kind": "model", + "type": { + "$ref": "842" + }, + "value": { + "$id": "1930", + "storageAccountType": { + "$id": "1931", + "kind": "string", + "type": { + "$ref": "200" + }, + "value": "Standard_LRS" + }, + "diskEncryptionSet": { + "$id": "1932", + "kind": "model", + "type": { + "$ref": "847" + }, + "value": { + "$id": "1933", + "id": { + "$id": "1934", + "kind": "string", + "type": { + "$ref": "849" + }, + "value": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskEncryptionSets/{diskEncryptionSetName}" + } + } + }, + "securityProfile": { + "$id": "1935", + "kind": "model", + "type": { + "$ref": "856" + }, + "value": { + "$id": "1936", + "securityEncryptionType": { + "$id": "1937", + "kind": "string", + "type": { + "$ref": "216" + }, + "value": "VMGuestStateOnly" + }, + "diskEncryptionSet": { + "$id": "1938", + "kind": "model", + "type": { + "$ref": "847" + }, + "value": { + "$id": "1939", + "id": { + "$id": "1940", + "kind": "string", + "type": { + "$ref": "849" + }, + "value": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskEncryptionSets/{diskEncryptionSetName}" + } + } + } + } + } + } + }, + "deleteOption": { + "$id": "1941", + "kind": "string", + "type": { + "$ref": "224" + }, + "value": "Delete" + } + } + }, + "dataDisks": { + "$id": "1942", + "kind": "array", + "type": { + "$ref": "873" + }, + "value": [ + { + "$id": "1943", + "kind": "model", + "type": { + "$ref": "874" + }, + "value": { + "$id": "1944", + "name": { + "$id": "1945", + "kind": "string", + "type": { + "$ref": "876" + }, + "value": "eogiykmdmeikswxmigjws" + }, + "lun": { + "$id": "1946", + "kind": "number", + "type": { + "$ref": "880" + }, + "value": 14 + }, + "caching": { + "$id": "1947", + "kind": "string", + "type": { + "$ref": "162" + }, + "value": "None" + }, + "writeAcceleratorEnabled": { + "$id": "1948", + "kind": "boolean", + "type": { + "$ref": "887" + }, + "value": true + }, + "createOption": { + "$id": "1949", + "kind": "string", + "type": { + "$ref": "170" + }, + "value": "FromImage" + }, + "diskSizeGB": { + "$id": "1950", + "kind": "number", + "type": { + "$ref": "894" + }, + "value": 6 + }, + "managedDisk": { + "$id": "1951", + "kind": "model", + "type": { + "$ref": "842" + }, + "value": { + "$id": "1952", + "storageAccountType": { + "$id": "1953", + "kind": "string", + "type": { + "$ref": "200" + }, + "value": "Standard_LRS" + }, + "diskEncryptionSet": { + "$id": "1954", + "kind": "model", + "type": { + "$ref": "847" + }, + "value": { + "$id": "1955", + "id": { + "$id": "1956", + "kind": "string", + "type": { + "$ref": "849" + }, + "value": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskEncryptionSets/{diskEncryptionSetName}" + } + } + }, + "securityProfile": { + "$id": "1957", + "kind": "model", + "type": { + "$ref": "856" + }, + "value": { + "$id": "1958", + "securityEncryptionType": { + "$id": "1959", + "kind": "string", + "type": { + "$ref": "216" + }, + "value": "VMGuestStateOnly" + }, + "diskEncryptionSet": { + "$id": "1960", + "kind": "model", + "type": { + "$ref": "847" + }, + "value": { + "$id": "1961", + "id": { + "$id": "1962", + "kind": "string", + "type": { + "$ref": "849" + }, + "value": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskEncryptionSets/{diskEncryptionSetName}" + } + } + } + } + } + } + }, + "diskIOPSReadWrite": { + "$id": "1963", + "kind": "number", + "type": { + "$ref": "901" + }, + "value": 27 + }, + "diskMBpsReadWrite": { + "$id": "1964", + "kind": "number", + "type": { + "$ref": "905" + }, + "value": 2 + }, + "deleteOption": { + "$id": "1965", + "kind": "string", + "type": { + "$ref": "224" + }, + "value": "Delete" + } + } + } + ] + } + } + }, + "networkProfile": { + "$id": "1966", + "kind": "model", + "type": { + "$ref": "919" + }, + "value": { + "$id": "1967", + "healthProbe": { + "$id": "1968", + "kind": "model", + "type": { + "$ref": "921" + }, + "value": { + "$id": "1969", + "id": { + "$id": "1970", + "kind": "string", + "type": { + "$ref": "923" + }, + "value": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/probes/{probeName}" + } + } + }, + "networkInterfaceConfigurations": { + "$id": "1971", + "kind": "array", + "type": { + "$ref": "930" + }, + "value": [ + { + "$id": "1972", + "kind": "model", + "type": { + "$ref": "931" + }, + "value": { + "$id": "1973", + "name": { + "$id": "1974", + "kind": "string", + "type": { + "$ref": "933" + }, + "value": "i" + }, + "properties": { + "$id": "1975", + "kind": "model", + "type": { + "$ref": "937" + }, + "value": { + "$id": "1976", + "primary": { + "$id": "1977", + "kind": "boolean", + "type": { + "$ref": "939" + }, + "value": true + }, + "enableAcceleratedNetworking": { + "$id": "1978", + "kind": "boolean", + "type": { + "$ref": "943" + }, + "value": true + }, + "disableTcpStateTracking": { + "$id": "1979", + "kind": "boolean", + "type": { + "$ref": "947" + }, + "value": true + }, + "enableFpga": { + "$id": "1980", + "kind": "boolean", + "type": { + "$ref": "951" + }, + "value": true + }, + "networkSecurityGroup": { + "$id": "1981", + "kind": "model", + "type": { + "$ref": "723" + }, + "value": { + "$id": "1982", + "id": { + "$id": "1983", + "kind": "string", + "type": { + "$ref": "725" + }, + "value": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}" + } + } + }, + "dnsSettings": { + "$id": "1984", + "kind": "model", + "type": { + "$ref": "958" + }, + "value": { + "$id": "1985", + "dnsServers": { + "$id": "1986", + "kind": "array", + "type": { + "$ref": "960" + }, + "value": [ + { + "$id": "1987", + "kind": "string", + "type": { + "$ref": "961" + }, + "value": "nxmmfolhclsesu" + } + ] + } + } + }, + "ipConfigurations": { + "$id": "1988", + "kind": "array", + "type": { + "$ref": "967" + }, + "value": [ + { + "$id": "1989", + "kind": "model", + "type": { + "$ref": "968" + }, + "value": { + "$id": "1990", + "name": { + "$id": "1991", + "kind": "string", + "type": { + "$ref": "970" + }, + "value": "oezqhkidfhyywlfzwuotilrpbqnjg" + }, + "properties": { + "$id": "1992", + "kind": "model", + "type": { + "$ref": "974" + }, + "value": { + "$id": "1993", + "subnet": { + "$id": "1994", + "kind": "model", + "type": { + "$ref": "921" + }, + "value": { + "$id": "1995", + "id": { + "$id": "1996", + "kind": "string", + "type": { + "$ref": "923" + }, + "value": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}" + } + } + }, + "primary": { + "$id": "1997", + "kind": "boolean", + "type": { + "$ref": "979" + }, + "value": true + }, + "publicIPAddressConfiguration": { + "$id": "1998", + "kind": "model", + "type": { + "$ref": "983" + }, + "value": { + "$id": "1999", + "name": { + "$id": "2000", + "kind": "string", + "type": { + "$ref": "985" + }, + "value": "fvpqf" + }, + "properties": { + "$id": "2001", + "kind": "model", + "type": { + "$ref": "989" + }, + "value": { + "$id": "2002", + "idleTimeoutInMinutes": { + "$id": "2003", + "kind": "number", + "type": { + "$ref": "991" + }, + "value": 9 + }, + "dnsSettings": { + "$id": "2004", + "kind": "model", + "type": { + "$ref": "995" + }, + "value": { + "$id": "2005", + "domainNameLabel": { + "$id": "2006", + "kind": "string", + "type": { + "$ref": "997" + }, + "value": "ukrddzvmorpmfsczjwtbvp" + }, + "domainNameLabelScope": { + "$id": "2007", + "kind": "string", + "type": { + "$ref": "236" + }, + "value": "TenantReuse" + } + } + }, + "ipTags": { + "$id": "2008", + "kind": "array", + "type": { + "$ref": "1006" + }, + "value": [ + { + "$id": "2009", + "kind": "model", + "type": { + "$ref": "1007" + }, + "value": { + "$id": "2010", + "ipTagType": { + "$id": "2011", + "kind": "string", + "type": { + "$ref": "1009" + }, + "value": "sddgsoemnzgqizale" + }, + "tag": { + "$id": "2012", + "kind": "string", + "type": { + "$ref": "1013" + }, + "value": "wufmhrjsakbiaetyara" + } + } + } + ] + }, + "publicIPPrefix": { + "$id": "2013", + "kind": "model", + "type": { + "$ref": "723" + }, + "value": { + "$id": "2014", + "id": { + "$id": "2015", + "kind": "string", + "type": { + "$ref": "725" + }, + "value": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPPrefixes/{publicIPPrefixName}" + } + } + }, + "publicIPAddressVersion": { + "$id": "2016", + "kind": "string", + "type": { + "$ref": "246" + }, + "value": "IPv4" + }, + "deleteOption": { + "$id": "2017", + "kind": "string", + "type": { + "$ref": "252" + }, + "value": "Delete" + } + } + }, + "sku": { + "$id": "2018", + "kind": "model", + "type": { + "$ref": "1030" + }, + "value": { + "$id": "2019", + "name": { + "$id": "2020", + "kind": "string", + "type": { + "$ref": "258" + }, + "value": "Basic" + }, + "tier": { + "$id": "2021", + "kind": "string", + "type": { + "$ref": "264" + }, + "value": "Regional" + } + } + } + } + }, + "privateIPAddressVersion": { + "$id": "2022", + "kind": "string", + "type": { + "$ref": "246" + }, + "value": "IPv4" + }, + "applicationGatewayBackendAddressPools": { + "$id": "2023", + "kind": "array", + "type": { + "$ref": "1045" + }, + "value": [ + { + "$id": "2024", + "kind": "model", + "type": { + "$ref": "723" + }, + "value": { + "$id": "2025", + "id": { + "$id": "2026", + "kind": "string", + "type": { + "$ref": "725" + }, + "value": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}/backendAddressPools/{backendAddressPoolName}" + } + } + } + ] + }, + "applicationSecurityGroups": { + "$id": "2027", + "kind": "array", + "type": { + "$ref": "1049" + }, + "value": [ + { + "$id": "2028", + "kind": "model", + "type": { + "$ref": "723" + }, + "value": { + "$id": "2029", + "id": { + "$id": "2030", + "kind": "string", + "type": { + "$ref": "725" + }, + "value": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationSecurityGroups/{applicationSecurityGroupName}" + } + } + } + ] + }, + "loadBalancerBackendAddressPools": { + "$id": "2031", + "kind": "array", + "type": { + "$ref": "1053" + }, + "value": [ + { + "$id": "2032", + "kind": "model", + "type": { + "$ref": "723" + }, + "value": { + "$id": "2033", + "id": { + "$id": "2034", + "kind": "string", + "type": { + "$ref": "725" + }, + "value": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/backendAddressPools/{backendAddressPoolName}" + } + } + } + ] + }, + "loadBalancerInboundNatPools": { + "$id": "2035", + "kind": "array", + "type": { + "$ref": "1057" + }, + "value": [ + { + "$id": "2036", + "kind": "model", + "type": { + "$ref": "723" + }, + "value": { + "$id": "2037", + "id": { + "$id": "2038", + "kind": "string", + "type": { + "$ref": "725" + }, + "value": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/inboundNatPools/{inboundNatPoolName}" + } + } + } + ] + } + } + } + } + } + ] + }, + "enableIPForwarding": { + "$id": "2039", + "kind": "boolean", + "type": { + "$ref": "1065" + }, + "value": true + }, + "deleteOption": { + "$id": "2040", + "kind": "string", + "type": { + "$ref": "252" + }, + "value": "Delete" + }, + "auxiliaryMode": { + "$id": "2041", + "kind": "string", + "type": { + "$ref": "270" + }, + "value": "None" + }, + "auxiliarySku": { + "$id": "2042", + "kind": "string", + "type": { + "$ref": "278" + }, + "value": "None" + } + } + } + } + } + ] + }, + "networkApiVersion": { + "$id": "2043", + "kind": "string", + "type": { + "$ref": "290" + }, + "value": "2020-11-01" + } + } + }, + "securityProfile": { + "$id": "2044", + "kind": "model", + "type": { + "$ref": "1087" + }, + "value": { + "$id": "2045", + "uefiSettings": { + "$id": "2046", + "kind": "model", + "type": { + "$ref": "1089" + }, + "value": { + "$id": "2047", + "secureBootEnabled": { + "$id": "2048", + "kind": "boolean", + "type": { + "$ref": "1091" + }, + "value": true + }, + "vTpmEnabled": { + "$id": "2049", + "kind": "boolean", + "type": { + "$ref": "1095" + }, + "value": true + } + } + }, + "encryptionAtHost": { + "$id": "2050", + "kind": "boolean", + "type": { + "$ref": "1101" + }, + "value": true + }, + "securityType": { + "$id": "2051", + "kind": "string", + "type": { + "$ref": "294" + }, + "value": "TrustedLaunch" + }, + "encryptionIdentity": { + "$id": "2052", + "kind": "model", + "type": { + "$ref": "1108" + }, + "value": { + "$id": "2053", + "userAssignedIdentityResourceId": { + "$id": "2054", + "kind": "string", + "type": { + "$ref": "1110" + }, + "value": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{userAssignedIdentityName}" + } + } + }, + "proxyAgentSettings": { + "$id": "2055", + "kind": "model", + "type": { + "$ref": "1117" + }, + "value": { + "$id": "2056", + "enabled": { + "$id": "2057", + "kind": "boolean", + "type": { + "$ref": "1119" + }, + "value": true + }, + "mode": { + "$id": "2058", + "kind": "string", + "type": { + "$ref": "300" + }, + "value": "Audit" + }, + "keyIncarnationId": { + "$id": "2059", + "kind": "number", + "type": { + "$ref": "1126" + }, + "value": 20 + } + } + } + } + }, + "diagnosticsProfile": { + "$id": "2060", + "kind": "model", + "type": { + "$ref": "1134" + }, + "value": { + "$id": "2061", + "bootDiagnostics": { + "$id": "2062", + "kind": "model", + "type": { + "$ref": "1136" + }, + "value": { + "$id": "2063", + "enabled": { + "$id": "2064", + "kind": "boolean", + "type": { + "$ref": "1138" + }, + "value": true + }, + "storageUri": { + "$id": "2065", + "kind": "string", + "type": { + "$ref": "1142" + }, + "value": "http://myStorageAccountName.blob.core.windows.net" + } + } + } + } + }, + "extensionProfile": { + "$id": "2066", + "kind": "model", + "type": { + "$ref": "1150" + }, + "value": { + "$id": "2067", + "extensions": { + "$id": "2068", + "kind": "array", + "type": { + "$ref": "1152" + }, + "value": [ + { + "$id": "2069", + "kind": "model", + "type": { + "$ref": "1153" + }, + "value": { + "$id": "2070", + "name": { + "$id": "2071", + "kind": "string", + "type": { + "$ref": "1160" + }, + "value": "bndxuxx" + }, + "type": { + "$id": "2072", + "kind": "string", + "type": { + "$ref": "1164" + }, + "value": "cmeam" + }, + "properties": { + "$id": "2073", + "kind": "model", + "type": { + "$ref": "1168" + }, + "value": { + "$id": "2074", + "forceUpdateTag": { + "$id": "2075", + "kind": "string", + "type": { + "$ref": "1170" + }, + "value": "yhgxw" + }, + "publisher": { + "$id": "2076", + "kind": "string", + "type": { + "$ref": "1174" + }, + "value": "kpxtirxjfprhs" + }, + "type": { + "$id": "2077", + "kind": "string", + "type": { + "$ref": "1178" + }, + "value": "pgjilctjjwaa" + }, + "typeHandlerVersion": { + "$id": "2078", + "kind": "string", + "type": { + "$ref": "1182" + }, + "value": "zevivcoilxmbwlrihhhibq" + }, + "autoUpgradeMinorVersion": { + "$id": "2079", + "kind": "boolean", + "type": { + "$ref": "1186" + }, + "value": true + }, + "enableAutomaticUpgrade": { + "$id": "2080", + "kind": "boolean", + "type": { + "$ref": "1190" + }, + "value": true + }, + "settings": { + "$id": "2081", + "kind": "dict", + "type": { + "$ref": "1194" + }, + "value": { + "$id": "2082" + } + }, + "provisioningState": { + "$id": "2083", + "kind": "string", + "type": { + "$ref": "1206" + }, + "value": "Succeeded" + }, + "provisionAfterExtensions": { + "$id": "2084", + "kind": "array", + "type": { + "$ref": "1210" + }, + "value": [ + { + "$id": "2085", + "kind": "string", + "type": { + "$ref": "1211" + }, + "value": "nftzosroolbcwmpupujzqwqe" + } + ] + }, + "suppressFailures": { + "$id": "2086", + "kind": "boolean", + "type": { + "$ref": "1215" + }, + "value": true + }, + "protectedSettingsFromKeyVault": { + "$id": "2087", + "kind": "model", + "type": { + "$ref": "1219" + }, + "value": { + "$id": "2088", + "secretUrl": { + "$id": "2089", + "kind": "string", + "type": { + "$ref": "1221" + }, + "value": "https://myVaultName.vault.azure.net/secrets/secret/mySecretName" + }, + "sourceVault": { + "$id": "2090", + "kind": "model", + "type": { + "$ref": "723" + }, + "value": { + "$id": "2091", + "id": { + "$id": "2092", + "kind": "string", + "type": { + "$ref": "725" + }, + "value": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault/vaults/{vaultName}" + } + } + } + } + } + } + }, + "id": { + "$id": "2093", + "kind": "string", + "type": { + "$ref": "1155" + }, + "value": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/extensions/{extensionName}" + } + } + } + ] + }, + "extensionsTimeBudget": { + "$id": "2094", + "kind": "string", + "type": { + "$ref": "1234" + }, + "value": "mbhjahtdygwgyszdwjtvlvtgchdwil" + } + } + }, + "licenseType": { + "$id": "2095", + "kind": "string", + "type": { + "$ref": "1240" + }, + "value": "v" + }, + "scheduledEventsProfile": { + "$id": "2096", + "kind": "model", + "type": { + "$ref": "1244" + }, + "value": { + "$id": "2097", + "terminateNotificationProfile": { + "$id": "2098", + "kind": "model", + "type": { + "$ref": "1246" + }, + "value": { + "$id": "2099", + "notBeforeTimeout": { + "$id": "2100", + "kind": "string", + "type": { + "$ref": "1248" + }, + "value": "iljppmmw" + }, + "enable": { + "$id": "2101", + "kind": "boolean", + "type": { + "$ref": "1252" + }, + "value": true + } + } + }, + "osImageNotificationProfile": { + "$id": "2102", + "kind": "model", + "type": { + "$ref": "1258" + }, + "value": { + "$id": "2103", + "notBeforeTimeout": { + "$id": "2104", + "kind": "string", + "type": { + "$ref": "1260" + }, + "value": "olbpadmevekyczfokodtfprxti" + }, + "enable": { + "$id": "2105", + "kind": "boolean", + "type": { + "$ref": "1264" + }, + "value": true + } + } + } + } + }, + "userData": { + "$id": "2106", + "kind": "string", + "type": { + "$ref": "1272" + }, + "value": "s" + }, + "capacityReservation": { + "$id": "2107", + "kind": "model", + "type": { + "$ref": "1276" + }, + "value": { + "$id": "2108", + "capacityReservationGroup": { + "$id": "2109", + "kind": "model", + "type": { + "$ref": "723" + }, + "value": { + "$id": "2110", + "id": { + "$id": "2111", + "kind": "string", + "type": { + "$ref": "725" + }, + "value": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/capacityReservationGroups/{capacityReservationGroupName}" + } + } + } + } + }, + "applicationProfile": { + "$id": "2112", + "kind": "model", + "type": { + "$ref": "1283" + }, + "value": { + "$id": "2113", + "galleryApplications": { + "$id": "2114", + "kind": "array", + "type": { + "$ref": "1285" + }, + "value": [ + { + "$id": "2115", + "kind": "model", + "type": { + "$ref": "1286" + }, + "value": { + "$id": "2116", + "tags": { + "$id": "2117", + "kind": "string", + "type": { + "$ref": "1288" + }, + "value": "eyrqjbib" + }, + "order": { + "$id": "2118", + "kind": "number", + "type": { + "$ref": "1292" + }, + "value": 5 + }, + "packageReferenceId": { + "$id": "2119", + "kind": "string", + "type": { + "$ref": "1296" + }, + "value": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/applications/{applicationName}/versions/{versionName}" + }, + "treatFailureAsDeploymentFailure": { + "$id": "2120", + "kind": "boolean", + "type": { + "$ref": "1305" + }, + "value": true + }, + "enableAutomaticUpgrade": { + "$id": "2121", + "kind": "boolean", + "type": { + "$ref": "1309" + }, + "value": true + } + } + } + ] + } + } + }, + "hardwareProfile": { + "$id": "2122", + "kind": "model", + "type": { + "$ref": "1317" + }, + "value": { + "$id": "2123", + "vmSizeProperties": { + "$id": "2124", + "kind": "model", + "type": { + "$ref": "1319" + }, + "value": { + "$id": "2125", + "vCPUsAvailable": { + "$id": "2126", + "kind": "number", + "type": { + "$ref": "1321" + }, + "value": 16 + }, + "vCPUsPerCore": { + "$id": "2127", + "kind": "number", + "type": { + "$ref": "1325" + }, + "value": 23 + } + } + } + } + }, + "serviceArtifactReference": { + "$id": "2128", + "kind": "model", + "type": { + "$ref": "1333" + }, + "value": { + "$id": "2129", + "id": { + "$id": "2130", + "kind": "string", + "type": { + "$ref": "1335" + }, + "value": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/serviceArtifacts/{serviceArtifactsName}/vmArtifactsProfiles/{vmArtifactsProfileName}" + } + } + }, + "securityPostureReference": { + "$id": "2131", + "kind": "model", + "type": { + "$ref": "1342" + }, + "value": { + "$id": "2132", + "id": { + "$id": "2133", + "kind": "string", + "type": { + "$ref": "1344" + }, + "value": "mubredelfbshboaxrsxiajihahaa" + }, + "excludeExtensions": { + "$id": "2134", + "kind": "array", + "type": { + "$ref": "1348" + }, + "value": [ + { + "$id": "2135", + "kind": "string", + "type": { + "$ref": "1349" + }, + "value": "{securityPostureVMExtensionName}" + } + ] + }, + "isOverridable": { + "$id": "2136", + "kind": "boolean", + "type": { + "$ref": "1353" + }, + "value": true + } + } + }, + "timeCreated": { + "$id": "2137", + "kind": "string", + "type": { + "$ref": "1359" + }, + "value": "2024-04-29T21:51:44.043Z" + } + } + }, + "computeApiVersion": { + "$id": "2138", + "kind": "string", + "type": { + "$ref": "1375" + }, + "value": "2023-07-01" + }, + "platformFaultDomainCount": { + "$id": "2139", + "kind": "number", + "type": { + "$ref": "1379" + }, + "value": 1 + } + } + }, + "timeCreated": { + "$id": "2140", + "kind": "string", + "type": { + "$ref": "1397" + }, + "value": "2024-07-10T00:16:34.8590555+00:00" + }, + "uniqueId": { + "$id": "2141", + "kind": "string", + "type": { + "$ref": "1402" + }, + "value": "a2f7fabd-bbc2-4a20-afe1-49fdb3885a28" + } + } + }, + "zones": { + "$id": "2142", + "kind": "array", + "type": { + "$ref": "1408" + }, + "value": [ + { + "$id": "2143", + "kind": "string", + "type": { + "$ref": "1409" + }, + "value": "zone1" + }, + { + "$id": "2144", + "kind": "string", + "type": { + "$ref": "1409" + }, + "value": "zone2" + } + ] + }, + "identity": { + "$id": "2145", + "kind": "model", + "type": { + "$ref": "1413" + }, + "value": { + "$id": "2146", + "principalId": { + "$id": "2147", + "kind": "string", + "type": { + "$ref": "1415" + }, + "value": "4d508e5b-374b-4382-9a1c-01fb8b6cb37c" + }, + "tenantId": { + "$id": "2148", + "kind": "string", + "type": { + "$ref": "1420" + }, + "value": "5d508e5b-374b-4382-9a1c-01fb8b6cb37c" + }, + "type": { + "$id": "2149", + "kind": "string", + "type": { + "$ref": "306" + }, + "value": "UserAssigned" + }, + "userAssignedIdentities": { + "$id": "2150", + "kind": "dict", + "type": { + "$ref": "1428" + }, + "value": { + "$id": "2151", + "key9851": { + "$id": "2152", + "kind": "model", + "type": { + "$ref": "1431" + }, + "value": { + "$id": "2153", + "principalId": { + "$id": "2154", + "kind": "string", + "type": { + "$ref": "1438" + }, + "value": "6d508e5b-374b-4382-9a1c-01fb8b6cb37c" + }, + "clientId": { + "$id": "2155", + "kind": "string", + "type": { + "$ref": "1433" + }, + "value": "7d508e5b-374b-4382-9a1c-01fb8b6cb37c" + } + } + } + } + } + } + }, + "tags": { + "$id": "2156", + "kind": "dict", + "type": { + "$ref": "396" + }, + "value": { + "$id": "2157", + "key3518": { + "$id": "2158", + "kind": "string", + "type": { + "$ref": "398" + }, + "value": "luvrnuvsgdpbuofdskkcoqhfh" + } + } + }, + "plan": { + "$id": "2159", + "kind": "model", + "type": { + "$ref": "1447" + }, + "value": { + "$id": "2160", + "name": { + "$id": "2161", + "kind": "string", + "type": { + "$ref": "1449" + }, + "value": "jwgrcrnrtfoxn" + }, + "publisher": { + "$id": "2162", + "kind": "string", + "type": { + "$ref": "1453" + }, + "value": "iozjbiqqckqm" + }, + "product": { + "$id": "2163", + "kind": "string", + "type": { + "$ref": "1457" + }, + "value": "cgopbyvdyqikahwyxfpzwaqk" + }, + "promotionCode": { + "$id": "2164", + "kind": "string", + "type": { + "$ref": "1461" + }, + "value": "naglezezplcaruqogtxnuizslqnnbr" + }, + "version": { + "$id": "2165", + "kind": "string", + "type": { + "$ref": "1465" + }, + "value": "wa" + } + } + }, + "location": { + "$id": "2166", + "kind": "string", + "type": { + "$ref": "402" + }, + "value": "westus" + }, + "id": { + "$id": "2167", + "kind": "string", + "type": { + "$ref": "354" + }, + "value": "/subscriptions/7B0CD4DB-3381-4013-9B31-FB6E6FD0FF1C/resourceGroups/rgazurefleet/providers/Microsoft.AzureFleet/fleets/testFleet" + }, + "name": { + "$id": "2168", + "kind": "string", + "type": { + "$ref": "359" + }, + "value": "testFleet" + }, + "type": { + "$id": "2169", + "kind": "string", + "type": { + "$ref": "363" + }, + "value": "Microsoft.AzureFleet/fleets" + }, + "systemData": { + "$id": "2170", + "kind": "model", + "type": { + "$ref": "368" + }, + "value": { + "$id": "2171", + "createdBy": { + "$id": "2172", + "kind": "string", + "type": { + "$ref": "370" + }, + "value": "rowegentrpoajsv" + }, + "createdByType": { + "$id": "2173", + "kind": "string", + "type": { + "$ref": "316" + }, + "value": "User" + }, + "createdAt": { + "$id": "2174", + "kind": "string", + "type": { + "$ref": "377" + }, + "value": "2024-04-29T21:51:44.043Z" + }, + "lastModifiedBy": { + "$id": "2175", + "kind": "string", + "type": { + "$ref": "382" + }, + "value": "edwuayhhaoepxzisfaqjhmrxjq" + }, + "lastModifiedByType": { + "$id": "2176", + "kind": "string", + "type": { + "$ref": "316" + }, + "value": "User" + }, + "lastModifiedAt": { + "$id": "2177", + "kind": "string", + "type": { + "$ref": "389" + }, + "value": "2024-04-29T21:51:44.043Z" + } + } + } + } + } + } + ] + } + ] + }, + { + "$id": "2178", + "Name": "createOrUpdate", + "ResourceName": "Fleet", + "Doc": "Create a Fleet", + "Accessibility": "public", + "Parameters": [ + { + "$id": "2179", + "Name": "apiVersion", + "NameInRequest": "api-version", + "Doc": "The API version to use for this operation.", + "Type": { + "$id": "2180", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": true, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "DefaultValue": { + "$id": "2181", + "Type": { + "$id": "2182", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "2024-11-01" + }, + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "2183", + "Name": "subscriptionId", + "NameInRequest": "subscriptionId", + "Doc": "The ID of the target subscription. The value must be an UUID.", + "Type": { + "$id": "2184", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "2185", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "2186", + "Name": "resourceGroupName", + "NameInRequest": "resourceGroupName", + "Doc": "The name of the resource group. The name is case insensitive.", + "Type": { + "$id": "2187", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "2188", + "Name": "fleetName", + "NameInRequest": "fleetName", + "Doc": "The name of the Compute Fleet", + "Type": { + "$id": "2189", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "2190", + "Name": "contentType", + "NameInRequest": "Content-Type", + "Doc": "Body parameter's content type. Known values are application/json", + "Type": { + "$id": "2191", + "kind": "constant", + "valueType": { + "$id": "2192", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": true, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "2193", + "Name": "accept", + "NameInRequest": "Accept", + "Type": { + "$id": "2194", + "kind": "constant", + "valueType": { + "$id": "2195", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "2196", + "Name": "resource", + "NameInRequest": "resource", + "Doc": "Resource create parameters.", + "Type": { + "$ref": "350" + }, + "Location": "Body", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "2197", + "StatusCodes": [ + 200 + ], + "BodyType": { + "$ref": "350" + }, + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false, + "ContentTypes": [ + "application/json" + ] + }, + { + "$id": "2198", + "StatusCodes": [ + 201 + ], + "BodyType": { + "$ref": "350" + }, + "BodyMediaType": "Json", + "Headers": [ + { + "$id": "2199", + "Name": "retryAfter", + "NameInResponse": "Retry-After", + "Doc": "The Retry-After header can indicate how long the client should wait before polling the operation status.", + "Type": { + "$id": "2200", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + } + } + ], + "IsErrorResponse": false, + "ContentTypes": [ + "application/json" + ] + } + ], + "HttpMethod": "PUT", + "RequestBodyMediaType": "Json", + "Uri": "{endpoint}", + "Path": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureFleet/fleets/{fleetName}", + "RequestMediaTypes": [ + "application/json" + ], + "BufferResponse": true, + "LongRunning": { + "$id": "2201", + "FinalStateVia": 0, + "FinalResponse": { + "$id": "2202", + "StatusCodes": [ + 200 + ], + "BodyType": { + "$ref": "350" + }, + "BodyMediaType": "Json" + } + }, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Microsoft.AzureFleet.Fleets.createOrUpdate", + "Decorators": [ + { + "$id": "2203", + "name": "Azure.Core.@useFinalStateVia", + "arguments": { + "$id": "2204", + "finalState": "azure-async-operation" + } + } + ], + "Examples": [ + { + "$id": "2205", + "kind": "http", + "name": "Fleets_CreateOrUpdate", + "description": "Fleets_CreateOrUpdate", + "filePath": "2024-11-01/Fleets_CreateOrUpdate.json", + "parameters": [ + { + "$id": "2206", + "parameter": { + "$ref": "2179" + }, + "value": { + "$id": "2207", + "kind": "string", + "type": { + "$ref": "2180" + }, + "value": "2024-11-01" + } + }, + { + "$id": "2208", + "parameter": { + "$ref": "2183" + }, + "value": { + "$id": "2209", + "kind": "string", + "type": { + "$ref": "2184" + }, + "value": "1DC2F28C-A625-4B0E-9748-9885A3C9E9EB" + } + }, + { + "$id": "2210", + "parameter": { + "$ref": "2186" + }, + "value": { + "$id": "2211", + "kind": "string", + "type": { + "$ref": "2187" + }, + "value": "rgazurefleet" + } + }, + { + "$id": "2212", + "parameter": { + "$ref": "2188" + }, + "value": { + "$id": "2213", + "kind": "string", + "type": { + "$ref": "2189" + }, + "value": "testFleet" + } + }, + { + "$id": "2214", + "parameter": { + "$ref": "2196" + }, + "value": { + "$id": "2215", + "kind": "model", + "type": { + "$ref": "350" + }, + "value": { + "$id": "2216", + "properties": { + "$id": "2217", + "kind": "model", + "type": { + "$ref": "406" + }, + "value": { + "$id": "2218", + "spotPriorityProfile": { + "$id": "2219", + "kind": "model", + "type": { + "$ref": "411" + }, + "value": { + "$id": "2220", + "capacity": { + "$id": "2221", + "kind": "number", + "type": { + "$ref": "413" + }, + "value": 20 + }, + "minCapacity": { + "$id": "2222", + "kind": "number", + "type": { + "$ref": "417" + }, + "value": 10 + }, + "maxPricePerVM": { + "$id": "2223", + "kind": "number", + "type": { + "$ref": "421" + }, + "value": 0.00865 + }, + "evictionPolicy": { + "$id": "2224", + "kind": "string", + "type": { + "$ref": "18" + }, + "value": "Delete" + }, + "allocationStrategy": { + "$id": "2225", + "kind": "string", + "type": { + "$ref": "24" + }, + "value": "PriceCapacityOptimized" + }, + "maintain": { + "$id": "2226", + "kind": "boolean", + "type": { + "$ref": "431" + }, + "value": true + } + } + }, + "regularPriorityProfile": { + "$id": "2227", + "kind": "model", + "type": { + "$ref": "437" + }, + "value": { + "$id": "2228", + "capacity": { + "$id": "2229", + "kind": "number", + "type": { + "$ref": "439" + }, + "value": 20 + }, + "minCapacity": { + "$id": "2230", + "kind": "number", + "type": { + "$ref": "443" + }, + "value": 10 + }, + "allocationStrategy": { + "$id": "2231", + "kind": "string", + "type": { + "$ref": "32" + }, + "value": "LowestPrice" + } + } + }, + "vmSizesProfile": { + "$id": "2232", + "kind": "array", + "type": { + "$ref": "452" + }, + "value": [ + { + "$id": "2233", + "kind": "model", + "type": { + "$ref": "453" + }, + "value": { + "$id": "2234", + "name": { + "$id": "2235", + "kind": "string", + "type": { + "$ref": "455" + }, + "value": "Standard_d1_v2" + }, + "rank": { + "$id": "2236", + "kind": "number", + "type": { + "$ref": "459" + }, + "value": 19225 + } + } + } + ] + }, + "computeProfile": { + "$id": "2237", + "kind": "model", + "type": { + "$ref": "1370" + }, + "value": { + "$id": "2238", + "baseVirtualMachineProfile": { + "$id": "2239", + "kind": "model", + "type": { + "$ref": "565" + }, + "value": { + "$id": "2240", + "osProfile": { + "$id": "2241", + "kind": "model", + "type": { + "$ref": "567" + }, + "value": { + "$id": "2242", + "computerNamePrefix": { + "$id": "2243", + "kind": "string", + "type": { + "$ref": "569" + }, + "value": "o" + }, + "adminUsername": { + "$id": "2244", + "kind": "string", + "type": { + "$ref": "573" + }, + "value": "nrgzqciiaaxjrqldbmjbqkyhntp" + }, + "adminPassword": { + "$id": "2245", + "kind": "string", + "type": { + "$ref": "577" + }, + "value": "adfbrdxpv" + }, + "customData": { + "$id": "2246", + "kind": "string", + "type": { + "$ref": "581" + }, + "value": "xjjib" + }, + "windowsConfiguration": { + "$id": "2247", + "kind": "model", + "type": { + "$ref": "585" + }, + "value": { + "$id": "2248", + "provisionVMAgent": { + "$id": "2249", + "kind": "boolean", + "type": { + "$ref": "587" + }, + "value": true + }, + "enableAutomaticUpdates": { + "$id": "2250", + "kind": "boolean", + "type": { + "$ref": "591" + }, + "value": true + }, + "timeZone": { + "$id": "2251", + "kind": "string", + "type": { + "$ref": "595" + }, + "value": "hlyjiqcfksgrpjrct" + }, + "additionalUnattendContent": { + "$id": "2252", + "kind": "array", + "type": { + "$ref": "599" + }, + "value": [ + { + "$id": "2253", + "kind": "model", + "type": { + "$ref": "600" + }, + "value": { + "$id": "2254", + "passName": { + "$id": "2255", + "kind": "string", + "type": { + "$ref": "602" + }, + "value": "OobeSystem" + }, + "componentName": { + "$id": "2256", + "kind": "string", + "type": { + "$ref": "606" + }, + "value": "Microsoft-Windows-Shell-Setup" + }, + "settingName": { + "$id": "2257", + "kind": "string", + "type": { + "$ref": "104" + }, + "value": "AutoLogon" + }, + "content": { + "$id": "2258", + "kind": "string", + "type": { + "$ref": "613" + }, + "value": "bubmqbxjkj" + } + } + } + ] + }, + "patchSettings": { + "$id": "2259", + "kind": "model", + "type": { + "$ref": "619" + }, + "value": { + "$id": "2260", + "patchMode": { + "$id": "2261", + "kind": "string", + "type": { + "$ref": "110" + }, + "value": "Manual" + }, + "enableHotpatching": { + "$id": "2262", + "kind": "boolean", + "type": { + "$ref": "624" + }, + "value": true + }, + "assessmentMode": { + "$id": "2263", + "kind": "string", + "type": { + "$ref": "118" + }, + "value": "ImageDefault" + }, + "automaticByPlatformSettings": { + "$id": "2264", + "kind": "model", + "type": { + "$ref": "631" + }, + "value": { + "$id": "2265", + "rebootSetting": { + "$id": "2266", + "kind": "string", + "type": { + "$ref": "124" + }, + "value": "Unknown" + }, + "bypassPlatformSafetyChecksOnUserSchedule": { + "$id": "2267", + "kind": "boolean", + "type": { + "$ref": "636" + }, + "value": true + } + } + } + } + }, + "winRM": { + "$id": "2268", + "kind": "model", + "type": { + "$ref": "644" + }, + "value": { + "$id": "2269", + "listeners": { + "$id": "2270", + "kind": "array", + "type": { + "$ref": "646" + }, + "value": [ + { + "$id": "2271", + "kind": "model", + "type": { + "$ref": "647" + }, + "value": { + "$id": "2272", + "protocol": { + "$id": "2273", + "kind": "string", + "type": { + "$ref": "134" + }, + "value": "Https" + }, + "certificateUrl": { + "$id": "2274", + "kind": "string", + "type": { + "$ref": "652" + }, + "value": "https://myVaultName.vault.azure.net/secrets/myCertName" + } + } + } + ] + } + } + }, + "enableVMAgentPlatformUpdates": { + "$id": "2275", + "kind": "boolean", + "type": { + "$ref": "660" + }, + "value": true + } + } + }, + "linuxConfiguration": { + "$id": "2276", + "kind": "model", + "type": { + "$ref": "666" + }, + "value": { + "$id": "2277", + "disablePasswordAuthentication": { + "$id": "2278", + "kind": "boolean", + "type": { + "$ref": "668" + }, + "value": true + }, + "ssh": { + "$id": "2279", + "kind": "model", + "type": { + "$ref": "672" + }, + "value": { + "$id": "2280", + "publicKeys": { + "$id": "2281", + "kind": "array", + "type": { + "$ref": "674" + }, + "value": [ + { + "$id": "2282", + "kind": "model", + "type": { + "$ref": "675" + }, + "value": { + "$id": "2283", + "path": { + "$id": "2284", + "kind": "string", + "type": { + "$ref": "677" + }, + "value": "kmqz" + }, + "keyData": { + "$id": "2285", + "kind": "string", + "type": { + "$ref": "681" + }, + "value": "kivgsubusvpprwqaqpjcmhsv" + } + } + } + ] + } + } + }, + "provisionVMAgent": { + "$id": "2286", + "kind": "boolean", + "type": { + "$ref": "689" + }, + "value": true + }, + "patchSettings": { + "$id": "2287", + "kind": "model", + "type": { + "$ref": "693" + }, + "value": { + "$id": "2288", + "patchMode": { + "$id": "2289", + "kind": "string", + "type": { + "$ref": "140" + }, + "value": "ImageDefault" + }, + "assessmentMode": { + "$id": "2290", + "kind": "string", + "type": { + "$ref": "146" + }, + "value": "ImageDefault" + }, + "automaticByPlatformSettings": { + "$id": "2291", + "kind": "model", + "type": { + "$ref": "701" + }, + "value": { + "$id": "2292", + "rebootSetting": { + "$id": "2293", + "kind": "string", + "type": { + "$ref": "152" + }, + "value": "Unknown" + }, + "bypassPlatformSafetyChecksOnUserSchedule": { + "$id": "2294", + "kind": "boolean", + "type": { + "$ref": "706" + }, + "value": true + } + } + } + } + }, + "enableVMAgentPlatformUpdates": { + "$id": "2295", + "kind": "boolean", + "type": { + "$ref": "714" + }, + "value": true + } + } + }, + "secrets": { + "$id": "2296", + "kind": "array", + "type": { + "$ref": "720" + }, + "value": [ + { + "$id": "2297", + "kind": "model", + "type": { + "$ref": "721" + }, + "value": { + "$id": "2298", + "sourceVault": { + "$id": "2299", + "kind": "model", + "type": { + "$ref": "723" + }, + "value": { + "$id": "2300", + "id": { + "$id": "2301", + "kind": "string", + "type": { + "$ref": "725" + }, + "value": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault/vaults/{vaultName}" + } + } + }, + "vaultCertificates": { + "$id": "2302", + "kind": "array", + "type": { + "$ref": "732" + }, + "value": [ + { + "$id": "2303", + "kind": "model", + "type": { + "$ref": "733" + }, + "value": { + "$id": "2304", + "certificateUrl": { + "$id": "2305", + "kind": "string", + "type": { + "$ref": "735" + }, + "value": "https://myVaultName.vault.azure.net/secrets/myCertName" + }, + "certificateStore": { + "$id": "2306", + "kind": "string", + "type": { + "$ref": "739" + }, + "value": "nlxrwavpzhueffxsshlun" + } + } + } + ] + } + } + } + ] + }, + "allowExtensionOperations": { + "$id": "2307", + "kind": "boolean", + "type": { + "$ref": "747" + }, + "value": true + }, + "requireGuestProvisionSignal": { + "$id": "2308", + "kind": "boolean", + "type": { + "$ref": "751" + }, + "value": true + } + } + }, + "storageProfile": { + "$id": "2309", + "kind": "model", + "type": { + "$ref": "757" + }, + "value": { + "$id": "2310", + "imageReference": { + "$id": "2311", + "kind": "model", + "type": { + "$ref": "759" + }, + "value": { + "$id": "2312", + "publisher": { + "$id": "2313", + "kind": "string", + "type": { + "$ref": "766" + }, + "value": "mqxgwbiyjzmxavhbkd" + }, + "offer": { + "$id": "2314", + "kind": "string", + "type": { + "$ref": "770" + }, + "value": "isxgumkarlkomp" + }, + "sku": { + "$id": "2315", + "kind": "string", + "type": { + "$ref": "774" + }, + "value": "eojmppqcrnpmxirtp" + }, + "version": { + "$id": "2316", + "kind": "string", + "type": { + "$ref": "778" + }, + "value": "wvpcqefgtmqdgltiuz" + }, + "sharedGalleryImageId": { + "$id": "2317", + "kind": "string", + "type": { + "$ref": "786" + }, + "value": "kmkgihoxwlawuuhcinfirktdwkmx" + }, + "communityGalleryImageId": { + "$id": "2318", + "kind": "string", + "type": { + "$ref": "790" + }, + "value": "vlqe" + }, + "id": { + "$id": "2319", + "kind": "string", + "type": { + "$ref": "761" + }, + "value": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/images/{imageName}/versions/{versionName}" + } + } + }, + "osDisk": { + "$id": "2320", + "kind": "model", + "type": { + "$ref": "796" + }, + "value": { + "$id": "2321", + "name": { + "$id": "2322", + "kind": "string", + "type": { + "$ref": "798" + }, + "value": "wfttw" + }, + "caching": { + "$id": "2323", + "kind": "string", + "type": { + "$ref": "162" + }, + "value": "None" + }, + "writeAcceleratorEnabled": { + "$id": "2324", + "kind": "boolean", + "type": { + "$ref": "805" + }, + "value": true + }, + "createOption": { + "$id": "2325", + "kind": "string", + "type": { + "$ref": "170" + }, + "value": "FromImage" + }, + "diffDiskSettings": { + "$id": "2326", + "kind": "model", + "type": { + "$ref": "812" + }, + "value": { + "$id": "2327", + "option": { + "$id": "2328", + "kind": "string", + "type": { + "$ref": "182" + }, + "value": "Local" + }, + "placement": { + "$id": "2329", + "kind": "string", + "type": { + "$ref": "186" + }, + "value": "CacheDisk" + } + } + }, + "diskSizeGB": { + "$id": "2330", + "kind": "number", + "type": { + "$ref": "822" + }, + "value": 14 + }, + "osType": { + "$id": "2331", + "kind": "string", + "type": { + "$ref": "194" + }, + "value": "Windows" + }, + "image": { + "$id": "2332", + "kind": "model", + "type": { + "$ref": "829" + }, + "value": { + "$id": "2333", + "uri": { + "$id": "2334", + "kind": "string", + "type": { + "$ref": "831" + }, + "value": "https://myStorageAccountName.blob.core.windows.net/myContainerName/myVhdName.vhd" + } + } + }, + "vhdContainers": { + "$id": "2335", + "kind": "array", + "type": { + "$ref": "837" + }, + "value": [ + { + "$id": "2336", + "kind": "string", + "type": { + "$ref": "838" + }, + "value": "tkzcwddtinkfpnfklatw" + } + ] + }, + "managedDisk": { + "$id": "2337", + "kind": "model", + "type": { + "$ref": "842" + }, + "value": { + "$id": "2338", + "storageAccountType": { + "$id": "2339", + "kind": "string", + "type": { + "$ref": "200" + }, + "value": "Standard_LRS" + }, + "diskEncryptionSet": { + "$id": "2340", + "kind": "model", + "type": { + "$ref": "847" + }, + "value": { + "$id": "2341", + "id": { + "$id": "2342", + "kind": "string", + "type": { + "$ref": "849" + }, + "value": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskEncryptionSets/{diskEncryptionSetName}" + } + } + }, + "securityProfile": { + "$id": "2343", + "kind": "model", + "type": { + "$ref": "856" + }, + "value": { + "$id": "2344", + "securityEncryptionType": { + "$id": "2345", + "kind": "string", + "type": { + "$ref": "216" + }, + "value": "VMGuestStateOnly" + }, + "diskEncryptionSet": { + "$id": "2346", + "kind": "model", + "type": { + "$ref": "847" + }, + "value": { + "$id": "2347", + "id": { + "$id": "2348", + "kind": "string", + "type": { + "$ref": "849" + }, + "value": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskEncryptionSets/{diskEncryptionSetName}" + } + } + } + } + } + } + }, + "deleteOption": { + "$id": "2349", + "kind": "string", + "type": { + "$ref": "224" + }, + "value": "Delete" + } + } + }, + "dataDisks": { + "$id": "2350", + "kind": "array", + "type": { + "$ref": "873" + }, + "value": [ + { + "$id": "2351", + "kind": "model", + "type": { + "$ref": "874" + }, + "value": { + "$id": "2352", + "name": { + "$id": "2353", + "kind": "string", + "type": { + "$ref": "876" + }, + "value": "eogiykmdmeikswxmigjws" + }, + "lun": { + "$id": "2354", + "kind": "number", + "type": { + "$ref": "880" + }, + "value": 14 + }, + "caching": { + "$id": "2355", + "kind": "string", + "type": { + "$ref": "162" + }, + "value": "None" + }, + "writeAcceleratorEnabled": { + "$id": "2356", + "kind": "boolean", + "type": { + "$ref": "887" + }, + "value": true + }, + "createOption": { + "$id": "2357", + "kind": "string", + "type": { + "$ref": "170" + }, + "value": "FromImage" + }, + "diskSizeGB": { + "$id": "2358", + "kind": "number", + "type": { + "$ref": "894" + }, + "value": 6 + }, + "managedDisk": { + "$id": "2359", + "kind": "model", + "type": { + "$ref": "842" + }, + "value": { + "$id": "2360", + "storageAccountType": { + "$id": "2361", + "kind": "string", + "type": { + "$ref": "200" + }, + "value": "Standard_LRS" + }, + "diskEncryptionSet": { + "$id": "2362", + "kind": "model", + "type": { + "$ref": "847" + }, + "value": { + "$id": "2363", + "id": { + "$id": "2364", + "kind": "string", + "type": { + "$ref": "849" + }, + "value": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskEncryptionSets/{diskEncryptionSetName}" + } + } + }, + "securityProfile": { + "$id": "2365", + "kind": "model", + "type": { + "$ref": "856" + }, + "value": { + "$id": "2366", + "securityEncryptionType": { + "$id": "2367", + "kind": "string", + "type": { + "$ref": "216" + }, + "value": "VMGuestStateOnly" + }, + "diskEncryptionSet": { + "$id": "2368", + "kind": "model", + "type": { + "$ref": "847" + }, + "value": { + "$id": "2369", + "id": { + "$id": "2370", + "kind": "string", + "type": { + "$ref": "849" + }, + "value": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskEncryptionSets/{diskEncryptionSetName}" + } + } + } + } + } + } + }, + "diskIOPSReadWrite": { + "$id": "2371", + "kind": "number", + "type": { + "$ref": "901" + }, + "value": 27 + }, + "diskMBpsReadWrite": { + "$id": "2372", + "kind": "number", + "type": { + "$ref": "905" + }, + "value": 2 + }, + "deleteOption": { + "$id": "2373", + "kind": "string", + "type": { + "$ref": "224" + }, + "value": "Delete" + } + } + } + ] + } + } + }, + "networkProfile": { + "$id": "2374", + "kind": "model", + "type": { + "$ref": "919" + }, + "value": { + "$id": "2375", + "healthProbe": { + "$id": "2376", + "kind": "model", + "type": { + "$ref": "921" + }, + "value": { + "$id": "2377", + "id": { + "$id": "2378", + "kind": "string", + "type": { + "$ref": "923" + }, + "value": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/probes/{probeName}" + } + } + }, + "networkInterfaceConfigurations": { + "$id": "2379", + "kind": "array", + "type": { + "$ref": "930" + }, + "value": [ + { + "$id": "2380", + "kind": "model", + "type": { + "$ref": "931" + }, + "value": { + "$id": "2381", + "name": { + "$id": "2382", + "kind": "string", + "type": { + "$ref": "933" + }, + "value": "i" + }, + "properties": { + "$id": "2383", + "kind": "model", + "type": { + "$ref": "937" + }, + "value": { + "$id": "2384", + "primary": { + "$id": "2385", + "kind": "boolean", + "type": { + "$ref": "939" + }, + "value": true + }, + "enableAcceleratedNetworking": { + "$id": "2386", + "kind": "boolean", + "type": { + "$ref": "943" + }, + "value": true + }, + "disableTcpStateTracking": { + "$id": "2387", + "kind": "boolean", + "type": { + "$ref": "947" + }, + "value": true + }, + "enableFpga": { + "$id": "2388", + "kind": "boolean", + "type": { + "$ref": "951" + }, + "value": true + }, + "networkSecurityGroup": { + "$id": "2389", + "kind": "model", + "type": { + "$ref": "723" + }, + "value": { + "$id": "2390", + "id": { + "$id": "2391", + "kind": "string", + "type": { + "$ref": "725" + }, + "value": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}" + } + } + }, + "dnsSettings": { + "$id": "2392", + "kind": "model", + "type": { + "$ref": "958" + }, + "value": { + "$id": "2393", + "dnsServers": { + "$id": "2394", + "kind": "array", + "type": { + "$ref": "960" + }, + "value": [ + { + "$id": "2395", + "kind": "string", + "type": { + "$ref": "961" + }, + "value": "nxmmfolhclsesu" + } + ] + } + } + }, + "ipConfigurations": { + "$id": "2396", + "kind": "array", + "type": { + "$ref": "967" + }, + "value": [ + { + "$id": "2397", + "kind": "model", + "type": { + "$ref": "968" + }, + "value": { + "$id": "2398", + "name": { + "$id": "2399", + "kind": "string", + "type": { + "$ref": "970" + }, + "value": "oezqhkidfhyywlfzwuotilrpbqnjg" + }, + "properties": { + "$id": "2400", + "kind": "model", + "type": { + "$ref": "974" + }, + "value": { + "$id": "2401", + "subnet": { + "$id": "2402", + "kind": "model", + "type": { + "$ref": "921" + }, + "value": { + "$id": "2403", + "id": { + "$id": "2404", + "kind": "string", + "type": { + "$ref": "923" + }, + "value": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}" + } + } + }, + "primary": { + "$id": "2405", + "kind": "boolean", + "type": { + "$ref": "979" + }, + "value": true + }, + "publicIPAddressConfiguration": { + "$id": "2406", + "kind": "model", + "type": { + "$ref": "983" + }, + "value": { + "$id": "2407", + "name": { + "$id": "2408", + "kind": "string", + "type": { + "$ref": "985" + }, + "value": "fvpqf" + }, + "properties": { + "$id": "2409", + "kind": "model", + "type": { + "$ref": "989" + }, + "value": { + "$id": "2410", + "idleTimeoutInMinutes": { + "$id": "2411", + "kind": "number", + "type": { + "$ref": "991" + }, + "value": 9 + }, + "dnsSettings": { + "$id": "2412", + "kind": "model", + "type": { + "$ref": "995" + }, + "value": { + "$id": "2413", + "domainNameLabel": { + "$id": "2414", + "kind": "string", + "type": { + "$ref": "997" + }, + "value": "ukrddzvmorpmfsczjwtbvp" + }, + "domainNameLabelScope": { + "$id": "2415", + "kind": "string", + "type": { + "$ref": "236" + }, + "value": "TenantReuse" + } + } + }, + "ipTags": { + "$id": "2416", + "kind": "array", + "type": { + "$ref": "1006" + }, + "value": [ + { + "$id": "2417", + "kind": "model", + "type": { + "$ref": "1007" + }, + "value": { + "$id": "2418", + "ipTagType": { + "$id": "2419", + "kind": "string", + "type": { + "$ref": "1009" + }, + "value": "sddgsoemnzgqizale" + }, + "tag": { + "$id": "2420", + "kind": "string", + "type": { + "$ref": "1013" + }, + "value": "wufmhrjsakbiaetyara" + } + } + } + ] + }, + "publicIPPrefix": { + "$id": "2421", + "kind": "model", + "type": { + "$ref": "723" + }, + "value": { + "$id": "2422", + "id": { + "$id": "2423", + "kind": "string", + "type": { + "$ref": "725" + }, + "value": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPPrefixes/{publicIPPrefixName}" + } + } + }, + "publicIPAddressVersion": { + "$id": "2424", + "kind": "string", + "type": { + "$ref": "246" + }, + "value": "IPv4" + }, + "deleteOption": { + "$id": "2425", + "kind": "string", + "type": { + "$ref": "252" + }, + "value": "Delete" + } + } + }, + "sku": { + "$id": "2426", + "kind": "model", + "type": { + "$ref": "1030" + }, + "value": { + "$id": "2427", + "name": { + "$id": "2428", + "kind": "string", + "type": { + "$ref": "258" + }, + "value": "Basic" + }, + "tier": { + "$id": "2429", + "kind": "string", + "type": { + "$ref": "264" + }, + "value": "Regional" + } + } + } + } + }, + "privateIPAddressVersion": { + "$id": "2430", + "kind": "string", + "type": { + "$ref": "246" + }, + "value": "IPv4" + }, + "applicationGatewayBackendAddressPools": { + "$id": "2431", + "kind": "array", + "type": { + "$ref": "1045" + }, + "value": [ + { + "$id": "2432", + "kind": "model", + "type": { + "$ref": "723" + }, + "value": { + "$id": "2433", + "id": { + "$id": "2434", + "kind": "string", + "type": { + "$ref": "725" + }, + "value": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}/backendAddressPools/{backendAddressPoolName}" + } + } + } + ] + }, + "applicationSecurityGroups": { + "$id": "2435", + "kind": "array", + "type": { + "$ref": "1049" + }, + "value": [ + { + "$id": "2436", + "kind": "model", + "type": { + "$ref": "723" + }, + "value": { + "$id": "2437", + "id": { + "$id": "2438", + "kind": "string", + "type": { + "$ref": "725" + }, + "value": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationSecurityGroups/{applicationSecurityGroupName}" + } + } + } + ] + }, + "loadBalancerBackendAddressPools": { + "$id": "2439", + "kind": "array", + "type": { + "$ref": "1053" + }, + "value": [ + { + "$id": "2440", + "kind": "model", + "type": { + "$ref": "723" + }, + "value": { + "$id": "2441", + "id": { + "$id": "2442", + "kind": "string", + "type": { + "$ref": "725" + }, + "value": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/backendAddressPools/{backendAddressPoolName}" + } + } + } + ] + }, + "loadBalancerInboundNatPools": { + "$id": "2443", + "kind": "array", + "type": { + "$ref": "1057" + }, + "value": [ + { + "$id": "2444", + "kind": "model", + "type": { + "$ref": "723" + }, + "value": { + "$id": "2445", + "id": { + "$id": "2446", + "kind": "string", + "type": { + "$ref": "725" + }, + "value": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/inboundNatPools/{inboundNatPoolName}" + } + } + } + ] + } + } + } + } + } + ] + }, + "enableIPForwarding": { + "$id": "2447", + "kind": "boolean", + "type": { + "$ref": "1065" + }, + "value": true + }, + "deleteOption": { + "$id": "2448", + "kind": "string", + "type": { + "$ref": "252" + }, + "value": "Delete" + }, + "auxiliaryMode": { + "$id": "2449", + "kind": "string", + "type": { + "$ref": "270" + }, + "value": "None" + }, + "auxiliarySku": { + "$id": "2450", + "kind": "string", + "type": { + "$ref": "278" + }, + "value": "None" + } + } + } + } + } + ] + }, + "networkApiVersion": { + "$id": "2451", + "kind": "string", + "type": { + "$ref": "290" + }, + "value": "2020-11-01" + } + } + }, + "securityProfile": { + "$id": "2452", + "kind": "model", + "type": { + "$ref": "1087" + }, + "value": { + "$id": "2453", + "uefiSettings": { + "$id": "2454", + "kind": "model", + "type": { + "$ref": "1089" + }, + "value": { + "$id": "2455", + "secureBootEnabled": { + "$id": "2456", + "kind": "boolean", + "type": { + "$ref": "1091" + }, + "value": true + }, + "vTpmEnabled": { + "$id": "2457", + "kind": "boolean", + "type": { + "$ref": "1095" + }, + "value": true + } + } + }, + "encryptionAtHost": { + "$id": "2458", + "kind": "boolean", + "type": { + "$ref": "1101" + }, + "value": true + }, + "securityType": { + "$id": "2459", + "kind": "string", + "type": { + "$ref": "294" + }, + "value": "TrustedLaunch" + }, + "encryptionIdentity": { + "$id": "2460", + "kind": "model", + "type": { + "$ref": "1108" + }, + "value": { + "$id": "2461", + "userAssignedIdentityResourceId": { + "$id": "2462", + "kind": "string", + "type": { + "$ref": "1110" + }, + "value": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{userAssignedIdentityName}" + } + } + }, + "proxyAgentSettings": { + "$id": "2463", + "kind": "model", + "type": { + "$ref": "1117" + }, + "value": { + "$id": "2464", + "enabled": { + "$id": "2465", + "kind": "boolean", + "type": { + "$ref": "1119" + }, + "value": true + }, + "mode": { + "$id": "2466", + "kind": "string", + "type": { + "$ref": "300" + }, + "value": "Audit" + }, + "keyIncarnationId": { + "$id": "2467", + "kind": "number", + "type": { + "$ref": "1126" + }, + "value": 20 + } + } + } + } + }, + "diagnosticsProfile": { + "$id": "2468", + "kind": "model", + "type": { + "$ref": "1134" + }, + "value": { + "$id": "2469", + "bootDiagnostics": { + "$id": "2470", + "kind": "model", + "type": { + "$ref": "1136" + }, + "value": { + "$id": "2471", + "enabled": { + "$id": "2472", + "kind": "boolean", + "type": { + "$ref": "1138" + }, + "value": true + }, + "storageUri": { + "$id": "2473", + "kind": "string", + "type": { + "$ref": "1142" + }, + "value": "http://myStorageAccountName.blob.core.windows.net" + } + } + } + } + }, + "extensionProfile": { + "$id": "2474", + "kind": "model", + "type": { + "$ref": "1150" + }, + "value": { + "$id": "2475", + "extensions": { + "$id": "2476", + "kind": "array", + "type": { + "$ref": "1152" + }, + "value": [ + { + "$id": "2477", + "kind": "model", + "type": { + "$ref": "1153" + }, + "value": { + "$id": "2478", + "name": { + "$id": "2479", + "kind": "string", + "type": { + "$ref": "1160" + }, + "value": "bndxuxx" + }, + "properties": { + "$id": "2480", + "kind": "model", + "type": { + "$ref": "1168" + }, + "value": { + "$id": "2481", + "forceUpdateTag": { + "$id": "2482", + "kind": "string", + "type": { + "$ref": "1170" + }, + "value": "yhgxw" + }, + "publisher": { + "$id": "2483", + "kind": "string", + "type": { + "$ref": "1174" + }, + "value": "kpxtirxjfprhs" + }, + "type": { + "$id": "2484", + "kind": "string", + "type": { + "$ref": "1178" + }, + "value": "pgjilctjjwaa" + }, + "typeHandlerVersion": { + "$id": "2485", + "kind": "string", + "type": { + "$ref": "1182" + }, + "value": "zevivcoilxmbwlrihhhibq" + }, + "autoUpgradeMinorVersion": { + "$id": "2486", + "kind": "boolean", + "type": { + "$ref": "1186" + }, + "value": true + }, + "enableAutomaticUpgrade": { + "$id": "2487", + "kind": "boolean", + "type": { + "$ref": "1190" + }, + "value": true + }, + "settings": { + "$id": "2488", + "kind": "dict", + "type": { + "$ref": "1194" + }, + "value": { + "$id": "2489" + } + }, + "protectedSettings": { + "$id": "2490", + "kind": "dict", + "type": { + "$ref": "1200" + }, + "value": { + "$id": "2491" + } + }, + "provisionAfterExtensions": { + "$id": "2492", + "kind": "array", + "type": { + "$ref": "1210" + }, + "value": [ + { + "$id": "2493", + "kind": "string", + "type": { + "$ref": "1211" + }, + "value": "nftzosroolbcwmpupujzqwqe" + } + ] + }, + "suppressFailures": { + "$id": "2494", + "kind": "boolean", + "type": { + "$ref": "1215" + }, + "value": true + }, + "protectedSettingsFromKeyVault": { + "$id": "2495", + "kind": "model", + "type": { + "$ref": "1219" + }, + "value": { + "$id": "2496", + "secretUrl": { + "$id": "2497", + "kind": "string", + "type": { + "$ref": "1221" + }, + "value": "https://myvaultName.vault.azure.net/secrets/secret/mySecretName" + }, + "sourceVault": { + "$id": "2498", + "kind": "model", + "type": { + "$ref": "723" + }, + "value": { + "$id": "2499", + "id": { + "$id": "2500", + "kind": "string", + "type": { + "$ref": "725" + }, + "value": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault/vaults/{vaultName}" + } + } + } + } + } + } + } + } + } + ] + }, + "extensionsTimeBudget": { + "$id": "2501", + "kind": "string", + "type": { + "$ref": "1234" + }, + "value": "mbhjahtdygwgyszdwjtvlvtgchdwil" + } + } + }, + "licenseType": { + "$id": "2502", + "kind": "string", + "type": { + "$ref": "1240" + }, + "value": "v" + }, + "scheduledEventsProfile": { + "$id": "2503", + "kind": "model", + "type": { + "$ref": "1244" + }, + "value": { + "$id": "2504", + "terminateNotificationProfile": { + "$id": "2505", + "kind": "model", + "type": { + "$ref": "1246" + }, + "value": { + "$id": "2506", + "notBeforeTimeout": { + "$id": "2507", + "kind": "string", + "type": { + "$ref": "1248" + }, + "value": "iljppmmw" + }, + "enable": { + "$id": "2508", + "kind": "boolean", + "type": { + "$ref": "1252" + }, + "value": true + } + } + }, + "osImageNotificationProfile": { + "$id": "2509", + "kind": "model", + "type": { + "$ref": "1258" + }, + "value": { + "$id": "2510", + "notBeforeTimeout": { + "$id": "2511", + "kind": "string", + "type": { + "$ref": "1260" + }, + "value": "olbpadmevekyczfokodtfprxti" + }, + "enable": { + "$id": "2512", + "kind": "boolean", + "type": { + "$ref": "1264" + }, + "value": true + } + } + } + } + }, + "userData": { + "$id": "2513", + "kind": "string", + "type": { + "$ref": "1272" + }, + "value": "s" + }, + "capacityReservation": { + "$id": "2514", + "kind": "model", + "type": { + "$ref": "1276" + }, + "value": { + "$id": "2515", + "capacityReservationGroup": { + "$id": "2516", + "kind": "model", + "type": { + "$ref": "723" + }, + "value": { + "$id": "2517", + "id": { + "$id": "2518", + "kind": "string", + "type": { + "$ref": "725" + }, + "value": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/capacityReservationGroups/{capacityReservationGroupName}" + } + } + } + } + }, + "applicationProfile": { + "$id": "2519", + "kind": "model", + "type": { + "$ref": "1283" + }, + "value": { + "$id": "2520", + "galleryApplications": { + "$id": "2521", + "kind": "array", + "type": { + "$ref": "1285" + }, + "value": [ + { + "$id": "2522", + "kind": "model", + "type": { + "$ref": "1286" + }, + "value": { + "$id": "2523", + "tags": { + "$id": "2524", + "kind": "string", + "type": { + "$ref": "1288" + }, + "value": "eyrqjbib" + }, + "order": { + "$id": "2525", + "kind": "number", + "type": { + "$ref": "1292" + }, + "value": 5 + }, + "packageReferenceId": { + "$id": "2526", + "kind": "string", + "type": { + "$ref": "1296" + }, + "value": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/applications/{applicationName}/versions/{versionName}" + }, + "configurationReference": { + "$id": "2527", + "kind": "string", + "type": { + "$ref": "1301" + }, + "value": "ulztmiavpojpbpbddgnuuiimxcpau" + }, + "treatFailureAsDeploymentFailure": { + "$id": "2528", + "kind": "boolean", + "type": { + "$ref": "1305" + }, + "value": true + }, + "enableAutomaticUpgrade": { + "$id": "2529", + "kind": "boolean", + "type": { + "$ref": "1309" + }, + "value": true + } + } + } + ] + } + } + }, + "hardwareProfile": { + "$id": "2530", + "kind": "model", + "type": { + "$ref": "1317" + }, + "value": { + "$id": "2531", + "vmSizeProperties": { + "$id": "2532", + "kind": "model", + "type": { + "$ref": "1319" + }, + "value": { + "$id": "2533", + "vCPUsAvailable": { + "$id": "2534", + "kind": "number", + "type": { + "$ref": "1321" + }, + "value": 16 + }, + "vCPUsPerCore": { + "$id": "2535", + "kind": "number", + "type": { + "$ref": "1325" + }, + "value": 23 + } + } + } + } + }, + "serviceArtifactReference": { + "$id": "2536", + "kind": "model", + "type": { + "$ref": "1333" + }, + "value": { + "$id": "2537", + "id": { + "$id": "2538", + "kind": "string", + "type": { + "$ref": "1335" + }, + "value": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/serviceArtifacts/{serviceArtifactsName}/vmArtifactsProfiles/{vmArtifactsProfileName}" + } + } + }, + "securityPostureReference": { + "$id": "2539", + "kind": "model", + "type": { + "$ref": "1342" + }, + "value": { + "$id": "2540", + "id": { + "$id": "2541", + "kind": "string", + "type": { + "$ref": "1344" + }, + "value": "/CommunityGalleries/{communityGalleryName}/securityPostures/{securityPostureName}/versions/{major.minor.patch}|{major.*}|latest" + }, + "excludeExtensions": { + "$id": "2542", + "kind": "array", + "type": { + "$ref": "1348" + }, + "value": [ + { + "$id": "2543", + "kind": "string", + "type": { + "$ref": "1349" + }, + "value": "{securityPostureVMExtensionName}" + } + ] + }, + "isOverridable": { + "$id": "2544", + "kind": "boolean", + "type": { + "$ref": "1353" + }, + "value": true + } + } + } + } + }, + "computeApiVersion": { + "$id": "2545", + "kind": "string", + "type": { + "$ref": "1375" + }, + "value": "2023-07-01" + }, + "platformFaultDomainCount": { + "$id": "2546", + "kind": "number", + "type": { + "$ref": "1379" + }, + "value": 1 + } + } + } + } + }, + "zones": { + "$id": "2547", + "kind": "array", + "type": { + "$ref": "1408" + }, + "value": [ + { + "$id": "2548", + "kind": "string", + "type": { + "$ref": "1409" + }, + "value": "zone1" + }, + { + "$id": "2549", + "kind": "string", + "type": { + "$ref": "1409" + }, + "value": "zone2" + } + ] + }, + "identity": { + "$id": "2550", + "kind": "model", + "type": { + "$ref": "1413" + }, + "value": { + "$id": "2551", + "type": { + "$id": "2552", + "kind": "string", + "type": { + "$ref": "306" + }, + "value": "UserAssigned" + }, + "userAssignedIdentities": { + "$id": "2553", + "kind": "dict", + "type": { + "$ref": "1428" + }, + "value": { + "$id": "2554", + "key9851": { + "$id": "2555", + "kind": "model", + "type": { + "$ref": "1431" + }, + "value": { + "$id": "2556" + } + } + } + } + } + }, + "tags": { + "$id": "2557", + "kind": "dict", + "type": { + "$ref": "396" + }, + "value": { + "$id": "2558", + "key3518": { + "$id": "2559", + "kind": "string", + "type": { + "$ref": "398" + }, + "value": "luvrnuvsgdpbuofdskkcoqhfh" + } + } + }, + "location": { + "$id": "2560", + "kind": "string", + "type": { + "$ref": "402" + }, + "value": "westus" + }, + "plan": { + "$id": "2561", + "kind": "model", + "type": { + "$ref": "1447" + }, + "value": { + "$id": "2562", + "name": { + "$id": "2563", + "kind": "string", + "type": { + "$ref": "1449" + }, + "value": "jwgrcrnrtfoxn" + }, + "publisher": { + "$id": "2564", + "kind": "string", + "type": { + "$ref": "1453" + }, + "value": "iozjbiqqckqm" + }, + "product": { + "$id": "2565", + "kind": "string", + "type": { + "$ref": "1457" + }, + "value": "cgopbyvdyqikahwyxfpzwaqk" + }, + "promotionCode": { + "$id": "2566", + "kind": "string", + "type": { + "$ref": "1461" + }, + "value": "naglezezplcaruqogtxnuizslqnnbr" + }, + "version": { + "$id": "2567", + "kind": "string", + "type": { + "$ref": "1465" + }, + "value": "wa" + } + } + } + } + } + } + ], + "responses": [ + { + "$id": "2568", + "response": { + "$ref": "2197" + }, + "statusCode": 200, + "bodyValue": { + "$id": "2569", + "kind": "model", + "type": { + "$ref": "350" + }, + "value": { + "$id": "2570", + "properties": { + "$id": "2571", + "kind": "model", + "type": { + "$ref": "406" + }, + "value": { + "$id": "2572", + "provisioningState": { + "$id": "2573", + "kind": "string", + "type": { + "$ref": "2" + }, + "value": "Succeeded" + }, + "spotPriorityProfile": { + "$id": "2574", + "kind": "model", + "type": { + "$ref": "411" + }, + "value": { + "$id": "2575", + "capacity": { + "$id": "2576", + "kind": "number", + "type": { + "$ref": "413" + }, + "value": 10 + }, + "minCapacity": { + "$id": "2577", + "kind": "number", + "type": { + "$ref": "417" + }, + "value": 20 + }, + "maxPricePerVM": { + "$id": "2578", + "kind": "number", + "type": { + "$ref": "421" + }, + "value": 0.00865 + }, + "evictionPolicy": { + "$id": "2579", + "kind": "string", + "type": { + "$ref": "18" + }, + "value": "Delete" + }, + "allocationStrategy": { + "$id": "2580", + "kind": "string", + "type": { + "$ref": "24" + }, + "value": "PriceCapacityOptimized" + }, + "maintain": { + "$id": "2581", + "kind": "boolean", + "type": { + "$ref": "431" + }, + "value": true + } + } + }, + "regularPriorityProfile": { + "$id": "2582", + "kind": "model", + "type": { + "$ref": "437" + }, + "value": { + "$id": "2583", + "capacity": { + "$id": "2584", + "kind": "number", + "type": { + "$ref": "439" + }, + "value": 10 + }, + "minCapacity": { + "$id": "2585", + "kind": "number", + "type": { + "$ref": "443" + }, + "value": 10 + }, + "allocationStrategy": { + "$id": "2586", + "kind": "string", + "type": { + "$ref": "32" + }, + "value": "LowestPrice" + } + } + }, + "vmSizesProfile": { + "$id": "2587", + "kind": "array", + "type": { + "$ref": "452" + }, + "value": [ + { + "$id": "2588", + "kind": "model", + "type": { + "$ref": "453" + }, + "value": { + "$id": "2589", + "name": { + "$id": "2590", + "kind": "string", + "type": { + "$ref": "455" + }, + "value": "Standard_d1_v2" + }, + "rank": { + "$id": "2591", + "kind": "number", + "type": { + "$ref": "459" + }, + "value": 19225 + } + } + } + ] + }, + "computeProfile": { + "$id": "2592", + "kind": "model", + "type": { + "$ref": "1370" + }, + "value": { + "$id": "2593", + "baseVirtualMachineProfile": { + "$id": "2594", + "kind": "model", + "type": { + "$ref": "565" + }, + "value": { + "$id": "2595", + "osProfile": { + "$id": "2596", + "kind": "model", + "type": { + "$ref": "567" + }, + "value": { + "$id": "2597", + "computerNamePrefix": { + "$id": "2598", + "kind": "string", + "type": { + "$ref": "569" + }, + "value": "o" + }, + "adminUsername": { + "$id": "2599", + "kind": "string", + "type": { + "$ref": "573" + }, + "value": "nrgzqciiaaxjrqldbmjbqkyhntp" + }, + "windowsConfiguration": { + "$id": "2600", + "kind": "model", + "type": { + "$ref": "585" + }, + "value": { + "$id": "2601", + "provisionVMAgent": { + "$id": "2602", + "kind": "boolean", + "type": { + "$ref": "587" + }, + "value": true + }, + "enableAutomaticUpdates": { + "$id": "2603", + "kind": "boolean", + "type": { + "$ref": "591" + }, + "value": true + }, + "timeZone": { + "$id": "2604", + "kind": "string", + "type": { + "$ref": "595" + }, + "value": "hlyjiqcfksgrpjrct" + }, + "additionalUnattendContent": { + "$id": "2605", + "kind": "array", + "type": { + "$ref": "599" + }, + "value": [ + { + "$id": "2606", + "kind": "model", + "type": { + "$ref": "600" + }, + "value": { + "$id": "2607", + "passName": { + "$id": "2608", + "kind": "string", + "type": { + "$ref": "602" + }, + "value": "OobeSystem" + }, + "componentName": { + "$id": "2609", + "kind": "string", + "type": { + "$ref": "606" + }, + "value": "Microsoft-Windows-Shell-Setup" + }, + "settingName": { + "$id": "2610", + "kind": "string", + "type": { + "$ref": "104" + }, + "value": "AutoLogon" + } + } + } + ] + }, + "patchSettings": { + "$id": "2611", + "kind": "model", + "type": { + "$ref": "619" + }, + "value": { + "$id": "2612", + "patchMode": { + "$id": "2613", + "kind": "string", + "type": { + "$ref": "110" + }, + "value": "Manual" + }, + "enableHotpatching": { + "$id": "2614", + "kind": "boolean", + "type": { + "$ref": "624" + }, + "value": true + }, + "assessmentMode": { + "$id": "2615", + "kind": "string", + "type": { + "$ref": "118" + }, + "value": "ImageDefault" + }, + "automaticByPlatformSettings": { + "$id": "2616", + "kind": "model", + "type": { + "$ref": "631" + }, + "value": { + "$id": "2617", + "rebootSetting": { + "$id": "2618", + "kind": "string", + "type": { + "$ref": "124" + }, + "value": "Unknown" + }, + "bypassPlatformSafetyChecksOnUserSchedule": { + "$id": "2619", + "kind": "boolean", + "type": { + "$ref": "636" + }, + "value": true + } + } + } + } + }, + "winRM": { + "$id": "2620", + "kind": "model", + "type": { + "$ref": "644" + }, + "value": { + "$id": "2621", + "listeners": { + "$id": "2622", + "kind": "array", + "type": { + "$ref": "646" + }, + "value": [ + { + "$id": "2623", + "kind": "model", + "type": { + "$ref": "647" + }, + "value": { + "$id": "2624", + "protocol": { + "$id": "2625", + "kind": "string", + "type": { + "$ref": "134" + }, + "value": "Https" + }, + "certificateUrl": { + "$id": "2626", + "kind": "string", + "type": { + "$ref": "652" + }, + "value": "https://myVaultName.vault.azure.net/secrets/myCertName" + } + } + } + ] + } + } + }, + "enableVMAgentPlatformUpdates": { + "$id": "2627", + "kind": "boolean", + "type": { + "$ref": "660" + }, + "value": true + } + } + }, + "linuxConfiguration": { + "$id": "2628", + "kind": "model", + "type": { + "$ref": "666" + }, + "value": { + "$id": "2629", + "disablePasswordAuthentication": { + "$id": "2630", + "kind": "boolean", + "type": { + "$ref": "668" + }, + "value": true + }, + "ssh": { + "$id": "2631", + "kind": "model", + "type": { + "$ref": "672" + }, + "value": { + "$id": "2632", + "publicKeys": { + "$id": "2633", + "kind": "array", + "type": { + "$ref": "674" + }, + "value": [ + { + "$id": "2634", + "kind": "model", + "type": { + "$ref": "675" + }, + "value": { + "$id": "2635", + "path": { + "$id": "2636", + "kind": "string", + "type": { + "$ref": "677" + }, + "value": "kmqz" + }, + "keyData": { + "$id": "2637", + "kind": "string", + "type": { + "$ref": "681" + }, + "value": "kivgsubusvpprwqaqpjcmhsv" + } + } + } + ] + } + } + }, + "provisionVMAgent": { + "$id": "2638", + "kind": "boolean", + "type": { + "$ref": "689" + }, + "value": true + }, + "patchSettings": { + "$id": "2639", + "kind": "model", + "type": { + "$ref": "693" + }, + "value": { + "$id": "2640", + "patchMode": { + "$id": "2641", + "kind": "string", + "type": { + "$ref": "140" + }, + "value": "ImageDefault" + }, + "assessmentMode": { + "$id": "2642", + "kind": "string", + "type": { + "$ref": "146" + }, + "value": "ImageDefault" + }, + "automaticByPlatformSettings": { + "$id": "2643", + "kind": "model", + "type": { + "$ref": "701" + }, + "value": { + "$id": "2644", + "rebootSetting": { + "$id": "2645", + "kind": "string", + "type": { + "$ref": "152" + }, + "value": "Unknown" + }, + "bypassPlatformSafetyChecksOnUserSchedule": { + "$id": "2646", + "kind": "boolean", + "type": { + "$ref": "706" + }, + "value": true + } + } + } + } + }, + "enableVMAgentPlatformUpdates": { + "$id": "2647", + "kind": "boolean", + "type": { + "$ref": "714" + }, + "value": true + } + } + }, + "secrets": { + "$id": "2648", + "kind": "array", + "type": { + "$ref": "720" + }, + "value": [ + { + "$id": "2649", + "kind": "model", + "type": { + "$ref": "721" + }, + "value": { + "$id": "2650", + "sourceVault": { + "$id": "2651", + "kind": "model", + "type": { + "$ref": "723" + }, + "value": { + "$id": "2652", + "id": { + "$id": "2653", + "kind": "string", + "type": { + "$ref": "725" + }, + "value": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault/vaults/{vaultName}" + } + } + }, + "vaultCertificates": { + "$id": "2654", + "kind": "array", + "type": { + "$ref": "732" + }, + "value": [ + { + "$id": "2655", + "kind": "model", + "type": { + "$ref": "733" + }, + "value": { + "$id": "2656", + "certificateUrl": { + "$id": "2657", + "kind": "string", + "type": { + "$ref": "735" + }, + "value": "https://myVaultName.vault.azure.net/secrets/myCertName" + }, + "certificateStore": { + "$id": "2658", + "kind": "string", + "type": { + "$ref": "739" + }, + "value": "nlxrwavpzhueffxsshlun" + } + } + } + ] + } + } + } + ] + }, + "allowExtensionOperations": { + "$id": "2659", + "kind": "boolean", + "type": { + "$ref": "747" + }, + "value": true + }, + "requireGuestProvisionSignal": { + "$id": "2660", + "kind": "boolean", + "type": { + "$ref": "751" + }, + "value": true + } + } + }, + "storageProfile": { + "$id": "2661", + "kind": "model", + "type": { + "$ref": "757" + }, + "value": { + "$id": "2662", + "imageReference": { + "$id": "2663", + "kind": "model", + "type": { + "$ref": "759" + }, + "value": { + "$id": "2664", + "publisher": { + "$id": "2665", + "kind": "string", + "type": { + "$ref": "766" + }, + "value": "mqxgwbiyjzmxavhbkd" + }, + "offer": { + "$id": "2666", + "kind": "string", + "type": { + "$ref": "770" + }, + "value": "isxgumkarlkomp" + }, + "sku": { + "$id": "2667", + "kind": "string", + "type": { + "$ref": "774" + }, + "value": "eojmppqcrnpmxirtp" + }, + "version": { + "$id": "2668", + "kind": "string", + "type": { + "$ref": "778" + }, + "value": "wvpcqefgtmqdgltiuz" + }, + "exactVersion": { + "$id": "2669", + "kind": "string", + "type": { + "$ref": "782" + }, + "value": "zjbntmiskjexlr" + }, + "sharedGalleryImageId": { + "$id": "2670", + "kind": "string", + "type": { + "$ref": "786" + }, + "value": "kmkgihoxwlawuuhcinfirktdwkmx" + }, + "communityGalleryImageId": { + "$id": "2671", + "kind": "string", + "type": { + "$ref": "790" + }, + "value": "vlqe" + }, + "id": { + "$id": "2672", + "kind": "string", + "type": { + "$ref": "761" + }, + "value": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/images/{imageName}/versions/{versionName}" + } + } + }, + "osDisk": { + "$id": "2673", + "kind": "model", + "type": { + "$ref": "796" + }, + "value": { + "$id": "2674", + "name": { + "$id": "2675", + "kind": "string", + "type": { + "$ref": "798" + }, + "value": "wfttw" + }, + "caching": { + "$id": "2676", + "kind": "string", + "type": { + "$ref": "162" + }, + "value": "None" + }, + "writeAcceleratorEnabled": { + "$id": "2677", + "kind": "boolean", + "type": { + "$ref": "805" + }, + "value": true + }, + "createOption": { + "$id": "2678", + "kind": "string", + "type": { + "$ref": "170" + }, + "value": "FromImage" + }, + "diffDiskSettings": { + "$id": "2679", + "kind": "model", + "type": { + "$ref": "812" + }, + "value": { + "$id": "2680", + "option": { + "$id": "2681", + "kind": "string", + "type": { + "$ref": "182" + }, + "value": "Local" + }, + "placement": { + "$id": "2682", + "kind": "string", + "type": { + "$ref": "186" + }, + "value": "CacheDisk" + } + } + }, + "diskSizeGB": { + "$id": "2683", + "kind": "number", + "type": { + "$ref": "822" + }, + "value": 14 + }, + "osType": { + "$id": "2684", + "kind": "string", + "type": { + "$ref": "194" + }, + "value": "Windows" + }, + "image": { + "$id": "2685", + "kind": "model", + "type": { + "$ref": "829" + }, + "value": { + "$id": "2686", + "uri": { + "$id": "2687", + "kind": "string", + "type": { + "$ref": "831" + }, + "value": "https://myStorageAccountName.blob.core.windows.net/myContainerName/myVhdName.vhd" + } + } + }, + "vhdContainers": { + "$id": "2688", + "kind": "array", + "type": { + "$ref": "837" + }, + "value": [ + { + "$id": "2689", + "kind": "string", + "type": { + "$ref": "838" + }, + "value": "tkzcwddtinkfpnfklatw" + } + ] + }, + "managedDisk": { + "$id": "2690", + "kind": "model", + "type": { + "$ref": "842" + }, + "value": { + "$id": "2691", + "storageAccountType": { + "$id": "2692", + "kind": "string", + "type": { + "$ref": "200" + }, + "value": "Standard_LRS" + }, + "diskEncryptionSet": { + "$id": "2693", + "kind": "model", + "type": { + "$ref": "847" + }, + "value": { + "$id": "2694", + "id": { + "$id": "2695", + "kind": "string", + "type": { + "$ref": "849" + }, + "value": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskEncryptionSets/{diskEncryptionSetName}" + } + } + }, + "securityProfile": { + "$id": "2696", + "kind": "model", + "type": { + "$ref": "856" + }, + "value": { + "$id": "2697", + "securityEncryptionType": { + "$id": "2698", + "kind": "string", + "type": { + "$ref": "216" + }, + "value": "VMGuestStateOnly" + }, + "diskEncryptionSet": { + "$id": "2699", + "kind": "model", + "type": { + "$ref": "847" + }, + "value": { + "$id": "2700", + "id": { + "$id": "2701", + "kind": "string", + "type": { + "$ref": "849" + }, + "value": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskEncryptionSets/{diskEncryptionSetName}" + } + } + } + } + } + } + }, + "deleteOption": { + "$id": "2702", + "kind": "string", + "type": { + "$ref": "224" + }, + "value": "Delete" + } + } + }, + "dataDisks": { + "$id": "2703", + "kind": "array", + "type": { + "$ref": "873" + }, + "value": [ + { + "$id": "2704", + "kind": "model", + "type": { + "$ref": "874" + }, + "value": { + "$id": "2705", + "name": { + "$id": "2706", + "kind": "string", + "type": { + "$ref": "876" + }, + "value": "eogiykmdmeikswxmigjws" + }, + "lun": { + "$id": "2707", + "kind": "number", + "type": { + "$ref": "880" + }, + "value": 14 + }, + "caching": { + "$id": "2708", + "kind": "string", + "type": { + "$ref": "162" + }, + "value": "None" + }, + "writeAcceleratorEnabled": { + "$id": "2709", + "kind": "boolean", + "type": { + "$ref": "887" + }, + "value": true + }, + "createOption": { + "$id": "2710", + "kind": "string", + "type": { + "$ref": "170" + }, + "value": "FromImage" + }, + "diskSizeGB": { + "$id": "2711", + "kind": "number", + "type": { + "$ref": "894" + }, + "value": 6 + }, + "managedDisk": { + "$id": "2712", + "kind": "model", + "type": { + "$ref": "842" + }, + "value": { + "$id": "2713", + "storageAccountType": { + "$id": "2714", + "kind": "string", + "type": { + "$ref": "200" + }, + "value": "Standard_LRS" + }, + "diskEncryptionSet": { + "$id": "2715", + "kind": "model", + "type": { + "$ref": "847" + }, + "value": { + "$id": "2716", + "id": { + "$id": "2717", + "kind": "string", + "type": { + "$ref": "849" + }, + "value": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskEncryptionSets/{diskEncryptionSetName}" + } + } + }, + "securityProfile": { + "$id": "2718", + "kind": "model", + "type": { + "$ref": "856" + }, + "value": { + "$id": "2719", + "securityEncryptionType": { + "$id": "2720", + "kind": "string", + "type": { + "$ref": "216" + }, + "value": "VMGuestStateOnly" + }, + "diskEncryptionSet": { + "$id": "2721", + "kind": "model", + "type": { + "$ref": "847" + }, + "value": { + "$id": "2722", + "id": { + "$id": "2723", + "kind": "string", + "type": { + "$ref": "849" + }, + "value": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskEncryptionSets/{diskEncryptionSetName}" + } + } + } + } + } + } + }, + "diskIOPSReadWrite": { + "$id": "2724", + "kind": "number", + "type": { + "$ref": "901" + }, + "value": 27 + }, + "diskMBpsReadWrite": { + "$id": "2725", + "kind": "number", + "type": { + "$ref": "905" + }, + "value": 2 + }, + "deleteOption": { + "$id": "2726", + "kind": "string", + "type": { + "$ref": "224" + }, + "value": "Delete" + } + } + } + ] + } + } + }, + "networkProfile": { + "$id": "2727", + "kind": "model", + "type": { + "$ref": "919" + }, + "value": { + "$id": "2728", + "healthProbe": { + "$id": "2729", + "kind": "model", + "type": { + "$ref": "921" + }, + "value": { + "$id": "2730", + "id": { + "$id": "2731", + "kind": "string", + "type": { + "$ref": "923" + }, + "value": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/probes/{probeName}" + } + } + }, + "networkInterfaceConfigurations": { + "$id": "2732", + "kind": "array", + "type": { + "$ref": "930" + }, + "value": [ + { + "$id": "2733", + "kind": "model", + "type": { + "$ref": "931" + }, + "value": { + "$id": "2734", + "name": { + "$id": "2735", + "kind": "string", + "type": { + "$ref": "933" + }, + "value": "i" + }, + "properties": { + "$id": "2736", + "kind": "model", + "type": { + "$ref": "937" + }, + "value": { + "$id": "2737", + "primary": { + "$id": "2738", + "kind": "boolean", + "type": { + "$ref": "939" + }, + "value": true + }, + "enableAcceleratedNetworking": { + "$id": "2739", + "kind": "boolean", + "type": { + "$ref": "943" + }, + "value": true + }, + "disableTcpStateTracking": { + "$id": "2740", + "kind": "boolean", + "type": { + "$ref": "947" + }, + "value": true + }, + "enableFpga": { + "$id": "2741", + "kind": "boolean", + "type": { + "$ref": "951" + }, + "value": true + }, + "networkSecurityGroup": { + "$id": "2742", + "kind": "model", + "type": { + "$ref": "723" + }, + "value": { + "$id": "2743", + "id": { + "$id": "2744", + "kind": "string", + "type": { + "$ref": "725" + }, + "value": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}" + } + } + }, + "dnsSettings": { + "$id": "2745", + "kind": "model", + "type": { + "$ref": "958" + }, + "value": { + "$id": "2746", + "dnsServers": { + "$id": "2747", + "kind": "array", + "type": { + "$ref": "960" + }, + "value": [ + { + "$id": "2748", + "kind": "string", + "type": { + "$ref": "961" + }, + "value": "nxmmfolhclsesu" + } + ] + } + } + }, + "ipConfigurations": { + "$id": "2749", + "kind": "array", + "type": { + "$ref": "967" + }, + "value": [ + { + "$id": "2750", + "kind": "model", + "type": { + "$ref": "968" + }, + "value": { + "$id": "2751", + "name": { + "$id": "2752", + "kind": "string", + "type": { + "$ref": "970" + }, + "value": "oezqhkidfhyywlfzwuotilrpbqnjg" + }, + "properties": { + "$id": "2753", + "kind": "model", + "type": { + "$ref": "974" + }, + "value": { + "$id": "2754", + "subnet": { + "$id": "2755", + "kind": "model", + "type": { + "$ref": "921" + }, + "value": { + "$id": "2756", + "id": { + "$id": "2757", + "kind": "string", + "type": { + "$ref": "923" + }, + "value": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}" + } + } + }, + "primary": { + "$id": "2758", + "kind": "boolean", + "type": { + "$ref": "979" + }, + "value": true + }, + "publicIPAddressConfiguration": { + "$id": "2759", + "kind": "model", + "type": { + "$ref": "983" + }, + "value": { + "$id": "2760", + "name": { + "$id": "2761", + "kind": "string", + "type": { + "$ref": "985" + }, + "value": "fvpqf" + }, + "properties": { + "$id": "2762", + "kind": "model", + "type": { + "$ref": "989" + }, + "value": { + "$id": "2763", + "idleTimeoutInMinutes": { + "$id": "2764", + "kind": "number", + "type": { + "$ref": "991" + }, + "value": 9 + }, + "dnsSettings": { + "$id": "2765", + "kind": "model", + "type": { + "$ref": "995" + }, + "value": { + "$id": "2766", + "domainNameLabel": { + "$id": "2767", + "kind": "string", + "type": { + "$ref": "997" + }, + "value": "ukrddzvmorpmfsczjwtbvp" + }, + "domainNameLabelScope": { + "$id": "2768", + "kind": "string", + "type": { + "$ref": "236" + }, + "value": "TenantReuse" + } + } + }, + "ipTags": { + "$id": "2769", + "kind": "array", + "type": { + "$ref": "1006" + }, + "value": [ + { + "$id": "2770", + "kind": "model", + "type": { + "$ref": "1007" + }, + "value": { + "$id": "2771", + "ipTagType": { + "$id": "2772", + "kind": "string", + "type": { + "$ref": "1009" + }, + "value": "sddgsoemnzgqizale" + }, + "tag": { + "$id": "2773", + "kind": "string", + "type": { + "$ref": "1013" + }, + "value": "wufmhrjsakbiaetyara" + } + } + } + ] + }, + "publicIPPrefix": { + "$id": "2774", + "kind": "model", + "type": { + "$ref": "723" + }, + "value": { + "$id": "2775", + "id": { + "$id": "2776", + "kind": "string", + "type": { + "$ref": "725" + }, + "value": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPPrefixes/{publicIPPrefixName}" + } + } + }, + "publicIPAddressVersion": { + "$id": "2777", + "kind": "string", + "type": { + "$ref": "246" + }, + "value": "IPv4" + }, + "deleteOption": { + "$id": "2778", + "kind": "string", + "type": { + "$ref": "252" + }, + "value": "Delete" + } + } + }, + "sku": { + "$id": "2779", + "kind": "model", + "type": { + "$ref": "1030" + }, + "value": { + "$id": "2780", + "name": { + "$id": "2781", + "kind": "string", + "type": { + "$ref": "258" + }, + "value": "Basic" + }, + "tier": { + "$id": "2782", + "kind": "string", + "type": { + "$ref": "264" + }, + "value": "Regional" + } + } + } + } + }, + "privateIPAddressVersion": { + "$id": "2783", + "kind": "string", + "type": { + "$ref": "246" + }, + "value": "IPv4" + }, + "applicationGatewayBackendAddressPools": { + "$id": "2784", + "kind": "array", + "type": { + "$ref": "1045" + }, + "value": [ + { + "$id": "2785", + "kind": "model", + "type": { + "$ref": "723" + }, + "value": { + "$id": "2786", + "id": { + "$id": "2787", + "kind": "string", + "type": { + "$ref": "725" + }, + "value": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}/backendAddressPools/{backendAddressPoolName}" + } + } + } + ] + }, + "applicationSecurityGroups": { + "$id": "2788", + "kind": "array", + "type": { + "$ref": "1049" + }, + "value": [ + { + "$id": "2789", + "kind": "model", + "type": { + "$ref": "723" + }, + "value": { + "$id": "2790", + "id": { + "$id": "2791", + "kind": "string", + "type": { + "$ref": "725" + }, + "value": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationSecurityGroups/{applicationSecurityGroupName}" + } + } + } + ] + }, + "loadBalancerBackendAddressPools": { + "$id": "2792", + "kind": "array", + "type": { + "$ref": "1053" + }, + "value": [ + { + "$id": "2793", + "kind": "model", + "type": { + "$ref": "723" + }, + "value": { + "$id": "2794", + "id": { + "$id": "2795", + "kind": "string", + "type": { + "$ref": "725" + }, + "value": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/backendAddressPools/{backendAddressPoolName}" + } + } + } + ] + }, + "loadBalancerInboundNatPools": { + "$id": "2796", + "kind": "array", + "type": { + "$ref": "1057" + }, + "value": [ + { + "$id": "2797", + "kind": "model", + "type": { + "$ref": "723" + }, + "value": { + "$id": "2798", + "id": { + "$id": "2799", + "kind": "string", + "type": { + "$ref": "725" + }, + "value": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/inboundNatPools/{inboundNatPoolName}" + } + } + } + ] + } + } + } + } + } + ] + }, + "enableIPForwarding": { + "$id": "2800", + "kind": "boolean", + "type": { + "$ref": "1065" + }, + "value": true + }, + "deleteOption": { + "$id": "2801", + "kind": "string", + "type": { + "$ref": "252" + }, + "value": "Delete" + }, + "auxiliaryMode": { + "$id": "2802", + "kind": "string", + "type": { + "$ref": "270" + }, + "value": "None" + }, + "auxiliarySku": { + "$id": "2803", + "kind": "string", + "type": { + "$ref": "278" + }, + "value": "None" + } + } + } + } + } + ] + }, + "networkApiVersion": { + "$id": "2804", + "kind": "string", + "type": { + "$ref": "290" + }, + "value": "2020-11-01" + } + } + }, + "securityProfile": { + "$id": "2805", + "kind": "model", + "type": { + "$ref": "1087" + }, + "value": { + "$id": "2806", + "uefiSettings": { + "$id": "2807", + "kind": "model", + "type": { + "$ref": "1089" + }, + "value": { + "$id": "2808", + "secureBootEnabled": { + "$id": "2809", + "kind": "boolean", + "type": { + "$ref": "1091" + }, + "value": true + }, + "vTpmEnabled": { + "$id": "2810", + "kind": "boolean", + "type": { + "$ref": "1095" + }, + "value": true + } + } + }, + "encryptionAtHost": { + "$id": "2811", + "kind": "boolean", + "type": { + "$ref": "1101" + }, + "value": true + }, + "securityType": { + "$id": "2812", + "kind": "string", + "type": { + "$ref": "294" + }, + "value": "TrustedLaunch" + }, + "encryptionIdentity": { + "$id": "2813", + "kind": "model", + "type": { + "$ref": "1108" + }, + "value": { + "$id": "2814", + "userAssignedIdentityResourceId": { + "$id": "2815", + "kind": "string", + "type": { + "$ref": "1110" + }, + "value": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{userAssignedIdentityName}" + } + } + }, + "proxyAgentSettings": { + "$id": "2816", + "kind": "model", + "type": { + "$ref": "1117" + }, + "value": { + "$id": "2817", + "enabled": { + "$id": "2818", + "kind": "boolean", + "type": { + "$ref": "1119" + }, + "value": true + }, + "mode": { + "$id": "2819", + "kind": "string", + "type": { + "$ref": "300" + }, + "value": "Audit" + }, + "keyIncarnationId": { + "$id": "2820", + "kind": "number", + "type": { + "$ref": "1126" + }, + "value": 20 + } + } + } + } + }, + "diagnosticsProfile": { + "$id": "2821", + "kind": "model", + "type": { + "$ref": "1134" + }, + "value": { + "$id": "2822", + "bootDiagnostics": { + "$id": "2823", + "kind": "model", + "type": { + "$ref": "1136" + }, + "value": { + "$id": "2824", + "enabled": { + "$id": "2825", + "kind": "boolean", + "type": { + "$ref": "1138" + }, + "value": true + }, + "storageUri": { + "$id": "2826", + "kind": "string", + "type": { + "$ref": "1142" + }, + "value": "http://myStorageAccountName.blob.core.windows.net" + } + } + } + } + }, + "extensionProfile": { + "$id": "2827", + "kind": "model", + "type": { + "$ref": "1150" + }, + "value": { + "$id": "2828", + "extensions": { + "$id": "2829", + "kind": "array", + "type": { + "$ref": "1152" + }, + "value": [ + { + "$id": "2830", + "kind": "model", + "type": { + "$ref": "1153" + }, + "value": { + "$id": "2831", + "name": { + "$id": "2832", + "kind": "string", + "type": { + "$ref": "1160" + }, + "value": "bndxuxx" + }, + "type": { + "$id": "2833", + "kind": "string", + "type": { + "$ref": "1164" + }, + "value": "cmeam" + }, + "properties": { + "$id": "2834", + "kind": "model", + "type": { + "$ref": "1168" + }, + "value": { + "$id": "2835", + "forceUpdateTag": { + "$id": "2836", + "kind": "string", + "type": { + "$ref": "1170" + }, + "value": "yhgxw" + }, + "publisher": { + "$id": "2837", + "kind": "string", + "type": { + "$ref": "1174" + }, + "value": "kpxtirxjfprhs" + }, + "type": { + "$id": "2838", + "kind": "string", + "type": { + "$ref": "1178" + }, + "value": "pgjilctjjwaa" + }, + "typeHandlerVersion": { + "$id": "2839", + "kind": "string", + "type": { + "$ref": "1182" + }, + "value": "zevivcoilxmbwlrihhhibq" + }, + "autoUpgradeMinorVersion": { + "$id": "2840", + "kind": "boolean", + "type": { + "$ref": "1186" + }, + "value": true + }, + "enableAutomaticUpgrade": { + "$id": "2841", + "kind": "boolean", + "type": { + "$ref": "1190" + }, + "value": true + }, + "settings": { + "$id": "2842", + "kind": "dict", + "type": { + "$ref": "1194" + }, + "value": { + "$id": "2843" + } + }, + "provisioningState": { + "$id": "2844", + "kind": "string", + "type": { + "$ref": "1206" + }, + "value": "Succeeded" + }, + "provisionAfterExtensions": { + "$id": "2845", + "kind": "array", + "type": { + "$ref": "1210" + }, + "value": [ + { + "$id": "2846", + "kind": "string", + "type": { + "$ref": "1211" + }, + "value": "nftzosroolbcwmpupujzqwqe" + } + ] + }, + "suppressFailures": { + "$id": "2847", + "kind": "boolean", + "type": { + "$ref": "1215" + }, + "value": true + }, + "protectedSettingsFromKeyVault": { + "$id": "2848", + "kind": "model", + "type": { + "$ref": "1219" + }, + "value": { + "$id": "2849", + "secretUrl": { + "$id": "2850", + "kind": "string", + "type": { + "$ref": "1221" + }, + "value": "https://myVaultName.vault.azure.net/secrets/secret/mySecretName" + }, + "sourceVault": { + "$id": "2851", + "kind": "model", + "type": { + "$ref": "723" + }, + "value": { + "$id": "2852", + "id": { + "$id": "2853", + "kind": "string", + "type": { + "$ref": "725" + }, + "value": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault/vaults/{vaultName}" + } + } + } + } + } + } + }, + "id": { + "$id": "2854", + "kind": "string", + "type": { + "$ref": "1155" + }, + "value": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/extensions/{extensionName}" + } + } + } + ] + }, + "extensionsTimeBudget": { + "$id": "2855", + "kind": "string", + "type": { + "$ref": "1234" + }, + "value": "mbhjahtdygwgyszdwjtvlvtgchdwil" + } + } + }, + "licenseType": { + "$id": "2856", + "kind": "string", + "type": { + "$ref": "1240" + }, + "value": "v" + }, + "scheduledEventsProfile": { + "$id": "2857", + "kind": "model", + "type": { + "$ref": "1244" + }, + "value": { + "$id": "2858", + "terminateNotificationProfile": { + "$id": "2859", + "kind": "model", + "type": { + "$ref": "1246" + }, + "value": { + "$id": "2860", + "notBeforeTimeout": { + "$id": "2861", + "kind": "string", + "type": { + "$ref": "1248" + }, + "value": "iljppmmw" + }, + "enable": { + "$id": "2862", + "kind": "boolean", + "type": { + "$ref": "1252" + }, + "value": true + } + } + }, + "osImageNotificationProfile": { + "$id": "2863", + "kind": "model", + "type": { + "$ref": "1258" + }, + "value": { + "$id": "2864", + "notBeforeTimeout": { + "$id": "2865", + "kind": "string", + "type": { + "$ref": "1260" + }, + "value": "olbpadmevekyczfokodtfprxti" + }, + "enable": { + "$id": "2866", + "kind": "boolean", + "type": { + "$ref": "1264" + }, + "value": true + } + } + } + } + }, + "userData": { + "$id": "2867", + "kind": "string", + "type": { + "$ref": "1272" + }, + "value": "s" + }, + "capacityReservation": { + "$id": "2868", + "kind": "model", + "type": { + "$ref": "1276" + }, + "value": { + "$id": "2869", + "capacityReservationGroup": { + "$id": "2870", + "kind": "model", + "type": { + "$ref": "723" + }, + "value": { + "$id": "2871", + "id": { + "$id": "2872", + "kind": "string", + "type": { + "$ref": "725" + }, + "value": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/capacityReservationGroups/{capacityReservationGroupName}" + } + } + } + } + }, + "applicationProfile": { + "$id": "2873", + "kind": "model", + "type": { + "$ref": "1283" + }, + "value": { + "$id": "2874", + "galleryApplications": { + "$id": "2875", + "kind": "array", + "type": { + "$ref": "1285" + }, + "value": [ + { + "$id": "2876", + "kind": "model", + "type": { + "$ref": "1286" + }, + "value": { + "$id": "2877", + "tags": { + "$id": "2878", + "kind": "string", + "type": { + "$ref": "1288" + }, + "value": "eyrqjbib" + }, + "order": { + "$id": "2879", + "kind": "number", + "type": { + "$ref": "1292" + }, + "value": 5 + }, + "packageReferenceId": { + "$id": "2880", + "kind": "string", + "type": { + "$ref": "1296" + }, + "value": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/applications/{applicationName}/versions/{versionName}" + }, + "treatFailureAsDeploymentFailure": { + "$id": "2881", + "kind": "boolean", + "type": { + "$ref": "1305" + }, + "value": true + }, + "enableAutomaticUpgrade": { + "$id": "2882", + "kind": "boolean", + "type": { + "$ref": "1309" + }, + "value": true + } + } + } + ] + } + } + }, + "hardwareProfile": { + "$id": "2883", + "kind": "model", + "type": { + "$ref": "1317" + }, + "value": { + "$id": "2884", + "vmSizeProperties": { + "$id": "2885", + "kind": "model", + "type": { + "$ref": "1319" + }, + "value": { + "$id": "2886", + "vCPUsAvailable": { + "$id": "2887", + "kind": "number", + "type": { + "$ref": "1321" + }, + "value": 16 + }, + "vCPUsPerCore": { + "$id": "2888", + "kind": "number", + "type": { + "$ref": "1325" + }, + "value": 23 + } + } + } + } + }, + "serviceArtifactReference": { + "$id": "2889", + "kind": "model", + "type": { + "$ref": "1333" + }, + "value": { + "$id": "2890", + "id": { + "$id": "2891", + "kind": "string", + "type": { + "$ref": "1335" + }, + "value": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/serviceArtifacts/{serviceArtifactsName}/vmArtifactsProfiles/{vmArtifactsProfileName}" + } + } + }, + "securityPostureReference": { + "$id": "2892", + "kind": "model", + "type": { + "$ref": "1342" + }, + "value": { + "$id": "2893", + "id": { + "$id": "2894", + "kind": "string", + "type": { + "$ref": "1344" + }, + "value": "/CommunityGalleries/{communityGalleryName}/securityPostures/{securityPostureName}/versions/{major.minor.patch}|{major.*}|latest" + }, + "excludeExtensions": { + "$id": "2895", + "kind": "array", + "type": { + "$ref": "1348" + }, + "value": [ + { + "$id": "2896", + "kind": "string", + "type": { + "$ref": "1349" + }, + "value": "{securityPostureVMExtensionName}" + } + ] + }, + "isOverridable": { + "$id": "2897", + "kind": "boolean", + "type": { + "$ref": "1353" + }, + "value": true + } + } + }, + "timeCreated": { + "$id": "2898", + "kind": "string", + "type": { + "$ref": "1359" + }, + "value": "2024-04-29T21:51:44.043Z" + } + } + }, + "computeApiVersion": { + "$id": "2899", + "kind": "string", + "type": { + "$ref": "1375" + }, + "value": "2023-07-01" + }, + "platformFaultDomainCount": { + "$id": "2900", + "kind": "number", + "type": { + "$ref": "1379" + }, + "value": 1 + } + } + }, + "timeCreated": { + "$id": "2901", + "kind": "string", + "type": { + "$ref": "1397" + }, + "value": "2024-07-10T00:16:34.8590555+00:00" + }, + "uniqueId": { + "$id": "2902", + "kind": "string", + "type": { + "$ref": "1402" + }, + "value": "a2f7fabd-bbc2-4a20-afe1-49fdb3885a28" + } + } + }, + "zones": { + "$id": "2903", + "kind": "array", + "type": { + "$ref": "1408" + }, + "value": [ + { + "$id": "2904", + "kind": "string", + "type": { + "$ref": "1409" + }, + "value": "zone1" + }, + { + "$id": "2905", + "kind": "string", + "type": { + "$ref": "1409" + }, + "value": "zone2" + } + ] + }, + "identity": { + "$id": "2906", + "kind": "model", + "type": { + "$ref": "1413" + }, + "value": { + "$id": "2907", + "principalId": { + "$id": "2908", + "kind": "string", + "type": { + "$ref": "1415" + }, + "value": "4d508e5b-374b-4382-9a1c-01fb8b6cb37c" + }, + "tenantId": { + "$id": "2909", + "kind": "string", + "type": { + "$ref": "1420" + }, + "value": "5d508e5b-374b-4382-9a1c-01fb8b6cb37c" + }, + "type": { + "$id": "2910", + "kind": "string", + "type": { + "$ref": "306" + }, + "value": "UserAssigned" + }, + "userAssignedIdentities": { + "$id": "2911", + "kind": "dict", + "type": { + "$ref": "1428" + }, + "value": { + "$id": "2912", + "key9851": { + "$id": "2913", + "kind": "model", + "type": { + "$ref": "1431" + }, + "value": { + "$id": "2914", + "principalId": { + "$id": "2915", + "kind": "string", + "type": { + "$ref": "1438" + }, + "value": "6d508e5b-374b-4382-9a1c-01fb8b6cb37c" + }, + "clientId": { + "$id": "2916", + "kind": "string", + "type": { + "$ref": "1433" + }, + "value": "7d508e5b-374b-4382-9a1c-01fb8b6cb37c" + } + } + } + } + } + } + }, + "plan": { + "$id": "2917", + "kind": "model", + "type": { + "$ref": "1447" + }, + "value": { + "$id": "2918", + "name": { + "$id": "2919", + "kind": "string", + "type": { + "$ref": "1449" + }, + "value": "jwgrcrnrtfoxn" + }, + "publisher": { + "$id": "2920", + "kind": "string", + "type": { + "$ref": "1453" + }, + "value": "iozjbiqqckqm" + }, + "product": { + "$id": "2921", + "kind": "string", + "type": { + "$ref": "1457" + }, + "value": "cgopbyvdyqikahwyxfpzwaqk" + }, + "promotionCode": { + "$id": "2922", + "kind": "string", + "type": { + "$ref": "1461" + }, + "value": "naglezezplcaruqogtxnuizslqnnbr" + }, + "version": { + "$id": "2923", + "kind": "string", + "type": { + "$ref": "1465" + }, + "value": "wa" + } + } + }, + "tags": { + "$id": "2924", + "kind": "dict", + "type": { + "$ref": "396" + }, + "value": { + "$id": "2925", + "key3518": { + "$id": "2926", + "kind": "string", + "type": { + "$ref": "398" + }, + "value": "luvrnuvsgdpbuofdskkcoqhfh" + } + } + }, + "location": { + "$id": "2927", + "kind": "string", + "type": { + "$ref": "402" + }, + "value": "westus" + }, + "id": { + "$id": "2928", + "kind": "string", + "type": { + "$ref": "354" + }, + "value": "/subscriptions/7B0CD4DB-3381-4013-9B31-FB6E6FD0FF1C/resourceGroups/rgazurefleet/providers/Microsoft.AzureFleet/fleets/testFleet" + }, + "name": { + "$id": "2929", + "kind": "string", + "type": { + "$ref": "359" + }, + "value": "testFleet" + }, + "type": { + "$id": "2930", + "kind": "string", + "type": { + "$ref": "363" + }, + "value": "Microsoft.AzureFleet/fleets" + }, + "systemData": { + "$id": "2931", + "kind": "model", + "type": { + "$ref": "368" + }, + "value": { + "$id": "2932", + "createdBy": { + "$id": "2933", + "kind": "string", + "type": { + "$ref": "370" + }, + "value": "rowegentrpoajsv" + }, + "createdByType": { + "$id": "2934", + "kind": "string", + "type": { + "$ref": "316" + }, + "value": "User" + }, + "createdAt": { + "$id": "2935", + "kind": "string", + "type": { + "$ref": "377" + }, + "value": "2024-04-29T21:51:44.043Z" + }, + "lastModifiedBy": { + "$id": "2936", + "kind": "string", + "type": { + "$ref": "382" + }, + "value": "edwuayhhaoepxzisfaqjhmrxjq" + }, + "lastModifiedByType": { + "$id": "2937", + "kind": "string", + "type": { + "$ref": "316" + }, + "value": "User" + }, + "lastModifiedAt": { + "$id": "2938", + "kind": "string", + "type": { + "$ref": "389" + }, + "value": "2024-04-29T21:51:44.043Z" + } + } + } + } + } + }, + { + "$id": "2939", + "response": { + "$ref": "2198" + }, + "statusCode": 201, + "bodyValue": { + "$id": "2940", + "kind": "model", + "type": { + "$ref": "350" + }, + "value": { + "$id": "2941", + "properties": { + "$id": "2942", + "kind": "model", + "type": { + "$ref": "406" + }, + "value": { + "$id": "2943", + "provisioningState": { + "$id": "2944", + "kind": "string", + "type": { + "$ref": "2" + }, + "value": "Creating" + }, + "spotPriorityProfile": { + "$id": "2945", + "kind": "model", + "type": { + "$ref": "411" + }, + "value": { + "$id": "2946", + "capacity": { + "$id": "2947", + "kind": "number", + "type": { + "$ref": "413" + }, + "value": 0 + }, + "minCapacity": { + "$id": "2948", + "kind": "number", + "type": { + "$ref": "417" + }, + "value": 0 + }, + "maxPricePerVM": { + "$id": "2949", + "kind": "number", + "type": { + "$ref": "421" + }, + "value": 0.00865 + }, + "evictionPolicy": { + "$id": "2950", + "kind": "string", + "type": { + "$ref": "18" + }, + "value": "Delete" + }, + "allocationStrategy": { + "$id": "2951", + "kind": "string", + "type": { + "$ref": "24" + }, + "value": "PriceCapacityOptimized" + }, + "maintain": { + "$id": "2952", + "kind": "boolean", + "type": { + "$ref": "431" + }, + "value": true + } + } + }, + "regularPriorityProfile": { + "$id": "2953", + "kind": "model", + "type": { + "$ref": "437" + }, + "value": { + "$id": "2954", + "capacity": { + "$id": "2955", + "kind": "number", + "type": { + "$ref": "439" + }, + "value": 20 + }, + "minCapacity": { + "$id": "2956", + "kind": "number", + "type": { + "$ref": "443" + }, + "value": 10 + }, + "allocationStrategy": { + "$id": "2957", + "kind": "string", + "type": { + "$ref": "32" + }, + "value": "LowestPrice" + } + } + }, + "vmSizesProfile": { + "$id": "2958", + "kind": "array", + "type": { + "$ref": "452" + }, + "value": [ + { + "$id": "2959", + "kind": "model", + "type": { + "$ref": "453" + }, + "value": { + "$id": "2960", + "name": { + "$id": "2961", + "kind": "string", + "type": { + "$ref": "455" + }, + "value": "Standard_d1_v2" + }, + "rank": { + "$id": "2962", + "kind": "number", + "type": { + "$ref": "459" + }, + "value": 19225 + } + } + } + ] + }, + "computeProfile": { + "$id": "2963", + "kind": "model", + "type": { + "$ref": "1370" + }, + "value": { + "$id": "2964", + "baseVirtualMachineProfile": { + "$id": "2965", + "kind": "model", + "type": { + "$ref": "565" + }, + "value": { + "$id": "2966", + "osProfile": { + "$id": "2967", + "kind": "model", + "type": { + "$ref": "567" + }, + "value": { + "$id": "2968", + "computerNamePrefix": { + "$id": "2969", + "kind": "string", + "type": { + "$ref": "569" + }, + "value": "o" + }, + "adminUsername": { + "$id": "2970", + "kind": "string", + "type": { + "$ref": "573" + }, + "value": "nrgzqciiaaxjrqldbmjbqkyhntp" + }, + "windowsConfiguration": { + "$id": "2971", + "kind": "model", + "type": { + "$ref": "585" + }, + "value": { + "$id": "2972", + "provisionVMAgent": { + "$id": "2973", + "kind": "boolean", + "type": { + "$ref": "587" + }, + "value": true + }, + "enableAutomaticUpdates": { + "$id": "2974", + "kind": "boolean", + "type": { + "$ref": "591" + }, + "value": true + }, + "timeZone": { + "$id": "2975", + "kind": "string", + "type": { + "$ref": "595" + }, + "value": "hlyjiqcfksgrpjrct" + }, + "additionalUnattendContent": { + "$id": "2976", + "kind": "array", + "type": { + "$ref": "599" + }, + "value": [ + { + "$id": "2977", + "kind": "model", + "type": { + "$ref": "600" + }, + "value": { + "$id": "2978", + "passName": { + "$id": "2979", + "kind": "string", + "type": { + "$ref": "602" + }, + "value": "OobeSystem" + }, + "componentName": { + "$id": "2980", + "kind": "string", + "type": { + "$ref": "606" + }, + "value": "Microsoft-Windows-Shell-Setup" + }, + "settingName": { + "$id": "2981", + "kind": "string", + "type": { + "$ref": "104" + }, + "value": "AutoLogon" + } + } + } + ] + }, + "patchSettings": { + "$id": "2982", + "kind": "model", + "type": { + "$ref": "619" + }, + "value": { + "$id": "2983", + "patchMode": { + "$id": "2984", + "kind": "string", + "type": { + "$ref": "110" + }, + "value": "Manual" + }, + "enableHotpatching": { + "$id": "2985", + "kind": "boolean", + "type": { + "$ref": "624" + }, + "value": true + }, + "assessmentMode": { + "$id": "2986", + "kind": "string", + "type": { + "$ref": "118" + }, + "value": "ImageDefault" + }, + "automaticByPlatformSettings": { + "$id": "2987", + "kind": "model", + "type": { + "$ref": "631" + }, + "value": { + "$id": "2988", + "rebootSetting": { + "$id": "2989", + "kind": "string", + "type": { + "$ref": "124" + }, + "value": "Unknown" + }, + "bypassPlatformSafetyChecksOnUserSchedule": { + "$id": "2990", + "kind": "boolean", + "type": { + "$ref": "636" + }, + "value": true + } + } + } + } + }, + "winRM": { + "$id": "2991", + "kind": "model", + "type": { + "$ref": "644" + }, + "value": { + "$id": "2992", + "listeners": { + "$id": "2993", + "kind": "array", + "type": { + "$ref": "646" + }, + "value": [ + { + "$id": "2994", + "kind": "model", + "type": { + "$ref": "647" + }, + "value": { + "$id": "2995", + "protocol": { + "$id": "2996", + "kind": "string", + "type": { + "$ref": "134" + }, + "value": "Https" + }, + "certificateUrl": { + "$id": "2997", + "kind": "string", + "type": { + "$ref": "652" + }, + "value": "https://myVaultName.vault.azure.net/secrets/myCertName" + } + } + } + ] + } + } + }, + "enableVMAgentPlatformUpdates": { + "$id": "2998", + "kind": "boolean", + "type": { + "$ref": "660" + }, + "value": true + } + } + }, + "linuxConfiguration": { + "$id": "2999", + "kind": "model", + "type": { + "$ref": "666" + }, + "value": { + "$id": "3000", + "disablePasswordAuthentication": { + "$id": "3001", + "kind": "boolean", + "type": { + "$ref": "668" + }, + "value": true + }, + "ssh": { + "$id": "3002", + "kind": "model", + "type": { + "$ref": "672" + }, + "value": { + "$id": "3003", + "publicKeys": { + "$id": "3004", + "kind": "array", + "type": { + "$ref": "674" + }, + "value": [ + { + "$id": "3005", + "kind": "model", + "type": { + "$ref": "675" + }, + "value": { + "$id": "3006", + "path": { + "$id": "3007", + "kind": "string", + "type": { + "$ref": "677" + }, + "value": "kmqz" + }, + "keyData": { + "$id": "3008", + "kind": "string", + "type": { + "$ref": "681" + }, + "value": "kivgsubusvpprwqaqpjcmhsv" + } + } + } + ] + } + } + }, + "provisionVMAgent": { + "$id": "3009", + "kind": "boolean", + "type": { + "$ref": "689" + }, + "value": true + }, + "patchSettings": { + "$id": "3010", + "kind": "model", + "type": { + "$ref": "693" + }, + "value": { + "$id": "3011", + "patchMode": { + "$id": "3012", + "kind": "string", + "type": { + "$ref": "140" + }, + "value": "ImageDefault" + }, + "assessmentMode": { + "$id": "3013", + "kind": "string", + "type": { + "$ref": "146" + }, + "value": "ImageDefault" + }, + "automaticByPlatformSettings": { + "$id": "3014", + "kind": "model", + "type": { + "$ref": "701" + }, + "value": { + "$id": "3015", + "rebootSetting": { + "$id": "3016", + "kind": "string", + "type": { + "$ref": "152" + }, + "value": "Unknown" + }, + "bypassPlatformSafetyChecksOnUserSchedule": { + "$id": "3017", + "kind": "boolean", + "type": { + "$ref": "706" + }, + "value": true + } + } + } + } + }, + "enableVMAgentPlatformUpdates": { + "$id": "3018", + "kind": "boolean", + "type": { + "$ref": "714" + }, + "value": true + } + } + }, + "secrets": { + "$id": "3019", + "kind": "array", + "type": { + "$ref": "720" + }, + "value": [ + { + "$id": "3020", + "kind": "model", + "type": { + "$ref": "721" + }, + "value": { + "$id": "3021", + "sourceVault": { + "$id": "3022", + "kind": "model", + "type": { + "$ref": "723" + }, + "value": { + "$id": "3023", + "id": { + "$id": "3024", + "kind": "string", + "type": { + "$ref": "725" + }, + "value": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault/vaults/{vaultName}" + } + } + }, + "vaultCertificates": { + "$id": "3025", + "kind": "array", + "type": { + "$ref": "732" + }, + "value": [ + { + "$id": "3026", + "kind": "model", + "type": { + "$ref": "733" + }, + "value": { + "$id": "3027", + "certificateUrl": { + "$id": "3028", + "kind": "string", + "type": { + "$ref": "735" + }, + "value": "https://myVaultName.vault.azure.net/secrets/myCertName" + }, + "certificateStore": { + "$id": "3029", + "kind": "string", + "type": { + "$ref": "739" + }, + "value": "nlxrwavpzhueffxsshlun" + } + } + } + ] + } + } + } + ] + }, + "allowExtensionOperations": { + "$id": "3030", + "kind": "boolean", + "type": { + "$ref": "747" + }, + "value": true + }, + "requireGuestProvisionSignal": { + "$id": "3031", + "kind": "boolean", + "type": { + "$ref": "751" + }, + "value": true + } + } + }, + "storageProfile": { + "$id": "3032", + "kind": "model", + "type": { + "$ref": "757" + }, + "value": { + "$id": "3033", + "imageReference": { + "$id": "3034", + "kind": "model", + "type": { + "$ref": "759" + }, + "value": { + "$id": "3035", + "publisher": { + "$id": "3036", + "kind": "string", + "type": { + "$ref": "766" + }, + "value": "mqxgwbiyjzmxavhbkd" + }, + "offer": { + "$id": "3037", + "kind": "string", + "type": { + "$ref": "770" + }, + "value": "isxgumkarlkomp" + }, + "sku": { + "$id": "3038", + "kind": "string", + "type": { + "$ref": "774" + }, + "value": "eojmppqcrnpmxirtp" + }, + "version": { + "$id": "3039", + "kind": "string", + "type": { + "$ref": "778" + }, + "value": "wvpcqefgtmqdgltiuz" + }, + "exactVersion": { + "$id": "3040", + "kind": "string", + "type": { + "$ref": "782" + }, + "value": "zjbntmiskjexlr" + }, + "sharedGalleryImageId": { + "$id": "3041", + "kind": "string", + "type": { + "$ref": "786" + }, + "value": "kmkgihoxwlawuuhcinfirktdwkmx" + }, + "communityGalleryImageId": { + "$id": "3042", + "kind": "string", + "type": { + "$ref": "790" + }, + "value": "vlqe" + }, + "id": { + "$id": "3043", + "kind": "string", + "type": { + "$ref": "761" + }, + "value": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/images/{imageName}/versions/{versionName}" + } + } + }, + "osDisk": { + "$id": "3044", + "kind": "model", + "type": { + "$ref": "796" + }, + "value": { + "$id": "3045", + "name": { + "$id": "3046", + "kind": "string", + "type": { + "$ref": "798" + }, + "value": "wfttw" + }, + "caching": { + "$id": "3047", + "kind": "string", + "type": { + "$ref": "162" + }, + "value": "None" + }, + "writeAcceleratorEnabled": { + "$id": "3048", + "kind": "boolean", + "type": { + "$ref": "805" + }, + "value": true + }, + "createOption": { + "$id": "3049", + "kind": "string", + "type": { + "$ref": "170" + }, + "value": "FromImage" + }, + "diffDiskSettings": { + "$id": "3050", + "kind": "model", + "type": { + "$ref": "812" + }, + "value": { + "$id": "3051", + "option": { + "$id": "3052", + "kind": "string", + "type": { + "$ref": "182" + }, + "value": "Local" + }, + "placement": { + "$id": "3053", + "kind": "string", + "type": { + "$ref": "186" + }, + "value": "CacheDisk" + } + } + }, + "diskSizeGB": { + "$id": "3054", + "kind": "number", + "type": { + "$ref": "822" + }, + "value": 14 + }, + "osType": { + "$id": "3055", + "kind": "string", + "type": { + "$ref": "194" + }, + "value": "Windows" + }, + "image": { + "$id": "3056", + "kind": "model", + "type": { + "$ref": "829" + }, + "value": { + "$id": "3057", + "uri": { + "$id": "3058", + "kind": "string", + "type": { + "$ref": "831" + }, + "value": "https://myStorageAccountName.blob.core.windows.net/myContainerName/myVhdName.vhd" + } + } + }, + "vhdContainers": { + "$id": "3059", + "kind": "array", + "type": { + "$ref": "837" + }, + "value": [ + { + "$id": "3060", + "kind": "string", + "type": { + "$ref": "838" + }, + "value": "tkzcwddtinkfpnfklatw" + } + ] + }, + "managedDisk": { + "$id": "3061", + "kind": "model", + "type": { + "$ref": "842" + }, + "value": { + "$id": "3062", + "storageAccountType": { + "$id": "3063", + "kind": "string", + "type": { + "$ref": "200" + }, + "value": "Standard_LRS" + }, + "diskEncryptionSet": { + "$id": "3064", + "kind": "model", + "type": { + "$ref": "847" + }, + "value": { + "$id": "3065", + "id": { + "$id": "3066", + "kind": "string", + "type": { + "$ref": "849" + }, + "value": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskEncryptionSets/{diskEncryptionSetName}" + } + } + }, + "securityProfile": { + "$id": "3067", + "kind": "model", + "type": { + "$ref": "856" + }, + "value": { + "$id": "3068", + "securityEncryptionType": { + "$id": "3069", + "kind": "string", + "type": { + "$ref": "216" + }, + "value": "VMGuestStateOnly" + }, + "diskEncryptionSet": { + "$id": "3070", + "kind": "model", + "type": { + "$ref": "847" + }, + "value": { + "$id": "3071", + "id": { + "$id": "3072", + "kind": "string", + "type": { + "$ref": "849" + }, + "value": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskEncryptionSets/{diskEncryptionSetName}" + } + } + } + } + } + } + }, + "deleteOption": { + "$id": "3073", + "kind": "string", + "type": { + "$ref": "224" + }, + "value": "Delete" + } + } + }, + "dataDisks": { + "$id": "3074", + "kind": "array", + "type": { + "$ref": "873" + }, + "value": [ + { + "$id": "3075", + "kind": "model", + "type": { + "$ref": "874" + }, + "value": { + "$id": "3076", + "name": { + "$id": "3077", + "kind": "string", + "type": { + "$ref": "876" + }, + "value": "eogiykmdmeikswxmigjws" + }, + "lun": { + "$id": "3078", + "kind": "number", + "type": { + "$ref": "880" + }, + "value": 14 + }, + "caching": { + "$id": "3079", + "kind": "string", + "type": { + "$ref": "162" + }, + "value": "None" + }, + "writeAcceleratorEnabled": { + "$id": "3080", + "kind": "boolean", + "type": { + "$ref": "887" + }, + "value": true + }, + "createOption": { + "$id": "3081", + "kind": "string", + "type": { + "$ref": "170" + }, + "value": "FromImage" + }, + "diskSizeGB": { + "$id": "3082", + "kind": "number", + "type": { + "$ref": "894" + }, + "value": 6 + }, + "managedDisk": { + "$id": "3083", + "kind": "model", + "type": { + "$ref": "842" + }, + "value": { + "$id": "3084", + "storageAccountType": { + "$id": "3085", + "kind": "string", + "type": { + "$ref": "200" + }, + "value": "Standard_LRS" + }, + "diskEncryptionSet": { + "$id": "3086", + "kind": "model", + "type": { + "$ref": "847" + }, + "value": { + "$id": "3087", + "id": { + "$id": "3088", + "kind": "string", + "type": { + "$ref": "849" + }, + "value": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskEncryptionSets/{diskEncryptionSetName}" + } + } + }, + "securityProfile": { + "$id": "3089", + "kind": "model", + "type": { + "$ref": "856" + }, + "value": { + "$id": "3090", + "securityEncryptionType": { + "$id": "3091", + "kind": "string", + "type": { + "$ref": "216" + }, + "value": "VMGuestStateOnly" + }, + "diskEncryptionSet": { + "$id": "3092", + "kind": "model", + "type": { + "$ref": "847" + }, + "value": { + "$id": "3093", + "id": { + "$id": "3094", + "kind": "string", + "type": { + "$ref": "849" + }, + "value": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskEncryptionSets/{diskEncryptionSetName}" + } + } + } + } + } + } + }, + "diskIOPSReadWrite": { + "$id": "3095", + "kind": "number", + "type": { + "$ref": "901" + }, + "value": 27 + }, + "diskMBpsReadWrite": { + "$id": "3096", + "kind": "number", + "type": { + "$ref": "905" + }, + "value": 2 + }, + "deleteOption": { + "$id": "3097", + "kind": "string", + "type": { + "$ref": "224" + }, + "value": "Delete" + } + } + } + ] + } + } + }, + "networkProfile": { + "$id": "3098", + "kind": "model", + "type": { + "$ref": "919" + }, + "value": { + "$id": "3099", + "healthProbe": { + "$id": "3100", + "kind": "model", + "type": { + "$ref": "921" + }, + "value": { + "$id": "3101", + "id": { + "$id": "3102", + "kind": "string", + "type": { + "$ref": "923" + }, + "value": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/probes/{probeName}" + } + } + }, + "networkInterfaceConfigurations": { + "$id": "3103", + "kind": "array", + "type": { + "$ref": "930" + }, + "value": [ + { + "$id": "3104", + "kind": "model", + "type": { + "$ref": "931" + }, + "value": { + "$id": "3105", + "name": { + "$id": "3106", + "kind": "string", + "type": { + "$ref": "933" + }, + "value": "i" + }, + "properties": { + "$id": "3107", + "kind": "model", + "type": { + "$ref": "937" + }, + "value": { + "$id": "3108", + "primary": { + "$id": "3109", + "kind": "boolean", + "type": { + "$ref": "939" + }, + "value": true + }, + "enableAcceleratedNetworking": { + "$id": "3110", + "kind": "boolean", + "type": { + "$ref": "943" + }, + "value": true + }, + "disableTcpStateTracking": { + "$id": "3111", + "kind": "boolean", + "type": { + "$ref": "947" + }, + "value": true + }, + "enableFpga": { + "$id": "3112", + "kind": "boolean", + "type": { + "$ref": "951" + }, + "value": true + }, + "networkSecurityGroup": { + "$id": "3113", + "kind": "model", + "type": { + "$ref": "723" + }, + "value": { + "$id": "3114", + "id": { + "$id": "3115", + "kind": "string", + "type": { + "$ref": "725" + }, + "value": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}" + } + } + }, + "dnsSettings": { + "$id": "3116", + "kind": "model", + "type": { + "$ref": "958" + }, + "value": { + "$id": "3117", + "dnsServers": { + "$id": "3118", + "kind": "array", + "type": { + "$ref": "960" + }, + "value": [ + { + "$id": "3119", + "kind": "string", + "type": { + "$ref": "961" + }, + "value": "nxmmfolhclsesu" + } + ] + } + } + }, + "ipConfigurations": { + "$id": "3120", + "kind": "array", + "type": { + "$ref": "967" + }, + "value": [ + { + "$id": "3121", + "kind": "model", + "type": { + "$ref": "968" + }, + "value": { + "$id": "3122", + "name": { + "$id": "3123", + "kind": "string", + "type": { + "$ref": "970" + }, + "value": "oezqhkidfhyywlfzwuotilrpbqnjg" + }, + "properties": { + "$id": "3124", + "kind": "model", + "type": { + "$ref": "974" + }, + "value": { + "$id": "3125", + "subnet": { + "$id": "3126", + "kind": "model", + "type": { + "$ref": "921" + }, + "value": { + "$id": "3127", + "id": { + "$id": "3128", + "kind": "string", + "type": { + "$ref": "923" + }, + "value": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}" + } + } + }, + "primary": { + "$id": "3129", + "kind": "boolean", + "type": { + "$ref": "979" + }, + "value": true + }, + "publicIPAddressConfiguration": { + "$id": "3130", + "kind": "model", + "type": { + "$ref": "983" + }, + "value": { + "$id": "3131", + "name": { + "$id": "3132", + "kind": "string", + "type": { + "$ref": "985" + }, + "value": "fvpqf" + }, + "properties": { + "$id": "3133", + "kind": "model", + "type": { + "$ref": "989" + }, + "value": { + "$id": "3134", + "idleTimeoutInMinutes": { + "$id": "3135", + "kind": "number", + "type": { + "$ref": "991" + }, + "value": 9 + }, + "dnsSettings": { + "$id": "3136", + "kind": "model", + "type": { + "$ref": "995" + }, + "value": { + "$id": "3137", + "domainNameLabel": { + "$id": "3138", + "kind": "string", + "type": { + "$ref": "997" + }, + "value": "ukrddzvmorpmfsczjwtbvp" + }, + "domainNameLabelScope": { + "$id": "3139", + "kind": "string", + "type": { + "$ref": "236" + }, + "value": "TenantReuse" + } + } + }, + "ipTags": { + "$id": "3140", + "kind": "array", + "type": { + "$ref": "1006" + }, + "value": [ + { + "$id": "3141", + "kind": "model", + "type": { + "$ref": "1007" + }, + "value": { + "$id": "3142", + "ipTagType": { + "$id": "3143", + "kind": "string", + "type": { + "$ref": "1009" + }, + "value": "sddgsoemnzgqizale" + }, + "tag": { + "$id": "3144", + "kind": "string", + "type": { + "$ref": "1013" + }, + "value": "wufmhrjsakbiaetyara" + } + } + } + ] + }, + "publicIPPrefix": { + "$id": "3145", + "kind": "model", + "type": { + "$ref": "723" + }, + "value": { + "$id": "3146", + "id": { + "$id": "3147", + "kind": "string", + "type": { + "$ref": "725" + }, + "value": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPPrefixes/{publicIPPrefixName}" + } + } + }, + "publicIPAddressVersion": { + "$id": "3148", + "kind": "string", + "type": { + "$ref": "246" + }, + "value": "IPv4" + }, + "deleteOption": { + "$id": "3149", + "kind": "string", + "type": { + "$ref": "252" + }, + "value": "Delete" + } + } + }, + "sku": { + "$id": "3150", + "kind": "model", + "type": { + "$ref": "1030" + }, + "value": { + "$id": "3151", + "name": { + "$id": "3152", + "kind": "string", + "type": { + "$ref": "258" + }, + "value": "Basic" + }, + "tier": { + "$id": "3153", + "kind": "string", + "type": { + "$ref": "264" + }, + "value": "Regional" + } + } + } + } + }, + "privateIPAddressVersion": { + "$id": "3154", + "kind": "string", + "type": { + "$ref": "246" + }, + "value": "IPv4" + }, + "applicationGatewayBackendAddressPools": { + "$id": "3155", + "kind": "array", + "type": { + "$ref": "1045" + }, + "value": [ + { + "$id": "3156", + "kind": "model", + "type": { + "$ref": "723" + }, + "value": { + "$id": "3157", + "id": { + "$id": "3158", + "kind": "string", + "type": { + "$ref": "725" + }, + "value": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}/backendAddressPools/{backendAddressPoolName}" + } + } + } + ] + }, + "applicationSecurityGroups": { + "$id": "3159", + "kind": "array", + "type": { + "$ref": "1049" + }, + "value": [ + { + "$id": "3160", + "kind": "model", + "type": { + "$ref": "723" + }, + "value": { + "$id": "3161", + "id": { + "$id": "3162", + "kind": "string", + "type": { + "$ref": "725" + }, + "value": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationSecurityGroups/{applicationSecurityGroupName}" + } + } + } + ] + }, + "loadBalancerBackendAddressPools": { + "$id": "3163", + "kind": "array", + "type": { + "$ref": "1053" + }, + "value": [ + { + "$id": "3164", + "kind": "model", + "type": { + "$ref": "723" + }, + "value": { + "$id": "3165", + "id": { + "$id": "3166", + "kind": "string", + "type": { + "$ref": "725" + }, + "value": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/backendAddressPools/{backendAddressPoolName}" + } + } + } + ] + }, + "loadBalancerInboundNatPools": { + "$id": "3167", + "kind": "array", + "type": { + "$ref": "1057" + }, + "value": [ + { + "$id": "3168", + "kind": "model", + "type": { + "$ref": "723" + }, + "value": { + "$id": "3169", + "id": { + "$id": "3170", + "kind": "string", + "type": { + "$ref": "725" + }, + "value": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/inboundNatPools/{inboundNatPoolName}" + } + } + } + ] + } + } + } + } + } + ] + }, + "enableIPForwarding": { + "$id": "3171", + "kind": "boolean", + "type": { + "$ref": "1065" + }, + "value": true + }, + "deleteOption": { + "$id": "3172", + "kind": "string", + "type": { + "$ref": "252" + }, + "value": "Delete" + }, + "auxiliaryMode": { + "$id": "3173", + "kind": "string", + "type": { + "$ref": "270" + }, + "value": "None" + }, + "auxiliarySku": { + "$id": "3174", + "kind": "string", + "type": { + "$ref": "278" + }, + "value": "None" + } + } + } + } + } + ] + }, + "networkApiVersion": { + "$id": "3175", + "kind": "string", + "type": { + "$ref": "290" + }, + "value": "2020-11-01" + } + } + }, + "securityProfile": { + "$id": "3176", + "kind": "model", + "type": { + "$ref": "1087" + }, + "value": { + "$id": "3177", + "uefiSettings": { + "$id": "3178", + "kind": "model", + "type": { + "$ref": "1089" + }, + "value": { + "$id": "3179", + "secureBootEnabled": { + "$id": "3180", + "kind": "boolean", + "type": { + "$ref": "1091" + }, + "value": true + }, + "vTpmEnabled": { + "$id": "3181", + "kind": "boolean", + "type": { + "$ref": "1095" + }, + "value": true + } + } + }, + "encryptionAtHost": { + "$id": "3182", + "kind": "boolean", + "type": { + "$ref": "1101" + }, + "value": true + }, + "securityType": { + "$id": "3183", + "kind": "string", + "type": { + "$ref": "294" + }, + "value": "TrustedLaunch" + }, + "encryptionIdentity": { + "$id": "3184", + "kind": "model", + "type": { + "$ref": "1108" + }, + "value": { + "$id": "3185", + "userAssignedIdentityResourceId": { + "$id": "3186", + "kind": "string", + "type": { + "$ref": "1110" + }, + "value": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{userAssignedIdentityName}" + } + } + }, + "proxyAgentSettings": { + "$id": "3187", + "kind": "model", + "type": { + "$ref": "1117" + }, + "value": { + "$id": "3188", + "enabled": { + "$id": "3189", + "kind": "boolean", + "type": { + "$ref": "1119" + }, + "value": true + }, + "mode": { + "$id": "3190", + "kind": "string", + "type": { + "$ref": "300" + }, + "value": "Audit" + }, + "keyIncarnationId": { + "$id": "3191", + "kind": "number", + "type": { + "$ref": "1126" + }, + "value": 20 + } + } + } + } + }, + "diagnosticsProfile": { + "$id": "3192", + "kind": "model", + "type": { + "$ref": "1134" + }, + "value": { + "$id": "3193", + "bootDiagnostics": { + "$id": "3194", + "kind": "model", + "type": { + "$ref": "1136" + }, + "value": { + "$id": "3195", + "enabled": { + "$id": "3196", + "kind": "boolean", + "type": { + "$ref": "1138" + }, + "value": true + }, + "storageUri": { + "$id": "3197", + "kind": "string", + "type": { + "$ref": "1142" + }, + "value": "http://myStorageAccountName.blob.core.windows.net" + } + } + } + } + }, + "extensionProfile": { + "$id": "3198", + "kind": "model", + "type": { + "$ref": "1150" + }, + "value": { + "$id": "3199", + "extensions": { + "$id": "3200", + "kind": "array", + "type": { + "$ref": "1152" + }, + "value": [ + { + "$id": "3201", + "kind": "model", + "type": { + "$ref": "1153" + }, + "value": { + "$id": "3202", + "name": { + "$id": "3203", + "kind": "string", + "type": { + "$ref": "1160" + }, + "value": "bndxuxx" + }, + "type": { + "$id": "3204", + "kind": "string", + "type": { + "$ref": "1164" + }, + "value": "cmeam" + }, + "properties": { + "$id": "3205", + "kind": "model", + "type": { + "$ref": "1168" + }, + "value": { + "$id": "3206", + "forceUpdateTag": { + "$id": "3207", + "kind": "string", + "type": { + "$ref": "1170" + }, + "value": "yhgxw" + }, + "publisher": { + "$id": "3208", + "kind": "string", + "type": { + "$ref": "1174" + }, + "value": "kpxtirxjfprhs" + }, + "type": { + "$id": "3209", + "kind": "string", + "type": { + "$ref": "1178" + }, + "value": "pgjilctjjwaa" + }, + "typeHandlerVersion": { + "$id": "3210", + "kind": "string", + "type": { + "$ref": "1182" + }, + "value": "zevivcoilxmbwlrihhhibq" + }, + "autoUpgradeMinorVersion": { + "$id": "3211", + "kind": "boolean", + "type": { + "$ref": "1186" + }, + "value": true + }, + "enableAutomaticUpgrade": { + "$id": "3212", + "kind": "boolean", + "type": { + "$ref": "1190" + }, + "value": true + }, + "settings": { + "$id": "3213", + "kind": "dict", + "type": { + "$ref": "1194" + }, + "value": { + "$id": "3214" + } + }, + "provisioningState": { + "$id": "3215", + "kind": "string", + "type": { + "$ref": "1206" + }, + "value": "Succeeded" + }, + "provisionAfterExtensions": { + "$id": "3216", + "kind": "array", + "type": { + "$ref": "1210" + }, + "value": [ + { + "$id": "3217", + "kind": "string", + "type": { + "$ref": "1211" + }, + "value": "nftzosroolbcwmpupujzqwqe" + } + ] + }, + "suppressFailures": { + "$id": "3218", + "kind": "boolean", + "type": { + "$ref": "1215" + }, + "value": true + }, + "protectedSettingsFromKeyVault": { + "$id": "3219", + "kind": "model", + "type": { + "$ref": "1219" + }, + "value": { + "$id": "3220", + "secretUrl": { + "$id": "3221", + "kind": "string", + "type": { + "$ref": "1221" + }, + "value": "https://myVaultName.vault.azure.net/secrets/secret/mySecretName" + }, + "sourceVault": { + "$id": "3222", + "kind": "model", + "type": { + "$ref": "723" + }, + "value": { + "$id": "3223", + "id": { + "$id": "3224", + "kind": "string", + "type": { + "$ref": "725" + }, + "value": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault/vaults/{vaultName}" + } + } + } + } + } + } + }, + "id": { + "$id": "3225", + "kind": "string", + "type": { + "$ref": "1155" + }, + "value": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/extensions/{extensionName}" + } + } + } + ] + }, + "extensionsTimeBudget": { + "$id": "3226", + "kind": "string", + "type": { + "$ref": "1234" + }, + "value": "mbhjahtdygwgyszdwjtvlvtgchdwil" + } + } + }, + "licenseType": { + "$id": "3227", + "kind": "string", + "type": { + "$ref": "1240" + }, + "value": "v" + }, + "scheduledEventsProfile": { + "$id": "3228", + "kind": "model", + "type": { + "$ref": "1244" + }, + "value": { + "$id": "3229", + "terminateNotificationProfile": { + "$id": "3230", + "kind": "model", + "type": { + "$ref": "1246" + }, + "value": { + "$id": "3231", + "notBeforeTimeout": { + "$id": "3232", + "kind": "string", + "type": { + "$ref": "1248" + }, + "value": "iljppmmw" + }, + "enable": { + "$id": "3233", + "kind": "boolean", + "type": { + "$ref": "1252" + }, + "value": true + } + } + }, + "osImageNotificationProfile": { + "$id": "3234", + "kind": "model", + "type": { + "$ref": "1258" + }, + "value": { + "$id": "3235", + "notBeforeTimeout": { + "$id": "3236", + "kind": "string", + "type": { + "$ref": "1260" + }, + "value": "olbpadmevekyczfokodtfprxti" + }, + "enable": { + "$id": "3237", + "kind": "boolean", + "type": { + "$ref": "1264" + }, + "value": true + } + } + } + } + }, + "userData": { + "$id": "3238", + "kind": "string", + "type": { + "$ref": "1272" + }, + "value": "s" + }, + "capacityReservation": { + "$id": "3239", + "kind": "model", + "type": { + "$ref": "1276" + }, + "value": { + "$id": "3240", + "capacityReservationGroup": { + "$id": "3241", + "kind": "model", + "type": { + "$ref": "723" + }, + "value": { + "$id": "3242", + "id": { + "$id": "3243", + "kind": "string", + "type": { + "$ref": "725" + }, + "value": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/capacityReservationGroups/{capacityReservationGroupName}" + } + } + } + } + }, + "applicationProfile": { + "$id": "3244", + "kind": "model", + "type": { + "$ref": "1283" + }, + "value": { + "$id": "3245", + "galleryApplications": { + "$id": "3246", + "kind": "array", + "type": { + "$ref": "1285" + }, + "value": [ + { + "$id": "3247", + "kind": "model", + "type": { + "$ref": "1286" + }, + "value": { + "$id": "3248", + "tags": { + "$id": "3249", + "kind": "string", + "type": { + "$ref": "1288" + }, + "value": "eyrqjbib" + }, + "order": { + "$id": "3250", + "kind": "number", + "type": { + "$ref": "1292" + }, + "value": 5 + }, + "packageReferenceId": { + "$id": "3251", + "kind": "string", + "type": { + "$ref": "1296" + }, + "value": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/applications/{applicationName}/versions/{versionName}" + }, + "treatFailureAsDeploymentFailure": { + "$id": "3252", + "kind": "boolean", + "type": { + "$ref": "1305" + }, + "value": true + }, + "enableAutomaticUpgrade": { + "$id": "3253", + "kind": "boolean", + "type": { + "$ref": "1309" + }, + "value": true + } + } + } + ] + } + } + }, + "hardwareProfile": { + "$id": "3254", + "kind": "model", + "type": { + "$ref": "1317" + }, + "value": { + "$id": "3255", + "vmSizeProperties": { + "$id": "3256", + "kind": "model", + "type": { + "$ref": "1319" + }, + "value": { + "$id": "3257", + "vCPUsAvailable": { + "$id": "3258", + "kind": "number", + "type": { + "$ref": "1321" + }, + "value": 16 + }, + "vCPUsPerCore": { + "$id": "3259", + "kind": "number", + "type": { + "$ref": "1325" + }, + "value": 23 + } + } + } + } + }, + "serviceArtifactReference": { + "$id": "3260", + "kind": "model", + "type": { + "$ref": "1333" + }, + "value": { + "$id": "3261", + "id": { + "$id": "3262", + "kind": "string", + "type": { + "$ref": "1335" + }, + "value": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/serviceArtifacts/{serviceArtifactsName}/vmArtifactsProfiles/{vmArtifactsProfileName}" + } + } + }, + "securityPostureReference": { + "$id": "3263", + "kind": "model", + "type": { + "$ref": "1342" + }, + "value": { + "$id": "3264", + "id": { + "$id": "3265", + "kind": "string", + "type": { + "$ref": "1344" + }, + "value": "/CommunityGalleries/{communityGalleryName}/securityPostures/{securityPostureName}/versions/{major.minor.patch}|{major.*}|latest" + }, + "excludeExtensions": { + "$id": "3266", + "kind": "array", + "type": { + "$ref": "1348" + }, + "value": [ + { + "$id": "3267", + "kind": "string", + "type": { + "$ref": "1349" + }, + "value": "{securityPostureVMExtensionName}" + } + ] + }, + "isOverridable": { + "$id": "3268", + "kind": "boolean", + "type": { + "$ref": "1353" + }, + "value": true + } + } + }, + "timeCreated": { + "$id": "3269", + "kind": "string", + "type": { + "$ref": "1359" + }, + "value": "2024-04-29T21:51:44.043Z" + } + } + }, + "computeApiVersion": { + "$id": "3270", + "kind": "string", + "type": { + "$ref": "1375" + }, + "value": "2023-07-01" + }, + "platformFaultDomainCount": { + "$id": "3271", + "kind": "number", + "type": { + "$ref": "1379" + }, + "value": 1 + } + } + }, + "timeCreated": { + "$id": "3272", + "kind": "string", + "type": { + "$ref": "1397" + }, + "value": "2024-07-10T00:16:34.8590555+00:00" + }, + "uniqueId": { + "$id": "3273", + "kind": "string", + "type": { + "$ref": "1402" + }, + "value": "a2f7fabd-bbc2-4a20-afe1-49fdb3885a28" + } + } + }, + "zones": { + "$id": "3274", + "kind": "array", + "type": { + "$ref": "1408" + }, + "value": [ + { + "$id": "3275", + "kind": "string", + "type": { + "$ref": "1409" + }, + "value": "zone1" + }, + { + "$id": "3276", + "kind": "string", + "type": { + "$ref": "1409" + }, + "value": "zone2" + } + ] + }, + "identity": { + "$id": "3277", + "kind": "model", + "type": { + "$ref": "1413" + }, + "value": { + "$id": "3278", + "principalId": { + "$id": "3279", + "kind": "string", + "type": { + "$ref": "1415" + }, + "value": "4d508e5b-374b-4382-9a1c-01fb8b6cb37c" + }, + "tenantId": { + "$id": "3280", + "kind": "string", + "type": { + "$ref": "1420" + }, + "value": "5d508e5b-374b-4382-9a1c-01fb8b6cb37c" + }, + "type": { + "$id": "3281", + "kind": "string", + "type": { + "$ref": "306" + }, + "value": "UserAssigned" + }, + "userAssignedIdentities": { + "$id": "3282", + "kind": "dict", + "type": { + "$ref": "1428" + }, + "value": { + "$id": "3283", + "key9851": { + "$id": "3284", + "kind": "model", + "type": { + "$ref": "1431" + }, + "value": { + "$id": "3285", + "principalId": { + "$id": "3286", + "kind": "string", + "type": { + "$ref": "1438" + }, + "value": "6d508e5b-374b-4382-9a1c-01fb8b6cb37c" + }, + "clientId": { + "$id": "3287", + "kind": "string", + "type": { + "$ref": "1433" + }, + "value": "7d508e5b-374b-4382-9a1c-01fb8b6cb37c" + } + } + } + } + } + } + }, + "tags": { + "$id": "3288", + "kind": "dict", + "type": { + "$ref": "396" + }, + "value": { + "$id": "3289", + "key3518": { + "$id": "3290", + "kind": "string", + "type": { + "$ref": "398" + }, + "value": "luvrnuvsgdpbuofdskkcoqhfh" + } + } + }, + "plan": { + "$id": "3291", + "kind": "model", + "type": { + "$ref": "1447" + }, + "value": { + "$id": "3292", + "name": { + "$id": "3293", + "kind": "string", + "type": { + "$ref": "1449" + }, + "value": "jwgrcrnrtfoxn" + }, + "publisher": { + "$id": "3294", + "kind": "string", + "type": { + "$ref": "1453" + }, + "value": "iozjbiqqckqm" + }, + "product": { + "$id": "3295", + "kind": "string", + "type": { + "$ref": "1457" + }, + "value": "cgopbyvdyqikahwyxfpzwaqk" + }, + "promotionCode": { + "$id": "3296", + "kind": "string", + "type": { + "$ref": "1461" + }, + "value": "naglezezplcaruqogtxnuizslqnnbr" + }, + "version": { + "$id": "3297", + "kind": "string", + "type": { + "$ref": "1465" + }, + "value": "wa" + } + } + }, + "location": { + "$id": "3298", + "kind": "string", + "type": { + "$ref": "402" + }, + "value": "westus" + }, + "id": { + "$id": "3299", + "kind": "string", + "type": { + "$ref": "354" + }, + "value": "/subscriptions/7B0CD4DB-3381-4013-9B31-FB6E6FD0FF1C/resourceGroups/rgazurefleet/providers/Microsoft.AzureFleet/fleets/testFleet" + }, + "name": { + "$id": "3300", + "kind": "string", + "type": { + "$ref": "359" + }, + "value": "testFleet" + }, + "type": { + "$id": "3301", + "kind": "string", + "type": { + "$ref": "363" + }, + "value": "Microsoft.AzureFleet/fleets" + }, + "systemData": { + "$id": "3302", + "kind": "model", + "type": { + "$ref": "368" + }, + "value": { + "$id": "3303", + "createdBy": { + "$id": "3304", + "kind": "string", + "type": { + "$ref": "370" + }, + "value": "rowegentrpoajsv" + }, + "createdByType": { + "$id": "3305", + "kind": "string", + "type": { + "$ref": "316" + }, + "value": "User" + }, + "createdAt": { + "$id": "3306", + "kind": "string", + "type": { + "$ref": "377" + }, + "value": "2024-04-29T21:51:44.043Z" + }, + "lastModifiedBy": { + "$id": "3307", + "kind": "string", + "type": { + "$ref": "382" + }, + "value": "edwuayhhaoepxzisfaqjhmrxjq" + }, + "lastModifiedByType": { + "$id": "3308", + "kind": "string", + "type": { + "$ref": "316" + }, + "value": "User" + }, + "lastModifiedAt": { + "$id": "3309", + "kind": "string", + "type": { + "$ref": "389" + }, + "value": "2024-04-29T21:51:44.043Z" + } + } + } + } + } + } + ] + }, + { + "$id": "3310", + "kind": "http", + "name": "Fleets_CreateOrUpdate_MinimumSet", + "description": "Fleets_CreateOrUpdate_MinimumSet", + "filePath": "2024-11-01/Fleets_CreateOrUpdate_MinimumSet.json", + "parameters": [ + { + "$id": "3311", + "parameter": { + "$ref": "2179" + }, + "value": { + "$id": "3312", + "kind": "string", + "type": { + "$ref": "2180" + }, + "value": "2024-11-01" + } + }, + { + "$id": "3313", + "parameter": { + "$ref": "2183" + }, + "value": { + "$id": "3314", + "kind": "string", + "type": { + "$ref": "2184" + }, + "value": "1DC2F28C-A625-4B0E-9748-9885A3C9E9EB" + } + }, + { + "$id": "3315", + "parameter": { + "$ref": "2186" + }, + "value": { + "$id": "3316", + "kind": "string", + "type": { + "$ref": "2187" + }, + "value": "rgazurefleet" + } + }, + { + "$id": "3317", + "parameter": { + "$ref": "2188" + }, + "value": { + "$id": "3318", + "kind": "string", + "type": { + "$ref": "2189" + }, + "value": "testFleet" + } + }, + { + "$id": "3319", + "parameter": { + "$ref": "2196" + }, + "value": { + "$id": "3320", + "kind": "model", + "type": { + "$ref": "350" + }, + "value": { + "$id": "3321", + "properties": { + "$id": "3322", + "kind": "model", + "type": { + "$ref": "406" + }, + "value": { + "$id": "3323", + "spotPriorityProfile": { + "$id": "3324", + "kind": "model", + "type": { + "$ref": "411" + }, + "value": { + "$id": "3325", + "capacity": { + "$id": "3326", + "kind": "number", + "type": { + "$ref": "413" + }, + "value": 2 + }, + "minCapacity": { + "$id": "3327", + "kind": "number", + "type": { + "$ref": "417" + }, + "value": 1 + }, + "evictionPolicy": { + "$id": "3328", + "kind": "string", + "type": { + "$ref": "18" + }, + "value": "Delete" + }, + "allocationStrategy": { + "$id": "3329", + "kind": "string", + "type": { + "$ref": "24" + }, + "value": "PriceCapacityOptimized" + }, + "maintain": { + "$id": "3330", + "kind": "boolean", + "type": { + "$ref": "431" + }, + "value": true + } + } + }, + "regularPriorityProfile": { + "$id": "3331", + "kind": "model", + "type": { + "$ref": "437" + }, + "value": { + "$id": "3332", + "capacity": { + "$id": "3333", + "kind": "number", + "type": { + "$ref": "439" + }, + "value": 2 + }, + "minCapacity": { + "$id": "3334", + "kind": "number", + "type": { + "$ref": "443" + }, + "value": 1 + }, + "allocationStrategy": { + "$id": "3335", + "kind": "string", + "type": { + "$ref": "32" + }, + "value": "LowestPrice" + } + } + }, + "vmSizesProfile": { + "$id": "3336", + "kind": "array", + "type": { + "$ref": "452" + }, + "value": [ + { + "$id": "3337", + "kind": "model", + "type": { + "$ref": "453" + }, + "value": { + "$id": "3338", + "name": { + "$id": "3339", + "kind": "string", + "type": { + "$ref": "455" + }, + "value": "Standard_D2s_v3" + } + } + }, + { + "$id": "3340", + "kind": "model", + "type": { + "$ref": "453" + }, + "value": { + "$id": "3341", + "name": { + "$id": "3342", + "kind": "string", + "type": { + "$ref": "455" + }, + "value": "Standard_D4s_v3" + } + } + }, + { + "$id": "3343", + "kind": "model", + "type": { + "$ref": "453" + }, + "value": { + "$id": "3344", + "name": { + "$id": "3345", + "kind": "string", + "type": { + "$ref": "455" + }, + "value": "Standard_E2s_v3" + } + } + } + ] + }, + "computeProfile": { + "$id": "3346", + "kind": "model", + "type": { + "$ref": "1370" + }, + "value": { + "$id": "3347", + "baseVirtualMachineProfile": { + "$id": "3348", + "kind": "model", + "type": { + "$ref": "565" + }, + "value": { + "$id": "3349", + "storageProfile": { + "$id": "3350", + "kind": "model", + "type": { + "$ref": "757" + }, + "value": { + "$id": "3351", + "imageReference": { + "$id": "3352", + "kind": "model", + "type": { + "$ref": "759" + }, + "value": { + "$id": "3353", + "publisher": { + "$id": "3354", + "kind": "string", + "type": { + "$ref": "766" + }, + "value": "canonical" + }, + "offer": { + "$id": "3355", + "kind": "string", + "type": { + "$ref": "770" + }, + "value": "0001-com-ubuntu-server-focal" + }, + "sku": { + "$id": "3356", + "kind": "string", + "type": { + "$ref": "774" + }, + "value": "20_04-lts-gen2" + }, + "version": { + "$id": "3357", + "kind": "string", + "type": { + "$ref": "778" + }, + "value": "latest" + } + } + }, + "osDisk": { + "$id": "3358", + "kind": "model", + "type": { + "$ref": "796" + }, + "value": { + "$id": "3359", + "caching": { + "$id": "3360", + "kind": "string", + "type": { + "$ref": "162" + }, + "value": "ReadWrite" + }, + "createOption": { + "$id": "3361", + "kind": "string", + "type": { + "$ref": "170" + }, + "value": "FromImage" + }, + "osType": { + "$id": "3362", + "kind": "string", + "type": { + "$ref": "194" + }, + "value": "Linux" + }, + "managedDisk": { + "$id": "3363", + "kind": "model", + "type": { + "$ref": "842" + }, + "value": { + "$id": "3364", + "storageAccountType": { + "$id": "3365", + "kind": "string", + "type": { + "$ref": "200" + }, + "value": "Standard_LRS" + } + } + } + } + } + } + }, + "osProfile": { + "$id": "3366", + "kind": "model", + "type": { + "$ref": "567" + }, + "value": { + "$id": "3367", + "computerNamePrefix": { + "$id": "3368", + "kind": "string", + "type": { + "$ref": "569" + }, + "value": "prefix" + }, + "adminUsername": { + "$id": "3369", + "kind": "string", + "type": { + "$ref": "573" + }, + "value": "azureuser" + }, + "adminPassword": { + "$id": "3370", + "kind": "string", + "type": { + "$ref": "577" + }, + "value": "TestPassword$0" + }, + "linuxConfiguration": { + "$id": "3371", + "kind": "model", + "type": { + "$ref": "666" + }, + "value": { + "$id": "3372", + "disablePasswordAuthentication": { + "$id": "3373", + "kind": "boolean", + "type": { + "$ref": "668" + }, + "value": false + } + } + } + } + }, + "networkProfile": { + "$id": "3374", + "kind": "model", + "type": { + "$ref": "919" + }, + "value": { + "$id": "3375", + "networkInterfaceConfigurations": { + "$id": "3376", + "kind": "array", + "type": { + "$ref": "930" + }, + "value": [ + { + "$id": "3377", + "kind": "model", + "type": { + "$ref": "931" + }, + "value": { + "$id": "3378", + "name": { + "$id": "3379", + "kind": "string", + "type": { + "$ref": "933" + }, + "value": "vmNameTest" + }, + "properties": { + "$id": "3380", + "kind": "model", + "type": { + "$ref": "937" + }, + "value": { + "$id": "3381", + "primary": { + "$id": "3382", + "kind": "boolean", + "type": { + "$ref": "939" + }, + "value": true + }, + "enableAcceleratedNetworking": { + "$id": "3383", + "kind": "boolean", + "type": { + "$ref": "943" + }, + "value": false + }, + "ipConfigurations": { + "$id": "3384", + "kind": "array", + "type": { + "$ref": "967" + }, + "value": [ + { + "$id": "3385", + "kind": "model", + "type": { + "$ref": "968" + }, + "value": { + "$id": "3386", + "name": { + "$id": "3387", + "kind": "string", + "type": { + "$ref": "970" + }, + "value": "vmNameTest" + }, + "properties": { + "$id": "3388", + "kind": "model", + "type": { + "$ref": "974" + }, + "value": { + "$id": "3389", + "subnet": { + "$id": "3390", + "kind": "model", + "type": { + "$ref": "921" + }, + "value": { + "$id": "3391", + "id": { + "$id": "3392", + "kind": "string", + "type": { + "$ref": "923" + }, + "value": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}" + } + } + }, + "primary": { + "$id": "3393", + "kind": "boolean", + "type": { + "$ref": "979" + }, + "value": true + }, + "loadBalancerBackendAddressPools": { + "$id": "3394", + "kind": "array", + "type": { + "$ref": "1053" + }, + "value": [ + { + "$id": "3395", + "kind": "model", + "type": { + "$ref": "723" + }, + "value": { + "$id": "3396", + "id": { + "$id": "3397", + "kind": "string", + "type": { + "$ref": "725" + }, + "value": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/backendAddressPools/{backendAddressPoolName}" + } + } + } + ] + } + } + } + } + } + ] + }, + "enableIPForwarding": { + "$id": "3398", + "kind": "boolean", + "type": { + "$ref": "1065" + }, + "value": true + } + } + } + } + } + ] + } + } + } + } + }, + "computeApiVersion": { + "$id": "3399", + "kind": "string", + "type": { + "$ref": "1375" + }, + "value": "2023-09-01" + }, + "platformFaultDomainCount": { + "$id": "3400", + "kind": "number", + "type": { + "$ref": "1379" + }, + "value": 1 + } + } + } + } + }, + "tags": { + "$id": "3401", + "kind": "dict", + "type": { + "$ref": "396" + }, + "value": { + "$id": "3402", + "key": { + "$id": "3403", + "kind": "string", + "type": { + "$ref": "398" + }, + "value": "fleets-test" + } + } + }, + "location": { + "$id": "3404", + "kind": "string", + "type": { + "$ref": "402" + }, + "value": "eastus2euap" + } + } + } + } + ], + "responses": [ + { + "$id": "3405", + "response": { + "$ref": "2197" + }, + "statusCode": 200, + "bodyValue": { + "$id": "3406", + "kind": "model", + "type": { + "$ref": "350" + }, + "value": { + "$id": "3407", + "properties": { + "$id": "3408", + "kind": "model", + "type": { + "$ref": "406" + }, + "value": { + "$id": "3409", + "provisioningState": { + "$id": "3410", + "kind": "string", + "type": { + "$ref": "2" + }, + "value": "Succeeded" + }, + "spotPriorityProfile": { + "$id": "3411", + "kind": "model", + "type": { + "$ref": "411" + }, + "value": { + "$id": "3412", + "capacity": { + "$id": "3413", + "kind": "number", + "type": { + "$ref": "413" + }, + "value": 2 + }, + "minCapacity": { + "$id": "3414", + "kind": "number", + "type": { + "$ref": "417" + }, + "value": 1 + }, + "evictionPolicy": { + "$id": "3415", + "kind": "string", + "type": { + "$ref": "18" + }, + "value": "Delete" + }, + "allocationStrategy": { + "$id": "3416", + "kind": "string", + "type": { + "$ref": "24" + }, + "value": "PriceCapacityOptimized" + }, + "maintain": { + "$id": "3417", + "kind": "boolean", + "type": { + "$ref": "431" + }, + "value": true + } + } + }, + "regularPriorityProfile": { + "$id": "3418", + "kind": "model", + "type": { + "$ref": "437" + }, + "value": { + "$id": "3419", + "capacity": { + "$id": "3420", + "kind": "number", + "type": { + "$ref": "439" + }, + "value": 2 + }, + "minCapacity": { + "$id": "3421", + "kind": "number", + "type": { + "$ref": "443" + }, + "value": 1 + }, + "allocationStrategy": { + "$id": "3422", + "kind": "string", + "type": { + "$ref": "32" + }, + "value": "LowestPrice" + } + } + }, + "vmSizesProfile": { + "$id": "3423", + "kind": "array", + "type": { + "$ref": "452" + }, + "value": [ + { + "$id": "3424", + "kind": "model", + "type": { + "$ref": "453" + }, + "value": { + "$id": "3425", + "name": { + "$id": "3426", + "kind": "string", + "type": { + "$ref": "455" + }, + "value": "Standard_D2s_v3" + } + } + }, + { + "$id": "3427", + "kind": "model", + "type": { + "$ref": "453" + }, + "value": { + "$id": "3428", + "name": { + "$id": "3429", + "kind": "string", + "type": { + "$ref": "455" + }, + "value": "Standard_D4s_v3" + } + } + }, + { + "$id": "3430", + "kind": "model", + "type": { + "$ref": "453" + }, + "value": { + "$id": "3431", + "name": { + "$id": "3432", + "kind": "string", + "type": { + "$ref": "455" + }, + "value": "Standard_E2s_v3" + } + } + } + ] + }, + "computeProfile": { + "$id": "3433", + "kind": "model", + "type": { + "$ref": "1370" + }, + "value": { + "$id": "3434", + "baseVirtualMachineProfile": { + "$id": "3435", + "kind": "model", + "type": { + "$ref": "565" + }, + "value": { + "$id": "3436", + "storageProfile": { + "$id": "3437", + "kind": "model", + "type": { + "$ref": "757" + }, + "value": { + "$id": "3438", + "imageReference": { + "$id": "3439", + "kind": "model", + "type": { + "$ref": "759" + }, + "value": { + "$id": "3440", + "publisher": { + "$id": "3441", + "kind": "string", + "type": { + "$ref": "766" + }, + "value": "canonical" + }, + "offer": { + "$id": "3442", + "kind": "string", + "type": { + "$ref": "770" + }, + "value": "0001-com-ubuntu-server-focal" + }, + "sku": { + "$id": "3443", + "kind": "string", + "type": { + "$ref": "774" + }, + "value": "20_04-lts-gen2" + }, + "version": { + "$id": "3444", + "kind": "string", + "type": { + "$ref": "778" + }, + "value": "latest" + } + } + }, + "osDisk": { + "$id": "3445", + "kind": "model", + "type": { + "$ref": "796" + }, + "value": { + "$id": "3446", + "caching": { + "$id": "3447", + "kind": "string", + "type": { + "$ref": "162" + }, + "value": "ReadWrite" + }, + "createOption": { + "$id": "3448", + "kind": "string", + "type": { + "$ref": "170" + }, + "value": "FromImage" + }, + "osType": { + "$id": "3449", + "kind": "string", + "type": { + "$ref": "194" + }, + "value": "Linux" + }, + "managedDisk": { + "$id": "3450", + "kind": "model", + "type": { + "$ref": "842" + }, + "value": { + "$id": "3451", + "storageAccountType": { + "$id": "3452", + "kind": "string", + "type": { + "$ref": "200" + }, + "value": "Standard_LRS" + } + } + } + } + } + } + }, + "osProfile": { + "$id": "3453", + "kind": "model", + "type": { + "$ref": "567" + }, + "value": { + "$id": "3454", + "computerNamePrefix": { + "$id": "3455", + "kind": "string", + "type": { + "$ref": "569" + }, + "value": "prefix" + }, + "adminUsername": { + "$id": "3456", + "kind": "string", + "type": { + "$ref": "573" + }, + "value": "azureuser" + }, + "linuxConfiguration": { + "$id": "3457", + "kind": "model", + "type": { + "$ref": "666" + }, + "value": { + "$id": "3458", + "disablePasswordAuthentication": { + "$id": "3459", + "kind": "boolean", + "type": { + "$ref": "668" + }, + "value": false + } + } + } + } + }, + "networkProfile": { + "$id": "3460", + "kind": "model", + "type": { + "$ref": "919" + }, + "value": { + "$id": "3461", + "networkInterfaceConfigurations": { + "$id": "3462", + "kind": "array", + "type": { + "$ref": "930" + }, + "value": [ + { + "$id": "3463", + "kind": "model", + "type": { + "$ref": "931" + }, + "value": { + "$id": "3464", + "name": { + "$id": "3465", + "kind": "string", + "type": { + "$ref": "933" + }, + "value": "vmNameTest" + }, + "properties": { + "$id": "3466", + "kind": "model", + "type": { + "$ref": "937" + }, + "value": { + "$id": "3467", + "primary": { + "$id": "3468", + "kind": "boolean", + "type": { + "$ref": "939" + }, + "value": true + }, + "enableAcceleratedNetworking": { + "$id": "3469", + "kind": "boolean", + "type": { + "$ref": "943" + }, + "value": false + }, + "ipConfigurations": { + "$id": "3470", + "kind": "array", + "type": { + "$ref": "967" + }, + "value": [ + { + "$id": "3471", + "kind": "model", + "type": { + "$ref": "968" + }, + "value": { + "$id": "3472", + "name": { + "$id": "3473", + "kind": "string", + "type": { + "$ref": "970" + }, + "value": "vmNameTest" + }, + "properties": { + "$id": "3474", + "kind": "model", + "type": { + "$ref": "974" + }, + "value": { + "$id": "3475", + "subnet": { + "$id": "3476", + "kind": "model", + "type": { + "$ref": "921" + }, + "value": { + "$id": "3477", + "id": { + "$id": "3478", + "kind": "string", + "type": { + "$ref": "923" + }, + "value": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}" + } + } + }, + "primary": { + "$id": "3479", + "kind": "boolean", + "type": { + "$ref": "979" + }, + "value": true + }, + "loadBalancerBackendAddressPools": { + "$id": "3480", + "kind": "array", + "type": { + "$ref": "1053" + }, + "value": [ + { + "$id": "3481", + "kind": "model", + "type": { + "$ref": "723" + }, + "value": { + "$id": "3482", + "id": { + "$id": "3483", + "kind": "string", + "type": { + "$ref": "725" + }, + "value": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/backendAddressPools/{backendAddressPoolName}" + } + } + } + ] + } + } + } + } + } + ] + }, + "enableIPForwarding": { + "$id": "3484", + "kind": "boolean", + "type": { + "$ref": "1065" + }, + "value": true + } + } + } + } + } + ] + } + } + } + } + }, + "computeApiVersion": { + "$id": "3485", + "kind": "string", + "type": { + "$ref": "1375" + }, + "value": "2023-09-01" + }, + "platformFaultDomainCount": { + "$id": "3486", + "kind": "number", + "type": { + "$ref": "1379" + }, + "value": 1 + } + } + }, + "timeCreated": { + "$id": "3487", + "kind": "string", + "type": { + "$ref": "1397" + }, + "value": "2024-07-10T00:16:34.8590555+00:00" + }, + "uniqueId": { + "$id": "3488", + "kind": "string", + "type": { + "$ref": "1402" + }, + "value": "a2f7fabd-bbc2-4a20-afe1-49fdb3885a28" + } + } + }, + "tags": { + "$id": "3489", + "kind": "dict", + "type": { + "$ref": "396" + }, + "value": { + "$id": "3490", + "key": { + "$id": "3491", + "kind": "string", + "type": { + "$ref": "398" + }, + "value": "fleets-test" + } + } + }, + "location": { + "$id": "3492", + "kind": "string", + "type": { + "$ref": "402" + }, + "value": "eastus2euap" + }, + "id": { + "$id": "3493", + "kind": "string", + "type": { + "$ref": "354" + }, + "value": "/subscriptions/7B0CD4DB-3381-4013-9B31-FB6E6FD0FF1C/resourceGroups/rgazurefleet/providers/Microsoft.AzureFleet/fleets/testFleet" + }, + "name": { + "$id": "3494", + "kind": "string", + "type": { + "$ref": "359" + }, + "value": "testFleet" + }, + "type": { + "$id": "3495", + "kind": "string", + "type": { + "$ref": "363" + }, + "value": "Microsoft.AzureFleet/fleets" + } + } + } + }, + { + "$id": "3496", + "response": { + "$ref": "2198" + }, + "statusCode": 201, + "bodyValue": { + "$id": "3497", + "kind": "model", + "type": { + "$ref": "350" + }, + "value": { + "$id": "3498", + "properties": { + "$id": "3499", + "kind": "model", + "type": { + "$ref": "406" + }, + "value": { + "$id": "3500", + "provisioningState": { + "$id": "3501", + "kind": "string", + "type": { + "$ref": "2" + }, + "value": "Creating" + }, + "spotPriorityProfile": { + "$id": "3502", + "kind": "model", + "type": { + "$ref": "411" + }, + "value": { + "$id": "3503", + "capacity": { + "$id": "3504", + "kind": "number", + "type": { + "$ref": "413" + }, + "value": 2 + }, + "minCapacity": { + "$id": "3505", + "kind": "number", + "type": { + "$ref": "417" + }, + "value": 1 + }, + "evictionPolicy": { + "$id": "3506", + "kind": "string", + "type": { + "$ref": "18" + }, + "value": "Delete" + }, + "allocationStrategy": { + "$id": "3507", + "kind": "string", + "type": { + "$ref": "24" + }, + "value": "PriceCapacityOptimized" + }, + "maintain": { + "$id": "3508", + "kind": "boolean", + "type": { + "$ref": "431" + }, + "value": true + } + } + }, + "regularPriorityProfile": { + "$id": "3509", + "kind": "model", + "type": { + "$ref": "437" + }, + "value": { + "$id": "3510", + "capacity": { + "$id": "3511", + "kind": "number", + "type": { + "$ref": "439" + }, + "value": 2 + }, + "minCapacity": { + "$id": "3512", + "kind": "number", + "type": { + "$ref": "443" + }, + "value": 1 + }, + "allocationStrategy": { + "$id": "3513", + "kind": "string", + "type": { + "$ref": "32" + }, + "value": "LowestPrice" + } + } + }, + "vmSizesProfile": { + "$id": "3514", + "kind": "array", + "type": { + "$ref": "452" + }, + "value": [ + { + "$id": "3515", + "kind": "model", + "type": { + "$ref": "453" + }, + "value": { + "$id": "3516", + "name": { + "$id": "3517", + "kind": "string", + "type": { + "$ref": "455" + }, + "value": "Standard_D2s_v3" + } + } + }, + { + "$id": "3518", + "kind": "model", + "type": { + "$ref": "453" + }, + "value": { + "$id": "3519", + "name": { + "$id": "3520", + "kind": "string", + "type": { + "$ref": "455" + }, + "value": "Standard_D4s_v3" + } + } + }, + { + "$id": "3521", + "kind": "model", + "type": { + "$ref": "453" + }, + "value": { + "$id": "3522", + "name": { + "$id": "3523", + "kind": "string", + "type": { + "$ref": "455" + }, + "value": "Standard_E2s_v3" + } + } + } + ] + }, + "computeProfile": { + "$id": "3524", + "kind": "model", + "type": { + "$ref": "1370" + }, + "value": { + "$id": "3525", + "baseVirtualMachineProfile": { + "$id": "3526", + "kind": "model", + "type": { + "$ref": "565" + }, + "value": { + "$id": "3527", + "storageProfile": { + "$id": "3528", + "kind": "model", + "type": { + "$ref": "757" + }, + "value": { + "$id": "3529", + "imageReference": { + "$id": "3530", + "kind": "model", + "type": { + "$ref": "759" + }, + "value": { + "$id": "3531", + "publisher": { + "$id": "3532", + "kind": "string", + "type": { + "$ref": "766" + }, + "value": "canonical" + }, + "offer": { + "$id": "3533", + "kind": "string", + "type": { + "$ref": "770" + }, + "value": "0001-com-ubuntu-server-focal" + }, + "sku": { + "$id": "3534", + "kind": "string", + "type": { + "$ref": "774" + }, + "value": "20_04-lts-gen2" + }, + "version": { + "$id": "3535", + "kind": "string", + "type": { + "$ref": "778" + }, + "value": "latest" + } + } + }, + "osDisk": { + "$id": "3536", + "kind": "model", + "type": { + "$ref": "796" + }, + "value": { + "$id": "3537", + "caching": { + "$id": "3538", + "kind": "string", + "type": { + "$ref": "162" + }, + "value": "ReadWrite" + }, + "createOption": { + "$id": "3539", + "kind": "string", + "type": { + "$ref": "170" + }, + "value": "FromImage" + }, + "osType": { + "$id": "3540", + "kind": "string", + "type": { + "$ref": "194" + }, + "value": "Linux" + }, + "managedDisk": { + "$id": "3541", + "kind": "model", + "type": { + "$ref": "842" + }, + "value": { + "$id": "3542", + "storageAccountType": { + "$id": "3543", + "kind": "string", + "type": { + "$ref": "200" + }, + "value": "Standard_LRS" + } + } + } + } + } + } + }, + "osProfile": { + "$id": "3544", + "kind": "model", + "type": { + "$ref": "567" + }, + "value": { + "$id": "3545", + "computerNamePrefix": { + "$id": "3546", + "kind": "string", + "type": { + "$ref": "569" + }, + "value": "prefix" + }, + "adminUsername": { + "$id": "3547", + "kind": "string", + "type": { + "$ref": "573" + }, + "value": "azureuser" + }, + "linuxConfiguration": { + "$id": "3548", + "kind": "model", + "type": { + "$ref": "666" + }, + "value": { + "$id": "3549", + "disablePasswordAuthentication": { + "$id": "3550", + "kind": "boolean", + "type": { + "$ref": "668" + }, + "value": false + } + } + } + } + }, + "networkProfile": { + "$id": "3551", + "kind": "model", + "type": { + "$ref": "919" + }, + "value": { + "$id": "3552", + "networkInterfaceConfigurations": { + "$id": "3553", + "kind": "array", + "type": { + "$ref": "930" + }, + "value": [ + { + "$id": "3554", + "kind": "model", + "type": { + "$ref": "931" + }, + "value": { + "$id": "3555", + "name": { + "$id": "3556", + "kind": "string", + "type": { + "$ref": "933" + }, + "value": "vmNameTest" + }, + "properties": { + "$id": "3557", + "kind": "model", + "type": { + "$ref": "937" + }, + "value": { + "$id": "3558", + "primary": { + "$id": "3559", + "kind": "boolean", + "type": { + "$ref": "939" + }, + "value": true + }, + "enableAcceleratedNetworking": { + "$id": "3560", + "kind": "boolean", + "type": { + "$ref": "943" + }, + "value": false + }, + "ipConfigurations": { + "$id": "3561", + "kind": "array", + "type": { + "$ref": "967" + }, + "value": [ + { + "$id": "3562", + "kind": "model", + "type": { + "$ref": "968" + }, + "value": { + "$id": "3563", + "name": { + "$id": "3564", + "kind": "string", + "type": { + "$ref": "970" + }, + "value": "vmNameTest" + }, + "properties": { + "$id": "3565", + "kind": "model", + "type": { + "$ref": "974" + }, + "value": { + "$id": "3566", + "subnet": { + "$id": "3567", + "kind": "model", + "type": { + "$ref": "921" + }, + "value": { + "$id": "3568", + "id": { + "$id": "3569", + "kind": "string", + "type": { + "$ref": "923" + }, + "value": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}" + } + } + }, + "primary": { + "$id": "3570", + "kind": "boolean", + "type": { + "$ref": "979" + }, + "value": true + }, + "loadBalancerBackendAddressPools": { + "$id": "3571", + "kind": "array", + "type": { + "$ref": "1053" + }, + "value": [ + { + "$id": "3572", + "kind": "model", + "type": { + "$ref": "723" + }, + "value": { + "$id": "3573", + "id": { + "$id": "3574", + "kind": "string", + "type": { + "$ref": "725" + }, + "value": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/backendAddressPools/{backendAddressPoolName}" + } + } + } + ] + } + } + } + } + } + ] + }, + "enableIPForwarding": { + "$id": "3575", + "kind": "boolean", + "type": { + "$ref": "1065" + }, + "value": true + } + } + } + } + } + ] + } + } + } + } + }, + "computeApiVersion": { + "$id": "3576", + "kind": "string", + "type": { + "$ref": "1375" + }, + "value": "2023-09-01" + }, + "platformFaultDomainCount": { + "$id": "3577", + "kind": "number", + "type": { + "$ref": "1379" + }, + "value": 1 + } + } + }, + "timeCreated": { + "$id": "3578", + "kind": "string", + "type": { + "$ref": "1397" + }, + "value": "2024-07-10T00:16:34.8590555+00:00" + }, + "uniqueId": { + "$id": "3579", + "kind": "string", + "type": { + "$ref": "1402" + }, + "value": "a2f7fabd-bbc2-4a20-afe1-49fdb3885a28" + } + } + }, + "tags": { + "$id": "3580", + "kind": "dict", + "type": { + "$ref": "396" + }, + "value": { + "$id": "3581", + "key": { + "$id": "3582", + "kind": "string", + "type": { + "$ref": "398" + }, + "value": "fleets-test" + } + } + }, + "location": { + "$id": "3583", + "kind": "string", + "type": { + "$ref": "402" + }, + "value": "eastus2euap" + }, + "id": { + "$id": "3584", + "kind": "string", + "type": { + "$ref": "354" + }, + "value": "/subscriptions/7B0CD4DB-3381-4013-9B31-FB6E6FD0FF1C/resourceGroups/rgazurefleet/providers/Microsoft.AzureFleet/fleets/testFleet" + }, + "name": { + "$id": "3585", + "kind": "string", + "type": { + "$ref": "359" + }, + "value": "testFleet" + }, + "type": { + "$id": "3586", + "kind": "string", + "type": { + "$ref": "363" + }, + "value": "Microsoft.AzureFleet/fleets" + } + } + } + } + ] + } + ] + }, + { + "$id": "3587", + "Name": "update", + "ResourceName": "Fleet", + "Doc": "Update a Fleet", + "Accessibility": "public", + "Parameters": [ + { + "$id": "3588", + "Name": "apiVersion", + "NameInRequest": "api-version", + "Doc": "The API version to use for this operation.", + "Type": { + "$id": "3589", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": true, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "DefaultValue": { + "$id": "3590", + "Type": { + "$id": "3591", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "2024-11-01" + }, + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "3592", + "Name": "subscriptionId", + "NameInRequest": "subscriptionId", + "Doc": "The ID of the target subscription. The value must be an UUID.", + "Type": { + "$id": "3593", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "3594", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "3595", + "Name": "resourceGroupName", + "NameInRequest": "resourceGroupName", + "Doc": "The name of the resource group. The name is case insensitive.", + "Type": { + "$id": "3596", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "3597", + "Name": "fleetName", + "NameInRequest": "fleetName", + "Doc": "The name of the Compute Fleet", + "Type": { + "$id": "3598", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "3599", + "Name": "contentType", + "NameInRequest": "Content-Type", + "Doc": "Body parameter's content type. Known values are application/json", + "Type": { + "$id": "3600", + "kind": "constant", + "valueType": { + "$id": "3601", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": true, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "3602", + "Name": "accept", + "NameInRequest": "Accept", + "Type": { + "$id": "3603", + "kind": "constant", + "valueType": { + "$id": "3604", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "3605", + "Name": "properties", + "NameInRequest": "properties", + "Doc": "The resource properties to be updated.", + "Type": { + "$ref": "1504" + }, + "Location": "Body", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "3606", + "StatusCodes": [ + 200 + ], + "BodyType": { + "$ref": "350" + }, + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false, + "ContentTypes": [ + "application/json" + ] + }, + { + "$id": "3607", + "StatusCodes": [ + 202 + ], + "BodyMediaType": "Json", + "Headers": [ + { + "$id": "3608", + "Name": "location", + "NameInResponse": "Location", + "Doc": "The Location header contains the URL where the status of the long running operation can be checked.", + "Type": { + "$id": "3609", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + } + }, + { + "$id": "3610", + "Name": "retryAfter", + "NameInResponse": "Retry-After", + "Doc": "The Retry-After header can indicate how long the client should wait before polling the operation status.", + "Type": { + "$id": "3611", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + } + } + ], + "IsErrorResponse": false + } + ], + "HttpMethod": "PATCH", + "RequestBodyMediaType": "Json", + "Uri": "{endpoint}", + "Path": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureFleet/fleets/{fleetName}", + "RequestMediaTypes": [ + "application/json" + ], + "BufferResponse": true, + "LongRunning": { + "$id": "3612", + "FinalStateVia": 1, + "FinalResponse": { + "$id": "3613", + "StatusCodes": [ + 200 + ], + "BodyType": { + "$ref": "350" + }, + "BodyMediaType": "Json" + } + }, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": false, + "CrossLanguageDefinitionId": "Microsoft.AzureFleet.Fleets.update", + "Decorators": [], + "Examples": [ + { + "$id": "3614", + "kind": "http", + "name": "Fleets_Update", + "description": "Fleets_Update", + "filePath": "2024-11-01/Fleets_Update.json", + "parameters": [ + { + "$id": "3615", + "parameter": { + "$ref": "3588" + }, + "value": { + "$id": "3616", + "kind": "string", + "type": { + "$ref": "3589" + }, + "value": "2024-11-01" + } + }, + { + "$id": "3617", + "parameter": { + "$ref": "3592" + }, + "value": { + "$id": "3618", + "kind": "string", + "type": { + "$ref": "3593" + }, + "value": "1DC2F28C-A625-4B0E-9748-9885A3C9E9EB" + } + }, + { + "$id": "3619", + "parameter": { + "$ref": "3595" + }, + "value": { + "$id": "3620", + "kind": "string", + "type": { + "$ref": "3596" + }, + "value": "rgazurefleet" + } + }, + { + "$id": "3621", + "parameter": { + "$ref": "3597" + }, + "value": { + "$id": "3622", + "kind": "string", + "type": { + "$ref": "3598" + }, + "value": "testFleet" + } + }, + { + "$id": "3623", + "parameter": { + "$ref": "3605" + }, + "value": { + "$id": "3624", + "kind": "model", + "type": { + "$ref": "1504" + }, + "value": { + "$id": "3625", + "identity": { + "$id": "3626", + "kind": "model", + "type": { + "$ref": "1512" + }, + "value": { + "$id": "3627", + "type": { + "$id": "3628", + "kind": "string", + "type": { + "$ref": "306" + }, + "value": "UserAssigned" + }, + "userAssignedIdentities": { + "$id": "3629", + "kind": "dict", + "type": { + "$ref": "1517" + }, + "value": { + "$id": "3630" + } + } + } + }, + "tags": { + "$id": "3631", + "kind": "dict", + "type": { + "$ref": "1506" + }, + "value": { + "$id": "3632" + } + }, + "properties": { + "$id": "3633", + "kind": "model", + "type": { + "$ref": "406" + }, + "value": { + "$id": "3634", + "spotPriorityProfile": { + "$id": "3635", + "kind": "model", + "type": { + "$ref": "411" + }, + "value": { + "$id": "3636", + "capacity": { + "$id": "3637", + "kind": "number", + "type": { + "$ref": "413" + }, + "value": 20 + }, + "minCapacity": { + "$id": "3638", + "kind": "number", + "type": { + "$ref": "417" + }, + "value": 10 + }, + "maxPricePerVM": { + "$id": "3639", + "kind": "number", + "type": { + "$ref": "421" + }, + "value": 0.00865 + }, + "evictionPolicy": { + "$id": "3640", + "kind": "string", + "type": { + "$ref": "18" + }, + "value": "Delete" + }, + "allocationStrategy": { + "$id": "3641", + "kind": "string", + "type": { + "$ref": "24" + }, + "value": "PriceCapacityOptimized" + }, + "maintain": { + "$id": "3642", + "kind": "boolean", + "type": { + "$ref": "431" + }, + "value": true + } + } + }, + "regularPriorityProfile": { + "$id": "3643", + "kind": "model", + "type": { + "$ref": "437" + }, + "value": { + "$id": "3644", + "capacity": { + "$id": "3645", + "kind": "number", + "type": { + "$ref": "439" + }, + "value": 20 + }, + "minCapacity": { + "$id": "3646", + "kind": "number", + "type": { + "$ref": "443" + }, + "value": 10 + }, + "allocationStrategy": { + "$id": "3647", + "kind": "string", + "type": { + "$ref": "32" + }, + "value": "LowestPrice" + } + } + }, + "vmSizesProfile": { + "$id": "3648", + "kind": "array", + "type": { + "$ref": "452" + }, + "value": [ + { + "$id": "3649", + "kind": "model", + "type": { + "$ref": "453" + }, + "value": { + "$id": "3650", + "name": { + "$id": "3651", + "kind": "string", + "type": { + "$ref": "455" + }, + "value": "Standard_d1_v2" + }, + "rank": { + "$id": "3652", + "kind": "number", + "type": { + "$ref": "459" + }, + "value": 19225 + } + } + } + ] + }, + "computeProfile": { + "$id": "3653", + "kind": "model", + "type": { + "$ref": "1370" + }, + "value": { + "$id": "3654", + "baseVirtualMachineProfile": { + "$id": "3655", + "kind": "model", + "type": { + "$ref": "565" + }, + "value": { + "$id": "3656", + "osProfile": { + "$id": "3657", + "kind": "model", + "type": { + "$ref": "567" + }, + "value": { + "$id": "3658", + "computerNamePrefix": { + "$id": "3659", + "kind": "string", + "type": { + "$ref": "569" + }, + "value": "o" + }, + "adminUsername": { + "$id": "3660", + "kind": "string", + "type": { + "$ref": "573" + }, + "value": "nrgzqciiaaxjrqldbmjbqkyhntp" + }, + "adminPassword": { + "$id": "3661", + "kind": "string", + "type": { + "$ref": "577" + }, + "value": "adfbrdxpv" + }, + "customData": { + "$id": "3662", + "kind": "string", + "type": { + "$ref": "581" + }, + "value": "xjjib" + }, + "windowsConfiguration": { + "$id": "3663", + "kind": "model", + "type": { + "$ref": "585" + }, + "value": { + "$id": "3664", + "provisionVMAgent": { + "$id": "3665", + "kind": "boolean", + "type": { + "$ref": "587" + }, + "value": true + }, + "enableAutomaticUpdates": { + "$id": "3666", + "kind": "boolean", + "type": { + "$ref": "591" + }, + "value": true + }, + "timeZone": { + "$id": "3667", + "kind": "string", + "type": { + "$ref": "595" + }, + "value": "hlyjiqcfksgrpjrct" + }, + "additionalUnattendContent": { + "$id": "3668", + "kind": "array", + "type": { + "$ref": "599" + }, + "value": [ + { + "$id": "3669", + "kind": "model", + "type": { + "$ref": "600" + }, + "value": { + "$id": "3670", + "passName": { + "$id": "3671", + "kind": "string", + "type": { + "$ref": "602" + }, + "value": "OobeSystem" + }, + "componentName": { + "$id": "3672", + "kind": "string", + "type": { + "$ref": "606" + }, + "value": "Microsoft-Windows-Shell-Setup" + }, + "settingName": { + "$id": "3673", + "kind": "string", + "type": { + "$ref": "104" + }, + "value": "AutoLogon" + }, + "content": { + "$id": "3674", + "kind": "string", + "type": { + "$ref": "613" + }, + "value": "bubmqbxjkj" + } + } + } + ] + }, + "patchSettings": { + "$id": "3675", + "kind": "model", + "type": { + "$ref": "619" + }, + "value": { + "$id": "3676", + "patchMode": { + "$id": "3677", + "kind": "string", + "type": { + "$ref": "110" + }, + "value": "Manual" + }, + "enableHotpatching": { + "$id": "3678", + "kind": "boolean", + "type": { + "$ref": "624" + }, + "value": true + }, + "assessmentMode": { + "$id": "3679", + "kind": "string", + "type": { + "$ref": "118" + }, + "value": "ImageDefault" + }, + "automaticByPlatformSettings": { + "$id": "3680", + "kind": "model", + "type": { + "$ref": "631" + }, + "value": { + "$id": "3681", + "rebootSetting": { + "$id": "3682", + "kind": "string", + "type": { + "$ref": "124" + }, + "value": "Unknown" + }, + "bypassPlatformSafetyChecksOnUserSchedule": { + "$id": "3683", + "kind": "boolean", + "type": { + "$ref": "636" + }, + "value": true + } + } + } + } + }, + "winRM": { + "$id": "3684", + "kind": "model", + "type": { + "$ref": "644" + }, + "value": { + "$id": "3685", + "listeners": { + "$id": "3686", + "kind": "array", + "type": { + "$ref": "646" + }, + "value": [ + { + "$id": "3687", + "kind": "model", + "type": { + "$ref": "647" + }, + "value": { + "$id": "3688", + "protocol": { + "$id": "3689", + "kind": "string", + "type": { + "$ref": "134" + }, + "value": "Http" + }, + "certificateUrl": { + "$id": "3690", + "kind": "string", + "type": { + "$ref": "652" + }, + "value": "https://myVaultName.vault.azure.net/secrets/myCertName" + } + } + } + ] + } + } + }, + "enableVMAgentPlatformUpdates": { + "$id": "3691", + "kind": "boolean", + "type": { + "$ref": "660" + }, + "value": true + } + } + }, + "linuxConfiguration": { + "$id": "3692", + "kind": "model", + "type": { + "$ref": "666" + }, + "value": { + "$id": "3693", + "disablePasswordAuthentication": { + "$id": "3694", + "kind": "boolean", + "type": { + "$ref": "668" + }, + "value": true + }, + "ssh": { + "$id": "3695", + "kind": "model", + "type": { + "$ref": "672" + }, + "value": { + "$id": "3696", + "publicKeys": { + "$id": "3697", + "kind": "array", + "type": { + "$ref": "674" + }, + "value": [ + { + "$id": "3698", + "kind": "model", + "type": { + "$ref": "675" + }, + "value": { + "$id": "3699", + "path": { + "$id": "3700", + "kind": "string", + "type": { + "$ref": "677" + }, + "value": "kmqz" + }, + "keyData": { + "$id": "3701", + "kind": "string", + "type": { + "$ref": "681" + }, + "value": "kivgsubusvpprwqaqpjcmhsv" + } + } + } + ] + } + } + }, + "provisionVMAgent": { + "$id": "3702", + "kind": "boolean", + "type": { + "$ref": "689" + }, + "value": true + }, + "patchSettings": { + "$id": "3703", + "kind": "model", + "type": { + "$ref": "693" + }, + "value": { + "$id": "3704", + "patchMode": { + "$id": "3705", + "kind": "string", + "type": { + "$ref": "140" + }, + "value": "ImageDefault" + }, + "assessmentMode": { + "$id": "3706", + "kind": "string", + "type": { + "$ref": "146" + }, + "value": "ImageDefault" + }, + "automaticByPlatformSettings": { + "$id": "3707", + "kind": "model", + "type": { + "$ref": "701" + }, + "value": { + "$id": "3708", + "rebootSetting": { + "$id": "3709", + "kind": "string", + "type": { + "$ref": "152" + }, + "value": "Unknown" + }, + "bypassPlatformSafetyChecksOnUserSchedule": { + "$id": "3710", + "kind": "boolean", + "type": { + "$ref": "706" + }, + "value": true + } + } + } + } + }, + "enableVMAgentPlatformUpdates": { + "$id": "3711", + "kind": "boolean", + "type": { + "$ref": "714" + }, + "value": true + } + } + }, + "secrets": { + "$id": "3712", + "kind": "array", + "type": { + "$ref": "720" + }, + "value": [ + { + "$id": "3713", + "kind": "model", + "type": { + "$ref": "721" + }, + "value": { + "$id": "3714", + "sourceVault": { + "$id": "3715", + "kind": "model", + "type": { + "$ref": "723" + }, + "value": { + "$id": "3716", + "id": { + "$id": "3717", + "kind": "string", + "type": { + "$ref": "725" + }, + "value": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault/vaults/{vaultName}" + } + } + }, + "vaultCertificates": { + "$id": "3718", + "kind": "array", + "type": { + "$ref": "732" + }, + "value": [ + { + "$id": "3719", + "kind": "model", + "type": { + "$ref": "733" + }, + "value": { + "$id": "3720", + "certificateUrl": { + "$id": "3721", + "kind": "string", + "type": { + "$ref": "735" + }, + "value": "https://myVaultName.vault.azure.net/secrets/myCertName" + }, + "certificateStore": { + "$id": "3722", + "kind": "string", + "type": { + "$ref": "739" + }, + "value": "nlxrwavpzhueffxsshlun" + } + } + } + ] + } + } + } + ] + }, + "allowExtensionOperations": { + "$id": "3723", + "kind": "boolean", + "type": { + "$ref": "747" + }, + "value": true + }, + "requireGuestProvisionSignal": { + "$id": "3724", + "kind": "boolean", + "type": { + "$ref": "751" + }, + "value": true + } + } + }, + "storageProfile": { + "$id": "3725", + "kind": "model", + "type": { + "$ref": "757" + }, + "value": { + "$id": "3726", + "imageReference": { + "$id": "3727", + "kind": "model", + "type": { + "$ref": "759" + }, + "value": { + "$id": "3728", + "publisher": { + "$id": "3729", + "kind": "string", + "type": { + "$ref": "766" + }, + "value": "mqxgwbiyjzmxavhbkd" + }, + "offer": { + "$id": "3730", + "kind": "string", + "type": { + "$ref": "770" + }, + "value": "isxgumkarlkomp" + }, + "sku": { + "$id": "3731", + "kind": "string", + "type": { + "$ref": "774" + }, + "value": "eojmppqcrnpmxirtp" + }, + "version": { + "$id": "3732", + "kind": "string", + "type": { + "$ref": "778" + }, + "value": "wvpcqefgtmqdgltiuz" + }, + "sharedGalleryImageId": { + "$id": "3733", + "kind": "string", + "type": { + "$ref": "786" + }, + "value": "kmkgihoxwlawuuhcinfirktdwkmx" + }, + "communityGalleryImageId": { + "$id": "3734", + "kind": "string", + "type": { + "$ref": "790" + }, + "value": "vlqe" + }, + "id": { + "$id": "3735", + "kind": "string", + "type": { + "$ref": "761" + }, + "value": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/images/{imageName}/versions/{versionName}" + } + } + }, + "osDisk": { + "$id": "3736", + "kind": "model", + "type": { + "$ref": "796" + }, + "value": { + "$id": "3737", + "name": { + "$id": "3738", + "kind": "string", + "type": { + "$ref": "798" + }, + "value": "wfttw" + }, + "caching": { + "$id": "3739", + "kind": "string", + "type": { + "$ref": "162" + }, + "value": "None" + }, + "writeAcceleratorEnabled": { + "$id": "3740", + "kind": "boolean", + "type": { + "$ref": "805" + }, + "value": true + }, + "createOption": { + "$id": "3741", + "kind": "string", + "type": { + "$ref": "170" + }, + "value": "FromImage" + }, + "diffDiskSettings": { + "$id": "3742", + "kind": "model", + "type": { + "$ref": "812" + }, + "value": { + "$id": "3743", + "option": { + "$id": "3744", + "kind": "string", + "type": { + "$ref": "182" + }, + "value": "Local" + }, + "placement": { + "$id": "3745", + "kind": "string", + "type": { + "$ref": "186" + }, + "value": "CacheDisk" + } + } + }, + "diskSizeGB": { + "$id": "3746", + "kind": "number", + "type": { + "$ref": "822" + }, + "value": 14 + }, + "osType": { + "$id": "3747", + "kind": "string", + "type": { + "$ref": "194" + }, + "value": "Windows" + }, + "image": { + "$id": "3748", + "kind": "model", + "type": { + "$ref": "829" + }, + "value": { + "$id": "3749", + "uri": { + "$id": "3750", + "kind": "string", + "type": { + "$ref": "831" + }, + "value": "https://myStorageAccountName.blob.core.windows.net/myContainerName/myVhdName.vhd" + } + } + }, + "vhdContainers": { + "$id": "3751", + "kind": "array", + "type": { + "$ref": "837" + }, + "value": [ + { + "$id": "3752", + "kind": "string", + "type": { + "$ref": "838" + }, + "value": "tkzcwddtinkfpnfklatw" + } + ] + }, + "managedDisk": { + "$id": "3753", + "kind": "model", + "type": { + "$ref": "842" + }, + "value": { + "$id": "3754", + "storageAccountType": { + "$id": "3755", + "kind": "string", + "type": { + "$ref": "200" + }, + "value": "Standard_LRS" + }, + "diskEncryptionSet": { + "$id": "3756", + "kind": "model", + "type": { + "$ref": "847" + }, + "value": { + "$id": "3757", + "id": { + "$id": "3758", + "kind": "string", + "type": { + "$ref": "849" + }, + "value": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskEncryptionSets/{diskEncryptionSetName}" + } + } + }, + "securityProfile": { + "$id": "3759", + "kind": "model", + "type": { + "$ref": "856" + }, + "value": { + "$id": "3760", + "securityEncryptionType": { + "$id": "3761", + "kind": "string", + "type": { + "$ref": "216" + }, + "value": "VMGuestStateOnly" + }, + "diskEncryptionSet": { + "$id": "3762", + "kind": "model", + "type": { + "$ref": "847" + }, + "value": { + "$id": "3763", + "id": { + "$id": "3764", + "kind": "string", + "type": { + "$ref": "849" + }, + "value": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskEncryptionSets/{diskEncryptionSetName}" + } + } + } + } + } + } + }, + "deleteOption": { + "$id": "3765", + "kind": "string", + "type": { + "$ref": "224" + }, + "value": "Delete" + } + } + }, + "dataDisks": { + "$id": "3766", + "kind": "array", + "type": { + "$ref": "873" + }, + "value": [ + { + "$id": "3767", + "kind": "model", + "type": { + "$ref": "874" + }, + "value": { + "$id": "3768", + "name": { + "$id": "3769", + "kind": "string", + "type": { + "$ref": "876" + }, + "value": "eogiykmdmeikswxmigjws" + }, + "lun": { + "$id": "3770", + "kind": "number", + "type": { + "$ref": "880" + }, + "value": 14 + }, + "caching": { + "$id": "3771", + "kind": "string", + "type": { + "$ref": "162" + }, + "value": "None" + }, + "writeAcceleratorEnabled": { + "$id": "3772", + "kind": "boolean", + "type": { + "$ref": "887" + }, + "value": true + }, + "createOption": { + "$id": "3773", + "kind": "string", + "type": { + "$ref": "170" + }, + "value": "FromImage" + }, + "diskSizeGB": { + "$id": "3774", + "kind": "number", + "type": { + "$ref": "894" + }, + "value": 6 + }, + "managedDisk": { + "$id": "3775", + "kind": "model", + "type": { + "$ref": "842" + }, + "value": { + "$id": "3776", + "storageAccountType": { + "$id": "3777", + "kind": "string", + "type": { + "$ref": "200" + }, + "value": "Standard_LRS" + }, + "diskEncryptionSet": { + "$id": "3778", + "kind": "model", + "type": { + "$ref": "847" + }, + "value": { + "$id": "3779", + "id": { + "$id": "3780", + "kind": "string", + "type": { + "$ref": "849" + }, + "value": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskEncryptionSets/{diskEncryptionSetName}" + } + } + }, + "securityProfile": { + "$id": "3781", + "kind": "model", + "type": { + "$ref": "856" + }, + "value": { + "$id": "3782", + "securityEncryptionType": { + "$id": "3783", + "kind": "string", + "type": { + "$ref": "216" + }, + "value": "VMGuestStateOnly" + }, + "diskEncryptionSet": { + "$id": "3784", + "kind": "model", + "type": { + "$ref": "847" + }, + "value": { + "$id": "3785", + "id": { + "$id": "3786", + "kind": "string", + "type": { + "$ref": "849" + }, + "value": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskEncryptionSets/{diskEncryptionSetName}" + } + } + } + } + } + } + }, + "diskIOPSReadWrite": { + "$id": "3787", + "kind": "number", + "type": { + "$ref": "901" + }, + "value": 27 + }, + "diskMBpsReadWrite": { + "$id": "3788", + "kind": "number", + "type": { + "$ref": "905" + }, + "value": 2 + }, + "deleteOption": { + "$id": "3789", + "kind": "string", + "type": { + "$ref": "224" + }, + "value": "Delete" + } + } + } + ] + } + } + }, + "networkProfile": { + "$id": "3790", + "kind": "model", + "type": { + "$ref": "919" + }, + "value": { + "$id": "3791", + "healthProbe": { + "$id": "3792", + "kind": "model", + "type": { + "$ref": "921" + }, + "value": { + "$id": "3793", + "id": { + "$id": "3794", + "kind": "string", + "type": { + "$ref": "923" + }, + "value": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/probes/{probeName}" + } + } + }, + "networkInterfaceConfigurations": { + "$id": "3795", + "kind": "array", + "type": { + "$ref": "930" + }, + "value": [ + { + "$id": "3796", + "kind": "model", + "type": { + "$ref": "931" + }, + "value": { + "$id": "3797", + "name": { + "$id": "3798", + "kind": "string", + "type": { + "$ref": "933" + }, + "value": "i" + }, + "properties": { + "$id": "3799", + "kind": "model", + "type": { + "$ref": "937" + }, + "value": { + "$id": "3800", + "primary": { + "$id": "3801", + "kind": "boolean", + "type": { + "$ref": "939" + }, + "value": true + }, + "enableAcceleratedNetworking": { + "$id": "3802", + "kind": "boolean", + "type": { + "$ref": "943" + }, + "value": true + }, + "disableTcpStateTracking": { + "$id": "3803", + "kind": "boolean", + "type": { + "$ref": "947" + }, + "value": true + }, + "enableFpga": { + "$id": "3804", + "kind": "boolean", + "type": { + "$ref": "951" + }, + "value": true + }, + "networkSecurityGroup": { + "$id": "3805", + "kind": "model", + "type": { + "$ref": "723" + }, + "value": { + "$id": "3806", + "id": { + "$id": "3807", + "kind": "string", + "type": { + "$ref": "725" + }, + "value": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}" + } + } + }, + "dnsSettings": { + "$id": "3808", + "kind": "model", + "type": { + "$ref": "958" + }, + "value": { + "$id": "3809", + "dnsServers": { + "$id": "3810", + "kind": "array", + "type": { + "$ref": "960" + }, + "value": [ + { + "$id": "3811", + "kind": "string", + "type": { + "$ref": "961" + }, + "value": "nxmmfolhclsesu" + } + ] + } + } + }, + "ipConfigurations": { + "$id": "3812", + "kind": "array", + "type": { + "$ref": "967" + }, + "value": [ + { + "$id": "3813", + "kind": "model", + "type": { + "$ref": "968" + }, + "value": { + "$id": "3814", + "name": { + "$id": "3815", + "kind": "string", + "type": { + "$ref": "970" + }, + "value": "oezqhkidfhyywlfzwuotilrpbqnjg" + }, + "properties": { + "$id": "3816", + "kind": "model", + "type": { + "$ref": "974" + }, + "value": { + "$id": "3817", + "subnet": { + "$id": "3818", + "kind": "model", + "type": { + "$ref": "921" + }, + "value": { + "$id": "3819", + "id": { + "$id": "3820", + "kind": "string", + "type": { + "$ref": "923" + }, + "value": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}" + } + } + }, + "primary": { + "$id": "3821", + "kind": "boolean", + "type": { + "$ref": "979" + }, + "value": true + }, + "publicIPAddressConfiguration": { + "$id": "3822", + "kind": "model", + "type": { + "$ref": "983" + }, + "value": { + "$id": "3823", + "name": { + "$id": "3824", + "kind": "string", + "type": { + "$ref": "985" + }, + "value": "fvpqf" + }, + "properties": { + "$id": "3825", + "kind": "model", + "type": { + "$ref": "989" + }, + "value": { + "$id": "3826", + "idleTimeoutInMinutes": { + "$id": "3827", + "kind": "number", + "type": { + "$ref": "991" + }, + "value": 9 + }, + "dnsSettings": { + "$id": "3828", + "kind": "model", + "type": { + "$ref": "995" + }, + "value": { + "$id": "3829", + "domainNameLabel": { + "$id": "3830", + "kind": "string", + "type": { + "$ref": "997" + }, + "value": "ukrddzvmorpmfsczjwtbvp" + }, + "domainNameLabelScope": { + "$id": "3831", + "kind": "string", + "type": { + "$ref": "236" + }, + "value": "TenantReuse" + } + } + }, + "ipTags": { + "$id": "3832", + "kind": "array", + "type": { + "$ref": "1006" + }, + "value": [ + { + "$id": "3833", + "kind": "model", + "type": { + "$ref": "1007" + }, + "value": { + "$id": "3834", + "ipTagType": { + "$id": "3835", + "kind": "string", + "type": { + "$ref": "1009" + }, + "value": "sddgsoemnzgqizale" + }, + "tag": { + "$id": "3836", + "kind": "string", + "type": { + "$ref": "1013" + }, + "value": "wufmhrjsakbiaetyara" + } + } + } + ] + }, + "publicIPPrefix": { + "$id": "3837", + "kind": "model", + "type": { + "$ref": "723" + }, + "value": { + "$id": "3838", + "id": { + "$id": "3839", + "kind": "string", + "type": { + "$ref": "725" + }, + "value": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPPrefixes/{publicIPPrefixName}" + } + } + }, + "publicIPAddressVersion": { + "$id": "3840", + "kind": "string", + "type": { + "$ref": "246" + }, + "value": "IPv4" + }, + "deleteOption": { + "$id": "3841", + "kind": "string", + "type": { + "$ref": "252" + }, + "value": "Delete" + } + } + }, + "sku": { + "$id": "3842", + "kind": "model", + "type": { + "$ref": "1030" + }, + "value": { + "$id": "3843", + "name": { + "$id": "3844", + "kind": "string", + "type": { + "$ref": "258" + }, + "value": "Basic" + }, + "tier": { + "$id": "3845", + "kind": "string", + "type": { + "$ref": "264" + }, + "value": "Regional" + } + } + } + } + }, + "privateIPAddressVersion": { + "$id": "3846", + "kind": "string", + "type": { + "$ref": "246" + }, + "value": "IPv4" + }, + "applicationGatewayBackendAddressPools": { + "$id": "3847", + "kind": "array", + "type": { + "$ref": "1045" + }, + "value": [ + { + "$id": "3848", + "kind": "model", + "type": { + "$ref": "723" + }, + "value": { + "$id": "3849", + "id": { + "$id": "3850", + "kind": "string", + "type": { + "$ref": "725" + }, + "value": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}/backendAddressPools/{backendAddressPoolName}" + } + } + } + ] + }, + "applicationSecurityGroups": { + "$id": "3851", + "kind": "array", + "type": { + "$ref": "1049" + }, + "value": [ + { + "$id": "3852", + "kind": "model", + "type": { + "$ref": "723" + }, + "value": { + "$id": "3853", + "id": { + "$id": "3854", + "kind": "string", + "type": { + "$ref": "725" + }, + "value": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationSecurityGroups/{applicationSecurityGroupName}" + } + } + } + ] + }, + "loadBalancerBackendAddressPools": { + "$id": "3855", + "kind": "array", + "type": { + "$ref": "1053" + }, + "value": [ + { + "$id": "3856", + "kind": "model", + "type": { + "$ref": "723" + }, + "value": { + "$id": "3857", + "id": { + "$id": "3858", + "kind": "string", + "type": { + "$ref": "725" + }, + "value": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/backendAddressPools/{backendAddressPoolName}" + } + } + } + ] + }, + "loadBalancerInboundNatPools": { + "$id": "3859", + "kind": "array", + "type": { + "$ref": "1057" + }, + "value": [ + { + "$id": "3860", + "kind": "model", + "type": { + "$ref": "723" + }, + "value": { + "$id": "3861", + "id": { + "$id": "3862", + "kind": "string", + "type": { + "$ref": "725" + }, + "value": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/inboundNatPools/{inboundNatPoolName}" + } + } + } + ] + } + } + } + } + } + ] + }, + "enableIPForwarding": { + "$id": "3863", + "kind": "boolean", + "type": { + "$ref": "1065" + }, + "value": true + }, + "deleteOption": { + "$id": "3864", + "kind": "string", + "type": { + "$ref": "252" + }, + "value": "Delete" + }, + "auxiliaryMode": { + "$id": "3865", + "kind": "string", + "type": { + "$ref": "270" + }, + "value": "None" + }, + "auxiliarySku": { + "$id": "3866", + "kind": "string", + "type": { + "$ref": "278" + }, + "value": "None" + } + } + } + } + } + ] + }, + "networkApiVersion": { + "$id": "3867", + "kind": "string", + "type": { + "$ref": "290" + }, + "value": "2020-11-01" + } + } + }, + "securityProfile": { + "$id": "3868", + "kind": "model", + "type": { + "$ref": "1087" + }, + "value": { + "$id": "3869", + "uefiSettings": { + "$id": "3870", + "kind": "model", + "type": { + "$ref": "1089" + }, + "value": { + "$id": "3871", + "secureBootEnabled": { + "$id": "3872", + "kind": "boolean", + "type": { + "$ref": "1091" + }, + "value": true + }, + "vTpmEnabled": { + "$id": "3873", + "kind": "boolean", + "type": { + "$ref": "1095" + }, + "value": true + } + } + }, + "encryptionAtHost": { + "$id": "3874", + "kind": "boolean", + "type": { + "$ref": "1101" + }, + "value": true + }, + "securityType": { + "$id": "3875", + "kind": "string", + "type": { + "$ref": "294" + }, + "value": "TrustedLaunch" + }, + "encryptionIdentity": { + "$id": "3876", + "kind": "model", + "type": { + "$ref": "1108" + }, + "value": { + "$id": "3877", + "userAssignedIdentityResourceId": { + "$id": "3878", + "kind": "string", + "type": { + "$ref": "1110" + }, + "value": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{userAssignedIdentityName}" + } + } + }, + "proxyAgentSettings": { + "$id": "3879", + "kind": "model", + "type": { + "$ref": "1117" + }, + "value": { + "$id": "3880", + "enabled": { + "$id": "3881", + "kind": "boolean", + "type": { + "$ref": "1119" + }, + "value": true + }, + "mode": { + "$id": "3882", + "kind": "string", + "type": { + "$ref": "300" + }, + "value": "Audit" + }, + "keyIncarnationId": { + "$id": "3883", + "kind": "number", + "type": { + "$ref": "1126" + }, + "value": 20 + } + } + } + } + }, + "diagnosticsProfile": { + "$id": "3884", + "kind": "model", + "type": { + "$ref": "1134" + }, + "value": { + "$id": "3885", + "bootDiagnostics": { + "$id": "3886", + "kind": "model", + "type": { + "$ref": "1136" + }, + "value": { + "$id": "3887", + "enabled": { + "$id": "3888", + "kind": "boolean", + "type": { + "$ref": "1138" + }, + "value": true + }, + "storageUri": { + "$id": "3889", + "kind": "string", + "type": { + "$ref": "1142" + }, + "value": "http://myStorageAccountName.blob.core.windows.net" + } + } + } + } + }, + "extensionProfile": { + "$id": "3890", + "kind": "model", + "type": { + "$ref": "1150" + }, + "value": { + "$id": "3891", + "extensions": { + "$id": "3892", + "kind": "array", + "type": { + "$ref": "1152" + }, + "value": [ + { + "$id": "3893", + "kind": "model", + "type": { + "$ref": "1153" + }, + "value": { + "$id": "3894", + "name": { + "$id": "3895", + "kind": "string", + "type": { + "$ref": "1160" + }, + "value": "bndxuxx" + }, + "properties": { + "$id": "3896", + "kind": "model", + "type": { + "$ref": "1168" + }, + "value": { + "$id": "3897", + "forceUpdateTag": { + "$id": "3898", + "kind": "string", + "type": { + "$ref": "1170" + }, + "value": "yhgxw" + }, + "publisher": { + "$id": "3899", + "kind": "string", + "type": { + "$ref": "1174" + }, + "value": "kpxtirxjfprhs" + }, + "type": { + "$id": "3900", + "kind": "string", + "type": { + "$ref": "1178" + }, + "value": "pgjilctjjwaa" + }, + "typeHandlerVersion": { + "$id": "3901", + "kind": "string", + "type": { + "$ref": "1182" + }, + "value": "zevivcoilxmbwlrihhhibq" + }, + "autoUpgradeMinorVersion": { + "$id": "3902", + "kind": "boolean", + "type": { + "$ref": "1186" + }, + "value": true + }, + "enableAutomaticUpgrade": { + "$id": "3903", + "kind": "boolean", + "type": { + "$ref": "1190" + }, + "value": true + }, + "settings": { + "$id": "3904", + "kind": "dict", + "type": { + "$ref": "1194" + }, + "value": { + "$id": "3905" + } + }, + "protectedSettings": { + "$id": "3906", + "kind": "dict", + "type": { + "$ref": "1200" + }, + "value": { + "$id": "3907" + } + }, + "provisionAfterExtensions": { + "$id": "3908", + "kind": "array", + "type": { + "$ref": "1210" + }, + "value": [ + { + "$id": "3909", + "kind": "string", + "type": { + "$ref": "1211" + }, + "value": "nftzosroolbcwmpupujzqwqe" + } + ] + }, + "suppressFailures": { + "$id": "3910", + "kind": "boolean", + "type": { + "$ref": "1215" + }, + "value": true + }, + "protectedSettingsFromKeyVault": { + "$id": "3911", + "kind": "model", + "type": { + "$ref": "1219" + }, + "value": { + "$id": "3912", + "secretUrl": { + "$id": "3913", + "kind": "string", + "type": { + "$ref": "1221" + }, + "value": "https://myVaultName.vault.azure.net/secrets/secret/mySecretName" + }, + "sourceVault": { + "$id": "3914", + "kind": "model", + "type": { + "$ref": "723" + }, + "value": { + "$id": "3915", + "id": { + "$id": "3916", + "kind": "string", + "type": { + "$ref": "725" + }, + "value": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault/vaults/{vaultName}" + } + } + } + } + } + } + } + } + } + ] + }, + "extensionsTimeBudget": { + "$id": "3917", + "kind": "string", + "type": { + "$ref": "1234" + }, + "value": "mbhjahtdygwgyszdwjtvlvtgchdwil" + } + } + }, + "licenseType": { + "$id": "3918", + "kind": "string", + "type": { + "$ref": "1240" + }, + "value": "v" + }, + "scheduledEventsProfile": { + "$id": "3919", + "kind": "model", + "type": { + "$ref": "1244" + }, + "value": { + "$id": "3920", + "terminateNotificationProfile": { + "$id": "3921", + "kind": "model", + "type": { + "$ref": "1246" + }, + "value": { + "$id": "3922", + "notBeforeTimeout": { + "$id": "3923", + "kind": "string", + "type": { + "$ref": "1248" + }, + "value": "iljppmmw" + }, + "enable": { + "$id": "3924", + "kind": "boolean", + "type": { + "$ref": "1252" + }, + "value": true + } + } + }, + "osImageNotificationProfile": { + "$id": "3925", + "kind": "model", + "type": { + "$ref": "1258" + }, + "value": { + "$id": "3926", + "notBeforeTimeout": { + "$id": "3927", + "kind": "string", + "type": { + "$ref": "1260" + }, + "value": "olbpadmevekyczfokodtfprxti" + }, + "enable": { + "$id": "3928", + "kind": "boolean", + "type": { + "$ref": "1264" + }, + "value": true + } + } + } + } + }, + "userData": { + "$id": "3929", + "kind": "string", + "type": { + "$ref": "1272" + }, + "value": "s" + }, + "capacityReservation": { + "$id": "3930", + "kind": "model", + "type": { + "$ref": "1276" + }, + "value": { + "$id": "3931", + "capacityReservationGroup": { + "$id": "3932", + "kind": "model", + "type": { + "$ref": "723" + }, + "value": { + "$id": "3933", + "id": { + "$id": "3934", + "kind": "string", + "type": { + "$ref": "725" + }, + "value": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/capacityReservationGroups/{capacityReservationGroupName}" + } + } + } + } + }, + "applicationProfile": { + "$id": "3935", + "kind": "model", + "type": { + "$ref": "1283" + }, + "value": { + "$id": "3936", + "galleryApplications": { + "$id": "3937", + "kind": "array", + "type": { + "$ref": "1285" + }, + "value": [ + { + "$id": "3938", + "kind": "model", + "type": { + "$ref": "1286" + }, + "value": { + "$id": "3939", + "tags": { + "$id": "3940", + "kind": "string", + "type": { + "$ref": "1288" + }, + "value": "eyrqjbib" + }, + "order": { + "$id": "3941", + "kind": "number", + "type": { + "$ref": "1292" + }, + "value": 5 + }, + "packageReferenceId": { + "$id": "3942", + "kind": "string", + "type": { + "$ref": "1296" + }, + "value": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/applications/{applicationName}/versions/{versionName}" + }, + "configurationReference": { + "$id": "3943", + "kind": "string", + "type": { + "$ref": "1301" + }, + "value": "ulztmiavpojpbpbddgnuuiimxcpau" + }, + "treatFailureAsDeploymentFailure": { + "$id": "3944", + "kind": "boolean", + "type": { + "$ref": "1305" + }, + "value": true + }, + "enableAutomaticUpgrade": { + "$id": "3945", + "kind": "boolean", + "type": { + "$ref": "1309" + }, + "value": true + } + } + } + ] + } + } + }, + "hardwareProfile": { + "$id": "3946", + "kind": "model", + "type": { + "$ref": "1317" + }, + "value": { + "$id": "3947", + "vmSizeProperties": { + "$id": "3948", + "kind": "model", + "type": { + "$ref": "1319" + }, + "value": { + "$id": "3949", + "vCPUsAvailable": { + "$id": "3950", + "kind": "number", + "type": { + "$ref": "1321" + }, + "value": 16 + }, + "vCPUsPerCore": { + "$id": "3951", + "kind": "number", + "type": { + "$ref": "1325" + }, + "value": 23 + } + } + } + } + }, + "serviceArtifactReference": { + "$id": "3952", + "kind": "model", + "type": { + "$ref": "1333" + }, + "value": { + "$id": "3953", + "id": { + "$id": "3954", + "kind": "string", + "type": { + "$ref": "1335" + }, + "value": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/serviceArtifacts/{serviceArtifactsName}/vmArtifactsProfiles/{vmArtifactsProfileName}" + } + } + }, + "securityPostureReference": { + "$id": "3955", + "kind": "model", + "type": { + "$ref": "1342" + }, + "value": { + "$id": "3956", + "id": { + "$id": "3957", + "kind": "string", + "type": { + "$ref": "1344" + }, + "value": "/CommunityGalleries/{communityGalleryName}/securityPostures/{securityPostureName}/versions/{major.minor.patch}|{major.*}|latest" + }, + "excludeExtensions": { + "$id": "3958", + "kind": "array", + "type": { + "$ref": "1348" + }, + "value": [ + { + "$id": "3959", + "kind": "string", + "type": { + "$ref": "1349" + }, + "value": "{securityPostureVMExtensionName}" + } + ] + }, + "isOverridable": { + "$id": "3960", + "kind": "boolean", + "type": { + "$ref": "1353" + }, + "value": true + } + } + } + } + }, + "computeApiVersion": { + "$id": "3961", + "kind": "string", + "type": { + "$ref": "1375" + }, + "value": "2023-07-01" + }, + "platformFaultDomainCount": { + "$id": "3962", + "kind": "number", + "type": { + "$ref": "1379" + }, + "value": 1 + } + } + } + } + }, + "plan": { + "$id": "3963", + "kind": "model", + "type": { + "$ref": "1524" + }, + "value": { + "$id": "3964", + "name": { + "$id": "3965", + "kind": "string", + "type": { + "$ref": "1526" + }, + "value": "jwgrcrnrtfoxn" + }, + "publisher": { + "$id": "3966", + "kind": "string", + "type": { + "$ref": "1530" + }, + "value": "iozjbiqqckqm" + }, + "product": { + "$id": "3967", + "kind": "string", + "type": { + "$ref": "1534" + }, + "value": "cgopbyvdyqikahwyxfpzwaqk" + }, + "promotionCode": { + "$id": "3968", + "kind": "string", + "type": { + "$ref": "1538" + }, + "value": "naglezezplcaruqogtxnuizslqnnbr" + }, + "version": { + "$id": "3969", + "kind": "string", + "type": { + "$ref": "1542" + }, + "value": "wa" + } + } + } + } + } + } + ], + "responses": [ + { + "$id": "3970", + "response": { + "$ref": "3606" + }, + "statusCode": 200, + "bodyValue": { + "$id": "3971", + "kind": "model", + "type": { + "$ref": "350" + }, + "value": { + "$id": "3972", + "properties": { + "$id": "3973", + "kind": "model", + "type": { + "$ref": "406" + }, + "value": { + "$id": "3974", + "spotPriorityProfile": { + "$id": "3975", + "kind": "model", + "type": { + "$ref": "411" + }, + "value": { + "$id": "3976", + "capacity": { + "$id": "3977", + "kind": "number", + "type": { + "$ref": "413" + }, + "value": 20 + }, + "minCapacity": { + "$id": "3978", + "kind": "number", + "type": { + "$ref": "417" + }, + "value": 10 + }, + "maxPricePerVM": { + "$id": "3979", + "kind": "number", + "type": { + "$ref": "421" + }, + "value": 0.00865 + }, + "evictionPolicy": { + "$id": "3980", + "kind": "string", + "type": { + "$ref": "18" + }, + "value": "Delete" + }, + "allocationStrategy": { + "$id": "3981", + "kind": "string", + "type": { + "$ref": "24" + }, + "value": "PriceCapacityOptimized" + }, + "maintain": { + "$id": "3982", + "kind": "boolean", + "type": { + "$ref": "431" + }, + "value": true + } + } + }, + "regularPriorityProfile": { + "$id": "3983", + "kind": "model", + "type": { + "$ref": "437" + }, + "value": { + "$id": "3984", + "capacity": { + "$id": "3985", + "kind": "number", + "type": { + "$ref": "439" + }, + "value": 20 + }, + "minCapacity": { + "$id": "3986", + "kind": "number", + "type": { + "$ref": "443" + }, + "value": 10 + }, + "allocationStrategy": { + "$id": "3987", + "kind": "string", + "type": { + "$ref": "32" + }, + "value": "LowestPrice" + } + } + }, + "vmSizesProfile": { + "$id": "3988", + "kind": "array", + "type": { + "$ref": "452" + }, + "value": [ + { + "$id": "3989", + "kind": "model", + "type": { + "$ref": "453" + }, + "value": { + "$id": "3990", + "name": { + "$id": "3991", + "kind": "string", + "type": { + "$ref": "455" + }, + "value": "Standard_d1_v2" + }, + "rank": { + "$id": "3992", + "kind": "number", + "type": { + "$ref": "459" + }, + "value": 19225 + } + } + } + ] + }, + "computeProfile": { + "$id": "3993", + "kind": "model", + "type": { + "$ref": "1370" + }, + "value": { + "$id": "3994", + "baseVirtualMachineProfile": { + "$id": "3995", + "kind": "model", + "type": { + "$ref": "565" + }, + "value": { + "$id": "3996", + "osProfile": { + "$id": "3997", + "kind": "model", + "type": { + "$ref": "567" + }, + "value": { + "$id": "3998", + "computerNamePrefix": { + "$id": "3999", + "kind": "string", + "type": { + "$ref": "569" + }, + "value": "o" + }, + "adminUsername": { + "$id": "4000", + "kind": "string", + "type": { + "$ref": "573" + }, + "value": "nrgzqciiaaxjrqldbmjbqkyhntp" + }, + "windowsConfiguration": { + "$id": "4001", + "kind": "model", + "type": { + "$ref": "585" + }, + "value": { + "$id": "4002", + "provisionVMAgent": { + "$id": "4003", + "kind": "boolean", + "type": { + "$ref": "587" + }, + "value": true + }, + "enableAutomaticUpdates": { + "$id": "4004", + "kind": "boolean", + "type": { + "$ref": "591" + }, + "value": true + }, + "timeZone": { + "$id": "4005", + "kind": "string", + "type": { + "$ref": "595" + }, + "value": "hlyjiqcfksgrpjrct" + }, + "additionalUnattendContent": { + "$id": "4006", + "kind": "array", + "type": { + "$ref": "599" + }, + "value": [ + { + "$id": "4007", + "kind": "model", + "type": { + "$ref": "600" + }, + "value": { + "$id": "4008", + "passName": { + "$id": "4009", + "kind": "string", + "type": { + "$ref": "602" + }, + "value": "OobeSystem" + }, + "componentName": { + "$id": "4010", + "kind": "string", + "type": { + "$ref": "606" + }, + "value": "Microsoft-Windows-Shell-Setup" + }, + "settingName": { + "$id": "4011", + "kind": "string", + "type": { + "$ref": "104" + }, + "value": "AutoLogon" + } + } + } + ] + }, + "patchSettings": { + "$id": "4012", + "kind": "model", + "type": { + "$ref": "619" + }, + "value": { + "$id": "4013", + "patchMode": { + "$id": "4014", + "kind": "string", + "type": { + "$ref": "110" + }, + "value": "Manual" + }, + "enableHotpatching": { + "$id": "4015", + "kind": "boolean", + "type": { + "$ref": "624" + }, + "value": true + }, + "assessmentMode": { + "$id": "4016", + "kind": "string", + "type": { + "$ref": "118" + }, + "value": "ImageDefault" + }, + "automaticByPlatformSettings": { + "$id": "4017", + "kind": "model", + "type": { + "$ref": "631" + }, + "value": { + "$id": "4018", + "rebootSetting": { + "$id": "4019", + "kind": "string", + "type": { + "$ref": "124" + }, + "value": "Unknown" + }, + "bypassPlatformSafetyChecksOnUserSchedule": { + "$id": "4020", + "kind": "boolean", + "type": { + "$ref": "636" + }, + "value": true + } + } + } + } + }, + "winRM": { + "$id": "4021", + "kind": "model", + "type": { + "$ref": "644" + }, + "value": { + "$id": "4022", + "listeners": { + "$id": "4023", + "kind": "array", + "type": { + "$ref": "646" + }, + "value": [ + { + "$id": "4024", + "kind": "model", + "type": { + "$ref": "647" + }, + "value": { + "$id": "4025", + "protocol": { + "$id": "4026", + "kind": "string", + "type": { + "$ref": "134" + }, + "value": "Http" + }, + "certificateUrl": { + "$id": "4027", + "kind": "string", + "type": { + "$ref": "652" + }, + "value": "https://myVaultName.vault.azure.net/secrets/myCertName" + } + } + } + ] + } + } + }, + "enableVMAgentPlatformUpdates": { + "$id": "4028", + "kind": "boolean", + "type": { + "$ref": "660" + }, + "value": true + } + } + }, + "linuxConfiguration": { + "$id": "4029", + "kind": "model", + "type": { + "$ref": "666" + }, + "value": { + "$id": "4030", + "disablePasswordAuthentication": { + "$id": "4031", + "kind": "boolean", + "type": { + "$ref": "668" + }, + "value": true + }, + "ssh": { + "$id": "4032", + "kind": "model", + "type": { + "$ref": "672" + }, + "value": { + "$id": "4033", + "publicKeys": { + "$id": "4034", + "kind": "array", + "type": { + "$ref": "674" + }, + "value": [ + { + "$id": "4035", + "kind": "model", + "type": { + "$ref": "675" + }, + "value": { + "$id": "4036", + "path": { + "$id": "4037", + "kind": "string", + "type": { + "$ref": "677" + }, + "value": "kmqz" + }, + "keyData": { + "$id": "4038", + "kind": "string", + "type": { + "$ref": "681" + }, + "value": "kivgsubusvpprwqaqpjcmhsv" + } + } + } + ] + } + } + }, + "provisionVMAgent": { + "$id": "4039", + "kind": "boolean", + "type": { + "$ref": "689" + }, + "value": true + }, + "patchSettings": { + "$id": "4040", + "kind": "model", + "type": { + "$ref": "693" + }, + "value": { + "$id": "4041", + "patchMode": { + "$id": "4042", + "kind": "string", + "type": { + "$ref": "140" + }, + "value": "ImageDefault" + }, + "assessmentMode": { + "$id": "4043", + "kind": "string", + "type": { + "$ref": "146" + }, + "value": "ImageDefault" + }, + "automaticByPlatformSettings": { + "$id": "4044", + "kind": "model", + "type": { + "$ref": "701" + }, + "value": { + "$id": "4045", + "rebootSetting": { + "$id": "4046", + "kind": "string", + "type": { + "$ref": "152" + }, + "value": "Unknown" + }, + "bypassPlatformSafetyChecksOnUserSchedule": { + "$id": "4047", + "kind": "boolean", + "type": { + "$ref": "706" + }, + "value": true + } + } + } + } + }, + "enableVMAgentPlatformUpdates": { + "$id": "4048", + "kind": "boolean", + "type": { + "$ref": "714" + }, + "value": true + } + } + }, + "secrets": { + "$id": "4049", + "kind": "array", + "type": { + "$ref": "720" + }, + "value": [ + { + "$id": "4050", + "kind": "model", + "type": { + "$ref": "721" + }, + "value": { + "$id": "4051", + "sourceVault": { + "$id": "4052", + "kind": "model", + "type": { + "$ref": "723" + }, + "value": { + "$id": "4053", + "id": { + "$id": "4054", + "kind": "string", + "type": { + "$ref": "725" + }, + "value": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault/vaults/{vaultName}" + } + } + }, + "vaultCertificates": { + "$id": "4055", + "kind": "array", + "type": { + "$ref": "732" + }, + "value": [ + { + "$id": "4056", + "kind": "model", + "type": { + "$ref": "733" + }, + "value": { + "$id": "4057", + "certificateUrl": { + "$id": "4058", + "kind": "string", + "type": { + "$ref": "735" + }, + "value": "https://myVaultName.vault.azure.net/secrets/myCertName" + }, + "certificateStore": { + "$id": "4059", + "kind": "string", + "type": { + "$ref": "739" + }, + "value": "nlxrwavpzhueffxsshlun" + } + } + } + ] + } + } + } + ] + }, + "allowExtensionOperations": { + "$id": "4060", + "kind": "boolean", + "type": { + "$ref": "747" + }, + "value": true + }, + "requireGuestProvisionSignal": { + "$id": "4061", + "kind": "boolean", + "type": { + "$ref": "751" + }, + "value": true + } + } + }, + "storageProfile": { + "$id": "4062", + "kind": "model", + "type": { + "$ref": "757" + }, + "value": { + "$id": "4063", + "imageReference": { + "$id": "4064", + "kind": "model", + "type": { + "$ref": "759" + }, + "value": { + "$id": "4065", + "publisher": { + "$id": "4066", + "kind": "string", + "type": { + "$ref": "766" + }, + "value": "mqxgwbiyjzmxavhbkd" + }, + "offer": { + "$id": "4067", + "kind": "string", + "type": { + "$ref": "770" + }, + "value": "isxgumkarlkomp" + }, + "sku": { + "$id": "4068", + "kind": "string", + "type": { + "$ref": "774" + }, + "value": "eojmppqcrnpmxirtp" + }, + "version": { + "$id": "4069", + "kind": "string", + "type": { + "$ref": "778" + }, + "value": "wvpcqefgtmqdgltiuz" + }, + "sharedGalleryImageId": { + "$id": "4070", + "kind": "string", + "type": { + "$ref": "786" + }, + "value": "kmkgihoxwlawuuhcinfirktdwkmx" + }, + "communityGalleryImageId": { + "$id": "4071", + "kind": "string", + "type": { + "$ref": "790" + }, + "value": "vlqe" + }, + "id": { + "$id": "4072", + "kind": "string", + "type": { + "$ref": "761" + }, + "value": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/images/{imageName}/versions/{versionName}" + }, + "exactVersion": { + "$id": "4073", + "kind": "string", + "type": { + "$ref": "782" + }, + "value": "zjbntmiskjexlr" + } + } + }, + "osDisk": { + "$id": "4074", + "kind": "model", + "type": { + "$ref": "796" + }, + "value": { + "$id": "4075", + "name": { + "$id": "4076", + "kind": "string", + "type": { + "$ref": "798" + }, + "value": "wfttw" + }, + "caching": { + "$id": "4077", + "kind": "string", + "type": { + "$ref": "162" + }, + "value": "None" + }, + "writeAcceleratorEnabled": { + "$id": "4078", + "kind": "boolean", + "type": { + "$ref": "805" + }, + "value": true + }, + "createOption": { + "$id": "4079", + "kind": "string", + "type": { + "$ref": "170" + }, + "value": "FromImage" + }, + "diffDiskSettings": { + "$id": "4080", + "kind": "model", + "type": { + "$ref": "812" + }, + "value": { + "$id": "4081", + "option": { + "$id": "4082", + "kind": "string", + "type": { + "$ref": "182" + }, + "value": "Local" + }, + "placement": { + "$id": "4083", + "kind": "string", + "type": { + "$ref": "186" + }, + "value": "CacheDisk" + } + } + }, + "diskSizeGB": { + "$id": "4084", + "kind": "number", + "type": { + "$ref": "822" + }, + "value": 14 + }, + "osType": { + "$id": "4085", + "kind": "string", + "type": { + "$ref": "194" + }, + "value": "Windows" + }, + "image": { + "$id": "4086", + "kind": "model", + "type": { + "$ref": "829" + }, + "value": { + "$id": "4087", + "uri": { + "$id": "4088", + "kind": "string", + "type": { + "$ref": "831" + }, + "value": "https://myStorageAccountName.blob.core.windows.net/myContainerName/myVhdName.vhd" + } + } + }, + "vhdContainers": { + "$id": "4089", + "kind": "array", + "type": { + "$ref": "837" + }, + "value": [ + { + "$id": "4090", + "kind": "string", + "type": { + "$ref": "838" + }, + "value": "tkzcwddtinkfpnfklatw" + } + ] + }, + "managedDisk": { + "$id": "4091", + "kind": "model", + "type": { + "$ref": "842" + }, + "value": { + "$id": "4092", + "storageAccountType": { + "$id": "4093", + "kind": "string", + "type": { + "$ref": "200" + }, + "value": "Standard_LRS" + }, + "diskEncryptionSet": { + "$id": "4094", + "kind": "model", + "type": { + "$ref": "847" + }, + "value": { + "$id": "4095", + "id": { + "$id": "4096", + "kind": "string", + "type": { + "$ref": "849" + }, + "value": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskEncryptionSets/{diskEncryptionSetName}" + } + } + }, + "securityProfile": { + "$id": "4097", + "kind": "model", + "type": { + "$ref": "856" + }, + "value": { + "$id": "4098", + "securityEncryptionType": { + "$id": "4099", + "kind": "string", + "type": { + "$ref": "216" + }, + "value": "VMGuestStateOnly" + }, + "diskEncryptionSet": { + "$id": "4100", + "kind": "model", + "type": { + "$ref": "847" + }, + "value": { + "$id": "4101", + "id": { + "$id": "4102", + "kind": "string", + "type": { + "$ref": "849" + }, + "value": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskEncryptionSets/{diskEncryptionSetName}" + } + } + } + } + } + } + }, + "deleteOption": { + "$id": "4103", + "kind": "string", + "type": { + "$ref": "224" + }, + "value": "Delete" + } + } + }, + "dataDisks": { + "$id": "4104", + "kind": "array", + "type": { + "$ref": "873" + }, + "value": [ + { + "$id": "4105", + "kind": "model", + "type": { + "$ref": "874" + }, + "value": { + "$id": "4106", + "name": { + "$id": "4107", + "kind": "string", + "type": { + "$ref": "876" + }, + "value": "eogiykmdmeikswxmigjws" + }, + "lun": { + "$id": "4108", + "kind": "number", + "type": { + "$ref": "880" + }, + "value": 14 + }, + "caching": { + "$id": "4109", + "kind": "string", + "type": { + "$ref": "162" + }, + "value": "None" + }, + "writeAcceleratorEnabled": { + "$id": "4110", + "kind": "boolean", + "type": { + "$ref": "887" + }, + "value": true + }, + "createOption": { + "$id": "4111", + "kind": "string", + "type": { + "$ref": "170" + }, + "value": "FromImage" + }, + "diskSizeGB": { + "$id": "4112", + "kind": "number", + "type": { + "$ref": "894" + }, + "value": 6 + }, + "managedDisk": { + "$id": "4113", + "kind": "model", + "type": { + "$ref": "842" + }, + "value": { + "$id": "4114", + "storageAccountType": { + "$id": "4115", + "kind": "string", + "type": { + "$ref": "200" + }, + "value": "Standard_LRS" + }, + "diskEncryptionSet": { + "$id": "4116", + "kind": "model", + "type": { + "$ref": "847" + }, + "value": { + "$id": "4117", + "id": { + "$id": "4118", + "kind": "string", + "type": { + "$ref": "849" + }, + "value": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskEncryptionSets/{diskEncryptionSetName}" + } + } + }, + "securityProfile": { + "$id": "4119", + "kind": "model", + "type": { + "$ref": "856" + }, + "value": { + "$id": "4120", + "securityEncryptionType": { + "$id": "4121", + "kind": "string", + "type": { + "$ref": "216" + }, + "value": "VMGuestStateOnly" + }, + "diskEncryptionSet": { + "$id": "4122", + "kind": "model", + "type": { + "$ref": "847" + }, + "value": { + "$id": "4123", + "id": { + "$id": "4124", + "kind": "string", + "type": { + "$ref": "849" + }, + "value": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskEncryptionSets/{diskEncryptionSetName}" + } + } + } + } + } + } + }, + "diskIOPSReadWrite": { + "$id": "4125", + "kind": "number", + "type": { + "$ref": "901" + }, + "value": 27 + }, + "diskMBpsReadWrite": { + "$id": "4126", + "kind": "number", + "type": { + "$ref": "905" + }, + "value": 2 + }, + "deleteOption": { + "$id": "4127", + "kind": "string", + "type": { + "$ref": "224" + }, + "value": "Delete" + } + } + } + ] + } + } + }, + "networkProfile": { + "$id": "4128", + "kind": "model", + "type": { + "$ref": "919" + }, + "value": { + "$id": "4129", + "healthProbe": { + "$id": "4130", + "kind": "model", + "type": { + "$ref": "921" + }, + "value": { + "$id": "4131", + "id": { + "$id": "4132", + "kind": "string", + "type": { + "$ref": "923" + }, + "value": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/probes/{probeName}" + } + } + }, + "networkInterfaceConfigurations": { + "$id": "4133", + "kind": "array", + "type": { + "$ref": "930" + }, + "value": [ + { + "$id": "4134", + "kind": "model", + "type": { + "$ref": "931" + }, + "value": { + "$id": "4135", + "name": { + "$id": "4136", + "kind": "string", + "type": { + "$ref": "933" + }, + "value": "i" + }, + "properties": { + "$id": "4137", + "kind": "model", + "type": { + "$ref": "937" + }, + "value": { + "$id": "4138", + "primary": { + "$id": "4139", + "kind": "boolean", + "type": { + "$ref": "939" + }, + "value": true + }, + "enableAcceleratedNetworking": { + "$id": "4140", + "kind": "boolean", + "type": { + "$ref": "943" + }, + "value": true + }, + "disableTcpStateTracking": { + "$id": "4141", + "kind": "boolean", + "type": { + "$ref": "947" + }, + "value": true + }, + "enableFpga": { + "$id": "4142", + "kind": "boolean", + "type": { + "$ref": "951" + }, + "value": true + }, + "networkSecurityGroup": { + "$id": "4143", + "kind": "model", + "type": { + "$ref": "723" + }, + "value": { + "$id": "4144", + "id": { + "$id": "4145", + "kind": "string", + "type": { + "$ref": "725" + }, + "value": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}" + } + } + }, + "dnsSettings": { + "$id": "4146", + "kind": "model", + "type": { + "$ref": "958" + }, + "value": { + "$id": "4147", + "dnsServers": { + "$id": "4148", + "kind": "array", + "type": { + "$ref": "960" + }, + "value": [ + { + "$id": "4149", + "kind": "string", + "type": { + "$ref": "961" + }, + "value": "nxmmfolhclsesu" + } + ] + } + } + }, + "ipConfigurations": { + "$id": "4150", + "kind": "array", + "type": { + "$ref": "967" + }, + "value": [ + { + "$id": "4151", + "kind": "model", + "type": { + "$ref": "968" + }, + "value": { + "$id": "4152", + "name": { + "$id": "4153", + "kind": "string", + "type": { + "$ref": "970" + }, + "value": "oezqhkidfhyywlfzwuotilrpbqnjg" + }, + "properties": { + "$id": "4154", + "kind": "model", + "type": { + "$ref": "974" + }, + "value": { + "$id": "4155", + "subnet": { + "$id": "4156", + "kind": "model", + "type": { + "$ref": "921" + }, + "value": { + "$id": "4157", + "id": { + "$id": "4158", + "kind": "string", + "type": { + "$ref": "923" + }, + "value": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}" + } + } + }, + "primary": { + "$id": "4159", + "kind": "boolean", + "type": { + "$ref": "979" + }, + "value": true + }, + "publicIPAddressConfiguration": { + "$id": "4160", + "kind": "model", + "type": { + "$ref": "983" + }, + "value": { + "$id": "4161", + "name": { + "$id": "4162", + "kind": "string", + "type": { + "$ref": "985" + }, + "value": "fvpqf" + }, + "properties": { + "$id": "4163", + "kind": "model", + "type": { + "$ref": "989" + }, + "value": { + "$id": "4164", + "idleTimeoutInMinutes": { + "$id": "4165", + "kind": "number", + "type": { + "$ref": "991" + }, + "value": 9 + }, + "dnsSettings": { + "$id": "4166", + "kind": "model", + "type": { + "$ref": "995" + }, + "value": { + "$id": "4167", + "domainNameLabel": { + "$id": "4168", + "kind": "string", + "type": { + "$ref": "997" + }, + "value": "ukrddzvmorpmfsczjwtbvp" + }, + "domainNameLabelScope": { + "$id": "4169", + "kind": "string", + "type": { + "$ref": "236" + }, + "value": "TenantReuse" + } + } + }, + "ipTags": { + "$id": "4170", + "kind": "array", + "type": { + "$ref": "1006" + }, + "value": [ + { + "$id": "4171", + "kind": "model", + "type": { + "$ref": "1007" + }, + "value": { + "$id": "4172", + "ipTagType": { + "$id": "4173", + "kind": "string", + "type": { + "$ref": "1009" + }, + "value": "sddgsoemnzgqizale" + }, + "tag": { + "$id": "4174", + "kind": "string", + "type": { + "$ref": "1013" + }, + "value": "wufmhrjsakbiaetyara" + } + } + } + ] + }, + "publicIPPrefix": { + "$id": "4175", + "kind": "model", + "type": { + "$ref": "723" + }, + "value": { + "$id": "4176", + "id": { + "$id": "4177", + "kind": "string", + "type": { + "$ref": "725" + }, + "value": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPPrefixes/{publicIPPrefixName}" + } + } + }, + "publicIPAddressVersion": { + "$id": "4178", + "kind": "string", + "type": { + "$ref": "246" + }, + "value": "IPv4" + }, + "deleteOption": { + "$id": "4179", + "kind": "string", + "type": { + "$ref": "252" + }, + "value": "Delete" + } + } + }, + "sku": { + "$id": "4180", + "kind": "model", + "type": { + "$ref": "1030" + }, + "value": { + "$id": "4181", + "name": { + "$id": "4182", + "kind": "string", + "type": { + "$ref": "258" + }, + "value": "Basic" + }, + "tier": { + "$id": "4183", + "kind": "string", + "type": { + "$ref": "264" + }, + "value": "Regional" + } + } + } + } + }, + "privateIPAddressVersion": { + "$id": "4184", + "kind": "string", + "type": { + "$ref": "246" + }, + "value": "IPv4" + }, + "applicationGatewayBackendAddressPools": { + "$id": "4185", + "kind": "array", + "type": { + "$ref": "1045" + }, + "value": [ + { + "$id": "4186", + "kind": "model", + "type": { + "$ref": "723" + }, + "value": { + "$id": "4187", + "id": { + "$id": "4188", + "kind": "string", + "type": { + "$ref": "725" + }, + "value": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}/backendAddressPools/{backendAddressPoolName}" + } + } + } + ] + }, + "applicationSecurityGroups": { + "$id": "4189", + "kind": "array", + "type": { + "$ref": "1049" + }, + "value": [ + { + "$id": "4190", + "kind": "model", + "type": { + "$ref": "723" + }, + "value": { + "$id": "4191", + "id": { + "$id": "4192", + "kind": "string", + "type": { + "$ref": "725" + }, + "value": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationSecurityGroups/{applicationSecurityGroupName}" + } + } + } + ] + }, + "loadBalancerBackendAddressPools": { + "$id": "4193", + "kind": "array", + "type": { + "$ref": "1053" + }, + "value": [ + { + "$id": "4194", + "kind": "model", + "type": { + "$ref": "723" + }, + "value": { + "$id": "4195", + "id": { + "$id": "4196", + "kind": "string", + "type": { + "$ref": "725" + }, + "value": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/backendAddressPools/{backendAddressPoolName}" + } + } + } + ] + }, + "loadBalancerInboundNatPools": { + "$id": "4197", + "kind": "array", + "type": { + "$ref": "1057" + }, + "value": [ + { + "$id": "4198", + "kind": "model", + "type": { + "$ref": "723" + }, + "value": { + "$id": "4199", + "id": { + "$id": "4200", + "kind": "string", + "type": { + "$ref": "725" + }, + "value": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/inboundNatPools/{inboundNatPoolName}" + } + } + } + ] + } + } + } + } + } + ] + }, + "enableIPForwarding": { + "$id": "4201", + "kind": "boolean", + "type": { + "$ref": "1065" + }, + "value": true + }, + "deleteOption": { + "$id": "4202", + "kind": "string", + "type": { + "$ref": "252" + }, + "value": "Delete" + }, + "auxiliaryMode": { + "$id": "4203", + "kind": "string", + "type": { + "$ref": "270" + }, + "value": "None" + }, + "auxiliarySku": { + "$id": "4204", + "kind": "string", + "type": { + "$ref": "278" + }, + "value": "None" + } + } + } + } + } + ] + }, + "networkApiVersion": { + "$id": "4205", + "kind": "string", + "type": { + "$ref": "290" + }, + "value": "2020-11-01" + } + } + }, + "securityProfile": { + "$id": "4206", + "kind": "model", + "type": { + "$ref": "1087" + }, + "value": { + "$id": "4207", + "uefiSettings": { + "$id": "4208", + "kind": "model", + "type": { + "$ref": "1089" + }, + "value": { + "$id": "4209", + "secureBootEnabled": { + "$id": "4210", + "kind": "boolean", + "type": { + "$ref": "1091" + }, + "value": true + }, + "vTpmEnabled": { + "$id": "4211", + "kind": "boolean", + "type": { + "$ref": "1095" + }, + "value": true + } + } + }, + "encryptionAtHost": { + "$id": "4212", + "kind": "boolean", + "type": { + "$ref": "1101" + }, + "value": true + }, + "securityType": { + "$id": "4213", + "kind": "string", + "type": { + "$ref": "294" + }, + "value": "TrustedLaunch" + }, + "encryptionIdentity": { + "$id": "4214", + "kind": "model", + "type": { + "$ref": "1108" + }, + "value": { + "$id": "4215", + "userAssignedIdentityResourceId": { + "$id": "4216", + "kind": "string", + "type": { + "$ref": "1110" + }, + "value": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{userAssignedIdentityName}" + } + } + }, + "proxyAgentSettings": { + "$id": "4217", + "kind": "model", + "type": { + "$ref": "1117" + }, + "value": { + "$id": "4218", + "enabled": { + "$id": "4219", + "kind": "boolean", + "type": { + "$ref": "1119" + }, + "value": true + }, + "mode": { + "$id": "4220", + "kind": "string", + "type": { + "$ref": "300" + }, + "value": "Audit" + }, + "keyIncarnationId": { + "$id": "4221", + "kind": "number", + "type": { + "$ref": "1126" + }, + "value": 20 + } + } + } + } + }, + "diagnosticsProfile": { + "$id": "4222", + "kind": "model", + "type": { + "$ref": "1134" + }, + "value": { + "$id": "4223", + "bootDiagnostics": { + "$id": "4224", + "kind": "model", + "type": { + "$ref": "1136" + }, + "value": { + "$id": "4225", + "enabled": { + "$id": "4226", + "kind": "boolean", + "type": { + "$ref": "1138" + }, + "value": true + }, + "storageUri": { + "$id": "4227", + "kind": "string", + "type": { + "$ref": "1142" + }, + "value": "http://myStorageAccountName.blob.core.windows.net" + } + } + } + } + }, + "extensionProfile": { + "$id": "4228", + "kind": "model", + "type": { + "$ref": "1150" + }, + "value": { + "$id": "4229", + "extensions": { + "$id": "4230", + "kind": "array", + "type": { + "$ref": "1152" + }, + "value": [ + { + "$id": "4231", + "kind": "model", + "type": { + "$ref": "1153" + }, + "value": { + "$id": "4232", + "name": { + "$id": "4233", + "kind": "string", + "type": { + "$ref": "1160" + }, + "value": "bndxuxx" + }, + "properties": { + "$id": "4234", + "kind": "model", + "type": { + "$ref": "1168" + }, + "value": { + "$id": "4235", + "forceUpdateTag": { + "$id": "4236", + "kind": "string", + "type": { + "$ref": "1170" + }, + "value": "yhgxw" + }, + "publisher": { + "$id": "4237", + "kind": "string", + "type": { + "$ref": "1174" + }, + "value": "kpxtirxjfprhs" + }, + "type": { + "$id": "4238", + "kind": "string", + "type": { + "$ref": "1178" + }, + "value": "pgjilctjjwaa" + }, + "typeHandlerVersion": { + "$id": "4239", + "kind": "string", + "type": { + "$ref": "1182" + }, + "value": "zevivcoilxmbwlrihhhibq" + }, + "autoUpgradeMinorVersion": { + "$id": "4240", + "kind": "boolean", + "type": { + "$ref": "1186" + }, + "value": true + }, + "enableAutomaticUpgrade": { + "$id": "4241", + "kind": "boolean", + "type": { + "$ref": "1190" + }, + "value": true + }, + "provisionAfterExtensions": { + "$id": "4242", + "kind": "array", + "type": { + "$ref": "1210" + }, + "value": [ + { + "$id": "4243", + "kind": "string", + "type": { + "$ref": "1211" + }, + "value": "nftzosroolbcwmpupujzqwqe" + } + ] + }, + "suppressFailures": { + "$id": "4244", + "kind": "boolean", + "type": { + "$ref": "1215" + }, + "value": true + }, + "protectedSettingsFromKeyVault": { + "$id": "4245", + "kind": "model", + "type": { + "$ref": "1219" + }, + "value": { + "$id": "4246", + "secretUrl": { + "$id": "4247", + "kind": "string", + "type": { + "$ref": "1221" + }, + "value": "https://myVaultName.vault.azure.net/secrets/secret/mySecretName" + }, + "sourceVault": { + "$id": "4248", + "kind": "model", + "type": { + "$ref": "723" + }, + "value": { + "$id": "4249", + "id": { + "$id": "4250", + "kind": "string", + "type": { + "$ref": "725" + }, + "value": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault/vaults/{vaultName}" + } + } + } + } + }, + "settings": { + "$id": "4251", + "kind": "dict", + "type": { + "$ref": "1194" + }, + "value": { + "$id": "4252" + } + }, + "provisioningState": { + "$id": "4253", + "kind": "string", + "type": { + "$ref": "1206" + }, + "value": "Succeeded" + } + } + }, + "type": { + "$id": "4254", + "kind": "string", + "type": { + "$ref": "1164" + }, + "value": "cmeam" + }, + "id": { + "$id": "4255", + "kind": "string", + "type": { + "$ref": "1155" + }, + "value": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/extensions/{extensionName}" + } + } + } + ] + }, + "extensionsTimeBudget": { + "$id": "4256", + "kind": "string", + "type": { + "$ref": "1234" + }, + "value": "mbhjahtdygwgyszdwjtvlvtgchdwil" + } + } + }, + "licenseType": { + "$id": "4257", + "kind": "string", + "type": { + "$ref": "1240" + }, + "value": "v" + }, + "scheduledEventsProfile": { + "$id": "4258", + "kind": "model", + "type": { + "$ref": "1244" + }, + "value": { + "$id": "4259", + "terminateNotificationProfile": { + "$id": "4260", + "kind": "model", + "type": { + "$ref": "1246" + }, + "value": { + "$id": "4261", + "notBeforeTimeout": { + "$id": "4262", + "kind": "string", + "type": { + "$ref": "1248" + }, + "value": "iljppmmw" + }, + "enable": { + "$id": "4263", + "kind": "boolean", + "type": { + "$ref": "1252" + }, + "value": true + } + } + }, + "osImageNotificationProfile": { + "$id": "4264", + "kind": "model", + "type": { + "$ref": "1258" + }, + "value": { + "$id": "4265", + "notBeforeTimeout": { + "$id": "4266", + "kind": "string", + "type": { + "$ref": "1260" + }, + "value": "olbpadmevekyczfokodtfprxti" + }, + "enable": { + "$id": "4267", + "kind": "boolean", + "type": { + "$ref": "1264" + }, + "value": true + } + } + } + } + }, + "userData": { + "$id": "4268", + "kind": "string", + "type": { + "$ref": "1272" + }, + "value": "s" + }, + "capacityReservation": { + "$id": "4269", + "kind": "model", + "type": { + "$ref": "1276" + }, + "value": { + "$id": "4270", + "capacityReservationGroup": { + "$id": "4271", + "kind": "model", + "type": { + "$ref": "723" + }, + "value": { + "$id": "4272", + "id": { + "$id": "4273", + "kind": "string", + "type": { + "$ref": "725" + }, + "value": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/capacityReservationGroups/{capacityReservationGroupName}" + } + } + } + } + }, + "applicationProfile": { + "$id": "4274", + "kind": "model", + "type": { + "$ref": "1283" + }, + "value": { + "$id": "4275", + "galleryApplications": { + "$id": "4276", + "kind": "array", + "type": { + "$ref": "1285" + }, + "value": [ + { + "$id": "4277", + "kind": "model", + "type": { + "$ref": "1286" + }, + "value": { + "$id": "4278", + "tags": { + "$id": "4279", + "kind": "string", + "type": { + "$ref": "1288" + }, + "value": "eyrqjbib" + }, + "order": { + "$id": "4280", + "kind": "number", + "type": { + "$ref": "1292" + }, + "value": 5 + }, + "packageReferenceId": { + "$id": "4281", + "kind": "string", + "type": { + "$ref": "1296" + }, + "value": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/applications/{applicationName}/versions/{versionName}" + }, + "treatFailureAsDeploymentFailure": { + "$id": "4282", + "kind": "boolean", + "type": { + "$ref": "1305" + }, + "value": true + }, + "enableAutomaticUpgrade": { + "$id": "4283", + "kind": "boolean", + "type": { + "$ref": "1309" + }, + "value": true + } + } + } + ] + } + } + }, + "hardwareProfile": { + "$id": "4284", + "kind": "model", + "type": { + "$ref": "1317" + }, + "value": { + "$id": "4285", + "vmSizeProperties": { + "$id": "4286", + "kind": "model", + "type": { + "$ref": "1319" + }, + "value": { + "$id": "4287", + "vCPUsAvailable": { + "$id": "4288", + "kind": "number", + "type": { + "$ref": "1321" + }, + "value": 16 + }, + "vCPUsPerCore": { + "$id": "4289", + "kind": "number", + "type": { + "$ref": "1325" + }, + "value": 23 + } + } + } + } + }, + "serviceArtifactReference": { + "$id": "4290", + "kind": "model", + "type": { + "$ref": "1333" + }, + "value": { + "$id": "4291", + "id": { + "$id": "4292", + "kind": "string", + "type": { + "$ref": "1335" + }, + "value": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/serviceArtifacts/{serviceArtifactsName}/vmArtifactsProfiles/{vmArtifactsProfileName}" + } + } + }, + "securityPostureReference": { + "$id": "4293", + "kind": "model", + "type": { + "$ref": "1342" + }, + "value": { + "$id": "4294", + "id": { + "$id": "4295", + "kind": "string", + "type": { + "$ref": "1344" + }, + "value": "/CommunityGalleries/{communityGalleryName}/securityPostures/{securityPostureName}/versions/{major.minor.patch}|{major.*}|latest" + }, + "excludeExtensions": { + "$id": "4296", + "kind": "array", + "type": { + "$ref": "1348" + }, + "value": [ + { + "$id": "4297", + "kind": "string", + "type": { + "$ref": "1349" + }, + "value": "{securityPostureVMExtensionName}" + } + ] + }, + "isOverridable": { + "$id": "4298", + "kind": "boolean", + "type": { + "$ref": "1353" + }, + "value": true + } + } + }, + "timeCreated": { + "$id": "4299", + "kind": "string", + "type": { + "$ref": "1359" + }, + "value": "2024-04-29T21:51:44.043Z" + } + } + }, + "computeApiVersion": { + "$id": "4300", + "kind": "string", + "type": { + "$ref": "1375" + }, + "value": "2023-07-01" + }, + "platformFaultDomainCount": { + "$id": "4301", + "kind": "number", + "type": { + "$ref": "1379" + }, + "value": 1 + } + } + }, + "provisioningState": { + "$id": "4302", + "kind": "string", + "type": { + "$ref": "2" + }, + "value": "Creating" + }, + "timeCreated": { + "$id": "4303", + "kind": "string", + "type": { + "$ref": "1397" + }, + "value": "2024-07-10T00:16:34.8590555+00:00" + }, + "uniqueId": { + "$id": "4304", + "kind": "string", + "type": { + "$ref": "1402" + }, + "value": "a2f7fabd-bbc2-4a20-afe1-49fdb3885a28" + } + } + }, + "zones": { + "$id": "4305", + "kind": "array", + "type": { + "$ref": "1408" + }, + "value": [ + { + "$id": "4306", + "kind": "string", + "type": { + "$ref": "1409" + }, + "value": "zone1" + }, + { + "$id": "4307", + "kind": "string", + "type": { + "$ref": "1409" + }, + "value": "zone2" + } + ] + }, + "identity": { + "$id": "4308", + "kind": "model", + "type": { + "$ref": "1413" + }, + "value": { + "$id": "4309", + "type": { + "$id": "4310", + "kind": "string", + "type": { + "$ref": "306" + }, + "value": "UserAssigned" + }, + "userAssignedIdentities": { + "$id": "4311", + "kind": "dict", + "type": { + "$ref": "1428" + }, + "value": { + "$id": "4312" + } + }, + "principalId": { + "$id": "4313", + "kind": "string", + "type": { + "$ref": "1415" + }, + "value": "4d508e5b-374b-4382-9a1c-01fb8b6cb37c" + }, + "tenantId": { + "$id": "4314", + "kind": "string", + "type": { + "$ref": "1420" + }, + "value": "5d508e5b-374b-4382-9a1c-01fb8b6cb37c" + } + } + }, + "tags": { + "$id": "4315", + "kind": "dict", + "type": { + "$ref": "396" + }, + "value": { + "$id": "4316" + } + }, + "location": { + "$id": "4317", + "kind": "string", + "type": { + "$ref": "402" + }, + "value": "westus" + }, + "plan": { + "$id": "4318", + "kind": "model", + "type": { + "$ref": "1447" + }, + "value": { + "$id": "4319", + "name": { + "$id": "4320", + "kind": "string", + "type": { + "$ref": "1449" + }, + "value": "uapfngmdekvpgjhomthtpxjfdmmll" + }, + "publisher": { + "$id": "4321", + "kind": "string", + "type": { + "$ref": "1453" + }, + "value": "aqhles" + }, + "product": { + "$id": "4322", + "kind": "string", + "type": { + "$ref": "1457" + }, + "value": "bfzbkdnbexmedxdc" + }, + "promotionCode": { + "$id": "4323", + "kind": "string", + "type": { + "$ref": "1461" + }, + "value": "gspehogwfjxirz" + }, + "version": { + "$id": "4324", + "kind": "string", + "type": { + "$ref": "1465" + }, + "value": "yza" + } + } + }, + "id": { + "$id": "4325", + "kind": "string", + "type": { + "$ref": "354" + }, + "value": "/subscriptions/7B0CD4DB-3381-4013-9B31-FB6E6FD0FF1C/resourceGroups/rgazurefleet/providers/Microsoft.AzureFleet/fleets/testFleet" + }, + "name": { + "$id": "4326", + "kind": "string", + "type": { + "$ref": "359" + }, + "value": "testFleet" + }, + "type": { + "$id": "4327", + "kind": "string", + "type": { + "$ref": "363" + }, + "value": "Microsoft.AzureFleet/fleets" + }, + "systemData": { + "$id": "4328", + "kind": "model", + "type": { + "$ref": "368" + }, + "value": { + "$id": "4329", + "createdBy": { + "$id": "4330", + "kind": "string", + "type": { + "$ref": "370" + }, + "value": "rowegentrpoajsv" + }, + "createdByType": { + "$id": "4331", + "kind": "string", + "type": { + "$ref": "316" + }, + "value": "User" + }, + "createdAt": { + "$id": "4332", + "kind": "string", + "type": { + "$ref": "377" + }, + "value": "2024-04-29T21:51:44.043Z" + }, + "lastModifiedBy": { + "$id": "4333", + "kind": "string", + "type": { + "$ref": "382" + }, + "value": "edwuayhhaoepxzisfaqjhmrxjq" + }, + "lastModifiedByType": { + "$id": "4334", + "kind": "string", + "type": { + "$ref": "316" + }, + "value": "User" + }, + "lastModifiedAt": { + "$id": "4335", + "kind": "string", + "type": { + "$ref": "389" + }, + "value": "2024-04-29T21:51:44.043Z" + } + } + } + } + } + }, + { + "$id": "4336", + "response": { + "$ref": "3607" + }, + "statusCode": 202 + } + ] + } + ] + }, + { + "$id": "4337", + "Name": "delete", + "ResourceName": "Fleet", + "Doc": "Delete a Fleet", + "Accessibility": "public", + "Parameters": [ + { + "$id": "4338", + "Name": "apiVersion", + "NameInRequest": "api-version", + "Doc": "The API version to use for this operation.", + "Type": { + "$id": "4339", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": true, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "DefaultValue": { + "$id": "4340", + "Type": { + "$id": "4341", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "2024-11-01" + }, + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "4342", + "Name": "subscriptionId", + "NameInRequest": "subscriptionId", + "Doc": "The ID of the target subscription. The value must be an UUID.", + "Type": { + "$id": "4343", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "4344", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "4345", + "Name": "resourceGroupName", + "NameInRequest": "resourceGroupName", + "Doc": "The name of the resource group. The name is case insensitive.", + "Type": { + "$id": "4346", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "4347", + "Name": "fleetName", + "NameInRequest": "fleetName", + "Doc": "The name of the Compute Fleet", + "Type": { + "$id": "4348", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "4349", + "Name": "accept", + "NameInRequest": "Accept", + "Type": { + "$id": "4350", + "kind": "constant", + "valueType": { + "$id": "4351", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "4352", + "StatusCodes": [ + 202 + ], + "BodyMediaType": "Json", + "Headers": [ + { + "$id": "4353", + "Name": "location", + "NameInResponse": "Location", + "Doc": "The Location header contains the URL where the status of the long running operation can be checked.", + "Type": { + "$id": "4354", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + } + }, + { + "$id": "4355", + "Name": "retryAfter", + "NameInResponse": "Retry-After", + "Doc": "The Retry-After header can indicate how long the client should wait before polling the operation status.", + "Type": { + "$id": "4356", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + } + } + ], + "IsErrorResponse": false + }, + { + "$id": "4357", + "StatusCodes": [ + 204 + ], + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false + } + ], + "HttpMethod": "DELETE", + "RequestBodyMediaType": "None", + "Uri": "{endpoint}", + "Path": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureFleet/fleets/{fleetName}", + "BufferResponse": true, + "LongRunning": { + "$id": "4358", + "FinalStateVia": 1, + "FinalResponse": { + "$id": "4359", + "StatusCodes": [ + 204 + ], + "BodyMediaType": "Json" + } + }, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Microsoft.AzureFleet.Fleets.delete", + "Decorators": [], + "Examples": [ + { + "$id": "4360", + "kind": "http", + "name": "Fleets_Delete", + "description": "Fleets_Delete", + "filePath": "2024-11-01/Fleets_Delete.json", + "parameters": [ + { + "$id": "4361", + "parameter": { + "$ref": "4338" + }, + "value": { + "$id": "4362", + "kind": "string", + "type": { + "$ref": "4339" + }, + "value": "2024-11-01" + } + }, + { + "$id": "4363", + "parameter": { + "$ref": "4342" + }, + "value": { + "$id": "4364", + "kind": "string", + "type": { + "$ref": "4343" + }, + "value": "1DC2F28C-A625-4B0E-9748-9885A3C9E9EB" + } + }, + { + "$id": "4365", + "parameter": { + "$ref": "4345" + }, + "value": { + "$id": "4366", + "kind": "string", + "type": { + "$ref": "4346" + }, + "value": "rgazurefleet" + } + }, + { + "$id": "4367", + "parameter": { + "$ref": "4347" + }, + "value": { + "$id": "4368", + "kind": "string", + "type": { + "$ref": "4348" + }, + "value": "testFleet" + } + } + ], + "responses": [ + { + "$id": "4369", + "response": { + "$ref": "4352" + }, + "statusCode": 202 + }, + { + "$id": "4370", + "response": { + "$ref": "4357" + }, + "statusCode": 204 + } + ] + } + ] + }, + { + "$id": "4371", + "Name": "listByResourceGroup", + "ResourceName": "Fleet", + "Doc": "List Fleet resources by resource group", + "Accessibility": "public", + "Parameters": [ + { + "$id": "4372", + "Name": "apiVersion", + "NameInRequest": "api-version", + "Doc": "The API version to use for this operation.", + "Type": { + "$id": "4373", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": true, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "DefaultValue": { + "$id": "4374", + "Type": { + "$id": "4375", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "2024-11-01" + }, + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "4376", + "Name": "subscriptionId", + "NameInRequest": "subscriptionId", + "Doc": "The ID of the target subscription. The value must be an UUID.", + "Type": { + "$id": "4377", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "4378", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "4379", + "Name": "resourceGroupName", + "NameInRequest": "resourceGroupName", + "Doc": "The name of the resource group. The name is case insensitive.", + "Type": { + "$id": "4380", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "4381", + "Name": "accept", + "NameInRequest": "Accept", + "Type": { + "$id": "4382", + "kind": "constant", + "valueType": { + "$id": "4383", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "4384", + "StatusCodes": [ + 200 + ], + "BodyType": { + "$ref": "1575" + }, + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false, + "ContentTypes": [ + "application/json" + ] + } + ], + "HttpMethod": "GET", + "RequestBodyMediaType": "None", + "Uri": "{endpoint}", + "Path": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureFleet/fleets", + "BufferResponse": true, + "Paging": { + "$id": "4385", + "ItemName": "value", + "NextLinkName": "nextLink" + }, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Microsoft.AzureFleet.Fleets.listByResourceGroup", + "Decorators": [], + "Examples": [ + { + "$id": "4386", + "kind": "http", + "name": "Fleets_ListByResourceGroup", + "description": "Fleets_ListByResourceGroup", + "filePath": "2024-11-01/Fleets_ListByResourceGroup.json", + "parameters": [ + { + "$id": "4387", + "parameter": { + "$ref": "4372" + }, + "value": { + "$id": "4388", + "kind": "string", + "type": { + "$ref": "4373" + }, + "value": "2024-11-01" + } + }, + { + "$id": "4389", + "parameter": { + "$ref": "4376" + }, + "value": { + "$id": "4390", + "kind": "string", + "type": { + "$ref": "4377" + }, + "value": "1DC2F28C-A625-4B0E-9748-9885A3C9E9EB" + } + }, + { + "$id": "4391", + "parameter": { + "$ref": "4379" + }, + "value": { + "$id": "4392", + "kind": "string", + "type": { + "$ref": "4380" + }, + "value": "rgazurefleet" + } + } + ], + "responses": [ + { + "$id": "4393", + "response": { + "$ref": "4384" + }, + "statusCode": 200, + "bodyValue": { + "$id": "4394", + "kind": "model", + "type": { + "$ref": "1575" + }, + "value": { + "$id": "4395", + "value": { + "$id": "4396", + "kind": "array", + "type": { + "$ref": "1577" + }, + "value": [ + { + "$id": "4397", + "kind": "model", + "type": { + "$ref": "350" + }, + "value": { + "$id": "4398", + "properties": { + "$id": "4399", + "kind": "model", + "type": { + "$ref": "406" + }, + "value": { + "$id": "4400", + "provisioningState": { + "$id": "4401", + "kind": "string", + "type": { + "$ref": "2" + }, + "value": "Creating" + }, + "spotPriorityProfile": { + "$id": "4402", + "kind": "model", + "type": { + "$ref": "411" + }, + "value": { + "$id": "4403", + "capacity": { + "$id": "4404", + "kind": "number", + "type": { + "$ref": "413" + }, + "value": 20 + }, + "minCapacity": { + "$id": "4405", + "kind": "number", + "type": { + "$ref": "417" + }, + "value": 10 + }, + "maxPricePerVM": { + "$id": "4406", + "kind": "number", + "type": { + "$ref": "421" + }, + "value": 0.00865 + }, + "evictionPolicy": { + "$id": "4407", + "kind": "string", + "type": { + "$ref": "18" + }, + "value": "Delete" + }, + "allocationStrategy": { + "$id": "4408", + "kind": "string", + "type": { + "$ref": "24" + }, + "value": "PriceCapacityOptimized" + }, + "maintain": { + "$id": "4409", + "kind": "boolean", + "type": { + "$ref": "431" + }, + "value": true + } + } + }, + "regularPriorityProfile": { + "$id": "4410", + "kind": "model", + "type": { + "$ref": "437" + }, + "value": { + "$id": "4411", + "capacity": { + "$id": "4412", + "kind": "number", + "type": { + "$ref": "439" + }, + "value": 20 + }, + "minCapacity": { + "$id": "4413", + "kind": "number", + "type": { + "$ref": "443" + }, + "value": 10 + }, + "allocationStrategy": { + "$id": "4414", + "kind": "string", + "type": { + "$ref": "32" + }, + "value": "LowestPrice" + } + } + }, + "vmSizesProfile": { + "$id": "4415", + "kind": "array", + "type": { + "$ref": "452" + }, + "value": [ + { + "$id": "4416", + "kind": "model", + "type": { + "$ref": "453" + }, + "value": { + "$id": "4417", + "name": { + "$id": "4418", + "kind": "string", + "type": { + "$ref": "455" + }, + "value": "Standard_d1_v2" + }, + "rank": { + "$id": "4419", + "kind": "number", + "type": { + "$ref": "459" + }, + "value": 19225 + } + } + } + ] + }, + "computeProfile": { + "$id": "4420", + "kind": "model", + "type": { + "$ref": "1370" + }, + "value": { + "$id": "4421", + "baseVirtualMachineProfile": { + "$id": "4422", + "kind": "model", + "type": { + "$ref": "565" + }, + "value": { + "$id": "4423", + "osProfile": { + "$id": "4424", + "kind": "model", + "type": { + "$ref": "567" + }, + "value": { + "$id": "4425", + "computerNamePrefix": { + "$id": "4426", + "kind": "string", + "type": { + "$ref": "569" + }, + "value": "o" + }, + "adminUsername": { + "$id": "4427", + "kind": "string", + "type": { + "$ref": "573" + }, + "value": "nrgzqciiaaxjrqldbmjbqkyhntp" + }, + "windowsConfiguration": { + "$id": "4428", + "kind": "model", + "type": { + "$ref": "585" + }, + "value": { + "$id": "4429", + "provisionVMAgent": { + "$id": "4430", + "kind": "boolean", + "type": { + "$ref": "587" + }, + "value": true + }, + "enableAutomaticUpdates": { + "$id": "4431", + "kind": "boolean", + "type": { + "$ref": "591" + }, + "value": true + }, + "timeZone": { + "$id": "4432", + "kind": "string", + "type": { + "$ref": "595" + }, + "value": "hlyjiqcfksgrpjrct" + }, + "additionalUnattendContent": { + "$id": "4433", + "kind": "array", + "type": { + "$ref": "599" + }, + "value": [ + { + "$id": "4434", + "kind": "model", + "type": { + "$ref": "600" + }, + "value": { + "$id": "4435", + "passName": { + "$id": "4436", + "kind": "string", + "type": { + "$ref": "602" + }, + "value": "OobeSystem" + }, + "componentName": { + "$id": "4437", + "kind": "string", + "type": { + "$ref": "606" + }, + "value": "Microsoft-Windows-Shell-Setup" + }, + "settingName": { + "$id": "4438", + "kind": "string", + "type": { + "$ref": "104" + }, + "value": "AutoLogon" + } + } + } + ] + }, + "patchSettings": { + "$id": "4439", + "kind": "model", + "type": { + "$ref": "619" + }, + "value": { + "$id": "4440", + "patchMode": { + "$id": "4441", + "kind": "string", + "type": { + "$ref": "110" + }, + "value": "Manual" + }, + "enableHotpatching": { + "$id": "4442", + "kind": "boolean", + "type": { + "$ref": "624" + }, + "value": true + }, + "assessmentMode": { + "$id": "4443", + "kind": "string", + "type": { + "$ref": "118" + }, + "value": "ImageDefault" + }, + "automaticByPlatformSettings": { + "$id": "4444", + "kind": "model", + "type": { + "$ref": "631" + }, + "value": { + "$id": "4445", + "rebootSetting": { + "$id": "4446", + "kind": "string", + "type": { + "$ref": "124" + }, + "value": "Unknown" + }, + "bypassPlatformSafetyChecksOnUserSchedule": { + "$id": "4447", + "kind": "boolean", + "type": { + "$ref": "636" + }, + "value": true + } + } + } + } + }, + "winRM": { + "$id": "4448", + "kind": "model", + "type": { + "$ref": "644" + }, + "value": { + "$id": "4449", + "listeners": { + "$id": "4450", + "kind": "array", + "type": { + "$ref": "646" + }, + "value": [ + { + "$id": "4451", + "kind": "model", + "type": { + "$ref": "647" + }, + "value": { + "$id": "4452", + "protocol": { + "$id": "4453", + "kind": "string", + "type": { + "$ref": "134" + }, + "value": "Http" + }, + "certificateUrl": { + "$id": "4454", + "kind": "string", + "type": { + "$ref": "652" + }, + "value": "https://myVaultName.vault.azure.net/secrets/myCertName" + } + } + } + ] + } + } + }, + "enableVMAgentPlatformUpdates": { + "$id": "4455", + "kind": "boolean", + "type": { + "$ref": "660" + }, + "value": true + } + } + }, + "linuxConfiguration": { + "$id": "4456", + "kind": "model", + "type": { + "$ref": "666" + }, + "value": { + "$id": "4457", + "disablePasswordAuthentication": { + "$id": "4458", + "kind": "boolean", + "type": { + "$ref": "668" + }, + "value": true + }, + "ssh": { + "$id": "4459", + "kind": "model", + "type": { + "$ref": "672" + }, + "value": { + "$id": "4460", + "publicKeys": { + "$id": "4461", + "kind": "array", + "type": { + "$ref": "674" + }, + "value": [ + { + "$id": "4462", + "kind": "model", + "type": { + "$ref": "675" + }, + "value": { + "$id": "4463", + "path": { + "$id": "4464", + "kind": "string", + "type": { + "$ref": "677" + }, + "value": "kmqz" + }, + "keyData": { + "$id": "4465", + "kind": "string", + "type": { + "$ref": "681" + }, + "value": "kivgsubusvpprwqaqpjcmhsv" + } + } + } + ] + } + } + }, + "provisionVMAgent": { + "$id": "4466", + "kind": "boolean", + "type": { + "$ref": "689" + }, + "value": true + }, + "patchSettings": { + "$id": "4467", + "kind": "model", + "type": { + "$ref": "693" + }, + "value": { + "$id": "4468", + "patchMode": { + "$id": "4469", + "kind": "string", + "type": { + "$ref": "140" + }, + "value": "ImageDefault" + }, + "assessmentMode": { + "$id": "4470", + "kind": "string", + "type": { + "$ref": "146" + }, + "value": "ImageDefault" + }, + "automaticByPlatformSettings": { + "$id": "4471", + "kind": "model", + "type": { + "$ref": "701" + }, + "value": { + "$id": "4472", + "rebootSetting": { + "$id": "4473", + "kind": "string", + "type": { + "$ref": "152" + }, + "value": "Unknown" + }, + "bypassPlatformSafetyChecksOnUserSchedule": { + "$id": "4474", + "kind": "boolean", + "type": { + "$ref": "706" + }, + "value": true + } + } + } + } + }, + "enableVMAgentPlatformUpdates": { + "$id": "4475", + "kind": "boolean", + "type": { + "$ref": "714" + }, + "value": true + } + } + }, + "secrets": { + "$id": "4476", + "kind": "array", + "type": { + "$ref": "720" + }, + "value": [ + { + "$id": "4477", + "kind": "model", + "type": { + "$ref": "721" + }, + "value": { + "$id": "4478", + "sourceVault": { + "$id": "4479", + "kind": "model", + "type": { + "$ref": "723" + }, + "value": { + "$id": "4480", + "id": { + "$id": "4481", + "kind": "string", + "type": { + "$ref": "725" + }, + "value": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault/vaults/{vaultName}" + } + } + }, + "vaultCertificates": { + "$id": "4482", + "kind": "array", + "type": { + "$ref": "732" + }, + "value": [ + { + "$id": "4483", + "kind": "model", + "type": { + "$ref": "733" + }, + "value": { + "$id": "4484", + "certificateUrl": { + "$id": "4485", + "kind": "string", + "type": { + "$ref": "735" + }, + "value": "https://myVaultName.vault.azure.net/secrets/myCertName" + }, + "certificateStore": { + "$id": "4486", + "kind": "string", + "type": { + "$ref": "739" + }, + "value": "nlxrwavpzhueffxsshlun" + } + } + } + ] + } + } + } + ] + }, + "allowExtensionOperations": { + "$id": "4487", + "kind": "boolean", + "type": { + "$ref": "747" + }, + "value": true + }, + "requireGuestProvisionSignal": { + "$id": "4488", + "kind": "boolean", + "type": { + "$ref": "751" + }, + "value": true + } + } + }, + "storageProfile": { + "$id": "4489", + "kind": "model", + "type": { + "$ref": "757" + }, + "value": { + "$id": "4490", + "imageReference": { + "$id": "4491", + "kind": "model", + "type": { + "$ref": "759" + }, + "value": { + "$id": "4492", + "publisher": { + "$id": "4493", + "kind": "string", + "type": { + "$ref": "766" + }, + "value": "mqxgwbiyjzmxavhbkd" + }, + "offer": { + "$id": "4494", + "kind": "string", + "type": { + "$ref": "770" + }, + "value": "isxgumkarlkomp" + }, + "sku": { + "$id": "4495", + "kind": "string", + "type": { + "$ref": "774" + }, + "value": "eojmppqcrnpmxirtp" + }, + "version": { + "$id": "4496", + "kind": "string", + "type": { + "$ref": "778" + }, + "value": "wvpcqefgtmqdgltiuz" + }, + "exactVersion": { + "$id": "4497", + "kind": "string", + "type": { + "$ref": "782" + }, + "value": "zjbntmiskjexlr" + }, + "sharedGalleryImageId": { + "$id": "4498", + "kind": "string", + "type": { + "$ref": "786" + }, + "value": "kmkgihoxwlawuuhcinfirktdwkmx" + }, + "communityGalleryImageId": { + "$id": "4499", + "kind": "string", + "type": { + "$ref": "790" + }, + "value": "vlqe" + }, + "id": { + "$id": "4500", + "kind": "string", + "type": { + "$ref": "761" + }, + "value": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/images/{imageName}/versions/{versionName}" + } + } + }, + "osDisk": { + "$id": "4501", + "kind": "model", + "type": { + "$ref": "796" + }, + "value": { + "$id": "4502", + "name": { + "$id": "4503", + "kind": "string", + "type": { + "$ref": "798" + }, + "value": "wfttw" + }, + "caching": { + "$id": "4504", + "kind": "string", + "type": { + "$ref": "162" + }, + "value": "None" + }, + "writeAcceleratorEnabled": { + "$id": "4505", + "kind": "boolean", + "type": { + "$ref": "805" + }, + "value": true + }, + "createOption": { + "$id": "4506", + "kind": "string", + "type": { + "$ref": "170" + }, + "value": "FromImage" + }, + "diffDiskSettings": { + "$id": "4507", + "kind": "model", + "type": { + "$ref": "812" + }, + "value": { + "$id": "4508", + "option": { + "$id": "4509", + "kind": "string", + "type": { + "$ref": "182" + }, + "value": "Local" + }, + "placement": { + "$id": "4510", + "kind": "string", + "type": { + "$ref": "186" + }, + "value": "CacheDisk" + } + } + }, + "diskSizeGB": { + "$id": "4511", + "kind": "number", + "type": { + "$ref": "822" + }, + "value": 14 + }, + "osType": { + "$id": "4512", + "kind": "string", + "type": { + "$ref": "194" + }, + "value": "Windows" + }, + "image": { + "$id": "4513", + "kind": "model", + "type": { + "$ref": "829" + }, + "value": { + "$id": "4514", + "uri": { + "$id": "4515", + "kind": "string", + "type": { + "$ref": "831" + }, + "value": "https://myStorageAccountName.blob.core.windows.net/myContainerName/myVhdName.vhd" + } + } + }, + "vhdContainers": { + "$id": "4516", + "kind": "array", + "type": { + "$ref": "837" + }, + "value": [ + { + "$id": "4517", + "kind": "string", + "type": { + "$ref": "838" + }, + "value": "tkzcwddtinkfpnfklatw" + } + ] + }, + "managedDisk": { + "$id": "4518", + "kind": "model", + "type": { + "$ref": "842" + }, + "value": { + "$id": "4519", + "storageAccountType": { + "$id": "4520", + "kind": "string", + "type": { + "$ref": "200" + }, + "value": "Standard_LRS" + }, + "diskEncryptionSet": { + "$id": "4521", + "kind": "model", + "type": { + "$ref": "847" + }, + "value": { + "$id": "4522", + "id": { + "$id": "4523", + "kind": "string", + "type": { + "$ref": "849" + }, + "value": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskEncryptionSets/{diskEncryptionSetName}" + } + } + }, + "securityProfile": { + "$id": "4524", + "kind": "model", + "type": { + "$ref": "856" + }, + "value": { + "$id": "4525", + "securityEncryptionType": { + "$id": "4526", + "kind": "string", + "type": { + "$ref": "216" + }, + "value": "VMGuestStateOnly" + }, + "diskEncryptionSet": { + "$id": "4527", + "kind": "model", + "type": { + "$ref": "847" + }, + "value": { + "$id": "4528", + "id": { + "$id": "4529", + "kind": "string", + "type": { + "$ref": "849" + }, + "value": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskEncryptionSets/{diskEncryptionSetName}" + } + } + } + } + } + } + }, + "deleteOption": { + "$id": "4530", + "kind": "string", + "type": { + "$ref": "224" + }, + "value": "Delete" + } + } + }, + "dataDisks": { + "$id": "4531", + "kind": "array", + "type": { + "$ref": "873" + }, + "value": [ + { + "$id": "4532", + "kind": "model", + "type": { + "$ref": "874" + }, + "value": { + "$id": "4533", + "name": { + "$id": "4534", + "kind": "string", + "type": { + "$ref": "876" + }, + "value": "eogiykmdmeikswxmigjws" + }, + "lun": { + "$id": "4535", + "kind": "number", + "type": { + "$ref": "880" + }, + "value": 14 + }, + "caching": { + "$id": "4536", + "kind": "string", + "type": { + "$ref": "162" + }, + "value": "None" + }, + "writeAcceleratorEnabled": { + "$id": "4537", + "kind": "boolean", + "type": { + "$ref": "887" + }, + "value": true + }, + "createOption": { + "$id": "4538", + "kind": "string", + "type": { + "$ref": "170" + }, + "value": "FromImage" + }, + "diskSizeGB": { + "$id": "4539", + "kind": "number", + "type": { + "$ref": "894" + }, + "value": 6 + }, + "managedDisk": { + "$id": "4540", + "kind": "model", + "type": { + "$ref": "842" + }, + "value": { + "$id": "4541", + "storageAccountType": { + "$id": "4542", + "kind": "string", + "type": { + "$ref": "200" + }, + "value": "Standard_LRS" + }, + "diskEncryptionSet": { + "$id": "4543", + "kind": "model", + "type": { + "$ref": "847" + }, + "value": { + "$id": "4544", + "id": { + "$id": "4545", + "kind": "string", + "type": { + "$ref": "849" + }, + "value": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskEncryptionSets/{diskEncryptionSetName}" + } + } + }, + "securityProfile": { + "$id": "4546", + "kind": "model", + "type": { + "$ref": "856" + }, + "value": { + "$id": "4547", + "securityEncryptionType": { + "$id": "4548", + "kind": "string", + "type": { + "$ref": "216" + }, + "value": "VMGuestStateOnly" + }, + "diskEncryptionSet": { + "$id": "4549", + "kind": "model", + "type": { + "$ref": "847" + }, + "value": { + "$id": "4550", + "id": { + "$id": "4551", + "kind": "string", + "type": { + "$ref": "849" + }, + "value": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskEncryptionSets/{diskEncryptionSetName}" + } + } + } + } + } + } + }, + "diskIOPSReadWrite": { + "$id": "4552", + "kind": "number", + "type": { + "$ref": "901" + }, + "value": 27 + }, + "diskMBpsReadWrite": { + "$id": "4553", + "kind": "number", + "type": { + "$ref": "905" + }, + "value": 2 + }, + "deleteOption": { + "$id": "4554", + "kind": "string", + "type": { + "$ref": "224" + }, + "value": "Delete" + } + } + } + ] + } + } + }, + "networkProfile": { + "$id": "4555", + "kind": "model", + "type": { + "$ref": "919" + }, + "value": { + "$id": "4556", + "healthProbe": { + "$id": "4557", + "kind": "model", + "type": { + "$ref": "921" + }, + "value": { + "$id": "4558", + "id": { + "$id": "4559", + "kind": "string", + "type": { + "$ref": "923" + }, + "value": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/probes/{probeName}" + } + } + }, + "networkInterfaceConfigurations": { + "$id": "4560", + "kind": "array", + "type": { + "$ref": "930" + }, + "value": [ + { + "$id": "4561", + "kind": "model", + "type": { + "$ref": "931" + }, + "value": { + "$id": "4562", + "name": { + "$id": "4563", + "kind": "string", + "type": { + "$ref": "933" + }, + "value": "i" + }, + "properties": { + "$id": "4564", + "kind": "model", + "type": { + "$ref": "937" + }, + "value": { + "$id": "4565", + "primary": { + "$id": "4566", + "kind": "boolean", + "type": { + "$ref": "939" + }, + "value": true + }, + "enableAcceleratedNetworking": { + "$id": "4567", + "kind": "boolean", + "type": { + "$ref": "943" + }, + "value": true + }, + "disableTcpStateTracking": { + "$id": "4568", + "kind": "boolean", + "type": { + "$ref": "947" + }, + "value": true + }, + "enableFpga": { + "$id": "4569", + "kind": "boolean", + "type": { + "$ref": "951" + }, + "value": true + }, + "networkSecurityGroup": { + "$id": "4570", + "kind": "model", + "type": { + "$ref": "723" + }, + "value": { + "$id": "4571", + "id": { + "$id": "4572", + "kind": "string", + "type": { + "$ref": "725" + }, + "value": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}" + } + } + }, + "dnsSettings": { + "$id": "4573", + "kind": "model", + "type": { + "$ref": "958" + }, + "value": { + "$id": "4574", + "dnsServers": { + "$id": "4575", + "kind": "array", + "type": { + "$ref": "960" + }, + "value": [ + { + "$id": "4576", + "kind": "string", + "type": { + "$ref": "961" + }, + "value": "nxmmfolhclsesu" + } + ] + } + } + }, + "ipConfigurations": { + "$id": "4577", + "kind": "array", + "type": { + "$ref": "967" + }, + "value": [ + { + "$id": "4578", + "kind": "model", + "type": { + "$ref": "968" + }, + "value": { + "$id": "4579", + "name": { + "$id": "4580", + "kind": "string", + "type": { + "$ref": "970" + }, + "value": "oezqhkidfhyywlfzwuotilrpbqnjg" + }, + "properties": { + "$id": "4581", + "kind": "model", + "type": { + "$ref": "974" + }, + "value": { + "$id": "4582", + "subnet": { + "$id": "4583", + "kind": "model", + "type": { + "$ref": "921" + }, + "value": { + "$id": "4584", + "id": { + "$id": "4585", + "kind": "string", + "type": { + "$ref": "923" + }, + "value": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}" + } + } + }, + "primary": { + "$id": "4586", + "kind": "boolean", + "type": { + "$ref": "979" + }, + "value": true + }, + "publicIPAddressConfiguration": { + "$id": "4587", + "kind": "model", + "type": { + "$ref": "983" + }, + "value": { + "$id": "4588", + "name": { + "$id": "4589", + "kind": "string", + "type": { + "$ref": "985" + }, + "value": "fvpqf" + }, + "properties": { + "$id": "4590", + "kind": "model", + "type": { + "$ref": "989" + }, + "value": { + "$id": "4591", + "idleTimeoutInMinutes": { + "$id": "4592", + "kind": "number", + "type": { + "$ref": "991" + }, + "value": 9 + }, + "dnsSettings": { + "$id": "4593", + "kind": "model", + "type": { + "$ref": "995" + }, + "value": { + "$id": "4594", + "domainNameLabel": { + "$id": "4595", + "kind": "string", + "type": { + "$ref": "997" + }, + "value": "ukrddzvmorpmfsczjwtbvp" + }, + "domainNameLabelScope": { + "$id": "4596", + "kind": "string", + "type": { + "$ref": "236" + }, + "value": "TenantReuse" + } + } + }, + "ipTags": { + "$id": "4597", + "kind": "array", + "type": { + "$ref": "1006" + }, + "value": [ + { + "$id": "4598", + "kind": "model", + "type": { + "$ref": "1007" + }, + "value": { + "$id": "4599", + "ipTagType": { + "$id": "4600", + "kind": "string", + "type": { + "$ref": "1009" + }, + "value": "sddgsoemnzgqizale" + }, + "tag": { + "$id": "4601", + "kind": "string", + "type": { + "$ref": "1013" + }, + "value": "wufmhrjsakbiaetyara" + } + } + } + ] + }, + "publicIPPrefix": { + "$id": "4602", + "kind": "model", + "type": { + "$ref": "723" + }, + "value": { + "$id": "4603", + "id": { + "$id": "4604", + "kind": "string", + "type": { + "$ref": "725" + }, + "value": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPPrefixes/{publicIPPrefixName}" + } + } + }, + "publicIPAddressVersion": { + "$id": "4605", + "kind": "string", + "type": { + "$ref": "246" + }, + "value": "IPv4" + }, + "deleteOption": { + "$id": "4606", + "kind": "string", + "type": { + "$ref": "252" + }, + "value": "Delete" + } + } + }, + "sku": { + "$id": "4607", + "kind": "model", + "type": { + "$ref": "1030" + }, + "value": { + "$id": "4608", + "name": { + "$id": "4609", + "kind": "string", + "type": { + "$ref": "258" + }, + "value": "Basic" + }, + "tier": { + "$id": "4610", + "kind": "string", + "type": { + "$ref": "264" + }, + "value": "Regional" + } + } + } + } + }, + "privateIPAddressVersion": { + "$id": "4611", + "kind": "string", + "type": { + "$ref": "246" + }, + "value": "IPv4" + }, + "applicationGatewayBackendAddressPools": { + "$id": "4612", + "kind": "array", + "type": { + "$ref": "1045" + }, + "value": [ + { + "$id": "4613", + "kind": "model", + "type": { + "$ref": "723" + }, + "value": { + "$id": "4614", + "id": { + "$id": "4615", + "kind": "string", + "type": { + "$ref": "725" + }, + "value": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}/backendAddressPools/{backendAddressPoolName}" + } + } + } + ] + }, + "applicationSecurityGroups": { + "$id": "4616", + "kind": "array", + "type": { + "$ref": "1049" + }, + "value": [ + { + "$id": "4617", + "kind": "model", + "type": { + "$ref": "723" + }, + "value": { + "$id": "4618", + "id": { + "$id": "4619", + "kind": "string", + "type": { + "$ref": "725" + }, + "value": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationSecurityGroups/{applicationSecurityGroupName}" + } + } + } + ] + }, + "loadBalancerBackendAddressPools": { + "$id": "4620", + "kind": "array", + "type": { + "$ref": "1053" + }, + "value": [ + { + "$id": "4621", + "kind": "model", + "type": { + "$ref": "723" + }, + "value": { + "$id": "4622", + "id": { + "$id": "4623", + "kind": "string", + "type": { + "$ref": "725" + }, + "value": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/backendAddressPools/{backendAddressPoolName}" + } + } + } + ] + }, + "loadBalancerInboundNatPools": { + "$id": "4624", + "kind": "array", + "type": { + "$ref": "1057" + }, + "value": [ + { + "$id": "4625", + "kind": "model", + "type": { + "$ref": "723" + }, + "value": { + "$id": "4626", + "id": { + "$id": "4627", + "kind": "string", + "type": { + "$ref": "725" + }, + "value": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/inboundNatPools/{inboundNatPoolName}" + } + } + } + ] + } + } + } + } + } + ] + }, + "enableIPForwarding": { + "$id": "4628", + "kind": "boolean", + "type": { + "$ref": "1065" + }, + "value": true + }, + "deleteOption": { + "$id": "4629", + "kind": "string", + "type": { + "$ref": "252" + }, + "value": "Delete" + }, + "auxiliaryMode": { + "$id": "4630", + "kind": "string", + "type": { + "$ref": "270" + }, + "value": "None" + }, + "auxiliarySku": { + "$id": "4631", + "kind": "string", + "type": { + "$ref": "278" + }, + "value": "None" + } + } + } + } + } + ] + }, + "networkApiVersion": { + "$id": "4632", + "kind": "string", + "type": { + "$ref": "290" + }, + "value": "2020-11-01" + } + } + }, + "securityProfile": { + "$id": "4633", + "kind": "model", + "type": { + "$ref": "1087" + }, + "value": { + "$id": "4634", + "uefiSettings": { + "$id": "4635", + "kind": "model", + "type": { + "$ref": "1089" + }, + "value": { + "$id": "4636", + "secureBootEnabled": { + "$id": "4637", + "kind": "boolean", + "type": { + "$ref": "1091" + }, + "value": true + }, + "vTpmEnabled": { + "$id": "4638", + "kind": "boolean", + "type": { + "$ref": "1095" + }, + "value": true + } + } + }, + "encryptionAtHost": { + "$id": "4639", + "kind": "boolean", + "type": { + "$ref": "1101" + }, + "value": true + }, + "securityType": { + "$id": "4640", + "kind": "string", + "type": { + "$ref": "294" + }, + "value": "TrustedLaunch" + }, + "encryptionIdentity": { + "$id": "4641", + "kind": "model", + "type": { + "$ref": "1108" + }, + "value": { + "$id": "4642", + "userAssignedIdentityResourceId": { + "$id": "4643", + "kind": "string", + "type": { + "$ref": "1110" + }, + "value": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{userAssignedIdentityName}" + } + } + }, + "proxyAgentSettings": { + "$id": "4644", + "kind": "model", + "type": { + "$ref": "1117" + }, + "value": { + "$id": "4645", + "enabled": { + "$id": "4646", + "kind": "boolean", + "type": { + "$ref": "1119" + }, + "value": true + }, + "mode": { + "$id": "4647", + "kind": "string", + "type": { + "$ref": "300" + }, + "value": "Audit" + }, + "keyIncarnationId": { + "$id": "4648", + "kind": "number", + "type": { + "$ref": "1126" + }, + "value": 20 + } + } + } + } + }, + "diagnosticsProfile": { + "$id": "4649", + "kind": "model", + "type": { + "$ref": "1134" + }, + "value": { + "$id": "4650", + "bootDiagnostics": { + "$id": "4651", + "kind": "model", + "type": { + "$ref": "1136" + }, + "value": { + "$id": "4652", + "enabled": { + "$id": "4653", + "kind": "boolean", + "type": { + "$ref": "1138" + }, + "value": true + }, + "storageUri": { + "$id": "4654", + "kind": "string", + "type": { + "$ref": "1142" + }, + "value": "http://myStorageAccountName.blob.core.windows.net" + } + } + } + } + }, + "extensionProfile": { + "$id": "4655", + "kind": "model", + "type": { + "$ref": "1150" + }, + "value": { + "$id": "4656", + "extensions": { + "$id": "4657", + "kind": "array", + "type": { + "$ref": "1152" + }, + "value": [ + { + "$id": "4658", + "kind": "model", + "type": { + "$ref": "1153" + }, + "value": { + "$id": "4659", + "name": { + "$id": "4660", + "kind": "string", + "type": { + "$ref": "1160" + }, + "value": "bndxuxx" + }, + "type": { + "$id": "4661", + "kind": "string", + "type": { + "$ref": "1164" + }, + "value": "cmeam" + }, + "properties": { + "$id": "4662", + "kind": "model", + "type": { + "$ref": "1168" + }, + "value": { + "$id": "4663", + "forceUpdateTag": { + "$id": "4664", + "kind": "string", + "type": { + "$ref": "1170" + }, + "value": "yhgxw" + }, + "publisher": { + "$id": "4665", + "kind": "string", + "type": { + "$ref": "1174" + }, + "value": "kpxtirxjfprhs" + }, + "type": { + "$id": "4666", + "kind": "string", + "type": { + "$ref": "1178" + }, + "value": "pgjilctjjwaa" + }, + "typeHandlerVersion": { + "$id": "4667", + "kind": "string", + "type": { + "$ref": "1182" + }, + "value": "zevivcoilxmbwlrihhhibq" + }, + "autoUpgradeMinorVersion": { + "$id": "4668", + "kind": "boolean", + "type": { + "$ref": "1186" + }, + "value": true + }, + "enableAutomaticUpgrade": { + "$id": "4669", + "kind": "boolean", + "type": { + "$ref": "1190" + }, + "value": true + }, + "settings": { + "$id": "4670", + "kind": "dict", + "type": { + "$ref": "1194" + }, + "value": { + "$id": "4671" + } + }, + "provisioningState": { + "$id": "4672", + "kind": "string", + "type": { + "$ref": "1206" + }, + "value": "Succeeded" + }, + "provisionAfterExtensions": { + "$id": "4673", + "kind": "array", + "type": { + "$ref": "1210" + }, + "value": [ + { + "$id": "4674", + "kind": "string", + "type": { + "$ref": "1211" + }, + "value": "nftzosroolbcwmpupujzqwqe" + } + ] + }, + "suppressFailures": { + "$id": "4675", + "kind": "boolean", + "type": { + "$ref": "1215" + }, + "value": true + }, + "protectedSettingsFromKeyVault": { + "$id": "4676", + "kind": "model", + "type": { + "$ref": "1219" + }, + "value": { + "$id": "4677", + "secretUrl": { + "$id": "4678", + "kind": "string", + "type": { + "$ref": "1221" + }, + "value": "https://myVaultName.vault.azure.net/secrets/secret/mySecretName" + }, + "sourceVault": { + "$id": "4679", + "kind": "model", + "type": { + "$ref": "723" + }, + "value": { + "$id": "4680", + "id": { + "$id": "4681", + "kind": "string", + "type": { + "$ref": "725" + }, + "value": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault/vaults/{vaultName}" + } + } + } + } + } + } + }, + "id": { + "$id": "4682", + "kind": "string", + "type": { + "$ref": "1155" + }, + "value": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/extensions/{extensionName}" + } + } + } + ] + }, + "extensionsTimeBudget": { + "$id": "4683", + "kind": "string", + "type": { + "$ref": "1234" + }, + "value": "mbhjahtdygwgyszdwjtvlvtgchdwil" + } + } + }, + "licenseType": { + "$id": "4684", + "kind": "string", + "type": { + "$ref": "1240" + }, + "value": "v" + }, + "scheduledEventsProfile": { + "$id": "4685", + "kind": "model", + "type": { + "$ref": "1244" + }, + "value": { + "$id": "4686", + "terminateNotificationProfile": { + "$id": "4687", + "kind": "model", + "type": { + "$ref": "1246" + }, + "value": { + "$id": "4688", + "notBeforeTimeout": { + "$id": "4689", + "kind": "string", + "type": { + "$ref": "1248" + }, + "value": "iljppmmw" + }, + "enable": { + "$id": "4690", + "kind": "boolean", + "type": { + "$ref": "1252" + }, + "value": true + } + } + }, + "osImageNotificationProfile": { + "$id": "4691", + "kind": "model", + "type": { + "$ref": "1258" + }, + "value": { + "$id": "4692", + "notBeforeTimeout": { + "$id": "4693", + "kind": "string", + "type": { + "$ref": "1260" + }, + "value": "olbpadmevekyczfokodtfprxti" + }, + "enable": { + "$id": "4694", + "kind": "boolean", + "type": { + "$ref": "1264" + }, + "value": true + } + } + } + } + }, + "userData": { + "$id": "4695", + "kind": "string", + "type": { + "$ref": "1272" + }, + "value": "s" + }, + "capacityReservation": { + "$id": "4696", + "kind": "model", + "type": { + "$ref": "1276" + }, + "value": { + "$id": "4697", + "capacityReservationGroup": { + "$id": "4698", + "kind": "model", + "type": { + "$ref": "723" + }, + "value": { + "$id": "4699", + "id": { + "$id": "4700", + "kind": "string", + "type": { + "$ref": "725" + }, + "value": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/capacityReservationGroups/{capacityReservationGroupName}" + } + } + } + } + }, + "applicationProfile": { + "$id": "4701", + "kind": "model", + "type": { + "$ref": "1283" + }, + "value": { + "$id": "4702", + "galleryApplications": { + "$id": "4703", + "kind": "array", + "type": { + "$ref": "1285" + }, + "value": [ + { + "$id": "4704", + "kind": "model", + "type": { + "$ref": "1286" + }, + "value": { + "$id": "4705", + "tags": { + "$id": "4706", + "kind": "string", + "type": { + "$ref": "1288" + }, + "value": "eyrqjbib" + }, + "order": { + "$id": "4707", + "kind": "number", + "type": { + "$ref": "1292" + }, + "value": 5 + }, + "packageReferenceId": { + "$id": "4708", + "kind": "string", + "type": { + "$ref": "1296" + }, + "value": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/applications/{applicationName}/versions/{versionName}" + }, + "treatFailureAsDeploymentFailure": { + "$id": "4709", + "kind": "boolean", + "type": { + "$ref": "1305" + }, + "value": true + }, + "enableAutomaticUpgrade": { + "$id": "4710", + "kind": "boolean", + "type": { + "$ref": "1309" + }, + "value": true + } + } + } + ] + } + } + }, + "hardwareProfile": { + "$id": "4711", + "kind": "model", + "type": { + "$ref": "1317" + }, + "value": { + "$id": "4712", + "vmSizeProperties": { + "$id": "4713", + "kind": "model", + "type": { + "$ref": "1319" + }, + "value": { + "$id": "4714", + "vCPUsAvailable": { + "$id": "4715", + "kind": "number", + "type": { + "$ref": "1321" + }, + "value": 16 + }, + "vCPUsPerCore": { + "$id": "4716", + "kind": "number", + "type": { + "$ref": "1325" + }, + "value": 23 + } + } + } + } + }, + "serviceArtifactReference": { + "$id": "4717", + "kind": "model", + "type": { + "$ref": "1333" + }, + "value": { + "$id": "4718", + "id": { + "$id": "4719", + "kind": "string", + "type": { + "$ref": "1335" + }, + "value": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/serviceArtifacts/{serviceArtifactsName}/vmArtifactsProfiles/{vmArtifactsProfileName}" + } + } + }, + "securityPostureReference": { + "$id": "4720", + "kind": "model", + "type": { + "$ref": "1342" + }, + "value": { + "$id": "4721", + "id": { + "$id": "4722", + "kind": "string", + "type": { + "$ref": "1344" + }, + "value": "mubredelfbshboaxrsxiajihahaa" + }, + "excludeExtensions": { + "$id": "4723", + "kind": "array", + "type": { + "$ref": "1348" + }, + "value": [ + { + "$id": "4724", + "kind": "string", + "type": { + "$ref": "1349" + }, + "value": "{securityPostureVMExtensionName}" + } + ] + }, + "isOverridable": { + "$id": "4725", + "kind": "boolean", + "type": { + "$ref": "1353" + }, + "value": true + } + } + }, + "timeCreated": { + "$id": "4726", + "kind": "string", + "type": { + "$ref": "1359" + }, + "value": "2024-04-29T21:51:44.043Z" + } + } + }, + "computeApiVersion": { + "$id": "4727", + "kind": "string", + "type": { + "$ref": "1375" + }, + "value": "2023-07-01" + }, + "platformFaultDomainCount": { + "$id": "4728", + "kind": "number", + "type": { + "$ref": "1379" + }, + "value": 1 + } + } + }, + "timeCreated": { + "$id": "4729", + "kind": "string", + "type": { + "$ref": "1397" + }, + "value": "2024-07-10T00:16:34.8590555+00:00" + }, + "uniqueId": { + "$id": "4730", + "kind": "string", + "type": { + "$ref": "1402" + }, + "value": "a2f7fabd-bbc2-4a20-afe1-49fdb3885a28" + } + } + }, + "zones": { + "$id": "4731", + "kind": "array", + "type": { + "$ref": "1408" + }, + "value": [ + { + "$id": "4732", + "kind": "string", + "type": { + "$ref": "1409" + }, + "value": "zone1" + }, + { + "$id": "4733", + "kind": "string", + "type": { + "$ref": "1409" + }, + "value": "zone2" + } + ] + }, + "identity": { + "$id": "4734", + "kind": "model", + "type": { + "$ref": "1413" + }, + "value": { + "$id": "4735", + "principalId": { + "$id": "4736", + "kind": "string", + "type": { + "$ref": "1415" + }, + "value": "4d508e5b-374b-4382-9a1c-01fb8b6cb37c" + }, + "tenantId": { + "$id": "4737", + "kind": "string", + "type": { + "$ref": "1420" + }, + "value": "5d508e5b-374b-4382-9a1c-01fb8b6cb37c" + }, + "type": { + "$id": "4738", + "kind": "string", + "type": { + "$ref": "306" + }, + "value": "UserAssigned" + }, + "userAssignedIdentities": { + "$id": "4739", + "kind": "dict", + "type": { + "$ref": "1428" + }, + "value": { + "$id": "4740", + "key9851": { + "$id": "4741", + "kind": "model", + "type": { + "$ref": "1431" + }, + "value": { + "$id": "4742", + "principalId": { + "$id": "4743", + "kind": "string", + "type": { + "$ref": "1438" + }, + "value": "6d508e5b-374b-4382-9a1c-01fb8b6cb37c" + }, + "clientId": { + "$id": "4744", + "kind": "string", + "type": { + "$ref": "1433" + }, + "value": "7d508e5b-374b-4382-9a1c-01fb8b6cb37c" + } + } + } + } + } + } + }, + "plan": { + "$id": "4745", + "kind": "model", + "type": { + "$ref": "1447" + }, + "value": { + "$id": "4746", + "name": { + "$id": "4747", + "kind": "string", + "type": { + "$ref": "1449" + }, + "value": "jwgrcrnrtfoxn" + }, + "publisher": { + "$id": "4748", + "kind": "string", + "type": { + "$ref": "1453" + }, + "value": "iozjbiqqckqm" + }, + "product": { + "$id": "4749", + "kind": "string", + "type": { + "$ref": "1457" + }, + "value": "cgopbyvdyqikahwyxfpzwaqk" + }, + "promotionCode": { + "$id": "4750", + "kind": "string", + "type": { + "$ref": "1461" + }, + "value": "naglezezplcaruqogtxnuizslqnnbr" + }, + "version": { + "$id": "4751", + "kind": "string", + "type": { + "$ref": "1465" + }, + "value": "wa" + } + } + }, + "tags": { + "$id": "4752", + "kind": "dict", + "type": { + "$ref": "396" + }, + "value": { + "$id": "4753", + "key3518": { + "$id": "4754", + "kind": "string", + "type": { + "$ref": "398" + }, + "value": "luvrnuvsgdpbuofdskkcoqhfh" + } + } + }, + "location": { + "$id": "4755", + "kind": "string", + "type": { + "$ref": "402" + }, + "value": "westus" + }, + "id": { + "$id": "4756", + "kind": "string", + "type": { + "$ref": "354" + }, + "value": "/subscriptions/7B0CD4DB-3381-4013-9B31-FB6E6FD0FF1C/resourceGroups/rgazurefleet/providers/Microsoft.AzureFleet/fleets/testFleet" + }, + "name": { + "$id": "4757", + "kind": "string", + "type": { + "$ref": "359" + }, + "value": "testFleet" + }, + "type": { + "$id": "4758", + "kind": "string", + "type": { + "$ref": "363" + }, + "value": "Microsoft.AzureFleet/fleets" + }, + "systemData": { + "$id": "4759", + "kind": "model", + "type": { + "$ref": "368" + }, + "value": { + "$id": "4760", + "createdBy": { + "$id": "4761", + "kind": "string", + "type": { + "$ref": "370" + }, + "value": "rowegentrpoajsv" + }, + "createdByType": { + "$id": "4762", + "kind": "string", + "type": { + "$ref": "316" + }, + "value": "User" + }, + "createdAt": { + "$id": "4763", + "kind": "string", + "type": { + "$ref": "377" + }, + "value": "2024-04-29T21:51:44.043Z" + }, + "lastModifiedBy": { + "$id": "4764", + "kind": "string", + "type": { + "$ref": "382" + }, + "value": "edwuayhhaoepxzisfaqjhmrxjq" + }, + "lastModifiedByType": { + "$id": "4765", + "kind": "string", + "type": { + "$ref": "316" + }, + "value": "User" + }, + "lastModifiedAt": { + "$id": "4766", + "kind": "string", + "type": { + "$ref": "389" + }, + "value": "2024-04-29T21:51:44.043Z" + } + } + } + } + } + ] + }, + "nextLink": { + "$id": "4767", + "kind": "string", + "type": { + "$ref": "1581" + }, + "value": "https://microsoft.com/a" + } + } + } + } + ] + } + ] + }, + { + "$id": "4768", + "Name": "listBySubscription", + "ResourceName": "Fleet", + "Doc": "List Fleet resources by subscription ID", + "Accessibility": "public", + "Parameters": [ + { + "$id": "4769", + "Name": "apiVersion", + "NameInRequest": "api-version", + "Doc": "The API version to use for this operation.", + "Type": { + "$id": "4770", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": true, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "DefaultValue": { + "$id": "4771", + "Type": { + "$id": "4772", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "2024-11-01" + }, + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "4773", + "Name": "subscriptionId", + "NameInRequest": "subscriptionId", + "Doc": "The ID of the target subscription. The value must be an UUID.", + "Type": { + "$id": "4774", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "4775", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "4776", + "Name": "accept", + "NameInRequest": "Accept", + "Type": { + "$id": "4777", + "kind": "constant", + "valueType": { + "$id": "4778", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "4779", + "StatusCodes": [ + 200 + ], + "BodyType": { + "$ref": "1575" + }, + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false, + "ContentTypes": [ + "application/json" + ] + } + ], + "HttpMethod": "GET", + "RequestBodyMediaType": "None", + "Uri": "{endpoint}", + "Path": "/subscriptions/{subscriptionId}/providers/Microsoft.AzureFleet/fleets", + "BufferResponse": true, + "Paging": { + "$id": "4780", + "ItemName": "value", + "NextLinkName": "nextLink" + }, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Microsoft.AzureFleet.Fleets.listBySubscription", + "Decorators": [], + "Examples": [ + { + "$id": "4781", + "kind": "http", + "name": "Fleets_ListBySubscription", + "description": "Fleets_ListBySubscription", + "filePath": "2024-11-01/Fleets_ListBySubscription.json", + "parameters": [ + { + "$id": "4782", + "parameter": { + "$ref": "4769" + }, + "value": { + "$id": "4783", + "kind": "string", + "type": { + "$ref": "4770" + }, + "value": "2024-11-01" + } + }, + { + "$id": "4784", + "parameter": { + "$ref": "4773" + }, + "value": { + "$id": "4785", + "kind": "string", + "type": { + "$ref": "4774" + }, + "value": "1DC2F28C-A625-4B0E-9748-9885A3C9E9EB" + } + } + ], + "responses": [ + { + "$id": "4786", + "response": { + "$ref": "4779" + }, + "statusCode": 200, + "bodyValue": { + "$id": "4787", + "kind": "model", + "type": { + "$ref": "1575" + }, + "value": { + "$id": "4788", + "value": { + "$id": "4789", + "kind": "array", + "type": { + "$ref": "1577" + }, + "value": [ + { + "$id": "4790", + "kind": "model", + "type": { + "$ref": "350" + }, + "value": { + "$id": "4791", + "properties": { + "$id": "4792", + "kind": "model", + "type": { + "$ref": "406" + }, + "value": { + "$id": "4793", + "provisioningState": { + "$id": "4794", + "kind": "string", + "type": { + "$ref": "2" + }, + "value": "Creating" + }, + "spotPriorityProfile": { + "$id": "4795", + "kind": "model", + "type": { + "$ref": "411" + }, + "value": { + "$id": "4796", + "capacity": { + "$id": "4797", + "kind": "number", + "type": { + "$ref": "413" + }, + "value": 20 + }, + "minCapacity": { + "$id": "4798", + "kind": "number", + "type": { + "$ref": "417" + }, + "value": 10 + }, + "maxPricePerVM": { + "$id": "4799", + "kind": "number", + "type": { + "$ref": "421" + }, + "value": 0.00865 + }, + "evictionPolicy": { + "$id": "4800", + "kind": "string", + "type": { + "$ref": "18" + }, + "value": "Delete" + }, + "allocationStrategy": { + "$id": "4801", + "kind": "string", + "type": { + "$ref": "24" + }, + "value": "PriceCapacityOptimized" + }, + "maintain": { + "$id": "4802", + "kind": "boolean", + "type": { + "$ref": "431" + }, + "value": true + } + } + }, + "regularPriorityProfile": { + "$id": "4803", + "kind": "model", + "type": { + "$ref": "437" + }, + "value": { + "$id": "4804", + "capacity": { + "$id": "4805", + "kind": "number", + "type": { + "$ref": "439" + }, + "value": 20 + }, + "minCapacity": { + "$id": "4806", + "kind": "number", + "type": { + "$ref": "443" + }, + "value": 10 + }, + "allocationStrategy": { + "$id": "4807", + "kind": "string", + "type": { + "$ref": "32" + }, + "value": "LowestPrice" + } + } + }, + "vmSizesProfile": { + "$id": "4808", + "kind": "array", + "type": { + "$ref": "452" + }, + "value": [ + { + "$id": "4809", + "kind": "model", + "type": { + "$ref": "453" + }, + "value": { + "$id": "4810", + "name": { + "$id": "4811", + "kind": "string", + "type": { + "$ref": "455" + }, + "value": "Standard_d1_v2" + }, + "rank": { + "$id": "4812", + "kind": "number", + "type": { + "$ref": "459" + }, + "value": 19225 + } + } + } + ] + }, + "computeProfile": { + "$id": "4813", + "kind": "model", + "type": { + "$ref": "1370" + }, + "value": { + "$id": "4814", + "baseVirtualMachineProfile": { + "$id": "4815", + "kind": "model", + "type": { + "$ref": "565" + }, + "value": { + "$id": "4816", + "osProfile": { + "$id": "4817", + "kind": "model", + "type": { + "$ref": "567" + }, + "value": { + "$id": "4818", + "computerNamePrefix": { + "$id": "4819", + "kind": "string", + "type": { + "$ref": "569" + }, + "value": "o" + }, + "adminUsername": { + "$id": "4820", + "kind": "string", + "type": { + "$ref": "573" + }, + "value": "nrgzqciiaaxjrqldbmjbqkyhntp" + }, + "windowsConfiguration": { + "$id": "4821", + "kind": "model", + "type": { + "$ref": "585" + }, + "value": { + "$id": "4822", + "provisionVMAgent": { + "$id": "4823", + "kind": "boolean", + "type": { + "$ref": "587" + }, + "value": true + }, + "enableAutomaticUpdates": { + "$id": "4824", + "kind": "boolean", + "type": { + "$ref": "591" + }, + "value": true + }, + "timeZone": { + "$id": "4825", + "kind": "string", + "type": { + "$ref": "595" + }, + "value": "hlyjiqcfksgrpjrct" + }, + "additionalUnattendContent": { + "$id": "4826", + "kind": "array", + "type": { + "$ref": "599" + }, + "value": [ + { + "$id": "4827", + "kind": "model", + "type": { + "$ref": "600" + }, + "value": { + "$id": "4828", + "passName": { + "$id": "4829", + "kind": "string", + "type": { + "$ref": "602" + }, + "value": "OobeSystem" + }, + "componentName": { + "$id": "4830", + "kind": "string", + "type": { + "$ref": "606" + }, + "value": "Microsoft-Windows-Shell-Setup" + }, + "settingName": { + "$id": "4831", + "kind": "string", + "type": { + "$ref": "104" + }, + "value": "AutoLogon" + } + } + } + ] + }, + "patchSettings": { + "$id": "4832", + "kind": "model", + "type": { + "$ref": "619" + }, + "value": { + "$id": "4833", + "patchMode": { + "$id": "4834", + "kind": "string", + "type": { + "$ref": "110" + }, + "value": "Manual" + }, + "enableHotpatching": { + "$id": "4835", + "kind": "boolean", + "type": { + "$ref": "624" + }, + "value": true + }, + "assessmentMode": { + "$id": "4836", + "kind": "string", + "type": { + "$ref": "118" + }, + "value": "ImageDefault" + }, + "automaticByPlatformSettings": { + "$id": "4837", + "kind": "model", + "type": { + "$ref": "631" + }, + "value": { + "$id": "4838", + "rebootSetting": { + "$id": "4839", + "kind": "string", + "type": { + "$ref": "124" + }, + "value": "Unknown" + }, + "bypassPlatformSafetyChecksOnUserSchedule": { + "$id": "4840", + "kind": "boolean", + "type": { + "$ref": "636" + }, + "value": true + } + } + } + } + }, + "winRM": { + "$id": "4841", + "kind": "model", + "type": { + "$ref": "644" + }, + "value": { + "$id": "4842", + "listeners": { + "$id": "4843", + "kind": "array", + "type": { + "$ref": "646" + }, + "value": [ + { + "$id": "4844", + "kind": "model", + "type": { + "$ref": "647" + }, + "value": { + "$id": "4845", + "protocol": { + "$id": "4846", + "kind": "string", + "type": { + "$ref": "134" + }, + "value": "Http" + }, + "certificateUrl": { + "$id": "4847", + "kind": "string", + "type": { + "$ref": "652" + }, + "value": "https://myVaultName.vault.azure.net/secrets/myCertName" + } + } + } + ] + } + } + }, + "enableVMAgentPlatformUpdates": { + "$id": "4848", + "kind": "boolean", + "type": { + "$ref": "660" + }, + "value": true + } + } + }, + "linuxConfiguration": { + "$id": "4849", + "kind": "model", + "type": { + "$ref": "666" + }, + "value": { + "$id": "4850", + "disablePasswordAuthentication": { + "$id": "4851", + "kind": "boolean", + "type": { + "$ref": "668" + }, + "value": true + }, + "ssh": { + "$id": "4852", + "kind": "model", + "type": { + "$ref": "672" + }, + "value": { + "$id": "4853", + "publicKeys": { + "$id": "4854", + "kind": "array", + "type": { + "$ref": "674" + }, + "value": [ + { + "$id": "4855", + "kind": "model", + "type": { + "$ref": "675" + }, + "value": { + "$id": "4856", + "path": { + "$id": "4857", + "kind": "string", + "type": { + "$ref": "677" + }, + "value": "kmqz" + }, + "keyData": { + "$id": "4858", + "kind": "string", + "type": { + "$ref": "681" + }, + "value": "kivgsubusvpprwqaqpjcmhsv" + } + } + } + ] + } + } + }, + "provisionVMAgent": { + "$id": "4859", + "kind": "boolean", + "type": { + "$ref": "689" + }, + "value": true + }, + "patchSettings": { + "$id": "4860", + "kind": "model", + "type": { + "$ref": "693" + }, + "value": { + "$id": "4861", + "patchMode": { + "$id": "4862", + "kind": "string", + "type": { + "$ref": "140" + }, + "value": "ImageDefault" + }, + "assessmentMode": { + "$id": "4863", + "kind": "string", + "type": { + "$ref": "146" + }, + "value": "ImageDefault" + }, + "automaticByPlatformSettings": { + "$id": "4864", + "kind": "model", + "type": { + "$ref": "701" + }, + "value": { + "$id": "4865", + "rebootSetting": { + "$id": "4866", + "kind": "string", + "type": { + "$ref": "152" + }, + "value": "Unknown" + }, + "bypassPlatformSafetyChecksOnUserSchedule": { + "$id": "4867", + "kind": "boolean", + "type": { + "$ref": "706" + }, + "value": true + } + } + } + } + }, + "enableVMAgentPlatformUpdates": { + "$id": "4868", + "kind": "boolean", + "type": { + "$ref": "714" + }, + "value": true + } + } + }, + "secrets": { + "$id": "4869", + "kind": "array", + "type": { + "$ref": "720" + }, + "value": [ + { + "$id": "4870", + "kind": "model", + "type": { + "$ref": "721" + }, + "value": { + "$id": "4871", + "sourceVault": { + "$id": "4872", + "kind": "model", + "type": { + "$ref": "723" + }, + "value": { + "$id": "4873", + "id": { + "$id": "4874", + "kind": "string", + "type": { + "$ref": "725" + }, + "value": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault/vaults/{vaultName}" + } + } + }, + "vaultCertificates": { + "$id": "4875", + "kind": "array", + "type": { + "$ref": "732" + }, + "value": [ + { + "$id": "4876", + "kind": "model", + "type": { + "$ref": "733" + }, + "value": { + "$id": "4877", + "certificateUrl": { + "$id": "4878", + "kind": "string", + "type": { + "$ref": "735" + }, + "value": "https://myVaultName.vault.azure.net/secrets/myCertName" + }, + "certificateStore": { + "$id": "4879", + "kind": "string", + "type": { + "$ref": "739" + }, + "value": "nlxrwavpzhueffxsshlun" + } + } + } + ] + } + } + } + ] + }, + "allowExtensionOperations": { + "$id": "4880", + "kind": "boolean", + "type": { + "$ref": "747" + }, + "value": true + }, + "requireGuestProvisionSignal": { + "$id": "4881", + "kind": "boolean", + "type": { + "$ref": "751" + }, + "value": true + } + } + }, + "storageProfile": { + "$id": "4882", + "kind": "model", + "type": { + "$ref": "757" + }, + "value": { + "$id": "4883", + "imageReference": { + "$id": "4884", + "kind": "model", + "type": { + "$ref": "759" + }, + "value": { + "$id": "4885", + "publisher": { + "$id": "4886", + "kind": "string", + "type": { + "$ref": "766" + }, + "value": "mqxgwbiyjzmxavhbkd" + }, + "offer": { + "$id": "4887", + "kind": "string", + "type": { + "$ref": "770" + }, + "value": "isxgumkarlkomp" + }, + "sku": { + "$id": "4888", + "kind": "string", + "type": { + "$ref": "774" + }, + "value": "eojmppqcrnpmxirtp" + }, + "version": { + "$id": "4889", + "kind": "string", + "type": { + "$ref": "778" + }, + "value": "wvpcqefgtmqdgltiuz" + }, + "exactVersion": { + "$id": "4890", + "kind": "string", + "type": { + "$ref": "782" + }, + "value": "zjbntmiskjexlr" + }, + "sharedGalleryImageId": { + "$id": "4891", + "kind": "string", + "type": { + "$ref": "786" + }, + "value": "kmkgihoxwlawuuhcinfirktdwkmx" + }, + "communityGalleryImageId": { + "$id": "4892", + "kind": "string", + "type": { + "$ref": "790" + }, + "value": "vlqe" + }, + "id": { + "$id": "4893", + "kind": "string", + "type": { + "$ref": "761" + }, + "value": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/images/{imageName}/versions/{versionName}" + } + } + }, + "osDisk": { + "$id": "4894", + "kind": "model", + "type": { + "$ref": "796" + }, + "value": { + "$id": "4895", + "name": { + "$id": "4896", + "kind": "string", + "type": { + "$ref": "798" + }, + "value": "wfttw" + }, + "caching": { + "$id": "4897", + "kind": "string", + "type": { + "$ref": "162" + }, + "value": "None" + }, + "writeAcceleratorEnabled": { + "$id": "4898", + "kind": "boolean", + "type": { + "$ref": "805" + }, + "value": true + }, + "createOption": { + "$id": "4899", + "kind": "string", + "type": { + "$ref": "170" + }, + "value": "FromImage" + }, + "diffDiskSettings": { + "$id": "4900", + "kind": "model", + "type": { + "$ref": "812" + }, + "value": { + "$id": "4901", + "option": { + "$id": "4902", + "kind": "string", + "type": { + "$ref": "182" + }, + "value": "Local" + }, + "placement": { + "$id": "4903", + "kind": "string", + "type": { + "$ref": "186" + }, + "value": "CacheDisk" + } + } + }, + "diskSizeGB": { + "$id": "4904", + "kind": "number", + "type": { + "$ref": "822" + }, + "value": 14 + }, + "osType": { + "$id": "4905", + "kind": "string", + "type": { + "$ref": "194" + }, + "value": "Windows" + }, + "image": { + "$id": "4906", + "kind": "model", + "type": { + "$ref": "829" + }, + "value": { + "$id": "4907", + "uri": { + "$id": "4908", + "kind": "string", + "type": { + "$ref": "831" + }, + "value": "https://myStorageAccountName.blob.core.windows.net/myContainerName/myVhdName.vhd" + } + } + }, + "vhdContainers": { + "$id": "4909", + "kind": "array", + "type": { + "$ref": "837" + }, + "value": [ + { + "$id": "4910", + "kind": "string", + "type": { + "$ref": "838" + }, + "value": "tkzcwddtinkfpnfklatw" + } + ] + }, + "managedDisk": { + "$id": "4911", + "kind": "model", + "type": { + "$ref": "842" + }, + "value": { + "$id": "4912", + "storageAccountType": { + "$id": "4913", + "kind": "string", + "type": { + "$ref": "200" + }, + "value": "Standard_LRS" + }, + "diskEncryptionSet": { + "$id": "4914", + "kind": "model", + "type": { + "$ref": "847" + }, + "value": { + "$id": "4915", + "id": { + "$id": "4916", + "kind": "string", + "type": { + "$ref": "849" + }, + "value": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskEncryptionSets/{diskEncryptionSetName}" + } + } + }, + "securityProfile": { + "$id": "4917", + "kind": "model", + "type": { + "$ref": "856" + }, + "value": { + "$id": "4918", + "securityEncryptionType": { + "$id": "4919", + "kind": "string", + "type": { + "$ref": "216" + }, + "value": "VMGuestStateOnly" + }, + "diskEncryptionSet": { + "$id": "4920", + "kind": "model", + "type": { + "$ref": "847" + }, + "value": { + "$id": "4921", + "id": { + "$id": "4922", + "kind": "string", + "type": { + "$ref": "849" + }, + "value": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskEncryptionSets/{diskEncryptionSetName}" + } + } + } + } + } + } + }, + "deleteOption": { + "$id": "4923", + "kind": "string", + "type": { + "$ref": "224" + }, + "value": "Delete" + } + } + }, + "dataDisks": { + "$id": "4924", + "kind": "array", + "type": { + "$ref": "873" + }, + "value": [ + { + "$id": "4925", + "kind": "model", + "type": { + "$ref": "874" + }, + "value": { + "$id": "4926", + "name": { + "$id": "4927", + "kind": "string", + "type": { + "$ref": "876" + }, + "value": "eogiykmdmeikswxmigjws" + }, + "lun": { + "$id": "4928", + "kind": "number", + "type": { + "$ref": "880" + }, + "value": 14 + }, + "caching": { + "$id": "4929", + "kind": "string", + "type": { + "$ref": "162" + }, + "value": "None" + }, + "writeAcceleratorEnabled": { + "$id": "4930", + "kind": "boolean", + "type": { + "$ref": "887" + }, + "value": true + }, + "createOption": { + "$id": "4931", + "kind": "string", + "type": { + "$ref": "170" + }, + "value": "FromImage" + }, + "diskSizeGB": { + "$id": "4932", + "kind": "number", + "type": { + "$ref": "894" + }, + "value": 6 + }, + "managedDisk": { + "$id": "4933", + "kind": "model", + "type": { + "$ref": "842" + }, + "value": { + "$id": "4934", + "storageAccountType": { + "$id": "4935", + "kind": "string", + "type": { + "$ref": "200" + }, + "value": "Standard_LRS" + }, + "diskEncryptionSet": { + "$id": "4936", + "kind": "model", + "type": { + "$ref": "847" + }, + "value": { + "$id": "4937", + "id": { + "$id": "4938", + "kind": "string", + "type": { + "$ref": "849" + }, + "value": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskEncryptionSets/{diskEncryptionSetName}" + } + } + }, + "securityProfile": { + "$id": "4939", + "kind": "model", + "type": { + "$ref": "856" + }, + "value": { + "$id": "4940", + "securityEncryptionType": { + "$id": "4941", + "kind": "string", + "type": { + "$ref": "216" + }, + "value": "VMGuestStateOnly" + }, + "diskEncryptionSet": { + "$id": "4942", + "kind": "model", + "type": { + "$ref": "847" + }, + "value": { + "$id": "4943", + "id": { + "$id": "4944", + "kind": "string", + "type": { + "$ref": "849" + }, + "value": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskEncryptionSets/{diskEncryptionSetName}" + } + } + } + } + } + } + }, + "diskIOPSReadWrite": { + "$id": "4945", + "kind": "number", + "type": { + "$ref": "901" + }, + "value": 27 + }, + "diskMBpsReadWrite": { + "$id": "4946", + "kind": "number", + "type": { + "$ref": "905" + }, + "value": 2 + }, + "deleteOption": { + "$id": "4947", + "kind": "string", + "type": { + "$ref": "224" + }, + "value": "Delete" + } + } + } + ] + } + } + }, + "networkProfile": { + "$id": "4948", + "kind": "model", + "type": { + "$ref": "919" + }, + "value": { + "$id": "4949", + "healthProbe": { + "$id": "4950", + "kind": "model", + "type": { + "$ref": "921" + }, + "value": { + "$id": "4951", + "id": { + "$id": "4952", + "kind": "string", + "type": { + "$ref": "923" + }, + "value": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/probes/{probeName}" + } + } + }, + "networkInterfaceConfigurations": { + "$id": "4953", + "kind": "array", + "type": { + "$ref": "930" + }, + "value": [ + { + "$id": "4954", + "kind": "model", + "type": { + "$ref": "931" + }, + "value": { + "$id": "4955", + "name": { + "$id": "4956", + "kind": "string", + "type": { + "$ref": "933" + }, + "value": "i" + }, + "properties": { + "$id": "4957", + "kind": "model", + "type": { + "$ref": "937" + }, + "value": { + "$id": "4958", + "primary": { + "$id": "4959", + "kind": "boolean", + "type": { + "$ref": "939" + }, + "value": true + }, + "enableAcceleratedNetworking": { + "$id": "4960", + "kind": "boolean", + "type": { + "$ref": "943" + }, + "value": true + }, + "disableTcpStateTracking": { + "$id": "4961", + "kind": "boolean", + "type": { + "$ref": "947" + }, + "value": true + }, + "enableFpga": { + "$id": "4962", + "kind": "boolean", + "type": { + "$ref": "951" + }, + "value": true + }, + "networkSecurityGroup": { + "$id": "4963", + "kind": "model", + "type": { + "$ref": "723" + }, + "value": { + "$id": "4964", + "id": { + "$id": "4965", + "kind": "string", + "type": { + "$ref": "725" + }, + "value": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}" + } + } + }, + "dnsSettings": { + "$id": "4966", + "kind": "model", + "type": { + "$ref": "958" + }, + "value": { + "$id": "4967", + "dnsServers": { + "$id": "4968", + "kind": "array", + "type": { + "$ref": "960" + }, + "value": [ + { + "$id": "4969", + "kind": "string", + "type": { + "$ref": "961" + }, + "value": "nxmmfolhclsesu" + } + ] + } + } + }, + "ipConfigurations": { + "$id": "4970", + "kind": "array", + "type": { + "$ref": "967" + }, + "value": [ + { + "$id": "4971", + "kind": "model", + "type": { + "$ref": "968" + }, + "value": { + "$id": "4972", + "name": { + "$id": "4973", + "kind": "string", + "type": { + "$ref": "970" + }, + "value": "oezqhkidfhyywlfzwuotilrpbqnjg" + }, + "properties": { + "$id": "4974", + "kind": "model", + "type": { + "$ref": "974" + }, + "value": { + "$id": "4975", + "subnet": { + "$id": "4976", + "kind": "model", + "type": { + "$ref": "921" + }, + "value": { + "$id": "4977", + "id": { + "$id": "4978", + "kind": "string", + "type": { + "$ref": "923" + }, + "value": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}" + } + } + }, + "primary": { + "$id": "4979", + "kind": "boolean", + "type": { + "$ref": "979" + }, + "value": true + }, + "publicIPAddressConfiguration": { + "$id": "4980", + "kind": "model", + "type": { + "$ref": "983" + }, + "value": { + "$id": "4981", + "name": { + "$id": "4982", + "kind": "string", + "type": { + "$ref": "985" + }, + "value": "fvpqf" + }, + "properties": { + "$id": "4983", + "kind": "model", + "type": { + "$ref": "989" + }, + "value": { + "$id": "4984", + "idleTimeoutInMinutes": { + "$id": "4985", + "kind": "number", + "type": { + "$ref": "991" + }, + "value": 9 + }, + "dnsSettings": { + "$id": "4986", + "kind": "model", + "type": { + "$ref": "995" + }, + "value": { + "$id": "4987", + "domainNameLabel": { + "$id": "4988", + "kind": "string", + "type": { + "$ref": "997" + }, + "value": "ukrddzvmorpmfsczjwtbvp" + }, + "domainNameLabelScope": { + "$id": "4989", + "kind": "string", + "type": { + "$ref": "236" + }, + "value": "TenantReuse" + } + } + }, + "ipTags": { + "$id": "4990", + "kind": "array", + "type": { + "$ref": "1006" + }, + "value": [ + { + "$id": "4991", + "kind": "model", + "type": { + "$ref": "1007" + }, + "value": { + "$id": "4992", + "ipTagType": { + "$id": "4993", + "kind": "string", + "type": { + "$ref": "1009" + }, + "value": "sddgsoemnzgqizale" + }, + "tag": { + "$id": "4994", + "kind": "string", + "type": { + "$ref": "1013" + }, + "value": "wufmhrjsakbiaetyara" + } + } + } + ] + }, + "publicIPPrefix": { + "$id": "4995", + "kind": "model", + "type": { + "$ref": "723" + }, + "value": { + "$id": "4996", + "id": { + "$id": "4997", + "kind": "string", + "type": { + "$ref": "725" + }, + "value": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPPrefixes/{publicIPPrefixName}" + } + } + }, + "publicIPAddressVersion": { + "$id": "4998", + "kind": "string", + "type": { + "$ref": "246" + }, + "value": "IPv4" + }, + "deleteOption": { + "$id": "4999", + "kind": "string", + "type": { + "$ref": "252" + }, + "value": "Delete" + } + } + }, + "sku": { + "$id": "5000", + "kind": "model", + "type": { + "$ref": "1030" + }, + "value": { + "$id": "5001", + "name": { + "$id": "5002", + "kind": "string", + "type": { + "$ref": "258" + }, + "value": "Basic" + }, + "tier": { + "$id": "5003", + "kind": "string", + "type": { + "$ref": "264" + }, + "value": "Regional" + } + } + } + } + }, + "privateIPAddressVersion": { + "$id": "5004", + "kind": "string", + "type": { + "$ref": "246" + }, + "value": "IPv4" + }, + "applicationGatewayBackendAddressPools": { + "$id": "5005", + "kind": "array", + "type": { + "$ref": "1045" + }, + "value": [ + { + "$id": "5006", + "kind": "model", + "type": { + "$ref": "723" + }, + "value": { + "$id": "5007", + "id": { + "$id": "5008", + "kind": "string", + "type": { + "$ref": "725" + }, + "value": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}/backendAddressPools/{backendAddressPoolName}" + } + } + } + ] + }, + "applicationSecurityGroups": { + "$id": "5009", + "kind": "array", + "type": { + "$ref": "1049" + }, + "value": [ + { + "$id": "5010", + "kind": "model", + "type": { + "$ref": "723" + }, + "value": { + "$id": "5011", + "id": { + "$id": "5012", + "kind": "string", + "type": { + "$ref": "725" + }, + "value": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationSecurityGroups/{applicationSecurityGroupName}" + } + } + } + ] + }, + "loadBalancerBackendAddressPools": { + "$id": "5013", + "kind": "array", + "type": { + "$ref": "1053" + }, + "value": [ + { + "$id": "5014", + "kind": "model", + "type": { + "$ref": "723" + }, + "value": { + "$id": "5015", + "id": { + "$id": "5016", + "kind": "string", + "type": { + "$ref": "725" + }, + "value": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/backendAddressPools/{backendAddressPoolName}" + } + } + } + ] + }, + "loadBalancerInboundNatPools": { + "$id": "5017", + "kind": "array", + "type": { + "$ref": "1057" + }, + "value": [ + { + "$id": "5018", + "kind": "model", + "type": { + "$ref": "723" + }, + "value": { + "$id": "5019", + "id": { + "$id": "5020", + "kind": "string", + "type": { + "$ref": "725" + }, + "value": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/inboundNatPools/{inboundNatPoolName}" + } + } + } + ] + } + } + } + } + } + ] + }, + "enableIPForwarding": { + "$id": "5021", + "kind": "boolean", + "type": { + "$ref": "1065" + }, + "value": true + }, + "deleteOption": { + "$id": "5022", + "kind": "string", + "type": { + "$ref": "252" + }, + "value": "Delete" + }, + "auxiliaryMode": { + "$id": "5023", + "kind": "string", + "type": { + "$ref": "270" + }, + "value": "None" + }, + "auxiliarySku": { + "$id": "5024", + "kind": "string", + "type": { + "$ref": "278" + }, + "value": "None" + } + } + } + } + } + ] + }, + "networkApiVersion": { + "$id": "5025", + "kind": "string", + "type": { + "$ref": "290" + }, + "value": "2020-11-01" + } + } + }, + "securityProfile": { + "$id": "5026", + "kind": "model", + "type": { + "$ref": "1087" + }, + "value": { + "$id": "5027", + "uefiSettings": { + "$id": "5028", + "kind": "model", + "type": { + "$ref": "1089" + }, + "value": { + "$id": "5029", + "secureBootEnabled": { + "$id": "5030", + "kind": "boolean", + "type": { + "$ref": "1091" + }, + "value": true + }, + "vTpmEnabled": { + "$id": "5031", + "kind": "boolean", + "type": { + "$ref": "1095" + }, + "value": true + } + } + }, + "encryptionAtHost": { + "$id": "5032", + "kind": "boolean", + "type": { + "$ref": "1101" + }, + "value": true + }, + "securityType": { + "$id": "5033", + "kind": "string", + "type": { + "$ref": "294" + }, + "value": "TrustedLaunch" + }, + "encryptionIdentity": { + "$id": "5034", + "kind": "model", + "type": { + "$ref": "1108" + }, + "value": { + "$id": "5035", + "userAssignedIdentityResourceId": { + "$id": "5036", + "kind": "string", + "type": { + "$ref": "1110" + }, + "value": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{userAssignedIdentityName}" + } + } + }, + "proxyAgentSettings": { + "$id": "5037", + "kind": "model", + "type": { + "$ref": "1117" + }, + "value": { + "$id": "5038", + "enabled": { + "$id": "5039", + "kind": "boolean", + "type": { + "$ref": "1119" + }, + "value": true + }, + "mode": { + "$id": "5040", + "kind": "string", + "type": { + "$ref": "300" + }, + "value": "Audit" + }, + "keyIncarnationId": { + "$id": "5041", + "kind": "number", + "type": { + "$ref": "1126" + }, + "value": 20 + } + } + } + } + }, + "diagnosticsProfile": { + "$id": "5042", + "kind": "model", + "type": { + "$ref": "1134" + }, + "value": { + "$id": "5043", + "bootDiagnostics": { + "$id": "5044", + "kind": "model", + "type": { + "$ref": "1136" + }, + "value": { + "$id": "5045", + "enabled": { + "$id": "5046", + "kind": "boolean", + "type": { + "$ref": "1138" + }, + "value": true + }, + "storageUri": { + "$id": "5047", + "kind": "string", + "type": { + "$ref": "1142" + }, + "value": "http://myStorageAccountName.blob.core.windows.net" + } + } + } + } + }, + "extensionProfile": { + "$id": "5048", + "kind": "model", + "type": { + "$ref": "1150" + }, + "value": { + "$id": "5049", + "extensions": { + "$id": "5050", + "kind": "array", + "type": { + "$ref": "1152" + }, + "value": [ + { + "$id": "5051", + "kind": "model", + "type": { + "$ref": "1153" + }, + "value": { + "$id": "5052", + "name": { + "$id": "5053", + "kind": "string", + "type": { + "$ref": "1160" + }, + "value": "bndxuxx" + }, + "type": { + "$id": "5054", + "kind": "string", + "type": { + "$ref": "1164" + }, + "value": "cmeam" + }, + "properties": { + "$id": "5055", + "kind": "model", + "type": { + "$ref": "1168" + }, + "value": { + "$id": "5056", + "forceUpdateTag": { + "$id": "5057", + "kind": "string", + "type": { + "$ref": "1170" + }, + "value": "yhgxw" + }, + "publisher": { + "$id": "5058", + "kind": "string", + "type": { + "$ref": "1174" + }, + "value": "kpxtirxjfprhs" + }, + "type": { + "$id": "5059", + "kind": "string", + "type": { + "$ref": "1178" + }, + "value": "pgjilctjjwaa" + }, + "typeHandlerVersion": { + "$id": "5060", + "kind": "string", + "type": { + "$ref": "1182" + }, + "value": "zevivcoilxmbwlrihhhibq" + }, + "autoUpgradeMinorVersion": { + "$id": "5061", + "kind": "boolean", + "type": { + "$ref": "1186" + }, + "value": true + }, + "enableAutomaticUpgrade": { + "$id": "5062", + "kind": "boolean", + "type": { + "$ref": "1190" + }, + "value": true + }, + "settings": { + "$id": "5063", + "kind": "dict", + "type": { + "$ref": "1194" + }, + "value": { + "$id": "5064" + } + }, + "provisioningState": { + "$id": "5065", + "kind": "string", + "type": { + "$ref": "1206" + }, + "value": "Succeeded" + }, + "provisionAfterExtensions": { + "$id": "5066", + "kind": "array", + "type": { + "$ref": "1210" + }, + "value": [ + { + "$id": "5067", + "kind": "string", + "type": { + "$ref": "1211" + }, + "value": "nftzosroolbcwmpupujzqwqe" + } + ] + }, + "suppressFailures": { + "$id": "5068", + "kind": "boolean", + "type": { + "$ref": "1215" + }, + "value": true + }, + "protectedSettingsFromKeyVault": { + "$id": "5069", + "kind": "model", + "type": { + "$ref": "1219" + }, + "value": { + "$id": "5070", + "secretUrl": { + "$id": "5071", + "kind": "string", + "type": { + "$ref": "1221" + }, + "value": "https://myVaultName.vault.azure.net/secrets/secret/mySecretName" + }, + "sourceVault": { + "$id": "5072", + "kind": "model", + "type": { + "$ref": "723" + }, + "value": { + "$id": "5073", + "id": { + "$id": "5074", + "kind": "string", + "type": { + "$ref": "725" + }, + "value": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault/vaults/{vaultName}" + } + } + } + } + } + } + }, + "id": { + "$id": "5075", + "kind": "string", + "type": { + "$ref": "1155" + }, + "value": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/extensions/{extensionName}" + } + } + } + ] + }, + "extensionsTimeBudget": { + "$id": "5076", + "kind": "string", + "type": { + "$ref": "1234" + }, + "value": "mbhjahtdygwgyszdwjtvlvtgchdwil" + } + } + }, + "licenseType": { + "$id": "5077", + "kind": "string", + "type": { + "$ref": "1240" + }, + "value": "v" + }, + "scheduledEventsProfile": { + "$id": "5078", + "kind": "model", + "type": { + "$ref": "1244" + }, + "value": { + "$id": "5079", + "terminateNotificationProfile": { + "$id": "5080", + "kind": "model", + "type": { + "$ref": "1246" + }, + "value": { + "$id": "5081", + "notBeforeTimeout": { + "$id": "5082", + "kind": "string", + "type": { + "$ref": "1248" + }, + "value": "iljppmmw" + }, + "enable": { + "$id": "5083", + "kind": "boolean", + "type": { + "$ref": "1252" + }, + "value": true + } + } + }, + "osImageNotificationProfile": { + "$id": "5084", + "kind": "model", + "type": { + "$ref": "1258" + }, + "value": { + "$id": "5085", + "notBeforeTimeout": { + "$id": "5086", + "kind": "string", + "type": { + "$ref": "1260" + }, + "value": "olbpadmevekyczfokodtfprxti" + }, + "enable": { + "$id": "5087", + "kind": "boolean", + "type": { + "$ref": "1264" + }, + "value": true + } + } + } + } + }, + "userData": { + "$id": "5088", + "kind": "string", + "type": { + "$ref": "1272" + }, + "value": "s" + }, + "capacityReservation": { + "$id": "5089", + "kind": "model", + "type": { + "$ref": "1276" + }, + "value": { + "$id": "5090", + "capacityReservationGroup": { + "$id": "5091", + "kind": "model", + "type": { + "$ref": "723" + }, + "value": { + "$id": "5092", + "id": { + "$id": "5093", + "kind": "string", + "type": { + "$ref": "725" + }, + "value": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/capacityReservationGroups/{capacityReservationGroupName}" + } + } + } + } + }, + "applicationProfile": { + "$id": "5094", + "kind": "model", + "type": { + "$ref": "1283" + }, + "value": { + "$id": "5095", + "galleryApplications": { + "$id": "5096", + "kind": "array", + "type": { + "$ref": "1285" + }, + "value": [ + { + "$id": "5097", + "kind": "model", + "type": { + "$ref": "1286" + }, + "value": { + "$id": "5098", + "tags": { + "$id": "5099", + "kind": "string", + "type": { + "$ref": "1288" + }, + "value": "eyrqjbib" + }, + "order": { + "$id": "5100", + "kind": "number", + "type": { + "$ref": "1292" + }, + "value": 5 + }, + "packageReferenceId": { + "$id": "5101", + "kind": "string", + "type": { + "$ref": "1296" + }, + "value": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/applications/{applicationName}/versions/{versionName}" + }, + "treatFailureAsDeploymentFailure": { + "$id": "5102", + "kind": "boolean", + "type": { + "$ref": "1305" + }, + "value": true + }, + "enableAutomaticUpgrade": { + "$id": "5103", + "kind": "boolean", + "type": { + "$ref": "1309" + }, + "value": true + } + } + } + ] + } + } + }, + "hardwareProfile": { + "$id": "5104", + "kind": "model", + "type": { + "$ref": "1317" + }, + "value": { + "$id": "5105", + "vmSizeProperties": { + "$id": "5106", + "kind": "model", + "type": { + "$ref": "1319" + }, + "value": { + "$id": "5107", + "vCPUsAvailable": { + "$id": "5108", + "kind": "number", + "type": { + "$ref": "1321" + }, + "value": 16 + }, + "vCPUsPerCore": { + "$id": "5109", + "kind": "number", + "type": { + "$ref": "1325" + }, + "value": 23 + } + } + } + } + }, + "serviceArtifactReference": { + "$id": "5110", + "kind": "model", + "type": { + "$ref": "1333" + }, + "value": { + "$id": "5111", + "id": { + "$id": "5112", + "kind": "string", + "type": { + "$ref": "1335" + }, + "value": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/serviceArtifacts/{serviceArtifactsName}/vmArtifactsProfiles/{vmArtifactsProfileName}" + } + } + }, + "securityPostureReference": { + "$id": "5113", + "kind": "model", + "type": { + "$ref": "1342" + }, + "value": { + "$id": "5114", + "id": { + "$id": "5115", + "kind": "string", + "type": { + "$ref": "1344" + }, + "value": "mubredelfbshboaxrsxiajihahaa" + }, + "excludeExtensions": { + "$id": "5116", + "kind": "array", + "type": { + "$ref": "1348" + }, + "value": [ + { + "$id": "5117", + "kind": "string", + "type": { + "$ref": "1349" + }, + "value": "{securityPostureVMExtensionName}" + } + ] + }, + "isOverridable": { + "$id": "5118", + "kind": "boolean", + "type": { + "$ref": "1353" + }, + "value": true + } + } + }, + "timeCreated": { + "$id": "5119", + "kind": "string", + "type": { + "$ref": "1359" + }, + "value": "2024-04-29T21:51:44.043Z" + } + } + }, + "computeApiVersion": { + "$id": "5120", + "kind": "string", + "type": { + "$ref": "1375" + }, + "value": "2023-07-01" + }, + "platformFaultDomainCount": { + "$id": "5121", + "kind": "number", + "type": { + "$ref": "1379" + }, + "value": 1 + } + } + }, + "timeCreated": { + "$id": "5122", + "kind": "string", + "type": { + "$ref": "1397" + }, + "value": "2024-07-10T00:16:34.8590555+00:00" + }, + "uniqueId": { + "$id": "5123", + "kind": "string", + "type": { + "$ref": "1402" + }, + "value": "a2f7fabd-bbc2-4a20-afe1-49fdb3885a28" + } + } + }, + "zones": { + "$id": "5124", + "kind": "array", + "type": { + "$ref": "1408" + }, + "value": [ + { + "$id": "5125", + "kind": "string", + "type": { + "$ref": "1409" + }, + "value": "zone1" + }, + { + "$id": "5126", + "kind": "string", + "type": { + "$ref": "1409" + }, + "value": "zone2" + } + ] + }, + "identity": { + "$id": "5127", + "kind": "model", + "type": { + "$ref": "1413" + }, + "value": { + "$id": "5128", + "principalId": { + "$id": "5129", + "kind": "string", + "type": { + "$ref": "1415" + }, + "value": "4d508e5b-374b-4382-9a1c-01fb8b6cb37c" + }, + "tenantId": { + "$id": "5130", + "kind": "string", + "type": { + "$ref": "1420" + }, + "value": "5d508e5b-374b-4382-9a1c-01fb8b6cb37c" + }, + "type": { + "$id": "5131", + "kind": "string", + "type": { + "$ref": "306" + }, + "value": "UserAssigned" + }, + "userAssignedIdentities": { + "$id": "5132", + "kind": "dict", + "type": { + "$ref": "1428" + }, + "value": { + "$id": "5133", + "key9851": { + "$id": "5134", + "kind": "model", + "type": { + "$ref": "1431" + }, + "value": { + "$id": "5135", + "principalId": { + "$id": "5136", + "kind": "string", + "type": { + "$ref": "1438" + }, + "value": "6d508e5b-374b-4382-9a1c-01fb8b6cb37c" + }, + "clientId": { + "$id": "5137", + "kind": "string", + "type": { + "$ref": "1433" + }, + "value": "7d508e5b-374b-4382-9a1c-01fb8b6cb37c" + } + } + } + } + } + } + }, + "plan": { + "$id": "5138", + "kind": "model", + "type": { + "$ref": "1447" + }, + "value": { + "$id": "5139", + "name": { + "$id": "5140", + "kind": "string", + "type": { + "$ref": "1449" + }, + "value": "jwgrcrnrtfoxn" + }, + "publisher": { + "$id": "5141", + "kind": "string", + "type": { + "$ref": "1453" + }, + "value": "iozjbiqqckqm" + }, + "product": { + "$id": "5142", + "kind": "string", + "type": { + "$ref": "1457" + }, + "value": "cgopbyvdyqikahwyxfpzwaqk" + }, + "promotionCode": { + "$id": "5143", + "kind": "string", + "type": { + "$ref": "1461" + }, + "value": "naglezezplcaruqogtxnuizslqnnbr" + }, + "version": { + "$id": "5144", + "kind": "string", + "type": { + "$ref": "1465" + }, + "value": "wa" + } + } + }, + "tags": { + "$id": "5145", + "kind": "dict", + "type": { + "$ref": "396" + }, + "value": { + "$id": "5146", + "key3518": { + "$id": "5147", + "kind": "string", + "type": { + "$ref": "398" + }, + "value": "luvrnuvsgdpbuofdskkcoqhfh" + } + } + }, + "location": { + "$id": "5148", + "kind": "string", + "type": { + "$ref": "402" + }, + "value": "westus" + }, + "id": { + "$id": "5149", + "kind": "string", + "type": { + "$ref": "354" + }, + "value": "/subscriptions/7B0CD4DB-3381-4013-9B31-FB6E6FD0FF1C/resourceGroups/rgazurefleet/providers/Microsoft.AzureFleet/fleets/testFleet" + }, + "name": { + "$id": "5150", + "kind": "string", + "type": { + "$ref": "359" + }, + "value": "testFleet" + }, + "type": { + "$id": "5151", + "kind": "string", + "type": { + "$ref": "363" + }, + "value": "Microsoft.AzureFleet/fleets" + }, + "systemData": { + "$id": "5152", + "kind": "model", + "type": { + "$ref": "368" + }, + "value": { + "$id": "5153", + "createdBy": { + "$id": "5154", + "kind": "string", + "type": { + "$ref": "370" + }, + "value": "rowegentrpoajsv" + }, + "createdByType": { + "$id": "5155", + "kind": "string", + "type": { + "$ref": "316" + }, + "value": "User" + }, + "createdAt": { + "$id": "5156", + "kind": "string", + "type": { + "$ref": "377" + }, + "value": "2024-04-29T21:51:44.043Z" + }, + "lastModifiedBy": { + "$id": "5157", + "kind": "string", + "type": { + "$ref": "382" + }, + "value": "edwuayhhaoepxzisfaqjhmrxjq" + }, + "lastModifiedByType": { + "$id": "5158", + "kind": "string", + "type": { + "$ref": "316" + }, + "value": "User" + }, + "lastModifiedAt": { + "$id": "5159", + "kind": "string", + "type": { + "$ref": "389" + }, + "value": "2024-04-29T21:51:44.043Z" + } + } + } + } + } + ] + }, + "nextLink": { + "$id": "5160", + "kind": "string", + "type": { + "$ref": "1581" + }, + "value": "https://microsoft.com/a" + } + } + } + } + ] + } + ] + }, + { + "$id": "5161", + "Name": "listVirtualMachineScaleSets", + "ResourceName": "VirtualMachineScaleSet", + "Doc": "List VirtualMachineScaleSet resources by Fleet", + "Accessibility": "public", + "Parameters": [ + { + "$id": "5162", + "Name": "apiVersion", + "NameInRequest": "api-version", + "Doc": "The API version to use for this operation.", + "Type": { + "$id": "5163", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": true, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "DefaultValue": { + "$id": "5164", + "Type": { + "$id": "5165", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "2024-11-01" + }, + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "5166", + "Name": "subscriptionId", + "NameInRequest": "subscriptionId", + "Doc": "The ID of the target subscription. The value must be an UUID.", + "Type": { + "$id": "5167", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "5168", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "5169", + "Name": "resourceGroupName", + "NameInRequest": "resourceGroupName", + "Doc": "The name of the resource group. The name is case insensitive.", + "Type": { + "$id": "5170", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "5171", + "Name": "name", + "NameInRequest": "name", + "Doc": "The name of the Fleet", + "Type": { + "$id": "5172", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "5173", + "Name": "accept", + "NameInRequest": "Accept", + "Type": { + "$id": "5174", + "kind": "constant", + "valueType": { + "$id": "5175", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "5176", + "StatusCodes": [ + 200 + ], + "BodyType": { + "$ref": "1585" + }, + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false, + "ContentTypes": [ + "application/json" + ] + } + ], + "HttpMethod": "GET", + "RequestBodyMediaType": "None", + "Uri": "{endpoint}", + "Path": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureFleet/fleets/{name}/virtualMachineScaleSets", + "BufferResponse": true, + "Paging": { + "$id": "5177", + "ItemName": "value", + "NextLinkName": "nextLink" + }, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Microsoft.AzureFleet.Fleets.listVirtualMachineScaleSets", + "Decorators": [], + "Examples": [ + { + "$id": "5178", + "kind": "http", + "name": "Fleets_ListVirtualMachineScaleSets", + "description": "Fleets_ListVirtualMachineScaleSets", + "filePath": "2024-11-01/Fleets_ListVirtualMachineScaleSets.json", + "parameters": [ + { + "$id": "5179", + "parameter": { + "$ref": "5162" + }, + "value": { + "$id": "5180", + "kind": "string", + "type": { + "$ref": "5163" + }, + "value": "2024-11-01" + } + }, + { + "$id": "5181", + "parameter": { + "$ref": "5166" + }, + "value": { + "$id": "5182", + "kind": "string", + "type": { + "$ref": "5167" + }, + "value": "1DC2F28C-A625-4B0E-9748-9885A3C9E9EB" + } + }, + { + "$id": "5183", + "parameter": { + "$ref": "5169" + }, + "value": { + "$id": "5184", + "kind": "string", + "type": { + "$ref": "5170" + }, + "value": "rgazurefleet" + } + }, + { + "$id": "5185", + "parameter": { + "$ref": "5171" + }, + "value": { + "$id": "5186", + "kind": "string", + "type": { + "$ref": "5172" + }, + "value": "myFleet" + } + } + ], + "responses": [ + { + "$id": "5187", + "response": { + "$ref": "5176" + }, + "statusCode": 200, + "bodyValue": { + "$id": "5188", + "kind": "model", + "type": { + "$ref": "1585" + }, + "value": { + "$id": "5189", + "value": { + "$id": "5190", + "kind": "array", + "type": { + "$ref": "1587" + }, + "value": [ + { + "$id": "5191", + "kind": "model", + "type": { + "$ref": "1588" + }, + "value": { + "$id": "5192", + "id": { + "$id": "5193", + "kind": "string", + "type": { + "$ref": "1590" + }, + "value": "/subscriptions/7B0CD4DB-3381-4013-9B31-FB6E6FD0FF1C/resourceGroups/rgazurefleet/providers/Microsoft.AzureFleet/fleets/myFleet/virtualMachineScaleSets/myVmss" + }, + "type": { + "$id": "5194", + "kind": "string", + "type": { + "$ref": "1595" + }, + "value": "Microsoft.AzureFleet/fleets/virtualMachineScaleSets" + }, + "operationStatus": { + "$id": "5195", + "kind": "string", + "type": { + "$ref": "2" + }, + "value": "Creating" + }, + "error": { + "$id": "5196", + "kind": "model", + "type": { + "$ref": "1602" + }, + "value": { + "$id": "5197", + "details": { + "$id": "5198", + "kind": "array", + "type": { + "$ref": "1616" + }, + "value": [ + { + "$id": "5199", + "kind": "model", + "type": { + "$ref": "1617" + }, + "value": { + "$id": "5200", + "code": { + "$id": "5201", + "kind": "string", + "type": { + "$ref": "1619" + }, + "value": "gzhtOverconstrainedAllocationRequestyosk" + }, + "target": { + "$id": "5202", + "kind": "string", + "type": { + "$ref": "1623" + }, + "value": "qfthabhrmndhfizfnrwpgxvnokpy" + }, + "message": { + "$id": "5203", + "kind": "string", + "type": { + "$ref": "1627" + }, + "value": "Allocation Failed" + } + } + } + ] + }, + "innererror": { + "$id": "5204", + "kind": "model", + "type": { + "$ref": "1633" + }, + "value": { + "$id": "5205", + "exceptionType": { + "$id": "5206", + "kind": "string", + "type": { + "$ref": "1635" + }, + "value": "sfaomfpoaptnbxchrfskm" + }, + "errorDetail": { + "$id": "5207", + "kind": "string", + "type": { + "$ref": "1639" + }, + "value": "ihjwbwykq" + } + } + }, + "code": { + "$id": "5208", + "kind": "string", + "type": { + "$ref": "1604" + }, + "value": "OverconstrainedAllocationRequest" + }, + "target": { + "$id": "5209", + "kind": "string", + "type": { + "$ref": "1608" + }, + "value": "nhaj" + }, + "message": { + "$id": "5210", + "kind": "string", + "type": { + "$ref": "1612" + }, + "value": "Allocation Failed" + } + } + } + } + } + ] + } + } + } + } + ] + } + ] + } + ], + "Protocol": { + "$id": "5211" + }, + "Parent": "AzureFleetClient", + "Parameters": [ + { + "$id": "5212", + "Name": "endpoint", + "NameInRequest": "endpoint", + "Doc": "Service host", + "Type": { + "$id": "5213", + "kind": "url", + "name": "url", + "crossLanguageDefinitionId": "TypeSpec.url" + }, + "Location": "Uri", + "IsApiVersion": false, + "IsResourceParameter": false, + "IsContentType": false, + "IsRequired": true, + "IsEndpoint": true, + "SkipUrlEncoding": false, + "Explode": false, + "Kind": "Client", + "DefaultValue": { + "$id": "5214", + "Type": { + "$id": "5215", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "https://management.azure.com" + } + } + ], + "Decorators": [] + } + ], + "Auth": { + "$id": "5216", + "OAuth2": { + "$id": "5217", + "Scopes": [ + "user_impersonation" + ] + } + } +} diff --git a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/Configuration.json b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/Configuration.json new file mode 100644 index 000000000000..3ebb2db81a78 --- /dev/null +++ b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/Configuration.json @@ -0,0 +1,12 @@ +{ + "output-folder": ".", + "namespace": "Azure.ResourceManager.ComputeSchedule", + "library-name": "Azure.ResourceManager.ComputeSchedule", + "flavor": "azure", + "use-model-reader-writer": true, + "shared-source-folders": [ + "../../TempTypeSpecFiles/node_modules/@autorest/csharp/Generator.Shared", + "../../TempTypeSpecFiles/node_modules/@autorest/csharp/Azure.Core.Shared" + ], + "azure-arm": true +} diff --git a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/tsp-location.yaml b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/tsp-location.yaml index 43a99ae83111..125c0c567bad 100644 --- a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/tsp-location.yaml +++ b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/tsp-location.yaml @@ -1,3 +1,4 @@ directory: specification/computeschedule/ComputeSchedule.Management -commit: 62e3312e67873d702fb2c6e5c7717d99cf4d369b -repo: Azure/azure-rest-api-specs \ No newline at end of file +commit: 676334a284e5136f0a0721d6ae844bb04332f579 +repo: Azure/azure-rest-api-specs +additionalDirectories: diff --git a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/tspCodeModel.json b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/tspCodeModel.json new file mode 100644 index 000000000000..0b3753e4bff0 --- /dev/null +++ b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/tspCodeModel.json @@ -0,0 +1,9030 @@ +{ + "$id": "1", + "Name": "Microsoft.ComputeSchedule", + "ApiVersions": [ + "2024-10-01" + ], + "Enums": [ + { + "$id": "2", + "kind": "enum", + "name": "ScheduledActionDeadlineType", + "crossLanguageDefinitionId": "Microsoft.ComputeSchedule.DeadlineType", + "valueType": { + "$id": "3", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "4", + "kind": "enumvalue", + "name": "Unknown", + "value": "Unknown", + "valueType": { + "$id": "5", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "2" + }, + "doc": "Default value of Unknown.", + "decorators": [] + }, + { + "$id": "6", + "kind": "enumvalue", + "name": "InitiateAt", + "value": "InitiateAt", + "valueType": { + "$id": "7", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "2" + }, + "doc": "Initiate the operation at the given deadline.", + "decorators": [] + }, + { + "$id": "8", + "kind": "enumvalue", + "name": "CompleteBy", + "value": "CompleteBy", + "valueType": { + "$id": "9", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "2" + }, + "doc": "Complete the operation by the given deadline.", + "decorators": [] + } + ], + "clientNamespace": "Microsoft.ComputeSchedule", + "doc": "The types of deadlines supported by ScheduledActions", + "isFixed": false, + "isFlags": false, + "usage": "Input,Output,Json", + "decorators": [] + }, + { + "$id": "10", + "kind": "enum", + "name": "ScheduledActionOptimizationPreference", + "crossLanguageDefinitionId": "Microsoft.ComputeSchedule.OptimizationPreference", + "valueType": { + "$id": "11", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "12", + "kind": "enumvalue", + "name": "Cost", + "value": "Cost", + "valueType": { + "$id": "13", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "10" + }, + "doc": "Optimize while considering cost savings", + "decorators": [] + }, + { + "$id": "14", + "kind": "enumvalue", + "name": "Availability", + "value": "Availability", + "valueType": { + "$id": "15", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "10" + }, + "doc": "Optimize while considering availability of resources", + "decorators": [] + }, + { + "$id": "16", + "kind": "enumvalue", + "name": "CostAvailabilityBalanced", + "value": "CostAvailabilityBalanced", + "valueType": { + "$id": "17", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "10" + }, + "doc": "Optimize while considering a balance of cost and availability", + "decorators": [] + } + ], + "clientNamespace": "Microsoft.ComputeSchedule", + "doc": "The preferences customers can select to optimize their requests to ScheduledActions", + "isFixed": false, + "isFlags": false, + "usage": "Input,Json", + "decorators": [] + }, + { + "$id": "18", + "kind": "enum", + "name": "ResourceOperationType", + "crossLanguageDefinitionId": "Microsoft.ComputeSchedule.ResourceOperationType", + "valueType": { + "$id": "19", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "20", + "kind": "enumvalue", + "name": "Unknown", + "value": "Unknown", + "valueType": { + "$id": "21", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "18" + }, + "doc": "The default value for this enum type", + "decorators": [] + }, + { + "$id": "22", + "kind": "enumvalue", + "name": "Start", + "value": "Start", + "valueType": { + "$id": "23", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "18" + }, + "doc": "Start operations on the resources", + "decorators": [] + }, + { + "$id": "24", + "kind": "enumvalue", + "name": "Deallocate", + "value": "Deallocate", + "valueType": { + "$id": "25", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "18" + }, + "doc": "Deallocate operations on the resources", + "decorators": [] + }, + { + "$id": "26", + "kind": "enumvalue", + "name": "Hibernate", + "value": "Hibernate", + "valueType": { + "$id": "27", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "18" + }, + "doc": "Hibernate operations on the resources", + "decorators": [] + } + ], + "clientNamespace": "Microsoft.ComputeSchedule", + "doc": "The kind of operation types that can be performed on resources using ScheduledActions", + "isFixed": false, + "isFlags": false, + "usage": "Output,Json", + "decorators": [] + }, + { + "$id": "28", + "kind": "enum", + "name": "ScheduledActionOperationState", + "crossLanguageDefinitionId": "Microsoft.ComputeSchedule.OperationState", + "valueType": { + "$id": "29", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "30", + "kind": "enumvalue", + "name": "Unknown", + "value": "Unknown", + "valueType": { + "$id": "31", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "28" + }, + "doc": "The default value for the operation state enum", + "decorators": [] + }, + { + "$id": "32", + "kind": "enumvalue", + "name": "PendingScheduling", + "value": "PendingScheduling", + "valueType": { + "$id": "33", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "28" + }, + "doc": "Operations that are pending scheduling", + "decorators": [] + }, + { + "$id": "34", + "kind": "enumvalue", + "name": "Scheduled", + "value": "Scheduled", + "valueType": { + "$id": "35", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "28" + }, + "doc": "Operations that have been scheduled", + "decorators": [] + }, + { + "$id": "36", + "kind": "enumvalue", + "name": "PendingExecution", + "value": "PendingExecution", + "valueType": { + "$id": "37", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "28" + }, + "doc": "Operations that are waiting to be executed", + "decorators": [] + }, + { + "$id": "38", + "kind": "enumvalue", + "name": "Executing", + "value": "Executing", + "valueType": { + "$id": "39", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "28" + }, + "doc": "Operations that are in the process of being executed", + "decorators": [] + }, + { + "$id": "40", + "kind": "enumvalue", + "name": "Succeeded", + "value": "Succeeded", + "valueType": { + "$id": "41", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "28" + }, + "doc": "Operations that suceeded", + "decorators": [] + }, + { + "$id": "42", + "kind": "enumvalue", + "name": "Failed", + "value": "Failed", + "valueType": { + "$id": "43", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "28" + }, + "doc": "Operations that have failed", + "decorators": [] + }, + { + "$id": "44", + "kind": "enumvalue", + "name": "Cancelled", + "value": "Cancelled", + "valueType": { + "$id": "45", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "28" + }, + "doc": "Operations that have been Cancelled by the user", + "decorators": [] + }, + { + "$id": "46", + "kind": "enumvalue", + "name": "Blocked", + "value": "Blocked", + "valueType": { + "$id": "47", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "28" + }, + "doc": "Operations that are blocked", + "decorators": [] + } + ], + "clientNamespace": "Microsoft.ComputeSchedule", + "doc": "Values that define the states of operations in Scheduled Actions", + "isFixed": false, + "isFlags": false, + "usage": "Output,Json", + "decorators": [] + }, + { + "$id": "48", + "kind": "enum", + "name": "Origin", + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.Origin", + "valueType": { + "$id": "49", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "50", + "kind": "enumvalue", + "name": "user", + "value": "user", + "valueType": { + "$id": "51", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "48" + }, + "doc": "Indicates the operation is initiated by a user.", + "decorators": [] + }, + { + "$id": "52", + "kind": "enumvalue", + "name": "system", + "value": "system", + "valueType": { + "$id": "53", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "48" + }, + "doc": "Indicates the operation is initiated by a system.", + "decorators": [] + }, + { + "$id": "54", + "kind": "enumvalue", + "name": "user,system", + "value": "user,system", + "valueType": { + "$id": "55", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "48" + }, + "doc": "Indicates the operation is initiated by a user or system.", + "decorators": [] + } + ], + "clientNamespace": "Azure.ResourceManager.CommonTypes", + "doc": "The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default value is \"user,system\"", + "isFixed": false, + "isFlags": false, + "usage": "Output,Json", + "decorators": [] + }, + { + "$id": "56", + "kind": "enum", + "name": "ActionType", + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.ActionType", + "valueType": { + "$id": "57", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "58", + "kind": "enumvalue", + "name": "Internal", + "value": "Internal", + "valueType": { + "$id": "59", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "56" + }, + "doc": "Actions are for internal-only APIs.", + "decorators": [] + } + ], + "clientNamespace": "Azure.ResourceManager.CommonTypes", + "doc": "Extensible enum. Indicates the action type. \"Internal\" refers to actions that are for internal only APIs.", + "isFixed": false, + "isFlags": false, + "usage": "Output,Json", + "decorators": [] + }, + { + "$id": "60", + "kind": "enum", + "name": "Versions", + "crossLanguageDefinitionId": "Microsoft.ComputeSchedule.Versions", + "valueType": { + "$id": "61", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "62", + "kind": "enumvalue", + "name": "2024-10-01", + "value": "2024-10-01", + "valueType": { + "$id": "63", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "60" + }, + "doc": "2024-10-01 version", + "decorators": [] + } + ], + "clientNamespace": "Microsoft.ComputeSchedule", + "doc": "ComputeSchedule API versions", + "isFixed": true, + "isFlags": false, + "usage": "ApiVersionEnum", + "decorators": [] + } + ], + "Models": [ + { + "$id": "64", + "kind": "model", + "name": "SubmitDeallocateRequest", + "clientNamespace": "Microsoft.ComputeSchedule", + "crossLanguageDefinitionId": "Microsoft.ComputeSchedule.SubmitDeallocateRequest", + "usage": "Input,Json", + "doc": "The deallocate request for resources", + "decorators": [], + "properties": [ + { + "$id": "65", + "kind": "property", + "name": "schedule", + "serializedName": "schedule", + "doc": "The schedule for the request", + "type": { + "$id": "66", + "kind": "model", + "name": "UserRequestSchedule", + "clientNamespace": "Microsoft.ComputeSchedule", + "crossLanguageDefinitionId": "Microsoft.ComputeSchedule.Schedule", + "usage": "Input,Json", + "doc": "The schedule details for the user request", + "decorators": [], + "properties": [ + { + "$id": "67", + "kind": "property", + "name": "deadline", + "serializedName": "deadline", + "doc": "The deadline for the operation", + "type": { + "$id": "68", + "kind": "offsetDateTime", + "name": "offsetDateTime", + "encode": "rfc3339", + "wireType": { + "$id": "69", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.offsetDateTime", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.ComputeSchedule.Schedule.deadline", + "serializationOptions": { + "$id": "70", + "json": { + "$id": "71", + "name": "deadline" + } + } + }, + { + "$id": "72", + "kind": "property", + "name": "userRequestDeadline", + "serializedName": "deadLine", + "doc": "The deadline for the operation", + "type": { + "$id": "73", + "kind": "offsetDateTime", + "name": "offsetDateTime", + "encode": "rfc3339", + "wireType": { + "$id": "74", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.offsetDateTime", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.ComputeSchedule.Schedule.deadLine", + "serializationOptions": { + "$id": "75", + "json": { + "$id": "76", + "name": "deadLine" + } + } + }, + { + "$id": "77", + "kind": "property", + "name": "timezone", + "serializedName": "timezone", + "doc": "The timezone for the operation", + "type": { + "$id": "78", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.ComputeSchedule.Schedule.timezone", + "serializationOptions": { + "$id": "79", + "json": { + "$id": "80", + "name": "timezone" + } + } + }, + { + "$id": "81", + "kind": "property", + "name": "userRequestTimezone", + "serializedName": "timeZone", + "doc": "The timezone for the operation", + "type": { + "$id": "82", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.ComputeSchedule.Schedule.timeZone", + "serializationOptions": { + "$id": "83", + "json": { + "$id": "84", + "name": "timeZone" + } + } + }, + { + "$id": "85", + "kind": "property", + "name": "deadlineType", + "serializedName": "deadlineType", + "doc": "The deadlinetype of the operation, this can either be InitiateAt or CompleteBy", + "type": { + "$ref": "2" + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.ComputeSchedule.Schedule.deadlineType", + "serializationOptions": { + "$id": "86", + "json": { + "$id": "87", + "name": "deadlineType" + } + } + } + ] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.ComputeSchedule.SubmitDeallocateRequest.schedule", + "serializationOptions": { + "$id": "88", + "json": { + "$id": "89", + "name": "schedule" + } + } + }, + { + "$id": "90", + "kind": "property", + "name": "executionParameters", + "serializedName": "executionParameters", + "doc": "The execution parameters for the request", + "type": { + "$id": "91", + "kind": "model", + "name": "ScheduledActionExecutionParameterDetail", + "clientNamespace": "Microsoft.ComputeSchedule", + "crossLanguageDefinitionId": "Microsoft.ComputeSchedule.ExecutionParameters", + "usage": "Input,Json", + "doc": "Extra details needed to run the user's request", + "decorators": [], + "properties": [ + { + "$id": "92", + "kind": "property", + "name": "optimizationPreference", + "serializedName": "optimizationPreference", + "doc": "Details that could optimize the user's request", + "type": { + "$ref": "10" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.ComputeSchedule.ExecutionParameters.optimizationPreference", + "serializationOptions": { + "$id": "93", + "json": { + "$id": "94", + "name": "optimizationPreference" + } + } + }, + { + "$id": "95", + "kind": "property", + "name": "retryPolicy", + "serializedName": "retryPolicy", + "doc": "Retry policy the user can pass", + "type": { + "$id": "96", + "kind": "model", + "name": "UserRequestRetryPolicy", + "clientNamespace": "Microsoft.ComputeSchedule", + "crossLanguageDefinitionId": "Microsoft.ComputeSchedule.RetryPolicy", + "usage": "Input,Output,Json", + "doc": "The retry policy for the user request", + "decorators": [], + "properties": [ + { + "$id": "97", + "kind": "property", + "name": "retryCount", + "serializedName": "retryCount", + "doc": "Retry count for user request", + "type": { + "$id": "98", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.ComputeSchedule.RetryPolicy.retryCount", + "serializationOptions": { + "$id": "99", + "json": { + "$id": "100", + "name": "retryCount" + } + } + }, + { + "$id": "101", + "kind": "property", + "name": "retryWindowInMinutes", + "serializedName": "retryWindowInMinutes", + "doc": "Retry window in minutes for user request", + "type": { + "$id": "102", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.ComputeSchedule.RetryPolicy.retryWindowInMinutes", + "serializationOptions": { + "$id": "103", + "json": { + "$id": "104", + "name": "retryWindowInMinutes" + } + } + } + ] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.ComputeSchedule.ExecutionParameters.retryPolicy", + "serializationOptions": { + "$id": "105", + "json": { + "$id": "106", + "name": "retryPolicy" + } + } + } + ] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.ComputeSchedule.SubmitDeallocateRequest.executionParameters", + "serializationOptions": { + "$id": "107", + "json": { + "$id": "108", + "name": "executionParameters" + } + } + }, + { + "$id": "109", + "kind": "property", + "name": "resources", + "serializedName": "resources", + "doc": "The resources for the request", + "type": { + "$id": "110", + "kind": "model", + "name": "UserRequestResources", + "clientNamespace": "Microsoft.ComputeSchedule", + "crossLanguageDefinitionId": "Microsoft.ComputeSchedule.Resources", + "usage": "Input,Json", + "doc": "The resources needed for the user request", + "decorators": [], + "properties": [ + { + "$id": "111", + "kind": "property", + "name": "ids", + "serializedName": "ids", + "doc": "The resource ids used for the request", + "type": { + "$id": "112", + "kind": "array", + "name": "Array", + "valueType": { + "$id": "113", + "kind": "string", + "name": "armResourceIdentifier", + "crossLanguageDefinitionId": "Azure.Core.armResourceIdentifier", + "baseType": { + "$id": "114", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.ComputeSchedule.Resources.ids", + "serializationOptions": { + "$id": "115", + "json": { + "$id": "116", + "name": "ids" + } + } + } + ] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.ComputeSchedule.SubmitDeallocateRequest.resources", + "serializationOptions": { + "$id": "117", + "json": { + "$id": "118", + "name": "resources" + } + } + }, + { + "$id": "119", + "kind": "property", + "name": "correlationId", + "serializedName": "correlationid", + "doc": "CorrelationId item", + "type": { + "$id": "120", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.ComputeSchedule.SubmitDeallocateRequest.correlationid", + "serializationOptions": { + "$id": "121", + "json": { + "$id": "122", + "name": "correlationid" + } + } + } + ] + }, + { + "$ref": "66" + }, + { + "$ref": "91" + }, + { + "$ref": "96" + }, + { + "$ref": "110" + }, + { + "$id": "123", + "kind": "model", + "name": "DeallocateResourceOperationResult", + "clientNamespace": "Microsoft.ComputeSchedule", + "crossLanguageDefinitionId": "Microsoft.ComputeSchedule.DeallocateResourceOperationResponse", + "usage": "Output,Json", + "doc": "The response from a deallocate request", + "decorators": [], + "properties": [ + { + "$id": "124", + "kind": "property", + "name": "description", + "serializedName": "description", + "doc": "The description of the operation response", + "type": { + "$id": "125", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.ComputeSchedule.DeallocateResourceOperationResponse.description", + "serializationOptions": { + "$id": "126", + "json": { + "$id": "127", + "name": "description" + } + } + }, + { + "$id": "128", + "kind": "property", + "name": "ResourceType", + "serializedName": "type", + "doc": "The type of resources used in the deallocate request eg virtual machines", + "type": { + "$id": "129", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.ComputeSchedule.DeallocateResourceOperationResponse.type", + "serializationOptions": { + "$id": "130", + "json": { + "$id": "131", + "name": "type" + } + } + }, + { + "$id": "132", + "kind": "property", + "name": "location", + "serializedName": "location", + "doc": "The location of the deallocate request eg westus", + "type": { + "$id": "133", + "kind": "string", + "name": "azureLocation", + "crossLanguageDefinitionId": "Azure.Core.azureLocation", + "baseType": { + "$id": "134", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.ComputeSchedule.DeallocateResourceOperationResponse.location", + "serializationOptions": { + "$id": "135", + "json": { + "$id": "136", + "name": "location" + } + } + }, + { + "$id": "137", + "kind": "property", + "name": "results", + "serializedName": "results", + "doc": "The results from the deallocate request if no errors exist", + "type": { + "$id": "138", + "kind": "array", + "name": "ArrayResourceOperation", + "valueType": { + "$id": "139", + "kind": "model", + "name": "ResourceOperationResult", + "clientNamespace": "Microsoft.ComputeSchedule", + "crossLanguageDefinitionId": "Microsoft.ComputeSchedule.ResourceOperation", + "usage": "Output,Json", + "doc": "High level response from an operation on a resource", + "decorators": [], + "properties": [ + { + "$id": "140", + "kind": "property", + "name": "resourceId", + "serializedName": "resourceId", + "doc": "Unique identifier for the resource involved in the operation, eg ArmId", + "type": { + "$id": "141", + "kind": "string", + "name": "armResourceIdentifier", + "crossLanguageDefinitionId": "Azure.Core.armResourceIdentifier", + "baseType": { + "$id": "142", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.ComputeSchedule.ResourceOperation.resourceId", + "serializationOptions": { + "$id": "143", + "json": { + "$id": "144", + "name": "resourceId" + } + } + }, + { + "$id": "145", + "kind": "property", + "name": "errorCode", + "serializedName": "errorCode", + "doc": "Resource level error code if it exists", + "type": { + "$id": "146", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.ComputeSchedule.ResourceOperation.errorCode", + "serializationOptions": { + "$id": "147", + "json": { + "$id": "148", + "name": "errorCode" + } + } + }, + { + "$id": "149", + "kind": "property", + "name": "errorDetails", + "serializedName": "errorDetails", + "doc": "Resource level error details if they exist", + "type": { + "$id": "150", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.ComputeSchedule.ResourceOperation.errorDetails", + "serializationOptions": { + "$id": "151", + "json": { + "$id": "152", + "name": "errorDetails" + } + } + }, + { + "$id": "153", + "kind": "property", + "name": "operation", + "serializedName": "operation", + "doc": "Details of the operation performed on a resource", + "type": { + "$id": "154", + "kind": "model", + "name": "ResourceOperationDetails", + "clientNamespace": "Microsoft.ComputeSchedule", + "crossLanguageDefinitionId": "Microsoft.ComputeSchedule.ResourceOperationDetails", + "usage": "Output,Json", + "doc": "The details of a response from an operation on a resource", + "decorators": [], + "properties": [ + { + "$id": "155", + "kind": "property", + "name": "operationId", + "serializedName": "operationId", + "doc": "Operation identifier for the unique operation", + "type": { + "$id": "156", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.ComputeSchedule.ResourceOperationDetails.operationId", + "serializationOptions": { + "$id": "157", + "json": { + "$id": "158", + "name": "operationId" + } + } + }, + { + "$id": "159", + "kind": "property", + "name": "resourceId", + "serializedName": "resourceId", + "doc": "Unique identifier for the resource involved in the operation, eg ArmId", + "type": { + "$id": "160", + "kind": "string", + "name": "armResourceIdentifier", + "crossLanguageDefinitionId": "Azure.Core.armResourceIdentifier", + "baseType": { + "$id": "161", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.ComputeSchedule.ResourceOperationDetails.resourceId", + "serializationOptions": { + "$id": "162", + "json": { + "$id": "163", + "name": "resourceId" + } + } + }, + { + "$id": "164", + "kind": "property", + "name": "opType", + "serializedName": "opType", + "doc": "Type of operation performed on the resources", + "type": { + "$ref": "18" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.ComputeSchedule.ResourceOperationDetails.opType", + "serializationOptions": { + "$id": "165", + "json": { + "$id": "166", + "name": "opType" + } + } + }, + { + "$id": "167", + "kind": "property", + "name": "subscriptionId", + "serializedName": "subscriptionId", + "doc": "Subscription id attached to the request", + "type": { + "$id": "168", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.ComputeSchedule.ResourceOperationDetails.subscriptionId", + "serializationOptions": { + "$id": "169", + "json": { + "$id": "170", + "name": "subscriptionId" + } + } + }, + { + "$id": "171", + "kind": "property", + "name": "deadline", + "serializedName": "deadline", + "doc": "Deadline for the operation", + "type": { + "$id": "172", + "kind": "offsetDateTime", + "name": "offsetDateTime", + "encode": "rfc3339", + "wireType": { + "$id": "173", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.offsetDateTime", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.ComputeSchedule.ResourceOperationDetails.deadline", + "serializationOptions": { + "$id": "174", + "json": { + "$id": "175", + "name": "deadline" + } + } + }, + { + "$id": "176", + "kind": "property", + "name": "deadlineType", + "serializedName": "deadlineType", + "doc": "Type of deadline of the operation", + "type": { + "$ref": "2" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.ComputeSchedule.ResourceOperationDetails.deadlineType", + "serializationOptions": { + "$id": "177", + "json": { + "$id": "178", + "name": "deadlineType" + } + } + }, + { + "$id": "179", + "kind": "property", + "name": "state", + "serializedName": "state", + "doc": "Current state of the operation", + "type": { + "$ref": "28" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.ComputeSchedule.ResourceOperationDetails.state", + "serializationOptions": { + "$id": "180", + "json": { + "$id": "181", + "name": "state" + } + } + }, + { + "$id": "182", + "kind": "property", + "name": "timezone", + "serializedName": "timezone", + "doc": "Timezone for the operation", + "type": { + "$id": "183", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.ComputeSchedule.ResourceOperationDetails.timezone", + "serializationOptions": { + "$id": "184", + "json": { + "$id": "185", + "name": "timezone" + } + } + }, + { + "$id": "186", + "kind": "property", + "name": "operationTimezone", + "serializedName": "timeZone", + "doc": "Timezone for the operation", + "type": { + "$id": "187", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.ComputeSchedule.ResourceOperationDetails.timeZone", + "serializationOptions": { + "$id": "188", + "json": { + "$id": "189", + "name": "timeZone" + } + } + }, + { + "$id": "190", + "kind": "property", + "name": "resourceOperationError", + "serializedName": "resourceOperationError", + "doc": "Operation level errors if they exist", + "type": { + "$id": "191", + "kind": "model", + "name": "ResourceOperationError", + "clientNamespace": "Microsoft.ComputeSchedule", + "crossLanguageDefinitionId": "Microsoft.ComputeSchedule.ResourceOperationError", + "usage": "Output,Json", + "doc": "These describe errors that occur at the resource level", + "decorators": [], + "properties": [ + { + "$id": "192", + "kind": "property", + "name": "errorCode", + "serializedName": "errorCode", + "doc": "Code for the error eg 404, 500", + "type": { + "$id": "193", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.ComputeSchedule.ResourceOperationError.errorCode", + "serializationOptions": { + "$id": "194", + "json": { + "$id": "195", + "name": "errorCode" + } + } + }, + { + "$id": "196", + "kind": "property", + "name": "errorDetails", + "serializedName": "errorDetails", + "doc": "Detailed message about the error", + "type": { + "$id": "197", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.ComputeSchedule.ResourceOperationError.errorDetails", + "serializationOptions": { + "$id": "198", + "json": { + "$id": "199", + "name": "errorDetails" + } + } + } + ] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.ComputeSchedule.ResourceOperationDetails.resourceOperationError", + "serializationOptions": { + "$id": "200", + "json": { + "$id": "201", + "name": "resourceOperationError" + } + } + }, + { + "$id": "202", + "kind": "property", + "name": "completedAt", + "serializedName": "completedAt", + "doc": "Time the operation was complete if errors are null", + "type": { + "$id": "203", + "kind": "offsetDateTime", + "name": "offsetDateTime", + "encode": "rfc3339", + "wireType": { + "$id": "204", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.offsetDateTime", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.ComputeSchedule.ResourceOperationDetails.completedAt", + "serializationOptions": { + "$id": "205", + "json": { + "$id": "206", + "name": "completedAt" + } + } + }, + { + "$id": "207", + "kind": "property", + "name": "retryPolicy", + "serializedName": "retryPolicy", + "doc": "Retry policy the user can pass", + "type": { + "$ref": "96" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.ComputeSchedule.ResourceOperationDetails.retryPolicy", + "serializationOptions": { + "$id": "208", + "json": { + "$id": "209", + "name": "retryPolicy" + } + } + } + ] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.ComputeSchedule.ResourceOperation.operation", + "serializationOptions": { + "$id": "210", + "json": { + "$id": "211", + "name": "operation" + } + } + } + ] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.ComputeSchedule.DeallocateResourceOperationResponse.results", + "serializationOptions": { + "$id": "212", + "json": { + "$id": "213", + "name": "results" + } + } + } + ] + }, + { + "$ref": "139" + }, + { + "$ref": "154" + }, + { + "$ref": "191" + }, + { + "$id": "214", + "kind": "model", + "name": "ErrorResponse", + "clientNamespace": "Azure.ResourceManager.CommonTypes", + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.ErrorResponse", + "usage": "Error,Json,Exception", + "doc": "Common error response for all Azure Resource Manager APIs to return error details for failed operations.", + "decorators": [], + "properties": [ + { + "$id": "215", + "kind": "property", + "name": "error", + "serializedName": "error", + "doc": "The error object.", + "type": { + "$id": "216", + "kind": "model", + "name": "ErrorDetail", + "clientNamespace": "Azure.ResourceManager.CommonTypes", + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.ErrorDetail", + "usage": "Json,Exception", + "doc": "The error detail.", + "decorators": [], + "properties": [ + { + "$id": "217", + "kind": "property", + "name": "code", + "serializedName": "code", + "doc": "The error code.", + "type": { + "$id": "218", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.ErrorDetail.code", + "serializationOptions": { + "$id": "219", + "json": { + "$id": "220", + "name": "code" + } + } + }, + { + "$id": "221", + "kind": "property", + "name": "message", + "serializedName": "message", + "doc": "The error message.", + "type": { + "$id": "222", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.ErrorDetail.message", + "serializationOptions": { + "$id": "223", + "json": { + "$id": "224", + "name": "message" + } + } + }, + { + "$id": "225", + "kind": "property", + "name": "target", + "serializedName": "target", + "doc": "The error target.", + "type": { + "$id": "226", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.ErrorDetail.target", + "serializationOptions": { + "$id": "227", + "json": { + "$id": "228", + "name": "target" + } + } + }, + { + "$id": "229", + "kind": "property", + "name": "details", + "serializedName": "details", + "doc": "The error details.", + "type": { + "$id": "230", + "kind": "array", + "name": "ArrayErrorDetail", + "valueType": { + "$ref": "216" + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.ErrorDetail.details", + "serializationOptions": { + "$id": "231", + "json": { + "$id": "232", + "name": "details" + } + } + }, + { + "$id": "233", + "kind": "property", + "name": "additionalInfo", + "serializedName": "additionalInfo", + "doc": "The error additional info.", + "type": { + "$id": "234", + "kind": "array", + "name": "ArrayErrorAdditionalInfo", + "valueType": { + "$id": "235", + "kind": "model", + "name": "ErrorAdditionalInfo", + "clientNamespace": "Azure.ResourceManager.CommonTypes", + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.ErrorAdditionalInfo", + "usage": "Json,Exception", + "doc": "The resource management error additional info.", + "decorators": [], + "properties": [ + { + "$id": "236", + "kind": "property", + "name": "type", + "serializedName": "type", + "doc": "The additional info type.", + "type": { + "$id": "237", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.ErrorAdditionalInfo.type", + "serializationOptions": { + "$id": "238", + "json": { + "$id": "239", + "name": "type" + } + } + }, + { + "$id": "240", + "kind": "property", + "name": "info", + "serializedName": "info", + "doc": "The additional info.", + "type": { + "$id": "241", + "kind": "model", + "name": "ErrorAdditionalInfoInfo", + "clientNamespace": "Azure.ResourceManager.CommonTypes", + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.ErrorAdditionalInfo.info.anonymous", + "usage": "Json,Exception", + "decorators": [], + "properties": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.ErrorAdditionalInfo.info", + "serializationOptions": { + "$id": "242", + "json": { + "$id": "243", + "name": "info" + } + } + } + ] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.ErrorDetail.additionalInfo", + "serializationOptions": { + "$id": "244", + "json": { + "$id": "245", + "name": "additionalInfo" + } + } + } + ] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.ErrorResponse.error", + "serializationOptions": { + "$id": "246", + "json": { + "$id": "247", + "name": "error" + } + } + } + ] + }, + { + "$ref": "216" + }, + { + "$ref": "235" + }, + { + "$ref": "241" + }, + { + "$id": "248", + "kind": "model", + "name": "SubmitHibernateRequest", + "clientNamespace": "Microsoft.ComputeSchedule", + "crossLanguageDefinitionId": "Microsoft.ComputeSchedule.SubmitHibernateRequest", + "usage": "Input,Json", + "doc": "This is the request for hibernate", + "decorators": [], + "properties": [ + { + "$id": "249", + "kind": "property", + "name": "schedule", + "serializedName": "schedule", + "doc": "The schedule for the request", + "type": { + "$ref": "66" + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.ComputeSchedule.SubmitHibernateRequest.schedule", + "serializationOptions": { + "$id": "250", + "json": { + "$id": "251", + "name": "schedule" + } + } + }, + { + "$id": "252", + "kind": "property", + "name": "executionParameters", + "serializedName": "executionParameters", + "doc": "The execution parameters for the request", + "type": { + "$ref": "91" + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.ComputeSchedule.SubmitHibernateRequest.executionParameters", + "serializationOptions": { + "$id": "253", + "json": { + "$id": "254", + "name": "executionParameters" + } + } + }, + { + "$id": "255", + "kind": "property", + "name": "resources", + "serializedName": "resources", + "doc": "The resources for the request", + "type": { + "$ref": "110" + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.ComputeSchedule.SubmitHibernateRequest.resources", + "serializationOptions": { + "$id": "256", + "json": { + "$id": "257", + "name": "resources" + } + } + }, + { + "$id": "258", + "kind": "property", + "name": "correlationId", + "serializedName": "correlationid", + "doc": "CorrelationId item", + "type": { + "$id": "259", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.ComputeSchedule.SubmitHibernateRequest.correlationid", + "serializationOptions": { + "$id": "260", + "json": { + "$id": "261", + "name": "correlationid" + } + } + } + ] + }, + { + "$id": "262", + "kind": "model", + "name": "HibernateResourceOperationResult", + "clientNamespace": "Microsoft.ComputeSchedule", + "crossLanguageDefinitionId": "Microsoft.ComputeSchedule.HibernateResourceOperationResponse", + "usage": "Output,Json", + "doc": "The response from a Hibernate request", + "decorators": [], + "properties": [ + { + "$id": "263", + "kind": "property", + "name": "description", + "serializedName": "description", + "doc": "The description of the operation response", + "type": { + "$id": "264", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.ComputeSchedule.HibernateResourceOperationResponse.description", + "serializationOptions": { + "$id": "265", + "json": { + "$id": "266", + "name": "description" + } + } + }, + { + "$id": "267", + "kind": "property", + "name": "ResourceType", + "serializedName": "type", + "doc": "The type of resources used in the Hibernate request eg virtual machines", + "type": { + "$id": "268", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.ComputeSchedule.HibernateResourceOperationResponse.type", + "serializationOptions": { + "$id": "269", + "json": { + "$id": "270", + "name": "type" + } + } + }, + { + "$id": "271", + "kind": "property", + "name": "location", + "serializedName": "location", + "doc": "The location of the Hibernate request eg westus", + "type": { + "$id": "272", + "kind": "string", + "name": "azureLocation", + "crossLanguageDefinitionId": "Azure.Core.azureLocation", + "baseType": { + "$id": "273", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.ComputeSchedule.HibernateResourceOperationResponse.location", + "serializationOptions": { + "$id": "274", + "json": { + "$id": "275", + "name": "location" + } + } + }, + { + "$id": "276", + "kind": "property", + "name": "results", + "serializedName": "results", + "doc": "The results from the Hibernate request if no errors exist", + "type": { + "$id": "277", + "kind": "array", + "name": "ArrayResourceOperation", + "valueType": { + "$ref": "139" + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.ComputeSchedule.HibernateResourceOperationResponse.results", + "serializationOptions": { + "$id": "278", + "json": { + "$id": "279", + "name": "results" + } + } + } + ] + }, + { + "$id": "280", + "kind": "model", + "name": "SubmitStartRequest", + "clientNamespace": "Microsoft.ComputeSchedule", + "crossLanguageDefinitionId": "Microsoft.ComputeSchedule.SubmitStartRequest", + "usage": "Input,Json", + "doc": "This is the request for start", + "decorators": [], + "properties": [ + { + "$id": "281", + "kind": "property", + "name": "schedule", + "serializedName": "schedule", + "doc": "The schedule for the request", + "type": { + "$ref": "66" + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.ComputeSchedule.SubmitStartRequest.schedule", + "serializationOptions": { + "$id": "282", + "json": { + "$id": "283", + "name": "schedule" + } + } + }, + { + "$id": "284", + "kind": "property", + "name": "executionParameters", + "serializedName": "executionParameters", + "doc": "The execution parameters for the request", + "type": { + "$ref": "91" + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.ComputeSchedule.SubmitStartRequest.executionParameters", + "serializationOptions": { + "$id": "285", + "json": { + "$id": "286", + "name": "executionParameters" + } + } + }, + { + "$id": "287", + "kind": "property", + "name": "resources", + "serializedName": "resources", + "doc": "The resources for the request", + "type": { + "$ref": "110" + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.ComputeSchedule.SubmitStartRequest.resources", + "serializationOptions": { + "$id": "288", + "json": { + "$id": "289", + "name": "resources" + } + } + }, + { + "$id": "290", + "kind": "property", + "name": "correlationId", + "serializedName": "correlationid", + "doc": "CorrelationId item", + "type": { + "$id": "291", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.ComputeSchedule.SubmitStartRequest.correlationid", + "serializationOptions": { + "$id": "292", + "json": { + "$id": "293", + "name": "correlationid" + } + } + } + ] + }, + { + "$id": "294", + "kind": "model", + "name": "StartResourceOperationResult", + "clientNamespace": "Microsoft.ComputeSchedule", + "crossLanguageDefinitionId": "Microsoft.ComputeSchedule.StartResourceOperationResponse", + "usage": "Output,Json", + "doc": "The response from a start request", + "decorators": [], + "properties": [ + { + "$id": "295", + "kind": "property", + "name": "description", + "serializedName": "description", + "doc": "The description of the operation response", + "type": { + "$id": "296", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.ComputeSchedule.StartResourceOperationResponse.description", + "serializationOptions": { + "$id": "297", + "json": { + "$id": "298", + "name": "description" + } + } + }, + { + "$id": "299", + "kind": "property", + "name": "ResourceType", + "serializedName": "type", + "doc": "The type of resources used in the start request eg virtual machines", + "type": { + "$id": "300", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.ComputeSchedule.StartResourceOperationResponse.type", + "serializationOptions": { + "$id": "301", + "json": { + "$id": "302", + "name": "type" + } + } + }, + { + "$id": "303", + "kind": "property", + "name": "location", + "serializedName": "location", + "doc": "The location of the start request eg westus", + "type": { + "$id": "304", + "kind": "string", + "name": "azureLocation", + "crossLanguageDefinitionId": "Azure.Core.azureLocation", + "baseType": { + "$id": "305", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.ComputeSchedule.StartResourceOperationResponse.location", + "serializationOptions": { + "$id": "306", + "json": { + "$id": "307", + "name": "location" + } + } + }, + { + "$id": "308", + "kind": "property", + "name": "results", + "serializedName": "results", + "doc": "The results from the start request if no errors exist", + "type": { + "$id": "309", + "kind": "array", + "name": "ArrayResourceOperation", + "valueType": { + "$ref": "139" + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.ComputeSchedule.StartResourceOperationResponse.results", + "serializationOptions": { + "$id": "310", + "json": { + "$id": "311", + "name": "results" + } + } + } + ] + }, + { + "$id": "312", + "kind": "model", + "name": "ExecuteDeallocateRequest", + "clientNamespace": "Microsoft.ComputeSchedule", + "crossLanguageDefinitionId": "Microsoft.ComputeSchedule.ExecuteDeallocateRequest", + "usage": "Input,Json", + "doc": "The ExecuteDeallocateRequest request for executeDeallocate operations", + "decorators": [], + "properties": [ + { + "$id": "313", + "kind": "property", + "name": "executionParameters", + "serializedName": "executionParameters", + "doc": "The execution parameters for the request", + "type": { + "$ref": "91" + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.ComputeSchedule.ExecuteDeallocateRequest.executionParameters", + "serializationOptions": { + "$id": "314", + "json": { + "$id": "315", + "name": "executionParameters" + } + } + }, + { + "$id": "316", + "kind": "property", + "name": "resources", + "serializedName": "resources", + "doc": "The resources for the request", + "type": { + "$ref": "110" + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.ComputeSchedule.ExecuteDeallocateRequest.resources", + "serializationOptions": { + "$id": "317", + "json": { + "$id": "318", + "name": "resources" + } + } + }, + { + "$id": "319", + "kind": "property", + "name": "correlationId", + "serializedName": "correlationid", + "doc": "CorrelationId item", + "type": { + "$id": "320", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.ComputeSchedule.ExecuteDeallocateRequest.correlationid", + "serializationOptions": { + "$id": "321", + "json": { + "$id": "322", + "name": "correlationid" + } + } + } + ] + }, + { + "$id": "323", + "kind": "model", + "name": "ExecuteHibernateRequest", + "clientNamespace": "Microsoft.ComputeSchedule", + "crossLanguageDefinitionId": "Microsoft.ComputeSchedule.ExecuteHibernateRequest", + "usage": "Input,Json", + "doc": "The ExecuteHibernateRequest request for executeHibernate operations", + "decorators": [], + "properties": [ + { + "$id": "324", + "kind": "property", + "name": "executionParameters", + "serializedName": "executionParameters", + "doc": "The execution parameters for the request", + "type": { + "$ref": "91" + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.ComputeSchedule.ExecuteHibernateRequest.executionParameters", + "serializationOptions": { + "$id": "325", + "json": { + "$id": "326", + "name": "executionParameters" + } + } + }, + { + "$id": "327", + "kind": "property", + "name": "resources", + "serializedName": "resources", + "doc": "The resources for the request", + "type": { + "$ref": "110" + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.ComputeSchedule.ExecuteHibernateRequest.resources", + "serializationOptions": { + "$id": "328", + "json": { + "$id": "329", + "name": "resources" + } + } + }, + { + "$id": "330", + "kind": "property", + "name": "correlationId", + "serializedName": "correlationid", + "doc": "CorrelationId item", + "type": { + "$id": "331", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.ComputeSchedule.ExecuteHibernateRequest.correlationid", + "serializationOptions": { + "$id": "332", + "json": { + "$id": "333", + "name": "correlationid" + } + } + } + ] + }, + { + "$id": "334", + "kind": "model", + "name": "ExecuteStartRequest", + "clientNamespace": "Microsoft.ComputeSchedule", + "crossLanguageDefinitionId": "Microsoft.ComputeSchedule.ExecuteStartRequest", + "usage": "Input,Json", + "doc": "The ExecuteStartRequest request for executeStart operations", + "decorators": [], + "properties": [ + { + "$id": "335", + "kind": "property", + "name": "executionParameters", + "serializedName": "executionParameters", + "doc": "The execution parameters for the request", + "type": { + "$ref": "91" + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.ComputeSchedule.ExecuteStartRequest.executionParameters", + "serializationOptions": { + "$id": "336", + "json": { + "$id": "337", + "name": "executionParameters" + } + } + }, + { + "$id": "338", + "kind": "property", + "name": "resources", + "serializedName": "resources", + "doc": "The resources for the request", + "type": { + "$ref": "110" + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.ComputeSchedule.ExecuteStartRequest.resources", + "serializationOptions": { + "$id": "339", + "json": { + "$id": "340", + "name": "resources" + } + } + }, + { + "$id": "341", + "kind": "property", + "name": "correlationId", + "serializedName": "correlationid", + "doc": "CorrelationId item", + "type": { + "$id": "342", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.ComputeSchedule.ExecuteStartRequest.correlationid", + "serializationOptions": { + "$id": "343", + "json": { + "$id": "344", + "name": "correlationid" + } + } + } + ] + }, + { + "$id": "345", + "kind": "model", + "name": "GetOperationStatusRequest", + "clientNamespace": "Microsoft.ComputeSchedule", + "crossLanguageDefinitionId": "Microsoft.ComputeSchedule.GetOperationStatusRequest", + "usage": "Input,Json", + "doc": "This is the request to get operation status using operationids", + "decorators": [], + "properties": [ + { + "$id": "346", + "kind": "property", + "name": "operationIds", + "serializedName": "operationIds", + "doc": "The list of operation ids to get the status of", + "type": { + "$id": "347", + "kind": "array", + "name": "Array", + "valueType": { + "$id": "348", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.ComputeSchedule.GetOperationStatusRequest.operationIds", + "serializationOptions": { + "$id": "349", + "json": { + "$id": "350", + "name": "operationIds" + } + } + }, + { + "$id": "351", + "kind": "property", + "name": "correlationId", + "serializedName": "correlationid", + "doc": "CorrelationId item", + "type": { + "$id": "352", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.ComputeSchedule.GetOperationStatusRequest.correlationid", + "serializationOptions": { + "$id": "353", + "json": { + "$id": "354", + "name": "correlationid" + } + } + } + ] + }, + { + "$id": "355", + "kind": "model", + "name": "GetOperationStatusResult", + "clientNamespace": "Microsoft.ComputeSchedule", + "crossLanguageDefinitionId": "Microsoft.ComputeSchedule.GetOperationStatusResponse", + "usage": "Output,Json", + "doc": "This is the response from a get operations status request", + "decorators": [], + "properties": [ + { + "$id": "356", + "kind": "property", + "name": "results", + "serializedName": "results", + "doc": "An array of resource operations based on their operation ids", + "type": { + "$id": "357", + "kind": "array", + "name": "ArrayResourceOperation", + "valueType": { + "$ref": "139" + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.ComputeSchedule.GetOperationStatusResponse.results", + "serializationOptions": { + "$id": "358", + "json": { + "$id": "359", + "name": "results" + } + } + } + ] + }, + { + "$id": "360", + "kind": "model", + "name": "CancelOperationsRequest", + "clientNamespace": "Microsoft.ComputeSchedule", + "crossLanguageDefinitionId": "Microsoft.ComputeSchedule.CancelOperationsRequest", + "usage": "Input,Json", + "doc": "This is the request to cancel running operations in scheduled actions using the operation ids", + "decorators": [], + "properties": [ + { + "$id": "361", + "kind": "property", + "name": "operationIds", + "serializedName": "operationIds", + "doc": "The list of operation ids to cancel operations on", + "type": { + "$id": "362", + "kind": "array", + "name": "Array", + "valueType": { + "$id": "363", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.ComputeSchedule.CancelOperationsRequest.operationIds", + "serializationOptions": { + "$id": "364", + "json": { + "$id": "365", + "name": "operationIds" + } + } + }, + { + "$id": "366", + "kind": "property", + "name": "correlationId", + "serializedName": "correlationid", + "doc": "CorrelationId item", + "type": { + "$id": "367", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.ComputeSchedule.CancelOperationsRequest.correlationid", + "serializationOptions": { + "$id": "368", + "json": { + "$id": "369", + "name": "correlationid" + } + } + } + ] + }, + { + "$id": "370", + "kind": "model", + "name": "CancelOperationsResult", + "clientNamespace": "Microsoft.ComputeSchedule", + "crossLanguageDefinitionId": "Microsoft.ComputeSchedule.CancelOperationsResponse", + "usage": "Output,Json", + "doc": "This is the response from a cancel operations request", + "decorators": [], + "properties": [ + { + "$id": "371", + "kind": "property", + "name": "results", + "serializedName": "results", + "doc": "An array of resource operations that were successfully cancelled", + "type": { + "$id": "372", + "kind": "array", + "name": "ArrayResourceOperation", + "valueType": { + "$ref": "139" + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.ComputeSchedule.CancelOperationsResponse.results", + "serializationOptions": { + "$id": "373", + "json": { + "$id": "374", + "name": "results" + } + } + } + ] + }, + { + "$id": "375", + "kind": "model", + "name": "GetOperationErrorsRequest", + "clientNamespace": "Microsoft.ComputeSchedule", + "crossLanguageDefinitionId": "Microsoft.ComputeSchedule.GetOperationErrorsRequest", + "usage": "Input,Json", + "doc": "This is the request to get errors per vm operations", + "decorators": [], + "properties": [ + { + "$id": "376", + "kind": "property", + "name": "operationIds", + "serializedName": "operationIds", + "doc": "The list of operation ids to query errors of", + "type": { + "$id": "377", + "kind": "array", + "name": "Array", + "valueType": { + "$id": "378", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.ComputeSchedule.GetOperationErrorsRequest.operationIds", + "serializationOptions": { + "$id": "379", + "json": { + "$id": "380", + "name": "operationIds" + } + } + } + ] + }, + { + "$id": "381", + "kind": "model", + "name": "GetOperationErrorsResult", + "clientNamespace": "Microsoft.ComputeSchedule", + "crossLanguageDefinitionId": "Microsoft.ComputeSchedule.GetOperationErrorsResponse", + "usage": "Output,Json", + "doc": "This is the response from a get operations errors request", + "decorators": [], + "properties": [ + { + "$id": "382", + "kind": "property", + "name": "results", + "serializedName": "results", + "doc": "An array of operationids and their corresponding errors if any", + "type": { + "$id": "383", + "kind": "array", + "name": "ArrayOperationErrorsResult", + "valueType": { + "$id": "384", + "kind": "model", + "name": "OperationErrorsResult", + "clientNamespace": "Microsoft.ComputeSchedule", + "crossLanguageDefinitionId": "Microsoft.ComputeSchedule.OperationErrorsResult", + "usage": "Output,Json", + "doc": "This is the first level of operation errors from the request when clients get errors per vm operation", + "decorators": [], + "properties": [ + { + "$id": "385", + "kind": "property", + "name": "operationId", + "serializedName": "operationId", + "doc": "The operationId identifying a vm operation", + "type": { + "$id": "386", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.ComputeSchedule.OperationErrorsResult.operationId", + "serializationOptions": { + "$id": "387", + "json": { + "$id": "388", + "name": "operationId" + } + } + }, + { + "$id": "389", + "kind": "property", + "name": "creationTime", + "serializedName": "creationTime", + "doc": "The creation time of the error result", + "type": { + "$id": "390", + "kind": "offsetDateTime", + "name": "offsetDateTime", + "encode": "rfc3339", + "wireType": { + "$id": "391", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.offsetDateTime", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.ComputeSchedule.OperationErrorsResult.creationTime", + "serializationOptions": { + "$id": "392", + "json": { + "$id": "393", + "name": "creationTime" + } + } + }, + { + "$id": "394", + "kind": "property", + "name": "activationTime", + "serializedName": "activationTime", + "doc": "The activation time of a vm operation", + "type": { + "$id": "395", + "kind": "offsetDateTime", + "name": "offsetDateTime", + "encode": "rfc3339", + "wireType": { + "$id": "396", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.offsetDateTime", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.ComputeSchedule.OperationErrorsResult.activationTime", + "serializationOptions": { + "$id": "397", + "json": { + "$id": "398", + "name": "activationTime" + } + } + }, + { + "$id": "399", + "kind": "property", + "name": "completedAt", + "serializedName": "completedAt", + "doc": "The completion time of the operation if the operation was completed", + "type": { + "$id": "400", + "kind": "offsetDateTime", + "name": "offsetDateTime", + "encode": "rfc3339", + "wireType": { + "$id": "401", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.offsetDateTime", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.ComputeSchedule.OperationErrorsResult.completedAt", + "serializationOptions": { + "$id": "402", + "json": { + "$id": "403", + "name": "completedAt" + } + } + }, + { + "$id": "404", + "kind": "property", + "name": "operationErrors", + "serializedName": "operationErrors", + "doc": "A list of errors associated with the operationid", + "type": { + "$id": "405", + "kind": "array", + "name": "ArrayOperationErrorDetails", + "valueType": { + "$id": "406", + "kind": "model", + "name": "OperationErrorDetails", + "clientNamespace": "Microsoft.ComputeSchedule", + "crossLanguageDefinitionId": "Microsoft.ComputeSchedule.OperationErrorDetails", + "usage": "Output,Json", + "doc": "This defines a list of operation errors associated with a unique operationId", + "decorators": [], + "properties": [ + { + "$id": "407", + "kind": "property", + "name": "errorCode", + "serializedName": "errorCode", + "doc": "The error code of the operation", + "type": { + "$id": "408", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.ComputeSchedule.OperationErrorDetails.errorCode", + "serializationOptions": { + "$id": "409", + "json": { + "$id": "410", + "name": "errorCode" + } + } + }, + { + "$id": "411", + "kind": "property", + "name": "errorDetails", + "serializedName": "errorDetails", + "doc": "The error details of the operation", + "type": { + "$id": "412", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.ComputeSchedule.OperationErrorDetails.errorDetails", + "serializationOptions": { + "$id": "413", + "json": { + "$id": "414", + "name": "errorDetails" + } + } + }, + { + "$id": "415", + "kind": "property", + "name": "timestamp", + "serializedName": "timestamp", + "doc": "The timestamp of the error occurence", + "type": { + "$id": "416", + "kind": "offsetDateTime", + "name": "offsetDateTime", + "encode": "rfc3339", + "wireType": { + "$id": "417", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.offsetDateTime", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.ComputeSchedule.OperationErrorDetails.timestamp", + "serializationOptions": { + "$id": "418", + "json": { + "$id": "419", + "name": "timestamp" + } + } + }, + { + "$id": "420", + "kind": "property", + "name": "errorDetailsTimestamp", + "serializedName": "timeStamp", + "doc": "The timestamp of the error occurence", + "type": { + "$id": "421", + "kind": "offsetDateTime", + "name": "offsetDateTime", + "encode": "rfc3339", + "wireType": { + "$id": "422", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.offsetDateTime", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.ComputeSchedule.OperationErrorDetails.timeStamp", + "serializationOptions": { + "$id": "423", + "json": { + "$id": "424", + "name": "timeStamp" + } + } + }, + { + "$id": "425", + "kind": "property", + "name": "azureOperationName", + "serializedName": "azureOperationName", + "doc": "The compute operationid of the Start/Deallocate/Hibernate request", + "type": { + "$id": "426", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.ComputeSchedule.OperationErrorDetails.azureOperationName", + "serializationOptions": { + "$id": "427", + "json": { + "$id": "428", + "name": "azureOperationName" + } + } + }, + { + "$id": "429", + "kind": "property", + "name": "crpOperationId", + "serializedName": "crpOperationId", + "doc": "The compute operationid of the Start/Deallocate/Hibernate request", + "type": { + "$id": "430", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.ComputeSchedule.OperationErrorDetails.crpOperationId", + "serializationOptions": { + "$id": "431", + "json": { + "$id": "432", + "name": "crpOperationId" + } + } + } + ] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.ComputeSchedule.OperationErrorsResult.operationErrors", + "serializationOptions": { + "$id": "433", + "json": { + "$id": "434", + "name": "operationErrors" + } + } + }, + { + "$id": "435", + "kind": "property", + "name": "requestErrorCode", + "serializedName": "requestErrorCode", + "doc": "Request level error code", + "type": { + "$id": "436", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.ComputeSchedule.OperationErrorsResult.requestErrorCode", + "serializationOptions": { + "$id": "437", + "json": { + "$id": "438", + "name": "requestErrorCode" + } + } + }, + { + "$id": "439", + "kind": "property", + "name": "requestErrorDetails", + "serializedName": "requestErrorDetails", + "doc": "Request level error details", + "type": { + "$id": "440", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.ComputeSchedule.OperationErrorsResult.requestErrorDetails", + "serializationOptions": { + "$id": "441", + "json": { + "$id": "442", + "name": "requestErrorDetails" + } + } + } + ] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.ComputeSchedule.GetOperationErrorsResponse.results", + "serializationOptions": { + "$id": "443", + "json": { + "$id": "444", + "name": "results" + } + } + } + ] + }, + { + "$ref": "384" + }, + { + "$ref": "406" + }, + { + "$id": "445", + "kind": "model", + "name": "OperationListResult", + "clientNamespace": "Azure.ResourceManager.CommonTypes", + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.OperationListResult", + "usage": "Output,Json", + "doc": "A list of REST API operations supported by an Azure Resource Provider. It contains an URL link to get the next set of results.", + "decorators": [], + "properties": [ + { + "$id": "446", + "kind": "property", + "name": "value", + "serializedName": "value", + "doc": "The Operation items on this page", + "type": { + "$id": "447", + "kind": "array", + "name": "ArrayOperation", + "valueType": { + "$id": "448", + "kind": "model", + "name": "Operation", + "clientNamespace": "Azure.ResourceManager.CommonTypes", + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.Operation", + "usage": "Output,Json", + "doc": "Details of a REST API operation, returned from the Resource Provider Operations API", + "decorators": [], + "properties": [ + { + "$id": "449", + "kind": "property", + "name": "name", + "serializedName": "name", + "doc": "The name of the operation, as per Resource-Based Access Control (RBAC). Examples: \"Microsoft.Compute/virtualMachines/write\", \"Microsoft.Compute/virtualMachines/capture/action\"", + "type": { + "$id": "450", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.Operation.name", + "serializationOptions": { + "$id": "451", + "json": { + "$id": "452", + "name": "name" + } + } + }, + { + "$id": "453", + "kind": "property", + "name": "isDataAction", + "serializedName": "isDataAction", + "doc": "Whether the operation applies to data-plane. This is \"true\" for data-plane operations and \"false\" for Azure Resource Manager/control-plane operations.", + "type": { + "$id": "454", + "kind": "boolean", + "name": "boolean", + "crossLanguageDefinitionId": "TypeSpec.boolean", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.Operation.isDataAction", + "serializationOptions": { + "$id": "455", + "json": { + "$id": "456", + "name": "isDataAction" + } + } + }, + { + "$id": "457", + "kind": "property", + "name": "display", + "serializedName": "display", + "doc": "Localized display information for this particular operation.", + "type": { + "$id": "458", + "kind": "model", + "name": "OperationDisplay", + "clientNamespace": "Azure.ResourceManager.CommonTypes", + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.OperationDisplay", + "usage": "Output,Json", + "doc": "Localized display information for and operation.", + "decorators": [], + "properties": [ + { + "$id": "459", + "kind": "property", + "name": "provider", + "serializedName": "provider", + "doc": "The localized friendly form of the resource provider name, e.g. \"Microsoft Monitoring Insights\" or \"Microsoft Compute\".", + "type": { + "$id": "460", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.OperationDisplay.provider", + "serializationOptions": { + "$id": "461", + "json": { + "$id": "462", + "name": "provider" + } + } + }, + { + "$id": "463", + "kind": "property", + "name": "resource", + "serializedName": "resource", + "doc": "The localized friendly name of the resource type related to this operation. E.g. \"Virtual Machines\" or \"Job Schedule Collections\".", + "type": { + "$id": "464", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.OperationDisplay.resource", + "serializationOptions": { + "$id": "465", + "json": { + "$id": "466", + "name": "resource" + } + } + }, + { + "$id": "467", + "kind": "property", + "name": "operation", + "serializedName": "operation", + "doc": "The concise, localized friendly name for the operation; suitable for dropdowns. E.g. \"Create or Update Virtual Machine\", \"Restart Virtual Machine\".", + "type": { + "$id": "468", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.OperationDisplay.operation", + "serializationOptions": { + "$id": "469", + "json": { + "$id": "470", + "name": "operation" + } + } + }, + { + "$id": "471", + "kind": "property", + "name": "description", + "serializedName": "description", + "doc": "The short, localized friendly description of the operation; suitable for tool tips and detailed views.", + "type": { + "$id": "472", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.OperationDisplay.description", + "serializationOptions": { + "$id": "473", + "json": { + "$id": "474", + "name": "description" + } + } + } + ] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.Operation.display", + "serializationOptions": { + "$id": "475", + "json": { + "$id": "476", + "name": "display" + } + } + }, + { + "$id": "477", + "kind": "property", + "name": "origin", + "serializedName": "origin", + "doc": "The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default value is \"user,system\"", + "type": { + "$ref": "48" + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.Operation.origin", + "serializationOptions": { + "$id": "478", + "json": { + "$id": "479", + "name": "origin" + } + } + }, + { + "$id": "480", + "kind": "property", + "name": "actionType", + "serializedName": "actionType", + "doc": "Extensible enum. Indicates the action type. \"Internal\" refers to actions that are for internal only APIs.", + "type": { + "$ref": "56" + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.Operation.actionType", + "serializationOptions": { + "$id": "481", + "json": { + "$id": "482", + "name": "actionType" + } + } + } + ] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.OperationListResult.value", + "serializationOptions": { + "$id": "483", + "json": { + "$id": "484", + "name": "value" + } + } + }, + { + "$id": "485", + "kind": "property", + "name": "nextLink", + "serializedName": "nextLink", + "doc": "The link to the next page of items", + "type": { + "$id": "486", + "kind": "url", + "name": "ResourceLocation", + "crossLanguageDefinitionId": "TypeSpec.Rest.ResourceLocation", + "baseType": { + "$id": "487", + "kind": "url", + "name": "url", + "crossLanguageDefinitionId": "TypeSpec.url", + "decorators": [] + }, + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.OperationListResult.nextLink", + "serializationOptions": { + "$id": "488", + "json": { + "$id": "489", + "name": "nextLink" + } + } + } + ] + }, + { + "$ref": "448" + }, + { + "$ref": "458" + } + ], + "Clients": [ + { + "$id": "490", + "Name": "ComputeScheduleClient", + "ClientNamespace": "Microsoft.ComputeSchedule", + "Doc": "Microsoft.ComputeSchedule Resource Provider management API.", + "Operations": [], + "Protocol": { + "$id": "491" + }, + "Parameters": [ + { + "$id": "492", + "Name": "endpoint", + "NameInRequest": "endpoint", + "Doc": "Service host", + "Type": { + "$id": "493", + "kind": "url", + "name": "url", + "crossLanguageDefinitionId": "TypeSpec.url" + }, + "Location": "Uri", + "IsApiVersion": false, + "IsResourceParameter": false, + "IsContentType": false, + "IsRequired": true, + "IsEndpoint": true, + "SkipUrlEncoding": false, + "Explode": false, + "Kind": "Client", + "DefaultValue": { + "$id": "494", + "Type": { + "$id": "495", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "https://management.azure.com" + } + } + ], + "Decorators": [] + }, + { + "$id": "496", + "Name": "Operations", + "ClientNamespace": "Microsoft.ComputeSchedule", + "Operations": [ + { + "$id": "497", + "Name": "list", + "ResourceName": "Operations", + "Doc": "List the operations for the provider", + "Accessibility": "public", + "Parameters": [ + { + "$id": "498", + "Name": "apiVersion", + "NameInRequest": "api-version", + "Doc": "The API version to use for this operation.", + "Type": { + "$id": "499", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": true, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "DefaultValue": { + "$id": "500", + "Type": { + "$id": "501", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "2024-10-01" + }, + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "502", + "Name": "accept", + "NameInRequest": "Accept", + "Type": { + "$id": "503", + "kind": "constant", + "valueType": { + "$id": "504", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "505", + "StatusCodes": [ + 200 + ], + "BodyType": { + "$ref": "445" + }, + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false, + "ContentTypes": [ + "application/json" + ] + } + ], + "HttpMethod": "GET", + "RequestBodyMediaType": "None", + "Uri": "{endpoint}", + "Path": "/providers/Microsoft.ComputeSchedule/operations", + "BufferResponse": true, + "Paging": { + "$id": "506", + "ItemName": "value", + "NextLinkName": "nextLink" + }, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Azure.ResourceManager.Operations.list", + "Decorators": [], + "Examples": [ + { + "$id": "507", + "kind": "http", + "name": "Operations_List", + "description": "Operations_List", + "filePath": "2024-10-01/Operations_List.json", + "parameters": [ + { + "$id": "508", + "parameter": { + "$ref": "498" + }, + "value": { + "$id": "509", + "kind": "string", + "type": { + "$ref": "499" + }, + "value": "2024-10-01" + } + } + ], + "responses": [ + { + "$id": "510", + "response": { + "$ref": "505" + }, + "statusCode": 200, + "bodyValue": { + "$id": "511", + "kind": "model", + "type": { + "$ref": "445" + }, + "value": { + "$id": "512", + "value": { + "$id": "513", + "kind": "array", + "type": { + "$ref": "447" + }, + "value": [ + { + "$id": "514", + "kind": "model", + "type": { + "$ref": "448" + }, + "value": { + "$id": "515", + "name": { + "$id": "516", + "kind": "string", + "type": { + "$ref": "450" + }, + "value": "mtiwosbky" + }, + "isDataAction": { + "$id": "517", + "kind": "boolean", + "type": { + "$ref": "454" + }, + "value": true + }, + "display": { + "$id": "518", + "kind": "model", + "type": { + "$ref": "458" + }, + "value": { + "$id": "519", + "provider": { + "$id": "520", + "kind": "string", + "type": { + "$ref": "460" + }, + "value": "vtlhmqtfhlyllnplzpdpq" + }, + "resource": { + "$id": "521", + "kind": "string", + "type": { + "$ref": "464" + }, + "value": "epj" + }, + "operation": { + "$id": "522", + "kind": "string", + "type": { + "$ref": "468" + }, + "value": "tuneyqwanedwnnbztrmq" + }, + "description": { + "$id": "523", + "kind": "string", + "type": { + "$ref": "472" + }, + "value": "moyje" + } + } + }, + "origin": { + "$id": "524", + "kind": "string", + "type": { + "$ref": "48" + }, + "value": "user" + }, + "actionType": { + "$id": "525", + "kind": "string", + "type": { + "$ref": "56" + }, + "value": "Internal" + } + } + } + ] + }, + "nextLink": { + "$id": "526", + "kind": "string", + "type": { + "$ref": "486" + }, + "value": "https://microsoft.com/a" + } + } + } + } + ] + } + ] + } + ], + "Protocol": { + "$id": "527" + }, + "Parent": "ComputeScheduleClient", + "Parameters": [ + { + "$id": "528", + "Name": "endpoint", + "NameInRequest": "endpoint", + "Doc": "Service host", + "Type": { + "$id": "529", + "kind": "url", + "name": "url", + "crossLanguageDefinitionId": "TypeSpec.url" + }, + "Location": "Uri", + "IsApiVersion": false, + "IsResourceParameter": false, + "IsContentType": false, + "IsRequired": true, + "IsEndpoint": true, + "SkipUrlEncoding": false, + "Explode": false, + "Kind": "Client", + "DefaultValue": { + "$id": "530", + "Type": { + "$id": "531", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "https://management.azure.com" + } + } + ], + "Decorators": [] + }, + { + "$id": "532", + "Name": "ScheduledActions", + "ClientNamespace": "Microsoft.ComputeSchedule", + "Operations": [ + { + "$id": "533", + "Name": "SubmitVirtualMachineDeallocate", + "ResourceName": "ScheduledActions", + "Doc": "VirtualMachinesSubmitDeallocate: Schedule deallocate operation for a batch of virtual machines at datetime in future.", + "Accessibility": "public", + "Parameters": [ + { + "$id": "534", + "Name": "apiVersion", + "NameInRequest": "api-version", + "Doc": "The API version to use for this operation.", + "Type": { + "$id": "535", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": true, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "DefaultValue": { + "$id": "536", + "Type": { + "$id": "537", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "2024-10-01" + }, + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "538", + "Name": "subscriptionId", + "NameInRequest": "subscriptionId", + "Doc": "The ID of the target subscription. The value must be an UUID.", + "Type": { + "$id": "539", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "540", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "541", + "Name": "locationparameter", + "NameInRequest": "locationparameter", + "Doc": "The location name.", + "Type": { + "$id": "542", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "543", + "Name": "contentType", + "NameInRequest": "Content-Type", + "Doc": "Body parameter's content type. Known values are application/json", + "Type": { + "$id": "544", + "kind": "constant", + "valueType": { + "$id": "545", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": true, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "546", + "Name": "accept", + "NameInRequest": "Accept", + "Type": { + "$id": "547", + "kind": "constant", + "valueType": { + "$id": "548", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "549", + "Name": "requestBody", + "NameInRequest": "requestBody", + "Doc": "The request body", + "Type": { + "$ref": "64" + }, + "Location": "Body", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "550", + "StatusCodes": [ + 200 + ], + "BodyType": { + "$ref": "123" + }, + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false, + "ContentTypes": [ + "application/json" + ] + } + ], + "HttpMethod": "POST", + "RequestBodyMediaType": "Json", + "Uri": "{endpoint}", + "Path": "/subscriptions/{subscriptionId}/providers/Microsoft.ComputeSchedule/locations/{locationparameter}/virtualMachinesSubmitDeallocate", + "RequestMediaTypes": [ + "application/json" + ], + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Microsoft.ComputeSchedule.ScheduledActions.virtualMachinesSubmitDeallocate", + "Decorators": [], + "Examples": [ + { + "$id": "551", + "kind": "http", + "name": "ScheduledActions_VirtualMachinesSubmitDeallocate", + "description": "ScheduledActions_VirtualMachinesSubmitDeallocate", + "filePath": "2024-10-01/ScheduledActions_VirtualMachinesSubmitDeallocate.json", + "parameters": [ + { + "$id": "552", + "parameter": { + "$ref": "534" + }, + "value": { + "$id": "553", + "kind": "string", + "type": { + "$ref": "535" + }, + "value": "2024-10-01" + } + }, + { + "$id": "554", + "parameter": { + "$ref": "538" + }, + "value": { + "$id": "555", + "kind": "string", + "type": { + "$ref": "539" + }, + "value": "D8E30CC0-2763-4FCC-84A8-3C5659281032" + } + }, + { + "$id": "556", + "parameter": { + "$ref": "541" + }, + "value": { + "$id": "557", + "kind": "string", + "type": { + "$ref": "542" + }, + "value": "eastus2euap" + } + }, + { + "$id": "558", + "parameter": { + "$ref": "549" + }, + "value": { + "$id": "559", + "kind": "model", + "type": { + "$ref": "64" + }, + "value": { + "$id": "560", + "schedule": { + "$id": "561", + "kind": "model", + "type": { + "$ref": "66" + }, + "value": { + "$id": "562", + "deadline": { + "$id": "563", + "kind": "string", + "type": { + "$ref": "68" + }, + "value": "2024-11-01T17:52:54.215Z" + }, + "timezone": { + "$id": "564", + "kind": "string", + "type": { + "$ref": "78" + }, + "value": "UTC" + }, + "deadlineType": { + "$id": "565", + "kind": "string", + "type": { + "$ref": "2" + }, + "value": "InitiateAt" + } + } + }, + "executionParameters": { + "$id": "566", + "kind": "model", + "type": { + "$ref": "91" + }, + "value": { + "$id": "567", + "retryPolicy": { + "$id": "568", + "kind": "model", + "type": { + "$ref": "96" + }, + "value": { + "$id": "569", + "retryCount": { + "$id": "570", + "kind": "number", + "type": { + "$ref": "98" + }, + "value": 4 + }, + "retryWindowInMinutes": { + "$id": "571", + "kind": "number", + "type": { + "$ref": "102" + }, + "value": 27 + } + } + } + } + }, + "resources": { + "$id": "572", + "kind": "model", + "type": { + "$ref": "110" + }, + "value": { + "$id": "573", + "ids": { + "$id": "574", + "kind": "array", + "type": { + "$ref": "112" + }, + "value": [ + { + "$id": "575", + "kind": "string", + "type": { + "$ref": "113" + }, + "value": "/subscriptions/YourSubscriptionId/resourceGroups/YourResourceGroupName/providers/Microsoft.Compute/virtualMachines/testResource3" + } + ] + } + } + }, + "correlationid": { + "$id": "576", + "kind": "string", + "type": { + "$ref": "120" + }, + "value": "23480d2f-1dca-4610-afb4-dd25eec1f34r" + } + } + } + } + ], + "responses": [ + { + "$id": "577", + "response": { + "$ref": "550" + }, + "statusCode": 200, + "bodyValue": { + "$id": "578", + "kind": "model", + "type": { + "$ref": "123" + }, + "value": { + "$id": "579", + "type": { + "$id": "580", + "kind": "string", + "type": { + "$ref": "129" + }, + "value": "virtualMachine" + }, + "location": { + "$id": "581", + "kind": "string", + "type": { + "$ref": "133" + }, + "value": "eastus2euap" + }, + "results": { + "$id": "582", + "kind": "array", + "type": { + "$ref": "138" + }, + "value": [ + { + "$id": "583", + "kind": "model", + "type": { + "$ref": "139" + }, + "value": { + "$id": "584", + "resourceId": { + "$id": "585", + "kind": "string", + "type": { + "$ref": "141" + }, + "value": "/subscriptions/YourSubscriptionId/resourceGroups/YourResourceGroupName/providers/Microsoft.Compute/virtualMachines/testResource3" + }, + "errorCode": { + "$id": "586", + "kind": "string", + "type": { + "$ref": "146" + }, + "value": "null" + }, + "errorDetails": { + "$id": "587", + "kind": "string", + "type": { + "$ref": "150" + }, + "value": "null" + }, + "operation": { + "$id": "588", + "kind": "model", + "type": { + "$ref": "154" + }, + "value": { + "$id": "589", + "operationId": { + "$id": "590", + "kind": "string", + "type": { + "$ref": "156" + }, + "value": "23480d2f-1dca-4610-afb4-dd25eec1f34r" + }, + "resourceId": { + "$id": "591", + "kind": "string", + "type": { + "$ref": "160" + }, + "value": "/subscriptions/YourSubscriptionId/resourceGroups/YourResourceGroupName/providers/Microsoft.Compute/virtualMachines/testResource3" + }, + "opType": { + "$id": "592", + "kind": "string", + "type": { + "$ref": "18" + }, + "value": "Deallocate" + }, + "subscriptionId": { + "$id": "593", + "kind": "string", + "type": { + "$ref": "168" + }, + "value": "D8E30CC0-2763-4FCC-84A8-3C5659281032" + }, + "deadline": { + "$id": "594", + "kind": "string", + "type": { + "$ref": "172" + }, + "value": "2024-11-01T17:52:53.667Z" + }, + "deadlineType": { + "$id": "595", + "kind": "string", + "type": { + "$ref": "2" + }, + "value": "InitiateAt" + }, + "state": { + "$id": "596", + "kind": "string", + "type": { + "$ref": "28" + }, + "value": "Succeeded" + }, + "timezone": { + "$id": "597", + "kind": "string", + "type": { + "$ref": "183" + }, + "value": "UTC" + }, + "resourceOperationError": { + "$id": "598", + "kind": "model", + "type": { + "$ref": "191" + }, + "value": { + "$id": "599", + "errorCode": { + "$id": "600", + "kind": "string", + "type": { + "$ref": "193" + }, + "value": "null" + }, + "errorDetails": { + "$id": "601", + "kind": "string", + "type": { + "$ref": "197" + }, + "value": "null" + } + } + }, + "completedAt": { + "$id": "602", + "kind": "string", + "type": { + "$ref": "203" + }, + "value": "2024-11-01T17:52:53.668Z" + }, + "retryPolicy": { + "$id": "603", + "kind": "model", + "type": { + "$ref": "96" + }, + "value": { + "$id": "604", + "retryCount": { + "$id": "605", + "kind": "number", + "type": { + "$ref": "98" + }, + "value": 4 + }, + "retryWindowInMinutes": { + "$id": "606", + "kind": "number", + "type": { + "$ref": "102" + }, + "value": 27 + } + } + }, + "timeZone": { + "$id": "607", + "kind": "string", + "type": { + "$ref": "187" + }, + "value": "UTC" + } + } + } + } + } + ] + }, + "description": { + "$id": "608", + "kind": "string", + "type": { + "$ref": "125" + }, + "value": "Deallocate Resource Request" + } + } + } + } + ] + } + ] + }, + { + "$id": "609", + "Name": "SubmitVirtualMachineHibernate", + "ResourceName": "ScheduledActions", + "Doc": "VirtualMachinesSubmitHibernate: Schedule hibernate operation for a batch of virtual machines at datetime in future.", + "Accessibility": "public", + "Parameters": [ + { + "$id": "610", + "Name": "apiVersion", + "NameInRequest": "api-version", + "Doc": "The API version to use for this operation.", + "Type": { + "$id": "611", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": true, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "DefaultValue": { + "$id": "612", + "Type": { + "$id": "613", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "2024-10-01" + }, + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "614", + "Name": "subscriptionId", + "NameInRequest": "subscriptionId", + "Doc": "The ID of the target subscription. The value must be an UUID.", + "Type": { + "$id": "615", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "616", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "617", + "Name": "locationparameter", + "NameInRequest": "locationparameter", + "Doc": "The location name.", + "Type": { + "$id": "618", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "619", + "Name": "contentType", + "NameInRequest": "Content-Type", + "Doc": "Body parameter's content type. Known values are application/json", + "Type": { + "$id": "620", + "kind": "constant", + "valueType": { + "$id": "621", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": true, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "622", + "Name": "accept", + "NameInRequest": "Accept", + "Type": { + "$id": "623", + "kind": "constant", + "valueType": { + "$id": "624", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "625", + "Name": "requestBody", + "NameInRequest": "requestBody", + "Doc": "The request body", + "Type": { + "$ref": "248" + }, + "Location": "Body", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "626", + "StatusCodes": [ + 200 + ], + "BodyType": { + "$ref": "262" + }, + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false, + "ContentTypes": [ + "application/json" + ] + } + ], + "HttpMethod": "POST", + "RequestBodyMediaType": "Json", + "Uri": "{endpoint}", + "Path": "/subscriptions/{subscriptionId}/providers/Microsoft.ComputeSchedule/locations/{locationparameter}/virtualMachinesSubmitHibernate", + "RequestMediaTypes": [ + "application/json" + ], + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Microsoft.ComputeSchedule.ScheduledActions.virtualMachinesSubmitHibernate", + "Decorators": [], + "Examples": [ + { + "$id": "627", + "kind": "http", + "name": "ScheduledActions_VirtualMachinesSubmitHibernate", + "description": "ScheduledActions_VirtualMachinesSubmitHibernate", + "filePath": "2024-10-01/ScheduledActions_VirtualMachinesSubmitHibernate.json", + "parameters": [ + { + "$id": "628", + "parameter": { + "$ref": "610" + }, + "value": { + "$id": "629", + "kind": "string", + "type": { + "$ref": "611" + }, + "value": "2024-10-01" + } + }, + { + "$id": "630", + "parameter": { + "$ref": "614" + }, + "value": { + "$id": "631", + "kind": "string", + "type": { + "$ref": "615" + }, + "value": "D8E30CC0-2763-4FCC-84A8-3C5659281032" + } + }, + { + "$id": "632", + "parameter": { + "$ref": "617" + }, + "value": { + "$id": "633", + "kind": "string", + "type": { + "$ref": "618" + }, + "value": "eastus2euap" + } + }, + { + "$id": "634", + "parameter": { + "$ref": "625" + }, + "value": { + "$id": "635", + "kind": "model", + "type": { + "$ref": "248" + }, + "value": { + "$id": "636", + "schedule": { + "$id": "637", + "kind": "model", + "type": { + "$ref": "66" + }, + "value": { + "$id": "638", + "deadline": { + "$id": "639", + "kind": "string", + "type": { + "$ref": "68" + }, + "value": "2024-11-01T17:52:54.215Z" + }, + "timezone": { + "$id": "640", + "kind": "string", + "type": { + "$ref": "78" + }, + "value": "UTC" + }, + "deadlineType": { + "$id": "641", + "kind": "string", + "type": { + "$ref": "2" + }, + "value": "InitiateAt" + } + } + }, + "executionParameters": { + "$id": "642", + "kind": "model", + "type": { + "$ref": "91" + }, + "value": { + "$id": "643", + "retryPolicy": { + "$id": "644", + "kind": "model", + "type": { + "$ref": "96" + }, + "value": { + "$id": "645", + "retryCount": { + "$id": "646", + "kind": "number", + "type": { + "$ref": "98" + }, + "value": 2 + }, + "retryWindowInMinutes": { + "$id": "647", + "kind": "number", + "type": { + "$ref": "102" + }, + "value": 27 + } + } + } + } + }, + "resources": { + "$id": "648", + "kind": "model", + "type": { + "$ref": "110" + }, + "value": { + "$id": "649", + "ids": { + "$id": "650", + "kind": "array", + "type": { + "$ref": "112" + }, + "value": [ + { + "$id": "651", + "kind": "string", + "type": { + "$ref": "113" + }, + "value": "/subscriptions/YourSubscriptionId/resourceGroups/YourResourceGroupName/providers/Microsoft.Compute/virtualMachines/testResource3" + } + ] + } + } + }, + "correlationid": { + "$id": "652", + "kind": "string", + "type": { + "$ref": "259" + }, + "value": "23480d2f-1dca-4610-afb4-dd25eec1f34r" + } + } + } + } + ], + "responses": [ + { + "$id": "653", + "response": { + "$ref": "626" + }, + "statusCode": 200, + "bodyValue": { + "$id": "654", + "kind": "model", + "type": { + "$ref": "262" + }, + "value": { + "$id": "655", + "type": { + "$id": "656", + "kind": "string", + "type": { + "$ref": "268" + }, + "value": "virtualMachine" + }, + "location": { + "$id": "657", + "kind": "string", + "type": { + "$ref": "272" + }, + "value": "eastus2euap" + }, + "results": { + "$id": "658", + "kind": "array", + "type": { + "$ref": "277" + }, + "value": [ + { + "$id": "659", + "kind": "model", + "type": { + "$ref": "139" + }, + "value": { + "$id": "660", + "resourceId": { + "$id": "661", + "kind": "string", + "type": { + "$ref": "141" + }, + "value": "/subscriptions/YourSubscriptionId/resourceGroups/YourResourceGroupName/providers/Microsoft.Compute/virtualMachines/testResource3" + }, + "errorCode": { + "$id": "662", + "kind": "string", + "type": { + "$ref": "146" + }, + "value": "null" + }, + "errorDetails": { + "$id": "663", + "kind": "string", + "type": { + "$ref": "150" + }, + "value": "null" + }, + "operation": { + "$id": "664", + "kind": "model", + "type": { + "$ref": "154" + }, + "value": { + "$id": "665", + "operationId": { + "$id": "666", + "kind": "string", + "type": { + "$ref": "156" + }, + "value": "23480d2f-1dca-4610-afb4-dd25eec1f34r" + }, + "resourceId": { + "$id": "667", + "kind": "string", + "type": { + "$ref": "160" + }, + "value": "/subscriptions/YourSubscriptionId/resourceGroups/YourResourceGroupName/providers/Microsoft.Compute/virtualMachines/testResource3" + }, + "opType": { + "$id": "668", + "kind": "string", + "type": { + "$ref": "18" + }, + "value": "Hibernate" + }, + "subscriptionId": { + "$id": "669", + "kind": "string", + "type": { + "$ref": "168" + }, + "value": "D8E30CC0-2763-4FCC-84A8-3C5659281032" + }, + "deadline": { + "$id": "670", + "kind": "string", + "type": { + "$ref": "172" + }, + "value": "2024-11-01T17:52:53.667Z" + }, + "deadlineType": { + "$id": "671", + "kind": "string", + "type": { + "$ref": "2" + }, + "value": "InitiateAt" + }, + "state": { + "$id": "672", + "kind": "string", + "type": { + "$ref": "28" + }, + "value": "Succeeded" + }, + "timezone": { + "$id": "673", + "kind": "string", + "type": { + "$ref": "183" + }, + "value": "UTC" + }, + "resourceOperationError": { + "$id": "674", + "kind": "model", + "type": { + "$ref": "191" + }, + "value": { + "$id": "675", + "errorCode": { + "$id": "676", + "kind": "string", + "type": { + "$ref": "193" + }, + "value": "null" + }, + "errorDetails": { + "$id": "677", + "kind": "string", + "type": { + "$ref": "197" + }, + "value": "null" + } + } + }, + "completedAt": { + "$id": "678", + "kind": "string", + "type": { + "$ref": "203" + }, + "value": "2024-11-01T17:52:53.668Z" + }, + "retryPolicy": { + "$id": "679", + "kind": "model", + "type": { + "$ref": "96" + }, + "value": { + "$id": "680", + "retryCount": { + "$id": "681", + "kind": "number", + "type": { + "$ref": "98" + }, + "value": 2 + }, + "retryWindowInMinutes": { + "$id": "682", + "kind": "number", + "type": { + "$ref": "102" + }, + "value": 27 + } + } + }, + "timeZone": { + "$id": "683", + "kind": "string", + "type": { + "$ref": "187" + }, + "value": "UTC" + } + } + } + } + } + ] + }, + "description": { + "$id": "684", + "kind": "string", + "type": { + "$ref": "264" + }, + "value": "Hibernate Resource Request" + } + } + } + } + ] + } + ] + }, + { + "$id": "685", + "Name": "SubmitVirtualMachineStart", + "ResourceName": "ScheduledActions", + "Doc": "VirtualMachinesSubmitStart: Schedule start operation for a batch of virtual machines at datetime in future.", + "Accessibility": "public", + "Parameters": [ + { + "$id": "686", + "Name": "apiVersion", + "NameInRequest": "api-version", + "Doc": "The API version to use for this operation.", + "Type": { + "$id": "687", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": true, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "DefaultValue": { + "$id": "688", + "Type": { + "$id": "689", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "2024-10-01" + }, + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "690", + "Name": "subscriptionId", + "NameInRequest": "subscriptionId", + "Doc": "The ID of the target subscription. The value must be an UUID.", + "Type": { + "$id": "691", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "692", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "693", + "Name": "locationparameter", + "NameInRequest": "locationparameter", + "Doc": "The location name.", + "Type": { + "$id": "694", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "695", + "Name": "contentType", + "NameInRequest": "Content-Type", + "Doc": "Body parameter's content type. Known values are application/json", + "Type": { + "$id": "696", + "kind": "constant", + "valueType": { + "$id": "697", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": true, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "698", + "Name": "accept", + "NameInRequest": "Accept", + "Type": { + "$id": "699", + "kind": "constant", + "valueType": { + "$id": "700", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "701", + "Name": "requestBody", + "NameInRequest": "requestBody", + "Doc": "The request body", + "Type": { + "$ref": "280" + }, + "Location": "Body", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "702", + "StatusCodes": [ + 200 + ], + "BodyType": { + "$ref": "294" + }, + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false, + "ContentTypes": [ + "application/json" + ] + } + ], + "HttpMethod": "POST", + "RequestBodyMediaType": "Json", + "Uri": "{endpoint}", + "Path": "/subscriptions/{subscriptionId}/providers/Microsoft.ComputeSchedule/locations/{locationparameter}/virtualMachinesSubmitStart", + "RequestMediaTypes": [ + "application/json" + ], + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Microsoft.ComputeSchedule.ScheduledActions.virtualMachinesSubmitStart", + "Decorators": [], + "Examples": [ + { + "$id": "703", + "kind": "http", + "name": "ScheduledActions_VirtualMachinesSubmitStart", + "description": "ScheduledActions_VirtualMachinesSubmitStart", + "filePath": "2024-10-01/ScheduledActions_VirtualMachinesSubmitStart.json", + "parameters": [ + { + "$id": "704", + "parameter": { + "$ref": "686" + }, + "value": { + "$id": "705", + "kind": "string", + "type": { + "$ref": "687" + }, + "value": "2024-10-01" + } + }, + { + "$id": "706", + "parameter": { + "$ref": "690" + }, + "value": { + "$id": "707", + "kind": "string", + "type": { + "$ref": "691" + }, + "value": "D8E30CC0-2763-4FCC-84A8-3C5659281032" + } + }, + { + "$id": "708", + "parameter": { + "$ref": "693" + }, + "value": { + "$id": "709", + "kind": "string", + "type": { + "$ref": "694" + }, + "value": "eastus2euap" + } + }, + { + "$id": "710", + "parameter": { + "$ref": "701" + }, + "value": { + "$id": "711", + "kind": "model", + "type": { + "$ref": "280" + }, + "value": { + "$id": "712", + "schedule": { + "$id": "713", + "kind": "model", + "type": { + "$ref": "66" + }, + "value": { + "$id": "714", + "deadline": { + "$id": "715", + "kind": "string", + "type": { + "$ref": "68" + }, + "value": "2024-11-01T17:52:54.215Z" + }, + "timezone": { + "$id": "716", + "kind": "string", + "type": { + "$ref": "78" + }, + "value": "UTC" + }, + "deadlineType": { + "$id": "717", + "kind": "string", + "type": { + "$ref": "2" + }, + "value": "InitiateAt" + } + } + }, + "executionParameters": { + "$id": "718", + "kind": "model", + "type": { + "$ref": "91" + }, + "value": { + "$id": "719", + "retryPolicy": { + "$id": "720", + "kind": "model", + "type": { + "$ref": "96" + }, + "value": { + "$id": "721", + "retryCount": { + "$id": "722", + "kind": "number", + "type": { + "$ref": "98" + }, + "value": 5 + }, + "retryWindowInMinutes": { + "$id": "723", + "kind": "number", + "type": { + "$ref": "102" + }, + "value": 27 + } + } + } + } + }, + "resources": { + "$id": "724", + "kind": "model", + "type": { + "$ref": "110" + }, + "value": { + "$id": "725", + "ids": { + "$id": "726", + "kind": "array", + "type": { + "$ref": "112" + }, + "value": [ + { + "$id": "727", + "kind": "string", + "type": { + "$ref": "113" + }, + "value": "/subscriptions/YourSubscriptionId/resourceGroups/YourResourceGroupName/providers/Microsoft.Compute/virtualMachines/testResource3" + } + ] + } + } + }, + "correlationid": { + "$id": "728", + "kind": "string", + "type": { + "$ref": "291" + }, + "value": "23480d2f-1dca-4610-afb4-dd25eec1f34r" + } + } + } + } + ], + "responses": [ + { + "$id": "729", + "response": { + "$ref": "702" + }, + "statusCode": 200, + "bodyValue": { + "$id": "730", + "kind": "model", + "type": { + "$ref": "294" + }, + "value": { + "$id": "731", + "type": { + "$id": "732", + "kind": "string", + "type": { + "$ref": "300" + }, + "value": "virtualMachine" + }, + "location": { + "$id": "733", + "kind": "string", + "type": { + "$ref": "304" + }, + "value": "eastus2euap" + }, + "results": { + "$id": "734", + "kind": "array", + "type": { + "$ref": "309" + }, + "value": [ + { + "$id": "735", + "kind": "model", + "type": { + "$ref": "139" + }, + "value": { + "$id": "736", + "resourceId": { + "$id": "737", + "kind": "string", + "type": { + "$ref": "141" + }, + "value": "/subscriptions/YourSubscriptionId/resourceGroups/YourResourceGroupName/providers/Microsoft.Compute/virtualMachines/testResource3" + }, + "errorCode": { + "$id": "738", + "kind": "string", + "type": { + "$ref": "146" + }, + "value": "null" + }, + "errorDetails": { + "$id": "739", + "kind": "string", + "type": { + "$ref": "150" + }, + "value": "null" + }, + "operation": { + "$id": "740", + "kind": "model", + "type": { + "$ref": "154" + }, + "value": { + "$id": "741", + "operationId": { + "$id": "742", + "kind": "string", + "type": { + "$ref": "156" + }, + "value": "23480d2f-1dca-4610-afb4-dd25eec1f34r" + }, + "resourceId": { + "$id": "743", + "kind": "string", + "type": { + "$ref": "160" + }, + "value": "/subscriptions/YourSubscriptionId/resourceGroups/YourResourceGroupName/providers/Microsoft.Compute/virtualMachines/testResource3" + }, + "opType": { + "$id": "744", + "kind": "string", + "type": { + "$ref": "18" + }, + "value": "Start" + }, + "subscriptionId": { + "$id": "745", + "kind": "string", + "type": { + "$ref": "168" + }, + "value": "D8E30CC0-2763-4FCC-84A8-3C5659281032" + }, + "deadline": { + "$id": "746", + "kind": "string", + "type": { + "$ref": "172" + }, + "value": "2024-11-01T17:52:53.667Z" + }, + "deadlineType": { + "$id": "747", + "kind": "string", + "type": { + "$ref": "2" + }, + "value": "InitiateAt" + }, + "state": { + "$id": "748", + "kind": "string", + "type": { + "$ref": "28" + }, + "value": "Succeeded" + }, + "timezone": { + "$id": "749", + "kind": "string", + "type": { + "$ref": "183" + }, + "value": "UTC" + }, + "resourceOperationError": { + "$id": "750", + "kind": "model", + "type": { + "$ref": "191" + }, + "value": { + "$id": "751", + "errorCode": { + "$id": "752", + "kind": "string", + "type": { + "$ref": "193" + }, + "value": "null" + }, + "errorDetails": { + "$id": "753", + "kind": "string", + "type": { + "$ref": "197" + }, + "value": "null" + } + } + }, + "completedAt": { + "$id": "754", + "kind": "string", + "type": { + "$ref": "203" + }, + "value": "2024-11-01T17:52:53.668Z" + }, + "retryPolicy": { + "$id": "755", + "kind": "model", + "type": { + "$ref": "96" + }, + "value": { + "$id": "756", + "retryCount": { + "$id": "757", + "kind": "number", + "type": { + "$ref": "98" + }, + "value": 5 + }, + "retryWindowInMinutes": { + "$id": "758", + "kind": "number", + "type": { + "$ref": "102" + }, + "value": 27 + } + } + }, + "timeZone": { + "$id": "759", + "kind": "string", + "type": { + "$ref": "187" + }, + "value": "UTC" + } + } + } + } + } + ] + }, + "description": { + "$id": "760", + "kind": "string", + "type": { + "$ref": "296" + }, + "value": "Start Resource Request" + } + } + } + } + ] + } + ] + }, + { + "$id": "761", + "Name": "ExecuteVirtualMachineDeallocate", + "ResourceName": "ScheduledActions", + "Doc": "VirtualMachinesExecuteDeallocate: Execute deallocate operation for a batch of virtual machines, this operation is triggered as soon as Computeschedule receives it.", + "Accessibility": "public", + "Parameters": [ + { + "$id": "762", + "Name": "apiVersion", + "NameInRequest": "api-version", + "Doc": "The API version to use for this operation.", + "Type": { + "$id": "763", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": true, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "DefaultValue": { + "$id": "764", + "Type": { + "$id": "765", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "2024-10-01" + }, + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "766", + "Name": "subscriptionId", + "NameInRequest": "subscriptionId", + "Doc": "The ID of the target subscription. The value must be an UUID.", + "Type": { + "$id": "767", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "768", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "769", + "Name": "locationparameter", + "NameInRequest": "locationparameter", + "Doc": "The location name.", + "Type": { + "$id": "770", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "771", + "Name": "contentType", + "NameInRequest": "Content-Type", + "Doc": "Body parameter's content type. Known values are application/json", + "Type": { + "$id": "772", + "kind": "constant", + "valueType": { + "$id": "773", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": true, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "774", + "Name": "accept", + "NameInRequest": "Accept", + "Type": { + "$id": "775", + "kind": "constant", + "valueType": { + "$id": "776", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "777", + "Name": "requestBody", + "NameInRequest": "requestBody", + "Doc": "The request body", + "Type": { + "$ref": "312" + }, + "Location": "Body", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "778", + "StatusCodes": [ + 200 + ], + "BodyType": { + "$ref": "123" + }, + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false, + "ContentTypes": [ + "application/json" + ] + } + ], + "HttpMethod": "POST", + "RequestBodyMediaType": "Json", + "Uri": "{endpoint}", + "Path": "/subscriptions/{subscriptionId}/providers/Microsoft.ComputeSchedule/locations/{locationparameter}/virtualMachinesExecuteDeallocate", + "RequestMediaTypes": [ + "application/json" + ], + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Microsoft.ComputeSchedule.ScheduledActions.virtualMachinesExecuteDeallocate", + "Decorators": [], + "Examples": [ + { + "$id": "779", + "kind": "http", + "name": "ScheduledActions_VirtualMachinesExecuteDeallocate", + "description": "ScheduledActions_VirtualMachinesExecuteDeallocate", + "filePath": "2024-10-01/ScheduledActions_VirtualMachinesExecuteDeallocate.json", + "parameters": [ + { + "$id": "780", + "parameter": { + "$ref": "762" + }, + "value": { + "$id": "781", + "kind": "string", + "type": { + "$ref": "763" + }, + "value": "2024-10-01" + } + }, + { + "$id": "782", + "parameter": { + "$ref": "766" + }, + "value": { + "$id": "783", + "kind": "string", + "type": { + "$ref": "767" + }, + "value": "D8E30CC0-2763-4FCC-84A8-3C5659281032" + } + }, + { + "$id": "784", + "parameter": { + "$ref": "769" + }, + "value": { + "$id": "785", + "kind": "string", + "type": { + "$ref": "770" + }, + "value": "eastus2euap" + } + }, + { + "$id": "786", + "parameter": { + "$ref": "777" + }, + "value": { + "$id": "787", + "kind": "model", + "type": { + "$ref": "312" + }, + "value": { + "$id": "788", + "executionParameters": { + "$id": "789", + "kind": "model", + "type": { + "$ref": "91" + }, + "value": { + "$id": "790", + "retryPolicy": { + "$id": "791", + "kind": "model", + "type": { + "$ref": "96" + }, + "value": { + "$id": "792", + "retryCount": { + "$id": "793", + "kind": "number", + "type": { + "$ref": "98" + }, + "value": 4 + }, + "retryWindowInMinutes": { + "$id": "794", + "kind": "number", + "type": { + "$ref": "102" + }, + "value": 27 + } + } + } + } + }, + "resources": { + "$id": "795", + "kind": "model", + "type": { + "$ref": "110" + }, + "value": { + "$id": "796", + "ids": { + "$id": "797", + "kind": "array", + "type": { + "$ref": "112" + }, + "value": [ + { + "$id": "798", + "kind": "string", + "type": { + "$ref": "113" + }, + "value": "/subscriptions/YourSubscriptionId/resourceGroups/YourResourceGroupName/providers/Microsoft.Compute/virtualMachines/testResource3" + } + ] + } + } + }, + "correlationid": { + "$id": "799", + "kind": "string", + "type": { + "$ref": "320" + }, + "value": "23480d2f-1dca-4610-afb4-dd25eec1f34r" + } + } + } + } + ], + "responses": [ + { + "$id": "800", + "response": { + "$ref": "778" + }, + "statusCode": 200, + "bodyValue": { + "$id": "801", + "kind": "model", + "type": { + "$ref": "123" + }, + "value": { + "$id": "802", + "type": { + "$id": "803", + "kind": "string", + "type": { + "$ref": "129" + }, + "value": "VirtualMachine" + }, + "location": { + "$id": "804", + "kind": "string", + "type": { + "$ref": "133" + }, + "value": "eastus2euap" + }, + "results": { + "$id": "805", + "kind": "array", + "type": { + "$ref": "138" + }, + "value": [ + { + "$id": "806", + "kind": "model", + "type": { + "$ref": "139" + }, + "value": { + "$id": "807", + "resourceId": { + "$id": "808", + "kind": "string", + "type": { + "$ref": "141" + }, + "value": "/subscriptions/YourSubscriptionId/resourceGroups/YourResourceGroupName/providers/Microsoft.Compute/virtualMachines/testResource3" + }, + "errorCode": { + "$id": "809", + "kind": "string", + "type": { + "$ref": "146" + }, + "value": "null" + }, + "errorDetails": { + "$id": "810", + "kind": "string", + "type": { + "$ref": "150" + }, + "value": "null" + }, + "operation": { + "$id": "811", + "kind": "model", + "type": { + "$ref": "154" + }, + "value": { + "$id": "812", + "operationId": { + "$id": "813", + "kind": "string", + "type": { + "$ref": "156" + }, + "value": "23480d2f-1dca-4610-afb4-dd25eec1f34r" + }, + "resourceId": { + "$id": "814", + "kind": "string", + "type": { + "$ref": "160" + }, + "value": "/subscriptions/YourSubscriptionId/resourceGroups/YourResourceGroupName/providers/Microsoft.Compute/virtualMachines/testResource3" + }, + "opType": { + "$id": "815", + "kind": "string", + "type": { + "$ref": "18" + }, + "value": "Deallocate" + }, + "subscriptionId": { + "$id": "816", + "kind": "string", + "type": { + "$ref": "168" + }, + "value": "D8E30CC0-2763-4FCC-84A8-3C5659281032" + }, + "deadline": { + "$id": "817", + "kind": "string", + "type": { + "$ref": "172" + }, + "value": "2024-11-01T17:52:53.667Z" + }, + "deadlineType": { + "$id": "818", + "kind": "string", + "type": { + "$ref": "2" + }, + "value": "InitiateAt" + }, + "state": { + "$id": "819", + "kind": "string", + "type": { + "$ref": "28" + }, + "value": "Succeeded" + }, + "timezone": { + "$id": "820", + "kind": "string", + "type": { + "$ref": "183" + }, + "value": "UTC" + }, + "resourceOperationError": { + "$id": "821", + "kind": "model", + "type": { + "$ref": "191" + }, + "value": { + "$id": "822", + "errorCode": { + "$id": "823", + "kind": "string", + "type": { + "$ref": "193" + }, + "value": "null" + }, + "errorDetails": { + "$id": "824", + "kind": "string", + "type": { + "$ref": "197" + }, + "value": "null" + } + } + }, + "completedAt": { + "$id": "825", + "kind": "string", + "type": { + "$ref": "203" + }, + "value": "2024-11-01T17:52:53.668Z" + }, + "retryPolicy": { + "$id": "826", + "kind": "model", + "type": { + "$ref": "96" + }, + "value": { + "$id": "827", + "retryCount": { + "$id": "828", + "kind": "number", + "type": { + "$ref": "98" + }, + "value": 4 + }, + "retryWindowInMinutes": { + "$id": "829", + "kind": "number", + "type": { + "$ref": "102" + }, + "value": 27 + } + } + }, + "timeZone": { + "$id": "830", + "kind": "string", + "type": { + "$ref": "187" + }, + "value": "UTC" + } + } + } + } + } + ] + }, + "description": { + "$id": "831", + "kind": "string", + "type": { + "$ref": "125" + }, + "value": "Deallocate Resource Request" + } + } + } + } + ] + } + ] + }, + { + "$id": "832", + "Name": "ExecuteVirtualMachineHibernate", + "ResourceName": "ScheduledActions", + "Doc": "VirtualMachinesExecuteHibernate: Execute hibernate operation for a batch of virtual machines, this operation is triggered as soon as Computeschedule receives it.", + "Accessibility": "public", + "Parameters": [ + { + "$id": "833", + "Name": "apiVersion", + "NameInRequest": "api-version", + "Doc": "The API version to use for this operation.", + "Type": { + "$id": "834", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": true, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "DefaultValue": { + "$id": "835", + "Type": { + "$id": "836", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "2024-10-01" + }, + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "837", + "Name": "subscriptionId", + "NameInRequest": "subscriptionId", + "Doc": "The ID of the target subscription. The value must be an UUID.", + "Type": { + "$id": "838", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "839", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "840", + "Name": "locationparameter", + "NameInRequest": "locationparameter", + "Doc": "The location name.", + "Type": { + "$id": "841", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "842", + "Name": "contentType", + "NameInRequest": "Content-Type", + "Doc": "Body parameter's content type. Known values are application/json", + "Type": { + "$id": "843", + "kind": "constant", + "valueType": { + "$id": "844", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": true, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "845", + "Name": "accept", + "NameInRequest": "Accept", + "Type": { + "$id": "846", + "kind": "constant", + "valueType": { + "$id": "847", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "848", + "Name": "requestBody", + "NameInRequest": "requestBody", + "Doc": "The request body", + "Type": { + "$ref": "323" + }, + "Location": "Body", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "849", + "StatusCodes": [ + 200 + ], + "BodyType": { + "$ref": "262" + }, + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false, + "ContentTypes": [ + "application/json" + ] + } + ], + "HttpMethod": "POST", + "RequestBodyMediaType": "Json", + "Uri": "{endpoint}", + "Path": "/subscriptions/{subscriptionId}/providers/Microsoft.ComputeSchedule/locations/{locationparameter}/virtualMachinesExecuteHibernate", + "RequestMediaTypes": [ + "application/json" + ], + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Microsoft.ComputeSchedule.ScheduledActions.virtualMachinesExecuteHibernate", + "Decorators": [], + "Examples": [ + { + "$id": "850", + "kind": "http", + "name": "ScheduledActions_VirtualMachinesExecuteHibernate", + "description": "ScheduledActions_VirtualMachinesExecuteHibernate", + "filePath": "2024-10-01/ScheduledActions_VirtualMachinesExecuteHibernate.json", + "parameters": [ + { + "$id": "851", + "parameter": { + "$ref": "833" + }, + "value": { + "$id": "852", + "kind": "string", + "type": { + "$ref": "834" + }, + "value": "2024-10-01" + } + }, + { + "$id": "853", + "parameter": { + "$ref": "837" + }, + "value": { + "$id": "854", + "kind": "string", + "type": { + "$ref": "838" + }, + "value": "D8E30CC0-2763-4FCC-84A8-3C5659281032" + } + }, + { + "$id": "855", + "parameter": { + "$ref": "840" + }, + "value": { + "$id": "856", + "kind": "string", + "type": { + "$ref": "841" + }, + "value": "eastus2euap" + } + }, + { + "$id": "857", + "parameter": { + "$ref": "848" + }, + "value": { + "$id": "858", + "kind": "model", + "type": { + "$ref": "323" + }, + "value": { + "$id": "859", + "executionParameters": { + "$id": "860", + "kind": "model", + "type": { + "$ref": "91" + }, + "value": { + "$id": "861", + "retryPolicy": { + "$id": "862", + "kind": "model", + "type": { + "$ref": "96" + }, + "value": { + "$id": "863", + "retryCount": { + "$id": "864", + "kind": "number", + "type": { + "$ref": "98" + }, + "value": 5 + }, + "retryWindowInMinutes": { + "$id": "865", + "kind": "number", + "type": { + "$ref": "102" + }, + "value": 27 + } + } + } + } + }, + "resources": { + "$id": "866", + "kind": "model", + "type": { + "$ref": "110" + }, + "value": { + "$id": "867", + "ids": { + "$id": "868", + "kind": "array", + "type": { + "$ref": "112" + }, + "value": [ + { + "$id": "869", + "kind": "string", + "type": { + "$ref": "113" + }, + "value": "/subscriptions/YourSubscriptionId/resourceGroups/YourResourceGroupName/providers/Microsoft.Compute/virtualMachines/testResource3" + } + ] + } + } + }, + "correlationid": { + "$id": "870", + "kind": "string", + "type": { + "$ref": "331" + }, + "value": "23480d2f-1dca-4610-afb4-dd25eec1f34r" + } + } + } + } + ], + "responses": [ + { + "$id": "871", + "response": { + "$ref": "849" + }, + "statusCode": 200, + "bodyValue": { + "$id": "872", + "kind": "model", + "type": { + "$ref": "262" + }, + "value": { + "$id": "873", + "type": { + "$id": "874", + "kind": "string", + "type": { + "$ref": "268" + }, + "value": "VirtualMachine" + }, + "location": { + "$id": "875", + "kind": "string", + "type": { + "$ref": "272" + }, + "value": "eastus2euap" + }, + "results": { + "$id": "876", + "kind": "array", + "type": { + "$ref": "277" + }, + "value": [ + { + "$id": "877", + "kind": "model", + "type": { + "$ref": "139" + }, + "value": { + "$id": "878", + "resourceId": { + "$id": "879", + "kind": "string", + "type": { + "$ref": "141" + }, + "value": "/subscriptions/YourSubscriptionId/resourceGroups/YourResourceGroupName/providers/Microsoft.Compute/virtualMachines/testResource3" + }, + "errorCode": { + "$id": "880", + "kind": "string", + "type": { + "$ref": "146" + }, + "value": "null" + }, + "errorDetails": { + "$id": "881", + "kind": "string", + "type": { + "$ref": "150" + }, + "value": "null" + }, + "operation": { + "$id": "882", + "kind": "model", + "type": { + "$ref": "154" + }, + "value": { + "$id": "883", + "operationId": { + "$id": "884", + "kind": "string", + "type": { + "$ref": "156" + }, + "value": "23480d2f-1dca-4610-afb4-dd25eec1f34r" + }, + "resourceId": { + "$id": "885", + "kind": "string", + "type": { + "$ref": "160" + }, + "value": "/subscriptions/YourSubscriptionId/resourceGroups/YourResourceGroupName/providers/Microsoft.Compute/virtualMachines/testResource3" + }, + "opType": { + "$id": "886", + "kind": "string", + "type": { + "$ref": "18" + }, + "value": "Hibernate" + }, + "subscriptionId": { + "$id": "887", + "kind": "string", + "type": { + "$ref": "168" + }, + "value": "D8E30CC0-2763-4FCC-84A8-3C5659281032" + }, + "deadline": { + "$id": "888", + "kind": "string", + "type": { + "$ref": "172" + }, + "value": "2024-11-01T17:52:53.667Z" + }, + "deadlineType": { + "$id": "889", + "kind": "string", + "type": { + "$ref": "2" + }, + "value": "InitiateAt" + }, + "state": { + "$id": "890", + "kind": "string", + "type": { + "$ref": "28" + }, + "value": "Succeeded" + }, + "timezone": { + "$id": "891", + "kind": "string", + "type": { + "$ref": "183" + }, + "value": "UTC" + }, + "resourceOperationError": { + "$id": "892", + "kind": "model", + "type": { + "$ref": "191" + }, + "value": { + "$id": "893", + "errorCode": { + "$id": "894", + "kind": "string", + "type": { + "$ref": "193" + }, + "value": "null" + }, + "errorDetails": { + "$id": "895", + "kind": "string", + "type": { + "$ref": "197" + }, + "value": "null" + } + } + }, + "completedAt": { + "$id": "896", + "kind": "string", + "type": { + "$ref": "203" + }, + "value": "2024-11-01T17:52:53.668Z" + }, + "retryPolicy": { + "$id": "897", + "kind": "model", + "type": { + "$ref": "96" + }, + "value": { + "$id": "898", + "retryCount": { + "$id": "899", + "kind": "number", + "type": { + "$ref": "98" + }, + "value": 5 + }, + "retryWindowInMinutes": { + "$id": "900", + "kind": "number", + "type": { + "$ref": "102" + }, + "value": 27 + } + } + }, + "timeZone": { + "$id": "901", + "kind": "string", + "type": { + "$ref": "187" + }, + "value": "UTC" + } + } + } + } + } + ] + }, + "description": { + "$id": "902", + "kind": "string", + "type": { + "$ref": "264" + }, + "value": "Hibernate Resource Request" + } + } + } + } + ] + } + ] + }, + { + "$id": "903", + "Name": "ExecuteVirtualMachineStart", + "ResourceName": "ScheduledActions", + "Doc": "VirtualMachinesExecuteStart: Execute start operation for a batch of virtual machines, this operation is triggered as soon as Computeschedule receives it.", + "Accessibility": "public", + "Parameters": [ + { + "$id": "904", + "Name": "apiVersion", + "NameInRequest": "api-version", + "Doc": "The API version to use for this operation.", + "Type": { + "$id": "905", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": true, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "DefaultValue": { + "$id": "906", + "Type": { + "$id": "907", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "2024-10-01" + }, + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "908", + "Name": "subscriptionId", + "NameInRequest": "subscriptionId", + "Doc": "The ID of the target subscription. The value must be an UUID.", + "Type": { + "$id": "909", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "910", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "911", + "Name": "locationparameter", + "NameInRequest": "locationparameter", + "Doc": "The location name.", + "Type": { + "$id": "912", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "913", + "Name": "contentType", + "NameInRequest": "Content-Type", + "Doc": "Body parameter's content type. Known values are application/json", + "Type": { + "$id": "914", + "kind": "constant", + "valueType": { + "$id": "915", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": true, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "916", + "Name": "accept", + "NameInRequest": "Accept", + "Type": { + "$id": "917", + "kind": "constant", + "valueType": { + "$id": "918", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "919", + "Name": "requestBody", + "NameInRequest": "requestBody", + "Doc": "The request body", + "Type": { + "$ref": "334" + }, + "Location": "Body", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "920", + "StatusCodes": [ + 200 + ], + "BodyType": { + "$ref": "294" + }, + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false, + "ContentTypes": [ + "application/json" + ] + } + ], + "HttpMethod": "POST", + "RequestBodyMediaType": "Json", + "Uri": "{endpoint}", + "Path": "/subscriptions/{subscriptionId}/providers/Microsoft.ComputeSchedule/locations/{locationparameter}/virtualMachinesExecuteStart", + "RequestMediaTypes": [ + "application/json" + ], + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Microsoft.ComputeSchedule.ScheduledActions.virtualMachinesExecuteStart", + "Decorators": [], + "Examples": [ + { + "$id": "921", + "kind": "http", + "name": "ScheduledActions_VirtualMachinesExecuteStart", + "description": "ScheduledActions_VirtualMachinesExecuteStart", + "filePath": "2024-10-01/ScheduledActions_VirtualMachinesExecuteStart.json", + "parameters": [ + { + "$id": "922", + "parameter": { + "$ref": "904" + }, + "value": { + "$id": "923", + "kind": "string", + "type": { + "$ref": "905" + }, + "value": "2024-10-01" + } + }, + { + "$id": "924", + "parameter": { + "$ref": "908" + }, + "value": { + "$id": "925", + "kind": "string", + "type": { + "$ref": "909" + }, + "value": "D8E30CC0-2763-4FCC-84A8-3C5659281032" + } + }, + { + "$id": "926", + "parameter": { + "$ref": "911" + }, + "value": { + "$id": "927", + "kind": "string", + "type": { + "$ref": "912" + }, + "value": "eastus2euap" + } + }, + { + "$id": "928", + "parameter": { + "$ref": "919" + }, + "value": { + "$id": "929", + "kind": "model", + "type": { + "$ref": "334" + }, + "value": { + "$id": "930", + "executionParameters": { + "$id": "931", + "kind": "model", + "type": { + "$ref": "91" + }, + "value": { + "$id": "932", + "retryPolicy": { + "$id": "933", + "kind": "model", + "type": { + "$ref": "96" + }, + "value": { + "$id": "934", + "retryCount": { + "$id": "935", + "kind": "number", + "type": { + "$ref": "98" + }, + "value": 2 + }, + "retryWindowInMinutes": { + "$id": "936", + "kind": "number", + "type": { + "$ref": "102" + }, + "value": 27 + } + } + } + } + }, + "resources": { + "$id": "937", + "kind": "model", + "type": { + "$ref": "110" + }, + "value": { + "$id": "938", + "ids": { + "$id": "939", + "kind": "array", + "type": { + "$ref": "112" + }, + "value": [ + { + "$id": "940", + "kind": "string", + "type": { + "$ref": "113" + }, + "value": "/subscriptions/YourSubscriptionId/resourceGroups/YourResourceGroupName/providers/Microsoft.Compute/virtualMachines/testResource3" + } + ] + } + } + }, + "correlationid": { + "$id": "941", + "kind": "string", + "type": { + "$ref": "342" + }, + "value": "23480d2f-1dca-4610-afb4-dd25eec1f34r" + } + } + } + } + ], + "responses": [ + { + "$id": "942", + "response": { + "$ref": "920" + }, + "statusCode": 200, + "bodyValue": { + "$id": "943", + "kind": "model", + "type": { + "$ref": "294" + }, + "value": { + "$id": "944", + "type": { + "$id": "945", + "kind": "string", + "type": { + "$ref": "300" + }, + "value": "virtualMachine" + }, + "location": { + "$id": "946", + "kind": "string", + "type": { + "$ref": "304" + }, + "value": "eastus2euap" + }, + "results": { + "$id": "947", + "kind": "array", + "type": { + "$ref": "309" + }, + "value": [ + { + "$id": "948", + "kind": "model", + "type": { + "$ref": "139" + }, + "value": { + "$id": "949", + "resourceId": { + "$id": "950", + "kind": "string", + "type": { + "$ref": "141" + }, + "value": "/subscriptions/YourSubscriptionId/resourceGroups/YourResourceGroupName/providers/Microsoft.Compute/virtualMachines/testResource3" + }, + "errorCode": { + "$id": "951", + "kind": "string", + "type": { + "$ref": "146" + }, + "value": "null" + }, + "errorDetails": { + "$id": "952", + "kind": "string", + "type": { + "$ref": "150" + }, + "value": "null" + }, + "operation": { + "$id": "953", + "kind": "model", + "type": { + "$ref": "154" + }, + "value": { + "$id": "954", + "operationId": { + "$id": "955", + "kind": "string", + "type": { + "$ref": "156" + }, + "value": "23480d2f-1dca-4610-afb4-dd25eec1f34r" + }, + "resourceId": { + "$id": "956", + "kind": "string", + "type": { + "$ref": "160" + }, + "value": "/subscriptions/YourSubscriptionId/resourceGroups/YourResourceGroupName/providers/Microsoft.Compute/virtualMachines/testResource3" + }, + "opType": { + "$id": "957", + "kind": "string", + "type": { + "$ref": "18" + }, + "value": "Start" + }, + "subscriptionId": { + "$id": "958", + "kind": "string", + "type": { + "$ref": "168" + }, + "value": "D8E30CC0-2763-4FCC-84A8-3C5659281032" + }, + "deadline": { + "$id": "959", + "kind": "string", + "type": { + "$ref": "172" + }, + "value": "2024-11-01T17:52:53.667Z" + }, + "deadlineType": { + "$id": "960", + "kind": "string", + "type": { + "$ref": "2" + }, + "value": "InitiateAt" + }, + "state": { + "$id": "961", + "kind": "string", + "type": { + "$ref": "28" + }, + "value": "Succeeded" + }, + "timezone": { + "$id": "962", + "kind": "string", + "type": { + "$ref": "183" + }, + "value": "UTC" + }, + "resourceOperationError": { + "$id": "963", + "kind": "model", + "type": { + "$ref": "191" + }, + "value": { + "$id": "964", + "errorCode": { + "$id": "965", + "kind": "string", + "type": { + "$ref": "193" + }, + "value": "null" + }, + "errorDetails": { + "$id": "966", + "kind": "string", + "type": { + "$ref": "197" + }, + "value": "null" + } + } + }, + "completedAt": { + "$id": "967", + "kind": "string", + "type": { + "$ref": "203" + }, + "value": "2024-11-01T17:52:53.668Z" + }, + "retryPolicy": { + "$id": "968", + "kind": "model", + "type": { + "$ref": "96" + }, + "value": { + "$id": "969", + "retryCount": { + "$id": "970", + "kind": "number", + "type": { + "$ref": "98" + }, + "value": 2 + }, + "retryWindowInMinutes": { + "$id": "971", + "kind": "number", + "type": { + "$ref": "102" + }, + "value": 27 + } + } + }, + "timeZone": { + "$id": "972", + "kind": "string", + "type": { + "$ref": "187" + }, + "value": "UTC" + } + } + } + } + } + ] + }, + "description": { + "$id": "973", + "kind": "string", + "type": { + "$ref": "296" + }, + "value": "Start Resource Request" + } + } + } + } + ] + } + ] + }, + { + "$id": "974", + "Name": "GetVirtualMachineOperationStatus", + "ResourceName": "ScheduledActions", + "Doc": "VirtualMachinesGetOperationStatus: Polling endpoint to read status of operations performed on virtual machines", + "Accessibility": "public", + "Parameters": [ + { + "$id": "975", + "Name": "apiVersion", + "NameInRequest": "api-version", + "Doc": "The API version to use for this operation.", + "Type": { + "$id": "976", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": true, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "DefaultValue": { + "$id": "977", + "Type": { + "$id": "978", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "2024-10-01" + }, + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "979", + "Name": "subscriptionId", + "NameInRequest": "subscriptionId", + "Doc": "The ID of the target subscription. The value must be an UUID.", + "Type": { + "$id": "980", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "981", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "982", + "Name": "locationparameter", + "NameInRequest": "locationparameter", + "Doc": "The location name.", + "Type": { + "$id": "983", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "984", + "Name": "contentType", + "NameInRequest": "Content-Type", + "Doc": "Body parameter's content type. Known values are application/json", + "Type": { + "$id": "985", + "kind": "constant", + "valueType": { + "$id": "986", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": true, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "987", + "Name": "accept", + "NameInRequest": "Accept", + "Type": { + "$id": "988", + "kind": "constant", + "valueType": { + "$id": "989", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "990", + "Name": "requestBody", + "NameInRequest": "requestBody", + "Doc": "The request body", + "Type": { + "$ref": "345" + }, + "Location": "Body", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "991", + "StatusCodes": [ + 200 + ], + "BodyType": { + "$ref": "355" + }, + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false, + "ContentTypes": [ + "application/json" + ] + } + ], + "HttpMethod": "POST", + "RequestBodyMediaType": "Json", + "Uri": "{endpoint}", + "Path": "/subscriptions/{subscriptionId}/providers/Microsoft.ComputeSchedule/locations/{locationparameter}/virtualMachinesGetOperationStatus", + "RequestMediaTypes": [ + "application/json" + ], + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Microsoft.ComputeSchedule.ScheduledActions.virtualMachinesGetOperationStatus", + "Decorators": [], + "Examples": [ + { + "$id": "992", + "kind": "http", + "name": "ScheduledActions_VirtualMachinesGetOperationStatus", + "description": "ScheduledActions_VirtualMachinesGetOperationStatus", + "filePath": "2024-10-01/ScheduledActions_VirtualMachinesGetOperationStatus.json", + "parameters": [ + { + "$id": "993", + "parameter": { + "$ref": "975" + }, + "value": { + "$id": "994", + "kind": "string", + "type": { + "$ref": "976" + }, + "value": "2024-10-01" + } + }, + { + "$id": "995", + "parameter": { + "$ref": "979" + }, + "value": { + "$id": "996", + "kind": "string", + "type": { + "$ref": "980" + }, + "value": "D8E30CC0-2763-4FCC-84A8-3C5659281032" + } + }, + { + "$id": "997", + "parameter": { + "$ref": "982" + }, + "value": { + "$id": "998", + "kind": "string", + "type": { + "$ref": "983" + }, + "value": "eastus2euap" + } + }, + { + "$id": "999", + "parameter": { + "$ref": "990" + }, + "value": { + "$id": "1000", + "kind": "model", + "type": { + "$ref": "345" + }, + "value": { + "$id": "1001", + "operationIds": { + "$id": "1002", + "kind": "array", + "type": { + "$ref": "347" + }, + "value": [ + { + "$id": "1003", + "kind": "string", + "type": { + "$ref": "348" + }, + "value": "23480d2f-1dca-4610-afb4-dd25eec1f34r" + } + ] + }, + "correlationid": { + "$id": "1004", + "kind": "string", + "type": { + "$ref": "352" + }, + "value": "35780d2f-1dca-4610-afb4-dd25eec1f34r" + } + } + } + } + ], + "responses": [ + { + "$id": "1005", + "response": { + "$ref": "991" + }, + "statusCode": 200, + "bodyValue": { + "$id": "1006", + "kind": "model", + "type": { + "$ref": "355" + }, + "value": { + "$id": "1007", + "results": { + "$id": "1008", + "kind": "array", + "type": { + "$ref": "357" + }, + "value": [ + { + "$id": "1009", + "kind": "model", + "type": { + "$ref": "139" + }, + "value": { + "$id": "1010", + "resourceId": { + "$id": "1011", + "kind": "string", + "type": { + "$ref": "141" + }, + "value": "/subscriptions/YourSubscriptionId/resourceGroups/YourResourceGroupName/providers/Microsoft.Compute/virtualMachines/testResource3" + }, + "errorCode": { + "$id": "1012", + "kind": "string", + "type": { + "$ref": "146" + }, + "value": "null" + }, + "errorDetails": { + "$id": "1013", + "kind": "string", + "type": { + "$ref": "150" + }, + "value": "null" + }, + "operation": { + "$id": "1014", + "kind": "model", + "type": { + "$ref": "154" + }, + "value": { + "$id": "1015", + "operationId": { + "$id": "1016", + "kind": "string", + "type": { + "$ref": "156" + }, + "value": "23480d2f-1dca-4610-afb4-dd25eec1f34r" + }, + "resourceId": { + "$id": "1017", + "kind": "string", + "type": { + "$ref": "160" + }, + "value": "/subscriptions/YourSubscriptionId/resourceGroups/YourResourceGroupName/providers/Microsoft.Compute/virtualMachines/testResource3" + }, + "opType": { + "$id": "1018", + "kind": "string", + "type": { + "$ref": "18" + }, + "value": "Deallocate" + }, + "subscriptionId": { + "$id": "1019", + "kind": "string", + "type": { + "$ref": "168" + }, + "value": "D8E30CC0-2763-4FCC-84A8-3C5659281032" + }, + "deadline": { + "$id": "1020", + "kind": "string", + "type": { + "$ref": "172" + }, + "value": "2024-11-01T17:52:53.667Z" + }, + "deadlineType": { + "$id": "1021", + "kind": "string", + "type": { + "$ref": "2" + }, + "value": "InitiateAt" + }, + "state": { + "$id": "1022", + "kind": "string", + "type": { + "$ref": "28" + }, + "value": "Succeeded" + }, + "timezone": { + "$id": "1023", + "kind": "string", + "type": { + "$ref": "183" + }, + "value": "UTC" + }, + "resourceOperationError": { + "$id": "1024", + "kind": "model", + "type": { + "$ref": "191" + }, + "value": { + "$id": "1025", + "errorCode": { + "$id": "1026", + "kind": "string", + "type": { + "$ref": "193" + }, + "value": "null" + }, + "errorDetails": { + "$id": "1027", + "kind": "string", + "type": { + "$ref": "197" + }, + "value": "null" + } + } + }, + "completedAt": { + "$id": "1028", + "kind": "string", + "type": { + "$ref": "203" + }, + "value": "2024-11-01T17:52:53.668Z" + }, + "retryPolicy": { + "$id": "1029", + "kind": "model", + "type": { + "$ref": "96" + }, + "value": { + "$id": "1030", + "retryCount": { + "$id": "1031", + "kind": "number", + "type": { + "$ref": "98" + }, + "value": 4 + }, + "retryWindowInMinutes": { + "$id": "1032", + "kind": "number", + "type": { + "$ref": "102" + }, + "value": 27 + } + } + }, + "timeZone": { + "$id": "1033", + "kind": "string", + "type": { + "$ref": "187" + }, + "value": "UTC" + } + } + } + } + } + ] + } + } + } + } + ] + } + ] + }, + { + "$id": "1034", + "Name": "CancelVirtualMachineOperations", + "ResourceName": "ScheduledActions", + "Doc": "VirtualMachinesCancelOperations: Cancel a previously submitted (start/deallocate/hibernate) request", + "Accessibility": "public", + "Parameters": [ + { + "$id": "1035", + "Name": "apiVersion", + "NameInRequest": "api-version", + "Doc": "The API version to use for this operation.", + "Type": { + "$id": "1036", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": true, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "DefaultValue": { + "$id": "1037", + "Type": { + "$id": "1038", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "2024-10-01" + }, + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1039", + "Name": "subscriptionId", + "NameInRequest": "subscriptionId", + "Doc": "The ID of the target subscription. The value must be an UUID.", + "Type": { + "$id": "1040", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "1041", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1042", + "Name": "locationparameter", + "NameInRequest": "locationparameter", + "Doc": "The location name.", + "Type": { + "$id": "1043", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1044", + "Name": "contentType", + "NameInRequest": "Content-Type", + "Doc": "Body parameter's content type. Known values are application/json", + "Type": { + "$id": "1045", + "kind": "constant", + "valueType": { + "$id": "1046", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": true, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1047", + "Name": "accept", + "NameInRequest": "Accept", + "Type": { + "$id": "1048", + "kind": "constant", + "valueType": { + "$id": "1049", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1050", + "Name": "requestBody", + "NameInRequest": "requestBody", + "Doc": "The request body", + "Type": { + "$ref": "360" + }, + "Location": "Body", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "1051", + "StatusCodes": [ + 200 + ], + "BodyType": { + "$ref": "370" + }, + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false, + "ContentTypes": [ + "application/json" + ] + } + ], + "HttpMethod": "POST", + "RequestBodyMediaType": "Json", + "Uri": "{endpoint}", + "Path": "/subscriptions/{subscriptionId}/providers/Microsoft.ComputeSchedule/locations/{locationparameter}/virtualMachinesCancelOperations", + "RequestMediaTypes": [ + "application/json" + ], + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Microsoft.ComputeSchedule.ScheduledActions.virtualMachinesCancelOperations", + "Decorators": [], + "Examples": [ + { + "$id": "1052", + "kind": "http", + "name": "ScheduledActions_VirtualMachinesCancelOperations", + "description": "ScheduledActions_VirtualMachinesCancelOperations", + "filePath": "2024-10-01/ScheduledActions_VirtualMachinesCancelOperations.json", + "parameters": [ + { + "$id": "1053", + "parameter": { + "$ref": "1035" + }, + "value": { + "$id": "1054", + "kind": "string", + "type": { + "$ref": "1036" + }, + "value": "2024-10-01" + } + }, + { + "$id": "1055", + "parameter": { + "$ref": "1039" + }, + "value": { + "$id": "1056", + "kind": "string", + "type": { + "$ref": "1040" + }, + "value": "D8E30CC0-2763-4FCC-84A8-3C5659281032" + } + }, + { + "$id": "1057", + "parameter": { + "$ref": "1042" + }, + "value": { + "$id": "1058", + "kind": "string", + "type": { + "$ref": "1043" + }, + "value": "eastus2euap" + } + }, + { + "$id": "1059", + "parameter": { + "$ref": "1050" + }, + "value": { + "$id": "1060", + "kind": "model", + "type": { + "$ref": "360" + }, + "value": { + "$id": "1061", + "operationIds": { + "$id": "1062", + "kind": "array", + "type": { + "$ref": "362" + }, + "value": [ + { + "$id": "1063", + "kind": "string", + "type": { + "$ref": "363" + }, + "value": "23480d2f-1dca-4610-afb4-dd25eec1f34r" + } + ] + }, + "correlationid": { + "$id": "1064", + "kind": "string", + "type": { + "$ref": "367" + }, + "value": "23480d2f-1dca-4610-afb4-gg25eec1f34r" + } + } + } + } + ], + "responses": [ + { + "$id": "1065", + "response": { + "$ref": "1051" + }, + "statusCode": 200, + "bodyValue": { + "$id": "1066", + "kind": "model", + "type": { + "$ref": "370" + }, + "value": { + "$id": "1067", + "results": { + "$id": "1068", + "kind": "array", + "type": { + "$ref": "372" + }, + "value": [ + { + "$id": "1069", + "kind": "model", + "type": { + "$ref": "139" + }, + "value": { + "$id": "1070", + "resourceId": { + "$id": "1071", + "kind": "string", + "type": { + "$ref": "141" + }, + "value": "/subscriptions/YourSubscriptionId/resourceGroups/YourResourceGroupName/providers/Microsoft.Compute/virtualMachines/testResource3" + }, + "errorCode": { + "$id": "1072", + "kind": "string", + "type": { + "$ref": "146" + }, + "value": "null" + }, + "errorDetails": { + "$id": "1073", + "kind": "string", + "type": { + "$ref": "150" + }, + "value": "null" + }, + "operation": { + "$id": "1074", + "kind": "model", + "type": { + "$ref": "154" + }, + "value": { + "$id": "1075", + "operationId": { + "$id": "1076", + "kind": "string", + "type": { + "$ref": "156" + }, + "value": "23480d2f-1dca-4610-afb4-dd25eec1f34r" + }, + "resourceId": { + "$id": "1077", + "kind": "string", + "type": { + "$ref": "160" + }, + "value": "/subscriptions/YourSubscriptionId/resourceGroups/YourResourceGroupName/providers/Microsoft.Compute/virtualMachines/testResource3" + }, + "opType": { + "$id": "1078", + "kind": "string", + "type": { + "$ref": "18" + }, + "value": "Deallocate" + }, + "subscriptionId": { + "$id": "1079", + "kind": "string", + "type": { + "$ref": "168" + }, + "value": "D8E30CC0-2763-4FCC-84A8-3C5659281032" + }, + "deadline": { + "$id": "1080", + "kind": "string", + "type": { + "$ref": "172" + }, + "value": "2024-11-01T17:52:53.667Z" + }, + "deadlineType": { + "$id": "1081", + "kind": "string", + "type": { + "$ref": "2" + }, + "value": "InitiateAt" + }, + "state": { + "$id": "1082", + "kind": "string", + "type": { + "$ref": "28" + }, + "value": "Cancelled" + }, + "timezone": { + "$id": "1083", + "kind": "string", + "type": { + "$ref": "183" + }, + "value": "UTC" + }, + "resourceOperationError": { + "$id": "1084", + "kind": "model", + "type": { + "$ref": "191" + }, + "value": { + "$id": "1085", + "errorCode": { + "$id": "1086", + "kind": "string", + "type": { + "$ref": "193" + }, + "value": "null" + }, + "errorDetails": { + "$id": "1087", + "kind": "string", + "type": { + "$ref": "197" + }, + "value": "null" + } + } + }, + "completedAt": { + "$id": "1088", + "kind": "string", + "type": { + "$ref": "203" + }, + "value": "2024-11-01T17:52:53.668Z" + }, + "retryPolicy": { + "$id": "1089", + "kind": "model", + "type": { + "$ref": "96" + }, + "value": { + "$id": "1090", + "retryCount": { + "$id": "1091", + "kind": "number", + "type": { + "$ref": "98" + }, + "value": 4 + }, + "retryWindowInMinutes": { + "$id": "1092", + "kind": "number", + "type": { + "$ref": "102" + }, + "value": 27 + } + } + }, + "timeZone": { + "$id": "1093", + "kind": "string", + "type": { + "$ref": "187" + }, + "value": "UTC" + } + } + } + } + } + ] + } + } + } + } + ] + } + ] + }, + { + "$id": "1094", + "Name": "GetVirtualMachineOperationErrors", + "ResourceName": "ScheduledActions", + "Doc": "VirtualMachinesGetOperationErrors: Get error details on operation errors (like transient errors encountered, additional logs) if they exist.", + "Accessibility": "public", + "Parameters": [ + { + "$id": "1095", + "Name": "apiVersion", + "NameInRequest": "api-version", + "Doc": "The API version to use for this operation.", + "Type": { + "$id": "1096", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": true, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "DefaultValue": { + "$id": "1097", + "Type": { + "$id": "1098", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "2024-10-01" + }, + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1099", + "Name": "subscriptionId", + "NameInRequest": "subscriptionId", + "Doc": "The ID of the target subscription. The value must be an UUID.", + "Type": { + "$id": "1100", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "1101", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1102", + "Name": "locationparameter", + "NameInRequest": "locationparameter", + "Doc": "The location name.", + "Type": { + "$id": "1103", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1104", + "Name": "contentType", + "NameInRequest": "Content-Type", + "Doc": "Body parameter's content type. Known values are application/json", + "Type": { + "$id": "1105", + "kind": "constant", + "valueType": { + "$id": "1106", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": true, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1107", + "Name": "accept", + "NameInRequest": "Accept", + "Type": { + "$id": "1108", + "kind": "constant", + "valueType": { + "$id": "1109", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1110", + "Name": "requestBody", + "NameInRequest": "requestBody", + "Doc": "The request body", + "Type": { + "$ref": "375" + }, + "Location": "Body", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "1111", + "StatusCodes": [ + 200 + ], + "BodyType": { + "$ref": "381" + }, + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false, + "ContentTypes": [ + "application/json" + ] + } + ], + "HttpMethod": "POST", + "RequestBodyMediaType": "Json", + "Uri": "{endpoint}", + "Path": "/subscriptions/{subscriptionId}/providers/Microsoft.ComputeSchedule/locations/{locationparameter}/virtualMachinesGetOperationErrors", + "RequestMediaTypes": [ + "application/json" + ], + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Microsoft.ComputeSchedule.ScheduledActions.virtualMachinesGetOperationErrors", + "Decorators": [], + "Examples": [ + { + "$id": "1112", + "kind": "http", + "name": "ScheduledActions_VirtualMachinesGetOperationErrors", + "description": "ScheduledActions_VirtualMachinesGetOperationErrors", + "filePath": "2024-10-01/ScheduledActions_VirtualMachinesGetOperationErrors.json", + "parameters": [ + { + "$id": "1113", + "parameter": { + "$ref": "1095" + }, + "value": { + "$id": "1114", + "kind": "string", + "type": { + "$ref": "1096" + }, + "value": "2024-10-01" + } + }, + { + "$id": "1115", + "parameter": { + "$ref": "1099" + }, + "value": { + "$id": "1116", + "kind": "string", + "type": { + "$ref": "1100" + }, + "value": "D8E30CC0-2763-4FCC-84A8-3C5659281032" + } + }, + { + "$id": "1117", + "parameter": { + "$ref": "1102" + }, + "value": { + "$id": "1118", + "kind": "string", + "type": { + "$ref": "1103" + }, + "value": "eastus2euap" + } + }, + { + "$id": "1119", + "parameter": { + "$ref": "1110" + }, + "value": { + "$id": "1120", + "kind": "model", + "type": { + "$ref": "375" + }, + "value": { + "$id": "1121", + "operationIds": { + "$id": "1122", + "kind": "array", + "type": { + "$ref": "377" + }, + "value": [ + { + "$id": "1123", + "kind": "string", + "type": { + "$ref": "378" + }, + "value": "23480d2f-1dca-4610-afb4-dd25eec1f34r" + } + ] + } + } + } + } + ], + "responses": [ + { + "$id": "1124", + "response": { + "$ref": "1111" + }, + "statusCode": 200, + "bodyValue": { + "$id": "1125", + "kind": "model", + "type": { + "$ref": "381" + }, + "value": { + "$id": "1126", + "results": { + "$id": "1127", + "kind": "array", + "type": { + "$ref": "383" + }, + "value": [ + { + "$id": "1128", + "kind": "model", + "type": { + "$ref": "384" + }, + "value": { + "$id": "1129", + "operationId": { + "$id": "1130", + "kind": "string", + "type": { + "$ref": "386" + }, + "value": "23480d2f-1dca-4610-afb4-dd25eec1f34r" + }, + "creationTime": { + "$id": "1131", + "kind": "string", + "type": { + "$ref": "390" + }, + "value": "2024-11-01T17:52:53.999Z" + }, + "activationTime": { + "$id": "1132", + "kind": "string", + "type": { + "$ref": "395" + }, + "value": "2024-11-01T17:52:53.999Z" + }, + "completedAt": { + "$id": "1133", + "kind": "string", + "type": { + "$ref": "400" + }, + "value": "2024-11-01T17:52:53.999Z" + }, + "operationErrors": { + "$id": "1134", + "kind": "array", + "type": { + "$ref": "405" + }, + "value": [ + { + "$id": "1135", + "kind": "model", + "type": { + "$ref": "406" + }, + "value": { + "$id": "1136", + "errorCode": { + "$id": "1137", + "kind": "string", + "type": { + "$ref": "408" + }, + "value": "null" + }, + "errorDetails": { + "$id": "1138", + "kind": "string", + "type": { + "$ref": "412" + }, + "value": "null" + }, + "timestamp": { + "$id": "1139", + "kind": "string", + "type": { + "$ref": "416" + }, + "value": "2024-11-01T17:52:53.999Z" + }, + "azureOperationName": { + "$id": "1140", + "kind": "string", + "type": { + "$ref": "426" + }, + "value": "23480d2f-1dca-4610-afb4-dd25eec1f34r" + }, + "timeStamp": { + "$id": "1141", + "kind": "string", + "type": { + "$ref": "421" + }, + "value": "2024-11-27T16:55:03.357Z" + }, + "crpOperationId": { + "$id": "1142", + "kind": "string", + "type": { + "$ref": "430" + }, + "value": "23480d2f-1dca-4610-afb4-dd25eec1f34r" + } + } + } + ] + }, + "requestErrorCode": { + "$id": "1143", + "kind": "string", + "type": { + "$ref": "436" + }, + "value": "null" + }, + "requestErrorDetails": { + "$id": "1144", + "kind": "string", + "type": { + "$ref": "440" + }, + "value": "null" + } + } + } + ] + } + } + } + } + ] + } + ] + } + ], + "Protocol": { + "$id": "1145" + }, + "Parent": "ComputeScheduleClient", + "Parameters": [ + { + "$id": "1146", + "Name": "endpoint", + "NameInRequest": "endpoint", + "Doc": "Service host", + "Type": { + "$id": "1147", + "kind": "url", + "name": "url", + "crossLanguageDefinitionId": "TypeSpec.url" + }, + "Location": "Uri", + "IsApiVersion": false, + "IsResourceParameter": false, + "IsContentType": false, + "IsRequired": true, + "IsEndpoint": true, + "SkipUrlEncoding": false, + "Explode": false, + "Kind": "Client", + "DefaultValue": { + "$id": "1148", + "Type": { + "$id": "1149", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "https://management.azure.com" + } + } + ], + "Decorators": [] + } + ], + "Auth": { + "$id": "1150", + "OAuth2": { + "$id": "1151", + "Scopes": [ + "user_impersonation" + ] + } + } +} diff --git a/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/Azure.ResourceManager.DatabaseFleetManager.sln b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/Azure.ResourceManager.DatabaseFleetManager.sln new file mode 100644 index 000000000000..089254656cac --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/Azure.ResourceManager.DatabaseFleetManager.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.DatabaseFleetManager.Samples", "samples\Azure.ResourceManager.DatabaseFleetManager.Samples.csproj", "{7A2DFF15-5746-49F4-BD0F-C6C35337088A}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Azure.ResourceManager.DatabaseFleetManager", "src\Azure.ResourceManager.DatabaseFleetManager.csproj", "{28FF4005-4467-4E36-92E7-DEA27DEB1519}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Azure.ResourceManager.DatabaseFleetManager.Tests", "tests\Azure.ResourceManager.DatabaseFleetManager.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/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/CHANGELOG.md b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/CHANGELOG.md new file mode 100644 index 000000000000..8b33f0fedccc --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/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/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/Directory.Build.props b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/Directory.Build.props new file mode 100644 index 000000000000..63bd836ad44b --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/Directory.Build.props @@ -0,0 +1,6 @@ + + + + diff --git a/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/README.md b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/README.md new file mode 100644 index 000000000000..ce57f5065e0e --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/README.md @@ -0,0 +1,80 @@ +# Microsoft Azure DatabaseFleetManager 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 DatabaseFleetManager management library for .NET with [NuGet](https://www.nuget.org/): + +```dotnetcli +dotnet add package Azure.ResourceManager.DatabaseFleetManager --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/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/api/Azure.ResourceManager.DatabaseFleetManager.net8.0.cs b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/api/Azure.ResourceManager.DatabaseFleetManager.net8.0.cs new file mode 100644 index 000000000000..3cd9005cfaab --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/api/Azure.ResourceManager.DatabaseFleetManager.net8.0.cs @@ -0,0 +1,637 @@ +namespace Azure.ResourceManager.DatabaseFleetManager +{ + public static partial class DatabaseFleetManagerExtensions + { + public static Azure.ResourceManager.DatabaseFleetManager.FirewallRuleResource GetFirewallRuleResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.Response GetFleet(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string fleetName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static System.Threading.Tasks.Task> GetFleetAsync(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string fleetName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.ResourceManager.DatabaseFleetManager.FleetDatabaseResource GetFleetDatabaseResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.DatabaseFleetManager.FleetResource GetFleetResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.DatabaseFleetManager.FleetCollection GetFleets(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource) { throw null; } + public static Azure.Pageable GetFleets(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.AsyncPageable GetFleetsAsync(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.ResourceManager.DatabaseFleetManager.FleetspaceResource GetFleetspaceResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.DatabaseFleetManager.FleetTierResource GetFleetTierResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + } + public partial class FirewallRuleCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected FirewallRuleCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string firewallRuleName, Azure.ResourceManager.DatabaseFleetManager.FirewallRuleData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string firewallRuleName, Azure.ResourceManager.DatabaseFleetManager.FirewallRuleData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string firewallRuleName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string firewallRuleName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string firewallRuleName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(long? skip = default(long?), long? top = default(long?), string skiptoken = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(long? skip = default(long?), long? top = default(long?), string skiptoken = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string firewallRuleName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string firewallRuleName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string firewallRuleName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class FirewallRuleData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public FirewallRuleData() { } + public Azure.ResourceManager.DatabaseFleetManager.Models.FirewallRuleProperties Properties { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseFleetManager.FirewallRuleData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseFleetManager.FirewallRuleData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class FirewallRuleResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected FirewallRuleResource() { } + public virtual Azure.ResourceManager.DatabaseFleetManager.FirewallRuleData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string fleetName, string fleetspaceName, string firewallRuleName) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + Azure.ResourceManager.DatabaseFleetManager.FirewallRuleData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseFleetManager.FirewallRuleData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.DatabaseFleetManager.FirewallRuleData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.DatabaseFleetManager.FirewallRuleData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class FleetCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected FleetCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string fleetName, Azure.ResourceManager.DatabaseFleetManager.FleetData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string fleetName, Azure.ResourceManager.DatabaseFleetManager.FleetData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string fleetName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string fleetName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string fleetName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(long? skip = default(long?), long? top = default(long?), string skiptoken = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(long? skip = default(long?), long? top = default(long?), string skiptoken = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string fleetName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string fleetName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string fleetName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class FleetData : Azure.ResourceManager.Models.TrackedResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public FleetData(Azure.Core.AzureLocation location) { } + public Azure.ResourceManager.DatabaseFleetManager.Models.FleetProperties Properties { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseFleetManager.FleetData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseFleetManager.FleetData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class FleetDatabaseCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected FleetDatabaseCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string databaseName, Azure.ResourceManager.DatabaseFleetManager.FleetDatabaseData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string databaseName, Azure.ResourceManager.DatabaseFleetManager.FleetDatabaseData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string databaseName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string databaseName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string databaseName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(long? skip = default(long?), long? top = default(long?), string filter = null, string skiptoken = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(long? skip = default(long?), long? top = default(long?), string filter = null, string skiptoken = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string databaseName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string databaseName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string databaseName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class FleetDatabaseData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public FleetDatabaseData() { } + public Azure.ResourceManager.DatabaseFleetManager.Models.FleetDatabaseProperties Properties { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseFleetManager.FleetDatabaseData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseFleetManager.FleetDatabaseData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class FleetDatabaseResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected FleetDatabaseResource() { } + public virtual Azure.ResourceManager.DatabaseFleetManager.FleetDatabaseData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public virtual Azure.ResourceManager.ArmOperation ChangeTier(Azure.WaitUntil waitUntil, Azure.ResourceManager.DatabaseFleetManager.Models.DatabaseChangeTierProperties body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task ChangeTierAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.DatabaseFleetManager.Models.DatabaseChangeTierProperties body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string fleetName, string fleetspaceName, string databaseName) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Rename(Azure.WaitUntil waitUntil, Azure.ResourceManager.DatabaseFleetManager.Models.DatabaseRenameProperties body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task RenameAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.DatabaseFleetManager.Models.DatabaseRenameProperties body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Revert(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task RevertAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + Azure.ResourceManager.DatabaseFleetManager.FleetDatabaseData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseFleetManager.FleetDatabaseData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.DatabaseFleetManager.FleetDatabaseData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.DatabaseFleetManager.FleetDatabaseData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class FleetResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected FleetResource() { } + public virtual Azure.ResourceManager.DatabaseFleetManager.FleetData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public virtual Azure.Response AddTag(string key, string value, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> AddTagAsync(string key, string value, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string fleetName) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response GetFleetspace(string fleetspaceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetFleetspaceAsync(string fleetspaceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.DatabaseFleetManager.FleetspaceCollection GetFleetspaces() { throw null; } + public virtual Azure.Response GetFleetTier(string tierName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetFleetTierAsync(string tierName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.DatabaseFleetManager.FleetTierCollection GetFleetTiers() { throw null; } + public virtual Azure.Response RemoveTag(string key, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> RemoveTagAsync(string key, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response SetTags(System.Collections.Generic.IDictionary tags, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> SetTagsAsync(System.Collections.Generic.IDictionary tags, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + Azure.ResourceManager.DatabaseFleetManager.FleetData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseFleetManager.FleetData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.DatabaseFleetManager.Models.FleetPatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.DatabaseFleetManager.Models.FleetPatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class FleetspaceCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected FleetspaceCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string fleetspaceName, Azure.ResourceManager.DatabaseFleetManager.FleetspaceData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string fleetspaceName, Azure.ResourceManager.DatabaseFleetManager.FleetspaceData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string fleetspaceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string fleetspaceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string fleetspaceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(long? skip = default(long?), long? top = default(long?), string skiptoken = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(long? skip = default(long?), long? top = default(long?), string skiptoken = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string fleetspaceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string fleetspaceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string fleetspaceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class FleetspaceData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public FleetspaceData() { } + public Azure.ResourceManager.DatabaseFleetManager.Models.FleetspaceProperties Properties { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseFleetManager.FleetspaceData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseFleetManager.FleetspaceData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class FleetspaceResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected FleetspaceResource() { } + public virtual Azure.ResourceManager.DatabaseFleetManager.FleetspaceData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string fleetName, string fleetspaceName) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response GetFirewallRule(string firewallRuleName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetFirewallRuleAsync(string firewallRuleName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.DatabaseFleetManager.FirewallRuleCollection GetFirewallRules() { throw null; } + public virtual Azure.Response GetFleetDatabase(string databaseName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetFleetDatabaseAsync(string databaseName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.DatabaseFleetManager.FleetDatabaseCollection GetFleetDatabases() { throw null; } + public virtual Azure.ResourceManager.ArmOperation RegisterServer(Azure.WaitUntil waitUntil, Azure.ResourceManager.DatabaseFleetManager.Models.RegisterServerProperties body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task RegisterServerAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.DatabaseFleetManager.Models.RegisterServerProperties body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + Azure.ResourceManager.DatabaseFleetManager.FleetspaceData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseFleetManager.FleetspaceData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Unregister(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task UnregisterAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.DatabaseFleetManager.FleetspaceData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.DatabaseFleetManager.FleetspaceData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class FleetTierCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected FleetTierCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string tierName, Azure.ResourceManager.DatabaseFleetManager.FleetTierData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string tierName, Azure.ResourceManager.DatabaseFleetManager.FleetTierData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string tierName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string tierName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string tierName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(long? skip = default(long?), long? top = default(long?), string skiptoken = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(long? skip = default(long?), long? top = default(long?), string skiptoken = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string tierName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string tierName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string tierName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class FleetTierData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public FleetTierData() { } + public Azure.ResourceManager.DatabaseFleetManager.Models.FleetTierProperties Properties { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseFleetManager.FleetTierData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseFleetManager.FleetTierData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class FleetTierResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected FleetTierResource() { } + public virtual Azure.ResourceManager.DatabaseFleetManager.FleetTierData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string fleetName, string tierName) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Disable(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> DisableAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + Azure.ResourceManager.DatabaseFleetManager.FleetTierData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseFleetManager.FleetTierData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.DatabaseFleetManager.FleetTierData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.DatabaseFleetManager.FleetTierData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } +} +namespace Azure.ResourceManager.DatabaseFleetManager.Mocking +{ + public partial class MockableDatabaseFleetManagerArmClient : Azure.ResourceManager.ArmResource + { + protected MockableDatabaseFleetManagerArmClient() { } + public virtual Azure.ResourceManager.DatabaseFleetManager.FirewallRuleResource GetFirewallRuleResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.DatabaseFleetManager.FleetDatabaseResource GetFleetDatabaseResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.DatabaseFleetManager.FleetResource GetFleetResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.DatabaseFleetManager.FleetspaceResource GetFleetspaceResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.DatabaseFleetManager.FleetTierResource GetFleetTierResource(Azure.Core.ResourceIdentifier id) { throw null; } + } + public partial class MockableDatabaseFleetManagerResourceGroupResource : Azure.ResourceManager.ArmResource + { + protected MockableDatabaseFleetManagerResourceGroupResource() { } + public virtual Azure.Response GetFleet(string fleetName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetFleetAsync(string fleetName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.DatabaseFleetManager.FleetCollection GetFleets() { throw null; } + } + public partial class MockableDatabaseFleetManagerSubscriptionResource : Azure.ResourceManager.ArmResource + { + protected MockableDatabaseFleetManagerSubscriptionResource() { } + public virtual Azure.Pageable GetFleets(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetFleetsAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } +} +namespace Azure.ResourceManager.DatabaseFleetManager.Models +{ + public static partial class ArmDatabaseFleetManagerModelFactory + { + public static Azure.ResourceManager.DatabaseFleetManager.FirewallRuleData FirewallRuleData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.DatabaseFleetManager.Models.FirewallRuleProperties properties = null) { throw null; } + public static Azure.ResourceManager.DatabaseFleetManager.Models.FirewallRuleProperties FirewallRuleProperties(string startIPAddress = null, string endIPAddress = null, Azure.ResourceManager.DatabaseFleetManager.Models.AzureProvisioningState? provisioningState = default(Azure.ResourceManager.DatabaseFleetManager.Models.AzureProvisioningState?)) { throw null; } + public static Azure.ResourceManager.DatabaseFleetManager.FleetData FleetData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), Azure.ResourceManager.DatabaseFleetManager.Models.FleetProperties properties = null) { throw null; } + public static Azure.ResourceManager.DatabaseFleetManager.FleetDatabaseData FleetDatabaseData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.DatabaseFleetManager.Models.FleetDatabaseProperties properties = null) { throw null; } + public static Azure.ResourceManager.DatabaseFleetManager.Models.FleetDatabaseProperties FleetDatabaseProperties(string originalDatabaseId = null, Azure.ResourceManager.DatabaseFleetManager.Models.AzureProvisioningState? provisioningState = default(Azure.ResourceManager.DatabaseFleetManager.Models.AzureProvisioningState?), Azure.ResourceManager.DatabaseFleetManager.Models.DatabaseCreateMode? createMode = default(Azure.ResourceManager.DatabaseFleetManager.Models.DatabaseCreateMode?), string tierName = null, string connectionString = null, bool? recoverable = default(bool?), System.DateTimeOffset? restoreFromOn = default(System.DateTimeOffset?), System.DateTimeOffset? earliestRestoreOn = default(System.DateTimeOffset?), System.DateTimeOffset? latestRestoreOn = default(System.DateTimeOffset?), int? backupRetentionDays = default(int?), int? databaseSizeGbMax = default(int?), string sourceDatabaseName = null, System.Collections.Generic.IDictionary resourceTags = null, Azure.ResourceManager.DatabaseFleetManager.Models.IdentityProperties identity = null, Azure.ResourceManager.DatabaseFleetManager.Models.TransparentDataEncryption transparentDataEncryption = null, string collation = null) { throw null; } + public static Azure.ResourceManager.DatabaseFleetManager.Models.FleetProperties FleetProperties(string description = null, Azure.ResourceManager.DatabaseFleetManager.Models.AzureProvisioningState? provisioningState = default(Azure.ResourceManager.DatabaseFleetManager.Models.AzureProvisioningState?)) { throw null; } + public static Azure.ResourceManager.DatabaseFleetManager.FleetspaceData FleetspaceData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.DatabaseFleetManager.Models.FleetspaceProperties properties = null) { throw null; } + public static Azure.ResourceManager.DatabaseFleetManager.Models.FleetspaceProperties FleetspaceProperties(Azure.ResourceManager.DatabaseFleetManager.Models.AzureProvisioningState? provisioningState = default(Azure.ResourceManager.DatabaseFleetManager.Models.AzureProvisioningState?), int? capacityMax = default(int?), Azure.ResourceManager.DatabaseFleetManager.Models.MainPrincipal mainPrincipal = null) { throw null; } + public static Azure.ResourceManager.DatabaseFleetManager.FleetTierData FleetTierData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.DatabaseFleetManager.Models.FleetTierProperties properties = null) { throw null; } + public static Azure.ResourceManager.DatabaseFleetManager.Models.FleetTierProperties FleetTierProperties(bool? disabled = default(bool?), bool? serverless = default(bool?), bool? pooled = default(bool?), string serviceTier = null, string family = null, int? capacity = default(int?), int? poolNumOfDatabasesMax = default(int?), int? highAvailabilityReplicaCount = default(int?), Azure.ResourceManager.DatabaseFleetManager.Models.ZoneRedundancy? zoneRedundancy = default(Azure.ResourceManager.DatabaseFleetManager.Models.ZoneRedundancy?), double? databaseCapacityMin = default(double?), double? databaseCapacityMax = default(double?), int? databaseSizeGbMax = default(int?), Azure.ResourceManager.DatabaseFleetManager.Models.AzureProvisioningState? provisioningState = default(Azure.ResourceManager.DatabaseFleetManager.Models.AzureProvisioningState?)) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct AzureProvisioningState : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public AzureProvisioningState(string value) { throw null; } + public static Azure.ResourceManager.DatabaseFleetManager.Models.AzureProvisioningState Accepted { get { throw null; } } + public static Azure.ResourceManager.DatabaseFleetManager.Models.AzureProvisioningState Canceled { get { throw null; } } + public static Azure.ResourceManager.DatabaseFleetManager.Models.AzureProvisioningState Failed { get { throw null; } } + public static Azure.ResourceManager.DatabaseFleetManager.Models.AzureProvisioningState Provisioning { get { throw null; } } + public static Azure.ResourceManager.DatabaseFleetManager.Models.AzureProvisioningState Succeeded { get { throw null; } } + public bool Equals(Azure.ResourceManager.DatabaseFleetManager.Models.AzureProvisioningState other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.DatabaseFleetManager.Models.AzureProvisioningState left, Azure.ResourceManager.DatabaseFleetManager.Models.AzureProvisioningState right) { throw null; } + public static implicit operator Azure.ResourceManager.DatabaseFleetManager.Models.AzureProvisioningState (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.DatabaseFleetManager.Models.AzureProvisioningState left, Azure.ResourceManager.DatabaseFleetManager.Models.AzureProvisioningState right) { throw null; } + public override string ToString() { throw null; } + } + public partial class DatabaseChangeTierProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DatabaseChangeTierProperties() { } + public string TargetTierName { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseFleetManager.Models.DatabaseChangeTierProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseFleetManager.Models.DatabaseChangeTierProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct DatabaseCreateMode : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public DatabaseCreateMode(string value) { throw null; } + public static Azure.ResourceManager.DatabaseFleetManager.Models.DatabaseCreateMode Copy { get { throw null; } } + public static Azure.ResourceManager.DatabaseFleetManager.Models.DatabaseCreateMode Default { get { throw null; } } + public static Azure.ResourceManager.DatabaseFleetManager.Models.DatabaseCreateMode PointInTimeRestore { get { throw null; } } + public bool Equals(Azure.ResourceManager.DatabaseFleetManager.Models.DatabaseCreateMode other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.DatabaseFleetManager.Models.DatabaseCreateMode left, Azure.ResourceManager.DatabaseFleetManager.Models.DatabaseCreateMode right) { throw null; } + public static implicit operator Azure.ResourceManager.DatabaseFleetManager.Models.DatabaseCreateMode (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.DatabaseFleetManager.Models.DatabaseCreateMode left, Azure.ResourceManager.DatabaseFleetManager.Models.DatabaseCreateMode right) { throw null; } + public override string ToString() { throw null; } + } + public partial class DatabaseIdentity : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DatabaseIdentity() { } + public System.Guid? ClientId { get { throw null; } set { } } + public System.Guid? PrincipalId { get { throw null; } set { } } + public Azure.Core.ResourceIdentifier ResourceId { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseFleetManager.Models.DatabaseIdentity System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseFleetManager.Models.DatabaseIdentity System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DatabaseRenameProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DatabaseRenameProperties() { } + public string NewName { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseFleetManager.Models.DatabaseRenameProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseFleetManager.Models.DatabaseRenameProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DestinationTierOverride : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DestinationTierOverride(Azure.ResourceManager.DatabaseFleetManager.Models.ResourceType resourceType, string tierName, string resourceName) { } + public string ResourceName { get { throw null; } } + public Azure.ResourceManager.DatabaseFleetManager.Models.ResourceType ResourceType { get { throw null; } } + public string TierName { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseFleetManager.Models.DestinationTierOverride System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseFleetManager.Models.DestinationTierOverride System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class FirewallRuleProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public FirewallRuleProperties() { } + public string EndIPAddress { get { throw null; } set { } } + public Azure.ResourceManager.DatabaseFleetManager.Models.AzureProvisioningState? ProvisioningState { get { throw null; } } + public string StartIPAddress { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseFleetManager.Models.FirewallRuleProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseFleetManager.Models.FirewallRuleProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class FleetDatabaseProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public FleetDatabaseProperties() { } + public int? BackupRetentionDays { get { throw null; } } + public string Collation { get { throw null; } set { } } + public string ConnectionString { get { throw null; } } + public Azure.ResourceManager.DatabaseFleetManager.Models.DatabaseCreateMode? CreateMode { get { throw null; } set { } } + public int? DatabaseSizeGbMax { get { throw null; } } + public System.DateTimeOffset? EarliestRestoreOn { get { throw null; } } + public Azure.ResourceManager.DatabaseFleetManager.Models.IdentityProperties Identity { get { throw null; } set { } } + public System.DateTimeOffset? LatestRestoreOn { get { throw null; } } + public string OriginalDatabaseId { get { throw null; } } + public Azure.ResourceManager.DatabaseFleetManager.Models.AzureProvisioningState? ProvisioningState { get { throw null; } } + public bool? Recoverable { get { throw null; } } + public System.Collections.Generic.IDictionary ResourceTags { get { throw null; } } + public System.DateTimeOffset? RestoreFromOn { get { throw null; } set { } } + public string SourceDatabaseName { get { throw null; } set { } } + public string TierName { get { throw null; } set { } } + public Azure.ResourceManager.DatabaseFleetManager.Models.TransparentDataEncryption TransparentDataEncryption { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseFleetManager.Models.FleetDatabaseProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseFleetManager.Models.FleetDatabaseProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class FleetPatch : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public FleetPatch() { } + public Azure.ResourceManager.DatabaseFleetManager.Models.FleetProperties Properties { get { throw null; } set { } } + public System.Collections.Generic.IDictionary Tags { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseFleetManager.Models.FleetPatch System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseFleetManager.Models.FleetPatch System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class FleetProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public FleetProperties() { } + public string Description { get { throw null; } set { } } + public Azure.ResourceManager.DatabaseFleetManager.Models.AzureProvisioningState? ProvisioningState { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseFleetManager.Models.FleetProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseFleetManager.Models.FleetProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class FleetspaceProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public FleetspaceProperties() { } + public int? CapacityMax { get { throw null; } set { } } + public Azure.ResourceManager.DatabaseFleetManager.Models.MainPrincipal MainPrincipal { get { throw null; } set { } } + public Azure.ResourceManager.DatabaseFleetManager.Models.AzureProvisioningState? ProvisioningState { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseFleetManager.Models.FleetspaceProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseFleetManager.Models.FleetspaceProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class FleetTierProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public FleetTierProperties() { } + public int? Capacity { get { throw null; } set { } } + public double? DatabaseCapacityMax { get { throw null; } set { } } + public double? DatabaseCapacityMin { get { throw null; } set { } } + public int? DatabaseSizeGbMax { get { throw null; } set { } } + public bool? Disabled { get { throw null; } } + public string Family { get { throw null; } set { } } + public int? HighAvailabilityReplicaCount { get { throw null; } set { } } + public bool? Pooled { get { throw null; } set { } } + public int? PoolNumOfDatabasesMax { get { throw null; } set { } } + public Azure.ResourceManager.DatabaseFleetManager.Models.AzureProvisioningState? ProvisioningState { get { throw null; } } + public bool? Serverless { get { throw null; } set { } } + public string ServiceTier { get { throw null; } set { } } + public Azure.ResourceManager.DatabaseFleetManager.Models.ZoneRedundancy? ZoneRedundancy { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseFleetManager.Models.FleetTierProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseFleetManager.Models.FleetTierProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class IdentityProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public IdentityProperties() { } + public System.Guid? FederatedClientId { get { throw null; } set { } } + public Azure.ResourceManager.DatabaseFleetManager.Models.IdentityType? IdentityType { get { throw null; } set { } } + public System.Collections.Generic.IList UserAssignedIdentities { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseFleetManager.Models.IdentityProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseFleetManager.Models.IdentityProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct IdentityType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public IdentityType(string value) { throw null; } + public static Azure.ResourceManager.DatabaseFleetManager.Models.IdentityType None { get { throw null; } } + public static Azure.ResourceManager.DatabaseFleetManager.Models.IdentityType UserAssigned { get { throw null; } } + public bool Equals(Azure.ResourceManager.DatabaseFleetManager.Models.IdentityType other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.DatabaseFleetManager.Models.IdentityType left, Azure.ResourceManager.DatabaseFleetManager.Models.IdentityType right) { throw null; } + public static implicit operator Azure.ResourceManager.DatabaseFleetManager.Models.IdentityType (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.DatabaseFleetManager.Models.IdentityType left, Azure.ResourceManager.DatabaseFleetManager.Models.IdentityType right) { throw null; } + public override string ToString() { throw null; } + } + public partial class MainPrincipal : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public MainPrincipal() { } + public System.Guid? ApplicationId { get { throw null; } set { } } + public string Login { get { throw null; } set { } } + public System.Guid? ObjectId { get { throw null; } set { } } + public Azure.ResourceManager.DatabaseFleetManager.Models.PrincipalType? PrincipalType { get { throw null; } set { } } + public System.Guid? TenantId { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseFleetManager.Models.MainPrincipal System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseFleetManager.Models.MainPrincipal System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct PrincipalType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public PrincipalType(string value) { throw null; } + public static Azure.ResourceManager.DatabaseFleetManager.Models.PrincipalType Application { get { throw null; } } + public static Azure.ResourceManager.DatabaseFleetManager.Models.PrincipalType User { get { throw null; } } + public bool Equals(Azure.ResourceManager.DatabaseFleetManager.Models.PrincipalType other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.DatabaseFleetManager.Models.PrincipalType left, Azure.ResourceManager.DatabaseFleetManager.Models.PrincipalType right) { throw null; } + public static implicit operator Azure.ResourceManager.DatabaseFleetManager.Models.PrincipalType (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.DatabaseFleetManager.Models.PrincipalType left, Azure.ResourceManager.DatabaseFleetManager.Models.PrincipalType right) { throw null; } + public override string ToString() { throw null; } + } + public partial class RegisterServerProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public RegisterServerProperties() { } + public System.Collections.Generic.IList DestinationTierOverrides { get { throw null; } } + public string SourceResourceGroupName { get { throw null; } set { } } + public string SourceServerName { get { throw null; } set { } } + public string SourceSubscriptionId { get { throw null; } set { } } + public string TierName { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseFleetManager.Models.RegisterServerProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseFleetManager.Models.RegisterServerProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct ResourceType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public ResourceType(string value) { throw null; } + public static Azure.ResourceManager.DatabaseFleetManager.Models.ResourceType Database { get { throw null; } } + public static Azure.ResourceManager.DatabaseFleetManager.Models.ResourceType Pool { get { throw null; } } + public bool Equals(Azure.ResourceManager.DatabaseFleetManager.Models.ResourceType other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.DatabaseFleetManager.Models.ResourceType left, Azure.ResourceManager.DatabaseFleetManager.Models.ResourceType right) { throw null; } + public static implicit operator Azure.ResourceManager.DatabaseFleetManager.Models.ResourceType (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.DatabaseFleetManager.Models.ResourceType left, Azure.ResourceManager.DatabaseFleetManager.Models.ResourceType right) { throw null; } + public override string ToString() { throw null; } + } + public partial class TransparentDataEncryption : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public TransparentDataEncryption() { } + public bool? EnableAutoRotation { get { throw null; } set { } } + public System.Collections.Generic.IList Keys { get { throw null; } } + public System.Uri KeyUri { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseFleetManager.Models.TransparentDataEncryption System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseFleetManager.Models.TransparentDataEncryption System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct ZoneRedundancy : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public ZoneRedundancy(string value) { throw null; } + public static Azure.ResourceManager.DatabaseFleetManager.Models.ZoneRedundancy Disabled { get { throw null; } } + public static Azure.ResourceManager.DatabaseFleetManager.Models.ZoneRedundancy Enabled { get { throw null; } } + public bool Equals(Azure.ResourceManager.DatabaseFleetManager.Models.ZoneRedundancy other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.DatabaseFleetManager.Models.ZoneRedundancy left, Azure.ResourceManager.DatabaseFleetManager.Models.ZoneRedundancy right) { throw null; } + public static implicit operator Azure.ResourceManager.DatabaseFleetManager.Models.ZoneRedundancy (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.DatabaseFleetManager.Models.ZoneRedundancy left, Azure.ResourceManager.DatabaseFleetManager.Models.ZoneRedundancy right) { throw null; } + public override string ToString() { throw null; } + } +} diff --git a/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/api/Azure.ResourceManager.DatabaseFleetManager.netstandard2.0.cs b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/api/Azure.ResourceManager.DatabaseFleetManager.netstandard2.0.cs new file mode 100644 index 000000000000..3cd9005cfaab --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/api/Azure.ResourceManager.DatabaseFleetManager.netstandard2.0.cs @@ -0,0 +1,637 @@ +namespace Azure.ResourceManager.DatabaseFleetManager +{ + public static partial class DatabaseFleetManagerExtensions + { + public static Azure.ResourceManager.DatabaseFleetManager.FirewallRuleResource GetFirewallRuleResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.Response GetFleet(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string fleetName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static System.Threading.Tasks.Task> GetFleetAsync(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string fleetName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.ResourceManager.DatabaseFleetManager.FleetDatabaseResource GetFleetDatabaseResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.DatabaseFleetManager.FleetResource GetFleetResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.DatabaseFleetManager.FleetCollection GetFleets(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource) { throw null; } + public static Azure.Pageable GetFleets(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.AsyncPageable GetFleetsAsync(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.ResourceManager.DatabaseFleetManager.FleetspaceResource GetFleetspaceResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.DatabaseFleetManager.FleetTierResource GetFleetTierResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + } + public partial class FirewallRuleCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected FirewallRuleCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string firewallRuleName, Azure.ResourceManager.DatabaseFleetManager.FirewallRuleData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string firewallRuleName, Azure.ResourceManager.DatabaseFleetManager.FirewallRuleData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string firewallRuleName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string firewallRuleName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string firewallRuleName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(long? skip = default(long?), long? top = default(long?), string skiptoken = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(long? skip = default(long?), long? top = default(long?), string skiptoken = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string firewallRuleName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string firewallRuleName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string firewallRuleName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class FirewallRuleData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public FirewallRuleData() { } + public Azure.ResourceManager.DatabaseFleetManager.Models.FirewallRuleProperties Properties { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseFleetManager.FirewallRuleData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseFleetManager.FirewallRuleData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class FirewallRuleResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected FirewallRuleResource() { } + public virtual Azure.ResourceManager.DatabaseFleetManager.FirewallRuleData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string fleetName, string fleetspaceName, string firewallRuleName) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + Azure.ResourceManager.DatabaseFleetManager.FirewallRuleData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseFleetManager.FirewallRuleData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.DatabaseFleetManager.FirewallRuleData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.DatabaseFleetManager.FirewallRuleData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class FleetCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected FleetCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string fleetName, Azure.ResourceManager.DatabaseFleetManager.FleetData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string fleetName, Azure.ResourceManager.DatabaseFleetManager.FleetData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string fleetName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string fleetName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string fleetName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(long? skip = default(long?), long? top = default(long?), string skiptoken = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(long? skip = default(long?), long? top = default(long?), string skiptoken = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string fleetName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string fleetName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string fleetName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class FleetData : Azure.ResourceManager.Models.TrackedResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public FleetData(Azure.Core.AzureLocation location) { } + public Azure.ResourceManager.DatabaseFleetManager.Models.FleetProperties Properties { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseFleetManager.FleetData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseFleetManager.FleetData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class FleetDatabaseCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected FleetDatabaseCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string databaseName, Azure.ResourceManager.DatabaseFleetManager.FleetDatabaseData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string databaseName, Azure.ResourceManager.DatabaseFleetManager.FleetDatabaseData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string databaseName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string databaseName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string databaseName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(long? skip = default(long?), long? top = default(long?), string filter = null, string skiptoken = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(long? skip = default(long?), long? top = default(long?), string filter = null, string skiptoken = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string databaseName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string databaseName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string databaseName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class FleetDatabaseData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public FleetDatabaseData() { } + public Azure.ResourceManager.DatabaseFleetManager.Models.FleetDatabaseProperties Properties { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseFleetManager.FleetDatabaseData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseFleetManager.FleetDatabaseData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class FleetDatabaseResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected FleetDatabaseResource() { } + public virtual Azure.ResourceManager.DatabaseFleetManager.FleetDatabaseData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public virtual Azure.ResourceManager.ArmOperation ChangeTier(Azure.WaitUntil waitUntil, Azure.ResourceManager.DatabaseFleetManager.Models.DatabaseChangeTierProperties body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task ChangeTierAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.DatabaseFleetManager.Models.DatabaseChangeTierProperties body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string fleetName, string fleetspaceName, string databaseName) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Rename(Azure.WaitUntil waitUntil, Azure.ResourceManager.DatabaseFleetManager.Models.DatabaseRenameProperties body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task RenameAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.DatabaseFleetManager.Models.DatabaseRenameProperties body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Revert(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task RevertAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + Azure.ResourceManager.DatabaseFleetManager.FleetDatabaseData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseFleetManager.FleetDatabaseData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.DatabaseFleetManager.FleetDatabaseData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.DatabaseFleetManager.FleetDatabaseData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class FleetResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected FleetResource() { } + public virtual Azure.ResourceManager.DatabaseFleetManager.FleetData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public virtual Azure.Response AddTag(string key, string value, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> AddTagAsync(string key, string value, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string fleetName) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response GetFleetspace(string fleetspaceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetFleetspaceAsync(string fleetspaceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.DatabaseFleetManager.FleetspaceCollection GetFleetspaces() { throw null; } + public virtual Azure.Response GetFleetTier(string tierName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetFleetTierAsync(string tierName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.DatabaseFleetManager.FleetTierCollection GetFleetTiers() { throw null; } + public virtual Azure.Response RemoveTag(string key, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> RemoveTagAsync(string key, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response SetTags(System.Collections.Generic.IDictionary tags, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> SetTagsAsync(System.Collections.Generic.IDictionary tags, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + Azure.ResourceManager.DatabaseFleetManager.FleetData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseFleetManager.FleetData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.DatabaseFleetManager.Models.FleetPatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.DatabaseFleetManager.Models.FleetPatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class FleetspaceCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected FleetspaceCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string fleetspaceName, Azure.ResourceManager.DatabaseFleetManager.FleetspaceData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string fleetspaceName, Azure.ResourceManager.DatabaseFleetManager.FleetspaceData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string fleetspaceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string fleetspaceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string fleetspaceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(long? skip = default(long?), long? top = default(long?), string skiptoken = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(long? skip = default(long?), long? top = default(long?), string skiptoken = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string fleetspaceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string fleetspaceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string fleetspaceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class FleetspaceData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public FleetspaceData() { } + public Azure.ResourceManager.DatabaseFleetManager.Models.FleetspaceProperties Properties { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseFleetManager.FleetspaceData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseFleetManager.FleetspaceData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class FleetspaceResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected FleetspaceResource() { } + public virtual Azure.ResourceManager.DatabaseFleetManager.FleetspaceData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string fleetName, string fleetspaceName) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response GetFirewallRule(string firewallRuleName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetFirewallRuleAsync(string firewallRuleName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.DatabaseFleetManager.FirewallRuleCollection GetFirewallRules() { throw null; } + public virtual Azure.Response GetFleetDatabase(string databaseName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetFleetDatabaseAsync(string databaseName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.DatabaseFleetManager.FleetDatabaseCollection GetFleetDatabases() { throw null; } + public virtual Azure.ResourceManager.ArmOperation RegisterServer(Azure.WaitUntil waitUntil, Azure.ResourceManager.DatabaseFleetManager.Models.RegisterServerProperties body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task RegisterServerAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.DatabaseFleetManager.Models.RegisterServerProperties body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + Azure.ResourceManager.DatabaseFleetManager.FleetspaceData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseFleetManager.FleetspaceData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Unregister(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task UnregisterAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.DatabaseFleetManager.FleetspaceData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.DatabaseFleetManager.FleetspaceData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class FleetTierCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected FleetTierCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string tierName, Azure.ResourceManager.DatabaseFleetManager.FleetTierData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string tierName, Azure.ResourceManager.DatabaseFleetManager.FleetTierData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string tierName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string tierName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string tierName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(long? skip = default(long?), long? top = default(long?), string skiptoken = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(long? skip = default(long?), long? top = default(long?), string skiptoken = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string tierName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string tierName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string tierName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class FleetTierData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public FleetTierData() { } + public Azure.ResourceManager.DatabaseFleetManager.Models.FleetTierProperties Properties { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseFleetManager.FleetTierData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseFleetManager.FleetTierData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class FleetTierResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected FleetTierResource() { } + public virtual Azure.ResourceManager.DatabaseFleetManager.FleetTierData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string fleetName, string tierName) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Disable(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> DisableAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + Azure.ResourceManager.DatabaseFleetManager.FleetTierData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseFleetManager.FleetTierData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.DatabaseFleetManager.FleetTierData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.DatabaseFleetManager.FleetTierData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } +} +namespace Azure.ResourceManager.DatabaseFleetManager.Mocking +{ + public partial class MockableDatabaseFleetManagerArmClient : Azure.ResourceManager.ArmResource + { + protected MockableDatabaseFleetManagerArmClient() { } + public virtual Azure.ResourceManager.DatabaseFleetManager.FirewallRuleResource GetFirewallRuleResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.DatabaseFleetManager.FleetDatabaseResource GetFleetDatabaseResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.DatabaseFleetManager.FleetResource GetFleetResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.DatabaseFleetManager.FleetspaceResource GetFleetspaceResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.DatabaseFleetManager.FleetTierResource GetFleetTierResource(Azure.Core.ResourceIdentifier id) { throw null; } + } + public partial class MockableDatabaseFleetManagerResourceGroupResource : Azure.ResourceManager.ArmResource + { + protected MockableDatabaseFleetManagerResourceGroupResource() { } + public virtual Azure.Response GetFleet(string fleetName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetFleetAsync(string fleetName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.DatabaseFleetManager.FleetCollection GetFleets() { throw null; } + } + public partial class MockableDatabaseFleetManagerSubscriptionResource : Azure.ResourceManager.ArmResource + { + protected MockableDatabaseFleetManagerSubscriptionResource() { } + public virtual Azure.Pageable GetFleets(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetFleetsAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } +} +namespace Azure.ResourceManager.DatabaseFleetManager.Models +{ + public static partial class ArmDatabaseFleetManagerModelFactory + { + public static Azure.ResourceManager.DatabaseFleetManager.FirewallRuleData FirewallRuleData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.DatabaseFleetManager.Models.FirewallRuleProperties properties = null) { throw null; } + public static Azure.ResourceManager.DatabaseFleetManager.Models.FirewallRuleProperties FirewallRuleProperties(string startIPAddress = null, string endIPAddress = null, Azure.ResourceManager.DatabaseFleetManager.Models.AzureProvisioningState? provisioningState = default(Azure.ResourceManager.DatabaseFleetManager.Models.AzureProvisioningState?)) { throw null; } + public static Azure.ResourceManager.DatabaseFleetManager.FleetData FleetData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), Azure.ResourceManager.DatabaseFleetManager.Models.FleetProperties properties = null) { throw null; } + public static Azure.ResourceManager.DatabaseFleetManager.FleetDatabaseData FleetDatabaseData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.DatabaseFleetManager.Models.FleetDatabaseProperties properties = null) { throw null; } + public static Azure.ResourceManager.DatabaseFleetManager.Models.FleetDatabaseProperties FleetDatabaseProperties(string originalDatabaseId = null, Azure.ResourceManager.DatabaseFleetManager.Models.AzureProvisioningState? provisioningState = default(Azure.ResourceManager.DatabaseFleetManager.Models.AzureProvisioningState?), Azure.ResourceManager.DatabaseFleetManager.Models.DatabaseCreateMode? createMode = default(Azure.ResourceManager.DatabaseFleetManager.Models.DatabaseCreateMode?), string tierName = null, string connectionString = null, bool? recoverable = default(bool?), System.DateTimeOffset? restoreFromOn = default(System.DateTimeOffset?), System.DateTimeOffset? earliestRestoreOn = default(System.DateTimeOffset?), System.DateTimeOffset? latestRestoreOn = default(System.DateTimeOffset?), int? backupRetentionDays = default(int?), int? databaseSizeGbMax = default(int?), string sourceDatabaseName = null, System.Collections.Generic.IDictionary resourceTags = null, Azure.ResourceManager.DatabaseFleetManager.Models.IdentityProperties identity = null, Azure.ResourceManager.DatabaseFleetManager.Models.TransparentDataEncryption transparentDataEncryption = null, string collation = null) { throw null; } + public static Azure.ResourceManager.DatabaseFleetManager.Models.FleetProperties FleetProperties(string description = null, Azure.ResourceManager.DatabaseFleetManager.Models.AzureProvisioningState? provisioningState = default(Azure.ResourceManager.DatabaseFleetManager.Models.AzureProvisioningState?)) { throw null; } + public static Azure.ResourceManager.DatabaseFleetManager.FleetspaceData FleetspaceData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.DatabaseFleetManager.Models.FleetspaceProperties properties = null) { throw null; } + public static Azure.ResourceManager.DatabaseFleetManager.Models.FleetspaceProperties FleetspaceProperties(Azure.ResourceManager.DatabaseFleetManager.Models.AzureProvisioningState? provisioningState = default(Azure.ResourceManager.DatabaseFleetManager.Models.AzureProvisioningState?), int? capacityMax = default(int?), Azure.ResourceManager.DatabaseFleetManager.Models.MainPrincipal mainPrincipal = null) { throw null; } + public static Azure.ResourceManager.DatabaseFleetManager.FleetTierData FleetTierData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.DatabaseFleetManager.Models.FleetTierProperties properties = null) { throw null; } + public static Azure.ResourceManager.DatabaseFleetManager.Models.FleetTierProperties FleetTierProperties(bool? disabled = default(bool?), bool? serverless = default(bool?), bool? pooled = default(bool?), string serviceTier = null, string family = null, int? capacity = default(int?), int? poolNumOfDatabasesMax = default(int?), int? highAvailabilityReplicaCount = default(int?), Azure.ResourceManager.DatabaseFleetManager.Models.ZoneRedundancy? zoneRedundancy = default(Azure.ResourceManager.DatabaseFleetManager.Models.ZoneRedundancy?), double? databaseCapacityMin = default(double?), double? databaseCapacityMax = default(double?), int? databaseSizeGbMax = default(int?), Azure.ResourceManager.DatabaseFleetManager.Models.AzureProvisioningState? provisioningState = default(Azure.ResourceManager.DatabaseFleetManager.Models.AzureProvisioningState?)) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct AzureProvisioningState : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public AzureProvisioningState(string value) { throw null; } + public static Azure.ResourceManager.DatabaseFleetManager.Models.AzureProvisioningState Accepted { get { throw null; } } + public static Azure.ResourceManager.DatabaseFleetManager.Models.AzureProvisioningState Canceled { get { throw null; } } + public static Azure.ResourceManager.DatabaseFleetManager.Models.AzureProvisioningState Failed { get { throw null; } } + public static Azure.ResourceManager.DatabaseFleetManager.Models.AzureProvisioningState Provisioning { get { throw null; } } + public static Azure.ResourceManager.DatabaseFleetManager.Models.AzureProvisioningState Succeeded { get { throw null; } } + public bool Equals(Azure.ResourceManager.DatabaseFleetManager.Models.AzureProvisioningState other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.DatabaseFleetManager.Models.AzureProvisioningState left, Azure.ResourceManager.DatabaseFleetManager.Models.AzureProvisioningState right) { throw null; } + public static implicit operator Azure.ResourceManager.DatabaseFleetManager.Models.AzureProvisioningState (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.DatabaseFleetManager.Models.AzureProvisioningState left, Azure.ResourceManager.DatabaseFleetManager.Models.AzureProvisioningState right) { throw null; } + public override string ToString() { throw null; } + } + public partial class DatabaseChangeTierProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DatabaseChangeTierProperties() { } + public string TargetTierName { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseFleetManager.Models.DatabaseChangeTierProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseFleetManager.Models.DatabaseChangeTierProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct DatabaseCreateMode : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public DatabaseCreateMode(string value) { throw null; } + public static Azure.ResourceManager.DatabaseFleetManager.Models.DatabaseCreateMode Copy { get { throw null; } } + public static Azure.ResourceManager.DatabaseFleetManager.Models.DatabaseCreateMode Default { get { throw null; } } + public static Azure.ResourceManager.DatabaseFleetManager.Models.DatabaseCreateMode PointInTimeRestore { get { throw null; } } + public bool Equals(Azure.ResourceManager.DatabaseFleetManager.Models.DatabaseCreateMode other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.DatabaseFleetManager.Models.DatabaseCreateMode left, Azure.ResourceManager.DatabaseFleetManager.Models.DatabaseCreateMode right) { throw null; } + public static implicit operator Azure.ResourceManager.DatabaseFleetManager.Models.DatabaseCreateMode (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.DatabaseFleetManager.Models.DatabaseCreateMode left, Azure.ResourceManager.DatabaseFleetManager.Models.DatabaseCreateMode right) { throw null; } + public override string ToString() { throw null; } + } + public partial class DatabaseIdentity : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DatabaseIdentity() { } + public System.Guid? ClientId { get { throw null; } set { } } + public System.Guid? PrincipalId { get { throw null; } set { } } + public Azure.Core.ResourceIdentifier ResourceId { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseFleetManager.Models.DatabaseIdentity System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseFleetManager.Models.DatabaseIdentity System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DatabaseRenameProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DatabaseRenameProperties() { } + public string NewName { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseFleetManager.Models.DatabaseRenameProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseFleetManager.Models.DatabaseRenameProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DestinationTierOverride : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DestinationTierOverride(Azure.ResourceManager.DatabaseFleetManager.Models.ResourceType resourceType, string tierName, string resourceName) { } + public string ResourceName { get { throw null; } } + public Azure.ResourceManager.DatabaseFleetManager.Models.ResourceType ResourceType { get { throw null; } } + public string TierName { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseFleetManager.Models.DestinationTierOverride System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseFleetManager.Models.DestinationTierOverride System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class FirewallRuleProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public FirewallRuleProperties() { } + public string EndIPAddress { get { throw null; } set { } } + public Azure.ResourceManager.DatabaseFleetManager.Models.AzureProvisioningState? ProvisioningState { get { throw null; } } + public string StartIPAddress { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseFleetManager.Models.FirewallRuleProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseFleetManager.Models.FirewallRuleProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class FleetDatabaseProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public FleetDatabaseProperties() { } + public int? BackupRetentionDays { get { throw null; } } + public string Collation { get { throw null; } set { } } + public string ConnectionString { get { throw null; } } + public Azure.ResourceManager.DatabaseFleetManager.Models.DatabaseCreateMode? CreateMode { get { throw null; } set { } } + public int? DatabaseSizeGbMax { get { throw null; } } + public System.DateTimeOffset? EarliestRestoreOn { get { throw null; } } + public Azure.ResourceManager.DatabaseFleetManager.Models.IdentityProperties Identity { get { throw null; } set { } } + public System.DateTimeOffset? LatestRestoreOn { get { throw null; } } + public string OriginalDatabaseId { get { throw null; } } + public Azure.ResourceManager.DatabaseFleetManager.Models.AzureProvisioningState? ProvisioningState { get { throw null; } } + public bool? Recoverable { get { throw null; } } + public System.Collections.Generic.IDictionary ResourceTags { get { throw null; } } + public System.DateTimeOffset? RestoreFromOn { get { throw null; } set { } } + public string SourceDatabaseName { get { throw null; } set { } } + public string TierName { get { throw null; } set { } } + public Azure.ResourceManager.DatabaseFleetManager.Models.TransparentDataEncryption TransparentDataEncryption { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseFleetManager.Models.FleetDatabaseProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseFleetManager.Models.FleetDatabaseProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class FleetPatch : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public FleetPatch() { } + public Azure.ResourceManager.DatabaseFleetManager.Models.FleetProperties Properties { get { throw null; } set { } } + public System.Collections.Generic.IDictionary Tags { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseFleetManager.Models.FleetPatch System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseFleetManager.Models.FleetPatch System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class FleetProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public FleetProperties() { } + public string Description { get { throw null; } set { } } + public Azure.ResourceManager.DatabaseFleetManager.Models.AzureProvisioningState? ProvisioningState { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseFleetManager.Models.FleetProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseFleetManager.Models.FleetProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class FleetspaceProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public FleetspaceProperties() { } + public int? CapacityMax { get { throw null; } set { } } + public Azure.ResourceManager.DatabaseFleetManager.Models.MainPrincipal MainPrincipal { get { throw null; } set { } } + public Azure.ResourceManager.DatabaseFleetManager.Models.AzureProvisioningState? ProvisioningState { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseFleetManager.Models.FleetspaceProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseFleetManager.Models.FleetspaceProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class FleetTierProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public FleetTierProperties() { } + public int? Capacity { get { throw null; } set { } } + public double? DatabaseCapacityMax { get { throw null; } set { } } + public double? DatabaseCapacityMin { get { throw null; } set { } } + public int? DatabaseSizeGbMax { get { throw null; } set { } } + public bool? Disabled { get { throw null; } } + public string Family { get { throw null; } set { } } + public int? HighAvailabilityReplicaCount { get { throw null; } set { } } + public bool? Pooled { get { throw null; } set { } } + public int? PoolNumOfDatabasesMax { get { throw null; } set { } } + public Azure.ResourceManager.DatabaseFleetManager.Models.AzureProvisioningState? ProvisioningState { get { throw null; } } + public bool? Serverless { get { throw null; } set { } } + public string ServiceTier { get { throw null; } set { } } + public Azure.ResourceManager.DatabaseFleetManager.Models.ZoneRedundancy? ZoneRedundancy { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseFleetManager.Models.FleetTierProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseFleetManager.Models.FleetTierProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class IdentityProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public IdentityProperties() { } + public System.Guid? FederatedClientId { get { throw null; } set { } } + public Azure.ResourceManager.DatabaseFleetManager.Models.IdentityType? IdentityType { get { throw null; } set { } } + public System.Collections.Generic.IList UserAssignedIdentities { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseFleetManager.Models.IdentityProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseFleetManager.Models.IdentityProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct IdentityType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public IdentityType(string value) { throw null; } + public static Azure.ResourceManager.DatabaseFleetManager.Models.IdentityType None { get { throw null; } } + public static Azure.ResourceManager.DatabaseFleetManager.Models.IdentityType UserAssigned { get { throw null; } } + public bool Equals(Azure.ResourceManager.DatabaseFleetManager.Models.IdentityType other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.DatabaseFleetManager.Models.IdentityType left, Azure.ResourceManager.DatabaseFleetManager.Models.IdentityType right) { throw null; } + public static implicit operator Azure.ResourceManager.DatabaseFleetManager.Models.IdentityType (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.DatabaseFleetManager.Models.IdentityType left, Azure.ResourceManager.DatabaseFleetManager.Models.IdentityType right) { throw null; } + public override string ToString() { throw null; } + } + public partial class MainPrincipal : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public MainPrincipal() { } + public System.Guid? ApplicationId { get { throw null; } set { } } + public string Login { get { throw null; } set { } } + public System.Guid? ObjectId { get { throw null; } set { } } + public Azure.ResourceManager.DatabaseFleetManager.Models.PrincipalType? PrincipalType { get { throw null; } set { } } + public System.Guid? TenantId { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseFleetManager.Models.MainPrincipal System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseFleetManager.Models.MainPrincipal System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct PrincipalType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public PrincipalType(string value) { throw null; } + public static Azure.ResourceManager.DatabaseFleetManager.Models.PrincipalType Application { get { throw null; } } + public static Azure.ResourceManager.DatabaseFleetManager.Models.PrincipalType User { get { throw null; } } + public bool Equals(Azure.ResourceManager.DatabaseFleetManager.Models.PrincipalType other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.DatabaseFleetManager.Models.PrincipalType left, Azure.ResourceManager.DatabaseFleetManager.Models.PrincipalType right) { throw null; } + public static implicit operator Azure.ResourceManager.DatabaseFleetManager.Models.PrincipalType (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.DatabaseFleetManager.Models.PrincipalType left, Azure.ResourceManager.DatabaseFleetManager.Models.PrincipalType right) { throw null; } + public override string ToString() { throw null; } + } + public partial class RegisterServerProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public RegisterServerProperties() { } + public System.Collections.Generic.IList DestinationTierOverrides { get { throw null; } } + public string SourceResourceGroupName { get { throw null; } set { } } + public string SourceServerName { get { throw null; } set { } } + public string SourceSubscriptionId { get { throw null; } set { } } + public string TierName { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseFleetManager.Models.RegisterServerProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseFleetManager.Models.RegisterServerProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct ResourceType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public ResourceType(string value) { throw null; } + public static Azure.ResourceManager.DatabaseFleetManager.Models.ResourceType Database { get { throw null; } } + public static Azure.ResourceManager.DatabaseFleetManager.Models.ResourceType Pool { get { throw null; } } + public bool Equals(Azure.ResourceManager.DatabaseFleetManager.Models.ResourceType other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.DatabaseFleetManager.Models.ResourceType left, Azure.ResourceManager.DatabaseFleetManager.Models.ResourceType right) { throw null; } + public static implicit operator Azure.ResourceManager.DatabaseFleetManager.Models.ResourceType (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.DatabaseFleetManager.Models.ResourceType left, Azure.ResourceManager.DatabaseFleetManager.Models.ResourceType right) { throw null; } + public override string ToString() { throw null; } + } + public partial class TransparentDataEncryption : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public TransparentDataEncryption() { } + public bool? EnableAutoRotation { get { throw null; } set { } } + public System.Collections.Generic.IList Keys { get { throw null; } } + public System.Uri KeyUri { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseFleetManager.Models.TransparentDataEncryption System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseFleetManager.Models.TransparentDataEncryption System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct ZoneRedundancy : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public ZoneRedundancy(string value) { throw null; } + public static Azure.ResourceManager.DatabaseFleetManager.Models.ZoneRedundancy Disabled { get { throw null; } } + public static Azure.ResourceManager.DatabaseFleetManager.Models.ZoneRedundancy Enabled { get { throw null; } } + public bool Equals(Azure.ResourceManager.DatabaseFleetManager.Models.ZoneRedundancy other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.DatabaseFleetManager.Models.ZoneRedundancy left, Azure.ResourceManager.DatabaseFleetManager.Models.ZoneRedundancy right) { throw null; } + public static implicit operator Azure.ResourceManager.DatabaseFleetManager.Models.ZoneRedundancy (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.DatabaseFleetManager.Models.ZoneRedundancy left, Azure.ResourceManager.DatabaseFleetManager.Models.ZoneRedundancy right) { throw null; } + public override string ToString() { throw null; } + } +} diff --git a/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/assets.json b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/assets.json new file mode 100644 index 000000000000..a3ae9749e088 --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/assets.json @@ -0,0 +1,7 @@ + +{ + "AssetsRepo": "Azure/azure-sdk-assets", + "AssetsRepoPrefixPath": "net", + "TagPrefix": "net/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager", + "Tag": "" +} diff --git a/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/samples/Azure.ResourceManager.DatabaseFleetManager.Samples.csproj b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/samples/Azure.ResourceManager.DatabaseFleetManager.Samples.csproj new file mode 100644 index 000000000000..1591846d9047 --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/samples/Azure.ResourceManager.DatabaseFleetManager.Samples.csproj @@ -0,0 +1,13 @@ + + + + + + + + + + + + + diff --git a/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/samples/Generated/Samples/Sample_FirewallRuleCollection.cs b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/samples/Generated/Samples/Sample_FirewallRuleCollection.cs new file mode 100644 index 000000000000..460fbae841d0 --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/samples/Generated/Samples/Sample_FirewallRuleCollection.cs @@ -0,0 +1,209 @@ +// 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.DatabaseFleetManager.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.DatabaseFleetManager.Samples +{ + public partial class Sample_FirewallRuleCollection + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task CreateOrUpdate_CreateOrUpdateFirewallRuleGeneratedByPolicy() + { + // Generated from example definition: 2025-02-01-preview/FirewallRules_CreateOrUpdate_MaximumSet_Gen.json + // this example is just showing the usage of "FirewallRule_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 FleetspaceResource created on azure + // for more information of creating FleetspaceResource, please refer to the document of FleetspaceResource + string subscriptionId = "a2b3c4d5-6789-0123-4567-89abcdef1234"; + string resourceGroupName = "rg-networking-operations"; + string fleetName = "data-fleet-01"; + string fleetspaceName = "prod-environment"; + ResourceIdentifier fleetspaceResourceId = FleetspaceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fleetName, fleetspaceName); + FleetspaceResource fleetspace = client.GetFleetspaceResource(fleetspaceResourceId); + + // get the collection of this FirewallRuleResource + FirewallRuleCollection collection = fleetspace.GetFirewallRules(); + + // invoke the operation + string firewallRuleName = "allow-10-0-0-0-24-to-10-1-0-0-24"; + FirewallRuleData data = new FirewallRuleData + { + Properties = new FirewallRuleProperties + { + StartIPAddress = "10.0.0.0", + EndIPAddress = "10.0.0.255", + }, + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, firewallRuleName, data); + FirewallRuleResource 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 + FirewallRuleData 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_GetFirewallRuleGeneratedByPolicy() + { + // Generated from example definition: 2025-02-01-preview/FirewallRules_Get_MaximumSet_Gen.json + // this example is just showing the usage of "FirewallRule_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 FleetspaceResource created on azure + // for more information of creating FleetspaceResource, please refer to the document of FleetspaceResource + string subscriptionId = "a2b3c4d5-6789-0123-4567-89abcdef1234"; + string resourceGroupName = "rg-networking-operations"; + string fleetName = "data-fleet-01"; + string fleetspaceName = "prod-environment"; + ResourceIdentifier fleetspaceResourceId = FleetspaceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fleetName, fleetspaceName); + FleetspaceResource fleetspace = client.GetFleetspaceResource(fleetspaceResourceId); + + // get the collection of this FirewallRuleResource + FirewallRuleCollection collection = fleetspace.GetFirewallRules(); + + // invoke the operation + string firewallRuleName = "allow-10-0-0-0-24-to-10-1-0-0-24"; + FirewallRuleResource result = await collection.GetAsync(firewallRuleName); + + // 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 + FirewallRuleData 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_ListFirewallRulesByFleetspaceGeneratedByPolicy() + { + // Generated from example definition: 2025-02-01-preview/FirewallRules_ListByFleetspace_MaximumSet_Gen.json + // this example is just showing the usage of "FirewallRule_ListByFleetspace" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details 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 FleetspaceResource created on azure + // for more information of creating FleetspaceResource, please refer to the document of FleetspaceResource + string subscriptionId = "a2b3c4d5-6789-0123-4567-89abcdef1234"; + string resourceGroupName = "rg-networking-operations"; + string fleetName = "data-fleet-01"; + string fleetspaceName = "prod-environment"; + ResourceIdentifier fleetspaceResourceId = FleetspaceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fleetName, fleetspaceName); + FleetspaceResource fleetspace = client.GetFleetspaceResource(fleetspaceResourceId); + + // get the collection of this FirewallRuleResource + FirewallRuleCollection collection = fleetspace.GetFirewallRules(); + + // invoke the operation and iterate over the result + await foreach (FirewallRuleResource 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 + FirewallRuleData 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_GetFirewallRuleGeneratedByPolicy() + { + // Generated from example definition: 2025-02-01-preview/FirewallRules_Get_MaximumSet_Gen.json + // this example is just showing the usage of "FirewallRule_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 FleetspaceResource created on azure + // for more information of creating FleetspaceResource, please refer to the document of FleetspaceResource + string subscriptionId = "a2b3c4d5-6789-0123-4567-89abcdef1234"; + string resourceGroupName = "rg-networking-operations"; + string fleetName = "data-fleet-01"; + string fleetspaceName = "prod-environment"; + ResourceIdentifier fleetspaceResourceId = FleetspaceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fleetName, fleetspaceName); + FleetspaceResource fleetspace = client.GetFleetspaceResource(fleetspaceResourceId); + + // get the collection of this FirewallRuleResource + FirewallRuleCollection collection = fleetspace.GetFirewallRules(); + + // invoke the operation + string firewallRuleName = "allow-10-0-0-0-24-to-10-1-0-0-24"; + bool result = await collection.ExistsAsync(firewallRuleName); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetIfExists_GetFirewallRuleGeneratedByPolicy() + { + // Generated from example definition: 2025-02-01-preview/FirewallRules_Get_MaximumSet_Gen.json + // this example is just showing the usage of "FirewallRule_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 FleetspaceResource created on azure + // for more information of creating FleetspaceResource, please refer to the document of FleetspaceResource + string subscriptionId = "a2b3c4d5-6789-0123-4567-89abcdef1234"; + string resourceGroupName = "rg-networking-operations"; + string fleetName = "data-fleet-01"; + string fleetspaceName = "prod-environment"; + ResourceIdentifier fleetspaceResourceId = FleetspaceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fleetName, fleetspaceName); + FleetspaceResource fleetspace = client.GetFleetspaceResource(fleetspaceResourceId); + + // get the collection of this FirewallRuleResource + FirewallRuleCollection collection = fleetspace.GetFirewallRules(); + + // invoke the operation + string firewallRuleName = "allow-10-0-0-0-24-to-10-1-0-0-24"; + NullableResponse response = await collection.GetIfExistsAsync(firewallRuleName); + FirewallRuleResource 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 + FirewallRuleData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + } +} diff --git a/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/samples/Generated/Samples/Sample_FirewallRuleResource.cs b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/samples/Generated/Samples/Sample_FirewallRuleResource.cs new file mode 100644 index 000000000000..87e86ff9cd3d --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/samples/Generated/Samples/Sample_FirewallRuleResource.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.DatabaseFleetManager.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.DatabaseFleetManager.Samples +{ + public partial class Sample_FirewallRuleResource + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_GetFirewallRuleGeneratedByPolicy() + { + // Generated from example definition: 2025-02-01-preview/FirewallRules_Get_MaximumSet_Gen.json + // this example is just showing the usage of "FirewallRule_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 FirewallRuleResource created on azure + // for more information of creating FirewallRuleResource, please refer to the document of FirewallRuleResource + string subscriptionId = "a2b3c4d5-6789-0123-4567-89abcdef1234"; + string resourceGroupName = "rg-networking-operations"; + string fleetName = "data-fleet-01"; + string fleetspaceName = "prod-environment"; + string firewallRuleName = "allow-10-0-0-0-24-to-10-1-0-0-24"; + ResourceIdentifier firewallRuleResourceId = FirewallRuleResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fleetName, fleetspaceName, firewallRuleName); + FirewallRuleResource firewallRule = client.GetFirewallRuleResource(firewallRuleResourceId); + + // invoke the operation + FirewallRuleResource result = await firewallRule.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 + FirewallRuleData 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_DeleteFirewallRuleGeneratedByPolicy() + { + // Generated from example definition: 2025-02-01-preview/FirewallRules_Delete_MaximumSet_Gen.json + // this example is just showing the usage of "FirewallRule_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 FirewallRuleResource created on azure + // for more information of creating FirewallRuleResource, please refer to the document of FirewallRuleResource + string subscriptionId = "a2b3c4d5-6789-0123-4567-89abcdef1234"; + string resourceGroupName = "rg-networking-operations"; + string fleetName = "data-fleet-01"; + string fleetspaceName = "prod-environment"; + string firewallRuleName = "allow-10-0-0-0-24-to-10-1-0-0-24"; + ResourceIdentifier firewallRuleResourceId = FirewallRuleResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fleetName, fleetspaceName, firewallRuleName); + FirewallRuleResource firewallRule = client.GetFirewallRuleResource(firewallRuleResourceId); + + // invoke the operation + await firewallRule.DeleteAsync(WaitUntil.Completed); + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Update_CreateOrUpdateFirewallRuleGeneratedByPolicy() + { + // Generated from example definition: 2025-02-01-preview/FirewallRules_CreateOrUpdate_MaximumSet_Gen.json + // this example is just showing the usage of "FirewallRule_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 FirewallRuleResource created on azure + // for more information of creating FirewallRuleResource, please refer to the document of FirewallRuleResource + string subscriptionId = "a2b3c4d5-6789-0123-4567-89abcdef1234"; + string resourceGroupName = "rg-networking-operations"; + string fleetName = "data-fleet-01"; + string fleetspaceName = "prod-environment"; + string firewallRuleName = "allow-10-0-0-0-24-to-10-1-0-0-24"; + ResourceIdentifier firewallRuleResourceId = FirewallRuleResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fleetName, fleetspaceName, firewallRuleName); + FirewallRuleResource firewallRule = client.GetFirewallRuleResource(firewallRuleResourceId); + + // invoke the operation + FirewallRuleData data = new FirewallRuleData + { + Properties = new FirewallRuleProperties + { + StartIPAddress = "10.0.0.0", + EndIPAddress = "10.0.0.255", + }, + }; + ArmOperation lro = await firewallRule.UpdateAsync(WaitUntil.Completed, data); + FirewallRuleResource 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 + FirewallRuleData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/samples/Generated/Samples/Sample_FleetCollection.cs b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/samples/Generated/Samples/Sample_FleetCollection.cs new file mode 100644 index 000000000000..da1a1955775a --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/samples/Generated/Samples/Sample_FleetCollection.cs @@ -0,0 +1,204 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.DatabaseFleetManager.Models; +using Azure.ResourceManager.Resources; +using NUnit.Framework; + +namespace Azure.ResourceManager.DatabaseFleetManager.Samples +{ + public partial class Sample_FleetCollection + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task CreateOrUpdate_FleetsCreateOrUpdateMaximumSetGenGeneratedByMaximumSetRule() + { + // Generated from example definition: 2025-02-01-preview/Fleets_CreateOrUpdate_MaximumSet_Gen.json + // this example is just showing the usage of "Fleet_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "C3897315-3847-4D8A-B2FC-7307B066AD63"; + string resourceGroupName = "rg-database-fleet-manager"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this FleetResource + FleetCollection collection = resourceGroupResource.GetFleets(); + + // invoke the operation + string fleetName = "production-fleet-01"; + FleetData data = new FleetData(new AzureLocation("East US")) + { + Properties = new FleetProperties + { + Description = "Production fleet for high availability and scalability.", + }, + Tags = +{ +["environment"] = "production", +["owner"] = "team-database" +}, + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, fleetName, data); + FleetResource 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 + FleetData 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_FleetsGetMaximumSetGenGeneratedByMaximumSetRule() + { + // Generated from example definition: 2025-02-01-preview/Fleets_Get_MaximumSet_Gen.json + // this example is just showing the usage of "Fleet_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 = "C3897315-3847-4D8A-B2FC-7307B066AD63"; + string resourceGroupName = "rg-database-fleet-manager"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this FleetResource + FleetCollection collection = resourceGroupResource.GetFleets(); + + // invoke the operation + string fleetName = "production-fleet-01"; + FleetResource result = await collection.GetAsync(fleetName); + + // 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 + FleetData 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_FleetsListByResourceGroupMaximumSetGenGeneratedByMaximumSetRule() + { + // Generated from example definition: 2025-02-01-preview/Fleets_ListByResourceGroup_MaximumSet_Gen.json + // this example is just showing the usage of "Fleet_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 = "C3897315-3847-4D8A-B2FC-7307B066AD63"; + string resourceGroupName = "rg-database-fleet-manager"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this FleetResource + FleetCollection collection = resourceGroupResource.GetFleets(); + + // invoke the operation and iterate over the result + await foreach (FleetResource 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 + FleetData 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_FleetsGetMaximumSetGenGeneratedByMaximumSetRule() + { + // Generated from example definition: 2025-02-01-preview/Fleets_Get_MaximumSet_Gen.json + // this example is just showing the usage of "Fleet_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 = "C3897315-3847-4D8A-B2FC-7307B066AD63"; + string resourceGroupName = "rg-database-fleet-manager"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this FleetResource + FleetCollection collection = resourceGroupResource.GetFleets(); + + // invoke the operation + string fleetName = "production-fleet-01"; + bool result = await collection.ExistsAsync(fleetName); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetIfExists_FleetsGetMaximumSetGenGeneratedByMaximumSetRule() + { + // Generated from example definition: 2025-02-01-preview/Fleets_Get_MaximumSet_Gen.json + // this example is just showing the usage of "Fleet_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 = "C3897315-3847-4D8A-B2FC-7307B066AD63"; + string resourceGroupName = "rg-database-fleet-manager"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this FleetResource + FleetCollection collection = resourceGroupResource.GetFleets(); + + // invoke the operation + string fleetName = "production-fleet-01"; + NullableResponse response = await collection.GetIfExistsAsync(fleetName); + FleetResource 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 + FleetData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + } +} diff --git a/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/samples/Generated/Samples/Sample_FleetDatabaseCollection.cs b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/samples/Generated/Samples/Sample_FleetDatabaseCollection.cs new file mode 100644 index 000000000000..6a008639d091 --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/samples/Generated/Samples/Sample_FleetDatabaseCollection.cs @@ -0,0 +1,232 @@ +// 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.DatabaseFleetManager.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.DatabaseFleetManager.Samples +{ + public partial class Sample_FleetDatabaseCollection + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task CreateOrUpdate_CreateOrUpdateDatabaseInFleetGeneratedByPolicy() + { + // Generated from example definition: 2025-02-01-preview/FleetDatabases_CreateOrUpdate_MaximumSet_Gen.json + // this example is just showing the usage of "FleetDatabase_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 FleetspaceResource created on azure + // for more information of creating FleetspaceResource, please refer to the document of FleetspaceResource + string subscriptionId = "C3897315-3847-4D8A-B2FC-7307B066AD63"; + string resourceGroupName = "rg-database-operations"; + string fleetName = "data-fleet-01"; + string fleetspaceName = "prod-environment"; + ResourceIdentifier fleetspaceResourceId = FleetspaceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fleetName, fleetspaceName); + FleetspaceResource fleetspace = client.GetFleetspaceResource(fleetspaceResourceId); + + // get the collection of this FleetDatabaseResource + FleetDatabaseCollection collection = fleetspace.GetFleetDatabases(); + + // invoke the operation + string databaseName = "customer-db-prod"; + FleetDatabaseData data = new FleetDatabaseData + { + Properties = new FleetDatabaseProperties + { + CreateMode = DatabaseCreateMode.Default, + TierName = "Premium", + RestoreFromOn = DateTimeOffset.Parse("2024-11-06T09:16:05.048Z"), + SourceDatabaseName = "existing-db-prod", + ResourceTags = +{ +["project"] = "Customer Data" +}, + Identity = new IdentityProperties + { + IdentityType = IdentityType.None, + UserAssignedIdentities = {new DatabaseIdentity +{ +ResourceId = new ResourceIdentifier("/subscriptions/12345678-90ab-cdef-1234-567890abcdef/resourceGroups/rg-database-operations/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity-01"), +PrincipalId = Guid.Parse("a2b3c4d5-6789-0123-4567-89abcdef1234"), +ClientId = Guid.Parse("a2b3c4d5-6789-0123-4567-89abcdef1234"), +}}, + FederatedClientId = Guid.Parse("a2b3c4d5-6789-0123-4567-89abcdef1234"), + }, + TransparentDataEncryption = new TransparentDataEncryption + { + KeyUri = new Uri("https://keyvaultname.vault.azure.net/keys/myKey/12345"), + Keys = { "key1" }, + EnableAutoRotation = true, + }, + }, + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, databaseName, data); + FleetDatabaseResource 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 + FleetDatabaseData 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_RetrieveDatabaseDetailsInFleetGeneratedByPolicy() + { + // Generated from example definition: 2025-02-01-preview/FleetDatabases_Get_MaximumSet_Gen.json + // this example is just showing the usage of "FleetDatabase_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 FleetspaceResource created on azure + // for more information of creating FleetspaceResource, please refer to the document of FleetspaceResource + string subscriptionId = "C3897315-3847-4D8A-B2FC-7307B066AD63"; + string resourceGroupName = "rg-database-operations"; + string fleetName = "data-fleet-01"; + string fleetspaceName = "prod-environment"; + ResourceIdentifier fleetspaceResourceId = FleetspaceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fleetName, fleetspaceName); + FleetspaceResource fleetspace = client.GetFleetspaceResource(fleetspaceResourceId); + + // get the collection of this FleetDatabaseResource + FleetDatabaseCollection collection = fleetspace.GetFleetDatabases(); + + // invoke the operation + string databaseName = "customer-db-prod"; + FleetDatabaseResource result = await collection.GetAsync(databaseName); + + // 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 + FleetDatabaseData 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_ListDatabasesInFleetspaceGeneratedByPolicy() + { + // Generated from example definition: 2025-02-01-preview/FleetDatabases_ListByFleetspace_MaximumSet_Gen.json + // this example is just showing the usage of "FleetDatabase_ListByFleetspace" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details 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 FleetspaceResource created on azure + // for more information of creating FleetspaceResource, please refer to the document of FleetspaceResource + string subscriptionId = "C3897315-3847-4D8A-B2FC-7307B066AD63"; + string resourceGroupName = "rg-database-operations"; + string fleetName = "data-fleet-01"; + string fleetspaceName = "prod-environment"; + ResourceIdentifier fleetspaceResourceId = FleetspaceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fleetName, fleetspaceName); + FleetspaceResource fleetspace = client.GetFleetspaceResource(fleetspaceResourceId); + + // get the collection of this FleetDatabaseResource + FleetDatabaseCollection collection = fleetspace.GetFleetDatabases(); + + // invoke the operation and iterate over the result + await foreach (FleetDatabaseResource 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 + FleetDatabaseData 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_RetrieveDatabaseDetailsInFleetGeneratedByPolicy() + { + // Generated from example definition: 2025-02-01-preview/FleetDatabases_Get_MaximumSet_Gen.json + // this example is just showing the usage of "FleetDatabase_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 FleetspaceResource created on azure + // for more information of creating FleetspaceResource, please refer to the document of FleetspaceResource + string subscriptionId = "C3897315-3847-4D8A-B2FC-7307B066AD63"; + string resourceGroupName = "rg-database-operations"; + string fleetName = "data-fleet-01"; + string fleetspaceName = "prod-environment"; + ResourceIdentifier fleetspaceResourceId = FleetspaceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fleetName, fleetspaceName); + FleetspaceResource fleetspace = client.GetFleetspaceResource(fleetspaceResourceId); + + // get the collection of this FleetDatabaseResource + FleetDatabaseCollection collection = fleetspace.GetFleetDatabases(); + + // invoke the operation + string databaseName = "customer-db-prod"; + bool result = await collection.ExistsAsync(databaseName); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetIfExists_RetrieveDatabaseDetailsInFleetGeneratedByPolicy() + { + // Generated from example definition: 2025-02-01-preview/FleetDatabases_Get_MaximumSet_Gen.json + // this example is just showing the usage of "FleetDatabase_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 FleetspaceResource created on azure + // for more information of creating FleetspaceResource, please refer to the document of FleetspaceResource + string subscriptionId = "C3897315-3847-4D8A-B2FC-7307B066AD63"; + string resourceGroupName = "rg-database-operations"; + string fleetName = "data-fleet-01"; + string fleetspaceName = "prod-environment"; + ResourceIdentifier fleetspaceResourceId = FleetspaceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fleetName, fleetspaceName); + FleetspaceResource fleetspace = client.GetFleetspaceResource(fleetspaceResourceId); + + // get the collection of this FleetDatabaseResource + FleetDatabaseCollection collection = fleetspace.GetFleetDatabases(); + + // invoke the operation + string databaseName = "customer-db-prod"; + NullableResponse response = await collection.GetIfExistsAsync(databaseName); + FleetDatabaseResource 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 + FleetDatabaseData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + } +} diff --git a/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/samples/Generated/Samples/Sample_FleetDatabaseResource.cs b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/samples/Generated/Samples/Sample_FleetDatabaseResource.cs new file mode 100644 index 000000000000..37e47d452231 --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/samples/Generated/Samples/Sample_FleetDatabaseResource.cs @@ -0,0 +1,236 @@ +// 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.DatabaseFleetManager.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.DatabaseFleetManager.Samples +{ + public partial class Sample_FleetDatabaseResource + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_RetrieveDatabaseDetailsInFleetGeneratedByPolicy() + { + // Generated from example definition: 2025-02-01-preview/FleetDatabases_Get_MaximumSet_Gen.json + // this example is just showing the usage of "FleetDatabase_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 FleetDatabaseResource created on azure + // for more information of creating FleetDatabaseResource, please refer to the document of FleetDatabaseResource + string subscriptionId = "C3897315-3847-4D8A-B2FC-7307B066AD63"; + string resourceGroupName = "rg-database-operations"; + string fleetName = "data-fleet-01"; + string fleetspaceName = "prod-environment"; + string databaseName = "customer-db-prod"; + ResourceIdentifier fleetDatabaseResourceId = FleetDatabaseResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fleetName, fleetspaceName, databaseName); + FleetDatabaseResource fleetDatabase = client.GetFleetDatabaseResource(fleetDatabaseResourceId); + + // invoke the operation + FleetDatabaseResource result = await fleetDatabase.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 + FleetDatabaseData 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_FleetDatabasesDeleteMaximumSetGenGeneratedByMaximumSetRule() + { + // Generated from example definition: 2025-02-01-preview/FleetDatabases_Delete_MaximumSet_Gen.json + // this example is just showing the usage of "FleetDatabase_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 FleetDatabaseResource created on azure + // for more information of creating FleetDatabaseResource, please refer to the document of FleetDatabaseResource + string subscriptionId = "C3897315-3847-4D8A-B2FC-7307B066AD63"; + string resourceGroupName = "rg-database-operations"; + string fleetName = "data-fleet-01"; + string fleetspaceName = "prod-environment"; + string databaseName = "customer-db-prod"; + ResourceIdentifier fleetDatabaseResourceId = FleetDatabaseResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fleetName, fleetspaceName, databaseName); + FleetDatabaseResource fleetDatabase = client.GetFleetDatabaseResource(fleetDatabaseResourceId); + + // invoke the operation + await fleetDatabase.DeleteAsync(WaitUntil.Completed); + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Update_UpdateDatabaseInFleetspaceGeneratedByPolicy() + { + // Generated from example definition: 2025-02-01-preview/FleetDatabases_Update_MaximumSet_Gen.json + // this example is just showing the usage of "FleetDatabase_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 FleetDatabaseResource created on azure + // for more information of creating FleetDatabaseResource, please refer to the document of FleetDatabaseResource + string subscriptionId = "C3897315-3847-4D8A-B2FC-7307B066AD63"; + string resourceGroupName = "rgdatabasefleetmanager"; + string fleetName = "production-fleet"; + string fleetspaceName = "primary-space"; + string databaseName = "customer-database-prod"; + ResourceIdentifier fleetDatabaseResourceId = FleetDatabaseResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fleetName, fleetspaceName, databaseName); + FleetDatabaseResource fleetDatabase = client.GetFleetDatabaseResource(fleetDatabaseResourceId); + + // invoke the operation + FleetDatabaseData data = new FleetDatabaseData + { + Properties = new FleetDatabaseProperties + { + CreateMode = DatabaseCreateMode.Default, + TierName = "Standard", + RestoreFromOn = DateTimeOffset.Parse("2024-11-06T09:16:05.048Z"), + SourceDatabaseName = "customer-database-staging", + ResourceTags = +{ +["environment"] = "production", +["owner"] = "database-team" +}, + Identity = new IdentityProperties + { + IdentityType = IdentityType.UserAssigned, + UserAssignedIdentities = {new DatabaseIdentity +{ +ResourceId = new ResourceIdentifier("/subscriptions/C3897315-3847-4D8A-B2FC-7307B066AD63/resourcegroups/rgdatabasefleetmanager/providers/Microsoft.ManagedIdentity/userAssignedIdentities/db-identity"), +PrincipalId = Guid.Parse("f8b7c2d3-b9c4-4f3b-85cd-3d56c6e49f92"), +ClientId = Guid.Parse("d2d8b19e-c4f7-4c62-8e8d-7f0f96d94e39"), +}}, + FederatedClientId = Guid.Parse("a2b3c4d5-6789-0123-4567-89abcdef1234"), + }, + TransparentDataEncryption = new TransparentDataEncryption + { + KeyUri = new Uri("https://keyvault-contoso.vault.azure.net/keys/db-encryption-key/abc123"), + Keys = { "abc123", "xyz789" }, + EnableAutoRotation = true, + }, + }, + }; + ArmOperation lro = await fleetDatabase.UpdateAsync(WaitUntil.Completed, data); + FleetDatabaseResource 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 + FleetDatabaseData 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 ChangeTier_ChangeDatabaseTierGeneratedByPolicy() + { + // Generated from example definition: 2025-02-01-preview/FleetDatabases_ChangeTier_MaximumSet_Gen.json + // this example is just showing the usage of "FleetDatabases_ChangeTier" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details 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 FleetDatabaseResource created on azure + // for more information of creating FleetDatabaseResource, please refer to the document of FleetDatabaseResource + string subscriptionId = "C3897315-3847-4D8A-B2FC-7307B066AD63"; + string resourceGroupName = "rg-database-operations"; + string fleetName = "data-fleet-01"; + string fleetspaceName = "prod-environment"; + string databaseName = "customer-db-prod"; + ResourceIdentifier fleetDatabaseResourceId = FleetDatabaseResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fleetName, fleetspaceName, databaseName); + FleetDatabaseResource fleetDatabase = client.GetFleetDatabaseResource(fleetDatabaseResourceId); + + // invoke the operation + DatabaseChangeTierProperties body = new DatabaseChangeTierProperties + { + TargetTierName = "Standard", + }; + await fleetDatabase.ChangeTierAsync(WaitUntil.Completed, body); + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Rename_RenameDatabaseInFleetspaceGeneratedByPolicy() + { + // Generated from example definition: 2025-02-01-preview/FleetDatabases_Rename_MaximumSet_Gen.json + // this example is just showing the usage of "FleetDatabases_Rename" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details 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 FleetDatabaseResource created on azure + // for more information of creating FleetDatabaseResource, please refer to the document of FleetDatabaseResource + string subscriptionId = "C3897315-3847-4D8A-B2FC-7307B066AD63"; + string resourceGroupName = "rg-database-operations"; + string fleetName = "data-fleet-01"; + string fleetspaceName = "prod-environment"; + string databaseName = "customer-db-prod"; + ResourceIdentifier fleetDatabaseResourceId = FleetDatabaseResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fleetName, fleetspaceName, databaseName); + FleetDatabaseResource fleetDatabase = client.GetFleetDatabaseResource(fleetDatabaseResourceId); + + // invoke the operation + DatabaseRenameProperties body = new DatabaseRenameProperties + { + NewName = "new-customer-db-prod", + }; + await fleetDatabase.RenameAsync(WaitUntil.Completed, body); + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Revert_RevertTransparentDataEncryptionInDatabaseGeneratedByPolicy() + { + // Generated from example definition: 2025-02-01-preview/FleetDatabases_Revert_MaximumSet_Gen.json + // this example is just showing the usage of "FleetDatabases_Revert" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details 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 FleetDatabaseResource created on azure + // for more information of creating FleetDatabaseResource, please refer to the document of FleetDatabaseResource + string subscriptionId = "C3897315-3847-4D8A-B2FC-7307B066AD63"; + string resourceGroupName = "rg-database-operations"; + string fleetName = "data-fleet-01"; + string fleetspaceName = "prod-environment"; + string databaseName = "customer-db-prod"; + ResourceIdentifier fleetDatabaseResourceId = FleetDatabaseResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fleetName, fleetspaceName, databaseName); + FleetDatabaseResource fleetDatabase = client.GetFleetDatabaseResource(fleetDatabaseResourceId); + + // invoke the operation + await fleetDatabase.RevertAsync(WaitUntil.Completed); + + Console.WriteLine("Succeeded"); + } + } +} diff --git a/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/samples/Generated/Samples/Sample_FleetResource.cs b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/samples/Generated/Samples/Sample_FleetResource.cs new file mode 100644 index 000000000000..89a408825e23 --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/samples/Generated/Samples/Sample_FleetResource.cs @@ -0,0 +1,118 @@ +// 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.DatabaseFleetManager.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.DatabaseFleetManager.Samples +{ + public partial class Sample_FleetResource + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_FleetsGetMaximumSetGenGeneratedByMaximumSetRule() + { + // Generated from example definition: 2025-02-01-preview/Fleets_Get_MaximumSet_Gen.json + // this example is just showing the usage of "Fleet_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 FleetResource created on azure + // for more information of creating FleetResource, please refer to the document of FleetResource + string subscriptionId = "C3897315-3847-4D8A-B2FC-7307B066AD63"; + string resourceGroupName = "rg-database-fleet-manager"; + string fleetName = "production-fleet-01"; + ResourceIdentifier fleetResourceId = FleetResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fleetName); + FleetResource fleet = client.GetFleetResource(fleetResourceId); + + // invoke the operation + FleetResource result = await fleet.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 + FleetData 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_FleetsDeleteMaximumSetGenGeneratedByMaximumSetRule() + { + // Generated from example definition: 2025-02-01-preview/Fleets_Delete_MaximumSet_Gen.json + // this example is just showing the usage of "Fleet_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 FleetResource created on azure + // for more information of creating FleetResource, please refer to the document of FleetResource + string subscriptionId = "C3897315-3847-4D8A-B2FC-7307B066AD63"; + string resourceGroupName = "rg-database-fleet-manager"; + string fleetName = "production-fleet-01"; + ResourceIdentifier fleetResourceId = FleetResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fleetName); + FleetResource fleet = client.GetFleetResource(fleetResourceId); + + // invoke the operation + await fleet.DeleteAsync(WaitUntil.Completed); + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Update_FleetsUpdateMaximumSetGenGeneratedByMaximumSetRule() + { + // Generated from example definition: 2025-02-01-preview/Fleets_Update_MaximumSet_Gen.json + // this example is just showing the usage of "Fleet_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 FleetResource created on azure + // for more information of creating FleetResource, please refer to the document of FleetResource + string subscriptionId = "C3897315-3847-4D8A-B2FC-7307B066AD63"; + string resourceGroupName = "rg-database-fleet-manager"; + string fleetName = "critical-production-fleet"; + ResourceIdentifier fleetResourceId = FleetResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fleetName); + FleetResource fleet = client.GetFleetResource(fleetResourceId); + + // invoke the operation + FleetPatch patch = new FleetPatch + { + Tags = +{ +["environment"] = "production", +["owner"] = "team-database" +}, + Properties = new FleetProperties + { + Description = "Fleet containing critical production databases and high availability configurations.", + }, + }; + ArmOperation lro = await fleet.UpdateAsync(WaitUntil.Completed, patch); + FleetResource 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 + FleetData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/samples/Generated/Samples/Sample_FleetTierCollection.cs b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/samples/Generated/Samples/Sample_FleetTierCollection.cs new file mode 100644 index 000000000000..cd978d6286e0 --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/samples/Generated/Samples/Sample_FleetTierCollection.cs @@ -0,0 +1,213 @@ +// 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.DatabaseFleetManager.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.DatabaseFleetManager.Samples +{ + public partial class Sample_FleetTierCollection + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task CreateOrUpdate_FleetTiersCreateOrUpdateMaximumSetGenGeneratedByMaximumSetRule() + { + // Generated from example definition: 2025-02-01-preview/FleetTiers_CreateOrUpdate_MaximumSet_Gen.json + // this example is just showing the usage of "FleetTier_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 FleetResource created on azure + // for more information of creating FleetResource, please refer to the document of FleetResource + string subscriptionId = "C3897315-3847-4D8A-B2FC-7307B066AD63"; + string resourceGroupName = "rg-database-fleet-manager"; + string fleetName = "critical-production-fleet"; + ResourceIdentifier fleetResourceId = FleetResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fleetName); + FleetResource fleet = client.GetFleetResource(fleetResourceId); + + // get the collection of this FleetTierResource + FleetTierCollection collection = fleet.GetFleetTiers(); + + // invoke the operation + string tierName = "general-purpose-tier"; + FleetTierData data = new FleetTierData + { + Properties = new FleetTierProperties + { + Serverless = false, + Pooled = true, + ServiceTier = "GeneralPurpose", + Family = "Gen5", + Capacity = 4, + PoolNumOfDatabasesMax = 10, + HighAvailabilityReplicaCount = 5, + ZoneRedundancy = ZoneRedundancy.Disabled, + DatabaseCapacityMin = 0, + DatabaseCapacityMax = 4, + DatabaseSizeGbMax = 50, + }, + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, tierName, data); + FleetTierResource 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 + FleetTierData 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_FleetTiersGetMaximumSetGenGeneratedByMaximumSetRule() + { + // Generated from example definition: 2025-02-01-preview/FleetTiers_Get_MaximumSet_Gen.json + // this example is just showing the usage of "FleetTier_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 FleetResource created on azure + // for more information of creating FleetResource, please refer to the document of FleetResource + string subscriptionId = "C3897315-3847-4D8A-B2FC-7307B066AD63"; + string resourceGroupName = "rg-database-fleet-manager"; + string fleetName = "critical-production-fleet"; + ResourceIdentifier fleetResourceId = FleetResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fleetName); + FleetResource fleet = client.GetFleetResource(fleetResourceId); + + // get the collection of this FleetTierResource + FleetTierCollection collection = fleet.GetFleetTiers(); + + // invoke the operation + string tierName = "general-purpose-tier"; + FleetTierResource result = await collection.GetAsync(tierName); + + // 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 + FleetTierData 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_FleetTiersListByFleetMaximumSetGenGeneratedByMaximumSetRule() + { + // Generated from example definition: 2025-02-01-preview/FleetTiers_ListByFleet_MaximumSet_Gen.json + // this example is just showing the usage of "FleetTier_ListByFleet" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details 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 FleetResource created on azure + // for more information of creating FleetResource, please refer to the document of FleetResource + string subscriptionId = "C3897315-3847-4D8A-B2FC-7307B066AD63"; + string resourceGroupName = "rg-database-fleet-manager"; + string fleetName = "critical-production-fleet"; + ResourceIdentifier fleetResourceId = FleetResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fleetName); + FleetResource fleet = client.GetFleetResource(fleetResourceId); + + // get the collection of this FleetTierResource + FleetTierCollection collection = fleet.GetFleetTiers(); + + // invoke the operation and iterate over the result + await foreach (FleetTierResource 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 + FleetTierData 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_FleetTiersGetMaximumSetGenGeneratedByMaximumSetRule() + { + // Generated from example definition: 2025-02-01-preview/FleetTiers_Get_MaximumSet_Gen.json + // this example is just showing the usage of "FleetTier_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 FleetResource created on azure + // for more information of creating FleetResource, please refer to the document of FleetResource + string subscriptionId = "C3897315-3847-4D8A-B2FC-7307B066AD63"; + string resourceGroupName = "rg-database-fleet-manager"; + string fleetName = "critical-production-fleet"; + ResourceIdentifier fleetResourceId = FleetResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fleetName); + FleetResource fleet = client.GetFleetResource(fleetResourceId); + + // get the collection of this FleetTierResource + FleetTierCollection collection = fleet.GetFleetTiers(); + + // invoke the operation + string tierName = "general-purpose-tier"; + bool result = await collection.ExistsAsync(tierName); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetIfExists_FleetTiersGetMaximumSetGenGeneratedByMaximumSetRule() + { + // Generated from example definition: 2025-02-01-preview/FleetTiers_Get_MaximumSet_Gen.json + // this example is just showing the usage of "FleetTier_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 FleetResource created on azure + // for more information of creating FleetResource, please refer to the document of FleetResource + string subscriptionId = "C3897315-3847-4D8A-B2FC-7307B066AD63"; + string resourceGroupName = "rg-database-fleet-manager"; + string fleetName = "critical-production-fleet"; + ResourceIdentifier fleetResourceId = FleetResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fleetName); + FleetResource fleet = client.GetFleetResource(fleetResourceId); + + // get the collection of this FleetTierResource + FleetTierCollection collection = fleet.GetFleetTiers(); + + // invoke the operation + string tierName = "general-purpose-tier"; + NullableResponse response = await collection.GetIfExistsAsync(tierName); + FleetTierResource 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 + FleetTierData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + } +} diff --git a/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/samples/Generated/Samples/Sample_FleetTierResource.cs b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/samples/Generated/Samples/Sample_FleetTierResource.cs new file mode 100644 index 000000000000..f087512991d3 --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/samples/Generated/Samples/Sample_FleetTierResource.cs @@ -0,0 +1,157 @@ +// 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.DatabaseFleetManager.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.DatabaseFleetManager.Samples +{ + public partial class Sample_FleetTierResource + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_FleetTiersGetMaximumSetGenGeneratedByMaximumSetRule() + { + // Generated from example definition: 2025-02-01-preview/FleetTiers_Get_MaximumSet_Gen.json + // this example is just showing the usage of "FleetTier_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 FleetTierResource created on azure + // for more information of creating FleetTierResource, please refer to the document of FleetTierResource + string subscriptionId = "C3897315-3847-4D8A-B2FC-7307B066AD63"; + string resourceGroupName = "rg-database-fleet-manager"; + string fleetName = "critical-production-fleet"; + string tierName = "general-purpose-tier"; + ResourceIdentifier fleetTierResourceId = FleetTierResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fleetName, tierName); + FleetTierResource fleetTier = client.GetFleetTierResource(fleetTierResourceId); + + // invoke the operation + FleetTierResource result = await fleetTier.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 + FleetTierData 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_FleetTiersDeleteMaximumSetGenGeneratedByMaximumSetRule() + { + // Generated from example definition: 2025-02-01-preview/FleetTiers_Delete_MaximumSet_Gen.json + // this example is just showing the usage of "FleetTier_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 FleetTierResource created on azure + // for more information of creating FleetTierResource, please refer to the document of FleetTierResource + string subscriptionId = "C3897315-3847-4D8A-B2FC-7307B066AD63"; + string resourceGroupName = "rg-database-fleet-manager"; + string fleetName = "critical-production-fleet"; + string tierName = "general-purpose-tier"; + ResourceIdentifier fleetTierResourceId = FleetTierResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fleetName, tierName); + FleetTierResource fleetTier = client.GetFleetTierResource(fleetTierResourceId); + + // invoke the operation + await fleetTier.DeleteAsync(WaitUntil.Completed); + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Update_FleetTiersUpdateMaximumSetGenGeneratedByMaximumSetRule() + { + // Generated from example definition: 2025-02-01-preview/FleetTiers_Update_MaximumSet_Gen.json + // this example is just showing the usage of "FleetTier_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 FleetTierResource created on azure + // for more information of creating FleetTierResource, please refer to the document of FleetTierResource + string subscriptionId = "C3897315-3847-4D8A-B2FC-7307B066AD63"; + string resourceGroupName = "rg-database-fleet-manager"; + string fleetName = "critical-production-fleet"; + string tierName = "general-purpose-tier"; + ResourceIdentifier fleetTierResourceId = FleetTierResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fleetName, tierName); + FleetTierResource fleetTier = client.GetFleetTierResource(fleetTierResourceId); + + // invoke the operation + FleetTierData data = new FleetTierData + { + Properties = new FleetTierProperties + { + Serverless = false, + Pooled = true, + ServiceTier = "GeneralPurpose", + Family = "Gen5", + Capacity = 4, + PoolNumOfDatabasesMax = 10, + HighAvailabilityReplicaCount = 5, + ZoneRedundancy = ZoneRedundancy.Disabled, + DatabaseCapacityMin = 0, + DatabaseCapacityMax = 4, + DatabaseSizeGbMax = 50, + }, + }; + ArmOperation lro = await fleetTier.UpdateAsync(WaitUntil.Completed, data); + FleetTierResource 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 + FleetTierData 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 Disable_FleetTiersDisableMaximumSetGenGeneratedByMaximumSetRule() + { + // Generated from example definition: 2025-02-01-preview/FleetTiers_Disable_MaximumSet_Gen.json + // this example is just showing the usage of "FleetTiers_Disable" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details 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 FleetTierResource created on azure + // for more information of creating FleetTierResource, please refer to the document of FleetTierResource + string subscriptionId = "C3897315-3847-4D8A-B2FC-7307B066AD63"; + string resourceGroupName = "rg-database-fleet-manager"; + string fleetName = "critical-production-fleet"; + string tierName = "general-purpose-tier"; + ResourceIdentifier fleetTierResourceId = FleetTierResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fleetName, tierName); + FleetTierResource fleetTier = client.GetFleetTierResource(fleetTierResourceId); + + // invoke the operation + FleetTierResource result = await fleetTier.DisableAsync(); + + // 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 + FleetTierData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/samples/Generated/Samples/Sample_FleetspaceCollection.cs b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/samples/Generated/Samples/Sample_FleetspaceCollection.cs new file mode 100644 index 000000000000..a0888b0588bf --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/samples/Generated/Samples/Sample_FleetspaceCollection.cs @@ -0,0 +1,211 @@ +// 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.DatabaseFleetManager.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.DatabaseFleetManager.Samples +{ + public partial class Sample_FleetspaceCollection + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task CreateOrUpdate_CreateOrUpdateFleetspaceGeneratedByPolicy() + { + // Generated from example definition: 2025-02-01-preview/Fleetspaces_CreateOrUpdate_MaximumSet_Gen.json + // this example is just showing the usage of "Fleetspace_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 FleetResource created on azure + // for more information of creating FleetResource, please refer to the document of FleetResource + string subscriptionId = "C3897315-3847-4D8A-B2FC-7307B066AD63"; + string resourceGroupName = "rgdatabasefleetmanager"; + string fleetName = "production-fleet"; + ResourceIdentifier fleetResourceId = FleetResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fleetName); + FleetResource fleet = client.GetFleetResource(fleetResourceId); + + // get the collection of this FleetspaceResource + FleetspaceCollection collection = fleet.GetFleetspaces(); + + // invoke the operation + string fleetspaceName = "primary-space"; + FleetspaceData data = new FleetspaceData + { + Properties = new FleetspaceProperties + { + CapacityMax = 150000, + MainPrincipal = new MainPrincipal + { + Login = "adminUser", + ApplicationId = Guid.Parse("d2d8b19e-c4f7-4c62-8e8d-7f0f96d94e39"), + ObjectId = Guid.Parse("f8b7c2d3-b9c4-4f3b-85cd-3d56c6e49f92"), + TenantId = Guid.Parse("bde45d44-ec42-45b8-a5a2-c5b998c65ef6"), + PrincipalType = PrincipalType.Application, + }, + }, + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, fleetspaceName, data); + FleetspaceResource 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 + FleetspaceData 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_FleetspacesGetMaximumSetGenGeneratedByMaximumSetRule() + { + // Generated from example definition: 2025-02-01-preview/Fleetspaces_Get_MaximumSet_Gen.json + // this example is just showing the usage of "Fleetspace_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 FleetResource created on azure + // for more information of creating FleetResource, please refer to the document of FleetResource + string subscriptionId = "C3897315-3847-4D8A-B2FC-7307B066AD63"; + string resourceGroupName = "rgdatabasefleetmanager"; + string fleetName = "production-fleet"; + ResourceIdentifier fleetResourceId = FleetResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fleetName); + FleetResource fleet = client.GetFleetResource(fleetResourceId); + + // get the collection of this FleetspaceResource + FleetspaceCollection collection = fleet.GetFleetspaces(); + + // invoke the operation + string fleetspaceName = "primary-space"; + FleetspaceResource result = await collection.GetAsync(fleetspaceName); + + // 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 + FleetspaceData 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_FleetspacesListByFleetMaximumSetGenGeneratedByMaximumSetRule() + { + // Generated from example definition: 2025-02-01-preview/Fleetspaces_ListByFleet_MaximumSet_Gen.json + // this example is just showing the usage of "Fleetspace_ListByFleet" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details 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 FleetResource created on azure + // for more information of creating FleetResource, please refer to the document of FleetResource + string subscriptionId = "C3897315-3847-4D8A-B2FC-7307B066AD63"; + string resourceGroupName = "rg-database-fleet-manager"; + string fleetName = "production-fleet"; + ResourceIdentifier fleetResourceId = FleetResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fleetName); + FleetResource fleet = client.GetFleetResource(fleetResourceId); + + // get the collection of this FleetspaceResource + FleetspaceCollection collection = fleet.GetFleetspaces(); + + // invoke the operation and iterate over the result + await foreach (FleetspaceResource 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 + FleetspaceData 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_FleetspacesGetMaximumSetGenGeneratedByMaximumSetRule() + { + // Generated from example definition: 2025-02-01-preview/Fleetspaces_Get_MaximumSet_Gen.json + // this example is just showing the usage of "Fleetspace_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 FleetResource created on azure + // for more information of creating FleetResource, please refer to the document of FleetResource + string subscriptionId = "C3897315-3847-4D8A-B2FC-7307B066AD63"; + string resourceGroupName = "rgdatabasefleetmanager"; + string fleetName = "production-fleet"; + ResourceIdentifier fleetResourceId = FleetResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fleetName); + FleetResource fleet = client.GetFleetResource(fleetResourceId); + + // get the collection of this FleetspaceResource + FleetspaceCollection collection = fleet.GetFleetspaces(); + + // invoke the operation + string fleetspaceName = "primary-space"; + bool result = await collection.ExistsAsync(fleetspaceName); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetIfExists_FleetspacesGetMaximumSetGenGeneratedByMaximumSetRule() + { + // Generated from example definition: 2025-02-01-preview/Fleetspaces_Get_MaximumSet_Gen.json + // this example is just showing the usage of "Fleetspace_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 FleetResource created on azure + // for more information of creating FleetResource, please refer to the document of FleetResource + string subscriptionId = "C3897315-3847-4D8A-B2FC-7307B066AD63"; + string resourceGroupName = "rgdatabasefleetmanager"; + string fleetName = "production-fleet"; + ResourceIdentifier fleetResourceId = FleetResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fleetName); + FleetResource fleet = client.GetFleetResource(fleetResourceId); + + // get the collection of this FleetspaceResource + FleetspaceCollection collection = fleet.GetFleetspaces(); + + // invoke the operation + string fleetspaceName = "primary-space"; + NullableResponse response = await collection.GetIfExistsAsync(fleetspaceName); + FleetspaceResource 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 + FleetspaceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + } +} diff --git a/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/samples/Generated/Samples/Sample_FleetspaceResource.cs b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/samples/Generated/Samples/Sample_FleetspaceResource.cs new file mode 100644 index 000000000000..210b86120dc8 --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/samples/Generated/Samples/Sample_FleetspaceResource.cs @@ -0,0 +1,186 @@ +// 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.DatabaseFleetManager.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.DatabaseFleetManager.Samples +{ + public partial class Sample_FleetspaceResource + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_FleetspacesGetMaximumSetGenGeneratedByMaximumSetRule() + { + // Generated from example definition: 2025-02-01-preview/Fleetspaces_Get_MaximumSet_Gen.json + // this example is just showing the usage of "Fleetspace_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 FleetspaceResource created on azure + // for more information of creating FleetspaceResource, please refer to the document of FleetspaceResource + string subscriptionId = "C3897315-3847-4D8A-B2FC-7307B066AD63"; + string resourceGroupName = "rgdatabasefleetmanager"; + string fleetName = "production-fleet"; + string fleetspaceName = "primary-space"; + ResourceIdentifier fleetspaceResourceId = FleetspaceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fleetName, fleetspaceName); + FleetspaceResource fleetspace = client.GetFleetspaceResource(fleetspaceResourceId); + + // invoke the operation + FleetspaceResource result = await fleetspace.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 + FleetspaceData 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_FleetspacesDeleteMaximumSetGenGeneratedByMaximumSetRule() + { + // Generated from example definition: 2025-02-01-preview/Fleetspaces_Delete_MaximumSet_Gen.json + // this example is just showing the usage of "Fleetspace_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 FleetspaceResource created on azure + // for more information of creating FleetspaceResource, please refer to the document of FleetspaceResource + string subscriptionId = "C3897315-3847-4D8A-B2FC-7307B066AD63"; + string resourceGroupName = "rgdatabasefleetmanager"; + string fleetName = "production-fleet"; + string fleetspaceName = "primary-space"; + ResourceIdentifier fleetspaceResourceId = FleetspaceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fleetName, fleetspaceName); + FleetspaceResource fleetspace = client.GetFleetspaceResource(fleetspaceResourceId); + + // invoke the operation + await fleetspace.DeleteAsync(WaitUntil.Completed); + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Update_FleetspacesUpdateMaximumSetGenGeneratedByMaximumSetRule() + { + // Generated from example definition: 2025-02-01-preview/Fleetspaces_Update_MaximumSet_Gen.json + // this example is just showing the usage of "Fleetspace_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 FleetspaceResource created on azure + // for more information of creating FleetspaceResource, please refer to the document of FleetspaceResource + string subscriptionId = "C3897315-3847-4D8A-B2FC-7307B066AD63"; + string resourceGroupName = "rg-database-fleet-manager"; + string fleetName = "production-fleet"; + string fleetspaceName = "primary-space"; + ResourceIdentifier fleetspaceResourceId = FleetspaceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fleetName, fleetspaceName); + FleetspaceResource fleetspace = client.GetFleetspaceResource(fleetspaceResourceId); + + // invoke the operation + FleetspaceData data = new FleetspaceData + { + Properties = new FleetspaceProperties + { + CapacityMax = 150000, + MainPrincipal = new MainPrincipal + { + Login = "adminUser", + ApplicationId = Guid.Parse("d2d8b19e-c4f7-4c62-8e8d-7f0f96d94e39"), + ObjectId = Guid.Parse("f8b7c2d3-b9c4-4f3b-85cd-3d56c6e49f92"), + TenantId = Guid.Parse("bde45d44-ec42-45b8-a5a2-c5b998c65ef6"), + PrincipalType = PrincipalType.Application, + }, + }, + }; + ArmOperation lro = await fleetspace.UpdateAsync(WaitUntil.Completed, data); + FleetspaceResource 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 + FleetspaceData 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 RegisterServer_FleetspacesRegisterServerMaximumSetGenGeneratedByMaximumSetRule() + { + // Generated from example definition: 2025-02-01-preview/Fleetspaces_RegisterServer_MaximumSet_Gen.json + // this example is just showing the usage of "Fleetspaces_RegisterServer" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details 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 FleetspaceResource created on azure + // for more information of creating FleetspaceResource, please refer to the document of FleetspaceResource + string subscriptionId = "C3897315-3847-4D8A-B2FC-7307B066AD63"; + string resourceGroupName = "rg-database-fleet-manager"; + string fleetName = "production-fleet"; + string fleetspaceName = "primary-space"; + ResourceIdentifier fleetspaceResourceId = FleetspaceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fleetName, fleetspaceName); + FleetspaceResource fleetspace = client.GetFleetspaceResource(fleetspaceResourceId); + + // invoke the operation + RegisterServerProperties body = new RegisterServerProperties + { + TierName = "Standard", + SourceSubscriptionId = "c76e2b32-46c7-4325-8f4f-476828a5b207", + SourceResourceGroupName = "rg-source-database", + SourceServerName = "source-db-server-prod", + DestinationTierOverrides = { new DestinationTierOverride(Models.ResourceType.Database, "bronze", "source-db-prod") }, + }; + await fleetspace.RegisterServerAsync(WaitUntil.Completed, body); + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Unregister_FleetspacesUnregisterMaximumSetGenGeneratedByMaximumSetRule() + { + // Generated from example definition: 2025-02-01-preview/Fleetspaces_Unregister_MaximumSet_Gen.json + // this example is just showing the usage of "Fleetspaces_Unregister" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details 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 FleetspaceResource created on azure + // for more information of creating FleetspaceResource, please refer to the document of FleetspaceResource + string subscriptionId = "C3897315-3847-4D8A-B2FC-7307B066AD63"; + string resourceGroupName = "rg-database-fleet-manager"; + string fleetName = "production-fleet"; + string fleetspaceName = "primary-space"; + ResourceIdentifier fleetspaceResourceId = FleetspaceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fleetName, fleetspaceName); + FleetspaceResource fleetspace = client.GetFleetspaceResource(fleetspaceResourceId); + + // invoke the operation + await fleetspace.UnregisterAsync(WaitUntil.Completed); + + Console.WriteLine("Succeeded"); + } + } +} diff --git a/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/samples/Generated/Samples/Sample_SubscriptionResourceExtensions.cs b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/samples/Generated/Samples/Sample_SubscriptionResourceExtensions.cs new file mode 100644 index 000000000000..3b8d32d2d723 --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/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.DatabaseFleetManager.Samples +{ + public partial class Sample_SubscriptionResourceExtensions + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetFleets_FleetsListMaximumSetGenGeneratedByMaximumSetRule() + { + // Generated from example definition: 2025-02-01-preview/Fleets_List_MaximumSet_Gen.json + // this example is just showing the usage of "Fleet_List" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this SubscriptionResource created on azure + // for more information of creating SubscriptionResource, please refer to the document of SubscriptionResource + string subscriptionId = "C3897315-3847-4D8A-B2FC-7307B066AD63"; + ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(subscriptionId); + SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId); + + // invoke the operation and iterate over the result + await foreach (FleetResource item in subscriptionResource.GetFleetsAsync()) + { + // 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 + FleetData 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/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Azure.ResourceManager.DatabaseFleetManager.csproj b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Azure.ResourceManager.DatabaseFleetManager.csproj new file mode 100644 index 000000000000..2bb49547d2ac --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Azure.ResourceManager.DatabaseFleetManager.csproj @@ -0,0 +1,8 @@ + + + Azure Resource Manager client SDK for Azure resource provider DatabaseFleetManager. + 1.0.0-beta.1 + azure;management;arm;resource manager;databasefleetmanager + Azure.ResourceManager.DatabaseFleetManager + + diff --git a/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/ArmDatabaseFleetManagerModelFactory.cs b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/ArmDatabaseFleetManagerModelFactory.cs new file mode 100644 index 000000000000..06870703a51a --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/ArmDatabaseFleetManagerModelFactory.cs @@ -0,0 +1,220 @@ +// 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.DatabaseFleetManager.Models +{ + /// Model factory for models. + public static partial class ArmDatabaseFleetManagerModelFactory + { + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// A Fleet tier properties. + /// A new instance for mocking. + public static FleetTierData FleetTierData(ResourceIdentifier id = null, string name = null, Core.ResourceType resourceType = default, SystemData systemData = null, FleetTierProperties properties = null) + { + return new FleetTierData( + id, + name, + resourceType, + systemData, + properties, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// If true, tier is disabled. + /// If true, serverless resources are provisioned in the tier. + /// If true, databases are pooled. + /// Service tier of provisioned resources. Supported values: GeneralPurpose, Hyperscale. + /// Family of provisioned resources, for example Gen5. + /// Capacity of provisioned resources in the tier, in units matching the specified service tier, for example vCore for GeneralPurpose. + /// Maximum number of databases per pool. + /// Number of high availability replicas for databases in this tier. + /// Enable zone redundancy for all databases in this tier. + /// Minimum allocated capacity per database, in units matching the specified service tier. + /// Maximum allocated capacity per database, in units matching the specified service tier. + /// Maximum database size in Gb. + /// Provisioning state. + /// A new instance for mocking. + public static FleetTierProperties FleetTierProperties(bool? disabled = null, bool? serverless = null, bool? pooled = null, string serviceTier = null, string family = null, int? capacity = null, int? poolNumOfDatabasesMax = null, int? highAvailabilityReplicaCount = null, ZoneRedundancy? zoneRedundancy = null, double? databaseCapacityMin = null, double? databaseCapacityMax = null, int? databaseSizeGbMax = null, AzureProvisioningState? provisioningState = null) + { + return new FleetTierProperties( + disabled, + serverless, + pooled, + serviceTier, + family, + capacity, + poolNumOfDatabasesMax, + highAvailabilityReplicaCount, + zoneRedundancy, + databaseCapacityMin, + databaseCapacityMax, + databaseSizeGbMax, + provisioningState, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// A Firewall rule properties. + /// A new instance for mocking. + public static FirewallRuleData FirewallRuleData(ResourceIdentifier id = null, string name = null, Core.ResourceType resourceType = default, SystemData systemData = null, FirewallRuleProperties properties = null) + { + return new FirewallRuleData( + id, + name, + resourceType, + systemData, + properties, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Start IP address. + /// End IP address. + /// Provisioning state. + /// A new instance for mocking. + public static FirewallRuleProperties FirewallRuleProperties(string startIPAddress = null, string endIPAddress = null, AzureProvisioningState? provisioningState = null) + { + return new FirewallRuleProperties(startIPAddress, endIPAddress, provisioningState, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The tags. + /// The location. + /// The fleet properties. + /// A new instance for mocking. + public static FleetData FleetData(ResourceIdentifier id = null, string name = null, Core.ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, FleetProperties properties = null) + { + tags ??= new Dictionary(); + + return new FleetData( + id, + name, + resourceType, + systemData, + tags, + location, + properties, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Fleet description. + /// Provisioning state. + /// A new instance for mocking. + public static FleetProperties FleetProperties(string description = null, AzureProvisioningState? provisioningState = null) + { + return new FleetProperties(description, provisioningState, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// A Fleetspace properties. + /// A new instance for mocking. + public static FleetspaceData FleetspaceData(ResourceIdentifier id = null, string name = null, Core.ResourceType resourceType = default, SystemData systemData = null, FleetspaceProperties properties = null) + { + return new FleetspaceData( + id, + name, + resourceType, + systemData, + properties, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Fleetspace state. + /// Maximum number of vCores database fleet manager is allowed to provision in the fleetspace. + /// Main Microsoft Entra ID principal that has admin access to all databases in the fleetspace. + /// A new instance for mocking. + public static FleetspaceProperties FleetspaceProperties(AzureProvisioningState? provisioningState = null, int? capacityMax = null, MainPrincipal mainPrincipal = null) + { + return new FleetspaceProperties(provisioningState, capacityMax, mainPrincipal, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// Fleet database properties. + /// A new instance for mocking. + public static FleetDatabaseData FleetDatabaseData(ResourceIdentifier id = null, string name = null, Core.ResourceType resourceType = default, SystemData systemData = null, FleetDatabaseProperties properties = null) + { + return new FleetDatabaseData( + id, + name, + resourceType, + systemData, + properties, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Resource identifier for the underlying database resource. + /// Database state. + /// Create mode. Available options: Default - Create a database. Copy - Copy the source database (source database name must be specified) PointInTimeRestore - Create a database by restoring source database from a point in time (source database name and restore from time must be specified). + /// Name of the tier this database belongs to. + /// Connection string to connect to the database with. + /// If true, database is recoverable. + /// Restore from time when CreateMode is PointInTimeRestore. + /// Earliest restore time. + /// Latest restore time. + /// Backup retention in days. + /// Maximum database size in Gb. + /// Source database name used when CreateMode is Copy or PointInTimeRestore. + /// Additional database properties to be applied as the underlying database resource tags. + /// Identity property. + /// Transparent Data Encryption properties. + /// Database collation. + /// A new instance for mocking. + public static FleetDatabaseProperties FleetDatabaseProperties(string originalDatabaseId = null, AzureProvisioningState? provisioningState = null, DatabaseCreateMode? createMode = null, string tierName = null, string connectionString = null, bool? recoverable = null, DateTimeOffset? restoreFromOn = null, DateTimeOffset? earliestRestoreOn = null, DateTimeOffset? latestRestoreOn = null, int? backupRetentionDays = null, int? databaseSizeGbMax = null, string sourceDatabaseName = null, IDictionary resourceTags = null, IdentityProperties identity = null, TransparentDataEncryption transparentDataEncryption = null, string collation = null) + { + resourceTags ??= new Dictionary(); + + return new FleetDatabaseProperties( + originalDatabaseId, + provisioningState, + createMode, + tierName, + connectionString, + recoverable, + restoreFromOn, + earliestRestoreOn, + latestRestoreOn, + backupRetentionDays, + databaseSizeGbMax, + sourceDatabaseName, + resourceTags, + identity, + transparentDataEncryption, + collation, + serializedAdditionalRawData: null); + } + } +} diff --git a/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Extensions/DatabaseFleetManagerExtensions.cs b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Extensions/DatabaseFleetManagerExtensions.cs new file mode 100644 index 000000000000..e89a58848597 --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Extensions/DatabaseFleetManagerExtensions.cs @@ -0,0 +1,295 @@ +// 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.DatabaseFleetManager.Mocking; +using Azure.ResourceManager.Resources; + +namespace Azure.ResourceManager.DatabaseFleetManager +{ + /// A class to add extension methods to Azure.ResourceManager.DatabaseFleetManager. + public static partial class DatabaseFleetManagerExtensions + { + private static MockableDatabaseFleetManagerArmClient GetMockableDatabaseFleetManagerArmClient(ArmClient client) + { + return client.GetCachedClient(client0 => new MockableDatabaseFleetManagerArmClient(client0)); + } + + private static MockableDatabaseFleetManagerResourceGroupResource GetMockableDatabaseFleetManagerResourceGroupResource(ArmResource resource) + { + return resource.GetCachedClient(client => new MockableDatabaseFleetManagerResourceGroupResource(client, resource.Id)); + } + + private static MockableDatabaseFleetManagerSubscriptionResource GetMockableDatabaseFleetManagerSubscriptionResource(ArmResource resource) + { + return resource.GetCachedClient(client => new MockableDatabaseFleetManagerSubscriptionResource(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 FleetDatabaseResource GetFleetDatabaseResource(this ArmClient client, ResourceIdentifier id) + { + Argument.AssertNotNull(client, nameof(client)); + + return GetMockableDatabaseFleetManagerArmClient(client).GetFleetDatabaseResource(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 FleetspaceResource GetFleetspaceResource(this ArmClient client, ResourceIdentifier id) + { + Argument.AssertNotNull(client, nameof(client)); + + return GetMockableDatabaseFleetManagerArmClient(client).GetFleetspaceResource(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 FleetResource GetFleetResource(this ArmClient client, ResourceIdentifier id) + { + Argument.AssertNotNull(client, nameof(client)); + + return GetMockableDatabaseFleetManagerArmClient(client).GetFleetResource(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 FirewallRuleResource GetFirewallRuleResource(this ArmClient client, ResourceIdentifier id) + { + Argument.AssertNotNull(client, nameof(client)); + + return GetMockableDatabaseFleetManagerArmClient(client).GetFirewallRuleResource(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 FleetTierResource GetFleetTierResource(this ArmClient client, ResourceIdentifier id) + { + Argument.AssertNotNull(client, nameof(client)); + + return GetMockableDatabaseFleetManagerArmClient(client).GetFleetTierResource(id); + } + + /// + /// Gets a collection of FleetResources 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 FleetResources and their operations over a FleetResource. + public static FleetCollection GetFleets(this ResourceGroupResource resourceGroupResource) + { + Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource)); + + return GetMockableDatabaseFleetManagerResourceGroupResource(resourceGroupResource).GetFleets(); + } + + /// + /// Gets a fleet resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName} + /// + /// + /// Operation Id + /// Fleet_Get + /// + /// + /// Default Api Version + /// 2025-02-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// Name of the database fleet. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public static async Task> GetFleetAsync(this ResourceGroupResource resourceGroupResource, string fleetName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource)); + + return await GetMockableDatabaseFleetManagerResourceGroupResource(resourceGroupResource).GetFleetAsync(fleetName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets a fleet resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName} + /// + /// + /// Operation Id + /// Fleet_Get + /// + /// + /// Default Api Version + /// 2025-02-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// Name of the database fleet. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public static Response GetFleet(this ResourceGroupResource resourceGroupResource, string fleetName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource)); + + return GetMockableDatabaseFleetManagerResourceGroupResource(resourceGroupResource).GetFleet(fleetName, cancellationToken); + } + + /// + /// Gets all fleets in a subscription. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.DatabaseFleetManager/fleets + /// + /// + /// Operation Id + /// Fleet_List + /// + /// + /// Default Api Version + /// 2025-02-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 GetFleetsAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); + + return GetMockableDatabaseFleetManagerSubscriptionResource(subscriptionResource).GetFleetsAsync(cancellationToken); + } + + /// + /// Gets all fleets in a subscription. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.DatabaseFleetManager/fleets + /// + /// + /// Operation Id + /// Fleet_List + /// + /// + /// Default Api Version + /// 2025-02-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 GetFleets(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); + + return GetMockableDatabaseFleetManagerSubscriptionResource(subscriptionResource).GetFleets(cancellationToken); + } + } +} diff --git a/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Extensions/MockableDatabaseFleetManagerArmClient.cs b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Extensions/MockableDatabaseFleetManagerArmClient.cs new file mode 100644 index 000000000000..c3c91294f345 --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Extensions/MockableDatabaseFleetManagerArmClient.cs @@ -0,0 +1,97 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using Azure.Core; + +namespace Azure.ResourceManager.DatabaseFleetManager.Mocking +{ + /// A class to add extension methods to ArmClient. + public partial class MockableDatabaseFleetManagerArmClient : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected MockableDatabaseFleetManagerArmClient() + { + } + + /// 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 MockableDatabaseFleetManagerArmClient(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + internal MockableDatabaseFleetManagerArmClient(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 FleetDatabaseResource GetFleetDatabaseResource(ResourceIdentifier id) + { + FleetDatabaseResource.ValidateResourceId(id); + return new FleetDatabaseResource(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 FleetspaceResource GetFleetspaceResource(ResourceIdentifier id) + { + FleetspaceResource.ValidateResourceId(id); + return new FleetspaceResource(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 FleetResource GetFleetResource(ResourceIdentifier id) + { + FleetResource.ValidateResourceId(id); + return new FleetResource(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 FirewallRuleResource GetFirewallRuleResource(ResourceIdentifier id) + { + FirewallRuleResource.ValidateResourceId(id); + return new FirewallRuleResource(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 FleetTierResource GetFleetTierResource(ResourceIdentifier id) + { + FleetTierResource.ValidateResourceId(id); + return new FleetTierResource(Client, id); + } + } +} diff --git a/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Extensions/MockableDatabaseFleetManagerResourceGroupResource.cs b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Extensions/MockableDatabaseFleetManagerResourceGroupResource.cs new file mode 100644 index 000000000000..85c1487077ff --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Extensions/MockableDatabaseFleetManagerResourceGroupResource.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.DatabaseFleetManager.Mocking +{ + /// A class to add extension methods to ResourceGroupResource. + public partial class MockableDatabaseFleetManagerResourceGroupResource : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected MockableDatabaseFleetManagerResourceGroupResource() + { + } + + /// 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 MockableDatabaseFleetManagerResourceGroupResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// Gets a collection of FleetResources in the ResourceGroupResource. + /// An object representing collection of FleetResources and their operations over a FleetResource. + public virtual FleetCollection GetFleets() + { + return GetCachedClient(client => new FleetCollection(client, Id)); + } + + /// + /// Gets a fleet resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName} + /// + /// + /// Operation Id + /// Fleet_Get + /// + /// + /// Default Api Version + /// 2025-02-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the database fleet. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetFleetAsync(string fleetName, CancellationToken cancellationToken = default) + { + return await GetFleets().GetAsync(fleetName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets a fleet resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName} + /// + /// + /// Operation Id + /// Fleet_Get + /// + /// + /// Default Api Version + /// 2025-02-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the database fleet. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetFleet(string fleetName, CancellationToken cancellationToken = default) + { + return GetFleets().Get(fleetName, cancellationToken); + } + } +} diff --git a/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Extensions/MockableDatabaseFleetManagerSubscriptionResource.cs b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Extensions/MockableDatabaseFleetManagerSubscriptionResource.cs new file mode 100644 index 000000000000..d5e0e2001ef8 --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Extensions/MockableDatabaseFleetManagerSubscriptionResource.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.DatabaseFleetManager.Mocking +{ + /// A class to add extension methods to SubscriptionResource. + public partial class MockableDatabaseFleetManagerSubscriptionResource : ArmResource + { + private ClientDiagnostics _fleetClientDiagnostics; + private FleetsRestOperations _fleetRestClient; + + /// Initializes a new instance of the class for mocking. + protected MockableDatabaseFleetManagerSubscriptionResource() + { + } + + /// 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 MockableDatabaseFleetManagerSubscriptionResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + private ClientDiagnostics FleetClientDiagnostics => _fleetClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.DatabaseFleetManager", FleetResource.ResourceType.Namespace, Diagnostics); + private FleetsRestOperations FleetRestClient => _fleetRestClient ??= new FleetsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, GetApiVersionOrNull(FleetResource.ResourceType)); + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// + /// Gets all fleets in a subscription. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.DatabaseFleetManager/fleets + /// + /// + /// Operation Id + /// Fleet_List + /// + /// + /// Default Api Version + /// 2025-02-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetFleetsAsync(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => FleetRestClient.CreateListRequest(Id.SubscriptionId); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => FleetRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new FleetResource(Client, FleetData.DeserializeFleetData(e)), FleetClientDiagnostics, Pipeline, "MockableDatabaseFleetManagerSubscriptionResource.GetFleets", "value", "nextLink", cancellationToken); + } + + /// + /// Gets all fleets in a subscription. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.DatabaseFleetManager/fleets + /// + /// + /// Operation Id + /// Fleet_List + /// + /// + /// Default Api Version + /// 2025-02-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetFleets(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => FleetRestClient.CreateListRequest(Id.SubscriptionId); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => FleetRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new FleetResource(Client, FleetData.DeserializeFleetData(e)), FleetClientDiagnostics, Pipeline, "MockableDatabaseFleetManagerSubscriptionResource.GetFleets", "value", "nextLink", cancellationToken); + } + } +} diff --git a/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/FirewallRuleCollection.cs b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/FirewallRuleCollection.cs new file mode 100644 index 000000000000..bf8f48feaf7f --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/FirewallRuleCollection.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.DatabaseFleetManager +{ + /// + /// 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 GetFirewallRules method from an instance of . + /// + public partial class FirewallRuleCollection : ArmCollection, IEnumerable, IAsyncEnumerable + { + private readonly ClientDiagnostics _firewallRuleClientDiagnostics; + private readonly FirewallRulesRestOperations _firewallRuleRestClient; + + /// Initializes a new instance of the class for mocking. + protected FirewallRuleCollection() + { + } + + /// 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 FirewallRuleCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _firewallRuleClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.DatabaseFleetManager", FirewallRuleResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(FirewallRuleResource.ResourceType, out string firewallRuleApiVersion); + _firewallRuleRestClient = new FirewallRulesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, firewallRuleApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != FleetspaceResource.ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, FleetspaceResource.ResourceType), nameof(id)); + } + + /// + /// Creates or updates a firewall rule. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName}/fleetspaces/{fleetspaceName}/firewallRules/{firewallRuleName} + /// + /// + /// Operation Id + /// FirewallRule_CreateOrUpdate + /// + /// + /// Default Api Version + /// 2025-02-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 firewall rule. + /// The firewall rule object to create or update. + /// 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 firewallRuleName, FirewallRuleData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(firewallRuleName, nameof(firewallRuleName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _firewallRuleClientDiagnostics.CreateScope("FirewallRuleCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = await _firewallRuleRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, firewallRuleName, data, cancellationToken).ConfigureAwait(false); + var operation = new DatabaseFleetManagerArmOperation(new FirewallRuleOperationSource(Client), _firewallRuleClientDiagnostics, Pipeline, _firewallRuleRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, firewallRuleName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Creates or updates a firewall rule. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName}/fleetspaces/{fleetspaceName}/firewallRules/{firewallRuleName} + /// + /// + /// Operation Id + /// FirewallRule_CreateOrUpdate + /// + /// + /// Default Api Version + /// 2025-02-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 firewall rule. + /// The firewall rule object to create or update. + /// 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 firewallRuleName, FirewallRuleData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(firewallRuleName, nameof(firewallRuleName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _firewallRuleClientDiagnostics.CreateScope("FirewallRuleCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = _firewallRuleRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, firewallRuleName, data, cancellationToken); + var operation = new DatabaseFleetManagerArmOperation(new FirewallRuleOperationSource(Client), _firewallRuleClientDiagnostics, Pipeline, _firewallRuleRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, firewallRuleName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets a firewall rule. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName}/fleetspaces/{fleetspaceName}/firewallRules/{firewallRuleName} + /// + /// + /// Operation Id + /// FirewallRule_Get + /// + /// + /// Default Api Version + /// 2025-02-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the firewall rule. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetAsync(string firewallRuleName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(firewallRuleName, nameof(firewallRuleName)); + + using var scope = _firewallRuleClientDiagnostics.CreateScope("FirewallRuleCollection.Get"); + scope.Start(); + try + { + var response = await _firewallRuleRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, firewallRuleName, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new FirewallRuleResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets a firewall rule. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName}/fleetspaces/{fleetspaceName}/firewallRules/{firewallRuleName} + /// + /// + /// Operation Id + /// FirewallRule_Get + /// + /// + /// Default Api Version + /// 2025-02-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the firewall rule. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Get(string firewallRuleName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(firewallRuleName, nameof(firewallRuleName)); + + using var scope = _firewallRuleClientDiagnostics.CreateScope("FirewallRuleCollection.Get"); + scope.Start(); + try + { + var response = _firewallRuleRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, firewallRuleName, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new FirewallRuleResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets all firewall rules in a fleetspace. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName}/fleetspaces/{fleetspaceName}/firewallRules + /// + /// + /// Operation Id + /// FirewallRule_ListByFleetspace + /// + /// + /// Default Api Version + /// 2025-02-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The number of elements in the collection to skip. + /// The number of elements to return from the collection. + /// An opaque token that identifies a starting point in the collection. + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetAllAsync(long? skip = null, long? top = null, string skiptoken = null, CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _firewallRuleRestClient.CreateListByFleetspaceRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, skip, top, skiptoken); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _firewallRuleRestClient.CreateListByFleetspaceNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, skip, top, skiptoken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new FirewallRuleResource(Client, FirewallRuleData.DeserializeFirewallRuleData(e)), _firewallRuleClientDiagnostics, Pipeline, "FirewallRuleCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Gets all firewall rules in a fleetspace. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName}/fleetspaces/{fleetspaceName}/firewallRules + /// + /// + /// Operation Id + /// FirewallRule_ListByFleetspace + /// + /// + /// Default Api Version + /// 2025-02-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The number of elements in the collection to skip. + /// The number of elements to return from the collection. + /// An opaque token that identifies a starting point in the collection. + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetAll(long? skip = null, long? top = null, string skiptoken = null, CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _firewallRuleRestClient.CreateListByFleetspaceRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, skip, top, skiptoken); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _firewallRuleRestClient.CreateListByFleetspaceNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, skip, top, skiptoken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new FirewallRuleResource(Client, FirewallRuleData.DeserializeFirewallRuleData(e)), _firewallRuleClientDiagnostics, Pipeline, "FirewallRuleCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName}/fleetspaces/{fleetspaceName}/firewallRules/{firewallRuleName} + /// + /// + /// Operation Id + /// FirewallRule_Get + /// + /// + /// Default Api Version + /// 2025-02-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the firewall rule. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> ExistsAsync(string firewallRuleName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(firewallRuleName, nameof(firewallRuleName)); + + using var scope = _firewallRuleClientDiagnostics.CreateScope("FirewallRuleCollection.Exists"); + scope.Start(); + try + { + var response = await _firewallRuleRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, firewallRuleName, 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.DatabaseFleetManager/fleets/{fleetName}/fleetspaces/{fleetspaceName}/firewallRules/{firewallRuleName} + /// + /// + /// Operation Id + /// FirewallRule_Get + /// + /// + /// Default Api Version + /// 2025-02-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the firewall rule. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Exists(string firewallRuleName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(firewallRuleName, nameof(firewallRuleName)); + + using var scope = _firewallRuleClientDiagnostics.CreateScope("FirewallRuleCollection.Exists"); + scope.Start(); + try + { + var response = _firewallRuleRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, firewallRuleName, 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.DatabaseFleetManager/fleets/{fleetName}/fleetspaces/{fleetspaceName}/firewallRules/{firewallRuleName} + /// + /// + /// Operation Id + /// FirewallRule_Get + /// + /// + /// Default Api Version + /// 2025-02-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the firewall rule. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetIfExistsAsync(string firewallRuleName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(firewallRuleName, nameof(firewallRuleName)); + + using var scope = _firewallRuleClientDiagnostics.CreateScope("FirewallRuleCollection.GetIfExists"); + scope.Start(); + try + { + var response = await _firewallRuleRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, firewallRuleName, cancellationToken: cancellationToken).ConfigureAwait(false); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new FirewallRuleResource(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.DatabaseFleetManager/fleets/{fleetName}/fleetspaces/{fleetspaceName}/firewallRules/{firewallRuleName} + /// + /// + /// Operation Id + /// FirewallRule_Get + /// + /// + /// Default Api Version + /// 2025-02-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the firewall rule. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual NullableResponse GetIfExists(string firewallRuleName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(firewallRuleName, nameof(firewallRuleName)); + + using var scope = _firewallRuleClientDiagnostics.CreateScope("FirewallRuleCollection.GetIfExists"); + scope.Start(); + try + { + var response = _firewallRuleRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, firewallRuleName, cancellationToken: cancellationToken); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new FirewallRuleResource(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/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/FirewallRuleData.Serialization.cs b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/FirewallRuleData.Serialization.cs new file mode 100644 index 000000000000..b132b4bd6c89 --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/FirewallRuleData.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.DatabaseFleetManager.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.DatabaseFleetManager +{ + public partial class FirewallRuleData : 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(FirewallRuleData)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (Optional.IsDefined(Properties)) + { + writer.WritePropertyName("properties"u8); + writer.WriteObjectValue(Properties, options); + } + } + + FirewallRuleData 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(FirewallRuleData)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeFirewallRuleData(document.RootElement, options); + } + + internal static FirewallRuleData DeserializeFirewallRuleData(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + FirewallRuleProperties properties = default; + ResourceIdentifier id = default; + string name = default; + Core.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 = FirewallRuleProperties.DeserializeFirewallRuleProperties(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 Core.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 FirewallRuleData( + 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(FirewallRuleData)} does not support writing '{options.Format}' format."); + } + } + + FirewallRuleData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeFirewallRuleData(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(FirewallRuleData)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/FirewallRuleData.cs b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/FirewallRuleData.cs new file mode 100644 index 000000000000..6138a49804b9 --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/FirewallRuleData.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.DatabaseFleetManager.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.DatabaseFleetManager +{ + /// + /// A class representing the FirewallRule data model. + /// A firewall rule. + /// + public partial class FirewallRuleData : 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 FirewallRuleData() + { + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// A Firewall rule properties. + /// Keeps track of any properties unknown to the library. + internal FirewallRuleData(ResourceIdentifier id, string name, Core.ResourceType resourceType, SystemData systemData, FirewallRuleProperties properties, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) + { + Properties = properties; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// A Firewall rule properties. + public FirewallRuleProperties Properties { get; set; } + } +} diff --git a/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/FirewallRuleResource.Serialization.cs b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/FirewallRuleResource.Serialization.cs new file mode 100644 index 000000000000..57847384327f --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/FirewallRuleResource.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.DatabaseFleetManager +{ + public partial class FirewallRuleResource : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); + + FirewallRuleData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options); + + FirewallRuleData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options); + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); + } +} diff --git a/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/FirewallRuleResource.cs b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/FirewallRuleResource.cs new file mode 100644 index 000000000000..8486d098a7b3 --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/FirewallRuleResource.cs @@ -0,0 +1,348 @@ +// 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.DatabaseFleetManager +{ + /// + /// A Class representing a FirewallRule 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 GetFirewallRuleResource method. + /// Otherwise you can get one from its parent resource using the GetFirewallRule method. + /// + public partial class FirewallRuleResource : ArmResource + { + /// Generate the resource identifier of a instance. + /// The subscriptionId. + /// The resourceGroupName. + /// The fleetName. + /// The fleetspaceName. + /// The firewallRuleName. + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string fleetName, string fleetspaceName, string firewallRuleName) + { + var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName}/fleetspaces/{fleetspaceName}/firewallRules/{firewallRuleName}"; + return new ResourceIdentifier(resourceId); + } + + private readonly ClientDiagnostics _firewallRuleClientDiagnostics; + private readonly FirewallRulesRestOperations _firewallRuleRestClient; + private readonly FirewallRuleData _data; + + /// Gets the resource type for the operations. + public static readonly ResourceType ResourceType = "Microsoft.DatabaseFleetManager/fleets/fleetspaces/firewallRules"; + + /// Initializes a new instance of the class for mocking. + protected FirewallRuleResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal FirewallRuleResource(ArmClient client, FirewallRuleData 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 FirewallRuleResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _firewallRuleClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.DatabaseFleetManager", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string firewallRuleApiVersion); + _firewallRuleRestClient = new FirewallRulesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, firewallRuleApiVersion); +#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 FirewallRuleData 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)); + } + + /// + /// Gets a firewall rule. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName}/fleetspaces/{fleetspaceName}/firewallRules/{firewallRuleName} + /// + /// + /// Operation Id + /// FirewallRule_Get + /// + /// + /// Default Api Version + /// 2025-02-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _firewallRuleClientDiagnostics.CreateScope("FirewallRuleResource.Get"); + scope.Start(); + try + { + var response = await _firewallRuleRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new FirewallRuleResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets a firewall rule. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName}/fleetspaces/{fleetspaceName}/firewallRules/{firewallRuleName} + /// + /// + /// Operation Id + /// FirewallRule_Get + /// + /// + /// Default Api Version + /// 2025-02-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _firewallRuleClientDiagnostics.CreateScope("FirewallRuleResource.Get"); + scope.Start(); + try + { + var response = _firewallRuleRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new FirewallRuleResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Deletes a firewall rule. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName}/fleetspaces/{fleetspaceName}/firewallRules/{firewallRuleName} + /// + /// + /// Operation Id + /// FirewallRule_Delete + /// + /// + /// Default Api Version + /// 2025-02-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 = _firewallRuleClientDiagnostics.CreateScope("FirewallRuleResource.Delete"); + scope.Start(); + try + { + var response = await _firewallRuleRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + var operation = new DatabaseFleetManagerArmOperation(_firewallRuleClientDiagnostics, Pipeline, _firewallRuleRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Deletes a firewall rule. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName}/fleetspaces/{fleetspaceName}/firewallRules/{firewallRuleName} + /// + /// + /// Operation Id + /// FirewallRule_Delete + /// + /// + /// Default Api Version + /// 2025-02-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 = _firewallRuleClientDiagnostics.CreateScope("FirewallRuleResource.Delete"); + scope.Start(); + try + { + var response = _firewallRuleRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken); + var operation = new DatabaseFleetManagerArmOperation(_firewallRuleClientDiagnostics, Pipeline, _firewallRuleRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletionResponse(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Creates or updates a firewall rule. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName}/fleetspaces/{fleetspaceName}/firewallRules/{firewallRuleName} + /// + /// + /// Operation Id + /// FirewallRule_CreateOrUpdate + /// + /// + /// Default Api Version + /// 2025-02-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 firewall rule object to create or update. + /// The cancellation token to use. + /// is null. + public virtual async Task> UpdateAsync(WaitUntil waitUntil, FirewallRuleData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _firewallRuleClientDiagnostics.CreateScope("FirewallRuleResource.Update"); + scope.Start(); + try + { + var response = await _firewallRuleRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, data, cancellationToken).ConfigureAwait(false); + var operation = new DatabaseFleetManagerArmOperation(new FirewallRuleOperationSource(Client), _firewallRuleClientDiagnostics, Pipeline, _firewallRuleRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Creates or updates a firewall rule. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName}/fleetspaces/{fleetspaceName}/firewallRules/{firewallRuleName} + /// + /// + /// Operation Id + /// FirewallRule_CreateOrUpdate + /// + /// + /// Default Api Version + /// 2025-02-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 firewall rule object to create or update. + /// The cancellation token to use. + /// is null. + public virtual ArmOperation Update(WaitUntil waitUntil, FirewallRuleData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _firewallRuleClientDiagnostics.CreateScope("FirewallRuleResource.Update"); + scope.Start(); + try + { + var response = _firewallRuleRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, data, cancellationToken); + var operation = new DatabaseFleetManagerArmOperation(new FirewallRuleOperationSource(Client), _firewallRuleClientDiagnostics, Pipeline, _firewallRuleRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/FleetCollection.cs b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/FleetCollection.cs new file mode 100644 index 000000000000..1657d527cedd --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/FleetCollection.cs @@ -0,0 +1,500 @@ +// 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.DatabaseFleetManager +{ + /// + /// 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 GetFleets method from an instance of . + /// + public partial class FleetCollection : ArmCollection, IEnumerable, IAsyncEnumerable + { + private readonly ClientDiagnostics _fleetClientDiagnostics; + private readonly FleetsRestOperations _fleetRestClient; + + /// Initializes a new instance of the class for mocking. + protected FleetCollection() + { + } + + /// 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 FleetCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _fleetClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.DatabaseFleetManager", FleetResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(FleetResource.ResourceType, out string fleetApiVersion); + _fleetRestClient = new FleetsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, fleetApiVersion); +#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)); + } + + /// + /// Creates or updates a fleet resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName} + /// + /// + /// Operation Id + /// Fleet_CreateOrUpdate + /// + /// + /// Default Api Version + /// 2025-02-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 database fleet. + /// The fleet object to create or update. + /// 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 fleetName, FleetData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _fleetClientDiagnostics.CreateScope("FleetCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = await _fleetRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, fleetName, data, cancellationToken).ConfigureAwait(false); + var operation = new DatabaseFleetManagerArmOperation(new FleetOperationSource(Client), _fleetClientDiagnostics, Pipeline, _fleetRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, fleetName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Creates or updates a fleet resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName} + /// + /// + /// Operation Id + /// Fleet_CreateOrUpdate + /// + /// + /// Default Api Version + /// 2025-02-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 database fleet. + /// The fleet object to create or update. + /// 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 fleetName, FleetData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _fleetClientDiagnostics.CreateScope("FleetCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = _fleetRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, fleetName, data, cancellationToken); + var operation = new DatabaseFleetManagerArmOperation(new FleetOperationSource(Client), _fleetClientDiagnostics, Pipeline, _fleetRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, fleetName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets a fleet resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName} + /// + /// + /// Operation Id + /// Fleet_Get + /// + /// + /// Default Api Version + /// 2025-02-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the database fleet. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetAsync(string fleetName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + + using var scope = _fleetClientDiagnostics.CreateScope("FleetCollection.Get"); + scope.Start(); + try + { + var response = await _fleetRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, fleetName, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new FleetResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets a fleet resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName} + /// + /// + /// Operation Id + /// Fleet_Get + /// + /// + /// Default Api Version + /// 2025-02-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the database fleet. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Get(string fleetName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + + using var scope = _fleetClientDiagnostics.CreateScope("FleetCollection.Get"); + scope.Start(); + try + { + var response = _fleetRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, fleetName, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new FleetResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets all fleets in a resource group. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets + /// + /// + /// Operation Id + /// Fleet_ListByResourceGroup + /// + /// + /// Default Api Version + /// 2025-02-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The number of elements in the collection to skip. + /// The number of elements to return from the collection. + /// An opaque token that identifies a starting point in the collection. + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetAllAsync(long? skip = null, long? top = null, string skiptoken = null, CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _fleetRestClient.CreateListByResourceGroupRequest(Id.SubscriptionId, Id.ResourceGroupName, skip, top, skiptoken); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _fleetRestClient.CreateListByResourceGroupNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, skip, top, skiptoken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new FleetResource(Client, FleetData.DeserializeFleetData(e)), _fleetClientDiagnostics, Pipeline, "FleetCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Gets all fleets in a resource group. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets + /// + /// + /// Operation Id + /// Fleet_ListByResourceGroup + /// + /// + /// Default Api Version + /// 2025-02-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The number of elements in the collection to skip. + /// The number of elements to return from the collection. + /// An opaque token that identifies a starting point in the collection. + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetAll(long? skip = null, long? top = null, string skiptoken = null, CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _fleetRestClient.CreateListByResourceGroupRequest(Id.SubscriptionId, Id.ResourceGroupName, skip, top, skiptoken); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _fleetRestClient.CreateListByResourceGroupNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, skip, top, skiptoken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new FleetResource(Client, FleetData.DeserializeFleetData(e)), _fleetClientDiagnostics, Pipeline, "FleetCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName} + /// + /// + /// Operation Id + /// Fleet_Get + /// + /// + /// Default Api Version + /// 2025-02-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the database fleet. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> ExistsAsync(string fleetName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + + using var scope = _fleetClientDiagnostics.CreateScope("FleetCollection.Exists"); + scope.Start(); + try + { + var response = await _fleetRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, fleetName, 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.DatabaseFleetManager/fleets/{fleetName} + /// + /// + /// Operation Id + /// Fleet_Get + /// + /// + /// Default Api Version + /// 2025-02-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the database fleet. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Exists(string fleetName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + + using var scope = _fleetClientDiagnostics.CreateScope("FleetCollection.Exists"); + scope.Start(); + try + { + var response = _fleetRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, fleetName, 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.DatabaseFleetManager/fleets/{fleetName} + /// + /// + /// Operation Id + /// Fleet_Get + /// + /// + /// Default Api Version + /// 2025-02-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the database fleet. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetIfExistsAsync(string fleetName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + + using var scope = _fleetClientDiagnostics.CreateScope("FleetCollection.GetIfExists"); + scope.Start(); + try + { + var response = await _fleetRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, fleetName, cancellationToken: cancellationToken).ConfigureAwait(false); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new FleetResource(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.DatabaseFleetManager/fleets/{fleetName} + /// + /// + /// Operation Id + /// Fleet_Get + /// + /// + /// Default Api Version + /// 2025-02-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the database fleet. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual NullableResponse GetIfExists(string fleetName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + + using var scope = _fleetClientDiagnostics.CreateScope("FleetCollection.GetIfExists"); + scope.Start(); + try + { + var response = _fleetRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, fleetName, cancellationToken: cancellationToken); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new FleetResource(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/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/FleetData.Serialization.cs b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/FleetData.Serialization.cs new file mode 100644 index 000000000000..18e66479c23c --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/FleetData.Serialization.cs @@ -0,0 +1,178 @@ +// 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.DatabaseFleetManager.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.DatabaseFleetManager +{ + public partial class FleetData : 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(FleetData)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (Optional.IsDefined(Properties)) + { + writer.WritePropertyName("properties"u8); + writer.WriteObjectValue(Properties, options); + } + } + + FleetData 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(FleetData)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeFleetData(document.RootElement, options); + } + + internal static FleetData DeserializeFleetData(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + FleetProperties properties = default; + IDictionary tags = default; + AzureLocation location = default; + ResourceIdentifier id = default; + string name = default; + Core.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 = FleetProperties.DeserializeFleetProperties(property.Value, options); + 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 Core.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 FleetData( + id, + name, + type, + systemData, + tags ?? new ChangeTrackingDictionary(), + location, + 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(FleetData)} does not support writing '{options.Format}' format."); + } + } + + FleetData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeFleetData(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(FleetData)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/FleetData.cs b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/FleetData.cs new file mode 100644 index 000000000000..b104bd126dd7 --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/FleetData.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.DatabaseFleetManager.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.DatabaseFleetManager +{ + /// + /// A class representing the Fleet data model. + /// A Database Fleet. + /// + public partial class FleetData : 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 FleetData(AzureLocation location) : base(location) + { + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The tags. + /// The location. + /// The fleet properties. + /// Keeps track of any properties unknown to the library. + internal FleetData(ResourceIdentifier id, string name, Core.ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, FleetProperties properties, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) + { + Properties = properties; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal FleetData() + { + } + + /// The fleet properties. + public FleetProperties Properties { get; set; } + } +} diff --git a/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/FleetDatabaseCollection.cs b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/FleetDatabaseCollection.cs new file mode 100644 index 000000000000..dec216d79917 --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/FleetDatabaseCollection.cs @@ -0,0 +1,501 @@ +// 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.DatabaseFleetManager +{ + /// + /// 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 GetFleetDatabases method from an instance of . + /// + public partial class FleetDatabaseCollection : ArmCollection, IEnumerable, IAsyncEnumerable + { + private readonly ClientDiagnostics _fleetDatabaseClientDiagnostics; + private readonly FleetDatabasesRestOperations _fleetDatabaseRestClient; + + /// Initializes a new instance of the class for mocking. + protected FleetDatabaseCollection() + { + } + + /// 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 FleetDatabaseCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _fleetDatabaseClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.DatabaseFleetManager", FleetDatabaseResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(FleetDatabaseResource.ResourceType, out string fleetDatabaseApiVersion); + _fleetDatabaseRestClient = new FleetDatabasesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, fleetDatabaseApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != FleetspaceResource.ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, FleetspaceResource.ResourceType), nameof(id)); + } + + /// + /// Creates or updates a fleet database. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName}/fleetspaces/{fleetspaceName}/databases/{databaseName} + /// + /// + /// Operation Id + /// FleetDatabase_CreateOrUpdate + /// + /// + /// Default Api Version + /// 2025-02-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 database. + /// The database object to create or update. + /// 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 databaseName, FleetDatabaseData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(databaseName, nameof(databaseName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _fleetDatabaseClientDiagnostics.CreateScope("FleetDatabaseCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = await _fleetDatabaseRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, databaseName, data, cancellationToken).ConfigureAwait(false); + var operation = new DatabaseFleetManagerArmOperation(new FleetDatabaseOperationSource(Client), _fleetDatabaseClientDiagnostics, Pipeline, _fleetDatabaseRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, databaseName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Creates or updates a fleet database. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName}/fleetspaces/{fleetspaceName}/databases/{databaseName} + /// + /// + /// Operation Id + /// FleetDatabase_CreateOrUpdate + /// + /// + /// Default Api Version + /// 2025-02-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 database. + /// The database object to create or update. + /// 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 databaseName, FleetDatabaseData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(databaseName, nameof(databaseName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _fleetDatabaseClientDiagnostics.CreateScope("FleetDatabaseCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = _fleetDatabaseRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, databaseName, data, cancellationToken); + var operation = new DatabaseFleetManagerArmOperation(new FleetDatabaseOperationSource(Client), _fleetDatabaseClientDiagnostics, Pipeline, _fleetDatabaseRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, databaseName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets a fleet database. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName}/fleetspaces/{fleetspaceName}/databases/{databaseName} + /// + /// + /// Operation Id + /// FleetDatabase_Get + /// + /// + /// Default Api Version + /// 2025-02-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the database. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetAsync(string databaseName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(databaseName, nameof(databaseName)); + + using var scope = _fleetDatabaseClientDiagnostics.CreateScope("FleetDatabaseCollection.Get"); + scope.Start(); + try + { + var response = await _fleetDatabaseRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, databaseName, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new FleetDatabaseResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets a fleet database. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName}/fleetspaces/{fleetspaceName}/databases/{databaseName} + /// + /// + /// Operation Id + /// FleetDatabase_Get + /// + /// + /// Default Api Version + /// 2025-02-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the database. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Get(string databaseName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(databaseName, nameof(databaseName)); + + using var scope = _fleetDatabaseClientDiagnostics.CreateScope("FleetDatabaseCollection.Get"); + scope.Start(); + try + { + var response = _fleetDatabaseRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, databaseName, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new FleetDatabaseResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets all fleet databases in a fleetspace. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName}/fleetspaces/{fleetspaceName}/databases + /// + /// + /// Operation Id + /// FleetDatabase_ListByFleetspace + /// + /// + /// Default Api Version + /// 2025-02-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The number of elements in the collection to skip. + /// The number of elements to return from the collection. + /// An OData filter expression that filters elements in the collection. + /// An opaque token that identifies a starting point in the collection. + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetAllAsync(long? skip = null, long? top = null, string filter = null, string skiptoken = null, CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _fleetDatabaseRestClient.CreateListByFleetspaceRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, skip, top, filter, skiptoken); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _fleetDatabaseRestClient.CreateListByFleetspaceNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, skip, top, filter, skiptoken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new FleetDatabaseResource(Client, FleetDatabaseData.DeserializeFleetDatabaseData(e)), _fleetDatabaseClientDiagnostics, Pipeline, "FleetDatabaseCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Gets all fleet databases in a fleetspace. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName}/fleetspaces/{fleetspaceName}/databases + /// + /// + /// Operation Id + /// FleetDatabase_ListByFleetspace + /// + /// + /// Default Api Version + /// 2025-02-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The number of elements in the collection to skip. + /// The number of elements to return from the collection. + /// An OData filter expression that filters elements in the collection. + /// An opaque token that identifies a starting point in the collection. + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetAll(long? skip = null, long? top = null, string filter = null, string skiptoken = null, CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _fleetDatabaseRestClient.CreateListByFleetspaceRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, skip, top, filter, skiptoken); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _fleetDatabaseRestClient.CreateListByFleetspaceNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, skip, top, filter, skiptoken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new FleetDatabaseResource(Client, FleetDatabaseData.DeserializeFleetDatabaseData(e)), _fleetDatabaseClientDiagnostics, Pipeline, "FleetDatabaseCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName}/fleetspaces/{fleetspaceName}/databases/{databaseName} + /// + /// + /// Operation Id + /// FleetDatabase_Get + /// + /// + /// Default Api Version + /// 2025-02-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the database. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> ExistsAsync(string databaseName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(databaseName, nameof(databaseName)); + + using var scope = _fleetDatabaseClientDiagnostics.CreateScope("FleetDatabaseCollection.Exists"); + scope.Start(); + try + { + var response = await _fleetDatabaseRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, databaseName, 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.DatabaseFleetManager/fleets/{fleetName}/fleetspaces/{fleetspaceName}/databases/{databaseName} + /// + /// + /// Operation Id + /// FleetDatabase_Get + /// + /// + /// Default Api Version + /// 2025-02-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the database. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Exists(string databaseName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(databaseName, nameof(databaseName)); + + using var scope = _fleetDatabaseClientDiagnostics.CreateScope("FleetDatabaseCollection.Exists"); + scope.Start(); + try + { + var response = _fleetDatabaseRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, databaseName, 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.DatabaseFleetManager/fleets/{fleetName}/fleetspaces/{fleetspaceName}/databases/{databaseName} + /// + /// + /// Operation Id + /// FleetDatabase_Get + /// + /// + /// Default Api Version + /// 2025-02-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the database. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetIfExistsAsync(string databaseName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(databaseName, nameof(databaseName)); + + using var scope = _fleetDatabaseClientDiagnostics.CreateScope("FleetDatabaseCollection.GetIfExists"); + scope.Start(); + try + { + var response = await _fleetDatabaseRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, databaseName, cancellationToken: cancellationToken).ConfigureAwait(false); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new FleetDatabaseResource(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.DatabaseFleetManager/fleets/{fleetName}/fleetspaces/{fleetspaceName}/databases/{databaseName} + /// + /// + /// Operation Id + /// FleetDatabase_Get + /// + /// + /// Default Api Version + /// 2025-02-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the database. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual NullableResponse GetIfExists(string databaseName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(databaseName, nameof(databaseName)); + + using var scope = _fleetDatabaseClientDiagnostics.CreateScope("FleetDatabaseCollection.GetIfExists"); + scope.Start(); + try + { + var response = _fleetDatabaseRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, databaseName, cancellationToken: cancellationToken); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new FleetDatabaseResource(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/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/FleetDatabaseData.Serialization.cs b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/FleetDatabaseData.Serialization.cs new file mode 100644 index 000000000000..3b42db9d418d --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/FleetDatabaseData.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.DatabaseFleetManager.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.DatabaseFleetManager +{ + public partial class FleetDatabaseData : 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(FleetDatabaseData)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (Optional.IsDefined(Properties)) + { + writer.WritePropertyName("properties"u8); + writer.WriteObjectValue(Properties, options); + } + } + + FleetDatabaseData 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(FleetDatabaseData)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeFleetDatabaseData(document.RootElement, options); + } + + internal static FleetDatabaseData DeserializeFleetDatabaseData(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + FleetDatabaseProperties properties = default; + ResourceIdentifier id = default; + string name = default; + Core.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 = FleetDatabaseProperties.DeserializeFleetDatabaseProperties(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 Core.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 FleetDatabaseData( + 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(FleetDatabaseData)} does not support writing '{options.Format}' format."); + } + } + + FleetDatabaseData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeFleetDatabaseData(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(FleetDatabaseData)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/FleetDatabaseData.cs b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/FleetDatabaseData.cs new file mode 100644 index 000000000000..15a588a310a1 --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/FleetDatabaseData.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.DatabaseFleetManager.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.DatabaseFleetManager +{ + /// + /// A class representing the FleetDatabase data model. + /// A fleet database. + /// + public partial class FleetDatabaseData : 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 FleetDatabaseData() + { + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// Fleet database properties. + /// Keeps track of any properties unknown to the library. + internal FleetDatabaseData(ResourceIdentifier id, string name, Core.ResourceType resourceType, SystemData systemData, FleetDatabaseProperties properties, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) + { + Properties = properties; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Fleet database properties. + public FleetDatabaseProperties Properties { get; set; } + } +} diff --git a/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/FleetDatabaseResource.Serialization.cs b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/FleetDatabaseResource.Serialization.cs new file mode 100644 index 000000000000..590f0c91cc98 --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/FleetDatabaseResource.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.DatabaseFleetManager +{ + public partial class FleetDatabaseResource : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); + + FleetDatabaseData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options); + + FleetDatabaseData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options); + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); + } +} diff --git a/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/FleetDatabaseResource.cs b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/FleetDatabaseResource.cs new file mode 100644 index 000000000000..78b41bfbae8f --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/FleetDatabaseResource.cs @@ -0,0 +1,617 @@ +// 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; +using Azure.ResourceManager.DatabaseFleetManager.Models; + +namespace Azure.ResourceManager.DatabaseFleetManager +{ + /// + /// A Class representing a FleetDatabase 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 GetFleetDatabaseResource method. + /// Otherwise you can get one from its parent resource using the GetFleetDatabase method. + /// + public partial class FleetDatabaseResource : ArmResource + { + /// Generate the resource identifier of a instance. + /// The subscriptionId. + /// The resourceGroupName. + /// The fleetName. + /// The fleetspaceName. + /// The databaseName. + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string fleetName, string fleetspaceName, string databaseName) + { + var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName}/fleetspaces/{fleetspaceName}/databases/{databaseName}"; + return new ResourceIdentifier(resourceId); + } + + private readonly ClientDiagnostics _fleetDatabaseClientDiagnostics; + private readonly FleetDatabasesRestOperations _fleetDatabaseRestClient; + private readonly FleetDatabaseData _data; + + /// Gets the resource type for the operations. + public static readonly Core.ResourceType ResourceType = "Microsoft.DatabaseFleetManager/fleets/fleetspaces/databases"; + + /// Initializes a new instance of the class for mocking. + protected FleetDatabaseResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal FleetDatabaseResource(ArmClient client, FleetDatabaseData 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 FleetDatabaseResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _fleetDatabaseClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.DatabaseFleetManager", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string fleetDatabaseApiVersion); + _fleetDatabaseRestClient = new FleetDatabasesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, fleetDatabaseApiVersion); +#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 FleetDatabaseData 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)); + } + + /// + /// Gets a fleet database. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName}/fleetspaces/{fleetspaceName}/databases/{databaseName} + /// + /// + /// Operation Id + /// FleetDatabase_Get + /// + /// + /// Default Api Version + /// 2025-02-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _fleetDatabaseClientDiagnostics.CreateScope("FleetDatabaseResource.Get"); + scope.Start(); + try + { + var response = await _fleetDatabaseRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new FleetDatabaseResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets a fleet database. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName}/fleetspaces/{fleetspaceName}/databases/{databaseName} + /// + /// + /// Operation Id + /// FleetDatabase_Get + /// + /// + /// Default Api Version + /// 2025-02-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _fleetDatabaseClientDiagnostics.CreateScope("FleetDatabaseResource.Get"); + scope.Start(); + try + { + var response = _fleetDatabaseRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new FleetDatabaseResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Deletes a fleet database. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName}/fleetspaces/{fleetspaceName}/databases/{databaseName} + /// + /// + /// Operation Id + /// FleetDatabase_Delete + /// + /// + /// Default Api Version + /// 2025-02-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 = _fleetDatabaseClientDiagnostics.CreateScope("FleetDatabaseResource.Delete"); + scope.Start(); + try + { + var response = await _fleetDatabaseRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + var operation = new DatabaseFleetManagerArmOperation(_fleetDatabaseClientDiagnostics, Pipeline, _fleetDatabaseRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Deletes a fleet database. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName}/fleetspaces/{fleetspaceName}/databases/{databaseName} + /// + /// + /// Operation Id + /// FleetDatabase_Delete + /// + /// + /// Default Api Version + /// 2025-02-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 = _fleetDatabaseClientDiagnostics.CreateScope("FleetDatabaseResource.Delete"); + scope.Start(); + try + { + var response = _fleetDatabaseRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken); + var operation = new DatabaseFleetManagerArmOperation(_fleetDatabaseClientDiagnostics, Pipeline, _fleetDatabaseRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletionResponse(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Updates a fleet database. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName}/fleetspaces/{fleetspaceName}/databases/{databaseName} + /// + /// + /// Operation Id + /// FleetDatabase_Update + /// + /// + /// Default Api Version + /// 2025-02-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 database object to patch. + /// The cancellation token to use. + /// is null. + public virtual async Task> UpdateAsync(WaitUntil waitUntil, FleetDatabaseData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _fleetDatabaseClientDiagnostics.CreateScope("FleetDatabaseResource.Update"); + scope.Start(); + try + { + var response = await _fleetDatabaseRestClient.UpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, data, cancellationToken).ConfigureAwait(false); + var operation = new DatabaseFleetManagerArmOperation(new FleetDatabaseOperationSource(Client), _fleetDatabaseClientDiagnostics, Pipeline, _fleetDatabaseRestClient.CreateUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, data).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Updates a fleet database. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName}/fleetspaces/{fleetspaceName}/databases/{databaseName} + /// + /// + /// Operation Id + /// FleetDatabase_Update + /// + /// + /// Default Api Version + /// 2025-02-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 database object to patch. + /// The cancellation token to use. + /// is null. + public virtual ArmOperation Update(WaitUntil waitUntil, FleetDatabaseData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _fleetDatabaseClientDiagnostics.CreateScope("FleetDatabaseResource.Update"); + scope.Start(); + try + { + var response = _fleetDatabaseRestClient.Update(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, data, cancellationToken); + var operation = new DatabaseFleetManagerArmOperation(new FleetDatabaseOperationSource(Client), _fleetDatabaseClientDiagnostics, Pipeline, _fleetDatabaseRestClient.CreateUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, data).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Moves database to a different tier. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName}/fleetspaces/{fleetspaceName}/databases/{databaseName}/changeTier + /// + /// + /// Operation Id + /// FleetDatabases_ChangeTier + /// + /// + /// Default Api Version + /// 2025-02-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 details of the change tier operation. + /// The cancellation token to use. + /// is null. + public virtual async Task ChangeTierAsync(WaitUntil waitUntil, DatabaseChangeTierProperties body, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(body, nameof(body)); + + using var scope = _fleetDatabaseClientDiagnostics.CreateScope("FleetDatabaseResource.ChangeTier"); + scope.Start(); + try + { + var response = await _fleetDatabaseRestClient.ChangeTierAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, body, cancellationToken).ConfigureAwait(false); + var operation = new DatabaseFleetManagerArmOperation(_fleetDatabaseClientDiagnostics, Pipeline, _fleetDatabaseRestClient.CreateChangeTierRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, body).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Moves database to a different tier. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName}/fleetspaces/{fleetspaceName}/databases/{databaseName}/changeTier + /// + /// + /// Operation Id + /// FleetDatabases_ChangeTier + /// + /// + /// Default Api Version + /// 2025-02-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 details of the change tier operation. + /// The cancellation token to use. + /// is null. + public virtual ArmOperation ChangeTier(WaitUntil waitUntil, DatabaseChangeTierProperties body, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(body, nameof(body)); + + using var scope = _fleetDatabaseClientDiagnostics.CreateScope("FleetDatabaseResource.ChangeTier"); + scope.Start(); + try + { + var response = _fleetDatabaseRestClient.ChangeTier(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, body, cancellationToken); + var operation = new DatabaseFleetManagerArmOperation(_fleetDatabaseClientDiagnostics, Pipeline, _fleetDatabaseRestClient.CreateChangeTierRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, body).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletionResponse(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Renames a database. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName}/fleetspaces/{fleetspaceName}/databases/{databaseName}/rename + /// + /// + /// Operation Id + /// FleetDatabases_Rename + /// + /// + /// Default Api Version + /// 2025-02-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 details of the rename operation. + /// The cancellation token to use. + /// is null. + public virtual async Task RenameAsync(WaitUntil waitUntil, DatabaseRenameProperties body, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(body, nameof(body)); + + using var scope = _fleetDatabaseClientDiagnostics.CreateScope("FleetDatabaseResource.Rename"); + scope.Start(); + try + { + var response = await _fleetDatabaseRestClient.RenameAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, body, cancellationToken).ConfigureAwait(false); + var operation = new DatabaseFleetManagerArmOperation(_fleetDatabaseClientDiagnostics, Pipeline, _fleetDatabaseRestClient.CreateRenameRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, body).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Renames a database. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName}/fleetspaces/{fleetspaceName}/databases/{databaseName}/rename + /// + /// + /// Operation Id + /// FleetDatabases_Rename + /// + /// + /// Default Api Version + /// 2025-02-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 details of the rename operation. + /// The cancellation token to use. + /// is null. + public virtual ArmOperation Rename(WaitUntil waitUntil, DatabaseRenameProperties body, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(body, nameof(body)); + + using var scope = _fleetDatabaseClientDiagnostics.CreateScope("FleetDatabaseResource.Rename"); + scope.Start(); + try + { + var response = _fleetDatabaseRestClient.Rename(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, body, cancellationToken); + var operation = new DatabaseFleetManagerArmOperation(_fleetDatabaseClientDiagnostics, Pipeline, _fleetDatabaseRestClient.CreateRenameRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, body).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletionResponse(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Revert a database transparent data encryption (TDE). + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName}/fleetspaces/{fleetspaceName}/databases/{databaseName}/revert + /// + /// + /// Operation Id + /// FleetDatabases_Revert + /// + /// + /// Default Api Version + /// 2025-02-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 RevertAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _fleetDatabaseClientDiagnostics.CreateScope("FleetDatabaseResource.Revert"); + scope.Start(); + try + { + var response = await _fleetDatabaseRestClient.RevertAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + var operation = new DatabaseFleetManagerArmOperation(_fleetDatabaseClientDiagnostics, Pipeline, _fleetDatabaseRestClient.CreateRevertRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Revert a database transparent data encryption (TDE). + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName}/fleetspaces/{fleetspaceName}/databases/{databaseName}/revert + /// + /// + /// Operation Id + /// FleetDatabases_Revert + /// + /// + /// Default Api Version + /// 2025-02-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 Revert(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _fleetDatabaseClientDiagnostics.CreateScope("FleetDatabaseResource.Revert"); + scope.Start(); + try + { + var response = _fleetDatabaseRestClient.Revert(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken); + var operation = new DatabaseFleetManagerArmOperation(_fleetDatabaseClientDiagnostics, Pipeline, _fleetDatabaseRestClient.CreateRevertRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletionResponse(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/FleetResource.Serialization.cs b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/FleetResource.Serialization.cs new file mode 100644 index 000000000000..7f71b89ec415 --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/FleetResource.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.DatabaseFleetManager +{ + public partial class FleetResource : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); + + FleetData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options); + + FleetData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options); + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); + } +} diff --git a/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/FleetResource.cs b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/FleetResource.cs new file mode 100644 index 000000000000..d7a95ec075a5 --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/FleetResource.cs @@ -0,0 +1,845 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.DatabaseFleetManager.Models; +using Azure.ResourceManager.Resources; + +namespace Azure.ResourceManager.DatabaseFleetManager +{ + /// + /// A Class representing a Fleet 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 GetFleetResource method. + /// Otherwise you can get one from its parent resource using the GetFleet method. + /// + public partial class FleetResource : ArmResource + { + /// Generate the resource identifier of a instance. + /// The subscriptionId. + /// The resourceGroupName. + /// The fleetName. + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string fleetName) + { + var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName}"; + return new ResourceIdentifier(resourceId); + } + + private readonly ClientDiagnostics _fleetClientDiagnostics; + private readonly FleetsRestOperations _fleetRestClient; + private readonly FleetData _data; + + /// Gets the resource type for the operations. + public static readonly Core.ResourceType ResourceType = "Microsoft.DatabaseFleetManager/fleets"; + + /// Initializes a new instance of the class for mocking. + protected FleetResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal FleetResource(ArmClient client, FleetData 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 FleetResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _fleetClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.DatabaseFleetManager", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string fleetApiVersion); + _fleetRestClient = new FleetsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, fleetApiVersion); +#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 FleetData 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)); + } + + /// Gets a collection of FleetspaceResources in the Fleet. + /// An object representing collection of FleetspaceResources and their operations over a FleetspaceResource. + public virtual FleetspaceCollection GetFleetspaces() + { + return GetCachedClient(client => new FleetspaceCollection(client, Id)); + } + + /// + /// Gets fleetspace resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName}/fleetspaces/{fleetspaceName} + /// + /// + /// Operation Id + /// Fleetspace_Get + /// + /// + /// Default Api Version + /// 2025-02-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the fleetspace. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetFleetspaceAsync(string fleetspaceName, CancellationToken cancellationToken = default) + { + return await GetFleetspaces().GetAsync(fleetspaceName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets fleetspace resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName}/fleetspaces/{fleetspaceName} + /// + /// + /// Operation Id + /// Fleetspace_Get + /// + /// + /// Default Api Version + /// 2025-02-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the fleetspace. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetFleetspace(string fleetspaceName, CancellationToken cancellationToken = default) + { + return GetFleetspaces().Get(fleetspaceName, cancellationToken); + } + + /// Gets a collection of FleetTierResources in the Fleet. + /// An object representing collection of FleetTierResources and their operations over a FleetTierResource. + public virtual FleetTierCollection GetFleetTiers() + { + return GetCachedClient(client => new FleetTierCollection(client, Id)); + } + + /// + /// Gets a tier resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName}/tiers/{tierName} + /// + /// + /// Operation Id + /// FleetTier_Get + /// + /// + /// Default Api Version + /// 2025-02-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the tier. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetFleetTierAsync(string tierName, CancellationToken cancellationToken = default) + { + return await GetFleetTiers().GetAsync(tierName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets a tier resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName}/tiers/{tierName} + /// + /// + /// Operation Id + /// FleetTier_Get + /// + /// + /// Default Api Version + /// 2025-02-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the tier. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetFleetTier(string tierName, CancellationToken cancellationToken = default) + { + return GetFleetTiers().Get(tierName, cancellationToken); + } + + /// + /// Gets a fleet resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName} + /// + /// + /// Operation Id + /// Fleet_Get + /// + /// + /// Default Api Version + /// 2025-02-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _fleetClientDiagnostics.CreateScope("FleetResource.Get"); + scope.Start(); + try + { + var response = await _fleetRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new FleetResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets a fleet resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName} + /// + /// + /// Operation Id + /// Fleet_Get + /// + /// + /// Default Api Version + /// 2025-02-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _fleetClientDiagnostics.CreateScope("FleetResource.Get"); + scope.Start(); + try + { + var response = _fleetRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new FleetResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Deletes a fleet. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName} + /// + /// + /// Operation Id + /// Fleet_Delete + /// + /// + /// Default Api Version + /// 2025-02-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 = _fleetClientDiagnostics.CreateScope("FleetResource.Delete"); + scope.Start(); + try + { + var response = await _fleetRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + var operation = new DatabaseFleetManagerArmOperation(_fleetClientDiagnostics, Pipeline, _fleetRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Deletes a fleet. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName} + /// + /// + /// Operation Id + /// Fleet_Delete + /// + /// + /// Default Api Version + /// 2025-02-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 = _fleetClientDiagnostics.CreateScope("FleetResource.Delete"); + scope.Start(); + try + { + var response = _fleetRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + var operation = new DatabaseFleetManagerArmOperation(_fleetClientDiagnostics, Pipeline, _fleetRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletionResponse(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Modifies a fleet resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName} + /// + /// + /// Operation Id + /// Fleet_Update + /// + /// + /// Default Api Version + /// 2025-02-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 fleet object to patch. + /// The cancellation token to use. + /// is null. + public virtual async Task> UpdateAsync(WaitUntil waitUntil, FleetPatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(patch, nameof(patch)); + + using var scope = _fleetClientDiagnostics.CreateScope("FleetResource.Update"); + scope.Start(); + try + { + var response = await _fleetRestClient.UpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch, cancellationToken).ConfigureAwait(false); + var operation = new DatabaseFleetManagerArmOperation(new FleetOperationSource(Client), _fleetClientDiagnostics, Pipeline, _fleetRestClient.CreateUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Modifies a fleet resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName} + /// + /// + /// Operation Id + /// Fleet_Update + /// + /// + /// Default Api Version + /// 2025-02-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 fleet object to patch. + /// The cancellation token to use. + /// is null. + public virtual ArmOperation Update(WaitUntil waitUntil, FleetPatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(patch, nameof(patch)); + + using var scope = _fleetClientDiagnostics.CreateScope("FleetResource.Update"); + scope.Start(); + try + { + var response = _fleetRestClient.Update(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch, cancellationToken); + var operation = new DatabaseFleetManagerArmOperation(new FleetOperationSource(Client), _fleetClientDiagnostics, Pipeline, _fleetRestClient.CreateUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Add a tag to the current resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName} + /// + /// + /// Operation Id + /// Fleet_Get + /// + /// + /// Default Api Version + /// 2025-02-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The key for the tag. + /// The value for the tag. + /// The cancellation token to use. + /// or is null. + public virtual async Task> AddTagAsync(string key, string value, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(key, nameof(key)); + Argument.AssertNotNull(value, nameof(value)); + + using var scope = _fleetClientDiagnostics.CreateScope("FleetResource.AddTag"); + scope.Start(); + try + { + if (await CanUseTagResourceAsync(cancellationToken: cancellationToken).ConfigureAwait(false)) + { + var originalTags = await GetTagResource().GetAsync(cancellationToken).ConfigureAwait(false); + originalTags.Value.Data.TagValues[key] = value; + await GetTagResource().CreateOrUpdateAsync(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken).ConfigureAwait(false); + var originalResponse = await _fleetRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new FleetResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; + var patch = new FleetPatch(); + foreach (var tag in current.Tags) + { + patch.Tags.Add(tag); + } + patch.Tags[key] = value; + var result = await UpdateAsync(WaitUntil.Completed, patch, cancellationToken: cancellationToken).ConfigureAwait(false); + return Response.FromValue(result.Value, result.GetRawResponse()); + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Add a tag to the current resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName} + /// + /// + /// Operation Id + /// Fleet_Get + /// + /// + /// Default Api Version + /// 2025-02-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The key for the tag. + /// The value for the tag. + /// The cancellation token to use. + /// or is null. + public virtual Response AddTag(string key, string value, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(key, nameof(key)); + Argument.AssertNotNull(value, nameof(value)); + + using var scope = _fleetClientDiagnostics.CreateScope("FleetResource.AddTag"); + scope.Start(); + try + { + if (CanUseTagResource(cancellationToken: cancellationToken)) + { + var originalTags = GetTagResource().Get(cancellationToken); + originalTags.Value.Data.TagValues[key] = value; + GetTagResource().CreateOrUpdate(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken); + var originalResponse = _fleetRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + return Response.FromValue(new FleetResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = Get(cancellationToken: cancellationToken).Value.Data; + var patch = new FleetPatch(); + foreach (var tag in current.Tags) + { + patch.Tags.Add(tag); + } + patch.Tags[key] = value; + var result = Update(WaitUntil.Completed, patch, cancellationToken: cancellationToken); + return Response.FromValue(result.Value, result.GetRawResponse()); + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Replace the tags on the resource with the given set. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName} + /// + /// + /// Operation Id + /// Fleet_Get + /// + /// + /// Default Api Version + /// 2025-02-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The set of tags to use as replacement. + /// The cancellation token to use. + /// is null. + public virtual async Task> SetTagsAsync(IDictionary tags, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(tags, nameof(tags)); + + using var scope = _fleetClientDiagnostics.CreateScope("FleetResource.SetTags"); + scope.Start(); + try + { + if (await CanUseTagResourceAsync(cancellationToken: cancellationToken).ConfigureAwait(false)) + { + await GetTagResource().DeleteAsync(WaitUntil.Completed, cancellationToken: cancellationToken).ConfigureAwait(false); + var originalTags = await GetTagResource().GetAsync(cancellationToken).ConfigureAwait(false); + originalTags.Value.Data.TagValues.ReplaceWith(tags); + await GetTagResource().CreateOrUpdateAsync(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken).ConfigureAwait(false); + var originalResponse = await _fleetRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new FleetResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; + var patch = new FleetPatch(); + patch.Tags.ReplaceWith(tags); + var result = await UpdateAsync(WaitUntil.Completed, patch, cancellationToken: cancellationToken).ConfigureAwait(false); + return Response.FromValue(result.Value, result.GetRawResponse()); + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Replace the tags on the resource with the given set. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName} + /// + /// + /// Operation Id + /// Fleet_Get + /// + /// + /// Default Api Version + /// 2025-02-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The set of tags to use as replacement. + /// The cancellation token to use. + /// is null. + public virtual Response SetTags(IDictionary tags, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(tags, nameof(tags)); + + using var scope = _fleetClientDiagnostics.CreateScope("FleetResource.SetTags"); + scope.Start(); + try + { + if (CanUseTagResource(cancellationToken: cancellationToken)) + { + GetTagResource().Delete(WaitUntil.Completed, cancellationToken: cancellationToken); + var originalTags = GetTagResource().Get(cancellationToken); + originalTags.Value.Data.TagValues.ReplaceWith(tags); + GetTagResource().CreateOrUpdate(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken); + var originalResponse = _fleetRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + return Response.FromValue(new FleetResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = Get(cancellationToken: cancellationToken).Value.Data; + var patch = new FleetPatch(); + patch.Tags.ReplaceWith(tags); + var result = Update(WaitUntil.Completed, patch, cancellationToken: cancellationToken); + return Response.FromValue(result.Value, result.GetRawResponse()); + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Removes a tag by key from the resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName} + /// + /// + /// Operation Id + /// Fleet_Get + /// + /// + /// Default Api Version + /// 2025-02-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The key for the tag. + /// The cancellation token to use. + /// is null. + public virtual async Task> RemoveTagAsync(string key, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(key, nameof(key)); + + using var scope = _fleetClientDiagnostics.CreateScope("FleetResource.RemoveTag"); + scope.Start(); + try + { + if (await CanUseTagResourceAsync(cancellationToken: cancellationToken).ConfigureAwait(false)) + { + var originalTags = await GetTagResource().GetAsync(cancellationToken).ConfigureAwait(false); + originalTags.Value.Data.TagValues.Remove(key); + await GetTagResource().CreateOrUpdateAsync(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken).ConfigureAwait(false); + var originalResponse = await _fleetRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new FleetResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; + var patch = new FleetPatch(); + foreach (var tag in current.Tags) + { + patch.Tags.Add(tag); + } + patch.Tags.Remove(key); + var result = await UpdateAsync(WaitUntil.Completed, patch, cancellationToken: cancellationToken).ConfigureAwait(false); + return Response.FromValue(result.Value, result.GetRawResponse()); + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Removes a tag by key from the resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName} + /// + /// + /// Operation Id + /// Fleet_Get + /// + /// + /// Default Api Version + /// 2025-02-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The key for the tag. + /// The cancellation token to use. + /// is null. + public virtual Response RemoveTag(string key, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(key, nameof(key)); + + using var scope = _fleetClientDiagnostics.CreateScope("FleetResource.RemoveTag"); + scope.Start(); + try + { + if (CanUseTagResource(cancellationToken: cancellationToken)) + { + var originalTags = GetTagResource().Get(cancellationToken); + originalTags.Value.Data.TagValues.Remove(key); + GetTagResource().CreateOrUpdate(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken); + var originalResponse = _fleetRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + return Response.FromValue(new FleetResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = Get(cancellationToken: cancellationToken).Value.Data; + var patch = new FleetPatch(); + foreach (var tag in current.Tags) + { + patch.Tags.Add(tag); + } + patch.Tags.Remove(key); + var result = Update(WaitUntil.Completed, patch, cancellationToken: cancellationToken); + return Response.FromValue(result.Value, result.GetRawResponse()); + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/FleetTierCollection.cs b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/FleetTierCollection.cs new file mode 100644 index 000000000000..e7d8fffec97a --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/FleetTierCollection.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.DatabaseFleetManager +{ + /// + /// 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 GetFleetTiers method from an instance of . + /// + public partial class FleetTierCollection : ArmCollection, IEnumerable, IAsyncEnumerable + { + private readonly ClientDiagnostics _fleetTierClientDiagnostics; + private readonly FleetTiersRestOperations _fleetTierRestClient; + + /// Initializes a new instance of the class for mocking. + protected FleetTierCollection() + { + } + + /// 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 FleetTierCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _fleetTierClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.DatabaseFleetManager", FleetTierResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(FleetTierResource.ResourceType, out string fleetTierApiVersion); + _fleetTierRestClient = new FleetTiersRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, fleetTierApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != FleetResource.ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, FleetResource.ResourceType), nameof(id)); + } + + /// + /// Creates or updates a tier. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName}/tiers/{tierName} + /// + /// + /// Operation Id + /// FleetTier_CreateOrUpdate + /// + /// + /// Default Api Version + /// 2025-02-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 tier. + /// The tier object to create or update. + /// 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 tierName, FleetTierData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(tierName, nameof(tierName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _fleetTierClientDiagnostics.CreateScope("FleetTierCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = await _fleetTierRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, tierName, data, cancellationToken).ConfigureAwait(false); + var operation = new DatabaseFleetManagerArmOperation(new FleetTierOperationSource(Client), _fleetTierClientDiagnostics, Pipeline, _fleetTierRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, tierName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Creates or updates a tier. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName}/tiers/{tierName} + /// + /// + /// Operation Id + /// FleetTier_CreateOrUpdate + /// + /// + /// Default Api Version + /// 2025-02-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 tier. + /// The tier object to create or update. + /// 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 tierName, FleetTierData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(tierName, nameof(tierName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _fleetTierClientDiagnostics.CreateScope("FleetTierCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = _fleetTierRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, tierName, data, cancellationToken); + var operation = new DatabaseFleetManagerArmOperation(new FleetTierOperationSource(Client), _fleetTierClientDiagnostics, Pipeline, _fleetTierRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, tierName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets a tier resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName}/tiers/{tierName} + /// + /// + /// Operation Id + /// FleetTier_Get + /// + /// + /// Default Api Version + /// 2025-02-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the tier. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetAsync(string tierName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(tierName, nameof(tierName)); + + using var scope = _fleetTierClientDiagnostics.CreateScope("FleetTierCollection.Get"); + scope.Start(); + try + { + var response = await _fleetTierRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, tierName, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new FleetTierResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets a tier resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName}/tiers/{tierName} + /// + /// + /// Operation Id + /// FleetTier_Get + /// + /// + /// Default Api Version + /// 2025-02-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the tier. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Get(string tierName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(tierName, nameof(tierName)); + + using var scope = _fleetTierClientDiagnostics.CreateScope("FleetTierCollection.Get"); + scope.Start(); + try + { + var response = _fleetTierRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, tierName, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new FleetTierResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// List tiers in a fleet. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName}/tiers + /// + /// + /// Operation Id + /// FleetTier_ListByFleet + /// + /// + /// Default Api Version + /// 2025-02-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The number of elements in the collection to skip. + /// The number of elements to return from the collection. + /// An opaque token that identifies a starting point in the collection. + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetAllAsync(long? skip = null, long? top = null, string skiptoken = null, CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _fleetTierRestClient.CreateListByFleetRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, skip, top, skiptoken); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _fleetTierRestClient.CreateListByFleetNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name, skip, top, skiptoken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new FleetTierResource(Client, FleetTierData.DeserializeFleetTierData(e)), _fleetTierClientDiagnostics, Pipeline, "FleetTierCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// List tiers in a fleet. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName}/tiers + /// + /// + /// Operation Id + /// FleetTier_ListByFleet + /// + /// + /// Default Api Version + /// 2025-02-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The number of elements in the collection to skip. + /// The number of elements to return from the collection. + /// An opaque token that identifies a starting point in the collection. + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetAll(long? skip = null, long? top = null, string skiptoken = null, CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _fleetTierRestClient.CreateListByFleetRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, skip, top, skiptoken); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _fleetTierRestClient.CreateListByFleetNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name, skip, top, skiptoken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new FleetTierResource(Client, FleetTierData.DeserializeFleetTierData(e)), _fleetTierClientDiagnostics, Pipeline, "FleetTierCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName}/tiers/{tierName} + /// + /// + /// Operation Id + /// FleetTier_Get + /// + /// + /// Default Api Version + /// 2025-02-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the tier. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> ExistsAsync(string tierName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(tierName, nameof(tierName)); + + using var scope = _fleetTierClientDiagnostics.CreateScope("FleetTierCollection.Exists"); + scope.Start(); + try + { + var response = await _fleetTierRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, tierName, 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.DatabaseFleetManager/fleets/{fleetName}/tiers/{tierName} + /// + /// + /// Operation Id + /// FleetTier_Get + /// + /// + /// Default Api Version + /// 2025-02-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the tier. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Exists(string tierName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(tierName, nameof(tierName)); + + using var scope = _fleetTierClientDiagnostics.CreateScope("FleetTierCollection.Exists"); + scope.Start(); + try + { + var response = _fleetTierRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, tierName, 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.DatabaseFleetManager/fleets/{fleetName}/tiers/{tierName} + /// + /// + /// Operation Id + /// FleetTier_Get + /// + /// + /// Default Api Version + /// 2025-02-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the tier. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetIfExistsAsync(string tierName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(tierName, nameof(tierName)); + + using var scope = _fleetTierClientDiagnostics.CreateScope("FleetTierCollection.GetIfExists"); + scope.Start(); + try + { + var response = await _fleetTierRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, tierName, cancellationToken: cancellationToken).ConfigureAwait(false); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new FleetTierResource(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.DatabaseFleetManager/fleets/{fleetName}/tiers/{tierName} + /// + /// + /// Operation Id + /// FleetTier_Get + /// + /// + /// Default Api Version + /// 2025-02-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the tier. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual NullableResponse GetIfExists(string tierName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(tierName, nameof(tierName)); + + using var scope = _fleetTierClientDiagnostics.CreateScope("FleetTierCollection.GetIfExists"); + scope.Start(); + try + { + var response = _fleetTierRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, tierName, cancellationToken: cancellationToken); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new FleetTierResource(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/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/FleetTierData.Serialization.cs b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/FleetTierData.Serialization.cs new file mode 100644 index 000000000000..0a4b0ee11df9 --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/FleetTierData.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.DatabaseFleetManager.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.DatabaseFleetManager +{ + public partial class FleetTierData : 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(FleetTierData)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (Optional.IsDefined(Properties)) + { + writer.WritePropertyName("properties"u8); + writer.WriteObjectValue(Properties, options); + } + } + + FleetTierData 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(FleetTierData)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeFleetTierData(document.RootElement, options); + } + + internal static FleetTierData DeserializeFleetTierData(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + FleetTierProperties properties = default; + ResourceIdentifier id = default; + string name = default; + Core.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 = FleetTierProperties.DeserializeFleetTierProperties(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 Core.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 FleetTierData( + 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(FleetTierData)} does not support writing '{options.Format}' format."); + } + } + + FleetTierData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeFleetTierData(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(FleetTierData)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/FleetTierData.cs b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/FleetTierData.cs new file mode 100644 index 000000000000..b7d9416f249a --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/FleetTierData.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.DatabaseFleetManager.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.DatabaseFleetManager +{ + /// + /// A class representing the FleetTier data model. + /// A SQL Database Fleet tier. + /// + public partial class FleetTierData : 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 FleetTierData() + { + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// A Fleet tier properties. + /// Keeps track of any properties unknown to the library. + internal FleetTierData(ResourceIdentifier id, string name, Core.ResourceType resourceType, SystemData systemData, FleetTierProperties properties, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) + { + Properties = properties; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// A Fleet tier properties. + public FleetTierProperties Properties { get; set; } + } +} diff --git a/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/FleetTierResource.Serialization.cs b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/FleetTierResource.Serialization.cs new file mode 100644 index 000000000000..5e5e193cc976 --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/FleetTierResource.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.DatabaseFleetManager +{ + public partial class FleetTierResource : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); + + FleetTierData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options); + + FleetTierData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options); + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); + } +} diff --git a/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/FleetTierResource.cs b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/FleetTierResource.cs new file mode 100644 index 000000000000..4b6723e281c2 --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/FleetTierResource.cs @@ -0,0 +1,423 @@ +// 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.DatabaseFleetManager +{ + /// + /// A Class representing a FleetTier 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 GetFleetTierResource method. + /// Otherwise you can get one from its parent resource using the GetFleetTier method. + /// + public partial class FleetTierResource : ArmResource + { + /// Generate the resource identifier of a instance. + /// The subscriptionId. + /// The resourceGroupName. + /// The fleetName. + /// The tierName. + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string fleetName, string tierName) + { + var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName}/tiers/{tierName}"; + return new ResourceIdentifier(resourceId); + } + + private readonly ClientDiagnostics _fleetTierClientDiagnostics; + private readonly FleetTiersRestOperations _fleetTierRestClient; + private readonly FleetTierData _data; + + /// Gets the resource type for the operations. + public static readonly ResourceType ResourceType = "Microsoft.DatabaseFleetManager/fleets/tiers"; + + /// Initializes a new instance of the class for mocking. + protected FleetTierResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal FleetTierResource(ArmClient client, FleetTierData 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 FleetTierResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _fleetTierClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.DatabaseFleetManager", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string fleetTierApiVersion); + _fleetTierRestClient = new FleetTiersRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, fleetTierApiVersion); +#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 FleetTierData 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)); + } + + /// + /// Gets a tier resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName}/tiers/{tierName} + /// + /// + /// Operation Id + /// FleetTier_Get + /// + /// + /// Default Api Version + /// 2025-02-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _fleetTierClientDiagnostics.CreateScope("FleetTierResource.Get"); + scope.Start(); + try + { + var response = await _fleetTierRestClient.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 FleetTierResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets a tier resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName}/tiers/{tierName} + /// + /// + /// Operation Id + /// FleetTier_Get + /// + /// + /// Default Api Version + /// 2025-02-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _fleetTierClientDiagnostics.CreateScope("FleetTierResource.Get"); + scope.Start(); + try + { + var response = _fleetTierRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new FleetTierResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Deletes a tier. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName}/tiers/{tierName} + /// + /// + /// Operation Id + /// FleetTier_Delete + /// + /// + /// Default Api Version + /// 2025-02-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 = _fleetTierClientDiagnostics.CreateScope("FleetTierResource.Delete"); + scope.Start(); + try + { + var response = await _fleetTierRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + var operation = new DatabaseFleetManagerArmOperation(_fleetTierClientDiagnostics, Pipeline, _fleetTierRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Deletes a tier. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName}/tiers/{tierName} + /// + /// + /// Operation Id + /// FleetTier_Delete + /// + /// + /// Default Api Version + /// 2025-02-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 = _fleetTierClientDiagnostics.CreateScope("FleetTierResource.Delete"); + scope.Start(); + try + { + var response = _fleetTierRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + var operation = new DatabaseFleetManagerArmOperation(_fleetTierClientDiagnostics, Pipeline, _fleetTierRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletionResponse(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Updates a tier. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName}/tiers/{tierName} + /// + /// + /// Operation Id + /// FleetTier_Update + /// + /// + /// Default Api Version + /// 2025-02-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 resource properties to be updated. + /// The cancellation token to use. + /// is null. + public virtual async Task> UpdateAsync(WaitUntil waitUntil, FleetTierData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _fleetTierClientDiagnostics.CreateScope("FleetTierResource.Update"); + scope.Start(); + try + { + var response = await _fleetTierRestClient.UpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, cancellationToken).ConfigureAwait(false); + var operation = new DatabaseFleetManagerArmOperation(new FleetTierOperationSource(Client), _fleetTierClientDiagnostics, Pipeline, _fleetTierRestClient.CreateUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Updates a tier. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName}/tiers/{tierName} + /// + /// + /// Operation Id + /// FleetTier_Update + /// + /// + /// Default Api Version + /// 2025-02-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 resource properties to be updated. + /// The cancellation token to use. + /// is null. + public virtual ArmOperation Update(WaitUntil waitUntil, FleetTierData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _fleetTierClientDiagnostics.CreateScope("FleetTierResource.Update"); + scope.Start(); + try + { + var response = _fleetTierRestClient.Update(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, cancellationToken); + var operation = new DatabaseFleetManagerArmOperation(new FleetTierOperationSource(Client), _fleetTierClientDiagnostics, Pipeline, _fleetTierRestClient.CreateUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Disables a tier. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName}/tiers/{tierName}/disable + /// + /// + /// Operation Id + /// FleetTiers_Disable + /// + /// + /// Default Api Version + /// 2025-02-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> DisableAsync(CancellationToken cancellationToken = default) + { + using var scope = _fleetTierClientDiagnostics.CreateScope("FleetTierResource.Disable"); + scope.Start(); + try + { + var response = await _fleetTierRestClient.DisableAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new FleetTierResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Disables a tier. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName}/tiers/{tierName}/disable + /// + /// + /// Operation Id + /// FleetTiers_Disable + /// + /// + /// Default Api Version + /// 2025-02-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual Response Disable(CancellationToken cancellationToken = default) + { + using var scope = _fleetTierClientDiagnostics.CreateScope("FleetTierResource.Disable"); + scope.Start(); + try + { + var response = _fleetTierRestClient.Disable(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + return Response.FromValue(new FleetTierResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/FleetspaceCollection.cs b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/FleetspaceCollection.cs new file mode 100644 index 000000000000..66e97247dfb7 --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/FleetspaceCollection.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.DatabaseFleetManager +{ + /// + /// 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 GetFleetspaces method from an instance of . + /// + public partial class FleetspaceCollection : ArmCollection, IEnumerable, IAsyncEnumerable + { + private readonly ClientDiagnostics _fleetspaceClientDiagnostics; + private readonly FleetspacesRestOperations _fleetspaceRestClient; + + /// Initializes a new instance of the class for mocking. + protected FleetspaceCollection() + { + } + + /// 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 FleetspaceCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _fleetspaceClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.DatabaseFleetManager", FleetspaceResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(FleetspaceResource.ResourceType, out string fleetspaceApiVersion); + _fleetspaceRestClient = new FleetspacesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, fleetspaceApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != FleetResource.ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, FleetResource.ResourceType), nameof(id)); + } + + /// + /// Creates or updates a fleetspace resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName}/fleetspaces/{fleetspaceName} + /// + /// + /// Operation Id + /// Fleetspace_CreateOrUpdate + /// + /// + /// Default Api Version + /// 2025-02-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 fleetspace. + /// The fleet object to create or update. + /// 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 fleetspaceName, FleetspaceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(fleetspaceName, nameof(fleetspaceName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _fleetspaceClientDiagnostics.CreateScope("FleetspaceCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = await _fleetspaceRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, fleetspaceName, data, cancellationToken).ConfigureAwait(false); + var operation = new DatabaseFleetManagerArmOperation(new FleetspaceOperationSource(Client), _fleetspaceClientDiagnostics, Pipeline, _fleetspaceRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, fleetspaceName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Creates or updates a fleetspace resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName}/fleetspaces/{fleetspaceName} + /// + /// + /// Operation Id + /// Fleetspace_CreateOrUpdate + /// + /// + /// Default Api Version + /// 2025-02-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 fleetspace. + /// The fleet object to create or update. + /// 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 fleetspaceName, FleetspaceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(fleetspaceName, nameof(fleetspaceName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _fleetspaceClientDiagnostics.CreateScope("FleetspaceCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = _fleetspaceRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, fleetspaceName, data, cancellationToken); + var operation = new DatabaseFleetManagerArmOperation(new FleetspaceOperationSource(Client), _fleetspaceClientDiagnostics, Pipeline, _fleetspaceRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, fleetspaceName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets fleetspace resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName}/fleetspaces/{fleetspaceName} + /// + /// + /// Operation Id + /// Fleetspace_Get + /// + /// + /// Default Api Version + /// 2025-02-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the fleetspace. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetAsync(string fleetspaceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(fleetspaceName, nameof(fleetspaceName)); + + using var scope = _fleetspaceClientDiagnostics.CreateScope("FleetspaceCollection.Get"); + scope.Start(); + try + { + var response = await _fleetspaceRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, fleetspaceName, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new FleetspaceResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets fleetspace resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName}/fleetspaces/{fleetspaceName} + /// + /// + /// Operation Id + /// Fleetspace_Get + /// + /// + /// Default Api Version + /// 2025-02-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the fleetspace. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Get(string fleetspaceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(fleetspaceName, nameof(fleetspaceName)); + + using var scope = _fleetspaceClientDiagnostics.CreateScope("FleetspaceCollection.Get"); + scope.Start(); + try + { + var response = _fleetspaceRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, fleetspaceName, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new FleetspaceResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Lists fleetspaces in a fleet. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName}/fleetspaces + /// + /// + /// Operation Id + /// Fleetspace_ListByFleet + /// + /// + /// Default Api Version + /// 2025-02-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The number of elements in the collection to skip. + /// The number of elements to return from the collection. + /// An opaque token that identifies a starting point in the collection. + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetAllAsync(long? skip = null, long? top = null, string skiptoken = null, CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _fleetspaceRestClient.CreateListByFleetRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, skip, top, skiptoken); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _fleetspaceRestClient.CreateListByFleetNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name, skip, top, skiptoken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new FleetspaceResource(Client, FleetspaceData.DeserializeFleetspaceData(e)), _fleetspaceClientDiagnostics, Pipeline, "FleetspaceCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Lists fleetspaces in a fleet. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName}/fleetspaces + /// + /// + /// Operation Id + /// Fleetspace_ListByFleet + /// + /// + /// Default Api Version + /// 2025-02-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The number of elements in the collection to skip. + /// The number of elements to return from the collection. + /// An opaque token that identifies a starting point in the collection. + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetAll(long? skip = null, long? top = null, string skiptoken = null, CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _fleetspaceRestClient.CreateListByFleetRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, skip, top, skiptoken); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _fleetspaceRestClient.CreateListByFleetNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name, skip, top, skiptoken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new FleetspaceResource(Client, FleetspaceData.DeserializeFleetspaceData(e)), _fleetspaceClientDiagnostics, Pipeline, "FleetspaceCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName}/fleetspaces/{fleetspaceName} + /// + /// + /// Operation Id + /// Fleetspace_Get + /// + /// + /// Default Api Version + /// 2025-02-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the fleetspace. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> ExistsAsync(string fleetspaceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(fleetspaceName, nameof(fleetspaceName)); + + using var scope = _fleetspaceClientDiagnostics.CreateScope("FleetspaceCollection.Exists"); + scope.Start(); + try + { + var response = await _fleetspaceRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, fleetspaceName, 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.DatabaseFleetManager/fleets/{fleetName}/fleetspaces/{fleetspaceName} + /// + /// + /// Operation Id + /// Fleetspace_Get + /// + /// + /// Default Api Version + /// 2025-02-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the fleetspace. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Exists(string fleetspaceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(fleetspaceName, nameof(fleetspaceName)); + + using var scope = _fleetspaceClientDiagnostics.CreateScope("FleetspaceCollection.Exists"); + scope.Start(); + try + { + var response = _fleetspaceRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, fleetspaceName, 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.DatabaseFleetManager/fleets/{fleetName}/fleetspaces/{fleetspaceName} + /// + /// + /// Operation Id + /// Fleetspace_Get + /// + /// + /// Default Api Version + /// 2025-02-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the fleetspace. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetIfExistsAsync(string fleetspaceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(fleetspaceName, nameof(fleetspaceName)); + + using var scope = _fleetspaceClientDiagnostics.CreateScope("FleetspaceCollection.GetIfExists"); + scope.Start(); + try + { + var response = await _fleetspaceRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, fleetspaceName, cancellationToken: cancellationToken).ConfigureAwait(false); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new FleetspaceResource(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.DatabaseFleetManager/fleets/{fleetName}/fleetspaces/{fleetspaceName} + /// + /// + /// Operation Id + /// Fleetspace_Get + /// + /// + /// Default Api Version + /// 2025-02-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the fleetspace. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual NullableResponse GetIfExists(string fleetspaceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(fleetspaceName, nameof(fleetspaceName)); + + using var scope = _fleetspaceClientDiagnostics.CreateScope("FleetspaceCollection.GetIfExists"); + scope.Start(); + try + { + var response = _fleetspaceRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, fleetspaceName, cancellationToken: cancellationToken); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new FleetspaceResource(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/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/FleetspaceData.Serialization.cs b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/FleetspaceData.Serialization.cs new file mode 100644 index 000000000000..5a722ce8bb0f --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/FleetspaceData.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.DatabaseFleetManager.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.DatabaseFleetManager +{ + public partial class FleetspaceData : 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(FleetspaceData)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (Optional.IsDefined(Properties)) + { + writer.WritePropertyName("properties"u8); + writer.WriteObjectValue(Properties, options); + } + } + + FleetspaceData 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(FleetspaceData)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeFleetspaceData(document.RootElement, options); + } + + internal static FleetspaceData DeserializeFleetspaceData(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + FleetspaceProperties properties = default; + ResourceIdentifier id = default; + string name = default; + Core.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 = FleetspaceProperties.DeserializeFleetspaceProperties(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 Core.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 FleetspaceData( + 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(FleetspaceData)} does not support writing '{options.Format}' format."); + } + } + + FleetspaceData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeFleetspaceData(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(FleetspaceData)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/FleetspaceData.cs b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/FleetspaceData.cs new file mode 100644 index 000000000000..ff1a45dd143b --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/FleetspaceData.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.DatabaseFleetManager.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.DatabaseFleetManager +{ + /// + /// A class representing the Fleetspace data model. + /// A fleetspace. + /// + public partial class FleetspaceData : 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 FleetspaceData() + { + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// A Fleetspace properties. + /// Keeps track of any properties unknown to the library. + internal FleetspaceData(ResourceIdentifier id, string name, Core.ResourceType resourceType, SystemData systemData, FleetspaceProperties properties, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) + { + Properties = properties; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// A Fleetspace properties. + public FleetspaceProperties Properties { get; set; } + } +} diff --git a/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/FleetspaceResource.Serialization.cs b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/FleetspaceResource.Serialization.cs new file mode 100644 index 000000000000..b75fae2c086c --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/FleetspaceResource.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.DatabaseFleetManager +{ + public partial class FleetspaceResource : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); + + FleetspaceData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options); + + FleetspaceData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options); + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); + } +} diff --git a/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/FleetspaceResource.cs b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/FleetspaceResource.cs new file mode 100644 index 000000000000..09866a232bc4 --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/FleetspaceResource.cs @@ -0,0 +1,662 @@ +// 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; +using Azure.ResourceManager.DatabaseFleetManager.Models; + +namespace Azure.ResourceManager.DatabaseFleetManager +{ + /// + /// A Class representing a Fleetspace 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 GetFleetspaceResource method. + /// Otherwise you can get one from its parent resource using the GetFleetspace method. + /// + public partial class FleetspaceResource : ArmResource + { + /// Generate the resource identifier of a instance. + /// The subscriptionId. + /// The resourceGroupName. + /// The fleetName. + /// The fleetspaceName. + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string fleetName, string fleetspaceName) + { + var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName}/fleetspaces/{fleetspaceName}"; + return new ResourceIdentifier(resourceId); + } + + private readonly ClientDiagnostics _fleetspaceClientDiagnostics; + private readonly FleetspacesRestOperations _fleetspaceRestClient; + private readonly FleetspaceData _data; + + /// Gets the resource type for the operations. + public static readonly Core.ResourceType ResourceType = "Microsoft.DatabaseFleetManager/fleets/fleetspaces"; + + /// Initializes a new instance of the class for mocking. + protected FleetspaceResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal FleetspaceResource(ArmClient client, FleetspaceData 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 FleetspaceResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _fleetspaceClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.DatabaseFleetManager", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string fleetspaceApiVersion); + _fleetspaceRestClient = new FleetspacesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, fleetspaceApiVersion); +#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 FleetspaceData 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)); + } + + /// Gets a collection of FleetDatabaseResources in the Fleetspace. + /// An object representing collection of FleetDatabaseResources and their operations over a FleetDatabaseResource. + public virtual FleetDatabaseCollection GetFleetDatabases() + { + return GetCachedClient(client => new FleetDatabaseCollection(client, Id)); + } + + /// + /// Gets a fleet database. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName}/fleetspaces/{fleetspaceName}/databases/{databaseName} + /// + /// + /// Operation Id + /// FleetDatabase_Get + /// + /// + /// Default Api Version + /// 2025-02-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the database. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetFleetDatabaseAsync(string databaseName, CancellationToken cancellationToken = default) + { + return await GetFleetDatabases().GetAsync(databaseName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets a fleet database. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName}/fleetspaces/{fleetspaceName}/databases/{databaseName} + /// + /// + /// Operation Id + /// FleetDatabase_Get + /// + /// + /// Default Api Version + /// 2025-02-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the database. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetFleetDatabase(string databaseName, CancellationToken cancellationToken = default) + { + return GetFleetDatabases().Get(databaseName, cancellationToken); + } + + /// Gets a collection of FirewallRuleResources in the Fleetspace. + /// An object representing collection of FirewallRuleResources and their operations over a FirewallRuleResource. + public virtual FirewallRuleCollection GetFirewallRules() + { + return GetCachedClient(client => new FirewallRuleCollection(client, Id)); + } + + /// + /// Gets a firewall rule. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName}/fleetspaces/{fleetspaceName}/firewallRules/{firewallRuleName} + /// + /// + /// Operation Id + /// FirewallRule_Get + /// + /// + /// Default Api Version + /// 2025-02-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the firewall rule. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetFirewallRuleAsync(string firewallRuleName, CancellationToken cancellationToken = default) + { + return await GetFirewallRules().GetAsync(firewallRuleName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets a firewall rule. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName}/fleetspaces/{fleetspaceName}/firewallRules/{firewallRuleName} + /// + /// + /// Operation Id + /// FirewallRule_Get + /// + /// + /// Default Api Version + /// 2025-02-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the firewall rule. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetFirewallRule(string firewallRuleName, CancellationToken cancellationToken = default) + { + return GetFirewallRules().Get(firewallRuleName, cancellationToken); + } + + /// + /// Gets fleetspace resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName}/fleetspaces/{fleetspaceName} + /// + /// + /// Operation Id + /// Fleetspace_Get + /// + /// + /// Default Api Version + /// 2025-02-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _fleetspaceClientDiagnostics.CreateScope("FleetspaceResource.Get"); + scope.Start(); + try + { + var response = await _fleetspaceRestClient.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 FleetspaceResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets fleetspace resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName}/fleetspaces/{fleetspaceName} + /// + /// + /// Operation Id + /// Fleetspace_Get + /// + /// + /// Default Api Version + /// 2025-02-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _fleetspaceClientDiagnostics.CreateScope("FleetspaceResource.Get"); + scope.Start(); + try + { + var response = _fleetspaceRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new FleetspaceResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Deletes a fleetspace. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName}/fleetspaces/{fleetspaceName} + /// + /// + /// Operation Id + /// Fleetspace_Delete + /// + /// + /// Default Api Version + /// 2025-02-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 = _fleetspaceClientDiagnostics.CreateScope("FleetspaceResource.Delete"); + scope.Start(); + try + { + var response = await _fleetspaceRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + var operation = new DatabaseFleetManagerArmOperation(_fleetspaceClientDiagnostics, Pipeline, _fleetspaceRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Deletes a fleetspace. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName}/fleetspaces/{fleetspaceName} + /// + /// + /// Operation Id + /// Fleetspace_Delete + /// + /// + /// Default Api Version + /// 2025-02-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 = _fleetspaceClientDiagnostics.CreateScope("FleetspaceResource.Delete"); + scope.Start(); + try + { + var response = _fleetspaceRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + var operation = new DatabaseFleetManagerArmOperation(_fleetspaceClientDiagnostics, Pipeline, _fleetspaceRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletionResponse(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Modifies a fleetspace resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName}/fleetspaces/{fleetspaceName} + /// + /// + /// Operation Id + /// Fleetspace_Update + /// + /// + /// Default Api Version + /// 2025-02-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 resource properties to be updated. + /// The cancellation token to use. + /// is null. + public virtual async Task> UpdateAsync(WaitUntil waitUntil, FleetspaceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _fleetspaceClientDiagnostics.CreateScope("FleetspaceResource.Update"); + scope.Start(); + try + { + var response = await _fleetspaceRestClient.UpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, cancellationToken).ConfigureAwait(false); + var operation = new DatabaseFleetManagerArmOperation(new FleetspaceOperationSource(Client), _fleetspaceClientDiagnostics, Pipeline, _fleetspaceRestClient.CreateUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Modifies a fleetspace resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName}/fleetspaces/{fleetspaceName} + /// + /// + /// Operation Id + /// Fleetspace_Update + /// + /// + /// Default Api Version + /// 2025-02-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 resource properties to be updated. + /// The cancellation token to use. + /// is null. + public virtual ArmOperation Update(WaitUntil waitUntil, FleetspaceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _fleetspaceClientDiagnostics.CreateScope("FleetspaceResource.Update"); + scope.Start(); + try + { + var response = _fleetspaceRestClient.Update(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, cancellationToken); + var operation = new DatabaseFleetManagerArmOperation(new FleetspaceOperationSource(Client), _fleetspaceClientDiagnostics, Pipeline, _fleetspaceRestClient.CreateUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Migrates an existing logical server into fleet. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName}/fleetspaces/{fleetspaceName}/registerServer + /// + /// + /// Operation Id + /// Fleetspaces_RegisterServer + /// + /// + /// Default Api Version + /// 2025-02-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 details of the register server operation. + /// The cancellation token to use. + /// is null. + public virtual async Task RegisterServerAsync(WaitUntil waitUntil, RegisterServerProperties body, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(body, nameof(body)); + + using var scope = _fleetspaceClientDiagnostics.CreateScope("FleetspaceResource.RegisterServer"); + scope.Start(); + try + { + var response = await _fleetspaceRestClient.RegisterServerAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, body, cancellationToken).ConfigureAwait(false); + var operation = new DatabaseFleetManagerArmOperation(_fleetspaceClientDiagnostics, Pipeline, _fleetspaceRestClient.CreateRegisterServerRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, body).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Migrates an existing logical server into fleet. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName}/fleetspaces/{fleetspaceName}/registerServer + /// + /// + /// Operation Id + /// Fleetspaces_RegisterServer + /// + /// + /// Default Api Version + /// 2025-02-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 details of the register server operation. + /// The cancellation token to use. + /// is null. + public virtual ArmOperation RegisterServer(WaitUntil waitUntil, RegisterServerProperties body, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(body, nameof(body)); + + using var scope = _fleetspaceClientDiagnostics.CreateScope("FleetspaceResource.RegisterServer"); + scope.Start(); + try + { + var response = _fleetspaceRestClient.RegisterServer(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, body, cancellationToken); + var operation = new DatabaseFleetManagerArmOperation(_fleetspaceClientDiagnostics, Pipeline, _fleetspaceRestClient.CreateRegisterServerRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, body).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletionResponse(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Unregisters all databases from a fleetspace + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName}/fleetspaces/{fleetspaceName}/unregister + /// + /// + /// Operation Id + /// Fleetspaces_Unregister + /// + /// + /// Default Api Version + /// 2025-02-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 UnregisterAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _fleetspaceClientDiagnostics.CreateScope("FleetspaceResource.Unregister"); + scope.Start(); + try + { + var response = await _fleetspaceRestClient.UnregisterAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + var operation = new DatabaseFleetManagerArmOperation(_fleetspaceClientDiagnostics, Pipeline, _fleetspaceRestClient.CreateUnregisterRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Unregisters all databases from a fleetspace + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName}/fleetspaces/{fleetspaceName}/unregister + /// + /// + /// Operation Id + /// Fleetspaces_Unregister + /// + /// + /// Default Api Version + /// 2025-02-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 Unregister(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _fleetspaceClientDiagnostics.CreateScope("FleetspaceResource.Unregister"); + scope.Start(); + try + { + var response = _fleetspaceRestClient.Unregister(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + var operation = new DatabaseFleetManagerArmOperation(_fleetspaceClientDiagnostics, Pipeline, _fleetspaceRestClient.CreateUnregisterRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletionResponse(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Internal/Argument.cs b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Internal/Argument.cs new file mode 100644 index 000000000000..0c8e7b17a1cd --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Internal/Argument.cs @@ -0,0 +1,129 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections; +using System.Collections.Generic; + +namespace Azure.ResourceManager.DatabaseFleetManager +{ + internal static class Argument + { + public static void AssertNotNull(T value, string name) + { + if (value is null) + { + throw new ArgumentNullException(name); + } + } + + public static void AssertNotNull(T? value, string name) + where T : struct + { + if (!value.HasValue) + { + throw new ArgumentNullException(name); + } + } + + public static void AssertNotNullOrEmpty(IEnumerable value, string name) + { + if (value is null) + { + throw new ArgumentNullException(name); + } + if (value is ICollection collectionOfT && collectionOfT.Count == 0) + { + throw new ArgumentException("Value cannot be an empty collection.", name); + } + if (value is ICollection collection && collection.Count == 0) + { + throw new ArgumentException("Value cannot be an empty collection.", name); + } + using IEnumerator e = value.GetEnumerator(); + if (!e.MoveNext()) + { + throw new ArgumentException("Value cannot be an empty collection.", name); + } + } + + public static void AssertNotNullOrEmpty(string value, string name) + { + if (value is null) + { + throw new ArgumentNullException(name); + } + if (value.Length == 0) + { + throw new ArgumentException("Value cannot be an empty string.", name); + } + } + + public static void AssertNotNullOrWhiteSpace(string value, string name) + { + if (value is null) + { + throw new ArgumentNullException(name); + } + if (string.IsNullOrWhiteSpace(value)) + { + throw new ArgumentException("Value cannot be empty or contain only white-space characters.", name); + } + } + + public static void AssertNotDefault(ref T value, string name) + where T : struct, IEquatable + { + if (value.Equals(default)) + { + throw new ArgumentException("Value cannot be empty.", name); + } + } + + public static void AssertInRange(T value, T minimum, T maximum, string name) + where T : notnull, IComparable + { + if (minimum.CompareTo(value) > 0) + { + throw new ArgumentOutOfRangeException(name, "Value is less than the minimum allowed."); + } + if (maximum.CompareTo(value) < 0) + { + throw new ArgumentOutOfRangeException(name, "Value is greater than the maximum allowed."); + } + } + + public static void AssertEnumDefined(Type enumType, object value, string name) + { + if (!Enum.IsDefined(enumType, value)) + { + throw new ArgumentException($"Value not defined for {enumType.FullName}.", name); + } + } + + public static T CheckNotNull(T value, string name) + where T : class + { + AssertNotNull(value, name); + return value; + } + + public static string CheckNotNullOrEmpty(string value, string name) + { + AssertNotNullOrEmpty(value, name); + return value; + } + + public static void AssertNull(T value, string name, string message = null) + { + if (value != null) + { + throw new ArgumentException(message ?? "Value must be null.", name); + } + } + } +} diff --git a/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Internal/ChangeTrackingDictionary.cs b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Internal/ChangeTrackingDictionary.cs new file mode 100644 index 000000000000..240180f8f8a5 --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Internal/ChangeTrackingDictionary.cs @@ -0,0 +1,167 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections; +using System.Collections.Generic; + +namespace Azure.ResourceManager.DatabaseFleetManager +{ + internal class ChangeTrackingDictionary : IDictionary, IReadOnlyDictionary where TKey : notnull + { + private IDictionary _innerDictionary; + + public ChangeTrackingDictionary() + { + } + + public ChangeTrackingDictionary(IDictionary dictionary) + { + if (dictionary == null) + { + return; + } + _innerDictionary = new Dictionary(dictionary); + } + + public ChangeTrackingDictionary(IReadOnlyDictionary dictionary) + { + if (dictionary == null) + { + return; + } + _innerDictionary = new Dictionary(); + foreach (var pair in dictionary) + { + _innerDictionary.Add(pair); + } + } + + public bool IsUndefined => _innerDictionary == null; + + public int Count => IsUndefined ? 0 : EnsureDictionary().Count; + + public bool IsReadOnly => IsUndefined ? false : EnsureDictionary().IsReadOnly; + + public ICollection Keys => IsUndefined ? Array.Empty() : EnsureDictionary().Keys; + + public ICollection Values => IsUndefined ? Array.Empty() : EnsureDictionary().Values; + + public TValue this[TKey key] + { + get + { + if (IsUndefined) + { + throw new KeyNotFoundException(nameof(key)); + } + return EnsureDictionary()[key]; + } + set + { + EnsureDictionary()[key] = value; + } + } + + IEnumerable IReadOnlyDictionary.Keys => Keys; + + IEnumerable IReadOnlyDictionary.Values => Values; + + public IEnumerator> GetEnumerator() + { + if (IsUndefined) + { + IEnumerator> enumerateEmpty() + { + yield break; + } + return enumerateEmpty(); + } + return EnsureDictionary().GetEnumerator(); + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetEnumerator(); + } + + public void Add(KeyValuePair item) + { + EnsureDictionary().Add(item); + } + + public void Clear() + { + EnsureDictionary().Clear(); + } + + public bool Contains(KeyValuePair item) + { + if (IsUndefined) + { + return false; + } + return EnsureDictionary().Contains(item); + } + + public void CopyTo(KeyValuePair[] array, int index) + { + if (IsUndefined) + { + return; + } + EnsureDictionary().CopyTo(array, index); + } + + public bool Remove(KeyValuePair item) + { + if (IsUndefined) + { + return false; + } + return EnsureDictionary().Remove(item); + } + + public void Add(TKey key, TValue value) + { + EnsureDictionary().Add(key, value); + } + + public bool ContainsKey(TKey key) + { + if (IsUndefined) + { + return false; + } + return EnsureDictionary().ContainsKey(key); + } + + public bool Remove(TKey key) + { + if (IsUndefined) + { + return false; + } + return EnsureDictionary().Remove(key); + } + + public bool TryGetValue(TKey key, out TValue value) + { + if (IsUndefined) + { + value = default; + return false; + } + return EnsureDictionary().TryGetValue(key, out value); + } + + public IDictionary EnsureDictionary() + { + return _innerDictionary ??= new Dictionary(); + } + } +} diff --git a/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Internal/ChangeTrackingList.cs b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Internal/ChangeTrackingList.cs new file mode 100644 index 000000000000..f5a2dd110e6e --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Internal/ChangeTrackingList.cs @@ -0,0 +1,153 @@ +// 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.Linq; + +namespace Azure.ResourceManager.DatabaseFleetManager +{ + internal class ChangeTrackingList : IList, IReadOnlyList + { + private IList _innerList; + + public ChangeTrackingList() + { + } + + public ChangeTrackingList(IList innerList) + { + if (innerList != null) + { + _innerList = innerList; + } + } + + public ChangeTrackingList(IReadOnlyList innerList) + { + if (innerList != null) + { + _innerList = innerList.ToList(); + } + } + + public bool IsUndefined => _innerList == null; + + public int Count => IsUndefined ? 0 : EnsureList().Count; + + public bool IsReadOnly => IsUndefined ? false : EnsureList().IsReadOnly; + + public T this[int index] + { + get + { + if (IsUndefined) + { + throw new ArgumentOutOfRangeException(nameof(index)); + } + return EnsureList()[index]; + } + set + { + if (IsUndefined) + { + throw new ArgumentOutOfRangeException(nameof(index)); + } + EnsureList()[index] = value; + } + } + + public void Reset() + { + _innerList = null; + } + + public IEnumerator GetEnumerator() + { + if (IsUndefined) + { + IEnumerator enumerateEmpty() + { + yield break; + } + return enumerateEmpty(); + } + return EnsureList().GetEnumerator(); + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetEnumerator(); + } + + public void Add(T item) + { + EnsureList().Add(item); + } + + public void Clear() + { + EnsureList().Clear(); + } + + public bool Contains(T item) + { + if (IsUndefined) + { + return false; + } + return EnsureList().Contains(item); + } + + public void CopyTo(T[] array, int arrayIndex) + { + if (IsUndefined) + { + return; + } + EnsureList().CopyTo(array, arrayIndex); + } + + public bool Remove(T item) + { + if (IsUndefined) + { + return false; + } + return EnsureList().Remove(item); + } + + public int IndexOf(T item) + { + if (IsUndefined) + { + return -1; + } + return EnsureList().IndexOf(item); + } + + public void Insert(int index, T item) + { + EnsureList().Insert(index, item); + } + + public void RemoveAt(int index) + { + if (IsUndefined) + { + throw new ArgumentOutOfRangeException(nameof(index)); + } + EnsureList().RemoveAt(index); + } + + public IList EnsureList() + { + return _innerList ??= new List(); + } + } +} diff --git a/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Internal/ModelSerializationExtensions.cs b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Internal/ModelSerializationExtensions.cs new file mode 100644 index 000000000000..7b4300aa8f94 --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Internal/ModelSerializationExtensions.cs @@ -0,0 +1,398 @@ +// 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.Diagnostics; +using System.Globalization; +using System.Text.Json; +using System.Xml; +using Azure.Core; + +namespace Azure.ResourceManager.DatabaseFleetManager +{ + internal static class ModelSerializationExtensions + { + internal static readonly ModelReaderWriterOptions WireOptions = new ModelReaderWriterOptions("W"); + + public static object GetObject(this JsonElement element) + { + switch (element.ValueKind) + { + case JsonValueKind.String: + return element.GetString(); + case JsonValueKind.Number: + if (element.TryGetInt32(out int intValue)) + { + return intValue; + } + if (element.TryGetInt64(out long longValue)) + { + return longValue; + } + return element.GetDouble(); + case JsonValueKind.True: + return true; + case JsonValueKind.False: + return false; + case JsonValueKind.Undefined: + case JsonValueKind.Null: + return null; + case JsonValueKind.Object: + var dictionary = new Dictionary(); + foreach (var jsonProperty in element.EnumerateObject()) + { + dictionary.Add(jsonProperty.Name, jsonProperty.Value.GetObject()); + } + return dictionary; + case JsonValueKind.Array: + var list = new List(); + foreach (var item in element.EnumerateArray()) + { + list.Add(item.GetObject()); + } + return list.ToArray(); + default: + throw new NotSupportedException($"Not supported value kind {element.ValueKind}"); + } + } + + public static byte[] GetBytesFromBase64(this JsonElement element, string format) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + + return format switch + { + "U" => TypeFormatters.FromBase64UrlString(element.GetRequiredString()), + "D" => element.GetBytesFromBase64(), + _ => throw new ArgumentException($"Format is not supported: '{format}'", nameof(format)) + }; + } + + public static DateTimeOffset GetDateTimeOffset(this JsonElement element, string format) => format switch + { + "U" when element.ValueKind == JsonValueKind.Number => DateTimeOffset.FromUnixTimeSeconds(element.GetInt64()), + _ => TypeFormatters.ParseDateTimeOffset(element.GetString(), format) + }; + + public static TimeSpan GetTimeSpan(this JsonElement element, string format) => TypeFormatters.ParseTimeSpan(element.GetString(), format); + + public static char GetChar(this JsonElement element) + { + if (element.ValueKind == JsonValueKind.String) + { + var text = element.GetString(); + if (text == null || text.Length != 1) + { + throw new NotSupportedException($"Cannot convert \"{text}\" to a char"); + } + return text[0]; + } + else + { + throw new NotSupportedException($"Cannot convert {element.ValueKind} to a char"); + } + } + + [Conditional("DEBUG")] + public static void ThrowNonNullablePropertyIsNull(this JsonProperty property) + { + throw new JsonException($"A property '{property.Name}' defined as non-nullable but received as null from the service. This exception only happens in DEBUG builds of the library and would be ignored in the release build"); + } + + public static string GetRequiredString(this JsonElement element) + { + var value = element.GetString(); + if (value == null) + { + throw new InvalidOperationException($"The requested operation requires an element of type 'String', but the target element has type '{element.ValueKind}'."); + } + return value; + } + + public static void WriteStringValue(this Utf8JsonWriter writer, DateTimeOffset value, string format) + { + writer.WriteStringValue(TypeFormatters.ToString(value, format)); + } + + public static void WriteStringValue(this Utf8JsonWriter writer, DateTime value, string format) + { + writer.WriteStringValue(TypeFormatters.ToString(value, format)); + } + + public static void WriteStringValue(this Utf8JsonWriter writer, TimeSpan value, string format) + { + writer.WriteStringValue(TypeFormatters.ToString(value, format)); + } + + public static void WriteStringValue(this Utf8JsonWriter writer, char value) + { + writer.WriteStringValue(value.ToString(CultureInfo.InvariantCulture)); + } + + public static void WriteBase64StringValue(this Utf8JsonWriter writer, byte[] value, string format) + { + if (value == null) + { + writer.WriteNullValue(); + return; + } + switch (format) + { + case "U": + writer.WriteStringValue(TypeFormatters.ToBase64UrlString(value)); + break; + case "D": + writer.WriteBase64StringValue(value); + break; + default: + throw new ArgumentException($"Format is not supported: '{format}'", nameof(format)); + } + } + + public static void WriteNumberValue(this Utf8JsonWriter writer, DateTimeOffset value, string format) + { + if (format != "U") + { + throw new ArgumentOutOfRangeException(nameof(format), "Only 'U' format is supported when writing a DateTimeOffset as a Number."); + } + writer.WriteNumberValue(value.ToUnixTimeSeconds()); + } + + public static void WriteObjectValue(this Utf8JsonWriter writer, T value, ModelReaderWriterOptions options = null) + { + switch (value) + { + case null: + writer.WriteNullValue(); + break; + case IJsonModel jsonModel: + jsonModel.Write(writer, options ?? WireOptions); + break; + case IUtf8JsonSerializable serializable: + serializable.Write(writer); + break; + case byte[] bytes: + writer.WriteBase64StringValue(bytes); + break; + case BinaryData bytes0: + writer.WriteBase64StringValue(bytes0); + break; + case JsonElement json: + json.WriteTo(writer); + break; + case int i: + writer.WriteNumberValue(i); + break; + case decimal d: + writer.WriteNumberValue(d); + break; + case double d0: + if (double.IsNaN(d0)) + { + writer.WriteStringValue("NaN"); + } + else + { + writer.WriteNumberValue(d0); + } + break; + case float f: + writer.WriteNumberValue(f); + break; + case long l: + writer.WriteNumberValue(l); + break; + case string s: + writer.WriteStringValue(s); + break; + case bool b: + writer.WriteBooleanValue(b); + break; + case Guid g: + writer.WriteStringValue(g); + break; + case DateTimeOffset dateTimeOffset: + writer.WriteStringValue(dateTimeOffset, "O"); + break; + case DateTime dateTime: + writer.WriteStringValue(dateTime, "O"); + break; + case IEnumerable> enumerable: + writer.WriteStartObject(); + foreach (var pair in enumerable) + { + writer.WritePropertyName(pair.Key); + writer.WriteObjectValue(pair.Value, options); + } + writer.WriteEndObject(); + break; + case IEnumerable objectEnumerable: + writer.WriteStartArray(); + foreach (var item in objectEnumerable) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + break; + case TimeSpan timeSpan: + writer.WriteStringValue(timeSpan, "P"); + break; + default: + throw new NotSupportedException($"Not supported type {value.GetType()}"); + } + } + + public static void WriteObjectValue(this Utf8JsonWriter writer, object value, ModelReaderWriterOptions options = null) + { + writer.WriteObjectValue(value, options); + } + + internal static class TypeFormatters + { + private const string RoundtripZFormat = "yyyy-MM-ddTHH:mm:ss.fffffffZ"; + public const string DefaultNumberFormat = "G"; + + public static string ToString(bool value) => value ? "true" : "false"; + + public static string ToString(DateTime value, string format) => value.Kind switch + { + DateTimeKind.Utc => ToString((DateTimeOffset)value, format), + _ => throw new NotSupportedException($"DateTime {value} has a Kind of {value.Kind}. Azure SDK requires it to be UTC. You can call DateTime.SpecifyKind to change Kind property value to DateTimeKind.Utc.") + }; + + public static string ToString(DateTimeOffset value, string format) => format switch + { + "D" => value.ToString("yyyy-MM-dd", CultureInfo.InvariantCulture), + "U" => value.ToUnixTimeSeconds().ToString(CultureInfo.InvariantCulture), + "O" => value.ToUniversalTime().ToString(RoundtripZFormat, CultureInfo.InvariantCulture), + "o" => value.ToUniversalTime().ToString(RoundtripZFormat, CultureInfo.InvariantCulture), + "R" => value.ToString("r", CultureInfo.InvariantCulture), + _ => value.ToString(format, CultureInfo.InvariantCulture) + }; + + public static string ToString(TimeSpan value, string format) => format switch + { + "P" => XmlConvert.ToString(value), + _ => value.ToString(format, CultureInfo.InvariantCulture) + }; + + public static string ToString(byte[] value, string format) => format switch + { + "U" => ToBase64UrlString(value), + "D" => Convert.ToBase64String(value), + _ => throw new ArgumentException($"Format is not supported: '{format}'", nameof(format)) + }; + + public static string ToBase64UrlString(byte[] value) + { + int numWholeOrPartialInputBlocks = checked(value.Length + 2) / 3; + int size = checked(numWholeOrPartialInputBlocks * 4); + char[] output = new char[size]; + + int numBase64Chars = Convert.ToBase64CharArray(value, 0, value.Length, output, 0); + + int i = 0; + for (; i < numBase64Chars; i++) + { + char ch = output[i]; + if (ch == '+') + { + output[i] = '-'; + } + else + { + if (ch == '/') + { + output[i] = '_'; + } + else + { + if (ch == '=') + { + break; + } + } + } + } + + return new string(output, 0, i); + } + + public static byte[] FromBase64UrlString(string value) + { + int paddingCharsToAdd = (value.Length % 4) switch + { + 0 => 0, + 2 => 2, + 3 => 1, + _ => throw new InvalidOperationException("Malformed input") + }; + char[] output = new char[(value.Length + paddingCharsToAdd)]; + int i = 0; + for (; i < value.Length; i++) + { + char ch = value[i]; + if (ch == '-') + { + output[i] = '+'; + } + else + { + if (ch == '_') + { + output[i] = '/'; + } + else + { + output[i] = ch; + } + } + } + + for (; i < output.Length; i++) + { + output[i] = '='; + } + + return Convert.FromBase64CharArray(output, 0, output.Length); + } + + public static DateTimeOffset ParseDateTimeOffset(string value, string format) => format switch + { + "U" => DateTimeOffset.FromUnixTimeSeconds(long.Parse(value, CultureInfo.InvariantCulture)), + _ => DateTimeOffset.Parse(value, CultureInfo.InvariantCulture, DateTimeStyles.AssumeUniversal) + }; + + public static TimeSpan ParseTimeSpan(string value, string format) => format switch + { + "P" => XmlConvert.ToTimeSpan(value), + _ => TimeSpan.ParseExact(value, format, CultureInfo.InvariantCulture) + }; + + public static string ConvertToString(object value, string format = null) => value switch + { + null => "null", + string s => s, + bool b => ToString(b), + int or float or double or long or decimal => ((IFormattable)value).ToString(DefaultNumberFormat, CultureInfo.InvariantCulture), + byte[] b0 when format != null => ToString(b0, format), + IEnumerable s0 => string.Join(",", s0), + DateTimeOffset dateTime when format != null => ToString(dateTime, format), + TimeSpan timeSpan when format != null => ToString(timeSpan, format), + TimeSpan timeSpan0 => XmlConvert.ToString(timeSpan0), + Guid guid => guid.ToString(), + BinaryData binaryData => ConvertToString(binaryData.ToArray(), format), + _ => value.ToString() + }; + } + } +} diff --git a/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Internal/Optional.cs b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Internal/Optional.cs new file mode 100644 index 000000000000..c0a6938f59ff --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Internal/Optional.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; + +namespace Azure.ResourceManager.DatabaseFleetManager +{ + internal static class Optional + { + public static bool IsCollectionDefined(IEnumerable collection) + { + return !(collection is ChangeTrackingList changeTrackingList && changeTrackingList.IsUndefined); + } + + public static bool IsCollectionDefined(IDictionary collection) + { + return !(collection is ChangeTrackingDictionary changeTrackingDictionary && changeTrackingDictionary.IsUndefined); + } + + public static bool IsCollectionDefined(IReadOnlyDictionary collection) + { + return !(collection is ChangeTrackingDictionary changeTrackingDictionary && changeTrackingDictionary.IsUndefined); + } + + public static bool IsDefined(T? value) + where T : struct + { + return value.HasValue; + } + + public static bool IsDefined(object value) + { + return value != null; + } + + public static bool IsDefined(JsonElement value) + { + return value.ValueKind != JsonValueKind.Undefined; + } + + public static bool IsDefined(string value) + { + return value != null; + } + } +} diff --git a/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Internal/Utf8JsonRequestContent.cs b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Internal/Utf8JsonRequestContent.cs new file mode 100644 index 000000000000..39c287294c4d --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Internal/Utf8JsonRequestContent.cs @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.IO; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; + +namespace Azure.ResourceManager.DatabaseFleetManager +{ + internal class Utf8JsonRequestContent : RequestContent + { + private readonly MemoryStream _stream; + private readonly RequestContent _content; + + public Utf8JsonRequestContent() + { + _stream = new MemoryStream(); + _content = Create(_stream); + JsonWriter = new Utf8JsonWriter(_stream); + } + + public Utf8JsonWriter JsonWriter { get; } + + public override async Task WriteToAsync(Stream stream, CancellationToken cancellationToken = default) + { + await JsonWriter.FlushAsync().ConfigureAwait(false); + await _content.WriteToAsync(stream, cancellationToken).ConfigureAwait(false); + } + + public override void WriteTo(Stream stream, CancellationToken cancellationToken = default) + { + JsonWriter.Flush(); + _content.WriteTo(stream, cancellationToken); + } + + public override bool TryComputeLength(out long length) + { + length = JsonWriter.BytesCommitted + JsonWriter.BytesPending; + return true; + } + + public override void Dispose() + { + JsonWriter.Dispose(); + _content.Dispose(); + _stream.Dispose(); + } + } +} diff --git a/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/LongRunningOperation/DatabaseFleetManagerArmOperation.cs b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/LongRunningOperation/DatabaseFleetManagerArmOperation.cs new file mode 100644 index 000000000000..6fd3fa7a1c7a --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/LongRunningOperation/DatabaseFleetManagerArmOperation.cs @@ -0,0 +1,94 @@ +// 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.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.DatabaseFleetManager +{ +#pragma warning disable SA1649 // File name should match first type name + internal class DatabaseFleetManagerArmOperation : ArmOperation +#pragma warning restore SA1649 // File name should match first type name + { + private readonly OperationInternal _operation; + private readonly RehydrationToken? _completeRehydrationToken; + private readonly NextLinkOperationImplementation _nextLinkOperation; + private readonly string _operationId; + + /// Initializes a new instance of DatabaseFleetManagerArmOperation for mocking. + protected DatabaseFleetManagerArmOperation() + { + } + + internal DatabaseFleetManagerArmOperation(Response response, RehydrationToken? rehydrationToken = null) + { + _operation = OperationInternal.Succeeded(response); + _completeRehydrationToken = rehydrationToken; + _operationId = GetOperationId(rehydrationToken); + } + + internal DatabaseFleetManagerArmOperation(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, Request request, Response response, OperationFinalStateVia finalStateVia, bool skipApiVersionOverride = false, string apiVersionOverrideValue = null) + { + var nextLinkOperation = NextLinkOperationImplementation.Create(pipeline, request.Method, request.Uri.ToUri(), response, finalStateVia, skipApiVersionOverride, apiVersionOverrideValue); + if (nextLinkOperation is NextLinkOperationImplementation nextLinkOperationValue) + { + _nextLinkOperation = nextLinkOperationValue; + _operationId = _nextLinkOperation.OperationId; + } + else + { + _completeRehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(request.Method, request.Uri.ToUri(), response, finalStateVia); + _operationId = GetOperationId(_completeRehydrationToken); + } + _operation = new OperationInternal(nextLinkOperation, clientDiagnostics, response, "DatabaseFleetManagerArmOperation", fallbackStrategy: new SequentialDelayStrategy()); + } + + private string GetOperationId(RehydrationToken? rehydrationToken) + { + if (rehydrationToken is null) + { + return null; + } + var lroDetails = ModelReaderWriter.Write(rehydrationToken, ModelReaderWriterOptions.Json).ToObjectFromJson>(); + return lroDetails["id"]; + } + /// + public override string Id => _operationId ?? NextLinkOperationImplementation.NotSet; + + /// + public override RehydrationToken? GetRehydrationToken() => _nextLinkOperation?.GetRehydrationToken() ?? _completeRehydrationToken; + + /// + public override bool HasCompleted => _operation.HasCompleted; + + /// + public override Response GetRawResponse() => _operation.RawResponse; + + /// + public override Response UpdateStatus(CancellationToken cancellationToken = default) => _operation.UpdateStatus(cancellationToken); + + /// + public override ValueTask UpdateStatusAsync(CancellationToken cancellationToken = default) => _operation.UpdateStatusAsync(cancellationToken); + + /// + public override Response WaitForCompletionResponse(CancellationToken cancellationToken = default) => _operation.WaitForCompletionResponse(cancellationToken); + + /// + public override Response WaitForCompletionResponse(TimeSpan pollingInterval, CancellationToken cancellationToken = default) => _operation.WaitForCompletionResponse(pollingInterval, cancellationToken); + + /// + public override ValueTask WaitForCompletionResponseAsync(CancellationToken cancellationToken = default) => _operation.WaitForCompletionResponseAsync(cancellationToken); + + /// + public override ValueTask WaitForCompletionResponseAsync(TimeSpan pollingInterval, CancellationToken cancellationToken = default) => _operation.WaitForCompletionResponseAsync(pollingInterval, cancellationToken); + } +} diff --git a/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/LongRunningOperation/DatabaseFleetManagerArmOperationOfT.cs b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/LongRunningOperation/DatabaseFleetManagerArmOperationOfT.cs new file mode 100644 index 000000000000..86c5d39dd20e --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/LongRunningOperation/DatabaseFleetManagerArmOperationOfT.cs @@ -0,0 +1,100 @@ +// 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.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.DatabaseFleetManager +{ +#pragma warning disable SA1649 // File name should match first type name + internal class DatabaseFleetManagerArmOperation : ArmOperation +#pragma warning restore SA1649 // File name should match first type name + { + private readonly OperationInternal _operation; + private readonly RehydrationToken? _completeRehydrationToken; + private readonly NextLinkOperationImplementation _nextLinkOperation; + private readonly string _operationId; + + /// Initializes a new instance of DatabaseFleetManagerArmOperation for mocking. + protected DatabaseFleetManagerArmOperation() + { + } + + internal DatabaseFleetManagerArmOperation(Response response, RehydrationToken? rehydrationToken = null) + { + _operation = OperationInternal.Succeeded(response.GetRawResponse(), response.Value); + _completeRehydrationToken = rehydrationToken; + _operationId = GetOperationId(rehydrationToken); + } + + internal DatabaseFleetManagerArmOperation(IOperationSource source, ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, Request request, Response response, OperationFinalStateVia finalStateVia, bool skipApiVersionOverride = false, string apiVersionOverrideValue = null) + { + var nextLinkOperation = NextLinkOperationImplementation.Create(pipeline, request.Method, request.Uri.ToUri(), response, finalStateVia, skipApiVersionOverride, apiVersionOverrideValue); + if (nextLinkOperation is NextLinkOperationImplementation nextLinkOperationValue) + { + _nextLinkOperation = nextLinkOperationValue; + _operationId = _nextLinkOperation.OperationId; + } + else + { + _completeRehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(request.Method, request.Uri.ToUri(), response, finalStateVia); + _operationId = GetOperationId(_completeRehydrationToken); + } + _operation = new OperationInternal(NextLinkOperationImplementation.Create(source, nextLinkOperation), clientDiagnostics, response, "DatabaseFleetManagerArmOperation", fallbackStrategy: new SequentialDelayStrategy()); + } + + private string GetOperationId(RehydrationToken? rehydrationToken) + { + if (rehydrationToken is null) + { + return null; + } + var lroDetails = ModelReaderWriter.Write(rehydrationToken, ModelReaderWriterOptions.Json).ToObjectFromJson>(); + return lroDetails["id"]; + } + /// + public override string Id => _operationId ?? NextLinkOperationImplementation.NotSet; + + /// + public override RehydrationToken? GetRehydrationToken() => _nextLinkOperation?.GetRehydrationToken() ?? _completeRehydrationToken; + + /// + public override T Value => _operation.Value; + + /// + public override bool HasValue => _operation.HasValue; + + /// + public override bool HasCompleted => _operation.HasCompleted; + + /// + public override Response GetRawResponse() => _operation.RawResponse; + + /// + public override Response UpdateStatus(CancellationToken cancellationToken = default) => _operation.UpdateStatus(cancellationToken); + + /// + public override ValueTask UpdateStatusAsync(CancellationToken cancellationToken = default) => _operation.UpdateStatusAsync(cancellationToken); + + /// + public override Response WaitForCompletion(CancellationToken cancellationToken = default) => _operation.WaitForCompletion(cancellationToken); + + /// + public override Response WaitForCompletion(TimeSpan pollingInterval, CancellationToken cancellationToken = default) => _operation.WaitForCompletion(pollingInterval, cancellationToken); + + /// + public override ValueTask> WaitForCompletionAsync(CancellationToken cancellationToken = default) => _operation.WaitForCompletionAsync(cancellationToken); + + /// + public override ValueTask> WaitForCompletionAsync(TimeSpan pollingInterval, CancellationToken cancellationToken = default) => _operation.WaitForCompletionAsync(pollingInterval, cancellationToken); + } +} diff --git a/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/LongRunningOperation/FirewallRuleOperationSource.cs b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/LongRunningOperation/FirewallRuleOperationSource.cs new file mode 100644 index 000000000000..97afe8ed8c2b --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/LongRunningOperation/FirewallRuleOperationSource.cs @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; + +namespace Azure.ResourceManager.DatabaseFleetManager +{ + internal class FirewallRuleOperationSource : IOperationSource + { + private readonly ArmClient _client; + + internal FirewallRuleOperationSource(ArmClient client) + { + _client = client; + } + + FirewallRuleResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) + { + using var document = JsonDocument.Parse(response.ContentStream); + var data = FirewallRuleData.DeserializeFirewallRuleData(document.RootElement); + return new FirewallRuleResource(_client, data); + } + + async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) + { + using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false); + var data = FirewallRuleData.DeserializeFirewallRuleData(document.RootElement); + return new FirewallRuleResource(_client, data); + } + } +} diff --git a/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/LongRunningOperation/FleetDatabaseOperationSource.cs b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/LongRunningOperation/FleetDatabaseOperationSource.cs new file mode 100644 index 000000000000..a24ad2dc050e --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/LongRunningOperation/FleetDatabaseOperationSource.cs @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; + +namespace Azure.ResourceManager.DatabaseFleetManager +{ + internal class FleetDatabaseOperationSource : IOperationSource + { + private readonly ArmClient _client; + + internal FleetDatabaseOperationSource(ArmClient client) + { + _client = client; + } + + FleetDatabaseResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) + { + using var document = JsonDocument.Parse(response.ContentStream); + var data = FleetDatabaseData.DeserializeFleetDatabaseData(document.RootElement); + return new FleetDatabaseResource(_client, data); + } + + async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) + { + using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false); + var data = FleetDatabaseData.DeserializeFleetDatabaseData(document.RootElement); + return new FleetDatabaseResource(_client, data); + } + } +} diff --git a/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/LongRunningOperation/FleetOperationSource.cs b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/LongRunningOperation/FleetOperationSource.cs new file mode 100644 index 000000000000..e17ae752c2b7 --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/LongRunningOperation/FleetOperationSource.cs @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; + +namespace Azure.ResourceManager.DatabaseFleetManager +{ + internal class FleetOperationSource : IOperationSource + { + private readonly ArmClient _client; + + internal FleetOperationSource(ArmClient client) + { + _client = client; + } + + FleetResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) + { + using var document = JsonDocument.Parse(response.ContentStream); + var data = FleetData.DeserializeFleetData(document.RootElement); + return new FleetResource(_client, data); + } + + async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) + { + using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false); + var data = FleetData.DeserializeFleetData(document.RootElement); + return new FleetResource(_client, data); + } + } +} diff --git a/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/LongRunningOperation/FleetTierOperationSource.cs b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/LongRunningOperation/FleetTierOperationSource.cs new file mode 100644 index 000000000000..509009db7d91 --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/LongRunningOperation/FleetTierOperationSource.cs @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; + +namespace Azure.ResourceManager.DatabaseFleetManager +{ + internal class FleetTierOperationSource : IOperationSource + { + private readonly ArmClient _client; + + internal FleetTierOperationSource(ArmClient client) + { + _client = client; + } + + FleetTierResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) + { + using var document = JsonDocument.Parse(response.ContentStream); + var data = FleetTierData.DeserializeFleetTierData(document.RootElement); + return new FleetTierResource(_client, data); + } + + async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) + { + using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false); + var data = FleetTierData.DeserializeFleetTierData(document.RootElement); + return new FleetTierResource(_client, data); + } + } +} diff --git a/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/LongRunningOperation/FleetspaceOperationSource.cs b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/LongRunningOperation/FleetspaceOperationSource.cs new file mode 100644 index 000000000000..175c596339cc --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/LongRunningOperation/FleetspaceOperationSource.cs @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; + +namespace Azure.ResourceManager.DatabaseFleetManager +{ + internal class FleetspaceOperationSource : IOperationSource + { + private readonly ArmClient _client; + + internal FleetspaceOperationSource(ArmClient client) + { + _client = client; + } + + FleetspaceResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) + { + using var document = JsonDocument.Parse(response.ContentStream); + var data = FleetspaceData.DeserializeFleetspaceData(document.RootElement); + return new FleetspaceResource(_client, data); + } + + async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) + { + using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false); + var data = FleetspaceData.DeserializeFleetspaceData(document.RootElement); + return new FleetspaceResource(_client, data); + } + } +} diff --git a/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/AzureProvisioningState.cs b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/AzureProvisioningState.cs new file mode 100644 index 000000000000..c073fa2c2d75 --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/AzureProvisioningState.cs @@ -0,0 +1,60 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.DatabaseFleetManager.Models +{ + /// The provisioning state of the resource. + public readonly partial struct AzureProvisioningState : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public AzureProvisioningState(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string SucceededValue = "Succeeded"; + private const string FailedValue = "Failed"; + private const string CanceledValue = "Canceled"; + private const string ProvisioningValue = "Provisioning"; + private const string AcceptedValue = "Accepted"; + + /// Resource has been created. + public static AzureProvisioningState Succeeded { get; } = new AzureProvisioningState(SucceededValue); + /// Resource creation failed. + public static AzureProvisioningState Failed { get; } = new AzureProvisioningState(FailedValue); + /// Resource creation was canceled. + public static AzureProvisioningState Canceled { get; } = new AzureProvisioningState(CanceledValue); + /// Resource is provisioning. + public static AzureProvisioningState Provisioning { get; } = new AzureProvisioningState(ProvisioningValue); + /// Request on the resource has been accepted. + public static AzureProvisioningState Accepted { get; } = new AzureProvisioningState(AcceptedValue); + /// Determines if two values are the same. + public static bool operator ==(AzureProvisioningState left, AzureProvisioningState right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(AzureProvisioningState left, AzureProvisioningState right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator AzureProvisioningState(string value) => new AzureProvisioningState(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is AzureProvisioningState other && Equals(other); + /// + public bool Equals(AzureProvisioningState other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/DatabaseChangeTierProperties.Serialization.cs b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/DatabaseChangeTierProperties.Serialization.cs new file mode 100644 index 000000000000..6753c31c8182 --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/DatabaseChangeTierProperties.Serialization.cs @@ -0,0 +1,129 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.DatabaseFleetManager.Models +{ + public partial class DatabaseChangeTierProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DatabaseChangeTierProperties)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(TargetTierName)) + { + writer.WritePropertyName("targetTierName"u8); + writer.WriteStringValue(TargetTierName); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + DatabaseChangeTierProperties 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(DatabaseChangeTierProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDatabaseChangeTierProperties(document.RootElement, options); + } + + internal static DatabaseChangeTierProperties DeserializeDatabaseChangeTierProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string targetTierName = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("targetTierName"u8)) + { + targetTierName = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DatabaseChangeTierProperties(targetTierName, 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(DatabaseChangeTierProperties)} does not support writing '{options.Format}' format."); + } + } + + DatabaseChangeTierProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeDatabaseChangeTierProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DatabaseChangeTierProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/DatabaseChangeTierProperties.cs b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/DatabaseChangeTierProperties.cs new file mode 100644 index 000000000000..8a70c7397149 --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/DatabaseChangeTierProperties.cs @@ -0,0 +1,65 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.DatabaseFleetManager.Models +{ + /// A database change tier definition. + public partial class DatabaseChangeTierProperties + { + /// + /// 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 DatabaseChangeTierProperties() + { + } + + /// Initializes a new instance of . + /// A target tier name. + /// Keeps track of any properties unknown to the library. + internal DatabaseChangeTierProperties(string targetTierName, IDictionary serializedAdditionalRawData) + { + TargetTierName = targetTierName; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// A target tier name. + public string TargetTierName { get; set; } + } +} diff --git a/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/DatabaseCreateMode.cs b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/DatabaseCreateMode.cs new file mode 100644 index 000000000000..cc3388d3483e --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/DatabaseCreateMode.cs @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.DatabaseFleetManager.Models +{ + /// Create mode. Available options: Default - Create a database. Copy - Copy the source database (source database name must be specified) PointInTimeRestore - Create a database by restoring source database from a point in time (source database name and restore from time must be specified). + public readonly partial struct DatabaseCreateMode : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public DatabaseCreateMode(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string DefaultValue = "Default"; + private const string CopyValue = "Copy"; + private const string PointInTimeRestoreValue = "PointInTimeRestore"; + + /// Create a database. + public static DatabaseCreateMode Default { get; } = new DatabaseCreateMode(DefaultValue); + /// Copy the source database (source database name must be specified). + public static DatabaseCreateMode Copy { get; } = new DatabaseCreateMode(CopyValue); + /// Create a database by restoring source database from a point in time (source database name and restore from time must be specified). + public static DatabaseCreateMode PointInTimeRestore { get; } = new DatabaseCreateMode(PointInTimeRestoreValue); + /// Determines if two values are the same. + public static bool operator ==(DatabaseCreateMode left, DatabaseCreateMode right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(DatabaseCreateMode left, DatabaseCreateMode right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator DatabaseCreateMode(string value) => new DatabaseCreateMode(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is DatabaseCreateMode other && Equals(other); + /// + public bool Equals(DatabaseCreateMode other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/DatabaseIdentity.Serialization.cs b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/DatabaseIdentity.Serialization.cs new file mode 100644 index 000000000000..a57846ee71d1 --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/DatabaseIdentity.Serialization.cs @@ -0,0 +1,163 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.DatabaseFleetManager.Models +{ + public partial class DatabaseIdentity : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DatabaseIdentity)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(ResourceId)) + { + writer.WritePropertyName("resourceId"u8); + writer.WriteStringValue(ResourceId); + } + if (Optional.IsDefined(PrincipalId)) + { + writer.WritePropertyName("principalId"u8); + writer.WriteStringValue(PrincipalId.Value); + } + if (Optional.IsDefined(ClientId)) + { + writer.WritePropertyName("clientId"u8); + writer.WriteStringValue(ClientId.Value); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + DatabaseIdentity 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(DatabaseIdentity)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDatabaseIdentity(document.RootElement, options); + } + + internal static DatabaseIdentity DeserializeDatabaseIdentity(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ResourceIdentifier resourceId = default; + Guid? principalId = default; + Guid? clientId = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("resourceId"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + resourceId = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("principalId"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + principalId = property.Value.GetGuid(); + continue; + } + if (property.NameEquals("clientId"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + clientId = property.Value.GetGuid(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DatabaseIdentity(resourceId, principalId, clientId, 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(DatabaseIdentity)} does not support writing '{options.Format}' format."); + } + } + + DatabaseIdentity IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeDatabaseIdentity(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DatabaseIdentity)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/DatabaseIdentity.cs b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/DatabaseIdentity.cs new file mode 100644 index 000000000000..67808bbeb8a3 --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/DatabaseIdentity.cs @@ -0,0 +1,74 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.ResourceManager.DatabaseFleetManager.Models +{ + /// Database Identity properties. + public partial class DatabaseIdentity + { + /// + /// 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 DatabaseIdentity() + { + } + + /// Initializes a new instance of . + /// Resource Id of the database identity. + /// Principal Id of the database identity. + /// Client Id of the database identity. + /// Keeps track of any properties unknown to the library. + internal DatabaseIdentity(ResourceIdentifier resourceId, Guid? principalId, Guid? clientId, IDictionary serializedAdditionalRawData) + { + ResourceId = resourceId; + PrincipalId = principalId; + ClientId = clientId; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Resource Id of the database identity. + public ResourceIdentifier ResourceId { get; set; } + /// Principal Id of the database identity. + public Guid? PrincipalId { get; set; } + /// Client Id of the database identity. + public Guid? ClientId { get; set; } + } +} diff --git a/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/DatabaseRenameProperties.Serialization.cs b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/DatabaseRenameProperties.Serialization.cs new file mode 100644 index 000000000000..188168354289 --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/DatabaseRenameProperties.Serialization.cs @@ -0,0 +1,129 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.DatabaseFleetManager.Models +{ + public partial class DatabaseRenameProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DatabaseRenameProperties)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(NewName)) + { + writer.WritePropertyName("newName"u8); + writer.WriteStringValue(NewName); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + DatabaseRenameProperties 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(DatabaseRenameProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDatabaseRenameProperties(document.RootElement, options); + } + + internal static DatabaseRenameProperties DeserializeDatabaseRenameProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string newName = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("newName"u8)) + { + newName = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DatabaseRenameProperties(newName, 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(DatabaseRenameProperties)} does not support writing '{options.Format}' format."); + } + } + + DatabaseRenameProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeDatabaseRenameProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DatabaseRenameProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/DatabaseRenameProperties.cs b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/DatabaseRenameProperties.cs new file mode 100644 index 000000000000..214a1aebc3b1 --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/DatabaseRenameProperties.cs @@ -0,0 +1,65 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.DatabaseFleetManager.Models +{ + /// A database rename definition. + public partial class DatabaseRenameProperties + { + /// + /// 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 DatabaseRenameProperties() + { + } + + /// Initializes a new instance of . + /// New database name. + /// Keeps track of any properties unknown to the library. + internal DatabaseRenameProperties(string newName, IDictionary serializedAdditionalRawData) + { + NewName = newName; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// New database name. + public string NewName { get; set; } + } +} diff --git a/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/DestinationTierOverride.Serialization.cs b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/DestinationTierOverride.Serialization.cs new file mode 100644 index 000000000000..9d77d06c132d --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/DestinationTierOverride.Serialization.cs @@ -0,0 +1,142 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.DatabaseFleetManager.Models +{ + public partial class DestinationTierOverride : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DestinationTierOverride)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("resourceType"u8); + writer.WriteStringValue(ResourceType.ToString()); + writer.WritePropertyName("tierName"u8); + writer.WriteStringValue(TierName); + writer.WritePropertyName("resourceName"u8); + writer.WriteStringValue(ResourceName); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + DestinationTierOverride 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(DestinationTierOverride)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDestinationTierOverride(document.RootElement, options); + } + + internal static DestinationTierOverride DeserializeDestinationTierOverride(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ResourceType resourceType = default; + string tierName = default; + string resourceName = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("resourceType"u8)) + { + resourceType = new ResourceType(property.Value.GetString()); + continue; + } + if (property.NameEquals("tierName"u8)) + { + tierName = property.Value.GetString(); + continue; + } + if (property.NameEquals("resourceName"u8)) + { + resourceName = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DestinationTierOverride(resourceType, tierName, resourceName, 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(DestinationTierOverride)} does not support writing '{options.Format}' format."); + } + } + + DestinationTierOverride IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeDestinationTierOverride(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DestinationTierOverride)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/DestinationTierOverride.cs b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/DestinationTierOverride.cs new file mode 100644 index 000000000000..57d6395ac192 --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/DestinationTierOverride.cs @@ -0,0 +1,88 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.DatabaseFleetManager.Models +{ + /// A destination tier override. + public partial class DestinationTierOverride + { + /// + /// 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 . + /// Resource type. + /// Destination tier name. + /// Resource name. + /// or is null. + public DestinationTierOverride(ResourceType resourceType, string tierName, string resourceName) + { + Argument.AssertNotNull(tierName, nameof(tierName)); + Argument.AssertNotNull(resourceName, nameof(resourceName)); + + ResourceType = resourceType; + TierName = tierName; + ResourceName = resourceName; + } + + /// Initializes a new instance of . + /// Resource type. + /// Destination tier name. + /// Resource name. + /// Keeps track of any properties unknown to the library. + internal DestinationTierOverride(ResourceType resourceType, string tierName, string resourceName, IDictionary serializedAdditionalRawData) + { + ResourceType = resourceType; + TierName = tierName; + ResourceName = resourceName; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal DestinationTierOverride() + { + } + + /// Resource type. + public ResourceType ResourceType { get; } + /// Destination tier name. + public string TierName { get; } + /// Resource name. + public string ResourceName { get; } + } +} diff --git a/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/FirewallRuleListResult.Serialization.cs b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/FirewallRuleListResult.Serialization.cs new file mode 100644 index 000000000000..6d2d78e993de --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/FirewallRuleListResult.Serialization.cs @@ -0,0 +1,151 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.DatabaseFleetManager.Models +{ + internal partial class FirewallRuleListResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(FirewallRuleListResult)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var item in Value) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + if (Optional.IsDefined(NextLink)) + { + writer.WritePropertyName("nextLink"u8); + writer.WriteStringValue(NextLink.AbsoluteUri); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + FirewallRuleListResult 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(FirewallRuleListResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeFirewallRuleListResult(document.RootElement, options); + } + + internal static FirewallRuleListResult DeserializeFirewallRuleListResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IReadOnlyList value = default; + Uri nextLink = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(FirewallRuleData.DeserializeFirewallRuleData(item, options)); + } + value = array; + continue; + } + if (property.NameEquals("nextLink"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + nextLink = new Uri(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new FirewallRuleListResult(value, nextLink, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(FirewallRuleListResult)} does not support writing '{options.Format}' format."); + } + } + + FirewallRuleListResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeFirewallRuleListResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(FirewallRuleListResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/FirewallRuleListResult.cs b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/FirewallRuleListResult.cs new file mode 100644 index 000000000000..fac7d86244ec --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/FirewallRuleListResult.cs @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.ResourceManager.DatabaseFleetManager.Models +{ + /// The response of a FirewallRule list operation. + internal partial class FirewallRuleListResult + { + /// + /// 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 FirewallRule items on this page. + /// is null. + internal FirewallRuleListResult(IEnumerable value) + { + Argument.AssertNotNull(value, nameof(value)); + + Value = value.ToList(); + } + + /// Initializes a new instance of . + /// The FirewallRule items on this page. + /// The link to the next page of items. + /// Keeps track of any properties unknown to the library. + internal FirewallRuleListResult(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) + { + Value = value; + NextLink = nextLink; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal FirewallRuleListResult() + { + } + + /// The FirewallRule items on this page. + public IReadOnlyList Value { get; } + /// The link to the next page of items. + public Uri NextLink { get; } + } +} diff --git a/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/FirewallRuleProperties.Serialization.cs b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/FirewallRuleProperties.Serialization.cs new file mode 100644 index 000000000000..350af8ca7fc5 --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/FirewallRuleProperties.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; + +namespace Azure.ResourceManager.DatabaseFleetManager.Models +{ + public partial class FirewallRuleProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(FirewallRuleProperties)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(StartIPAddress)) + { + writer.WritePropertyName("startIpAddress"u8); + writer.WriteStringValue(StartIPAddress); + } + if (Optional.IsDefined(EndIPAddress)) + { + writer.WritePropertyName("endIpAddress"u8); + writer.WriteStringValue(EndIPAddress); + } + if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) + { + writer.WritePropertyName("provisioningState"u8); + writer.WriteStringValue(ProvisioningState.Value.ToString()); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + FirewallRuleProperties 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(FirewallRuleProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeFirewallRuleProperties(document.RootElement, options); + } + + internal static FirewallRuleProperties DeserializeFirewallRuleProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string startIPAddress = default; + string endIPAddress = default; + AzureProvisioningState? provisioningState = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("startIpAddress"u8)) + { + startIPAddress = property.Value.GetString(); + continue; + } + if (property.NameEquals("endIpAddress"u8)) + { + endIPAddress = property.Value.GetString(); + continue; + } + if (property.NameEquals("provisioningState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + provisioningState = new AzureProvisioningState(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new FirewallRuleProperties(startIPAddress, endIPAddress, provisioningState, 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(FirewallRuleProperties)} does not support writing '{options.Format}' format."); + } + } + + FirewallRuleProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeFirewallRuleProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(FirewallRuleProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/FirewallRuleProperties.cs b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/FirewallRuleProperties.cs new file mode 100644 index 000000000000..2bf604d4345e --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/FirewallRuleProperties.cs @@ -0,0 +1,73 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.DatabaseFleetManager.Models +{ + /// A Firewall rule properties. + public partial class FirewallRuleProperties + { + /// + /// 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 FirewallRuleProperties() + { + } + + /// Initializes a new instance of . + /// Start IP address. + /// End IP address. + /// Provisioning state. + /// Keeps track of any properties unknown to the library. + internal FirewallRuleProperties(string startIPAddress, string endIPAddress, AzureProvisioningState? provisioningState, IDictionary serializedAdditionalRawData) + { + StartIPAddress = startIPAddress; + EndIPAddress = endIPAddress; + ProvisioningState = provisioningState; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Start IP address. + public string StartIPAddress { get; set; } + /// End IP address. + public string EndIPAddress { get; set; } + /// Provisioning state. + public AzureProvisioningState? ProvisioningState { get; } + } +} diff --git a/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/FleetDatabaseListResult.Serialization.cs b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/FleetDatabaseListResult.Serialization.cs new file mode 100644 index 000000000000..715caa4906b5 --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/FleetDatabaseListResult.Serialization.cs @@ -0,0 +1,151 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.DatabaseFleetManager.Models +{ + internal partial class FleetDatabaseListResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(FleetDatabaseListResult)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var item in Value) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + if (Optional.IsDefined(NextLink)) + { + writer.WritePropertyName("nextLink"u8); + writer.WriteStringValue(NextLink.AbsoluteUri); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + FleetDatabaseListResult 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(FleetDatabaseListResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeFleetDatabaseListResult(document.RootElement, options); + } + + internal static FleetDatabaseListResult DeserializeFleetDatabaseListResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IReadOnlyList value = default; + Uri nextLink = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(FleetDatabaseData.DeserializeFleetDatabaseData(item, options)); + } + value = array; + continue; + } + if (property.NameEquals("nextLink"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + nextLink = new Uri(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new FleetDatabaseListResult(value, nextLink, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(FleetDatabaseListResult)} does not support writing '{options.Format}' format."); + } + } + + FleetDatabaseListResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeFleetDatabaseListResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(FleetDatabaseListResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/FleetDatabaseListResult.cs b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/FleetDatabaseListResult.cs new file mode 100644 index 000000000000..94d3204d6a4e --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/FleetDatabaseListResult.cs @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.ResourceManager.DatabaseFleetManager.Models +{ + /// The response of a FleetDatabase list operation. + internal partial class FleetDatabaseListResult + { + /// + /// 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 FleetDatabase items on this page. + /// is null. + internal FleetDatabaseListResult(IEnumerable value) + { + Argument.AssertNotNull(value, nameof(value)); + + Value = value.ToList(); + } + + /// Initializes a new instance of . + /// The FleetDatabase items on this page. + /// The link to the next page of items. + /// Keeps track of any properties unknown to the library. + internal FleetDatabaseListResult(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) + { + Value = value; + NextLink = nextLink; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal FleetDatabaseListResult() + { + } + + /// The FleetDatabase items on this page. + public IReadOnlyList Value { get; } + /// The link to the next page of items. + public Uri NextLink { get; } + } +} diff --git a/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/FleetDatabaseProperties.Serialization.cs b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/FleetDatabaseProperties.Serialization.cs new file mode 100644 index 000000000000..8ffd78cb6d06 --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/FleetDatabaseProperties.Serialization.cs @@ -0,0 +1,366 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.DatabaseFleetManager.Models +{ + public partial class FleetDatabaseProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(FleetDatabaseProperties)} does not support writing '{format}' format."); + } + + if (options.Format != "W" && Optional.IsDefined(OriginalDatabaseId)) + { + writer.WritePropertyName("originalDatabaseId"u8); + writer.WriteStringValue(OriginalDatabaseId); + } + if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) + { + writer.WritePropertyName("provisioningState"u8); + writer.WriteStringValue(ProvisioningState.Value.ToString()); + } + if (Optional.IsDefined(CreateMode)) + { + writer.WritePropertyName("createMode"u8); + writer.WriteStringValue(CreateMode.Value.ToString()); + } + if (Optional.IsDefined(TierName)) + { + writer.WritePropertyName("tierName"u8); + writer.WriteStringValue(TierName); + } + if (options.Format != "W" && Optional.IsDefined(ConnectionString)) + { + writer.WritePropertyName("connectionString"u8); + writer.WriteStringValue(ConnectionString); + } + if (options.Format != "W" && Optional.IsDefined(Recoverable)) + { + writer.WritePropertyName("recoverable"u8); + writer.WriteBooleanValue(Recoverable.Value); + } + if (Optional.IsDefined(RestoreFromOn)) + { + writer.WritePropertyName("restoreFromTime"u8); + writer.WriteStringValue(RestoreFromOn.Value, "O"); + } + if (options.Format != "W" && Optional.IsDefined(EarliestRestoreOn)) + { + writer.WritePropertyName("earliestRestoreTime"u8); + writer.WriteStringValue(EarliestRestoreOn.Value, "O"); + } + if (options.Format != "W" && Optional.IsDefined(LatestRestoreOn)) + { + writer.WritePropertyName("latestRestoreTime"u8); + writer.WriteStringValue(LatestRestoreOn.Value, "O"); + } + if (options.Format != "W" && Optional.IsDefined(BackupRetentionDays)) + { + writer.WritePropertyName("backupRetentionDays"u8); + writer.WriteNumberValue(BackupRetentionDays.Value); + } + if (options.Format != "W" && Optional.IsDefined(DatabaseSizeGbMax)) + { + writer.WritePropertyName("databaseSizeGbMax"u8); + writer.WriteNumberValue(DatabaseSizeGbMax.Value); + } + if (Optional.IsDefined(SourceDatabaseName)) + { + writer.WritePropertyName("sourceDatabaseName"u8); + writer.WriteStringValue(SourceDatabaseName); + } + if (Optional.IsCollectionDefined(ResourceTags)) + { + writer.WritePropertyName("resourceTags"u8); + writer.WriteStartObject(); + foreach (var item in ResourceTags) + { + writer.WritePropertyName(item.Key); + writer.WriteStringValue(item.Value); + } + writer.WriteEndObject(); + } + if (Optional.IsDefined(Identity)) + { + writer.WritePropertyName("identity"u8); + writer.WriteObjectValue(Identity, options); + } + if (Optional.IsDefined(TransparentDataEncryption)) + { + writer.WritePropertyName("transparentDataEncryption"u8); + writer.WriteObjectValue(TransparentDataEncryption, options); + } + if (Optional.IsDefined(Collation)) + { + writer.WritePropertyName("collation"u8); + writer.WriteStringValue(Collation); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + FleetDatabaseProperties 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(FleetDatabaseProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeFleetDatabaseProperties(document.RootElement, options); + } + + internal static FleetDatabaseProperties DeserializeFleetDatabaseProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string originalDatabaseId = default; + AzureProvisioningState? provisioningState = default; + DatabaseCreateMode? createMode = default; + string tierName = default; + string connectionString = default; + bool? recoverable = default; + DateTimeOffset? restoreFromTime = default; + DateTimeOffset? earliestRestoreTime = default; + DateTimeOffset? latestRestoreTime = default; + int? backupRetentionDays = default; + int? databaseSizeGbMax = default; + string sourceDatabaseName = default; + IDictionary resourceTags = default; + IdentityProperties identity = default; + TransparentDataEncryption transparentDataEncryption = default; + string collation = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("originalDatabaseId"u8)) + { + originalDatabaseId = property.Value.GetString(); + continue; + } + if (property.NameEquals("provisioningState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + provisioningState = new AzureProvisioningState(property.Value.GetString()); + continue; + } + if (property.NameEquals("createMode"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + createMode = new DatabaseCreateMode(property.Value.GetString()); + continue; + } + if (property.NameEquals("tierName"u8)) + { + tierName = property.Value.GetString(); + continue; + } + if (property.NameEquals("connectionString"u8)) + { + connectionString = property.Value.GetString(); + continue; + } + if (property.NameEquals("recoverable"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + recoverable = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("restoreFromTime"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + restoreFromTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("earliestRestoreTime"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + earliestRestoreTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("latestRestoreTime"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + latestRestoreTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("backupRetentionDays"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + backupRetentionDays = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("databaseSizeGbMax"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + databaseSizeGbMax = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("sourceDatabaseName"u8)) + { + sourceDatabaseName = property.Value.GetString(); + continue; + } + if (property.NameEquals("resourceTags"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()); + } + resourceTags = dictionary; + continue; + } + if (property.NameEquals("identity"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + identity = IdentityProperties.DeserializeIdentityProperties(property.Value, options); + continue; + } + if (property.NameEquals("transparentDataEncryption"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + transparentDataEncryption = TransparentDataEncryption.DeserializeTransparentDataEncryption(property.Value, options); + continue; + } + if (property.NameEquals("collation"u8)) + { + collation = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new FleetDatabaseProperties( + originalDatabaseId, + provisioningState, + createMode, + tierName, + connectionString, + recoverable, + restoreFromTime, + earliestRestoreTime, + latestRestoreTime, + backupRetentionDays, + databaseSizeGbMax, + sourceDatabaseName, + resourceTags ?? new ChangeTrackingDictionary(), + identity, + transparentDataEncryption, + collation, + 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(FleetDatabaseProperties)} does not support writing '{options.Format}' format."); + } + } + + FleetDatabaseProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeFleetDatabaseProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(FleetDatabaseProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/FleetDatabaseProperties.cs b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/FleetDatabaseProperties.cs new file mode 100644 index 000000000000..f9af6806a77c --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/FleetDatabaseProperties.cs @@ -0,0 +1,126 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.DatabaseFleetManager.Models +{ + /// Fleet database properties. + public partial class FleetDatabaseProperties + { + /// + /// 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 FleetDatabaseProperties() + { + ResourceTags = new ChangeTrackingDictionary(); + } + + /// Initializes a new instance of . + /// Resource identifier for the underlying database resource. + /// Database state. + /// Create mode. Available options: Default - Create a database. Copy - Copy the source database (source database name must be specified) PointInTimeRestore - Create a database by restoring source database from a point in time (source database name and restore from time must be specified). + /// Name of the tier this database belongs to. + /// Connection string to connect to the database with. + /// If true, database is recoverable. + /// Restore from time when CreateMode is PointInTimeRestore. + /// Earliest restore time. + /// Latest restore time. + /// Backup retention in days. + /// Maximum database size in Gb. + /// Source database name used when CreateMode is Copy or PointInTimeRestore. + /// Additional database properties to be applied as the underlying database resource tags. + /// Identity property. + /// Transparent Data Encryption properties. + /// Database collation. + /// Keeps track of any properties unknown to the library. + internal FleetDatabaseProperties(string originalDatabaseId, AzureProvisioningState? provisioningState, DatabaseCreateMode? createMode, string tierName, string connectionString, bool? recoverable, DateTimeOffset? restoreFromOn, DateTimeOffset? earliestRestoreOn, DateTimeOffset? latestRestoreOn, int? backupRetentionDays, int? databaseSizeGbMax, string sourceDatabaseName, IDictionary resourceTags, IdentityProperties identity, TransparentDataEncryption transparentDataEncryption, string collation, IDictionary serializedAdditionalRawData) + { + OriginalDatabaseId = originalDatabaseId; + ProvisioningState = provisioningState; + CreateMode = createMode; + TierName = tierName; + ConnectionString = connectionString; + Recoverable = recoverable; + RestoreFromOn = restoreFromOn; + EarliestRestoreOn = earliestRestoreOn; + LatestRestoreOn = latestRestoreOn; + BackupRetentionDays = backupRetentionDays; + DatabaseSizeGbMax = databaseSizeGbMax; + SourceDatabaseName = sourceDatabaseName; + ResourceTags = resourceTags; + Identity = identity; + TransparentDataEncryption = transparentDataEncryption; + Collation = collation; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Resource identifier for the underlying database resource. + public string OriginalDatabaseId { get; } + /// Database state. + public AzureProvisioningState? ProvisioningState { get; } + /// Create mode. Available options: Default - Create a database. Copy - Copy the source database (source database name must be specified) PointInTimeRestore - Create a database by restoring source database from a point in time (source database name and restore from time must be specified). + public DatabaseCreateMode? CreateMode { get; set; } + /// Name of the tier this database belongs to. + public string TierName { get; set; } + /// Connection string to connect to the database with. + public string ConnectionString { get; } + /// If true, database is recoverable. + public bool? Recoverable { get; } + /// Restore from time when CreateMode is PointInTimeRestore. + public DateTimeOffset? RestoreFromOn { get; set; } + /// Earliest restore time. + public DateTimeOffset? EarliestRestoreOn { get; } + /// Latest restore time. + public DateTimeOffset? LatestRestoreOn { get; } + /// Backup retention in days. + public int? BackupRetentionDays { get; } + /// Maximum database size in Gb. + public int? DatabaseSizeGbMax { get; } + /// Source database name used when CreateMode is Copy or PointInTimeRestore. + public string SourceDatabaseName { get; set; } + /// Additional database properties to be applied as the underlying database resource tags. + public IDictionary ResourceTags { get; } + /// Identity property. + public IdentityProperties Identity { get; set; } + /// Transparent Data Encryption properties. + public TransparentDataEncryption TransparentDataEncryption { get; set; } + /// Database collation. + public string Collation { get; set; } + } +} diff --git a/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/FleetListResult.Serialization.cs b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/FleetListResult.Serialization.cs new file mode 100644 index 000000000000..28d728bb7135 --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/FleetListResult.Serialization.cs @@ -0,0 +1,151 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.DatabaseFleetManager.Models +{ + internal partial class FleetListResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(FleetListResult)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var item in Value) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + if (Optional.IsDefined(NextLink)) + { + writer.WritePropertyName("nextLink"u8); + writer.WriteStringValue(NextLink.AbsoluteUri); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + FleetListResult 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(FleetListResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeFleetListResult(document.RootElement, options); + } + + internal static FleetListResult DeserializeFleetListResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IReadOnlyList value = default; + Uri nextLink = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(FleetData.DeserializeFleetData(item, options)); + } + value = array; + continue; + } + if (property.NameEquals("nextLink"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + nextLink = new Uri(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new FleetListResult(value, nextLink, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(FleetListResult)} does not support writing '{options.Format}' format."); + } + } + + FleetListResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeFleetListResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(FleetListResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/FleetListResult.cs b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/FleetListResult.cs new file mode 100644 index 000000000000..8f540541070e --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/FleetListResult.cs @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.ResourceManager.DatabaseFleetManager.Models +{ + /// The response of a Fleet list operation. + internal partial class FleetListResult + { + /// + /// 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 Fleet items on this page. + /// is null. + internal FleetListResult(IEnumerable value) + { + Argument.AssertNotNull(value, nameof(value)); + + Value = value.ToList(); + } + + /// Initializes a new instance of . + /// The Fleet items on this page. + /// The link to the next page of items. + /// Keeps track of any properties unknown to the library. + internal FleetListResult(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) + { + Value = value; + NextLink = nextLink; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal FleetListResult() + { + } + + /// The Fleet items on this page. + public IReadOnlyList Value { get; } + /// The link to the next page of items. + public Uri NextLink { get; } + } +} diff --git a/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/FleetPatch.Serialization.cs b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/FleetPatch.Serialization.cs new file mode 100644 index 000000000000..a5d53bb9ecc4 --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/FleetPatch.Serialization.cs @@ -0,0 +1,159 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.DatabaseFleetManager.Models +{ + public partial class FleetPatch : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(FleetPatch)} does not support writing '{format}' format."); + } + + if (Optional.IsCollectionDefined(Tags)) + { + writer.WritePropertyName("tags"u8); + writer.WriteStartObject(); + foreach (var item in Tags) + { + writer.WritePropertyName(item.Key); + writer.WriteStringValue(item.Value); + } + writer.WriteEndObject(); + } + if (Optional.IsDefined(Properties)) + { + writer.WritePropertyName("properties"u8); + writer.WriteObjectValue(Properties, options); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + FleetPatch 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(FleetPatch)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeFleetPatch(document.RootElement, options); + } + + internal static FleetPatch DeserializeFleetPatch(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IDictionary tags = default; + FleetProperties properties = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("tags"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var property0 in property.Value.EnumerateObject()) + { + dictionary.Add(property0.Name, property0.Value.GetString()); + } + tags = dictionary; + continue; + } + if (property.NameEquals("properties"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + properties = FleetProperties.DeserializeFleetProperties(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new FleetPatch(tags ?? new ChangeTrackingDictionary(), 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(FleetPatch)} does not support writing '{options.Format}' format."); + } + } + + FleetPatch IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeFleetPatch(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(FleetPatch)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/FleetPatch.cs b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/FleetPatch.cs new file mode 100644 index 000000000000..5d094a941c76 --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/FleetPatch.cs @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.DatabaseFleetManager.Models +{ + /// An update to a Database Fleet. + public partial class FleetPatch + { + /// + /// 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 FleetPatch() + { + Tags = new ChangeTrackingDictionary(); + } + + /// Initializes a new instance of . + /// Resource tags. + /// The Database Fleet properties. + /// Keeps track of any properties unknown to the library. + internal FleetPatch(IDictionary tags, FleetProperties properties, IDictionary serializedAdditionalRawData) + { + Tags = tags; + Properties = properties; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Resource tags. + public IDictionary Tags { get; } + /// The Database Fleet properties. + public FleetProperties Properties { get; set; } + } +} diff --git a/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/FleetProperties.Serialization.cs b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/FleetProperties.Serialization.cs new file mode 100644 index 000000000000..ff870de81d86 --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/FleetProperties.Serialization.cs @@ -0,0 +1,144 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.DatabaseFleetManager.Models +{ + public partial class FleetProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(FleetProperties)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(Description)) + { + writer.WritePropertyName("description"u8); + writer.WriteStringValue(Description); + } + if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) + { + writer.WritePropertyName("provisioningState"u8); + writer.WriteStringValue(ProvisioningState.Value.ToString()); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + FleetProperties 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(FleetProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeFleetProperties(document.RootElement, options); + } + + internal static FleetProperties DeserializeFleetProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string description = default; + AzureProvisioningState? provisioningState = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("description"u8)) + { + description = property.Value.GetString(); + continue; + } + if (property.NameEquals("provisioningState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + provisioningState = new AzureProvisioningState(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new FleetProperties(description, provisioningState, 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(FleetProperties)} does not support writing '{options.Format}' format."); + } + } + + FleetProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeFleetProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(FleetProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/FleetProperties.cs b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/FleetProperties.cs new file mode 100644 index 000000000000..36f22956d71d --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/FleetProperties.cs @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.DatabaseFleetManager.Models +{ + /// The Database Fleet properties. + public partial class FleetProperties + { + /// + /// 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 FleetProperties() + { + } + + /// Initializes a new instance of . + /// Fleet description. + /// Provisioning state. + /// Keeps track of any properties unknown to the library. + internal FleetProperties(string description, AzureProvisioningState? provisioningState, IDictionary serializedAdditionalRawData) + { + Description = description; + ProvisioningState = provisioningState; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Fleet description. + public string Description { get; set; } + /// Provisioning state. + public AzureProvisioningState? ProvisioningState { get; } + } +} diff --git a/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/FleetTierListResult.Serialization.cs b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/FleetTierListResult.Serialization.cs new file mode 100644 index 000000000000..4c8254fc36e0 --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/FleetTierListResult.Serialization.cs @@ -0,0 +1,151 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.DatabaseFleetManager.Models +{ + internal partial class FleetTierListResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(FleetTierListResult)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var item in Value) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + if (Optional.IsDefined(NextLink)) + { + writer.WritePropertyName("nextLink"u8); + writer.WriteStringValue(NextLink.AbsoluteUri); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + FleetTierListResult 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(FleetTierListResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeFleetTierListResult(document.RootElement, options); + } + + internal static FleetTierListResult DeserializeFleetTierListResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IReadOnlyList value = default; + Uri nextLink = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(FleetTierData.DeserializeFleetTierData(item, options)); + } + value = array; + continue; + } + if (property.NameEquals("nextLink"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + nextLink = new Uri(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new FleetTierListResult(value, nextLink, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(FleetTierListResult)} does not support writing '{options.Format}' format."); + } + } + + FleetTierListResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeFleetTierListResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(FleetTierListResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/FleetTierListResult.cs b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/FleetTierListResult.cs new file mode 100644 index 000000000000..b5e5af8cb162 --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/FleetTierListResult.cs @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.ResourceManager.DatabaseFleetManager.Models +{ + /// The response of a FleetTier list operation. + internal partial class FleetTierListResult + { + /// + /// 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 FleetTier items on this page. + /// is null. + internal FleetTierListResult(IEnumerable value) + { + Argument.AssertNotNull(value, nameof(value)); + + Value = value.ToList(); + } + + /// Initializes a new instance of . + /// The FleetTier items on this page. + /// The link to the next page of items. + /// Keeps track of any properties unknown to the library. + internal FleetTierListResult(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) + { + Value = value; + NextLink = nextLink; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal FleetTierListResult() + { + } + + /// The FleetTier items on this page. + public IReadOnlyList Value { get; } + /// The link to the next page of items. + public Uri NextLink { get; } + } +} diff --git a/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/FleetTierProperties.Serialization.cs b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/FleetTierProperties.Serialization.cs new file mode 100644 index 000000000000..1e334e1c60de --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/FleetTierProperties.Serialization.cs @@ -0,0 +1,319 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.DatabaseFleetManager.Models +{ + public partial class FleetTierProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(FleetTierProperties)} does not support writing '{format}' format."); + } + + if (options.Format != "W" && Optional.IsDefined(Disabled)) + { + writer.WritePropertyName("disabled"u8); + writer.WriteBooleanValue(Disabled.Value); + } + if (Optional.IsDefined(Serverless)) + { + writer.WritePropertyName("serverless"u8); + writer.WriteBooleanValue(Serverless.Value); + } + if (Optional.IsDefined(Pooled)) + { + writer.WritePropertyName("pooled"u8); + writer.WriteBooleanValue(Pooled.Value); + } + if (Optional.IsDefined(ServiceTier)) + { + writer.WritePropertyName("serviceTier"u8); + writer.WriteStringValue(ServiceTier); + } + if (Optional.IsDefined(Family)) + { + writer.WritePropertyName("family"u8); + writer.WriteStringValue(Family); + } + if (Optional.IsDefined(Capacity)) + { + writer.WritePropertyName("capacity"u8); + writer.WriteNumberValue(Capacity.Value); + } + if (Optional.IsDefined(PoolNumOfDatabasesMax)) + { + writer.WritePropertyName("poolNumOfDatabasesMax"u8); + writer.WriteNumberValue(PoolNumOfDatabasesMax.Value); + } + if (Optional.IsDefined(HighAvailabilityReplicaCount)) + { + writer.WritePropertyName("highAvailabilityReplicaCount"u8); + writer.WriteNumberValue(HighAvailabilityReplicaCount.Value); + } + if (Optional.IsDefined(ZoneRedundancy)) + { + writer.WritePropertyName("zoneRedundancy"u8); + writer.WriteStringValue(ZoneRedundancy.Value.ToString()); + } + if (Optional.IsDefined(DatabaseCapacityMin)) + { + writer.WritePropertyName("databaseCapacityMin"u8); + writer.WriteNumberValue(DatabaseCapacityMin.Value); + } + if (Optional.IsDefined(DatabaseCapacityMax)) + { + writer.WritePropertyName("databaseCapacityMax"u8); + writer.WriteNumberValue(DatabaseCapacityMax.Value); + } + if (Optional.IsDefined(DatabaseSizeGbMax)) + { + writer.WritePropertyName("databaseSizeGbMax"u8); + writer.WriteNumberValue(DatabaseSizeGbMax.Value); + } + if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) + { + writer.WritePropertyName("provisioningState"u8); + writer.WriteStringValue(ProvisioningState.Value.ToString()); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + FleetTierProperties 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(FleetTierProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeFleetTierProperties(document.RootElement, options); + } + + internal static FleetTierProperties DeserializeFleetTierProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + bool? disabled = default; + bool? serverless = default; + bool? pooled = default; + string serviceTier = default; + string family = default; + int? capacity = default; + int? poolNumOfDatabasesMax = default; + int? highAvailabilityReplicaCount = default; + ZoneRedundancy? zoneRedundancy = default; + double? databaseCapacityMin = default; + double? databaseCapacityMax = default; + int? databaseSizeGbMax = default; + AzureProvisioningState? provisioningState = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("disabled"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + disabled = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("serverless"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + serverless = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("pooled"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + pooled = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("serviceTier"u8)) + { + serviceTier = property.Value.GetString(); + continue; + } + if (property.NameEquals("family"u8)) + { + family = property.Value.GetString(); + continue; + } + if (property.NameEquals("capacity"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + capacity = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("poolNumOfDatabasesMax"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + poolNumOfDatabasesMax = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("highAvailabilityReplicaCount"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + highAvailabilityReplicaCount = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("zoneRedundancy"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + zoneRedundancy = new ZoneRedundancy(property.Value.GetString()); + continue; + } + if (property.NameEquals("databaseCapacityMin"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + databaseCapacityMin = property.Value.GetDouble(); + continue; + } + if (property.NameEquals("databaseCapacityMax"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + databaseCapacityMax = property.Value.GetDouble(); + continue; + } + if (property.NameEquals("databaseSizeGbMax"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + databaseSizeGbMax = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("provisioningState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + provisioningState = new AzureProvisioningState(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new FleetTierProperties( + disabled, + serverless, + pooled, + serviceTier, + family, + capacity, + poolNumOfDatabasesMax, + highAvailabilityReplicaCount, + zoneRedundancy, + databaseCapacityMin, + databaseCapacityMax, + databaseSizeGbMax, + provisioningState, + 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(FleetTierProperties)} does not support writing '{options.Format}' format."); + } + } + + FleetTierProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeFleetTierProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(FleetTierProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/FleetTierProperties.cs b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/FleetTierProperties.cs new file mode 100644 index 000000000000..35cb55d23201 --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/FleetTierProperties.cs @@ -0,0 +1,113 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.DatabaseFleetManager.Models +{ + /// A Fleet tier properties. + public partial class FleetTierProperties + { + /// + /// 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 FleetTierProperties() + { + } + + /// Initializes a new instance of . + /// If true, tier is disabled. + /// If true, serverless resources are provisioned in the tier. + /// If true, databases are pooled. + /// Service tier of provisioned resources. Supported values: GeneralPurpose, Hyperscale. + /// Family of provisioned resources, for example Gen5. + /// Capacity of provisioned resources in the tier, in units matching the specified service tier, for example vCore for GeneralPurpose. + /// Maximum number of databases per pool. + /// Number of high availability replicas for databases in this tier. + /// Enable zone redundancy for all databases in this tier. + /// Minimum allocated capacity per database, in units matching the specified service tier. + /// Maximum allocated capacity per database, in units matching the specified service tier. + /// Maximum database size in Gb. + /// Provisioning state. + /// Keeps track of any properties unknown to the library. + internal FleetTierProperties(bool? disabled, bool? serverless, bool? pooled, string serviceTier, string family, int? capacity, int? poolNumOfDatabasesMax, int? highAvailabilityReplicaCount, ZoneRedundancy? zoneRedundancy, double? databaseCapacityMin, double? databaseCapacityMax, int? databaseSizeGbMax, AzureProvisioningState? provisioningState, IDictionary serializedAdditionalRawData) + { + Disabled = disabled; + Serverless = serverless; + Pooled = pooled; + ServiceTier = serviceTier; + Family = family; + Capacity = capacity; + PoolNumOfDatabasesMax = poolNumOfDatabasesMax; + HighAvailabilityReplicaCount = highAvailabilityReplicaCount; + ZoneRedundancy = zoneRedundancy; + DatabaseCapacityMin = databaseCapacityMin; + DatabaseCapacityMax = databaseCapacityMax; + DatabaseSizeGbMax = databaseSizeGbMax; + ProvisioningState = provisioningState; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// If true, tier is disabled. + public bool? Disabled { get; } + /// If true, serverless resources are provisioned in the tier. + public bool? Serverless { get; set; } + /// If true, databases are pooled. + public bool? Pooled { get; set; } + /// Service tier of provisioned resources. Supported values: GeneralPurpose, Hyperscale. + public string ServiceTier { get; set; } + /// Family of provisioned resources, for example Gen5. + public string Family { get; set; } + /// Capacity of provisioned resources in the tier, in units matching the specified service tier, for example vCore for GeneralPurpose. + public int? Capacity { get; set; } + /// Maximum number of databases per pool. + public int? PoolNumOfDatabasesMax { get; set; } + /// Number of high availability replicas for databases in this tier. + public int? HighAvailabilityReplicaCount { get; set; } + /// Enable zone redundancy for all databases in this tier. + public ZoneRedundancy? ZoneRedundancy { get; set; } + /// Minimum allocated capacity per database, in units matching the specified service tier. + public double? DatabaseCapacityMin { get; set; } + /// Maximum allocated capacity per database, in units matching the specified service tier. + public double? DatabaseCapacityMax { get; set; } + /// Maximum database size in Gb. + public int? DatabaseSizeGbMax { get; set; } + /// Provisioning state. + public AzureProvisioningState? ProvisioningState { get; } + } +} diff --git a/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/FleetspaceListResult.Serialization.cs b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/FleetspaceListResult.Serialization.cs new file mode 100644 index 000000000000..2bd9261813be --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/FleetspaceListResult.Serialization.cs @@ -0,0 +1,151 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.DatabaseFleetManager.Models +{ + internal partial class FleetspaceListResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(FleetspaceListResult)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var item in Value) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + if (Optional.IsDefined(NextLink)) + { + writer.WritePropertyName("nextLink"u8); + writer.WriteStringValue(NextLink.AbsoluteUri); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + FleetspaceListResult 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(FleetspaceListResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeFleetspaceListResult(document.RootElement, options); + } + + internal static FleetspaceListResult DeserializeFleetspaceListResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IReadOnlyList value = default; + Uri nextLink = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(FleetspaceData.DeserializeFleetspaceData(item, options)); + } + value = array; + continue; + } + if (property.NameEquals("nextLink"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + nextLink = new Uri(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new FleetspaceListResult(value, nextLink, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(FleetspaceListResult)} does not support writing '{options.Format}' format."); + } + } + + FleetspaceListResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeFleetspaceListResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(FleetspaceListResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/FleetspaceListResult.cs b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/FleetspaceListResult.cs new file mode 100644 index 000000000000..3f4024c0a31f --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/FleetspaceListResult.cs @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.ResourceManager.DatabaseFleetManager.Models +{ + /// The response of a Fleetspace list operation. + internal partial class FleetspaceListResult + { + /// + /// 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 Fleetspace items on this page. + /// is null. + internal FleetspaceListResult(IEnumerable value) + { + Argument.AssertNotNull(value, nameof(value)); + + Value = value.ToList(); + } + + /// Initializes a new instance of . + /// The Fleetspace items on this page. + /// The link to the next page of items. + /// Keeps track of any properties unknown to the library. + internal FleetspaceListResult(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) + { + Value = value; + NextLink = nextLink; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal FleetspaceListResult() + { + } + + /// The Fleetspace items on this page. + public IReadOnlyList Value { get; } + /// The link to the next page of items. + public Uri NextLink { get; } + } +} diff --git a/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/FleetspaceProperties.Serialization.cs b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/FleetspaceProperties.Serialization.cs new file mode 100644 index 000000000000..a7a72ab47704 --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/FleetspaceProperties.Serialization.cs @@ -0,0 +1,163 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.DatabaseFleetManager.Models +{ + public partial class FleetspaceProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(FleetspaceProperties)} does not support writing '{format}' format."); + } + + if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) + { + writer.WritePropertyName("provisioningState"u8); + writer.WriteStringValue(ProvisioningState.Value.ToString()); + } + if (Optional.IsDefined(CapacityMax)) + { + writer.WritePropertyName("capacityMax"u8); + writer.WriteNumberValue(CapacityMax.Value); + } + if (Optional.IsDefined(MainPrincipal)) + { + writer.WritePropertyName("mainPrincipal"u8); + writer.WriteObjectValue(MainPrincipal, options); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + FleetspaceProperties 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(FleetspaceProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeFleetspaceProperties(document.RootElement, options); + } + + internal static FleetspaceProperties DeserializeFleetspaceProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + AzureProvisioningState? provisioningState = default; + int? capacityMax = default; + MainPrincipal mainPrincipal = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("provisioningState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + provisioningState = new AzureProvisioningState(property.Value.GetString()); + continue; + } + if (property.NameEquals("capacityMax"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + capacityMax = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("mainPrincipal"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + mainPrincipal = MainPrincipal.DeserializeMainPrincipal(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new FleetspaceProperties(provisioningState, capacityMax, mainPrincipal, 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(FleetspaceProperties)} does not support writing '{options.Format}' format."); + } + } + + FleetspaceProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeFleetspaceProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(FleetspaceProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/FleetspaceProperties.cs b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/FleetspaceProperties.cs new file mode 100644 index 000000000000..e9289aa3cdc4 --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/FleetspaceProperties.cs @@ -0,0 +1,73 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.DatabaseFleetManager.Models +{ + /// A Fleetspace properties. + public partial class FleetspaceProperties + { + /// + /// 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 FleetspaceProperties() + { + } + + /// Initializes a new instance of . + /// Fleetspace state. + /// Maximum number of vCores database fleet manager is allowed to provision in the fleetspace. + /// Main Microsoft Entra ID principal that has admin access to all databases in the fleetspace. + /// Keeps track of any properties unknown to the library. + internal FleetspaceProperties(AzureProvisioningState? provisioningState, int? capacityMax, MainPrincipal mainPrincipal, IDictionary serializedAdditionalRawData) + { + ProvisioningState = provisioningState; + CapacityMax = capacityMax; + MainPrincipal = mainPrincipal; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Fleetspace state. + public AzureProvisioningState? ProvisioningState { get; } + /// Maximum number of vCores database fleet manager is allowed to provision in the fleetspace. + public int? CapacityMax { get; set; } + /// Main Microsoft Entra ID principal that has admin access to all databases in the fleetspace. + public MainPrincipal MainPrincipal { get; set; } + } +} diff --git a/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/IdentityProperties.Serialization.cs b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/IdentityProperties.Serialization.cs new file mode 100644 index 000000000000..5e202209be2d --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/IdentityProperties.Serialization.cs @@ -0,0 +1,173 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.DatabaseFleetManager.Models +{ + public partial class IdentityProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(IdentityProperties)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(IdentityType)) + { + writer.WritePropertyName("identityType"u8); + writer.WriteStringValue(IdentityType.Value.ToString()); + } + if (Optional.IsCollectionDefined(UserAssignedIdentities)) + { + writer.WritePropertyName("userAssignedIdentities"u8); + writer.WriteStartArray(); + foreach (var item in UserAssignedIdentities) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(FederatedClientId)) + { + writer.WritePropertyName("federatedClientId"u8); + writer.WriteStringValue(FederatedClientId.Value); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + IdentityProperties 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(IdentityProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeIdentityProperties(document.RootElement, options); + } + + internal static IdentityProperties DeserializeIdentityProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IdentityType? identityType = default; + IList userAssignedIdentities = default; + Guid? federatedClientId = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("identityType"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + identityType = new IdentityType(property.Value.GetString()); + continue; + } + if (property.NameEquals("userAssignedIdentities"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(DatabaseIdentity.DeserializeDatabaseIdentity(item, options)); + } + userAssignedIdentities = array; + continue; + } + if (property.NameEquals("federatedClientId"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + federatedClientId = property.Value.GetGuid(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new IdentityProperties(identityType, userAssignedIdentities ?? new ChangeTrackingList(), federatedClientId, 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(IdentityProperties)} does not support writing '{options.Format}' format."); + } + } + + IdentityProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeIdentityProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(IdentityProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/IdentityProperties.cs b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/IdentityProperties.cs new file mode 100644 index 000000000000..c8aa59723fd3 --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/IdentityProperties.cs @@ -0,0 +1,74 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.DatabaseFleetManager.Models +{ + /// Database Identity. + public partial class IdentityProperties + { + /// + /// 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 IdentityProperties() + { + UserAssignedIdentities = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// Identity type of the main principal. + /// User identity ids. + /// The federated client id for the SQL Database. It is used for cross tenant CMK scenario. + /// Keeps track of any properties unknown to the library. + internal IdentityProperties(IdentityType? identityType, IList userAssignedIdentities, Guid? federatedClientId, IDictionary serializedAdditionalRawData) + { + IdentityType = identityType; + UserAssignedIdentities = userAssignedIdentities; + FederatedClientId = federatedClientId; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Identity type of the main principal. + public IdentityType? IdentityType { get; set; } + /// User identity ids. + public IList UserAssignedIdentities { get; } + /// The federated client id for the SQL Database. It is used for cross tenant CMK scenario. + public Guid? FederatedClientId { get; set; } + } +} diff --git a/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/IdentityType.cs b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/IdentityType.cs new file mode 100644 index 000000000000..4c18df457266 --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/IdentityType.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.DatabaseFleetManager.Models +{ + /// Identity type of the main principal. + public readonly partial struct IdentityType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public IdentityType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string NoneValue = "None"; + private const string UserAssignedValue = "UserAssigned"; + + /// No identity. + public static IdentityType None { get; } = new IdentityType(NoneValue); + /// User assigned identity. + public static IdentityType UserAssigned { get; } = new IdentityType(UserAssignedValue); + /// Determines if two values are the same. + public static bool operator ==(IdentityType left, IdentityType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(IdentityType left, IdentityType right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator IdentityType(string value) => new IdentityType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is IdentityType other && Equals(other); + /// + public bool Equals(IdentityType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/MainPrincipal.Serialization.cs b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/MainPrincipal.Serialization.cs new file mode 100644 index 000000000000..9603d30d97ca --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/MainPrincipal.Serialization.cs @@ -0,0 +1,195 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.DatabaseFleetManager.Models +{ + public partial class MainPrincipal : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(MainPrincipal)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(Login)) + { + writer.WritePropertyName("login"u8); + writer.WriteStringValue(Login); + } + if (Optional.IsDefined(ApplicationId)) + { + writer.WritePropertyName("applicationId"u8); + writer.WriteStringValue(ApplicationId.Value); + } + if (Optional.IsDefined(ObjectId)) + { + writer.WritePropertyName("objectId"u8); + writer.WriteStringValue(ObjectId.Value); + } + if (Optional.IsDefined(TenantId)) + { + writer.WritePropertyName("tenantId"u8); + writer.WriteStringValue(TenantId.Value); + } + if (Optional.IsDefined(PrincipalType)) + { + writer.WritePropertyName("principalType"u8); + writer.WriteStringValue(PrincipalType.Value.ToString()); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + MainPrincipal 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(MainPrincipal)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeMainPrincipal(document.RootElement, options); + } + + internal static MainPrincipal DeserializeMainPrincipal(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string login = default; + Guid? applicationId = default; + Guid? objectId = default; + Guid? tenantId = default; + PrincipalType? principalType = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("login"u8)) + { + login = property.Value.GetString(); + continue; + } + if (property.NameEquals("applicationId"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + applicationId = property.Value.GetGuid(); + continue; + } + if (property.NameEquals("objectId"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + objectId = property.Value.GetGuid(); + continue; + } + if (property.NameEquals("tenantId"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + tenantId = property.Value.GetGuid(); + continue; + } + if (property.NameEquals("principalType"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + principalType = new PrincipalType(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new MainPrincipal( + login, + applicationId, + objectId, + tenantId, + principalType, + 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(MainPrincipal)} does not support writing '{options.Format}' format."); + } + } + + MainPrincipal IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeMainPrincipal(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(MainPrincipal)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/MainPrincipal.cs b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/MainPrincipal.cs new file mode 100644 index 000000000000..eb5d3839f132 --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/MainPrincipal.cs @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.DatabaseFleetManager.Models +{ + /// A main principal. + public partial class MainPrincipal + { + /// + /// 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 MainPrincipal() + { + } + + /// Initializes a new instance of . + /// Login name of the main principal. + /// Application Id of the main principal. + /// Object Id of the main principal. + /// Tenant Id of the main principal. + /// Principal type of the main principal. + /// Keeps track of any properties unknown to the library. + internal MainPrincipal(string login, Guid? applicationId, Guid? objectId, Guid? tenantId, PrincipalType? principalType, IDictionary serializedAdditionalRawData) + { + Login = login; + ApplicationId = applicationId; + ObjectId = objectId; + TenantId = tenantId; + PrincipalType = principalType; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Login name of the main principal. + public string Login { get; set; } + /// Application Id of the main principal. + public Guid? ApplicationId { get; set; } + /// Object Id of the main principal. + public Guid? ObjectId { get; set; } + /// Tenant Id of the main principal. + public Guid? TenantId { get; set; } + /// Principal type of the main principal. + public PrincipalType? PrincipalType { get; set; } + } +} diff --git a/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/PrincipalType.cs b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/PrincipalType.cs new file mode 100644 index 000000000000..a8fe0c148ff2 --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/PrincipalType.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.DatabaseFleetManager.Models +{ + /// Principal type of the authorized principal. + public readonly partial struct PrincipalType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public PrincipalType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string ApplicationValue = "Application"; + private const string UserValue = "User"; + + /// Application principal type. + public static PrincipalType Application { get; } = new PrincipalType(ApplicationValue); + /// User principal type. + public static PrincipalType User { get; } = new PrincipalType(UserValue); + /// Determines if two values are the same. + public static bool operator ==(PrincipalType left, PrincipalType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(PrincipalType left, PrincipalType right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator PrincipalType(string value) => new PrincipalType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is PrincipalType other && Equals(other); + /// + public bool Equals(PrincipalType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/RegisterServerProperties.Serialization.cs b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/RegisterServerProperties.Serialization.cs new file mode 100644 index 000000000000..804ae5700643 --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/RegisterServerProperties.Serialization.cs @@ -0,0 +1,193 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.DatabaseFleetManager.Models +{ + public partial class RegisterServerProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(RegisterServerProperties)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(TierName)) + { + writer.WritePropertyName("tierName"u8); + writer.WriteStringValue(TierName); + } + if (Optional.IsDefined(SourceSubscriptionId)) + { + writer.WritePropertyName("sourceSubscriptionId"u8); + writer.WriteStringValue(SourceSubscriptionId); + } + if (Optional.IsDefined(SourceResourceGroupName)) + { + writer.WritePropertyName("sourceResourceGroupName"u8); + writer.WriteStringValue(SourceResourceGroupName); + } + if (Optional.IsDefined(SourceServerName)) + { + writer.WritePropertyName("sourceServerName"u8); + writer.WriteStringValue(SourceServerName); + } + if (Optional.IsCollectionDefined(DestinationTierOverrides)) + { + writer.WritePropertyName("destinationTierOverrides"u8); + writer.WriteStartArray(); + foreach (var item in DestinationTierOverrides) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + RegisterServerProperties 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(RegisterServerProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeRegisterServerProperties(document.RootElement, options); + } + + internal static RegisterServerProperties DeserializeRegisterServerProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string tierName = default; + string sourceSubscriptionId = default; + string sourceResourceGroupName = default; + string sourceServerName = default; + IList destinationTierOverrides = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("tierName"u8)) + { + tierName = property.Value.GetString(); + continue; + } + if (property.NameEquals("sourceSubscriptionId"u8)) + { + sourceSubscriptionId = property.Value.GetString(); + continue; + } + if (property.NameEquals("sourceResourceGroupName"u8)) + { + sourceResourceGroupName = property.Value.GetString(); + continue; + } + if (property.NameEquals("sourceServerName"u8)) + { + sourceServerName = property.Value.GetString(); + continue; + } + if (property.NameEquals("destinationTierOverrides"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(DestinationTierOverride.DeserializeDestinationTierOverride(item, options)); + } + destinationTierOverrides = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new RegisterServerProperties( + tierName, + sourceSubscriptionId, + sourceResourceGroupName, + sourceServerName, + destinationTierOverrides ?? new ChangeTrackingList(), + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(RegisterServerProperties)} does not support writing '{options.Format}' format."); + } + } + + RegisterServerProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeRegisterServerProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(RegisterServerProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/RegisterServerProperties.cs b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/RegisterServerProperties.cs new file mode 100644 index 000000000000..83270ed1034b --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/RegisterServerProperties.cs @@ -0,0 +1,82 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.DatabaseFleetManager.Models +{ + /// Server registration definition. + public partial class RegisterServerProperties + { + /// + /// 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 RegisterServerProperties() + { + DestinationTierOverrides = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// Destination tier name. + /// Source subscription id. + /// Source resource group name. + /// Source SQL Server name. + /// Destination tier overrides. + /// Keeps track of any properties unknown to the library. + internal RegisterServerProperties(string tierName, string sourceSubscriptionId, string sourceResourceGroupName, string sourceServerName, IList destinationTierOverrides, IDictionary serializedAdditionalRawData) + { + TierName = tierName; + SourceSubscriptionId = sourceSubscriptionId; + SourceResourceGroupName = sourceResourceGroupName; + SourceServerName = sourceServerName; + DestinationTierOverrides = destinationTierOverrides; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Destination tier name. + public string TierName { get; set; } + /// Source subscription id. + public string SourceSubscriptionId { get; set; } + /// Source resource group name. + public string SourceResourceGroupName { get; set; } + /// Source SQL Server name. + public string SourceServerName { get; set; } + /// Destination tier overrides. + public IList DestinationTierOverrides { get; } + } +} diff --git a/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/ResourceType.cs b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/ResourceType.cs new file mode 100644 index 000000000000..47ce2d88086f --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/ResourceType.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.DatabaseFleetManager.Models +{ + /// Resource type of the destination tier override. + public readonly partial struct ResourceType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public ResourceType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string DatabaseValue = "Database"; + private const string PoolValue = "Pool"; + + /// Database resource type. + public static ResourceType Database { get; } = new ResourceType(DatabaseValue); + /// Elastic pool resource type. + public static ResourceType Pool { get; } = new ResourceType(PoolValue); + /// Determines if two values are the same. + public static bool operator ==(ResourceType left, ResourceType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(ResourceType left, ResourceType right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator ResourceType(string value) => new ResourceType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is ResourceType other && Equals(other); + /// + public bool Equals(ResourceType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/TransparentDataEncryption.Serialization.cs b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/TransparentDataEncryption.Serialization.cs new file mode 100644 index 000000000000..819c575b8011 --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/TransparentDataEncryption.Serialization.cs @@ -0,0 +1,173 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.DatabaseFleetManager.Models +{ + public partial class TransparentDataEncryption : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(TransparentDataEncryption)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(KeyUri)) + { + writer.WritePropertyName("keyUri"u8); + writer.WriteStringValue(KeyUri.AbsoluteUri); + } + if (Optional.IsCollectionDefined(Keys)) + { + writer.WritePropertyName("keys"u8); + writer.WriteStartArray(); + foreach (var item in Keys) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(EnableAutoRotation)) + { + writer.WritePropertyName("enableAutoRotation"u8); + writer.WriteBooleanValue(EnableAutoRotation.Value); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + TransparentDataEncryption 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(TransparentDataEncryption)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeTransparentDataEncryption(document.RootElement, options); + } + + internal static TransparentDataEncryption DeserializeTransparentDataEncryption(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Uri keyUri = default; + IList keys = default; + bool? enableAutoRotation = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("keyUri"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + keyUri = new Uri(property.Value.GetString()); + continue; + } + if (property.NameEquals("keys"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + keys = array; + continue; + } + if (property.NameEquals("enableAutoRotation"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + enableAutoRotation = property.Value.GetBoolean(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new TransparentDataEncryption(keyUri, keys ?? new ChangeTrackingList(), enableAutoRotation, 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(TransparentDataEncryption)} does not support writing '{options.Format}' format."); + } + } + + TransparentDataEncryption IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeTransparentDataEncryption(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(TransparentDataEncryption)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/TransparentDataEncryption.cs b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/TransparentDataEncryption.cs new file mode 100644 index 000000000000..8cf2e72658ff --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/TransparentDataEncryption.cs @@ -0,0 +1,74 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.DatabaseFleetManager.Models +{ + /// Transparent Data Encryption properties. + public partial class TransparentDataEncryption + { + /// + /// 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 TransparentDataEncryption() + { + Keys = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// Customer Managed Key (CMK) Uri. + /// Additional Keys. + /// Enable key auto rotation. + /// Keeps track of any properties unknown to the library. + internal TransparentDataEncryption(Uri keyUri, IList keys, bool? enableAutoRotation, IDictionary serializedAdditionalRawData) + { + KeyUri = keyUri; + Keys = keys; + EnableAutoRotation = enableAutoRotation; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Customer Managed Key (CMK) Uri. + public Uri KeyUri { get; set; } + /// Additional Keys. + public IList Keys { get; } + /// Enable key auto rotation. + public bool? EnableAutoRotation { get; set; } + } +} diff --git a/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/ZoneRedundancy.cs b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/ZoneRedundancy.cs new file mode 100644 index 000000000000..5aaa4d259d0d --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/ZoneRedundancy.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.DatabaseFleetManager.Models +{ + /// Status of zone redundancy in a tier. + public readonly partial struct ZoneRedundancy : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public ZoneRedundancy(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string EnabledValue = "Enabled"; + private const string DisabledValue = "Disabled"; + + /// Zone redundancy enabled. + public static ZoneRedundancy Enabled { get; } = new ZoneRedundancy(EnabledValue); + /// Zone redundancy disabled. + public static ZoneRedundancy Disabled { get; } = new ZoneRedundancy(DisabledValue); + /// Determines if two values are the same. + public static bool operator ==(ZoneRedundancy left, ZoneRedundancy right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(ZoneRedundancy left, ZoneRedundancy right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator ZoneRedundancy(string value) => new ZoneRedundancy(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is ZoneRedundancy other && Equals(other); + /// + public bool Equals(ZoneRedundancy other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/ProviderConstants.cs b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/ProviderConstants.cs new file mode 100644 index 000000000000..978185b579aa --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/ProviderConstants.cs @@ -0,0 +1,16 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.DatabaseFleetManager +{ + internal static class ProviderConstants + { + public static string DefaultProviderNamespace { get; } = ClientDiagnostics.GetResourceProviderNamespace(typeof(ProviderConstants).Assembly); + } +} diff --git a/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/RestOperations/FirewallRulesRestOperations.cs b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/RestOperations/FirewallRulesRestOperations.cs new file mode 100644 index 000000000000..21a390d84412 --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/RestOperations/FirewallRulesRestOperations.cs @@ -0,0 +1,585 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.DatabaseFleetManager.Models; + +namespace Azure.ResourceManager.DatabaseFleetManager +{ + internal partial class FirewallRulesRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of FirewallRulesRestOperations. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// The application id to use for user agent. + /// Service host. + /// The API version to use for this operation. + /// or is null. + public FirewallRulesRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + { + _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); + _endpoint = endpoint ?? new Uri("https://management.azure.com"); + _apiVersion = apiVersion ?? "2025-02-01-preview"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string fleetName, string fleetspaceName, string firewallRuleName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DatabaseFleetManager/fleets/", false); + uri.AppendPath(fleetName, true); + uri.AppendPath("/fleetspaces/", false); + uri.AppendPath(fleetspaceName, true); + uri.AppendPath("/firewallRules/", false); + uri.AppendPath(firewallRuleName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string fleetName, string fleetspaceName, string firewallRuleName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DatabaseFleetManager/fleets/", false); + uri.AppendPath(fleetName, true); + uri.AppendPath("/fleetspaces/", false); + uri.AppendPath(fleetspaceName, true); + uri.AppendPath("/firewallRules/", false); + uri.AppendPath(firewallRuleName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Gets a firewall rule. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the database fleet. + /// Name of the fleetspace. + /// Name of the firewall rule. + /// The cancellation token to use. + /// , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public async Task> GetAsync(string subscriptionId, string resourceGroupName, string fleetName, string fleetspaceName, string firewallRuleName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + Argument.AssertNotNullOrEmpty(fleetspaceName, nameof(fleetspaceName)); + Argument.AssertNotNullOrEmpty(firewallRuleName, nameof(firewallRuleName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, fleetName, fleetspaceName, firewallRuleName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + FirewallRuleData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = FirewallRuleData.DeserializeFirewallRuleData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((FirewallRuleData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// Gets a firewall rule. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the database fleet. + /// Name of the fleetspace. + /// Name of the firewall rule. + /// The cancellation token to use. + /// , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public Response Get(string subscriptionId, string resourceGroupName, string fleetName, string fleetspaceName, string firewallRuleName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + Argument.AssertNotNullOrEmpty(fleetspaceName, nameof(fleetspaceName)); + Argument.AssertNotNullOrEmpty(firewallRuleName, nameof(firewallRuleName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, fleetName, fleetspaceName, firewallRuleName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + FirewallRuleData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = FirewallRuleData.DeserializeFirewallRuleData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((FirewallRuleData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateCreateOrUpdateRequestUri(string subscriptionId, string resourceGroupName, string fleetName, string fleetspaceName, string firewallRuleName, FirewallRuleData data) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DatabaseFleetManager/fleets/", false); + uri.AppendPath(fleetName, true); + uri.AppendPath("/fleetspaces/", false); + uri.AppendPath(fleetspaceName, true); + uri.AppendPath("/firewallRules/", false); + uri.AppendPath(firewallRuleName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string resourceGroupName, string fleetName, string fleetspaceName, string firewallRuleName, FirewallRuleData data) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Put; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DatabaseFleetManager/fleets/", false); + uri.AppendPath(fleetName, true); + uri.AppendPath("/fleetspaces/", false); + uri.AppendPath(fleetspaceName, true); + uri.AppendPath("/firewallRules/", false); + uri.AppendPath(firewallRuleName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(data, ModelSerializationExtensions.WireOptions); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Creates or updates a firewall rule. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the database fleet. + /// Name of the fleetspace. + /// Name of the firewall rule. + /// The firewall rule object to create or update. + /// The cancellation token to use. + /// , , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public async Task CreateOrUpdateAsync(string subscriptionId, string resourceGroupName, string fleetName, string fleetspaceName, string firewallRuleName, FirewallRuleData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + Argument.AssertNotNullOrEmpty(fleetspaceName, nameof(fleetspaceName)); + Argument.AssertNotNullOrEmpty(firewallRuleName, nameof(firewallRuleName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, fleetName, fleetspaceName, firewallRuleName, data); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 201: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Creates or updates a firewall rule. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the database fleet. + /// Name of the fleetspace. + /// Name of the firewall rule. + /// The firewall rule object to create or update. + /// The cancellation token to use. + /// , , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public Response CreateOrUpdate(string subscriptionId, string resourceGroupName, string fleetName, string fleetspaceName, string firewallRuleName, FirewallRuleData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + Argument.AssertNotNullOrEmpty(fleetspaceName, nameof(fleetspaceName)); + Argument.AssertNotNullOrEmpty(firewallRuleName, nameof(firewallRuleName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, fleetName, fleetspaceName, firewallRuleName, data); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 201: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string resourceGroupName, string fleetName, string fleetspaceName, string firewallRuleName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DatabaseFleetManager/fleets/", false); + uri.AppendPath(fleetName, true); + uri.AppendPath("/fleetspaces/", false); + uri.AppendPath(fleetspaceName, true); + uri.AppendPath("/firewallRules/", false); + uri.AppendPath(firewallRuleName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string fleetName, string fleetspaceName, string firewallRuleName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Delete; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DatabaseFleetManager/fleets/", false); + uri.AppendPath(fleetName, true); + uri.AppendPath("/fleetspaces/", false); + uri.AppendPath(fleetspaceName, true); + uri.AppendPath("/firewallRules/", false); + uri.AppendPath(firewallRuleName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Deletes a firewall rule. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the database fleet. + /// Name of the fleetspace. + /// Name of the firewall rule. + /// The cancellation token to use. + /// , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public async Task DeleteAsync(string subscriptionId, string resourceGroupName, string fleetName, string fleetspaceName, string firewallRuleName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + Argument.AssertNotNullOrEmpty(fleetspaceName, nameof(fleetspaceName)); + Argument.AssertNotNullOrEmpty(firewallRuleName, nameof(firewallRuleName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, fleetName, fleetspaceName, firewallRuleName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Deletes a firewall rule. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the database fleet. + /// Name of the fleetspace. + /// Name of the firewall rule. + /// The cancellation token to use. + /// , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public Response Delete(string subscriptionId, string resourceGroupName, string fleetName, string fleetspaceName, string firewallRuleName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + Argument.AssertNotNullOrEmpty(fleetspaceName, nameof(fleetspaceName)); + Argument.AssertNotNullOrEmpty(firewallRuleName, nameof(firewallRuleName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, fleetName, fleetspaceName, firewallRuleName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListByFleetspaceRequestUri(string subscriptionId, string resourceGroupName, string fleetName, string fleetspaceName, long? skip, long? top, string skiptoken) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DatabaseFleetManager/fleets/", false); + uri.AppendPath(fleetName, true); + uri.AppendPath("/fleetspaces/", false); + uri.AppendPath(fleetspaceName, true); + uri.AppendPath("/firewallRules", false); + uri.AppendQuery("api-version", _apiVersion, true); + if (skip != null) + { + uri.AppendQuery("$skip", skip.Value, true); + } + if (top != null) + { + uri.AppendQuery("$top", top.Value, true); + } + if (skiptoken != null) + { + uri.AppendQuery("$skiptoken", skiptoken, true); + } + return uri; + } + + internal HttpMessage CreateListByFleetspaceRequest(string subscriptionId, string resourceGroupName, string fleetName, string fleetspaceName, long? skip, long? top, string skiptoken) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DatabaseFleetManager/fleets/", false); + uri.AppendPath(fleetName, true); + uri.AppendPath("/fleetspaces/", false); + uri.AppendPath(fleetspaceName, true); + uri.AppendPath("/firewallRules", false); + uri.AppendQuery("api-version", _apiVersion, true); + if (skip != null) + { + uri.AppendQuery("$skip", skip.Value, true); + } + if (top != null) + { + uri.AppendQuery("$top", top.Value, true); + } + if (skiptoken != null) + { + uri.AppendQuery("$skiptoken", skiptoken, true); + } + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Gets all firewall rules in a fleetspace. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the database fleet. + /// Name of the fleetspace. + /// The number of elements in the collection to skip. + /// The number of elements to return from the collection. + /// An opaque token that identifies a starting point in the collection. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task> ListByFleetspaceAsync(string subscriptionId, string resourceGroupName, string fleetName, string fleetspaceName, long? skip = null, long? top = null, string skiptoken = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + Argument.AssertNotNullOrEmpty(fleetspaceName, nameof(fleetspaceName)); + + using var message = CreateListByFleetspaceRequest(subscriptionId, resourceGroupName, fleetName, fleetspaceName, skip, top, skiptoken); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + FirewallRuleListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = FirewallRuleListResult.DeserializeFirewallRuleListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Gets all firewall rules in a fleetspace. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the database fleet. + /// Name of the fleetspace. + /// The number of elements in the collection to skip. + /// The number of elements to return from the collection. + /// An opaque token that identifies a starting point in the collection. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response ListByFleetspace(string subscriptionId, string resourceGroupName, string fleetName, string fleetspaceName, long? skip = null, long? top = null, string skiptoken = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + Argument.AssertNotNullOrEmpty(fleetspaceName, nameof(fleetspaceName)); + + using var message = CreateListByFleetspaceRequest(subscriptionId, resourceGroupName, fleetName, fleetspaceName, skip, top, skiptoken); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + FirewallRuleListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = FirewallRuleListResult.DeserializeFirewallRuleListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListByFleetspaceNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string fleetName, string fleetspaceName, long? skip, long? top, string skiptoken) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateListByFleetspaceNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string fleetName, string fleetspaceName, long? skip, long? top, string skiptoken) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Gets all firewall rules in a fleetspace. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the database fleet. + /// Name of the fleetspace. + /// The number of elements in the collection to skip. + /// The number of elements to return from the collection. + /// An opaque token that identifies a starting point in the collection. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task> ListByFleetspaceNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string fleetName, string fleetspaceName, long? skip = null, long? top = null, string skiptoken = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + Argument.AssertNotNullOrEmpty(fleetspaceName, nameof(fleetspaceName)); + + using var message = CreateListByFleetspaceNextPageRequest(nextLink, subscriptionId, resourceGroupName, fleetName, fleetspaceName, skip, top, skiptoken); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + FirewallRuleListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = FirewallRuleListResult.DeserializeFirewallRuleListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Gets all firewall rules in a fleetspace. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the database fleet. + /// Name of the fleetspace. + /// The number of elements in the collection to skip. + /// The number of elements to return from the collection. + /// An opaque token that identifies a starting point in the collection. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response ListByFleetspaceNextPage(string nextLink, string subscriptionId, string resourceGroupName, string fleetName, string fleetspaceName, long? skip = null, long? top = null, string skiptoken = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + Argument.AssertNotNullOrEmpty(fleetspaceName, nameof(fleetspaceName)); + + using var message = CreateListByFleetspaceNextPageRequest(nextLink, subscriptionId, resourceGroupName, fleetName, fleetspaceName, skip, top, skiptoken); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + FirewallRuleListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = FirewallRuleListResult.DeserializeFirewallRuleListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/RestOperations/FleetDatabasesRestOperations.cs b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/RestOperations/FleetDatabasesRestOperations.cs new file mode 100644 index 000000000000..98687433fe65 --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/RestOperations/FleetDatabasesRestOperations.cs @@ -0,0 +1,1021 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.DatabaseFleetManager.Models; + +namespace Azure.ResourceManager.DatabaseFleetManager +{ + internal partial class FleetDatabasesRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of FleetDatabasesRestOperations. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// The application id to use for user agent. + /// Service host. + /// The API version to use for this operation. + /// or is null. + public FleetDatabasesRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + { + _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); + _endpoint = endpoint ?? new Uri("https://management.azure.com"); + _apiVersion = apiVersion ?? "2025-02-01-preview"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string fleetName, string fleetspaceName, string databaseName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DatabaseFleetManager/fleets/", false); + uri.AppendPath(fleetName, true); + uri.AppendPath("/fleetspaces/", false); + uri.AppendPath(fleetspaceName, true); + uri.AppendPath("/databases/", false); + uri.AppendPath(databaseName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string fleetName, string fleetspaceName, string databaseName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DatabaseFleetManager/fleets/", false); + uri.AppendPath(fleetName, true); + uri.AppendPath("/fleetspaces/", false); + uri.AppendPath(fleetspaceName, true); + uri.AppendPath("/databases/", false); + uri.AppendPath(databaseName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Gets a fleet database. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the database fleet. + /// Name of the fleetspace. + /// Name of the database. + /// The cancellation token to use. + /// , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public async Task> GetAsync(string subscriptionId, string resourceGroupName, string fleetName, string fleetspaceName, string databaseName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + Argument.AssertNotNullOrEmpty(fleetspaceName, nameof(fleetspaceName)); + Argument.AssertNotNullOrEmpty(databaseName, nameof(databaseName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, fleetName, fleetspaceName, databaseName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + FleetDatabaseData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = FleetDatabaseData.DeserializeFleetDatabaseData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((FleetDatabaseData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// Gets a fleet database. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the database fleet. + /// Name of the fleetspace. + /// Name of the database. + /// The cancellation token to use. + /// , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public Response Get(string subscriptionId, string resourceGroupName, string fleetName, string fleetspaceName, string databaseName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + Argument.AssertNotNullOrEmpty(fleetspaceName, nameof(fleetspaceName)); + Argument.AssertNotNullOrEmpty(databaseName, nameof(databaseName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, fleetName, fleetspaceName, databaseName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + FleetDatabaseData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = FleetDatabaseData.DeserializeFleetDatabaseData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((FleetDatabaseData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateCreateOrUpdateRequestUri(string subscriptionId, string resourceGroupName, string fleetName, string fleetspaceName, string databaseName, FleetDatabaseData data) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DatabaseFleetManager/fleets/", false); + uri.AppendPath(fleetName, true); + uri.AppendPath("/fleetspaces/", false); + uri.AppendPath(fleetspaceName, true); + uri.AppendPath("/databases/", false); + uri.AppendPath(databaseName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string resourceGroupName, string fleetName, string fleetspaceName, string databaseName, FleetDatabaseData data) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Put; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DatabaseFleetManager/fleets/", false); + uri.AppendPath(fleetName, true); + uri.AppendPath("/fleetspaces/", false); + uri.AppendPath(fleetspaceName, true); + uri.AppendPath("/databases/", false); + uri.AppendPath(databaseName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(data, ModelSerializationExtensions.WireOptions); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Creates or updates a fleet database. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the database fleet. + /// Name of the fleetspace. + /// Name of the database. + /// The database object to create or update. + /// The cancellation token to use. + /// , , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public async Task CreateOrUpdateAsync(string subscriptionId, string resourceGroupName, string fleetName, string fleetspaceName, string databaseName, FleetDatabaseData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + Argument.AssertNotNullOrEmpty(fleetspaceName, nameof(fleetspaceName)); + Argument.AssertNotNullOrEmpty(databaseName, nameof(databaseName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, fleetName, fleetspaceName, databaseName, data); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 201: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Creates or updates a fleet database. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the database fleet. + /// Name of the fleetspace. + /// Name of the database. + /// The database object to create or update. + /// The cancellation token to use. + /// , , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public Response CreateOrUpdate(string subscriptionId, string resourceGroupName, string fleetName, string fleetspaceName, string databaseName, FleetDatabaseData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + Argument.AssertNotNullOrEmpty(fleetspaceName, nameof(fleetspaceName)); + Argument.AssertNotNullOrEmpty(databaseName, nameof(databaseName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, fleetName, fleetspaceName, databaseName, data); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 201: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateUpdateRequestUri(string subscriptionId, string resourceGroupName, string fleetName, string fleetspaceName, string databaseName, FleetDatabaseData data) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DatabaseFleetManager/fleets/", false); + uri.AppendPath(fleetName, true); + uri.AppendPath("/fleetspaces/", false); + uri.AppendPath(fleetspaceName, true); + uri.AppendPath("/databases/", false); + uri.AppendPath(databaseName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceGroupName, string fleetName, string fleetspaceName, string databaseName, FleetDatabaseData data) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Patch; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DatabaseFleetManager/fleets/", false); + uri.AppendPath(fleetName, true); + uri.AppendPath("/fleetspaces/", false); + uri.AppendPath(fleetspaceName, true); + uri.AppendPath("/databases/", false); + uri.AppendPath(databaseName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(data, ModelSerializationExtensions.WireOptions); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Updates a fleet database. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the database fleet. + /// Name of the fleetspace. + /// Name of the database. + /// The database object to patch. + /// The cancellation token to use. + /// , , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public async Task UpdateAsync(string subscriptionId, string resourceGroupName, string fleetName, string fleetspaceName, string databaseName, FleetDatabaseData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + Argument.AssertNotNullOrEmpty(fleetspaceName, nameof(fleetspaceName)); + Argument.AssertNotNullOrEmpty(databaseName, nameof(databaseName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, fleetName, fleetspaceName, databaseName, data); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Updates a fleet database. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the database fleet. + /// Name of the fleetspace. + /// Name of the database. + /// The database object to patch. + /// The cancellation token to use. + /// , , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public Response Update(string subscriptionId, string resourceGroupName, string fleetName, string fleetspaceName, string databaseName, FleetDatabaseData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + Argument.AssertNotNullOrEmpty(fleetspaceName, nameof(fleetspaceName)); + Argument.AssertNotNullOrEmpty(databaseName, nameof(databaseName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, fleetName, fleetspaceName, databaseName, data); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string resourceGroupName, string fleetName, string fleetspaceName, string databaseName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DatabaseFleetManager/fleets/", false); + uri.AppendPath(fleetName, true); + uri.AppendPath("/fleetspaces/", false); + uri.AppendPath(fleetspaceName, true); + uri.AppendPath("/databases/", false); + uri.AppendPath(databaseName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string fleetName, string fleetspaceName, string databaseName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Delete; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DatabaseFleetManager/fleets/", false); + uri.AppendPath(fleetName, true); + uri.AppendPath("/fleetspaces/", false); + uri.AppendPath(fleetspaceName, true); + uri.AppendPath("/databases/", false); + uri.AppendPath(databaseName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Deletes a fleet database. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the database fleet. + /// Name of the fleetspace. + /// Name of the database. + /// The cancellation token to use. + /// , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public async Task DeleteAsync(string subscriptionId, string resourceGroupName, string fleetName, string fleetspaceName, string databaseName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + Argument.AssertNotNullOrEmpty(fleetspaceName, nameof(fleetspaceName)); + Argument.AssertNotNullOrEmpty(databaseName, nameof(databaseName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, fleetName, fleetspaceName, databaseName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Deletes a fleet database. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the database fleet. + /// Name of the fleetspace. + /// Name of the database. + /// The cancellation token to use. + /// , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public Response Delete(string subscriptionId, string resourceGroupName, string fleetName, string fleetspaceName, string databaseName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + Argument.AssertNotNullOrEmpty(fleetspaceName, nameof(fleetspaceName)); + Argument.AssertNotNullOrEmpty(databaseName, nameof(databaseName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, fleetName, fleetspaceName, databaseName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListByFleetspaceRequestUri(string subscriptionId, string resourceGroupName, string fleetName, string fleetspaceName, long? skip, long? top, string filter, string skiptoken) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DatabaseFleetManager/fleets/", false); + uri.AppendPath(fleetName, true); + uri.AppendPath("/fleetspaces/", false); + uri.AppendPath(fleetspaceName, true); + uri.AppendPath("/databases", false); + uri.AppendQuery("api-version", _apiVersion, true); + if (skip != null) + { + uri.AppendQuery("$skip", skip.Value, true); + } + if (top != null) + { + uri.AppendQuery("$top", top.Value, true); + } + if (filter != null) + { + uri.AppendQuery("$filter", filter, true); + } + if (skiptoken != null) + { + uri.AppendQuery("$skiptoken", skiptoken, true); + } + return uri; + } + + internal HttpMessage CreateListByFleetspaceRequest(string subscriptionId, string resourceGroupName, string fleetName, string fleetspaceName, long? skip, long? top, string filter, string skiptoken) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DatabaseFleetManager/fleets/", false); + uri.AppendPath(fleetName, true); + uri.AppendPath("/fleetspaces/", false); + uri.AppendPath(fleetspaceName, true); + uri.AppendPath("/databases", false); + uri.AppendQuery("api-version", _apiVersion, true); + if (skip != null) + { + uri.AppendQuery("$skip", skip.Value, true); + } + if (top != null) + { + uri.AppendQuery("$top", top.Value, true); + } + if (filter != null) + { + uri.AppendQuery("$filter", filter, true); + } + if (skiptoken != null) + { + uri.AppendQuery("$skiptoken", skiptoken, true); + } + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Gets all fleet databases in a fleetspace. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the database fleet. + /// Name of the fleetspace. + /// The number of elements in the collection to skip. + /// The number of elements to return from the collection. + /// An OData filter expression that filters elements in the collection. + /// An opaque token that identifies a starting point in the collection. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task> ListByFleetspaceAsync(string subscriptionId, string resourceGroupName, string fleetName, string fleetspaceName, long? skip = null, long? top = null, string filter = null, string skiptoken = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + Argument.AssertNotNullOrEmpty(fleetspaceName, nameof(fleetspaceName)); + + using var message = CreateListByFleetspaceRequest(subscriptionId, resourceGroupName, fleetName, fleetspaceName, skip, top, filter, skiptoken); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + FleetDatabaseListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = FleetDatabaseListResult.DeserializeFleetDatabaseListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Gets all fleet databases in a fleetspace. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the database fleet. + /// Name of the fleetspace. + /// The number of elements in the collection to skip. + /// The number of elements to return from the collection. + /// An OData filter expression that filters elements in the collection. + /// An opaque token that identifies a starting point in the collection. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response ListByFleetspace(string subscriptionId, string resourceGroupName, string fleetName, string fleetspaceName, long? skip = null, long? top = null, string filter = null, string skiptoken = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + Argument.AssertNotNullOrEmpty(fleetspaceName, nameof(fleetspaceName)); + + using var message = CreateListByFleetspaceRequest(subscriptionId, resourceGroupName, fleetName, fleetspaceName, skip, top, filter, skiptoken); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + FleetDatabaseListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = FleetDatabaseListResult.DeserializeFleetDatabaseListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateChangeTierRequestUri(string subscriptionId, string resourceGroupName, string fleetName, string fleetspaceName, string databaseName, DatabaseChangeTierProperties body) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DatabaseFleetManager/fleets/", false); + uri.AppendPath(fleetName, true); + uri.AppendPath("/fleetspaces/", false); + uri.AppendPath(fleetspaceName, true); + uri.AppendPath("/databases/", false); + uri.AppendPath(databaseName, true); + uri.AppendPath("/changeTier", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateChangeTierRequest(string subscriptionId, string resourceGroupName, string fleetName, string fleetspaceName, string databaseName, DatabaseChangeTierProperties body) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DatabaseFleetManager/fleets/", false); + uri.AppendPath(fleetName, true); + uri.AppendPath("/fleetspaces/", false); + uri.AppendPath(fleetspaceName, true); + uri.AppendPath("/databases/", false); + uri.AppendPath(databaseName, true); + uri.AppendPath("/changeTier", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(body, ModelSerializationExtensions.WireOptions); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Moves database to a different tier. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the database fleet. + /// Name of the fleetspace. + /// Name of the database. + /// The details of the change tier operation. + /// The cancellation token to use. + /// , , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public async Task ChangeTierAsync(string subscriptionId, string resourceGroupName, string fleetName, string fleetspaceName, string databaseName, DatabaseChangeTierProperties body, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + Argument.AssertNotNullOrEmpty(fleetspaceName, nameof(fleetspaceName)); + Argument.AssertNotNullOrEmpty(databaseName, nameof(databaseName)); + Argument.AssertNotNull(body, nameof(body)); + + using var message = CreateChangeTierRequest(subscriptionId, resourceGroupName, fleetName, fleetspaceName, databaseName, body); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Moves database to a different tier. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the database fleet. + /// Name of the fleetspace. + /// Name of the database. + /// The details of the change tier operation. + /// The cancellation token to use. + /// , , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public Response ChangeTier(string subscriptionId, string resourceGroupName, string fleetName, string fleetspaceName, string databaseName, DatabaseChangeTierProperties body, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + Argument.AssertNotNullOrEmpty(fleetspaceName, nameof(fleetspaceName)); + Argument.AssertNotNullOrEmpty(databaseName, nameof(databaseName)); + Argument.AssertNotNull(body, nameof(body)); + + using var message = CreateChangeTierRequest(subscriptionId, resourceGroupName, fleetName, fleetspaceName, databaseName, body); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateRenameRequestUri(string subscriptionId, string resourceGroupName, string fleetName, string fleetspaceName, string databaseName, DatabaseRenameProperties body) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DatabaseFleetManager/fleets/", false); + uri.AppendPath(fleetName, true); + uri.AppendPath("/fleetspaces/", false); + uri.AppendPath(fleetspaceName, true); + uri.AppendPath("/databases/", false); + uri.AppendPath(databaseName, true); + uri.AppendPath("/rename", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateRenameRequest(string subscriptionId, string resourceGroupName, string fleetName, string fleetspaceName, string databaseName, DatabaseRenameProperties body) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DatabaseFleetManager/fleets/", false); + uri.AppendPath(fleetName, true); + uri.AppendPath("/fleetspaces/", false); + uri.AppendPath(fleetspaceName, true); + uri.AppendPath("/databases/", false); + uri.AppendPath(databaseName, true); + uri.AppendPath("/rename", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(body, ModelSerializationExtensions.WireOptions); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Renames a database. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the database fleet. + /// Name of the fleetspace. + /// Name of the database. + /// The details of the rename operation. + /// The cancellation token to use. + /// , , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public async Task RenameAsync(string subscriptionId, string resourceGroupName, string fleetName, string fleetspaceName, string databaseName, DatabaseRenameProperties body, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + Argument.AssertNotNullOrEmpty(fleetspaceName, nameof(fleetspaceName)); + Argument.AssertNotNullOrEmpty(databaseName, nameof(databaseName)); + Argument.AssertNotNull(body, nameof(body)); + + using var message = CreateRenameRequest(subscriptionId, resourceGroupName, fleetName, fleetspaceName, databaseName, body); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Renames a database. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the database fleet. + /// Name of the fleetspace. + /// Name of the database. + /// The details of the rename operation. + /// The cancellation token to use. + /// , , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public Response Rename(string subscriptionId, string resourceGroupName, string fleetName, string fleetspaceName, string databaseName, DatabaseRenameProperties body, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + Argument.AssertNotNullOrEmpty(fleetspaceName, nameof(fleetspaceName)); + Argument.AssertNotNullOrEmpty(databaseName, nameof(databaseName)); + Argument.AssertNotNull(body, nameof(body)); + + using var message = CreateRenameRequest(subscriptionId, resourceGroupName, fleetName, fleetspaceName, databaseName, body); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateRevertRequestUri(string subscriptionId, string resourceGroupName, string fleetName, string fleetspaceName, string databaseName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DatabaseFleetManager/fleets/", false); + uri.AppendPath(fleetName, true); + uri.AppendPath("/fleetspaces/", false); + uri.AppendPath(fleetspaceName, true); + uri.AppendPath("/databases/", false); + uri.AppendPath(databaseName, true); + uri.AppendPath("/revert", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateRevertRequest(string subscriptionId, string resourceGroupName, string fleetName, string fleetspaceName, string databaseName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DatabaseFleetManager/fleets/", false); + uri.AppendPath(fleetName, true); + uri.AppendPath("/fleetspaces/", false); + uri.AppendPath(fleetspaceName, true); + uri.AppendPath("/databases/", false); + uri.AppendPath(databaseName, true); + uri.AppendPath("/revert", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Revert a database transparent data encryption (TDE). + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the database fleet. + /// Name of the fleetspace. + /// Name of the database. + /// The cancellation token to use. + /// , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public async Task RevertAsync(string subscriptionId, string resourceGroupName, string fleetName, string fleetspaceName, string databaseName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + Argument.AssertNotNullOrEmpty(fleetspaceName, nameof(fleetspaceName)); + Argument.AssertNotNullOrEmpty(databaseName, nameof(databaseName)); + + using var message = CreateRevertRequest(subscriptionId, resourceGroupName, fleetName, fleetspaceName, databaseName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Revert a database transparent data encryption (TDE). + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the database fleet. + /// Name of the fleetspace. + /// Name of the database. + /// The cancellation token to use. + /// , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public Response Revert(string subscriptionId, string resourceGroupName, string fleetName, string fleetspaceName, string databaseName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + Argument.AssertNotNullOrEmpty(fleetspaceName, nameof(fleetspaceName)); + Argument.AssertNotNullOrEmpty(databaseName, nameof(databaseName)); + + using var message = CreateRevertRequest(subscriptionId, resourceGroupName, fleetName, fleetspaceName, databaseName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListByFleetspaceNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string fleetName, string fleetspaceName, long? skip, long? top, string filter, string skiptoken) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateListByFleetspaceNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string fleetName, string fleetspaceName, long? skip, long? top, string filter, string skiptoken) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Gets all fleet databases in a fleetspace. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the database fleet. + /// Name of the fleetspace. + /// The number of elements in the collection to skip. + /// The number of elements to return from the collection. + /// An OData filter expression that filters elements in the collection. + /// An opaque token that identifies a starting point in the collection. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task> ListByFleetspaceNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string fleetName, string fleetspaceName, long? skip = null, long? top = null, string filter = null, string skiptoken = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + Argument.AssertNotNullOrEmpty(fleetspaceName, nameof(fleetspaceName)); + + using var message = CreateListByFleetspaceNextPageRequest(nextLink, subscriptionId, resourceGroupName, fleetName, fleetspaceName, skip, top, filter, skiptoken); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + FleetDatabaseListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = FleetDatabaseListResult.DeserializeFleetDatabaseListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Gets all fleet databases in a fleetspace. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the database fleet. + /// Name of the fleetspace. + /// The number of elements in the collection to skip. + /// The number of elements to return from the collection. + /// An OData filter expression that filters elements in the collection. + /// An opaque token that identifies a starting point in the collection. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response ListByFleetspaceNextPage(string nextLink, string subscriptionId, string resourceGroupName, string fleetName, string fleetspaceName, long? skip = null, long? top = null, string filter = null, string skiptoken = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + Argument.AssertNotNullOrEmpty(fleetspaceName, nameof(fleetspaceName)); + + using var message = CreateListByFleetspaceNextPageRequest(nextLink, subscriptionId, resourceGroupName, fleetName, fleetspaceName, skip, top, filter, skiptoken); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + FleetDatabaseListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = FleetDatabaseListResult.DeserializeFleetDatabaseListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/RestOperations/FleetTiersRestOperations.cs b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/RestOperations/FleetTiersRestOperations.cs new file mode 100644 index 000000000000..62f71593b7d0 --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/RestOperations/FleetTiersRestOperations.cs @@ -0,0 +1,751 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.DatabaseFleetManager.Models; + +namespace Azure.ResourceManager.DatabaseFleetManager +{ + internal partial class FleetTiersRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of FleetTiersRestOperations. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// The application id to use for user agent. + /// Service host. + /// The API version to use for this operation. + /// or is null. + public FleetTiersRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + { + _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); + _endpoint = endpoint ?? new Uri("https://management.azure.com"); + _apiVersion = apiVersion ?? "2025-02-01-preview"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string fleetName, string tierName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DatabaseFleetManager/fleets/", false); + uri.AppendPath(fleetName, true); + uri.AppendPath("/tiers/", false); + uri.AppendPath(tierName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string fleetName, string tierName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DatabaseFleetManager/fleets/", false); + uri.AppendPath(fleetName, true); + uri.AppendPath("/tiers/", false); + uri.AppendPath(tierName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Gets a tier resource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the database fleet. + /// Name of the tier. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task> GetAsync(string subscriptionId, string resourceGroupName, string fleetName, string tierName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + Argument.AssertNotNullOrEmpty(tierName, nameof(tierName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, fleetName, tierName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + FleetTierData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = FleetTierData.DeserializeFleetTierData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((FleetTierData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// Gets a tier resource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the database fleet. + /// Name of the tier. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response Get(string subscriptionId, string resourceGroupName, string fleetName, string tierName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + Argument.AssertNotNullOrEmpty(tierName, nameof(tierName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, fleetName, tierName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + FleetTierData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = FleetTierData.DeserializeFleetTierData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((FleetTierData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateCreateOrUpdateRequestUri(string subscriptionId, string resourceGroupName, string fleetName, string tierName, FleetTierData data) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DatabaseFleetManager/fleets/", false); + uri.AppendPath(fleetName, true); + uri.AppendPath("/tiers/", false); + uri.AppendPath(tierName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string resourceGroupName, string fleetName, string tierName, FleetTierData data) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Put; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DatabaseFleetManager/fleets/", false); + uri.AppendPath(fleetName, true); + uri.AppendPath("/tiers/", false); + uri.AppendPath(tierName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(data, ModelSerializationExtensions.WireOptions); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Creates or updates a tier. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the database fleet. + /// Name of the tier. + /// The tier object to create or update. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task CreateOrUpdateAsync(string subscriptionId, string resourceGroupName, string fleetName, string tierName, FleetTierData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + Argument.AssertNotNullOrEmpty(tierName, nameof(tierName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, fleetName, tierName, data); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 201: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Creates or updates a tier. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the database fleet. + /// Name of the tier. + /// The tier object to create or update. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response CreateOrUpdate(string subscriptionId, string resourceGroupName, string fleetName, string tierName, FleetTierData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + Argument.AssertNotNullOrEmpty(tierName, nameof(tierName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, fleetName, tierName, data); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 201: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateUpdateRequestUri(string subscriptionId, string resourceGroupName, string fleetName, string tierName, FleetTierData data) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DatabaseFleetManager/fleets/", false); + uri.AppendPath(fleetName, true); + uri.AppendPath("/tiers/", false); + uri.AppendPath(tierName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceGroupName, string fleetName, string tierName, FleetTierData data) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Patch; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DatabaseFleetManager/fleets/", false); + uri.AppendPath(fleetName, true); + uri.AppendPath("/tiers/", false); + uri.AppendPath(tierName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(data, ModelSerializationExtensions.WireOptions); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Updates a tier. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the database fleet. + /// Name of the tier. + /// The resource properties to be updated. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task UpdateAsync(string subscriptionId, string resourceGroupName, string fleetName, string tierName, FleetTierData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + Argument.AssertNotNullOrEmpty(tierName, nameof(tierName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, fleetName, tierName, data); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Updates a tier. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the database fleet. + /// Name of the tier. + /// The resource properties to be updated. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response Update(string subscriptionId, string resourceGroupName, string fleetName, string tierName, FleetTierData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + Argument.AssertNotNullOrEmpty(tierName, nameof(tierName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, fleetName, tierName, data); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string resourceGroupName, string fleetName, string tierName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DatabaseFleetManager/fleets/", false); + uri.AppendPath(fleetName, true); + uri.AppendPath("/tiers/", false); + uri.AppendPath(tierName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string fleetName, string tierName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Delete; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DatabaseFleetManager/fleets/", false); + uri.AppendPath(fleetName, true); + uri.AppendPath("/tiers/", false); + uri.AppendPath(tierName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Deletes a tier. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the database fleet. + /// Name of the tier. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task DeleteAsync(string subscriptionId, string resourceGroupName, string fleetName, string tierName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + Argument.AssertNotNullOrEmpty(tierName, nameof(tierName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, fleetName, tierName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Deletes a tier. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the database fleet. + /// Name of the tier. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response Delete(string subscriptionId, string resourceGroupName, string fleetName, string tierName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + Argument.AssertNotNullOrEmpty(tierName, nameof(tierName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, fleetName, tierName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListByFleetRequestUri(string subscriptionId, string resourceGroupName, string fleetName, long? skip, long? top, string skiptoken) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DatabaseFleetManager/fleets/", false); + uri.AppendPath(fleetName, true); + uri.AppendPath("/tiers", false); + uri.AppendQuery("api-version", _apiVersion, true); + if (skip != null) + { + uri.AppendQuery("$skip", skip.Value, true); + } + if (top != null) + { + uri.AppendQuery("$top", top.Value, true); + } + if (skiptoken != null) + { + uri.AppendQuery("$skiptoken", skiptoken, true); + } + return uri; + } + + internal HttpMessage CreateListByFleetRequest(string subscriptionId, string resourceGroupName, string fleetName, long? skip, long? top, string skiptoken) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DatabaseFleetManager/fleets/", false); + uri.AppendPath(fleetName, true); + uri.AppendPath("/tiers", false); + uri.AppendQuery("api-version", _apiVersion, true); + if (skip != null) + { + uri.AppendQuery("$skip", skip.Value, true); + } + if (top != null) + { + uri.AppendQuery("$top", top.Value, true); + } + if (skiptoken != null) + { + uri.AppendQuery("$skiptoken", skiptoken, true); + } + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List tiers in a fleet. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the database fleet. + /// The number of elements in the collection to skip. + /// The number of elements to return from the collection. + /// An opaque token that identifies a starting point in the collection. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> ListByFleetAsync(string subscriptionId, string resourceGroupName, string fleetName, long? skip = null, long? top = null, string skiptoken = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + + using var message = CreateListByFleetRequest(subscriptionId, resourceGroupName, fleetName, skip, top, skiptoken); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + FleetTierListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = FleetTierListResult.DeserializeFleetTierListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List tiers in a fleet. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the database fleet. + /// The number of elements in the collection to skip. + /// The number of elements to return from the collection. + /// An opaque token that identifies a starting point in the collection. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response ListByFleet(string subscriptionId, string resourceGroupName, string fleetName, long? skip = null, long? top = null, string skiptoken = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + + using var message = CreateListByFleetRequest(subscriptionId, resourceGroupName, fleetName, skip, top, skiptoken); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + FleetTierListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = FleetTierListResult.DeserializeFleetTierListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateDisableRequestUri(string subscriptionId, string resourceGroupName, string fleetName, string tierName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DatabaseFleetManager/fleets/", false); + uri.AppendPath(fleetName, true); + uri.AppendPath("/tiers/", false); + uri.AppendPath(tierName, true); + uri.AppendPath("/disable", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateDisableRequest(string subscriptionId, string resourceGroupName, string fleetName, string tierName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DatabaseFleetManager/fleets/", false); + uri.AppendPath(fleetName, true); + uri.AppendPath("/tiers/", false); + uri.AppendPath(tierName, true); + uri.AppendPath("/disable", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Disables a tier. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the database fleet. + /// Name of the tier. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task> DisableAsync(string subscriptionId, string resourceGroupName, string fleetName, string tierName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + Argument.AssertNotNullOrEmpty(tierName, nameof(tierName)); + + using var message = CreateDisableRequest(subscriptionId, resourceGroupName, fleetName, tierName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + FleetTierData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = FleetTierData.DeserializeFleetTierData(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Disables a tier. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the database fleet. + /// Name of the tier. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response Disable(string subscriptionId, string resourceGroupName, string fleetName, string tierName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + Argument.AssertNotNullOrEmpty(tierName, nameof(tierName)); + + using var message = CreateDisableRequest(subscriptionId, resourceGroupName, fleetName, tierName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + FleetTierData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = FleetTierData.DeserializeFleetTierData(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListByFleetNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string fleetName, long? skip, long? top, string skiptoken) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateListByFleetNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string fleetName, long? skip, long? top, string skiptoken) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List tiers in a fleet. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the database fleet. + /// The number of elements in the collection to skip. + /// The number of elements to return from the collection. + /// An opaque token that identifies a starting point in the collection. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> ListByFleetNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string fleetName, long? skip = null, long? top = null, string skiptoken = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + + using var message = CreateListByFleetNextPageRequest(nextLink, subscriptionId, resourceGroupName, fleetName, skip, top, skiptoken); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + FleetTierListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = FleetTierListResult.DeserializeFleetTierListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List tiers in a fleet. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the database fleet. + /// The number of elements in the collection to skip. + /// The number of elements to return from the collection. + /// An opaque token that identifies a starting point in the collection. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response ListByFleetNextPage(string nextLink, string subscriptionId, string resourceGroupName, string fleetName, long? skip = null, long? top = null, string skiptoken = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + + using var message = CreateListByFleetNextPageRequest(nextLink, subscriptionId, resourceGroupName, fleetName, skip, top, skiptoken); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + FleetTierListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = FleetTierListResult.DeserializeFleetTierListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/RestOperations/FleetsRestOperations.cs b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/RestOperations/FleetsRestOperations.cs new file mode 100644 index 000000000000..4789af1cc296 --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/RestOperations/FleetsRestOperations.cs @@ -0,0 +1,759 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.DatabaseFleetManager.Models; + +namespace Azure.ResourceManager.DatabaseFleetManager +{ + internal partial class FleetsRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of FleetsRestOperations. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// The application id to use for user agent. + /// Service host. + /// The API version to use for this operation. + /// or is null. + public FleetsRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + { + _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); + _endpoint = endpoint ?? new Uri("https://management.azure.com"); + _apiVersion = apiVersion ?? "2025-02-01-preview"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string fleetName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DatabaseFleetManager/fleets/", false); + uri.AppendPath(fleetName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string fleetName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DatabaseFleetManager/fleets/", false); + uri.AppendPath(fleetName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Gets a fleet resource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the database fleet. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> GetAsync(string subscriptionId, string resourceGroupName, string fleetName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, fleetName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + FleetData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = FleetData.DeserializeFleetData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((FleetData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// Gets a fleet resource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the database fleet. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response Get(string subscriptionId, string resourceGroupName, string fleetName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, fleetName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + FleetData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = FleetData.DeserializeFleetData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((FleetData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateCreateOrUpdateRequestUri(string subscriptionId, string resourceGroupName, string fleetName, FleetData data) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DatabaseFleetManager/fleets/", false); + uri.AppendPath(fleetName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string resourceGroupName, string fleetName, FleetData data) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Put; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DatabaseFleetManager/fleets/", false); + uri.AppendPath(fleetName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(data, ModelSerializationExtensions.WireOptions); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Creates or updates a fleet resource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the database fleet. + /// The fleet object to create or update. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task CreateOrUpdateAsync(string subscriptionId, string resourceGroupName, string fleetName, FleetData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, fleetName, data); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 201: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Creates or updates a fleet resource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the database fleet. + /// The fleet object to create or update. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response CreateOrUpdate(string subscriptionId, string resourceGroupName, string fleetName, FleetData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, fleetName, data); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 201: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateUpdateRequestUri(string subscriptionId, string resourceGroupName, string fleetName, FleetPatch patch) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DatabaseFleetManager/fleets/", false); + uri.AppendPath(fleetName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceGroupName, string fleetName, FleetPatch patch) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Patch; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DatabaseFleetManager/fleets/", false); + uri.AppendPath(fleetName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(patch, ModelSerializationExtensions.WireOptions); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Modifies a fleet resource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the database fleet. + /// The fleet object to patch. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task UpdateAsync(string subscriptionId, string resourceGroupName, string fleetName, FleetPatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + Argument.AssertNotNull(patch, nameof(patch)); + + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, fleetName, patch); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Modifies a fleet resource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the database fleet. + /// The fleet object to patch. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response Update(string subscriptionId, string resourceGroupName, string fleetName, FleetPatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + Argument.AssertNotNull(patch, nameof(patch)); + + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, fleetName, patch); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string resourceGroupName, string fleetName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DatabaseFleetManager/fleets/", false); + uri.AppendPath(fleetName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string fleetName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Delete; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DatabaseFleetManager/fleets/", false); + uri.AppendPath(fleetName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Deletes a fleet. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the database fleet. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task DeleteAsync(string subscriptionId, string resourceGroupName, string fleetName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, fleetName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Deletes a fleet. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the database fleet. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response Delete(string subscriptionId, string resourceGroupName, string fleetName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, fleetName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListByResourceGroupRequestUri(string subscriptionId, string resourceGroupName, long? skip, long? top, string skiptoken) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DatabaseFleetManager/fleets", false); + uri.AppendQuery("api-version", _apiVersion, true); + if (skip != null) + { + uri.AppendQuery("$skip", skip.Value, true); + } + if (top != null) + { + uri.AppendQuery("$top", top.Value, true); + } + if (skiptoken != null) + { + uri.AppendQuery("$skiptoken", skiptoken, true); + } + return uri; + } + + internal HttpMessage CreateListByResourceGroupRequest(string subscriptionId, string resourceGroupName, long? skip, long? top, string skiptoken) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DatabaseFleetManager/fleets", false); + uri.AppendQuery("api-version", _apiVersion, true); + if (skip != null) + { + uri.AppendQuery("$skip", skip.Value, true); + } + if (top != null) + { + uri.AppendQuery("$top", top.Value, true); + } + if (skiptoken != null) + { + uri.AppendQuery("$skiptoken", skiptoken, true); + } + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Gets all fleets in a resource group. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The number of elements in the collection to skip. + /// The number of elements to return from the collection. + /// An opaque token that identifies a starting point in the collection. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + public async Task> ListByResourceGroupAsync(string subscriptionId, string resourceGroupName, long? skip = null, long? top = null, string skiptoken = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + + using var message = CreateListByResourceGroupRequest(subscriptionId, resourceGroupName, skip, top, skiptoken); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + FleetListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = FleetListResult.DeserializeFleetListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Gets all fleets in a resource group. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The number of elements in the collection to skip. + /// The number of elements to return from the collection. + /// An opaque token that identifies a starting point in the collection. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + public Response ListByResourceGroup(string subscriptionId, string resourceGroupName, long? skip = null, long? top = null, string skiptoken = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + + using var message = CreateListByResourceGroupRequest(subscriptionId, resourceGroupName, skip, top, skiptoken); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + FleetListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = FleetListResult.DeserializeFleetListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListRequestUri(string subscriptionId) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/providers/Microsoft.DatabaseFleetManager/fleets", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateListRequest(string subscriptionId) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/providers/Microsoft.DatabaseFleetManager/fleets", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Gets all fleets in a subscription. + /// The ID of the target subscription. The value must be an UUID. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + public async Task> ListAsync(string subscriptionId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + + using var message = CreateListRequest(subscriptionId); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + FleetListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = FleetListResult.DeserializeFleetListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Gets all fleets in a subscription. + /// The ID of the target subscription. The value must be an UUID. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + public Response List(string subscriptionId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + + using var message = CreateListRequest(subscriptionId); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + FleetListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = FleetListResult.DeserializeFleetListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListByResourceGroupNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, long? skip, long? top, string skiptoken) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateListByResourceGroupNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, long? skip, long? top, string skiptoken) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Gets all fleets in a resource group. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The number of elements in the collection to skip. + /// The number of elements to return from the collection. + /// An opaque token that identifies a starting point in the collection. + /// The cancellation token to use. + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + public async Task> ListByResourceGroupNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, long? skip = null, long? top = null, string skiptoken = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + + using var message = CreateListByResourceGroupNextPageRequest(nextLink, subscriptionId, resourceGroupName, skip, top, skiptoken); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + FleetListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = FleetListResult.DeserializeFleetListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Gets all fleets in a resource group. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The number of elements in the collection to skip. + /// The number of elements to return from the collection. + /// An opaque token that identifies a starting point in the collection. + /// The cancellation token to use. + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + public Response ListByResourceGroupNextPage(string nextLink, string subscriptionId, string resourceGroupName, long? skip = null, long? top = null, string skiptoken = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + + using var message = CreateListByResourceGroupNextPageRequest(nextLink, subscriptionId, resourceGroupName, skip, top, skiptoken); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + FleetListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = FleetListResult.DeserializeFleetListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListNextPageRequestUri(string nextLink, string subscriptionId) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateListNextPageRequest(string nextLink, string subscriptionId) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Gets all fleets in a subscription. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + public async Task> ListNextPageAsync(string nextLink, string subscriptionId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + + using var message = CreateListNextPageRequest(nextLink, subscriptionId); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + FleetListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = FleetListResult.DeserializeFleetListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Gets all fleets in a subscription. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + public Response ListNextPage(string nextLink, string subscriptionId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + + using var message = CreateListNextPageRequest(nextLink, subscriptionId); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + FleetListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = FleetListResult.DeserializeFleetListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/RestOperations/FleetspacesRestOperations.cs b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/RestOperations/FleetspacesRestOperations.cs new file mode 100644 index 000000000000..c540ace18c2c --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/RestOperations/FleetspacesRestOperations.cs @@ -0,0 +1,841 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.DatabaseFleetManager.Models; + +namespace Azure.ResourceManager.DatabaseFleetManager +{ + internal partial class FleetspacesRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of FleetspacesRestOperations. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// The application id to use for user agent. + /// Service host. + /// The API version to use for this operation. + /// or is null. + public FleetspacesRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + { + _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); + _endpoint = endpoint ?? new Uri("https://management.azure.com"); + _apiVersion = apiVersion ?? "2025-02-01-preview"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string fleetName, string fleetspaceName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DatabaseFleetManager/fleets/", false); + uri.AppendPath(fleetName, true); + uri.AppendPath("/fleetspaces/", false); + uri.AppendPath(fleetspaceName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string fleetName, string fleetspaceName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DatabaseFleetManager/fleets/", false); + uri.AppendPath(fleetName, true); + uri.AppendPath("/fleetspaces/", false); + uri.AppendPath(fleetspaceName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Gets fleetspace resource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the database fleet. + /// Name of the fleetspace. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task> GetAsync(string subscriptionId, string resourceGroupName, string fleetName, string fleetspaceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + Argument.AssertNotNullOrEmpty(fleetspaceName, nameof(fleetspaceName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, fleetName, fleetspaceName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + FleetspaceData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = FleetspaceData.DeserializeFleetspaceData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((FleetspaceData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// Gets fleetspace resource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the database fleet. + /// Name of the fleetspace. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response Get(string subscriptionId, string resourceGroupName, string fleetName, string fleetspaceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + Argument.AssertNotNullOrEmpty(fleetspaceName, nameof(fleetspaceName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, fleetName, fleetspaceName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + FleetspaceData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = FleetspaceData.DeserializeFleetspaceData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((FleetspaceData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateCreateOrUpdateRequestUri(string subscriptionId, string resourceGroupName, string fleetName, string fleetspaceName, FleetspaceData data) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DatabaseFleetManager/fleets/", false); + uri.AppendPath(fleetName, true); + uri.AppendPath("/fleetspaces/", false); + uri.AppendPath(fleetspaceName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string resourceGroupName, string fleetName, string fleetspaceName, FleetspaceData data) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Put; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DatabaseFleetManager/fleets/", false); + uri.AppendPath(fleetName, true); + uri.AppendPath("/fleetspaces/", false); + uri.AppendPath(fleetspaceName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(data, ModelSerializationExtensions.WireOptions); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Creates or updates a fleetspace resource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the database fleet. + /// Name of the fleetspace. + /// The fleet object to create or update. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task CreateOrUpdateAsync(string subscriptionId, string resourceGroupName, string fleetName, string fleetspaceName, FleetspaceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + Argument.AssertNotNullOrEmpty(fleetspaceName, nameof(fleetspaceName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, fleetName, fleetspaceName, data); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 201: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Creates or updates a fleetspace resource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the database fleet. + /// Name of the fleetspace. + /// The fleet object to create or update. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response CreateOrUpdate(string subscriptionId, string resourceGroupName, string fleetName, string fleetspaceName, FleetspaceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + Argument.AssertNotNullOrEmpty(fleetspaceName, nameof(fleetspaceName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, fleetName, fleetspaceName, data); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 201: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateUpdateRequestUri(string subscriptionId, string resourceGroupName, string fleetName, string fleetspaceName, FleetspaceData data) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DatabaseFleetManager/fleets/", false); + uri.AppendPath(fleetName, true); + uri.AppendPath("/fleetspaces/", false); + uri.AppendPath(fleetspaceName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceGroupName, string fleetName, string fleetspaceName, FleetspaceData data) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Patch; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DatabaseFleetManager/fleets/", false); + uri.AppendPath(fleetName, true); + uri.AppendPath("/fleetspaces/", false); + uri.AppendPath(fleetspaceName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(data, ModelSerializationExtensions.WireOptions); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Modifies a fleetspace resource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the database fleet. + /// Name of the fleetspace. + /// The resource properties to be updated. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task UpdateAsync(string subscriptionId, string resourceGroupName, string fleetName, string fleetspaceName, FleetspaceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + Argument.AssertNotNullOrEmpty(fleetspaceName, nameof(fleetspaceName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, fleetName, fleetspaceName, data); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Modifies a fleetspace resource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the database fleet. + /// Name of the fleetspace. + /// The resource properties to be updated. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response Update(string subscriptionId, string resourceGroupName, string fleetName, string fleetspaceName, FleetspaceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + Argument.AssertNotNullOrEmpty(fleetspaceName, nameof(fleetspaceName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, fleetName, fleetspaceName, data); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string resourceGroupName, string fleetName, string fleetspaceName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DatabaseFleetManager/fleets/", false); + uri.AppendPath(fleetName, true); + uri.AppendPath("/fleetspaces/", false); + uri.AppendPath(fleetspaceName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string fleetName, string fleetspaceName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Delete; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DatabaseFleetManager/fleets/", false); + uri.AppendPath(fleetName, true); + uri.AppendPath("/fleetspaces/", false); + uri.AppendPath(fleetspaceName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Deletes a fleetspace. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the database fleet. + /// Name of the fleetspace. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task DeleteAsync(string subscriptionId, string resourceGroupName, string fleetName, string fleetspaceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + Argument.AssertNotNullOrEmpty(fleetspaceName, nameof(fleetspaceName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, fleetName, fleetspaceName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Deletes a fleetspace. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the database fleet. + /// Name of the fleetspace. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response Delete(string subscriptionId, string resourceGroupName, string fleetName, string fleetspaceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + Argument.AssertNotNullOrEmpty(fleetspaceName, nameof(fleetspaceName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, fleetName, fleetspaceName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListByFleetRequestUri(string subscriptionId, string resourceGroupName, string fleetName, long? skip, long? top, string skiptoken) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DatabaseFleetManager/fleets/", false); + uri.AppendPath(fleetName, true); + uri.AppendPath("/fleetspaces", false); + uri.AppendQuery("api-version", _apiVersion, true); + if (skip != null) + { + uri.AppendQuery("$skip", skip.Value, true); + } + if (top != null) + { + uri.AppendQuery("$top", top.Value, true); + } + if (skiptoken != null) + { + uri.AppendQuery("$skiptoken", skiptoken, true); + } + return uri; + } + + internal HttpMessage CreateListByFleetRequest(string subscriptionId, string resourceGroupName, string fleetName, long? skip, long? top, string skiptoken) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DatabaseFleetManager/fleets/", false); + uri.AppendPath(fleetName, true); + uri.AppendPath("/fleetspaces", false); + uri.AppendQuery("api-version", _apiVersion, true); + if (skip != null) + { + uri.AppendQuery("$skip", skip.Value, true); + } + if (top != null) + { + uri.AppendQuery("$top", top.Value, true); + } + if (skiptoken != null) + { + uri.AppendQuery("$skiptoken", skiptoken, true); + } + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Lists fleetspaces in a fleet. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the database fleet. + /// The number of elements in the collection to skip. + /// The number of elements to return from the collection. + /// An opaque token that identifies a starting point in the collection. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> ListByFleetAsync(string subscriptionId, string resourceGroupName, string fleetName, long? skip = null, long? top = null, string skiptoken = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + + using var message = CreateListByFleetRequest(subscriptionId, resourceGroupName, fleetName, skip, top, skiptoken); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + FleetspaceListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = FleetspaceListResult.DeserializeFleetspaceListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Lists fleetspaces in a fleet. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the database fleet. + /// The number of elements in the collection to skip. + /// The number of elements to return from the collection. + /// An opaque token that identifies a starting point in the collection. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response ListByFleet(string subscriptionId, string resourceGroupName, string fleetName, long? skip = null, long? top = null, string skiptoken = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + + using var message = CreateListByFleetRequest(subscriptionId, resourceGroupName, fleetName, skip, top, skiptoken); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + FleetspaceListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = FleetspaceListResult.DeserializeFleetspaceListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateRegisterServerRequestUri(string subscriptionId, string resourceGroupName, string fleetName, string fleetspaceName, RegisterServerProperties body) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DatabaseFleetManager/fleets/", false); + uri.AppendPath(fleetName, true); + uri.AppendPath("/fleetspaces/", false); + uri.AppendPath(fleetspaceName, true); + uri.AppendPath("/registerServer", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateRegisterServerRequest(string subscriptionId, string resourceGroupName, string fleetName, string fleetspaceName, RegisterServerProperties body) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DatabaseFleetManager/fleets/", false); + uri.AppendPath(fleetName, true); + uri.AppendPath("/fleetspaces/", false); + uri.AppendPath(fleetspaceName, true); + uri.AppendPath("/registerServer", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(body, ModelSerializationExtensions.WireOptions); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Migrates an existing logical server into fleet. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the database fleet. + /// Name of the fleetspace. + /// The details of the register server operation. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task RegisterServerAsync(string subscriptionId, string resourceGroupName, string fleetName, string fleetspaceName, RegisterServerProperties body, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + Argument.AssertNotNullOrEmpty(fleetspaceName, nameof(fleetspaceName)); + Argument.AssertNotNull(body, nameof(body)); + + using var message = CreateRegisterServerRequest(subscriptionId, resourceGroupName, fleetName, fleetspaceName, body); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Migrates an existing logical server into fleet. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the database fleet. + /// Name of the fleetspace. + /// The details of the register server operation. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response RegisterServer(string subscriptionId, string resourceGroupName, string fleetName, string fleetspaceName, RegisterServerProperties body, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + Argument.AssertNotNullOrEmpty(fleetspaceName, nameof(fleetspaceName)); + Argument.AssertNotNull(body, nameof(body)); + + using var message = CreateRegisterServerRequest(subscriptionId, resourceGroupName, fleetName, fleetspaceName, body); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateUnregisterRequestUri(string subscriptionId, string resourceGroupName, string fleetName, string fleetspaceName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DatabaseFleetManager/fleets/", false); + uri.AppendPath(fleetName, true); + uri.AppendPath("/fleetspaces/", false); + uri.AppendPath(fleetspaceName, true); + uri.AppendPath("/unregister", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateUnregisterRequest(string subscriptionId, string resourceGroupName, string fleetName, string fleetspaceName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DatabaseFleetManager/fleets/", false); + uri.AppendPath(fleetName, true); + uri.AppendPath("/fleetspaces/", false); + uri.AppendPath(fleetspaceName, true); + uri.AppendPath("/unregister", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Unregisters all databases from a fleetspace. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the database fleet. + /// Name of the fleetspace. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task UnregisterAsync(string subscriptionId, string resourceGroupName, string fleetName, string fleetspaceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + Argument.AssertNotNullOrEmpty(fleetspaceName, nameof(fleetspaceName)); + + using var message = CreateUnregisterRequest(subscriptionId, resourceGroupName, fleetName, fleetspaceName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Unregisters all databases from a fleetspace. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the database fleet. + /// Name of the fleetspace. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response Unregister(string subscriptionId, string resourceGroupName, string fleetName, string fleetspaceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + Argument.AssertNotNullOrEmpty(fleetspaceName, nameof(fleetspaceName)); + + using var message = CreateUnregisterRequest(subscriptionId, resourceGroupName, fleetName, fleetspaceName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListByFleetNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string fleetName, long? skip, long? top, string skiptoken) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateListByFleetNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string fleetName, long? skip, long? top, string skiptoken) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Lists fleetspaces in a fleet. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the database fleet. + /// The number of elements in the collection to skip. + /// The number of elements to return from the collection. + /// An opaque token that identifies a starting point in the collection. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> ListByFleetNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string fleetName, long? skip = null, long? top = null, string skiptoken = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + + using var message = CreateListByFleetNextPageRequest(nextLink, subscriptionId, resourceGroupName, fleetName, skip, top, skiptoken); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + FleetspaceListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = FleetspaceListResult.DeserializeFleetspaceListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Lists fleetspaces in a fleet. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the database fleet. + /// The number of elements in the collection to skip. + /// The number of elements to return from the collection. + /// An opaque token that identifies a starting point in the collection. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response ListByFleetNextPage(string nextLink, string subscriptionId, string resourceGroupName, string fleetName, long? skip = null, long? top = null, string skiptoken = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + + using var message = CreateListByFleetNextPageRequest(nextLink, subscriptionId, resourceGroupName, fleetName, skip, top, skiptoken); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + FleetspaceListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = FleetspaceListResult.DeserializeFleetspaceListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Properties/AssemblyInfo.cs b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Properties/AssemblyInfo.cs new file mode 100644 index 000000000000..5054b8d16600 --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Properties/AssemblyInfo.cs @@ -0,0 +1,11 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System.Runtime.CompilerServices; + +[assembly: InternalsVisibleTo("Azure.ResourceManager.DatabaseFleetManager.Tests, PublicKey = 0024000004800000940000000602000000240000525341310004000001000100d15ddcb29688295338af4b7686603fe614abd555e09efba8fb88ee09e1f7b1ccaeed2e8f823fa9eef3fdd60217fc012ea67d2479751a0b8c087a4185541b851bd8b16f8d91b840e51b1cb0ba6fe647997e57429265e85ef62d565db50a69ae1647d54d7bd855e4db3d8a91510e5bcbd0edfbbecaa20a7bd9ae74593daa7b11b4")] + +// Replace Microsoft.Test with the correct resource provider namepace for your service and uncomment. +// See https://docs.microsoft.com/en-us/azure/azure-resource-manager/management/azure-services-resource-providers +// for the list of possible values. +[assembly: Azure.Core.AzureResourceProviderNamespace("DatabaseFleetManager")] diff --git a/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/tests/Azure.ResourceManager.DatabaseFleetManager.Tests.csproj b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/tests/Azure.ResourceManager.DatabaseFleetManager.Tests.csproj new file mode 100644 index 000000000000..0d3762ddbdc3 --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/tests/Azure.ResourceManager.DatabaseFleetManager.Tests.csproj @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/tests/DatabaseFleetManagerManagementTestBase.cs b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/tests/DatabaseFleetManagerManagementTestBase.cs new file mode 100644 index 000000000000..7ffd79d94660 --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/tests/DatabaseFleetManagerManagementTestBase.cs @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using Azure; +using Azure.Core; +using Azure.Core.TestFramework; +using Azure.ResourceManager; +using Azure.ResourceManager.Resources; +using Azure.ResourceManager.TestFramework; +using NUnit.Framework; +using System.Threading.Tasks; + +namespace Azure.ResourceManager.DatabaseFleetManager.Tests +{ + public class DatabaseFleetManagerManagementTestBase : ManagementRecordedTestBase + { + protected ArmClient Client { get; private set; } + protected SubscriptionResource DefaultSubscription { get; private set; } + + protected DatabaseFleetManagerManagementTestBase(bool isAsync, RecordedTestMode mode) + : base(isAsync, mode) + { + } + + protected DatabaseFleetManagerManagementTestBase(bool isAsync) + : base(isAsync) + { + } + + [SetUp] + public async Task CreateCommonClient() + { + Client = GetArmClient(); + DefaultSubscription = await Client.GetDefaultSubscriptionAsync().ConfigureAwait(false); + } + + protected async Task CreateResourceGroup(SubscriptionResource subscription, string rgNamePrefix, AzureLocation location) + { + string rgName = Recording.GenerateAssetName(rgNamePrefix); + ResourceGroupData input = new ResourceGroupData(location); + var lro = await subscription.GetResourceGroups().CreateOrUpdateAsync(WaitUntil.Completed, rgName, input); + return lro.Value; + } + } +} diff --git a/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/tests/DatabaseFleetManagerManagementTestEnvironment.cs b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/tests/DatabaseFleetManagerManagementTestEnvironment.cs new file mode 100644 index 000000000000..9582ae45e94a --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/tests/DatabaseFleetManagerManagementTestEnvironment.cs @@ -0,0 +1,11 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using Azure.Core.TestFramework; + +namespace Azure.ResourceManager.DatabaseFleetManager.Tests +{ + public class DatabaseFleetManagerManagementTestEnvironment : TestEnvironment + { + } +} diff --git a/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/tsp-location.yaml b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/tsp-location.yaml new file mode 100644 index 000000000000..81be649699c8 --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/tsp-location.yaml @@ -0,0 +1,4 @@ +directory: specification/databasefleetmanager/DatabaseFleetManager.Management +commit: 676334a284e5136f0a0721d6ae844bb04332f579 +repo: Azure/azure-rest-api-specs +additionalDirectories: diff --git a/sdk/databasefleetmanager/ci.mgmt.yml b/sdk/databasefleetmanager/ci.mgmt.yml new file mode 100644 index 000000000000..97b2f849f23c --- /dev/null +++ b/sdk/databasefleetmanager/ci.mgmt.yml @@ -0,0 +1,26 @@ +# NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. + +trigger: none + +pr: + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/databasefleetmanager /ci.mgmt.yml + - sdk/databasefleetmanager /Azure.ResourceManager.DatabaseFleetManager / + + +extends: + template: /eng/pipelines/templates/stages/archetype-sdk-client.yml + parameters: + ServiceDirectory: databasefleetmanager + ArtifactName: packages + LimitForPullRequest: true + Artifacts: + - name: Azure.ResourceManager.DatabaseFleetManager + safeName: AzureResourceManagerDatabaseFleetManager diff --git a/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/Azure.ResourceManager.DatabaseWatcher.sln b/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/Azure.ResourceManager.DatabaseWatcher.sln new file mode 100644 index 000000000000..313caa46f33f --- /dev/null +++ b/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/Azure.ResourceManager.DatabaseWatcher.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.DatabaseWatcher.Samples", "samples\Azure.ResourceManager.DatabaseWatcher.Samples.csproj", "{7A2DFF15-5746-49F4-BD0F-C6C35337088A}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Azure.ResourceManager.DatabaseWatcher", "src\Azure.ResourceManager.DatabaseWatcher.csproj", "{28FF4005-4467-4E36-92E7-DEA27DEB1519}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Azure.ResourceManager.DatabaseWatcher.Tests", "tests\Azure.ResourceManager.DatabaseWatcher.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/databasewatcher/Azure.ResourceManager.DatabaseWatcher/CHANGELOG.md b/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/CHANGELOG.md new file mode 100644 index 000000000000..8b33f0fedccc --- /dev/null +++ b/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/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/databasewatcher/Azure.ResourceManager.DatabaseWatcher/Directory.Build.props b/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/Directory.Build.props new file mode 100644 index 000000000000..63bd836ad44b --- /dev/null +++ b/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/Directory.Build.props @@ -0,0 +1,6 @@ + + + + diff --git a/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/README.md b/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/README.md new file mode 100644 index 000000000000..876bc6678452 --- /dev/null +++ b/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/README.md @@ -0,0 +1,80 @@ +# Microsoft Azure DatabaseWatcher 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 DatabaseWatcher management library for .NET with [NuGet](https://www.nuget.org/): + +```dotnetcli +dotnet add package Azure.ResourceManager.DatabaseWatcher --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/databasewatcher/Azure.ResourceManager.DatabaseWatcher/api/Azure.ResourceManager.DatabaseWatcher.net8.0.cs b/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/api/Azure.ResourceManager.DatabaseWatcher.net8.0.cs new file mode 100644 index 000000000000..600b1aa1b45a --- /dev/null +++ b/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/api/Azure.ResourceManager.DatabaseWatcher.net8.0.cs @@ -0,0 +1,691 @@ +namespace Azure.ResourceManager.DatabaseWatcher +{ + public partial class AlertRuleResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected AlertRuleResource() { } + public virtual Azure.ResourceManager.DatabaseWatcher.AlertRuleResourceData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string watcherName, string alertRuleResourceName) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + Azure.ResourceManager.DatabaseWatcher.AlertRuleResourceData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseWatcher.AlertRuleResourceData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.DatabaseWatcher.AlertRuleResourceData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.DatabaseWatcher.AlertRuleResourceData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class AlertRuleResourceCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected AlertRuleResourceCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string alertRuleResourceName, Azure.ResourceManager.DatabaseWatcher.AlertRuleResourceData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string alertRuleResourceName, Azure.ResourceManager.DatabaseWatcher.AlertRuleResourceData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string alertRuleResourceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string alertRuleResourceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string alertRuleResourceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string alertRuleResourceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string alertRuleResourceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string alertRuleResourceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class AlertRuleResourceData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public AlertRuleResourceData() { } + public Azure.ResourceManager.DatabaseWatcher.Models.AlertRuleResourceProperties Properties { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseWatcher.AlertRuleResourceData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseWatcher.AlertRuleResourceData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public static partial class DatabaseWatcherExtensions + { + public static Azure.ResourceManager.DatabaseWatcher.AlertRuleResource GetAlertRuleResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.DatabaseWatcher.HealthValidationResource GetHealthValidationResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.DatabaseWatcher.SharedPrivateLinkResource GetSharedPrivateLinkResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.DatabaseWatcher.TargetResource GetTargetResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.Response GetWatcher(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string watcherName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static System.Threading.Tasks.Task> GetWatcherAsync(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string watcherName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.ResourceManager.DatabaseWatcher.WatcherResource GetWatcherResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.DatabaseWatcher.WatcherCollection GetWatchers(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource) { throw null; } + public static Azure.Pageable GetWatchers(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.AsyncPageable GetWatchersAsync(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class HealthValidationCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected HealthValidationCollection() { } + public virtual Azure.Response Exists(string healthValidationName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string healthValidationName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string healthValidationName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string healthValidationName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string healthValidationName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string healthValidationName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class HealthValidationData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal HealthValidationData() { } + public Azure.ResourceManager.DatabaseWatcher.Models.HealthValidationProperties Properties { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseWatcher.HealthValidationData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseWatcher.HealthValidationData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class HealthValidationResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected HealthValidationResource() { } + public virtual Azure.ResourceManager.DatabaseWatcher.HealthValidationData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string watcherName, string healthValidationName) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.ArmOperation StartValidation(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> StartValidationAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + Azure.ResourceManager.DatabaseWatcher.HealthValidationData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseWatcher.HealthValidationData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class SharedPrivateLinkResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected SharedPrivateLinkResource() { } + public virtual Azure.ResourceManager.DatabaseWatcher.SharedPrivateLinkResourceData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string watcherName, string sharedPrivateLinkResourceName) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + Azure.ResourceManager.DatabaseWatcher.SharedPrivateLinkResourceData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseWatcher.SharedPrivateLinkResourceData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.DatabaseWatcher.SharedPrivateLinkResourceData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.DatabaseWatcher.SharedPrivateLinkResourceData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class SharedPrivateLinkResourceCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected SharedPrivateLinkResourceCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string sharedPrivateLinkResourceName, Azure.ResourceManager.DatabaseWatcher.SharedPrivateLinkResourceData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string sharedPrivateLinkResourceName, Azure.ResourceManager.DatabaseWatcher.SharedPrivateLinkResourceData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string sharedPrivateLinkResourceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string sharedPrivateLinkResourceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string sharedPrivateLinkResourceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string sharedPrivateLinkResourceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string sharedPrivateLinkResourceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string sharedPrivateLinkResourceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class SharedPrivateLinkResourceData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public SharedPrivateLinkResourceData() { } + public Azure.ResourceManager.DatabaseWatcher.Models.SharedPrivateLinkResourceProperties Properties { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseWatcher.SharedPrivateLinkResourceData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseWatcher.SharedPrivateLinkResourceData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class TargetCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected TargetCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string targetName, Azure.ResourceManager.DatabaseWatcher.TargetData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string targetName, Azure.ResourceManager.DatabaseWatcher.TargetData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string targetName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string targetName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string targetName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string targetName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string targetName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string targetName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class TargetData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public TargetData() { } + public Azure.ResourceManager.DatabaseWatcher.Models.TargetProperties Properties { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseWatcher.TargetData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseWatcher.TargetData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class TargetResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected TargetResource() { } + public virtual Azure.ResourceManager.DatabaseWatcher.TargetData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string watcherName, string targetName) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + Azure.ResourceManager.DatabaseWatcher.TargetData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseWatcher.TargetData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.DatabaseWatcher.TargetData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.DatabaseWatcher.TargetData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class WatcherCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected WatcherCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string watcherName, Azure.ResourceManager.DatabaseWatcher.WatcherData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string watcherName, Azure.ResourceManager.DatabaseWatcher.WatcherData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string watcherName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string watcherName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string watcherName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string watcherName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string watcherName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string watcherName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class WatcherData : Azure.ResourceManager.Models.TrackedResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public WatcherData(Azure.Core.AzureLocation location) { } + public Azure.ResourceManager.DatabaseWatcher.Models.ManagedServiceIdentityV4 Identity { get { throw null; } set { } } + public Azure.ResourceManager.DatabaseWatcher.Models.WatcherProperties Properties { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseWatcher.WatcherData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseWatcher.WatcherData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class WatcherResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected WatcherResource() { } + public virtual Azure.ResourceManager.DatabaseWatcher.WatcherData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public virtual Azure.Response AddTag(string key, string value, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> AddTagAsync(string key, string value, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string watcherName) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response GetAlertRuleResource(string alertRuleResourceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAlertRuleResourceAsync(string alertRuleResourceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.DatabaseWatcher.AlertRuleResourceCollection GetAlertRuleResources() { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response GetHealthValidation(string healthValidationName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetHealthValidationAsync(string healthValidationName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.DatabaseWatcher.HealthValidationCollection GetHealthValidations() { throw null; } + public virtual Azure.Response GetSharedPrivateLinkResource(string sharedPrivateLinkResourceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetSharedPrivateLinkResourceAsync(string sharedPrivateLinkResourceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.DatabaseWatcher.SharedPrivateLinkResourceCollection GetSharedPrivateLinkResources() { throw null; } + public virtual Azure.Response GetTarget(string targetName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetTargetAsync(string targetName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.DatabaseWatcher.TargetCollection GetTargets() { throw null; } + public virtual Azure.Response RemoveTag(string key, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> RemoveTagAsync(string key, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response SetTags(System.Collections.Generic.IDictionary tags, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> SetTagsAsync(System.Collections.Generic.IDictionary tags, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Start(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task StartAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Stop(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task StopAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + Azure.ResourceManager.DatabaseWatcher.WatcherData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseWatcher.WatcherData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.DatabaseWatcher.Models.WatcherPatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.DatabaseWatcher.Models.WatcherPatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } +} +namespace Azure.ResourceManager.DatabaseWatcher.Mocking +{ + public partial class MockableDatabaseWatcherArmClient : Azure.ResourceManager.ArmResource + { + protected MockableDatabaseWatcherArmClient() { } + public virtual Azure.ResourceManager.DatabaseWatcher.AlertRuleResource GetAlertRuleResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.DatabaseWatcher.HealthValidationResource GetHealthValidationResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.DatabaseWatcher.SharedPrivateLinkResource GetSharedPrivateLinkResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.DatabaseWatcher.TargetResource GetTargetResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.DatabaseWatcher.WatcherResource GetWatcherResource(Azure.Core.ResourceIdentifier id) { throw null; } + } + public partial class MockableDatabaseWatcherResourceGroupResource : Azure.ResourceManager.ArmResource + { + protected MockableDatabaseWatcherResourceGroupResource() { } + public virtual Azure.Response GetWatcher(string watcherName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetWatcherAsync(string watcherName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.DatabaseWatcher.WatcherCollection GetWatchers() { throw null; } + } + public partial class MockableDatabaseWatcherSubscriptionResource : Azure.ResourceManager.ArmResource + { + protected MockableDatabaseWatcherSubscriptionResource() { } + public virtual Azure.Pageable GetWatchers(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetWatchersAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } +} +namespace Azure.ResourceManager.DatabaseWatcher.Models +{ + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct AlertRuleCreationProperty : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public AlertRuleCreationProperty(string value) { throw null; } + public static Azure.ResourceManager.DatabaseWatcher.Models.AlertRuleCreationProperty CreatedWithActionGroup { get { throw null; } } + public static Azure.ResourceManager.DatabaseWatcher.Models.AlertRuleCreationProperty None { get { throw null; } } + public bool Equals(Azure.ResourceManager.DatabaseWatcher.Models.AlertRuleCreationProperty other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.DatabaseWatcher.Models.AlertRuleCreationProperty left, Azure.ResourceManager.DatabaseWatcher.Models.AlertRuleCreationProperty right) { throw null; } + public static implicit operator Azure.ResourceManager.DatabaseWatcher.Models.AlertRuleCreationProperty (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.DatabaseWatcher.Models.AlertRuleCreationProperty left, Azure.ResourceManager.DatabaseWatcher.Models.AlertRuleCreationProperty right) { throw null; } + public override string ToString() { throw null; } + } + public partial class AlertRuleResourceProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public AlertRuleResourceProperties(Azure.Core.ResourceIdentifier alertRuleResourceId, Azure.ResourceManager.DatabaseWatcher.Models.AlertRuleCreationProperty createdWithProperties, System.DateTimeOffset createdOn, string alertRuleTemplateId, string alertRuleTemplateVersion) { } + public Azure.Core.ResourceIdentifier AlertRuleResourceId { get { throw null; } set { } } + public string AlertRuleTemplateId { get { throw null; } set { } } + public string AlertRuleTemplateVersion { get { throw null; } set { } } + public System.DateTimeOffset CreatedOn { get { throw null; } set { } } + public Azure.ResourceManager.DatabaseWatcher.Models.AlertRuleCreationProperty CreatedWithProperties { get { throw null; } set { } } + public Azure.ResourceManager.DatabaseWatcher.Models.ResourceProvisioningState? ProvisioningState { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseWatcher.Models.AlertRuleResourceProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseWatcher.Models.AlertRuleResourceProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public static partial class ArmDatabaseWatcherModelFactory + { + public static Azure.ResourceManager.DatabaseWatcher.AlertRuleResourceData AlertRuleResourceData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.DatabaseWatcher.Models.AlertRuleResourceProperties properties = null) { throw null; } + public static Azure.ResourceManager.DatabaseWatcher.Models.AlertRuleResourceProperties AlertRuleResourceProperties(Azure.Core.ResourceIdentifier alertRuleResourceId = null, Azure.ResourceManager.DatabaseWatcher.Models.AlertRuleCreationProperty createdWithProperties = default(Azure.ResourceManager.DatabaseWatcher.Models.AlertRuleCreationProperty), System.DateTimeOffset createdOn = default(System.DateTimeOffset), Azure.ResourceManager.DatabaseWatcher.Models.ResourceProvisioningState? provisioningState = default(Azure.ResourceManager.DatabaseWatcher.Models.ResourceProvisioningState?), string alertRuleTemplateId = null, string alertRuleTemplateVersion = null) { throw null; } + public static Azure.ResourceManager.DatabaseWatcher.HealthValidationData HealthValidationData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.DatabaseWatcher.Models.HealthValidationProperties properties = null) { throw null; } + public static Azure.ResourceManager.DatabaseWatcher.Models.HealthValidationProperties HealthValidationProperties(System.DateTimeOffset startOn = default(System.DateTimeOffset), System.DateTimeOffset endOn = default(System.DateTimeOffset), Azure.ResourceManager.DatabaseWatcher.Models.ValidationStatus status = default(Azure.ResourceManager.DatabaseWatcher.Models.ValidationStatus), System.Collections.Generic.IEnumerable issues = null, Azure.ResourceManager.DatabaseWatcher.Models.ResourceProvisioningState? provisioningState = default(Azure.ResourceManager.DatabaseWatcher.Models.ResourceProvisioningState?)) { throw null; } + public static Azure.ResourceManager.DatabaseWatcher.Models.ManagedServiceIdentityV4 ManagedServiceIdentityV4(System.Guid? principalId = default(System.Guid?), System.Guid? tenantId = default(System.Guid?), Azure.ResourceManager.DatabaseWatcher.Models.ManagedServiceIdentityType type = default(Azure.ResourceManager.DatabaseWatcher.Models.ManagedServiceIdentityType), System.Collections.Generic.IDictionary userAssignedIdentities = null) { throw null; } + public static Azure.ResourceManager.DatabaseWatcher.SharedPrivateLinkResourceData SharedPrivateLinkResourceData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.DatabaseWatcher.Models.SharedPrivateLinkResourceProperties properties = null) { throw null; } + public static Azure.ResourceManager.DatabaseWatcher.Models.SharedPrivateLinkResourceProperties SharedPrivateLinkResourceProperties(Azure.Core.ResourceIdentifier privateLinkResourceId = null, string groupId = null, string requestMessage = null, string dnsZone = null, Azure.ResourceManager.DatabaseWatcher.Models.SharedPrivateLinkResourceStatus? status = default(Azure.ResourceManager.DatabaseWatcher.Models.SharedPrivateLinkResourceStatus?), Azure.ResourceManager.DatabaseWatcher.Models.ResourceProvisioningState? provisioningState = default(Azure.ResourceManager.DatabaseWatcher.Models.ResourceProvisioningState?)) { throw null; } + public static Azure.ResourceManager.DatabaseWatcher.Models.SqlDbElasticPoolTargetProperties SqlDbElasticPoolTargetProperties(Azure.ResourceManager.DatabaseWatcher.Models.TargetAuthenticationType targetAuthenticationType = default(Azure.ResourceManager.DatabaseWatcher.Models.TargetAuthenticationType), Azure.ResourceManager.DatabaseWatcher.Models.VaultSecret targetVault = null, string connectionServerName = null, Azure.ResourceManager.DatabaseWatcher.Models.ResourceProvisioningState? provisioningState = default(Azure.ResourceManager.DatabaseWatcher.Models.ResourceProvisioningState?), Azure.Core.ResourceIdentifier sqlEpResourceId = null, Azure.Core.ResourceIdentifier anchorDatabaseResourceId = null, bool? readIntent = default(bool?)) { throw null; } + public static Azure.ResourceManager.DatabaseWatcher.Models.SqlDbSingleDatabaseTargetProperties SqlDbSingleDatabaseTargetProperties(Azure.ResourceManager.DatabaseWatcher.Models.TargetAuthenticationType targetAuthenticationType = default(Azure.ResourceManager.DatabaseWatcher.Models.TargetAuthenticationType), Azure.ResourceManager.DatabaseWatcher.Models.VaultSecret targetVault = null, string connectionServerName = null, Azure.ResourceManager.DatabaseWatcher.Models.ResourceProvisioningState? provisioningState = default(Azure.ResourceManager.DatabaseWatcher.Models.ResourceProvisioningState?), Azure.Core.ResourceIdentifier sqlDbResourceId = null, bool? readIntent = default(bool?)) { throw null; } + public static Azure.ResourceManager.DatabaseWatcher.Models.SqlMiTargetProperties SqlMiTargetProperties(Azure.ResourceManager.DatabaseWatcher.Models.TargetAuthenticationType targetAuthenticationType = default(Azure.ResourceManager.DatabaseWatcher.Models.TargetAuthenticationType), Azure.ResourceManager.DatabaseWatcher.Models.VaultSecret targetVault = null, string connectionServerName = null, Azure.ResourceManager.DatabaseWatcher.Models.ResourceProvisioningState? provisioningState = default(Azure.ResourceManager.DatabaseWatcher.Models.ResourceProvisioningState?), Azure.Core.ResourceIdentifier sqlMiResourceId = null, int? connectionTcpPort = default(int?), bool? readIntent = default(bool?)) { throw null; } + public static Azure.ResourceManager.DatabaseWatcher.TargetData TargetData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.DatabaseWatcher.Models.TargetProperties properties = null) { throw null; } + public static Azure.ResourceManager.DatabaseWatcher.Models.TargetProperties TargetProperties(string targetType = null, Azure.ResourceManager.DatabaseWatcher.Models.TargetAuthenticationType targetAuthenticationType = default(Azure.ResourceManager.DatabaseWatcher.Models.TargetAuthenticationType), Azure.ResourceManager.DatabaseWatcher.Models.VaultSecret targetVault = null, string connectionServerName = null, Azure.ResourceManager.DatabaseWatcher.Models.ResourceProvisioningState? provisioningState = default(Azure.ResourceManager.DatabaseWatcher.Models.ResourceProvisioningState?)) { throw null; } + public static Azure.ResourceManager.DatabaseWatcher.Models.ValidationIssue ValidationIssue(string errorCode = null, string errorMessage = null, string additionalDetails = null, string recommendationMessage = null, System.Uri recommendationUri = null, Azure.Core.ResourceIdentifier relatedResourceId = null, string relatedResourceType = null) { throw null; } + public static Azure.ResourceManager.DatabaseWatcher.WatcherData WatcherData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), Azure.ResourceManager.DatabaseWatcher.Models.WatcherProperties properties = null, Azure.ResourceManager.DatabaseWatcher.Models.ManagedServiceIdentityV4 identity = null) { throw null; } + public static Azure.ResourceManager.DatabaseWatcher.Models.WatcherProperties WatcherProperties(Azure.ResourceManager.DatabaseWatcher.Models.Datastore datastore = null, Azure.ResourceManager.DatabaseWatcher.Models.WatcherStatus? status = default(Azure.ResourceManager.DatabaseWatcher.Models.WatcherStatus?), Azure.ResourceManager.DatabaseWatcher.Models.DatabaseWatcherProvisioningState? provisioningState = default(Azure.ResourceManager.DatabaseWatcher.Models.DatabaseWatcherProvisioningState?), Azure.Core.ResourceIdentifier defaultAlertRuleIdentityResourceId = null) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct DatabaseWatcherProvisioningState : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public DatabaseWatcherProvisioningState(string value) { throw null; } + public static Azure.ResourceManager.DatabaseWatcher.Models.DatabaseWatcherProvisioningState Canceled { get { throw null; } } + public static Azure.ResourceManager.DatabaseWatcher.Models.DatabaseWatcherProvisioningState Failed { get { throw null; } } + public static Azure.ResourceManager.DatabaseWatcher.Models.DatabaseWatcherProvisioningState Succeeded { get { throw null; } } + public bool Equals(Azure.ResourceManager.DatabaseWatcher.Models.DatabaseWatcherProvisioningState other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.DatabaseWatcher.Models.DatabaseWatcherProvisioningState left, Azure.ResourceManager.DatabaseWatcher.Models.DatabaseWatcherProvisioningState right) { throw null; } + public static implicit operator Azure.ResourceManager.DatabaseWatcher.Models.DatabaseWatcherProvisioningState (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.DatabaseWatcher.Models.DatabaseWatcherProvisioningState left, Azure.ResourceManager.DatabaseWatcher.Models.DatabaseWatcherProvisioningState right) { throw null; } + public override string ToString() { throw null; } + } + public partial class Datastore : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public Datastore(string kustoClusterUri, string kustoDataIngestionUri, string kustoDatabaseName, string kustoManagementUri, Azure.ResourceManager.DatabaseWatcher.Models.KustoOfferingType kustoOfferingType) { } + public Azure.Core.ResourceIdentifier AdxClusterResourceId { get { throw null; } set { } } + public string KustoClusterDisplayName { get { throw null; } set { } } + public string KustoClusterUri { get { throw null; } set { } } + public string KustoDatabaseName { get { throw null; } set { } } + public string KustoDataIngestionUri { get { throw null; } set { } } + public string KustoManagementUri { get { throw null; } set { } } + public Azure.ResourceManager.DatabaseWatcher.Models.KustoOfferingType KustoOfferingType { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseWatcher.Models.Datastore System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseWatcher.Models.Datastore System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class HealthValidationProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal HealthValidationProperties() { } + public System.DateTimeOffset EndOn { get { throw null; } } + public System.Collections.Generic.IReadOnlyList Issues { get { throw null; } } + public Azure.ResourceManager.DatabaseWatcher.Models.ResourceProvisioningState? ProvisioningState { get { throw null; } } + public System.DateTimeOffset StartOn { get { throw null; } } + public Azure.ResourceManager.DatabaseWatcher.Models.ValidationStatus Status { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseWatcher.Models.HealthValidationProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseWatcher.Models.HealthValidationProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct KustoOfferingType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public KustoOfferingType(string value) { throw null; } + public static Azure.ResourceManager.DatabaseWatcher.Models.KustoOfferingType Adx { get { throw null; } } + public static Azure.ResourceManager.DatabaseWatcher.Models.KustoOfferingType Fabric { get { throw null; } } + public static Azure.ResourceManager.DatabaseWatcher.Models.KustoOfferingType Free { get { throw null; } } + public bool Equals(Azure.ResourceManager.DatabaseWatcher.Models.KustoOfferingType other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.DatabaseWatcher.Models.KustoOfferingType left, Azure.ResourceManager.DatabaseWatcher.Models.KustoOfferingType right) { throw null; } + public static implicit operator Azure.ResourceManager.DatabaseWatcher.Models.KustoOfferingType (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.DatabaseWatcher.Models.KustoOfferingType left, Azure.ResourceManager.DatabaseWatcher.Models.KustoOfferingType right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct ManagedServiceIdentityType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public ManagedServiceIdentityType(string value) { throw null; } + public static Azure.ResourceManager.DatabaseWatcher.Models.ManagedServiceIdentityType None { get { throw null; } } + public static Azure.ResourceManager.DatabaseWatcher.Models.ManagedServiceIdentityType SystemAndUserAssigned { get { throw null; } } + public static Azure.ResourceManager.DatabaseWatcher.Models.ManagedServiceIdentityType SystemAssigned { get { throw null; } } + public static Azure.ResourceManager.DatabaseWatcher.Models.ManagedServiceIdentityType UserAssigned { get { throw null; } } + public bool Equals(Azure.ResourceManager.DatabaseWatcher.Models.ManagedServiceIdentityType other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.DatabaseWatcher.Models.ManagedServiceIdentityType left, Azure.ResourceManager.DatabaseWatcher.Models.ManagedServiceIdentityType right) { throw null; } + public static implicit operator Azure.ResourceManager.DatabaseWatcher.Models.ManagedServiceIdentityType (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.DatabaseWatcher.Models.ManagedServiceIdentityType left, Azure.ResourceManager.DatabaseWatcher.Models.ManagedServiceIdentityType right) { throw null; } + public override string ToString() { throw null; } + } + public partial class ManagedServiceIdentityV4 : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ManagedServiceIdentityV4(Azure.ResourceManager.DatabaseWatcher.Models.ManagedServiceIdentityType type) { } + public System.Guid? PrincipalId { get { throw null; } } + public System.Guid? TenantId { get { throw null; } } + public Azure.ResourceManager.DatabaseWatcher.Models.ManagedServiceIdentityType Type { get { throw null; } set { } } + public System.Collections.Generic.IDictionary UserAssignedIdentities { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseWatcher.Models.ManagedServiceIdentityV4 System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseWatcher.Models.ManagedServiceIdentityV4 System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct ResourceProvisioningState : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public ResourceProvisioningState(string value) { throw null; } + public static Azure.ResourceManager.DatabaseWatcher.Models.ResourceProvisioningState Canceled { get { throw null; } } + public static Azure.ResourceManager.DatabaseWatcher.Models.ResourceProvisioningState Failed { get { throw null; } } + public static Azure.ResourceManager.DatabaseWatcher.Models.ResourceProvisioningState Succeeded { get { throw null; } } + public bool Equals(Azure.ResourceManager.DatabaseWatcher.Models.ResourceProvisioningState other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.DatabaseWatcher.Models.ResourceProvisioningState left, Azure.ResourceManager.DatabaseWatcher.Models.ResourceProvisioningState right) { throw null; } + public static implicit operator Azure.ResourceManager.DatabaseWatcher.Models.ResourceProvisioningState (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.DatabaseWatcher.Models.ResourceProvisioningState left, Azure.ResourceManager.DatabaseWatcher.Models.ResourceProvisioningState right) { throw null; } + public override string ToString() { throw null; } + } + public partial class SharedPrivateLinkResourceProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public SharedPrivateLinkResourceProperties(Azure.Core.ResourceIdentifier privateLinkResourceId, string groupId, string requestMessage) { } + public string DnsZone { get { throw null; } set { } } + public string GroupId { get { throw null; } set { } } + public Azure.Core.ResourceIdentifier PrivateLinkResourceId { get { throw null; } set { } } + public Azure.ResourceManager.DatabaseWatcher.Models.ResourceProvisioningState? ProvisioningState { get { throw null; } } + public string RequestMessage { get { throw null; } set { } } + public Azure.ResourceManager.DatabaseWatcher.Models.SharedPrivateLinkResourceStatus? Status { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseWatcher.Models.SharedPrivateLinkResourceProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseWatcher.Models.SharedPrivateLinkResourceProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct SharedPrivateLinkResourceStatus : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public SharedPrivateLinkResourceStatus(string value) { throw null; } + public static Azure.ResourceManager.DatabaseWatcher.Models.SharedPrivateLinkResourceStatus Approved { get { throw null; } } + public static Azure.ResourceManager.DatabaseWatcher.Models.SharedPrivateLinkResourceStatus Disconnected { get { throw null; } } + public static Azure.ResourceManager.DatabaseWatcher.Models.SharedPrivateLinkResourceStatus Pending { get { throw null; } } + public static Azure.ResourceManager.DatabaseWatcher.Models.SharedPrivateLinkResourceStatus Rejected { get { throw null; } } + public bool Equals(Azure.ResourceManager.DatabaseWatcher.Models.SharedPrivateLinkResourceStatus other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.DatabaseWatcher.Models.SharedPrivateLinkResourceStatus left, Azure.ResourceManager.DatabaseWatcher.Models.SharedPrivateLinkResourceStatus right) { throw null; } + public static implicit operator Azure.ResourceManager.DatabaseWatcher.Models.SharedPrivateLinkResourceStatus (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.DatabaseWatcher.Models.SharedPrivateLinkResourceStatus left, Azure.ResourceManager.DatabaseWatcher.Models.SharedPrivateLinkResourceStatus right) { throw null; } + public override string ToString() { throw null; } + } + public partial class SqlDbElasticPoolTargetProperties : Azure.ResourceManager.DatabaseWatcher.Models.TargetProperties, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public SqlDbElasticPoolTargetProperties(Azure.ResourceManager.DatabaseWatcher.Models.TargetAuthenticationType targetAuthenticationType, string connectionServerName, Azure.Core.ResourceIdentifier sqlEpResourceId, Azure.Core.ResourceIdentifier anchorDatabaseResourceId) : base (default(Azure.ResourceManager.DatabaseWatcher.Models.TargetAuthenticationType), default(string)) { } + public Azure.Core.ResourceIdentifier AnchorDatabaseResourceId { get { throw null; } set { } } + public bool? ReadIntent { get { throw null; } set { } } + public Azure.Core.ResourceIdentifier SqlEpResourceId { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseWatcher.Models.SqlDbElasticPoolTargetProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseWatcher.Models.SqlDbElasticPoolTargetProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class SqlDbSingleDatabaseTargetProperties : Azure.ResourceManager.DatabaseWatcher.Models.TargetProperties, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public SqlDbSingleDatabaseTargetProperties(Azure.ResourceManager.DatabaseWatcher.Models.TargetAuthenticationType targetAuthenticationType, string connectionServerName, Azure.Core.ResourceIdentifier sqlDbResourceId) : base (default(Azure.ResourceManager.DatabaseWatcher.Models.TargetAuthenticationType), default(string)) { } + public bool? ReadIntent { get { throw null; } set { } } + public Azure.Core.ResourceIdentifier SqlDbResourceId { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseWatcher.Models.SqlDbSingleDatabaseTargetProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseWatcher.Models.SqlDbSingleDatabaseTargetProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class SqlMiTargetProperties : Azure.ResourceManager.DatabaseWatcher.Models.TargetProperties, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public SqlMiTargetProperties(Azure.ResourceManager.DatabaseWatcher.Models.TargetAuthenticationType targetAuthenticationType, string connectionServerName, Azure.Core.ResourceIdentifier sqlMiResourceId) : base (default(Azure.ResourceManager.DatabaseWatcher.Models.TargetAuthenticationType), default(string)) { } + public int? ConnectionTcpPort { get { throw null; } set { } } + public bool? ReadIntent { get { throw null; } set { } } + public Azure.Core.ResourceIdentifier SqlMiResourceId { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseWatcher.Models.SqlMiTargetProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseWatcher.Models.SqlMiTargetProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct TargetAuthenticationType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public TargetAuthenticationType(string value) { throw null; } + public static Azure.ResourceManager.DatabaseWatcher.Models.TargetAuthenticationType Aad { get { throw null; } } + public static Azure.ResourceManager.DatabaseWatcher.Models.TargetAuthenticationType Sql { get { throw null; } } + public bool Equals(Azure.ResourceManager.DatabaseWatcher.Models.TargetAuthenticationType other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.DatabaseWatcher.Models.TargetAuthenticationType left, Azure.ResourceManager.DatabaseWatcher.Models.TargetAuthenticationType right) { throw null; } + public static implicit operator Azure.ResourceManager.DatabaseWatcher.Models.TargetAuthenticationType (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.DatabaseWatcher.Models.TargetAuthenticationType left, Azure.ResourceManager.DatabaseWatcher.Models.TargetAuthenticationType right) { throw null; } + public override string ToString() { throw null; } + } + public abstract partial class TargetProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + protected TargetProperties(Azure.ResourceManager.DatabaseWatcher.Models.TargetAuthenticationType targetAuthenticationType, string connectionServerName) { } + public string ConnectionServerName { get { throw null; } set { } } + public Azure.ResourceManager.DatabaseWatcher.Models.ResourceProvisioningState? ProvisioningState { get { throw null; } } + public Azure.ResourceManager.DatabaseWatcher.Models.TargetAuthenticationType TargetAuthenticationType { get { throw null; } set { } } + public Azure.ResourceManager.DatabaseWatcher.Models.VaultSecret TargetVault { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseWatcher.Models.TargetProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseWatcher.Models.TargetProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ValidationIssue : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal ValidationIssue() { } + public string AdditionalDetails { get { throw null; } } + public string ErrorCode { get { throw null; } } + public string ErrorMessage { get { throw null; } } + public string RecommendationMessage { get { throw null; } } + public System.Uri RecommendationUri { get { throw null; } } + public Azure.Core.ResourceIdentifier RelatedResourceId { get { throw null; } } + public string RelatedResourceType { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseWatcher.Models.ValidationIssue System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseWatcher.Models.ValidationIssue System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct ValidationStatus : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public ValidationStatus(string value) { throw null; } + public static Azure.ResourceManager.DatabaseWatcher.Models.ValidationStatus Canceled { get { throw null; } } + public static Azure.ResourceManager.DatabaseWatcher.Models.ValidationStatus Failed { get { throw null; } } + public static Azure.ResourceManager.DatabaseWatcher.Models.ValidationStatus NotStarted { get { throw null; } } + public static Azure.ResourceManager.DatabaseWatcher.Models.ValidationStatus Running { get { throw null; } } + public static Azure.ResourceManager.DatabaseWatcher.Models.ValidationStatus Succeeded { get { throw null; } } + public static Azure.ResourceManager.DatabaseWatcher.Models.ValidationStatus TimedOut { get { throw null; } } + public bool Equals(Azure.ResourceManager.DatabaseWatcher.Models.ValidationStatus other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.DatabaseWatcher.Models.ValidationStatus left, Azure.ResourceManager.DatabaseWatcher.Models.ValidationStatus right) { throw null; } + public static implicit operator Azure.ResourceManager.DatabaseWatcher.Models.ValidationStatus (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.DatabaseWatcher.Models.ValidationStatus left, Azure.ResourceManager.DatabaseWatcher.Models.ValidationStatus right) { throw null; } + public override string ToString() { throw null; } + } + public partial class VaultSecret : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public VaultSecret() { } + public Azure.Core.ResourceIdentifier AkvResourceId { get { throw null; } set { } } + public string AkvTargetPassword { get { throw null; } set { } } + public string AkvTargetUser { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseWatcher.Models.VaultSecret System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseWatcher.Models.VaultSecret System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class WatcherPatch : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public WatcherPatch() { } + public Azure.ResourceManager.DatabaseWatcher.Models.ManagedServiceIdentityV4 Identity { get { throw null; } set { } } + public Azure.ResourceManager.DatabaseWatcher.Models.WatcherUpdateProperties Properties { get { throw null; } set { } } + public System.Collections.Generic.IDictionary Tags { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseWatcher.Models.WatcherPatch System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseWatcher.Models.WatcherPatch System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class WatcherProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public WatcherProperties() { } + public Azure.ResourceManager.DatabaseWatcher.Models.Datastore Datastore { get { throw null; } set { } } + public Azure.Core.ResourceIdentifier DefaultAlertRuleIdentityResourceId { get { throw null; } set { } } + public Azure.ResourceManager.DatabaseWatcher.Models.DatabaseWatcherProvisioningState? ProvisioningState { get { throw null; } } + public Azure.ResourceManager.DatabaseWatcher.Models.WatcherStatus? Status { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseWatcher.Models.WatcherProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseWatcher.Models.WatcherProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct WatcherStatus : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public WatcherStatus(string value) { throw null; } + public static Azure.ResourceManager.DatabaseWatcher.Models.WatcherStatus Deleting { get { throw null; } } + public static Azure.ResourceManager.DatabaseWatcher.Models.WatcherStatus Running { get { throw null; } } + public static Azure.ResourceManager.DatabaseWatcher.Models.WatcherStatus Starting { get { throw null; } } + public static Azure.ResourceManager.DatabaseWatcher.Models.WatcherStatus Stopped { get { throw null; } } + public static Azure.ResourceManager.DatabaseWatcher.Models.WatcherStatus Stopping { get { throw null; } } + public bool Equals(Azure.ResourceManager.DatabaseWatcher.Models.WatcherStatus other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.DatabaseWatcher.Models.WatcherStatus left, Azure.ResourceManager.DatabaseWatcher.Models.WatcherStatus right) { throw null; } + public static implicit operator Azure.ResourceManager.DatabaseWatcher.Models.WatcherStatus (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.DatabaseWatcher.Models.WatcherStatus left, Azure.ResourceManager.DatabaseWatcher.Models.WatcherStatus right) { throw null; } + public override string ToString() { throw null; } + } + public partial class WatcherUpdateProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public WatcherUpdateProperties() { } + public Azure.ResourceManager.DatabaseWatcher.Models.Datastore Datastore { get { throw null; } set { } } + public Azure.Core.ResourceIdentifier DefaultAlertRuleIdentityResourceId { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseWatcher.Models.WatcherUpdateProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseWatcher.Models.WatcherUpdateProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } +} diff --git a/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/api/Azure.ResourceManager.DatabaseWatcher.netstandard2.0.cs b/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/api/Azure.ResourceManager.DatabaseWatcher.netstandard2.0.cs new file mode 100644 index 000000000000..600b1aa1b45a --- /dev/null +++ b/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/api/Azure.ResourceManager.DatabaseWatcher.netstandard2.0.cs @@ -0,0 +1,691 @@ +namespace Azure.ResourceManager.DatabaseWatcher +{ + public partial class AlertRuleResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected AlertRuleResource() { } + public virtual Azure.ResourceManager.DatabaseWatcher.AlertRuleResourceData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string watcherName, string alertRuleResourceName) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + Azure.ResourceManager.DatabaseWatcher.AlertRuleResourceData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseWatcher.AlertRuleResourceData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.DatabaseWatcher.AlertRuleResourceData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.DatabaseWatcher.AlertRuleResourceData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class AlertRuleResourceCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected AlertRuleResourceCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string alertRuleResourceName, Azure.ResourceManager.DatabaseWatcher.AlertRuleResourceData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string alertRuleResourceName, Azure.ResourceManager.DatabaseWatcher.AlertRuleResourceData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string alertRuleResourceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string alertRuleResourceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string alertRuleResourceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string alertRuleResourceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string alertRuleResourceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string alertRuleResourceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class AlertRuleResourceData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public AlertRuleResourceData() { } + public Azure.ResourceManager.DatabaseWatcher.Models.AlertRuleResourceProperties Properties { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseWatcher.AlertRuleResourceData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseWatcher.AlertRuleResourceData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public static partial class DatabaseWatcherExtensions + { + public static Azure.ResourceManager.DatabaseWatcher.AlertRuleResource GetAlertRuleResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.DatabaseWatcher.HealthValidationResource GetHealthValidationResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.DatabaseWatcher.SharedPrivateLinkResource GetSharedPrivateLinkResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.DatabaseWatcher.TargetResource GetTargetResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.Response GetWatcher(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string watcherName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static System.Threading.Tasks.Task> GetWatcherAsync(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string watcherName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.ResourceManager.DatabaseWatcher.WatcherResource GetWatcherResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.DatabaseWatcher.WatcherCollection GetWatchers(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource) { throw null; } + public static Azure.Pageable GetWatchers(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.AsyncPageable GetWatchersAsync(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class HealthValidationCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected HealthValidationCollection() { } + public virtual Azure.Response Exists(string healthValidationName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string healthValidationName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string healthValidationName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string healthValidationName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string healthValidationName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string healthValidationName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class HealthValidationData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal HealthValidationData() { } + public Azure.ResourceManager.DatabaseWatcher.Models.HealthValidationProperties Properties { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseWatcher.HealthValidationData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseWatcher.HealthValidationData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class HealthValidationResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected HealthValidationResource() { } + public virtual Azure.ResourceManager.DatabaseWatcher.HealthValidationData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string watcherName, string healthValidationName) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.ArmOperation StartValidation(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> StartValidationAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + Azure.ResourceManager.DatabaseWatcher.HealthValidationData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseWatcher.HealthValidationData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class SharedPrivateLinkResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected SharedPrivateLinkResource() { } + public virtual Azure.ResourceManager.DatabaseWatcher.SharedPrivateLinkResourceData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string watcherName, string sharedPrivateLinkResourceName) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + Azure.ResourceManager.DatabaseWatcher.SharedPrivateLinkResourceData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseWatcher.SharedPrivateLinkResourceData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.DatabaseWatcher.SharedPrivateLinkResourceData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.DatabaseWatcher.SharedPrivateLinkResourceData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class SharedPrivateLinkResourceCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected SharedPrivateLinkResourceCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string sharedPrivateLinkResourceName, Azure.ResourceManager.DatabaseWatcher.SharedPrivateLinkResourceData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string sharedPrivateLinkResourceName, Azure.ResourceManager.DatabaseWatcher.SharedPrivateLinkResourceData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string sharedPrivateLinkResourceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string sharedPrivateLinkResourceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string sharedPrivateLinkResourceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string sharedPrivateLinkResourceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string sharedPrivateLinkResourceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string sharedPrivateLinkResourceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class SharedPrivateLinkResourceData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public SharedPrivateLinkResourceData() { } + public Azure.ResourceManager.DatabaseWatcher.Models.SharedPrivateLinkResourceProperties Properties { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseWatcher.SharedPrivateLinkResourceData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseWatcher.SharedPrivateLinkResourceData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class TargetCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected TargetCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string targetName, Azure.ResourceManager.DatabaseWatcher.TargetData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string targetName, Azure.ResourceManager.DatabaseWatcher.TargetData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string targetName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string targetName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string targetName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string targetName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string targetName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string targetName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class TargetData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public TargetData() { } + public Azure.ResourceManager.DatabaseWatcher.Models.TargetProperties Properties { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseWatcher.TargetData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseWatcher.TargetData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class TargetResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected TargetResource() { } + public virtual Azure.ResourceManager.DatabaseWatcher.TargetData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string watcherName, string targetName) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + Azure.ResourceManager.DatabaseWatcher.TargetData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseWatcher.TargetData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.DatabaseWatcher.TargetData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.DatabaseWatcher.TargetData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class WatcherCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected WatcherCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string watcherName, Azure.ResourceManager.DatabaseWatcher.WatcherData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string watcherName, Azure.ResourceManager.DatabaseWatcher.WatcherData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string watcherName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string watcherName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string watcherName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string watcherName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string watcherName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string watcherName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class WatcherData : Azure.ResourceManager.Models.TrackedResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public WatcherData(Azure.Core.AzureLocation location) { } + public Azure.ResourceManager.DatabaseWatcher.Models.ManagedServiceIdentityV4 Identity { get { throw null; } set { } } + public Azure.ResourceManager.DatabaseWatcher.Models.WatcherProperties Properties { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseWatcher.WatcherData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseWatcher.WatcherData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class WatcherResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected WatcherResource() { } + public virtual Azure.ResourceManager.DatabaseWatcher.WatcherData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public virtual Azure.Response AddTag(string key, string value, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> AddTagAsync(string key, string value, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string watcherName) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response GetAlertRuleResource(string alertRuleResourceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAlertRuleResourceAsync(string alertRuleResourceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.DatabaseWatcher.AlertRuleResourceCollection GetAlertRuleResources() { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response GetHealthValidation(string healthValidationName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetHealthValidationAsync(string healthValidationName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.DatabaseWatcher.HealthValidationCollection GetHealthValidations() { throw null; } + public virtual Azure.Response GetSharedPrivateLinkResource(string sharedPrivateLinkResourceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetSharedPrivateLinkResourceAsync(string sharedPrivateLinkResourceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.DatabaseWatcher.SharedPrivateLinkResourceCollection GetSharedPrivateLinkResources() { throw null; } + public virtual Azure.Response GetTarget(string targetName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetTargetAsync(string targetName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.DatabaseWatcher.TargetCollection GetTargets() { throw null; } + public virtual Azure.Response RemoveTag(string key, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> RemoveTagAsync(string key, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response SetTags(System.Collections.Generic.IDictionary tags, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> SetTagsAsync(System.Collections.Generic.IDictionary tags, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Start(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task StartAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Stop(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task StopAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + Azure.ResourceManager.DatabaseWatcher.WatcherData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseWatcher.WatcherData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.DatabaseWatcher.Models.WatcherPatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.DatabaseWatcher.Models.WatcherPatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } +} +namespace Azure.ResourceManager.DatabaseWatcher.Mocking +{ + public partial class MockableDatabaseWatcherArmClient : Azure.ResourceManager.ArmResource + { + protected MockableDatabaseWatcherArmClient() { } + public virtual Azure.ResourceManager.DatabaseWatcher.AlertRuleResource GetAlertRuleResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.DatabaseWatcher.HealthValidationResource GetHealthValidationResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.DatabaseWatcher.SharedPrivateLinkResource GetSharedPrivateLinkResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.DatabaseWatcher.TargetResource GetTargetResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.DatabaseWatcher.WatcherResource GetWatcherResource(Azure.Core.ResourceIdentifier id) { throw null; } + } + public partial class MockableDatabaseWatcherResourceGroupResource : Azure.ResourceManager.ArmResource + { + protected MockableDatabaseWatcherResourceGroupResource() { } + public virtual Azure.Response GetWatcher(string watcherName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetWatcherAsync(string watcherName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.DatabaseWatcher.WatcherCollection GetWatchers() { throw null; } + } + public partial class MockableDatabaseWatcherSubscriptionResource : Azure.ResourceManager.ArmResource + { + protected MockableDatabaseWatcherSubscriptionResource() { } + public virtual Azure.Pageable GetWatchers(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetWatchersAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } +} +namespace Azure.ResourceManager.DatabaseWatcher.Models +{ + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct AlertRuleCreationProperty : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public AlertRuleCreationProperty(string value) { throw null; } + public static Azure.ResourceManager.DatabaseWatcher.Models.AlertRuleCreationProperty CreatedWithActionGroup { get { throw null; } } + public static Azure.ResourceManager.DatabaseWatcher.Models.AlertRuleCreationProperty None { get { throw null; } } + public bool Equals(Azure.ResourceManager.DatabaseWatcher.Models.AlertRuleCreationProperty other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.DatabaseWatcher.Models.AlertRuleCreationProperty left, Azure.ResourceManager.DatabaseWatcher.Models.AlertRuleCreationProperty right) { throw null; } + public static implicit operator Azure.ResourceManager.DatabaseWatcher.Models.AlertRuleCreationProperty (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.DatabaseWatcher.Models.AlertRuleCreationProperty left, Azure.ResourceManager.DatabaseWatcher.Models.AlertRuleCreationProperty right) { throw null; } + public override string ToString() { throw null; } + } + public partial class AlertRuleResourceProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public AlertRuleResourceProperties(Azure.Core.ResourceIdentifier alertRuleResourceId, Azure.ResourceManager.DatabaseWatcher.Models.AlertRuleCreationProperty createdWithProperties, System.DateTimeOffset createdOn, string alertRuleTemplateId, string alertRuleTemplateVersion) { } + public Azure.Core.ResourceIdentifier AlertRuleResourceId { get { throw null; } set { } } + public string AlertRuleTemplateId { get { throw null; } set { } } + public string AlertRuleTemplateVersion { get { throw null; } set { } } + public System.DateTimeOffset CreatedOn { get { throw null; } set { } } + public Azure.ResourceManager.DatabaseWatcher.Models.AlertRuleCreationProperty CreatedWithProperties { get { throw null; } set { } } + public Azure.ResourceManager.DatabaseWatcher.Models.ResourceProvisioningState? ProvisioningState { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseWatcher.Models.AlertRuleResourceProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseWatcher.Models.AlertRuleResourceProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public static partial class ArmDatabaseWatcherModelFactory + { + public static Azure.ResourceManager.DatabaseWatcher.AlertRuleResourceData AlertRuleResourceData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.DatabaseWatcher.Models.AlertRuleResourceProperties properties = null) { throw null; } + public static Azure.ResourceManager.DatabaseWatcher.Models.AlertRuleResourceProperties AlertRuleResourceProperties(Azure.Core.ResourceIdentifier alertRuleResourceId = null, Azure.ResourceManager.DatabaseWatcher.Models.AlertRuleCreationProperty createdWithProperties = default(Azure.ResourceManager.DatabaseWatcher.Models.AlertRuleCreationProperty), System.DateTimeOffset createdOn = default(System.DateTimeOffset), Azure.ResourceManager.DatabaseWatcher.Models.ResourceProvisioningState? provisioningState = default(Azure.ResourceManager.DatabaseWatcher.Models.ResourceProvisioningState?), string alertRuleTemplateId = null, string alertRuleTemplateVersion = null) { throw null; } + public static Azure.ResourceManager.DatabaseWatcher.HealthValidationData HealthValidationData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.DatabaseWatcher.Models.HealthValidationProperties properties = null) { throw null; } + public static Azure.ResourceManager.DatabaseWatcher.Models.HealthValidationProperties HealthValidationProperties(System.DateTimeOffset startOn = default(System.DateTimeOffset), System.DateTimeOffset endOn = default(System.DateTimeOffset), Azure.ResourceManager.DatabaseWatcher.Models.ValidationStatus status = default(Azure.ResourceManager.DatabaseWatcher.Models.ValidationStatus), System.Collections.Generic.IEnumerable issues = null, Azure.ResourceManager.DatabaseWatcher.Models.ResourceProvisioningState? provisioningState = default(Azure.ResourceManager.DatabaseWatcher.Models.ResourceProvisioningState?)) { throw null; } + public static Azure.ResourceManager.DatabaseWatcher.Models.ManagedServiceIdentityV4 ManagedServiceIdentityV4(System.Guid? principalId = default(System.Guid?), System.Guid? tenantId = default(System.Guid?), Azure.ResourceManager.DatabaseWatcher.Models.ManagedServiceIdentityType type = default(Azure.ResourceManager.DatabaseWatcher.Models.ManagedServiceIdentityType), System.Collections.Generic.IDictionary userAssignedIdentities = null) { throw null; } + public static Azure.ResourceManager.DatabaseWatcher.SharedPrivateLinkResourceData SharedPrivateLinkResourceData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.DatabaseWatcher.Models.SharedPrivateLinkResourceProperties properties = null) { throw null; } + public static Azure.ResourceManager.DatabaseWatcher.Models.SharedPrivateLinkResourceProperties SharedPrivateLinkResourceProperties(Azure.Core.ResourceIdentifier privateLinkResourceId = null, string groupId = null, string requestMessage = null, string dnsZone = null, Azure.ResourceManager.DatabaseWatcher.Models.SharedPrivateLinkResourceStatus? status = default(Azure.ResourceManager.DatabaseWatcher.Models.SharedPrivateLinkResourceStatus?), Azure.ResourceManager.DatabaseWatcher.Models.ResourceProvisioningState? provisioningState = default(Azure.ResourceManager.DatabaseWatcher.Models.ResourceProvisioningState?)) { throw null; } + public static Azure.ResourceManager.DatabaseWatcher.Models.SqlDbElasticPoolTargetProperties SqlDbElasticPoolTargetProperties(Azure.ResourceManager.DatabaseWatcher.Models.TargetAuthenticationType targetAuthenticationType = default(Azure.ResourceManager.DatabaseWatcher.Models.TargetAuthenticationType), Azure.ResourceManager.DatabaseWatcher.Models.VaultSecret targetVault = null, string connectionServerName = null, Azure.ResourceManager.DatabaseWatcher.Models.ResourceProvisioningState? provisioningState = default(Azure.ResourceManager.DatabaseWatcher.Models.ResourceProvisioningState?), Azure.Core.ResourceIdentifier sqlEpResourceId = null, Azure.Core.ResourceIdentifier anchorDatabaseResourceId = null, bool? readIntent = default(bool?)) { throw null; } + public static Azure.ResourceManager.DatabaseWatcher.Models.SqlDbSingleDatabaseTargetProperties SqlDbSingleDatabaseTargetProperties(Azure.ResourceManager.DatabaseWatcher.Models.TargetAuthenticationType targetAuthenticationType = default(Azure.ResourceManager.DatabaseWatcher.Models.TargetAuthenticationType), Azure.ResourceManager.DatabaseWatcher.Models.VaultSecret targetVault = null, string connectionServerName = null, Azure.ResourceManager.DatabaseWatcher.Models.ResourceProvisioningState? provisioningState = default(Azure.ResourceManager.DatabaseWatcher.Models.ResourceProvisioningState?), Azure.Core.ResourceIdentifier sqlDbResourceId = null, bool? readIntent = default(bool?)) { throw null; } + public static Azure.ResourceManager.DatabaseWatcher.Models.SqlMiTargetProperties SqlMiTargetProperties(Azure.ResourceManager.DatabaseWatcher.Models.TargetAuthenticationType targetAuthenticationType = default(Azure.ResourceManager.DatabaseWatcher.Models.TargetAuthenticationType), Azure.ResourceManager.DatabaseWatcher.Models.VaultSecret targetVault = null, string connectionServerName = null, Azure.ResourceManager.DatabaseWatcher.Models.ResourceProvisioningState? provisioningState = default(Azure.ResourceManager.DatabaseWatcher.Models.ResourceProvisioningState?), Azure.Core.ResourceIdentifier sqlMiResourceId = null, int? connectionTcpPort = default(int?), bool? readIntent = default(bool?)) { throw null; } + public static Azure.ResourceManager.DatabaseWatcher.TargetData TargetData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.DatabaseWatcher.Models.TargetProperties properties = null) { throw null; } + public static Azure.ResourceManager.DatabaseWatcher.Models.TargetProperties TargetProperties(string targetType = null, Azure.ResourceManager.DatabaseWatcher.Models.TargetAuthenticationType targetAuthenticationType = default(Azure.ResourceManager.DatabaseWatcher.Models.TargetAuthenticationType), Azure.ResourceManager.DatabaseWatcher.Models.VaultSecret targetVault = null, string connectionServerName = null, Azure.ResourceManager.DatabaseWatcher.Models.ResourceProvisioningState? provisioningState = default(Azure.ResourceManager.DatabaseWatcher.Models.ResourceProvisioningState?)) { throw null; } + public static Azure.ResourceManager.DatabaseWatcher.Models.ValidationIssue ValidationIssue(string errorCode = null, string errorMessage = null, string additionalDetails = null, string recommendationMessage = null, System.Uri recommendationUri = null, Azure.Core.ResourceIdentifier relatedResourceId = null, string relatedResourceType = null) { throw null; } + public static Azure.ResourceManager.DatabaseWatcher.WatcherData WatcherData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), Azure.ResourceManager.DatabaseWatcher.Models.WatcherProperties properties = null, Azure.ResourceManager.DatabaseWatcher.Models.ManagedServiceIdentityV4 identity = null) { throw null; } + public static Azure.ResourceManager.DatabaseWatcher.Models.WatcherProperties WatcherProperties(Azure.ResourceManager.DatabaseWatcher.Models.Datastore datastore = null, Azure.ResourceManager.DatabaseWatcher.Models.WatcherStatus? status = default(Azure.ResourceManager.DatabaseWatcher.Models.WatcherStatus?), Azure.ResourceManager.DatabaseWatcher.Models.DatabaseWatcherProvisioningState? provisioningState = default(Azure.ResourceManager.DatabaseWatcher.Models.DatabaseWatcherProvisioningState?), Azure.Core.ResourceIdentifier defaultAlertRuleIdentityResourceId = null) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct DatabaseWatcherProvisioningState : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public DatabaseWatcherProvisioningState(string value) { throw null; } + public static Azure.ResourceManager.DatabaseWatcher.Models.DatabaseWatcherProvisioningState Canceled { get { throw null; } } + public static Azure.ResourceManager.DatabaseWatcher.Models.DatabaseWatcherProvisioningState Failed { get { throw null; } } + public static Azure.ResourceManager.DatabaseWatcher.Models.DatabaseWatcherProvisioningState Succeeded { get { throw null; } } + public bool Equals(Azure.ResourceManager.DatabaseWatcher.Models.DatabaseWatcherProvisioningState other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.DatabaseWatcher.Models.DatabaseWatcherProvisioningState left, Azure.ResourceManager.DatabaseWatcher.Models.DatabaseWatcherProvisioningState right) { throw null; } + public static implicit operator Azure.ResourceManager.DatabaseWatcher.Models.DatabaseWatcherProvisioningState (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.DatabaseWatcher.Models.DatabaseWatcherProvisioningState left, Azure.ResourceManager.DatabaseWatcher.Models.DatabaseWatcherProvisioningState right) { throw null; } + public override string ToString() { throw null; } + } + public partial class Datastore : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public Datastore(string kustoClusterUri, string kustoDataIngestionUri, string kustoDatabaseName, string kustoManagementUri, Azure.ResourceManager.DatabaseWatcher.Models.KustoOfferingType kustoOfferingType) { } + public Azure.Core.ResourceIdentifier AdxClusterResourceId { get { throw null; } set { } } + public string KustoClusterDisplayName { get { throw null; } set { } } + public string KustoClusterUri { get { throw null; } set { } } + public string KustoDatabaseName { get { throw null; } set { } } + public string KustoDataIngestionUri { get { throw null; } set { } } + public string KustoManagementUri { get { throw null; } set { } } + public Azure.ResourceManager.DatabaseWatcher.Models.KustoOfferingType KustoOfferingType { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseWatcher.Models.Datastore System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseWatcher.Models.Datastore System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class HealthValidationProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal HealthValidationProperties() { } + public System.DateTimeOffset EndOn { get { throw null; } } + public System.Collections.Generic.IReadOnlyList Issues { get { throw null; } } + public Azure.ResourceManager.DatabaseWatcher.Models.ResourceProvisioningState? ProvisioningState { get { throw null; } } + public System.DateTimeOffset StartOn { get { throw null; } } + public Azure.ResourceManager.DatabaseWatcher.Models.ValidationStatus Status { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseWatcher.Models.HealthValidationProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseWatcher.Models.HealthValidationProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct KustoOfferingType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public KustoOfferingType(string value) { throw null; } + public static Azure.ResourceManager.DatabaseWatcher.Models.KustoOfferingType Adx { get { throw null; } } + public static Azure.ResourceManager.DatabaseWatcher.Models.KustoOfferingType Fabric { get { throw null; } } + public static Azure.ResourceManager.DatabaseWatcher.Models.KustoOfferingType Free { get { throw null; } } + public bool Equals(Azure.ResourceManager.DatabaseWatcher.Models.KustoOfferingType other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.DatabaseWatcher.Models.KustoOfferingType left, Azure.ResourceManager.DatabaseWatcher.Models.KustoOfferingType right) { throw null; } + public static implicit operator Azure.ResourceManager.DatabaseWatcher.Models.KustoOfferingType (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.DatabaseWatcher.Models.KustoOfferingType left, Azure.ResourceManager.DatabaseWatcher.Models.KustoOfferingType right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct ManagedServiceIdentityType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public ManagedServiceIdentityType(string value) { throw null; } + public static Azure.ResourceManager.DatabaseWatcher.Models.ManagedServiceIdentityType None { get { throw null; } } + public static Azure.ResourceManager.DatabaseWatcher.Models.ManagedServiceIdentityType SystemAndUserAssigned { get { throw null; } } + public static Azure.ResourceManager.DatabaseWatcher.Models.ManagedServiceIdentityType SystemAssigned { get { throw null; } } + public static Azure.ResourceManager.DatabaseWatcher.Models.ManagedServiceIdentityType UserAssigned { get { throw null; } } + public bool Equals(Azure.ResourceManager.DatabaseWatcher.Models.ManagedServiceIdentityType other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.DatabaseWatcher.Models.ManagedServiceIdentityType left, Azure.ResourceManager.DatabaseWatcher.Models.ManagedServiceIdentityType right) { throw null; } + public static implicit operator Azure.ResourceManager.DatabaseWatcher.Models.ManagedServiceIdentityType (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.DatabaseWatcher.Models.ManagedServiceIdentityType left, Azure.ResourceManager.DatabaseWatcher.Models.ManagedServiceIdentityType right) { throw null; } + public override string ToString() { throw null; } + } + public partial class ManagedServiceIdentityV4 : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ManagedServiceIdentityV4(Azure.ResourceManager.DatabaseWatcher.Models.ManagedServiceIdentityType type) { } + public System.Guid? PrincipalId { get { throw null; } } + public System.Guid? TenantId { get { throw null; } } + public Azure.ResourceManager.DatabaseWatcher.Models.ManagedServiceIdentityType Type { get { throw null; } set { } } + public System.Collections.Generic.IDictionary UserAssignedIdentities { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseWatcher.Models.ManagedServiceIdentityV4 System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseWatcher.Models.ManagedServiceIdentityV4 System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct ResourceProvisioningState : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public ResourceProvisioningState(string value) { throw null; } + public static Azure.ResourceManager.DatabaseWatcher.Models.ResourceProvisioningState Canceled { get { throw null; } } + public static Azure.ResourceManager.DatabaseWatcher.Models.ResourceProvisioningState Failed { get { throw null; } } + public static Azure.ResourceManager.DatabaseWatcher.Models.ResourceProvisioningState Succeeded { get { throw null; } } + public bool Equals(Azure.ResourceManager.DatabaseWatcher.Models.ResourceProvisioningState other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.DatabaseWatcher.Models.ResourceProvisioningState left, Azure.ResourceManager.DatabaseWatcher.Models.ResourceProvisioningState right) { throw null; } + public static implicit operator Azure.ResourceManager.DatabaseWatcher.Models.ResourceProvisioningState (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.DatabaseWatcher.Models.ResourceProvisioningState left, Azure.ResourceManager.DatabaseWatcher.Models.ResourceProvisioningState right) { throw null; } + public override string ToString() { throw null; } + } + public partial class SharedPrivateLinkResourceProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public SharedPrivateLinkResourceProperties(Azure.Core.ResourceIdentifier privateLinkResourceId, string groupId, string requestMessage) { } + public string DnsZone { get { throw null; } set { } } + public string GroupId { get { throw null; } set { } } + public Azure.Core.ResourceIdentifier PrivateLinkResourceId { get { throw null; } set { } } + public Azure.ResourceManager.DatabaseWatcher.Models.ResourceProvisioningState? ProvisioningState { get { throw null; } } + public string RequestMessage { get { throw null; } set { } } + public Azure.ResourceManager.DatabaseWatcher.Models.SharedPrivateLinkResourceStatus? Status { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseWatcher.Models.SharedPrivateLinkResourceProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseWatcher.Models.SharedPrivateLinkResourceProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct SharedPrivateLinkResourceStatus : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public SharedPrivateLinkResourceStatus(string value) { throw null; } + public static Azure.ResourceManager.DatabaseWatcher.Models.SharedPrivateLinkResourceStatus Approved { get { throw null; } } + public static Azure.ResourceManager.DatabaseWatcher.Models.SharedPrivateLinkResourceStatus Disconnected { get { throw null; } } + public static Azure.ResourceManager.DatabaseWatcher.Models.SharedPrivateLinkResourceStatus Pending { get { throw null; } } + public static Azure.ResourceManager.DatabaseWatcher.Models.SharedPrivateLinkResourceStatus Rejected { get { throw null; } } + public bool Equals(Azure.ResourceManager.DatabaseWatcher.Models.SharedPrivateLinkResourceStatus other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.DatabaseWatcher.Models.SharedPrivateLinkResourceStatus left, Azure.ResourceManager.DatabaseWatcher.Models.SharedPrivateLinkResourceStatus right) { throw null; } + public static implicit operator Azure.ResourceManager.DatabaseWatcher.Models.SharedPrivateLinkResourceStatus (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.DatabaseWatcher.Models.SharedPrivateLinkResourceStatus left, Azure.ResourceManager.DatabaseWatcher.Models.SharedPrivateLinkResourceStatus right) { throw null; } + public override string ToString() { throw null; } + } + public partial class SqlDbElasticPoolTargetProperties : Azure.ResourceManager.DatabaseWatcher.Models.TargetProperties, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public SqlDbElasticPoolTargetProperties(Azure.ResourceManager.DatabaseWatcher.Models.TargetAuthenticationType targetAuthenticationType, string connectionServerName, Azure.Core.ResourceIdentifier sqlEpResourceId, Azure.Core.ResourceIdentifier anchorDatabaseResourceId) : base (default(Azure.ResourceManager.DatabaseWatcher.Models.TargetAuthenticationType), default(string)) { } + public Azure.Core.ResourceIdentifier AnchorDatabaseResourceId { get { throw null; } set { } } + public bool? ReadIntent { get { throw null; } set { } } + public Azure.Core.ResourceIdentifier SqlEpResourceId { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseWatcher.Models.SqlDbElasticPoolTargetProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseWatcher.Models.SqlDbElasticPoolTargetProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class SqlDbSingleDatabaseTargetProperties : Azure.ResourceManager.DatabaseWatcher.Models.TargetProperties, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public SqlDbSingleDatabaseTargetProperties(Azure.ResourceManager.DatabaseWatcher.Models.TargetAuthenticationType targetAuthenticationType, string connectionServerName, Azure.Core.ResourceIdentifier sqlDbResourceId) : base (default(Azure.ResourceManager.DatabaseWatcher.Models.TargetAuthenticationType), default(string)) { } + public bool? ReadIntent { get { throw null; } set { } } + public Azure.Core.ResourceIdentifier SqlDbResourceId { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseWatcher.Models.SqlDbSingleDatabaseTargetProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseWatcher.Models.SqlDbSingleDatabaseTargetProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class SqlMiTargetProperties : Azure.ResourceManager.DatabaseWatcher.Models.TargetProperties, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public SqlMiTargetProperties(Azure.ResourceManager.DatabaseWatcher.Models.TargetAuthenticationType targetAuthenticationType, string connectionServerName, Azure.Core.ResourceIdentifier sqlMiResourceId) : base (default(Azure.ResourceManager.DatabaseWatcher.Models.TargetAuthenticationType), default(string)) { } + public int? ConnectionTcpPort { get { throw null; } set { } } + public bool? ReadIntent { get { throw null; } set { } } + public Azure.Core.ResourceIdentifier SqlMiResourceId { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseWatcher.Models.SqlMiTargetProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseWatcher.Models.SqlMiTargetProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct TargetAuthenticationType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public TargetAuthenticationType(string value) { throw null; } + public static Azure.ResourceManager.DatabaseWatcher.Models.TargetAuthenticationType Aad { get { throw null; } } + public static Azure.ResourceManager.DatabaseWatcher.Models.TargetAuthenticationType Sql { get { throw null; } } + public bool Equals(Azure.ResourceManager.DatabaseWatcher.Models.TargetAuthenticationType other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.DatabaseWatcher.Models.TargetAuthenticationType left, Azure.ResourceManager.DatabaseWatcher.Models.TargetAuthenticationType right) { throw null; } + public static implicit operator Azure.ResourceManager.DatabaseWatcher.Models.TargetAuthenticationType (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.DatabaseWatcher.Models.TargetAuthenticationType left, Azure.ResourceManager.DatabaseWatcher.Models.TargetAuthenticationType right) { throw null; } + public override string ToString() { throw null; } + } + public abstract partial class TargetProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + protected TargetProperties(Azure.ResourceManager.DatabaseWatcher.Models.TargetAuthenticationType targetAuthenticationType, string connectionServerName) { } + public string ConnectionServerName { get { throw null; } set { } } + public Azure.ResourceManager.DatabaseWatcher.Models.ResourceProvisioningState? ProvisioningState { get { throw null; } } + public Azure.ResourceManager.DatabaseWatcher.Models.TargetAuthenticationType TargetAuthenticationType { get { throw null; } set { } } + public Azure.ResourceManager.DatabaseWatcher.Models.VaultSecret TargetVault { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseWatcher.Models.TargetProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseWatcher.Models.TargetProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ValidationIssue : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal ValidationIssue() { } + public string AdditionalDetails { get { throw null; } } + public string ErrorCode { get { throw null; } } + public string ErrorMessage { get { throw null; } } + public string RecommendationMessage { get { throw null; } } + public System.Uri RecommendationUri { get { throw null; } } + public Azure.Core.ResourceIdentifier RelatedResourceId { get { throw null; } } + public string RelatedResourceType { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseWatcher.Models.ValidationIssue System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseWatcher.Models.ValidationIssue System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct ValidationStatus : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public ValidationStatus(string value) { throw null; } + public static Azure.ResourceManager.DatabaseWatcher.Models.ValidationStatus Canceled { get { throw null; } } + public static Azure.ResourceManager.DatabaseWatcher.Models.ValidationStatus Failed { get { throw null; } } + public static Azure.ResourceManager.DatabaseWatcher.Models.ValidationStatus NotStarted { get { throw null; } } + public static Azure.ResourceManager.DatabaseWatcher.Models.ValidationStatus Running { get { throw null; } } + public static Azure.ResourceManager.DatabaseWatcher.Models.ValidationStatus Succeeded { get { throw null; } } + public static Azure.ResourceManager.DatabaseWatcher.Models.ValidationStatus TimedOut { get { throw null; } } + public bool Equals(Azure.ResourceManager.DatabaseWatcher.Models.ValidationStatus other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.DatabaseWatcher.Models.ValidationStatus left, Azure.ResourceManager.DatabaseWatcher.Models.ValidationStatus right) { throw null; } + public static implicit operator Azure.ResourceManager.DatabaseWatcher.Models.ValidationStatus (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.DatabaseWatcher.Models.ValidationStatus left, Azure.ResourceManager.DatabaseWatcher.Models.ValidationStatus right) { throw null; } + public override string ToString() { throw null; } + } + public partial class VaultSecret : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public VaultSecret() { } + public Azure.Core.ResourceIdentifier AkvResourceId { get { throw null; } set { } } + public string AkvTargetPassword { get { throw null; } set { } } + public string AkvTargetUser { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseWatcher.Models.VaultSecret System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseWatcher.Models.VaultSecret System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class WatcherPatch : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public WatcherPatch() { } + public Azure.ResourceManager.DatabaseWatcher.Models.ManagedServiceIdentityV4 Identity { get { throw null; } set { } } + public Azure.ResourceManager.DatabaseWatcher.Models.WatcherUpdateProperties Properties { get { throw null; } set { } } + public System.Collections.Generic.IDictionary Tags { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseWatcher.Models.WatcherPatch System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseWatcher.Models.WatcherPatch System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class WatcherProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public WatcherProperties() { } + public Azure.ResourceManager.DatabaseWatcher.Models.Datastore Datastore { get { throw null; } set { } } + public Azure.Core.ResourceIdentifier DefaultAlertRuleIdentityResourceId { get { throw null; } set { } } + public Azure.ResourceManager.DatabaseWatcher.Models.DatabaseWatcherProvisioningState? ProvisioningState { get { throw null; } } + public Azure.ResourceManager.DatabaseWatcher.Models.WatcherStatus? Status { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseWatcher.Models.WatcherProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseWatcher.Models.WatcherProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct WatcherStatus : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public WatcherStatus(string value) { throw null; } + public static Azure.ResourceManager.DatabaseWatcher.Models.WatcherStatus Deleting { get { throw null; } } + public static Azure.ResourceManager.DatabaseWatcher.Models.WatcherStatus Running { get { throw null; } } + public static Azure.ResourceManager.DatabaseWatcher.Models.WatcherStatus Starting { get { throw null; } } + public static Azure.ResourceManager.DatabaseWatcher.Models.WatcherStatus Stopped { get { throw null; } } + public static Azure.ResourceManager.DatabaseWatcher.Models.WatcherStatus Stopping { get { throw null; } } + public bool Equals(Azure.ResourceManager.DatabaseWatcher.Models.WatcherStatus other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.DatabaseWatcher.Models.WatcherStatus left, Azure.ResourceManager.DatabaseWatcher.Models.WatcherStatus right) { throw null; } + public static implicit operator Azure.ResourceManager.DatabaseWatcher.Models.WatcherStatus (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.DatabaseWatcher.Models.WatcherStatus left, Azure.ResourceManager.DatabaseWatcher.Models.WatcherStatus right) { throw null; } + public override string ToString() { throw null; } + } + public partial class WatcherUpdateProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public WatcherUpdateProperties() { } + public Azure.ResourceManager.DatabaseWatcher.Models.Datastore Datastore { get { throw null; } set { } } + public Azure.Core.ResourceIdentifier DefaultAlertRuleIdentityResourceId { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseWatcher.Models.WatcherUpdateProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseWatcher.Models.WatcherUpdateProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } +} diff --git a/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/assets.json b/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/assets.json new file mode 100644 index 000000000000..169779905282 --- /dev/null +++ b/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/assets.json @@ -0,0 +1,7 @@ + +{ + "AssetsRepo": "Azure/azure-sdk-assets", + "AssetsRepoPrefixPath": "net", + "TagPrefix": "net/databasewatcher/Azure.ResourceManager.DatabaseWatcher", + "Tag": "" +} diff --git a/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/samples/Azure.ResourceManager.DatabaseWatcher.Samples.csproj b/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/samples/Azure.ResourceManager.DatabaseWatcher.Samples.csproj new file mode 100644 index 000000000000..4750448f1e63 --- /dev/null +++ b/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/samples/Azure.ResourceManager.DatabaseWatcher.Samples.csproj @@ -0,0 +1,13 @@ + + + + + + + + + + + + + diff --git a/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/samples/Generated/Samples/Sample_AlertRuleResource.cs b/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/samples/Generated/Samples/Sample_AlertRuleResource.cs new file mode 100644 index 000000000000..3485ac40f5df --- /dev/null +++ b/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/samples/Generated/Samples/Sample_AlertRuleResource.cs @@ -0,0 +1,113 @@ +// 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.DatabaseWatcher.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.DatabaseWatcher.Samples +{ + public partial class Sample_AlertRuleResource + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_AlertRuleResourcesGetMaximumSet() + { + // Generated from example definition: 2025-01-02/AlertRuleResources_Get_MaximumSet_Gen.json + // this example is just showing the usage of "AlertRuleResource_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 AlertRuleResource created on azure + // for more information of creating AlertRuleResource, please refer to the document of AlertRuleResource + string subscriptionId = "A76F9850-996B-40B3-94D4-C98110A0EEC9"; + string resourceGroupName = "rgWatcher"; + string watcherName = "testWatcher"; + string alertRuleResourceName = "testAlert"; + ResourceIdentifier alertRuleResourceId = AlertRuleResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, watcherName, alertRuleResourceName); + AlertRuleResource alertRuleResource = client.GetAlertRuleResource(alertRuleResourceId); + + // invoke the operation + AlertRuleResource result = await alertRuleResource.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 + AlertRuleResourceData 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_AlertRuleResourcesDeleteMaximumSet() + { + // Generated from example definition: 2025-01-02/AlertRuleResources_Delete_MaximumSet_Gen.json + // this example is just showing the usage of "AlertRuleResource_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 AlertRuleResource created on azure + // for more information of creating AlertRuleResource, please refer to the document of AlertRuleResource + string subscriptionId = "A76F9850-996B-40B3-94D4-C98110A0EEC9"; + string resourceGroupName = "rgWatcher"; + string watcherName = "testWatcher"; + string alertRuleResourceName = "testAlert"; + ResourceIdentifier alertRuleResourceId = AlertRuleResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, watcherName, alertRuleResourceName); + AlertRuleResource alertRuleResource = client.GetAlertRuleResource(alertRuleResourceId); + + // invoke the operation + await alertRuleResource.DeleteAsync(WaitUntil.Completed); + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Update_AlertRuleResourcesCreateOrUpdateMaximumSet() + { + // Generated from example definition: 2025-01-02/AlertRuleResources_CreateOrUpdate_MaximumSet_Gen.json + // this example is just showing the usage of "AlertRuleResource_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 AlertRuleResource created on azure + // for more information of creating AlertRuleResource, please refer to the document of AlertRuleResource + string subscriptionId = "A76F9850-996B-40B3-94D4-C98110A0EEC9"; + string resourceGroupName = "rgWatcher"; + string watcherName = "testWatcher"; + string alertRuleResourceName = "testAlert"; + ResourceIdentifier alertRuleResourceId = AlertRuleResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, watcherName, alertRuleResourceName); + AlertRuleResource alertRuleResource = client.GetAlertRuleResource(alertRuleResourceId); + + // invoke the operation + AlertRuleResourceData data = new AlertRuleResourceData + { + Properties = new AlertRuleResourceProperties(new ResourceIdentifier("/subscriptions/469DD77C-C8DB-47B7-B9E1-72D29F8C878Be/resourceGroups/rgWatcher/providers/microsoft.insights/scheduledqueryrules/alerts-demo"), AlertRuleCreationProperty.CreatedWithActionGroup, DateTimeOffset.Parse("2024-07-25T15:38:47.798Z"), "someTemplateId", "1.0"), + }; + ArmOperation lro = await alertRuleResource.UpdateAsync(WaitUntil.Completed, data); + AlertRuleResource 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 + AlertRuleResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/samples/Generated/Samples/Sample_AlertRuleResourceCollection.cs b/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/samples/Generated/Samples/Sample_AlertRuleResourceCollection.cs new file mode 100644 index 000000000000..44c4f3db380a --- /dev/null +++ b/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/samples/Generated/Samples/Sample_AlertRuleResourceCollection.cs @@ -0,0 +1,200 @@ +// 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.DatabaseWatcher.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.DatabaseWatcher.Samples +{ + public partial class Sample_AlertRuleResourceCollection + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task CreateOrUpdate_AlertRuleResourcesCreateOrUpdateMaximumSet() + { + // Generated from example definition: 2025-01-02/AlertRuleResources_CreateOrUpdate_MaximumSet_Gen.json + // this example is just showing the usage of "AlertRuleResource_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 WatcherResource created on azure + // for more information of creating WatcherResource, please refer to the document of WatcherResource + string subscriptionId = "A76F9850-996B-40B3-94D4-C98110A0EEC9"; + string resourceGroupName = "rgWatcher"; + string watcherName = "testWatcher"; + ResourceIdentifier watcherResourceId = WatcherResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, watcherName); + WatcherResource watcher = client.GetWatcherResource(watcherResourceId); + + // get the collection of this AlertRuleResource + AlertRuleResourceCollection collection = watcher.GetAlertRuleResources(); + + // invoke the operation + string alertRuleResourceName = "testAlert"; + AlertRuleResourceData data = new AlertRuleResourceData + { + Properties = new AlertRuleResourceProperties(new ResourceIdentifier("/subscriptions/469DD77C-C8DB-47B7-B9E1-72D29F8C878Be/resourceGroups/rgWatcher/providers/microsoft.insights/scheduledqueryrules/alerts-demo"), AlertRuleCreationProperty.CreatedWithActionGroup, DateTimeOffset.Parse("2024-07-25T15:38:47.798Z"), "someTemplateId", "1.0"), + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, alertRuleResourceName, data); + AlertRuleResource 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 + AlertRuleResourceData 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_AlertRuleResourcesGetMaximumSet() + { + // Generated from example definition: 2025-01-02/AlertRuleResources_Get_MaximumSet_Gen.json + // this example is just showing the usage of "AlertRuleResource_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 WatcherResource created on azure + // for more information of creating WatcherResource, please refer to the document of WatcherResource + string subscriptionId = "A76F9850-996B-40B3-94D4-C98110A0EEC9"; + string resourceGroupName = "rgWatcher"; + string watcherName = "testWatcher"; + ResourceIdentifier watcherResourceId = WatcherResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, watcherName); + WatcherResource watcher = client.GetWatcherResource(watcherResourceId); + + // get the collection of this AlertRuleResource + AlertRuleResourceCollection collection = watcher.GetAlertRuleResources(); + + // invoke the operation + string alertRuleResourceName = "testAlert"; + AlertRuleResource result = await collection.GetAsync(alertRuleResourceName); + + // 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 + AlertRuleResourceData 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_AlertRuleResourcesListByParentMaximumSet() + { + // Generated from example definition: 2025-01-02/AlertRuleResources_ListByParent_MaximumSet_Gen.json + // this example is just showing the usage of "AlertRuleResource_ListByParent" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details 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 WatcherResource created on azure + // for more information of creating WatcherResource, please refer to the document of WatcherResource + string subscriptionId = "A76F9850-996B-40B3-94D4-C98110A0EEC9"; + string resourceGroupName = "rgWatcher"; + string watcherName = "testWatcher"; + ResourceIdentifier watcherResourceId = WatcherResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, watcherName); + WatcherResource watcher = client.GetWatcherResource(watcherResourceId); + + // get the collection of this AlertRuleResource + AlertRuleResourceCollection collection = watcher.GetAlertRuleResources(); + + // invoke the operation and iterate over the result + await foreach (AlertRuleResource 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 + AlertRuleResourceData 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_AlertRuleResourcesGetMaximumSet() + { + // Generated from example definition: 2025-01-02/AlertRuleResources_Get_MaximumSet_Gen.json + // this example is just showing the usage of "AlertRuleResource_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 WatcherResource created on azure + // for more information of creating WatcherResource, please refer to the document of WatcherResource + string subscriptionId = "A76F9850-996B-40B3-94D4-C98110A0EEC9"; + string resourceGroupName = "rgWatcher"; + string watcherName = "testWatcher"; + ResourceIdentifier watcherResourceId = WatcherResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, watcherName); + WatcherResource watcher = client.GetWatcherResource(watcherResourceId); + + // get the collection of this AlertRuleResource + AlertRuleResourceCollection collection = watcher.GetAlertRuleResources(); + + // invoke the operation + string alertRuleResourceName = "testAlert"; + bool result = await collection.ExistsAsync(alertRuleResourceName); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetIfExists_AlertRuleResourcesGetMaximumSet() + { + // Generated from example definition: 2025-01-02/AlertRuleResources_Get_MaximumSet_Gen.json + // this example is just showing the usage of "AlertRuleResource_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 WatcherResource created on azure + // for more information of creating WatcherResource, please refer to the document of WatcherResource + string subscriptionId = "A76F9850-996B-40B3-94D4-C98110A0EEC9"; + string resourceGroupName = "rgWatcher"; + string watcherName = "testWatcher"; + ResourceIdentifier watcherResourceId = WatcherResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, watcherName); + WatcherResource watcher = client.GetWatcherResource(watcherResourceId); + + // get the collection of this AlertRuleResource + AlertRuleResourceCollection collection = watcher.GetAlertRuleResources(); + + // invoke the operation + string alertRuleResourceName = "testAlert"; + NullableResponse response = await collection.GetIfExistsAsync(alertRuleResourceName); + AlertRuleResource 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 + AlertRuleResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + } +} diff --git a/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/samples/Generated/Samples/Sample_HealthValidationCollection.cs b/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/samples/Generated/Samples/Sample_HealthValidationCollection.cs new file mode 100644 index 000000000000..d42c055011fa --- /dev/null +++ b/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/samples/Generated/Samples/Sample_HealthValidationCollection.cs @@ -0,0 +1,160 @@ +// 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 NUnit.Framework; + +namespace Azure.ResourceManager.DatabaseWatcher.Samples +{ + public partial class Sample_HealthValidationCollection + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_HealthValidationsGetMaximumSet() + { + // Generated from example definition: 2025-01-02/HealthValidations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "HealthValidation_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 WatcherResource created on azure + // for more information of creating WatcherResource, please refer to the document of WatcherResource + string subscriptionId = "A76F9850-996B-40B3-94D4-C98110A0EEC9"; + string resourceGroupName = "rgWatcher"; + string watcherName = "testWatcher"; + ResourceIdentifier watcherResourceId = WatcherResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, watcherName); + WatcherResource watcher = client.GetWatcherResource(watcherResourceId); + + // get the collection of this HealthValidationResource + HealthValidationCollection collection = watcher.GetHealthValidations(); + + // invoke the operation + string healthValidationName = "testHealthValidation"; + HealthValidationResource result = await collection.GetAsync(healthValidationName); + + // 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 + HealthValidationData 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_HealthValidationsListByParentMaximumSet() + { + // Generated from example definition: 2025-01-02/HealthValidations_ListByParent_MaximumSet_Gen.json + // this example is just showing the usage of "HealthValidation_ListByParent" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details 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 WatcherResource created on azure + // for more information of creating WatcherResource, please refer to the document of WatcherResource + string subscriptionId = "A76F9850-996B-40B3-94D4-C98110A0EEC9"; + string resourceGroupName = "rgWatcher"; + string watcherName = "testWatcher"; + ResourceIdentifier watcherResourceId = WatcherResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, watcherName); + WatcherResource watcher = client.GetWatcherResource(watcherResourceId); + + // get the collection of this HealthValidationResource + HealthValidationCollection collection = watcher.GetHealthValidations(); + + // invoke the operation and iterate over the result + await foreach (HealthValidationResource 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 + HealthValidationData 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_HealthValidationsGetMaximumSet() + { + // Generated from example definition: 2025-01-02/HealthValidations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "HealthValidation_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 WatcherResource created on azure + // for more information of creating WatcherResource, please refer to the document of WatcherResource + string subscriptionId = "A76F9850-996B-40B3-94D4-C98110A0EEC9"; + string resourceGroupName = "rgWatcher"; + string watcherName = "testWatcher"; + ResourceIdentifier watcherResourceId = WatcherResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, watcherName); + WatcherResource watcher = client.GetWatcherResource(watcherResourceId); + + // get the collection of this HealthValidationResource + HealthValidationCollection collection = watcher.GetHealthValidations(); + + // invoke the operation + string healthValidationName = "testHealthValidation"; + bool result = await collection.ExistsAsync(healthValidationName); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetIfExists_HealthValidationsGetMaximumSet() + { + // Generated from example definition: 2025-01-02/HealthValidations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "HealthValidation_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 WatcherResource created on azure + // for more information of creating WatcherResource, please refer to the document of WatcherResource + string subscriptionId = "A76F9850-996B-40B3-94D4-C98110A0EEC9"; + string resourceGroupName = "rgWatcher"; + string watcherName = "testWatcher"; + ResourceIdentifier watcherResourceId = WatcherResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, watcherName); + WatcherResource watcher = client.GetWatcherResource(watcherResourceId); + + // get the collection of this HealthValidationResource + HealthValidationCollection collection = watcher.GetHealthValidations(); + + // invoke the operation + string healthValidationName = "testHealthValidation"; + NullableResponse response = await collection.GetIfExistsAsync(healthValidationName); + HealthValidationResource 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 + HealthValidationData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + } +} diff --git a/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/samples/Generated/Samples/Sample_HealthValidationResource.cs b/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/samples/Generated/Samples/Sample_HealthValidationResource.cs new file mode 100644 index 000000000000..ce9b4741820d --- /dev/null +++ b/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/samples/Generated/Samples/Sample_HealthValidationResource.cs @@ -0,0 +1,81 @@ +// 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 NUnit.Framework; + +namespace Azure.ResourceManager.DatabaseWatcher.Samples +{ + public partial class Sample_HealthValidationResource + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_HealthValidationsGetMaximumSet() + { + // Generated from example definition: 2025-01-02/HealthValidations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "HealthValidation_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 HealthValidationResource created on azure + // for more information of creating HealthValidationResource, please refer to the document of HealthValidationResource + string subscriptionId = "A76F9850-996B-40B3-94D4-C98110A0EEC9"; + string resourceGroupName = "rgWatcher"; + string watcherName = "testWatcher"; + string healthValidationName = "testHealthValidation"; + ResourceIdentifier healthValidationResourceId = HealthValidationResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, watcherName, healthValidationName); + HealthValidationResource healthValidation = client.GetHealthValidationResource(healthValidationResourceId); + + // invoke the operation + HealthValidationResource result = await healthValidation.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 + HealthValidationData 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 StartValidation_HealthValidationsStartValidationMaximumSet() + { + // Generated from example definition: 2025-01-02/HealthValidations_StartValidation_MaximumSet_Gen.json + // this example is just showing the usage of "HealthValidations_StartValidation" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details 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 HealthValidationResource created on azure + // for more information of creating HealthValidationResource, please refer to the document of HealthValidationResource + string subscriptionId = "A76F9850-996B-40B3-94D4-C98110A0EEC9"; + string resourceGroupName = "rgWatcher"; + string watcherName = "testWatcher"; + string healthValidationName = "testHealthValidation"; + ResourceIdentifier healthValidationResourceId = HealthValidationResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, watcherName, healthValidationName); + HealthValidationResource healthValidation = client.GetHealthValidationResource(healthValidationResourceId); + + // invoke the operation + ArmOperation lro = await healthValidation.StartValidationAsync(WaitUntil.Completed); + HealthValidationResource 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 + HealthValidationData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/samples/Generated/Samples/Sample_SharedPrivateLinkResource.cs b/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/samples/Generated/Samples/Sample_SharedPrivateLinkResource.cs new file mode 100644 index 000000000000..8e163d7bf921 --- /dev/null +++ b/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/samples/Generated/Samples/Sample_SharedPrivateLinkResource.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.DatabaseWatcher.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.DatabaseWatcher.Samples +{ + public partial class Sample_SharedPrivateLinkResource + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_SharedPrivateLinkResourcesGetMaximumSet() + { + // Generated from example definition: 2025-01-02/SharedPrivateLinkResources_Get_MaximumSet_Gen.json + // this example is just showing the usage of "SharedPrivateLinkResource_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 SharedPrivateLinkResource created on azure + // for more information of creating SharedPrivateLinkResource, please refer to the document of SharedPrivateLinkResource + string subscriptionId = "49e0fbd3-75e8-44e7-96fd-5b64d9ad818d"; + string resourceGroupName = "apiTest-ddat4p"; + string watcherName = "databasemo3ej9ih"; + string sharedPrivateLinkResourceName = "monitoringh22eed"; + ResourceIdentifier sharedPrivateLinkResourceId = SharedPrivateLinkResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, watcherName, sharedPrivateLinkResourceName); + SharedPrivateLinkResource sharedPrivateLinkResource = client.GetSharedPrivateLinkResource(sharedPrivateLinkResourceId); + + // invoke the operation + SharedPrivateLinkResource result = await sharedPrivateLinkResource.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 + SharedPrivateLinkResourceData 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_SharedPrivateLinkResourcesDeleteMaximumSet() + { + // Generated from example definition: 2025-01-02/SharedPrivateLinkResources_Delete_MaximumSet_Gen.json + // this example is just showing the usage of "SharedPrivateLinkResource_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 SharedPrivateLinkResource created on azure + // for more information of creating SharedPrivateLinkResource, please refer to the document of SharedPrivateLinkResource + string subscriptionId = "49e0fbd3-75e8-44e7-96fd-5b64d9ad818d"; + string resourceGroupName = "apiTest-ddat4p"; + string watcherName = "databasemo3ej9ih"; + string sharedPrivateLinkResourceName = "monitoringh22eed"; + ResourceIdentifier sharedPrivateLinkResourceId = SharedPrivateLinkResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, watcherName, sharedPrivateLinkResourceName); + SharedPrivateLinkResource sharedPrivateLinkResource = client.GetSharedPrivateLinkResource(sharedPrivateLinkResourceId); + + // invoke the operation + await sharedPrivateLinkResource.DeleteAsync(WaitUntil.Completed); + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Update_SharedPrivateLinkResourcesCreateMaximumSet() + { + // Generated from example definition: 2025-01-02/SharedPrivateLinkResources_Create_MaximumSet_Gen.json + // this example is just showing the usage of "SharedPrivateLinkResource_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 SharedPrivateLinkResource created on azure + // for more information of creating SharedPrivateLinkResource, please refer to the document of SharedPrivateLinkResource + string subscriptionId = "49e0fbd3-75e8-44e7-96fd-5b64d9ad818d"; + string resourceGroupName = "apiTest-ddat4p"; + string watcherName = "databasemo3ej9ih"; + string sharedPrivateLinkResourceName = "monitoringh22eed"; + ResourceIdentifier sharedPrivateLinkResourceId = SharedPrivateLinkResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, watcherName, sharedPrivateLinkResourceName); + SharedPrivateLinkResource sharedPrivateLinkResource = client.GetSharedPrivateLinkResource(sharedPrivateLinkResourceId); + + // invoke the operation + SharedPrivateLinkResourceData data = new SharedPrivateLinkResourceData + { + Properties = new SharedPrivateLinkResourceProperties(new ResourceIdentifier("/subscriptions/49e0fbd3-75e8-44e7-96fd-5b64d9ad818d/resourceGroups/apiTest-ddat4p/providers/Microsoft.KeyVault/vaults/kvmo3ej9ih"), "vault", "request message") + { + DnsZone = "ec3ae9d410ba", + }, + }; + ArmOperation lro = await sharedPrivateLinkResource.UpdateAsync(WaitUntil.Completed, data); + SharedPrivateLinkResource 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 + SharedPrivateLinkResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/samples/Generated/Samples/Sample_SharedPrivateLinkResourceCollection.cs b/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/samples/Generated/Samples/Sample_SharedPrivateLinkResourceCollection.cs new file mode 100644 index 000000000000..8ea926df43bc --- /dev/null +++ b/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/samples/Generated/Samples/Sample_SharedPrivateLinkResourceCollection.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.DatabaseWatcher.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.DatabaseWatcher.Samples +{ + public partial class Sample_SharedPrivateLinkResourceCollection + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task CreateOrUpdate_SharedPrivateLinkResourcesCreateMaximumSet() + { + // Generated from example definition: 2025-01-02/SharedPrivateLinkResources_Create_MaximumSet_Gen.json + // this example is just showing the usage of "SharedPrivateLinkResource_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 WatcherResource created on azure + // for more information of creating WatcherResource, please refer to the document of WatcherResource + string subscriptionId = "49e0fbd3-75e8-44e7-96fd-5b64d9ad818d"; + string resourceGroupName = "apiTest-ddat4p"; + string watcherName = "databasemo3ej9ih"; + ResourceIdentifier watcherResourceId = WatcherResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, watcherName); + WatcherResource watcher = client.GetWatcherResource(watcherResourceId); + + // get the collection of this SharedPrivateLinkResource + SharedPrivateLinkResourceCollection collection = watcher.GetSharedPrivateLinkResources(); + + // invoke the operation + string sharedPrivateLinkResourceName = "monitoringh22eed"; + SharedPrivateLinkResourceData data = new SharedPrivateLinkResourceData + { + Properties = new SharedPrivateLinkResourceProperties(new ResourceIdentifier("/subscriptions/49e0fbd3-75e8-44e7-96fd-5b64d9ad818d/resourceGroups/apiTest-ddat4p/providers/Microsoft.KeyVault/vaults/kvmo3ej9ih"), "vault", "request message") + { + DnsZone = "ec3ae9d410ba", + }, + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, sharedPrivateLinkResourceName, data); + SharedPrivateLinkResource 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 + SharedPrivateLinkResourceData 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_SharedPrivateLinkResourcesGetMaximumSet() + { + // Generated from example definition: 2025-01-02/SharedPrivateLinkResources_Get_MaximumSet_Gen.json + // this example is just showing the usage of "SharedPrivateLinkResource_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 WatcherResource created on azure + // for more information of creating WatcherResource, please refer to the document of WatcherResource + string subscriptionId = "49e0fbd3-75e8-44e7-96fd-5b64d9ad818d"; + string resourceGroupName = "apiTest-ddat4p"; + string watcherName = "databasemo3ej9ih"; + ResourceIdentifier watcherResourceId = WatcherResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, watcherName); + WatcherResource watcher = client.GetWatcherResource(watcherResourceId); + + // get the collection of this SharedPrivateLinkResource + SharedPrivateLinkResourceCollection collection = watcher.GetSharedPrivateLinkResources(); + + // invoke the operation + string sharedPrivateLinkResourceName = "monitoringh22eed"; + SharedPrivateLinkResource result = await collection.GetAsync(sharedPrivateLinkResourceName); + + // 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 + SharedPrivateLinkResourceData 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_SharedPrivateLinkResourcesListByWatcherMaximumSet() + { + // Generated from example definition: 2025-01-02/SharedPrivateLinkResources_ListByWatcher_MaximumSet_Gen.json + // this example is just showing the usage of "SharedPrivateLinkResource_ListByWatcher" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details 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 WatcherResource created on azure + // for more information of creating WatcherResource, please refer to the document of WatcherResource + string subscriptionId = "49e0fbd3-75e8-44e7-96fd-5b64d9ad818d"; + string resourceGroupName = "apiTest-ddat4p"; + string watcherName = "databasemo3ej9ih"; + ResourceIdentifier watcherResourceId = WatcherResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, watcherName); + WatcherResource watcher = client.GetWatcherResource(watcherResourceId); + + // get the collection of this SharedPrivateLinkResource + SharedPrivateLinkResourceCollection collection = watcher.GetSharedPrivateLinkResources(); + + // invoke the operation and iterate over the result + await foreach (SharedPrivateLinkResource 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 + SharedPrivateLinkResourceData 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_SharedPrivateLinkResourcesGetMaximumSet() + { + // Generated from example definition: 2025-01-02/SharedPrivateLinkResources_Get_MaximumSet_Gen.json + // this example is just showing the usage of "SharedPrivateLinkResource_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 WatcherResource created on azure + // for more information of creating WatcherResource, please refer to the document of WatcherResource + string subscriptionId = "49e0fbd3-75e8-44e7-96fd-5b64d9ad818d"; + string resourceGroupName = "apiTest-ddat4p"; + string watcherName = "databasemo3ej9ih"; + ResourceIdentifier watcherResourceId = WatcherResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, watcherName); + WatcherResource watcher = client.GetWatcherResource(watcherResourceId); + + // get the collection of this SharedPrivateLinkResource + SharedPrivateLinkResourceCollection collection = watcher.GetSharedPrivateLinkResources(); + + // invoke the operation + string sharedPrivateLinkResourceName = "monitoringh22eed"; + bool result = await collection.ExistsAsync(sharedPrivateLinkResourceName); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetIfExists_SharedPrivateLinkResourcesGetMaximumSet() + { + // Generated from example definition: 2025-01-02/SharedPrivateLinkResources_Get_MaximumSet_Gen.json + // this example is just showing the usage of "SharedPrivateLinkResource_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 WatcherResource created on azure + // for more information of creating WatcherResource, please refer to the document of WatcherResource + string subscriptionId = "49e0fbd3-75e8-44e7-96fd-5b64d9ad818d"; + string resourceGroupName = "apiTest-ddat4p"; + string watcherName = "databasemo3ej9ih"; + ResourceIdentifier watcherResourceId = WatcherResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, watcherName); + WatcherResource watcher = client.GetWatcherResource(watcherResourceId); + + // get the collection of this SharedPrivateLinkResource + SharedPrivateLinkResourceCollection collection = watcher.GetSharedPrivateLinkResources(); + + // invoke the operation + string sharedPrivateLinkResourceName = "monitoringh22eed"; + NullableResponse response = await collection.GetIfExistsAsync(sharedPrivateLinkResourceName); + SharedPrivateLinkResource 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 + SharedPrivateLinkResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + } +} diff --git a/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/samples/Generated/Samples/Sample_SubscriptionResourceExtensions.cs b/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/samples/Generated/Samples/Sample_SubscriptionResourceExtensions.cs new file mode 100644 index 000000000000..52b5589c03f6 --- /dev/null +++ b/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/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.DatabaseWatcher.Samples +{ + public partial class Sample_SubscriptionResourceExtensions + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetWatchers_WatchersListBySubscriptionMaximumSet() + { + // Generated from example definition: 2025-01-02/Watchers_ListBySubscription_MaximumSet_Gen.json + // this example is just showing the usage of "Watcher_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 = "A76F9850-996B-40B3-94D4-C98110A0EEC9"; + ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(subscriptionId); + SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId); + + // invoke the operation and iterate over the result + await foreach (WatcherResource item in subscriptionResource.GetWatchersAsync()) + { + // 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 + WatcherData 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/databasewatcher/Azure.ResourceManager.DatabaseWatcher/samples/Generated/Samples/Sample_TargetCollection.cs b/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/samples/Generated/Samples/Sample_TargetCollection.cs new file mode 100644 index 000000000000..7a680ae22dbe --- /dev/null +++ b/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/samples/Generated/Samples/Sample_TargetCollection.cs @@ -0,0 +1,200 @@ +// 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.DatabaseWatcher.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.DatabaseWatcher.Samples +{ + public partial class Sample_TargetCollection + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task CreateOrUpdate_TargetsCreateOrUpdateMaximumSet() + { + // Generated from example definition: 2025-01-02/Targets_CreateOrUpdate_MaximumSet_Gen.json + // this example is just showing the usage of "Target_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 WatcherResource created on azure + // for more information of creating WatcherResource, please refer to the document of WatcherResource + string subscriptionId = "49e0fbd3-75e8-44e7-96fd-5b64d9ad818d"; + string resourceGroupName = "apiTest-ddat4p"; + string watcherName = "databasemo3ej9ih"; + ResourceIdentifier watcherResourceId = WatcherResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, watcherName); + WatcherResource watcher = client.GetWatcherResource(watcherResourceId); + + // get the collection of this TargetResource + TargetCollection collection = watcher.GetTargets(); + + // invoke the operation + string targetName = "monitoringh22eed"; + TargetData data = new TargetData + { + Properties = new SqlDbSingleDatabaseTargetProperties(TargetAuthenticationType.Aad, "sqlServero1ihe2", new ResourceIdentifier("/subscriptions/49e0fbd3-75e8-44e7-96fd-5b64d9ad818d/resourceGroups/apiTest-ddat4p/providers/Microsoft.Sql/servers/m1/databases/m2")), + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, targetName, data); + TargetResource 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 + TargetData 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_TargetsGetMaximumSet() + { + // Generated from example definition: 2025-01-02/Targets_Get_MaximumSet_Gen.json + // this example is just showing the usage of "Target_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 WatcherResource created on azure + // for more information of creating WatcherResource, please refer to the document of WatcherResource + string subscriptionId = "49e0fbd3-75e8-44e7-96fd-5b64d9ad818d"; + string resourceGroupName = "apiTest-ddat4p"; + string watcherName = "databasemo3ej9ih"; + ResourceIdentifier watcherResourceId = WatcherResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, watcherName); + WatcherResource watcher = client.GetWatcherResource(watcherResourceId); + + // get the collection of this TargetResource + TargetCollection collection = watcher.GetTargets(); + + // invoke the operation + string targetName = "monitoringh22eed"; + TargetResource result = await collection.GetAsync(targetName); + + // 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 + TargetData 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_TargetsListByWatcherMaximumSet() + { + // Generated from example definition: 2025-01-02/Targets_ListByWatcher_MaximumSet_Gen.json + // this example is just showing the usage of "Target_ListByWatcher" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details 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 WatcherResource created on azure + // for more information of creating WatcherResource, please refer to the document of WatcherResource + string subscriptionId = "49e0fbd3-75e8-44e7-96fd-5b64d9ad818d"; + string resourceGroupName = "apiTest-ddat4p"; + string watcherName = "databasemo3ej9ih"; + ResourceIdentifier watcherResourceId = WatcherResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, watcherName); + WatcherResource watcher = client.GetWatcherResource(watcherResourceId); + + // get the collection of this TargetResource + TargetCollection collection = watcher.GetTargets(); + + // invoke the operation and iterate over the result + await foreach (TargetResource 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 + TargetData 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_TargetsGetMaximumSet() + { + // Generated from example definition: 2025-01-02/Targets_Get_MaximumSet_Gen.json + // this example is just showing the usage of "Target_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 WatcherResource created on azure + // for more information of creating WatcherResource, please refer to the document of WatcherResource + string subscriptionId = "49e0fbd3-75e8-44e7-96fd-5b64d9ad818d"; + string resourceGroupName = "apiTest-ddat4p"; + string watcherName = "databasemo3ej9ih"; + ResourceIdentifier watcherResourceId = WatcherResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, watcherName); + WatcherResource watcher = client.GetWatcherResource(watcherResourceId); + + // get the collection of this TargetResource + TargetCollection collection = watcher.GetTargets(); + + // invoke the operation + string targetName = "monitoringh22eed"; + bool result = await collection.ExistsAsync(targetName); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetIfExists_TargetsGetMaximumSet() + { + // Generated from example definition: 2025-01-02/Targets_Get_MaximumSet_Gen.json + // this example is just showing the usage of "Target_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 WatcherResource created on azure + // for more information of creating WatcherResource, please refer to the document of WatcherResource + string subscriptionId = "49e0fbd3-75e8-44e7-96fd-5b64d9ad818d"; + string resourceGroupName = "apiTest-ddat4p"; + string watcherName = "databasemo3ej9ih"; + ResourceIdentifier watcherResourceId = WatcherResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, watcherName); + WatcherResource watcher = client.GetWatcherResource(watcherResourceId); + + // get the collection of this TargetResource + TargetCollection collection = watcher.GetTargets(); + + // invoke the operation + string targetName = "monitoringh22eed"; + NullableResponse response = await collection.GetIfExistsAsync(targetName); + TargetResource 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 + TargetData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + } +} diff --git a/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/samples/Generated/Samples/Sample_TargetResource.cs b/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/samples/Generated/Samples/Sample_TargetResource.cs new file mode 100644 index 000000000000..6c10469af52d --- /dev/null +++ b/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/samples/Generated/Samples/Sample_TargetResource.cs @@ -0,0 +1,113 @@ +// 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.DatabaseWatcher.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.DatabaseWatcher.Samples +{ + public partial class Sample_TargetResource + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_TargetsGetMaximumSet() + { + // Generated from example definition: 2025-01-02/Targets_Get_MaximumSet_Gen.json + // this example is just showing the usage of "Target_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 TargetResource created on azure + // for more information of creating TargetResource, please refer to the document of TargetResource + string subscriptionId = "49e0fbd3-75e8-44e7-96fd-5b64d9ad818d"; + string resourceGroupName = "apiTest-ddat4p"; + string watcherName = "databasemo3ej9ih"; + string targetName = "monitoringh22eed"; + ResourceIdentifier targetResourceId = TargetResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, watcherName, targetName); + TargetResource target = client.GetTargetResource(targetResourceId); + + // invoke the operation + TargetResource result = await target.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 + TargetData 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_TargetsDeleteMaximumSet() + { + // Generated from example definition: 2025-01-02/Targets_Delete_MaximumSet_Gen.json + // this example is just showing the usage of "Target_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 TargetResource created on azure + // for more information of creating TargetResource, please refer to the document of TargetResource + string subscriptionId = "49e0fbd3-75e8-44e7-96fd-5b64d9ad818d"; + string resourceGroupName = "apiTest-ddat4p"; + string watcherName = "databasemo3ej9ih"; + string targetName = "monitoringh22eed"; + ResourceIdentifier targetResourceId = TargetResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, watcherName, targetName); + TargetResource target = client.GetTargetResource(targetResourceId); + + // invoke the operation + await target.DeleteAsync(WaitUntil.Completed); + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Update_TargetsCreateOrUpdateMaximumSet() + { + // Generated from example definition: 2025-01-02/Targets_CreateOrUpdate_MaximumSet_Gen.json + // this example is just showing the usage of "Target_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 TargetResource created on azure + // for more information of creating TargetResource, please refer to the document of TargetResource + string subscriptionId = "49e0fbd3-75e8-44e7-96fd-5b64d9ad818d"; + string resourceGroupName = "apiTest-ddat4p"; + string watcherName = "databasemo3ej9ih"; + string targetName = "monitoringh22eed"; + ResourceIdentifier targetResourceId = TargetResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, watcherName, targetName); + TargetResource target = client.GetTargetResource(targetResourceId); + + // invoke the operation + TargetData data = new TargetData + { + Properties = new SqlDbSingleDatabaseTargetProperties(TargetAuthenticationType.Aad, "sqlServero1ihe2", new ResourceIdentifier("/subscriptions/49e0fbd3-75e8-44e7-96fd-5b64d9ad818d/resourceGroups/apiTest-ddat4p/providers/Microsoft.Sql/servers/m1/databases/m2")), + }; + ArmOperation lro = await target.UpdateAsync(WaitUntil.Completed, data); + TargetResource 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 + TargetData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/samples/Generated/Samples/Sample_WatcherCollection.cs b/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/samples/Generated/Samples/Sample_WatcherCollection.cs new file mode 100644 index 000000000000..840349b9b52c --- /dev/null +++ b/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/samples/Generated/Samples/Sample_WatcherCollection.cs @@ -0,0 +1,206 @@ +// 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.DatabaseWatcher.Models; +using Azure.ResourceManager.Resources; +using NUnit.Framework; + +namespace Azure.ResourceManager.DatabaseWatcher.Samples +{ + public partial class Sample_WatcherCollection + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task CreateOrUpdate_WatchersCreateOrUpdateMaximumSet() + { + // Generated from example definition: 2025-01-02/Watchers_CreateOrUpdate_MaximumSet_Gen.json + // this example is just showing the usage of "Watcher_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "A76F9850-996B-40B3-94D4-C98110A0EEC9"; + string resourceGroupName = "rgWatcher"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this WatcherResource + WatcherCollection collection = resourceGroupResource.GetWatchers(); + + // invoke the operation + string watcherName = "testWatcher"; + WatcherData data = new WatcherData(new AzureLocation("eastus2")) + { + Properties = new WatcherProperties + { + Datastore = new Datastore("https://kustouri-adx.eastus.kusto.windows.net", "https://ingest-kustouri-adx.eastus.kusto.windows.net", "kustoDatabaseName1", "https://portal.azure.com/", KustoOfferingType.Adx) + { + AdxClusterResourceId = new ResourceIdentifier("/subscriptions/49e0fbd3-75e8-44e7-96fd-5b64d9ad818d/resourceGroups/apiTest/providers/Microsoft.Kusto/clusters/apiTestKusto"), + KustoClusterDisplayName = "kustoUri-adx", + }, + DefaultAlertRuleIdentityResourceId = new ResourceIdentifier("/subscriptions/469DD77C-C8DB-47B7-B9E1-72D29F8C878B/resourceGroups/rgWatcher/providers/Microsoft.ManagedIdentity/userAssignedIdentities/3pmtest"), + }, + Identity = new ManagedServiceIdentityV4(ManagedServiceIdentityType.SystemAssigned), + Tags = { }, + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, watcherName, data); + WatcherResource 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 + WatcherData 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_WatchersGetMaximumSet() + { + // Generated from example definition: 2025-01-02/Watchers_Get_MaximumSet_Gen.json + // this example is just showing the usage of "Watcher_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 = "A76F9850-996B-40B3-94D4-C98110A0EEC9"; + string resourceGroupName = "rgWatcher"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this WatcherResource + WatcherCollection collection = resourceGroupResource.GetWatchers(); + + // invoke the operation + string watcherName = "myWatcher"; + WatcherResource result = await collection.GetAsync(watcherName); + + // 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 + WatcherData 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_WatchersListByResourceGroupMaximumSet() + { + // Generated from example definition: 2025-01-02/Watchers_ListByResourceGroup_MaximumSet_Gen.json + // this example is just showing the usage of "Watcher_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 = "A76F9850-996B-40B3-94D4-C98110A0EEC9"; + string resourceGroupName = "rgWatcher"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this WatcherResource + WatcherCollection collection = resourceGroupResource.GetWatchers(); + + // invoke the operation and iterate over the result + await foreach (WatcherResource 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 + WatcherData 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_WatchersGetMaximumSet() + { + // Generated from example definition: 2025-01-02/Watchers_Get_MaximumSet_Gen.json + // this example is just showing the usage of "Watcher_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 = "A76F9850-996B-40B3-94D4-C98110A0EEC9"; + string resourceGroupName = "rgWatcher"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this WatcherResource + WatcherCollection collection = resourceGroupResource.GetWatchers(); + + // invoke the operation + string watcherName = "myWatcher"; + bool result = await collection.ExistsAsync(watcherName); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetIfExists_WatchersGetMaximumSet() + { + // Generated from example definition: 2025-01-02/Watchers_Get_MaximumSet_Gen.json + // this example is just showing the usage of "Watcher_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 = "A76F9850-996B-40B3-94D4-C98110A0EEC9"; + string resourceGroupName = "rgWatcher"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this WatcherResource + WatcherCollection collection = resourceGroupResource.GetWatchers(); + + // invoke the operation + string watcherName = "myWatcher"; + NullableResponse response = await collection.GetIfExistsAsync(watcherName); + WatcherResource 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 + WatcherData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + } +} diff --git a/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/samples/Generated/Samples/Sample_WatcherResource.cs b/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/samples/Generated/Samples/Sample_WatcherResource.cs new file mode 100644 index 000000000000..db6444b0f51d --- /dev/null +++ b/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/samples/Generated/Samples/Sample_WatcherResource.cs @@ -0,0 +1,172 @@ +// 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.DatabaseWatcher.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.DatabaseWatcher.Samples +{ + public partial class Sample_WatcherResource + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_WatchersGetMaximumSet() + { + // Generated from example definition: 2025-01-02/Watchers_Get_MaximumSet_Gen.json + // this example is just showing the usage of "Watcher_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 WatcherResource created on azure + // for more information of creating WatcherResource, please refer to the document of WatcherResource + string subscriptionId = "A76F9850-996B-40B3-94D4-C98110A0EEC9"; + string resourceGroupName = "rgWatcher"; + string watcherName = "myWatcher"; + ResourceIdentifier watcherResourceId = WatcherResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, watcherName); + WatcherResource watcher = client.GetWatcherResource(watcherResourceId); + + // invoke the operation + WatcherResource result = await watcher.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 + WatcherData 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_WatchersDeleteMaximumSet() + { + // Generated from example definition: 2025-01-02/Watchers_Delete_MaximumSet_Gen.json + // this example is just showing the usage of "Watcher_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 WatcherResource created on azure + // for more information of creating WatcherResource, please refer to the document of WatcherResource + string subscriptionId = "A76F9850-996B-40B3-94D4-C98110A0EEC9"; + string resourceGroupName = "rgWatcher"; + string watcherName = "testWatcher"; + ResourceIdentifier watcherResourceId = WatcherResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, watcherName); + WatcherResource watcher = client.GetWatcherResource(watcherResourceId); + + // invoke the operation + await watcher.DeleteAsync(WaitUntil.Completed); + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Update_WatchersUpdateMaximumSet() + { + // Generated from example definition: 2025-01-02/Watchers_Update_MaximumSet_Gen.json + // this example is just showing the usage of "Watcher_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 WatcherResource created on azure + // for more information of creating WatcherResource, please refer to the document of WatcherResource + string subscriptionId = "A76F9850-996B-40B3-94D4-C98110A0EEC9"; + string resourceGroupName = "rgWatcher"; + string watcherName = "testWatcher"; + ResourceIdentifier watcherResourceId = WatcherResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, watcherName); + WatcherResource watcher = client.GetWatcherResource(watcherResourceId); + + // invoke the operation + WatcherPatch patch = new WatcherPatch + { + Identity = new ManagedServiceIdentityV4(ManagedServiceIdentityType.SystemAssigned), + Tags = { }, + Properties = new WatcherUpdateProperties + { + Datastore = new Datastore("https://kustouri-adx.eastus.kusto.windows.net", "https://ingest-kustouri-adx.eastus.kusto.windows.net", "kustoDatabaseName1", "https://portal.azure.com/", KustoOfferingType.Adx) + { + AdxClusterResourceId = new ResourceIdentifier("/subscriptions/49e0fbd3-75e8-44e7-96fd-5b64d9ad818d/resourceGroups/apiTest/providers/Microsoft.Kusto/clusters/apiTestKusto"), + KustoClusterDisplayName = "kustoUri-adx", + }, + DefaultAlertRuleIdentityResourceId = new ResourceIdentifier("/subscriptions/469DD77C-C8DB-47B7-B9E1-72D29F8C878B/resourceGroups/rgWatcher/providers/Microsoft.ManagedIdentity/userAssignedIdentities/newtest"), + }, + }; + ArmOperation lro = await watcher.UpdateAsync(WaitUntil.Completed, patch); + WatcherResource 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 + WatcherData 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 Start_WatchersStartMaximumSet() + { + // Generated from example definition: 2025-01-02/Watchers_Start_MaximumSet_Gen.json + // this example is just showing the usage of "Watchers_Start" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details 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 WatcherResource created on azure + // for more information of creating WatcherResource, please refer to the document of WatcherResource + string subscriptionId = "A76F9850-996B-40B3-94D4-C98110A0EEC9"; + string resourceGroupName = "rgWatcher"; + string watcherName = "testWatcher"; + ResourceIdentifier watcherResourceId = WatcherResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, watcherName); + WatcherResource watcher = client.GetWatcherResource(watcherResourceId); + + // invoke the operation + await watcher.StartAsync(WaitUntil.Completed); + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Stop_WatchersStopMaximumSet() + { + // Generated from example definition: 2025-01-02/Watchers_Stop_MaximumSet_Gen.json + // this example is just showing the usage of "Watchers_Stop" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details 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 WatcherResource created on azure + // for more information of creating WatcherResource, please refer to the document of WatcherResource + string subscriptionId = "A76F9850-996B-40B3-94D4-C98110A0EEC9"; + string resourceGroupName = "rgWatcher"; + string watcherName = "myWatcher"; + ResourceIdentifier watcherResourceId = WatcherResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, watcherName); + WatcherResource watcher = client.GetWatcherResource(watcherResourceId); + + // invoke the operation + await watcher.StopAsync(WaitUntil.Completed); + + Console.WriteLine("Succeeded"); + } + } +} diff --git a/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/src/Azure.ResourceManager.DatabaseWatcher.csproj b/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/src/Azure.ResourceManager.DatabaseWatcher.csproj new file mode 100644 index 000000000000..80105c7a5309 --- /dev/null +++ b/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/src/Azure.ResourceManager.DatabaseWatcher.csproj @@ -0,0 +1,8 @@ + + + Azure Resource Manager client SDK for Azure resource provider DatabaseWatcher. + 1.0.0-beta.1 + azure;management;arm;resource manager;databasewatcher + Azure.ResourceManager.DatabaseWatcher + + diff --git a/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/src/Generated/AlertRuleResource.Serialization.cs b/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/src/Generated/AlertRuleResource.Serialization.cs new file mode 100644 index 000000000000..f6ae198f9d4c --- /dev/null +++ b/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/src/Generated/AlertRuleResource.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.DatabaseWatcher +{ + public partial class AlertRuleResource : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); + + AlertRuleResourceData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options); + + AlertRuleResourceData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options); + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); + } +} diff --git a/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/src/Generated/AlertRuleResource.cs b/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/src/Generated/AlertRuleResource.cs new file mode 100644 index 000000000000..fd418580c368 --- /dev/null +++ b/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/src/Generated/AlertRuleResource.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.DatabaseWatcher +{ + /// + /// A Class representing an AlertRuleResource 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 GetAlertRuleResource method. + /// Otherwise you can get one from its parent resource using the GetAlertRuleResource method. + /// + public partial class AlertRuleResource : ArmResource + { + /// Generate the resource identifier of a instance. + /// The subscriptionId. + /// The resourceGroupName. + /// The watcherName. + /// The alertRuleResourceName. + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string watcherName, string alertRuleResourceName) + { + var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseWatcher/watchers/{watcherName}/alertRuleResources/{alertRuleResourceName}"; + return new ResourceIdentifier(resourceId); + } + + private readonly ClientDiagnostics _alertRuleResourceClientDiagnostics; + private readonly AlertRuleResourcesRestOperations _alertRuleResourceRestClient; + private readonly AlertRuleResourceData _data; + + /// Gets the resource type for the operations. + public static readonly ResourceType ResourceType = "Microsoft.DatabaseWatcher/watchers/alertRuleResources"; + + /// Initializes a new instance of the class for mocking. + protected AlertRuleResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal AlertRuleResource(ArmClient client, AlertRuleResourceData 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 AlertRuleResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _alertRuleResourceClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.DatabaseWatcher", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string alertRuleResourceApiVersion); + _alertRuleResourceRestClient = new AlertRuleResourcesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, alertRuleResourceApiVersion); +#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 AlertRuleResourceData 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 AlertRuleResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseWatcher/watchers/{watcherName}/alertRuleResources/{alertRuleResourceName} + /// + /// + /// Operation Id + /// AlertRuleResource_Get + /// + /// + /// Default Api Version + /// 2025-01-02 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _alertRuleResourceClientDiagnostics.CreateScope("AlertRuleResource.Get"); + scope.Start(); + try + { + var response = await _alertRuleResourceRestClient.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 AlertRuleResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a AlertRuleResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseWatcher/watchers/{watcherName}/alertRuleResources/{alertRuleResourceName} + /// + /// + /// Operation Id + /// AlertRuleResource_Get + /// + /// + /// Default Api Version + /// 2025-01-02 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _alertRuleResourceClientDiagnostics.CreateScope("AlertRuleResource.Get"); + scope.Start(); + try + { + var response = _alertRuleResourceRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new AlertRuleResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Delete a AlertRuleResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseWatcher/watchers/{watcherName}/alertRuleResources/{alertRuleResourceName} + /// + /// + /// Operation Id + /// AlertRuleResource_Delete + /// + /// + /// Default Api Version + /// 2025-01-02 + /// + /// + /// 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 = _alertRuleResourceClientDiagnostics.CreateScope("AlertRuleResource.Delete"); + scope.Start(); + try + { + var response = await _alertRuleResourceRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + var uri = _alertRuleResourceRestClient.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 DatabaseWatcherArmOperation(response, rehydrationToken); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Delete a AlertRuleResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseWatcher/watchers/{watcherName}/alertRuleResources/{alertRuleResourceName} + /// + /// + /// Operation Id + /// AlertRuleResource_Delete + /// + /// + /// Default Api Version + /// 2025-01-02 + /// + /// + /// 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 = _alertRuleResourceClientDiagnostics.CreateScope("AlertRuleResource.Delete"); + scope.Start(); + try + { + var response = _alertRuleResourceRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + var uri = _alertRuleResourceRestClient.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 DatabaseWatcherArmOperation(response, rehydrationToken); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletionResponse(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Create a AlertRuleResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseWatcher/watchers/{watcherName}/alertRuleResources/{alertRuleResourceName} + /// + /// + /// Operation Id + /// AlertRuleResource_CreateOrUpdate + /// + /// + /// Default Api Version + /// 2025-01-02 + /// + /// + /// 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, AlertRuleResourceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _alertRuleResourceClientDiagnostics.CreateScope("AlertRuleResource.Update"); + scope.Start(); + try + { + var response = await _alertRuleResourceRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, cancellationToken).ConfigureAwait(false); + var uri = _alertRuleResourceRestClient.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 DatabaseWatcherArmOperation(Response.FromValue(new AlertRuleResource(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 AlertRuleResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseWatcher/watchers/{watcherName}/alertRuleResources/{alertRuleResourceName} + /// + /// + /// Operation Id + /// AlertRuleResource_CreateOrUpdate + /// + /// + /// Default Api Version + /// 2025-01-02 + /// + /// + /// 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, AlertRuleResourceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _alertRuleResourceClientDiagnostics.CreateScope("AlertRuleResource.Update"); + scope.Start(); + try + { + var response = _alertRuleResourceRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, cancellationToken); + var uri = _alertRuleResourceRestClient.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 DatabaseWatcherArmOperation(Response.FromValue(new AlertRuleResource(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/databasewatcher/Azure.ResourceManager.DatabaseWatcher/src/Generated/AlertRuleResourceCollection.cs b/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/src/Generated/AlertRuleResourceCollection.cs new file mode 100644 index 000000000000..de00e95cf4cb --- /dev/null +++ b/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/src/Generated/AlertRuleResourceCollection.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.DatabaseWatcher +{ + /// + /// 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 GetAlertRuleResources method from an instance of . + /// + public partial class AlertRuleResourceCollection : ArmCollection, IEnumerable, IAsyncEnumerable + { + private readonly ClientDiagnostics _alertRuleResourceClientDiagnostics; + private readonly AlertRuleResourcesRestOperations _alertRuleResourceRestClient; + + /// Initializes a new instance of the class for mocking. + protected AlertRuleResourceCollection() + { + } + + /// 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 AlertRuleResourceCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _alertRuleResourceClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.DatabaseWatcher", AlertRuleResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(AlertRuleResource.ResourceType, out string alertRuleResourceApiVersion); + _alertRuleResourceRestClient = new AlertRuleResourcesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, alertRuleResourceApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != WatcherResource.ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, WatcherResource.ResourceType), nameof(id)); + } + + /// + /// Create a AlertRuleResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseWatcher/watchers/{watcherName}/alertRuleResources/{alertRuleResourceName} + /// + /// + /// Operation Id + /// AlertRuleResource_CreateOrUpdate + /// + /// + /// Default Api Version + /// 2025-01-02 + /// + /// + /// 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 alert rule proxy resource name. + /// 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 alertRuleResourceName, AlertRuleResourceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(alertRuleResourceName, nameof(alertRuleResourceName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _alertRuleResourceClientDiagnostics.CreateScope("AlertRuleResourceCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = await _alertRuleResourceRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, alertRuleResourceName, data, cancellationToken).ConfigureAwait(false); + var uri = _alertRuleResourceRestClient.CreateCreateOrUpdateRequestUri(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, alertRuleResourceName, data); + var rehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(RequestMethod.Put, uri.ToUri(), uri.ToString(), "None", null, OperationFinalStateVia.OriginalUri.ToString()); + var operation = new DatabaseWatcherArmOperation(Response.FromValue(new AlertRuleResource(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 AlertRuleResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseWatcher/watchers/{watcherName}/alertRuleResources/{alertRuleResourceName} + /// + /// + /// Operation Id + /// AlertRuleResource_CreateOrUpdate + /// + /// + /// Default Api Version + /// 2025-01-02 + /// + /// + /// 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 alert rule proxy resource name. + /// 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 alertRuleResourceName, AlertRuleResourceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(alertRuleResourceName, nameof(alertRuleResourceName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _alertRuleResourceClientDiagnostics.CreateScope("AlertRuleResourceCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = _alertRuleResourceRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, alertRuleResourceName, data, cancellationToken); + var uri = _alertRuleResourceRestClient.CreateCreateOrUpdateRequestUri(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, alertRuleResourceName, data); + var rehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(RequestMethod.Put, uri.ToUri(), uri.ToString(), "None", null, OperationFinalStateVia.OriginalUri.ToString()); + var operation = new DatabaseWatcherArmOperation(Response.FromValue(new AlertRuleResource(Client, response), response.GetRawResponse()), rehydrationToken); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a AlertRuleResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseWatcher/watchers/{watcherName}/alertRuleResources/{alertRuleResourceName} + /// + /// + /// Operation Id + /// AlertRuleResource_Get + /// + /// + /// Default Api Version + /// 2025-01-02 + /// + /// + /// Resource + /// + /// + /// + /// + /// The alert rule proxy resource name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetAsync(string alertRuleResourceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(alertRuleResourceName, nameof(alertRuleResourceName)); + + using var scope = _alertRuleResourceClientDiagnostics.CreateScope("AlertRuleResourceCollection.Get"); + scope.Start(); + try + { + var response = await _alertRuleResourceRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, alertRuleResourceName, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new AlertRuleResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a AlertRuleResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseWatcher/watchers/{watcherName}/alertRuleResources/{alertRuleResourceName} + /// + /// + /// Operation Id + /// AlertRuleResource_Get + /// + /// + /// Default Api Version + /// 2025-01-02 + /// + /// + /// Resource + /// + /// + /// + /// + /// The alert rule proxy resource name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Get(string alertRuleResourceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(alertRuleResourceName, nameof(alertRuleResourceName)); + + using var scope = _alertRuleResourceClientDiagnostics.CreateScope("AlertRuleResourceCollection.Get"); + scope.Start(); + try + { + var response = _alertRuleResourceRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, alertRuleResourceName, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new AlertRuleResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// List AlertRuleResource resources by Watcher + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseWatcher/watchers/{watcherName}/alertRuleResources + /// + /// + /// Operation Id + /// AlertRuleResource_ListByParent + /// + /// + /// Default Api Version + /// 2025-01-02 + /// + /// + /// 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) => _alertRuleResourceRestClient.CreateListByParentRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _alertRuleResourceRestClient.CreateListByParentNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new AlertRuleResource(Client, AlertRuleResourceData.DeserializeAlertRuleResourceData(e)), _alertRuleResourceClientDiagnostics, Pipeline, "AlertRuleResourceCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// List AlertRuleResource resources by Watcher + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseWatcher/watchers/{watcherName}/alertRuleResources + /// + /// + /// Operation Id + /// AlertRuleResource_ListByParent + /// + /// + /// Default Api Version + /// 2025-01-02 + /// + /// + /// 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) => _alertRuleResourceRestClient.CreateListByParentRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _alertRuleResourceRestClient.CreateListByParentNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new AlertRuleResource(Client, AlertRuleResourceData.DeserializeAlertRuleResourceData(e)), _alertRuleResourceClientDiagnostics, Pipeline, "AlertRuleResourceCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseWatcher/watchers/{watcherName}/alertRuleResources/{alertRuleResourceName} + /// + /// + /// Operation Id + /// AlertRuleResource_Get + /// + /// + /// Default Api Version + /// 2025-01-02 + /// + /// + /// Resource + /// + /// + /// + /// + /// The alert rule proxy resource name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> ExistsAsync(string alertRuleResourceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(alertRuleResourceName, nameof(alertRuleResourceName)); + + using var scope = _alertRuleResourceClientDiagnostics.CreateScope("AlertRuleResourceCollection.Exists"); + scope.Start(); + try + { + var response = await _alertRuleResourceRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, alertRuleResourceName, 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.DatabaseWatcher/watchers/{watcherName}/alertRuleResources/{alertRuleResourceName} + /// + /// + /// Operation Id + /// AlertRuleResource_Get + /// + /// + /// Default Api Version + /// 2025-01-02 + /// + /// + /// Resource + /// + /// + /// + /// + /// The alert rule proxy resource name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Exists(string alertRuleResourceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(alertRuleResourceName, nameof(alertRuleResourceName)); + + using var scope = _alertRuleResourceClientDiagnostics.CreateScope("AlertRuleResourceCollection.Exists"); + scope.Start(); + try + { + var response = _alertRuleResourceRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, alertRuleResourceName, 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.DatabaseWatcher/watchers/{watcherName}/alertRuleResources/{alertRuleResourceName} + /// + /// + /// Operation Id + /// AlertRuleResource_Get + /// + /// + /// Default Api Version + /// 2025-01-02 + /// + /// + /// Resource + /// + /// + /// + /// + /// The alert rule proxy resource name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetIfExistsAsync(string alertRuleResourceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(alertRuleResourceName, nameof(alertRuleResourceName)); + + using var scope = _alertRuleResourceClientDiagnostics.CreateScope("AlertRuleResourceCollection.GetIfExists"); + scope.Start(); + try + { + var response = await _alertRuleResourceRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, alertRuleResourceName, cancellationToken: cancellationToken).ConfigureAwait(false); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new AlertRuleResource(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.DatabaseWatcher/watchers/{watcherName}/alertRuleResources/{alertRuleResourceName} + /// + /// + /// Operation Id + /// AlertRuleResource_Get + /// + /// + /// Default Api Version + /// 2025-01-02 + /// + /// + /// Resource + /// + /// + /// + /// + /// The alert rule proxy resource name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual NullableResponse GetIfExists(string alertRuleResourceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(alertRuleResourceName, nameof(alertRuleResourceName)); + + using var scope = _alertRuleResourceClientDiagnostics.CreateScope("AlertRuleResourceCollection.GetIfExists"); + scope.Start(); + try + { + var response = _alertRuleResourceRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, alertRuleResourceName, cancellationToken: cancellationToken); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new AlertRuleResource(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/databasewatcher/Azure.ResourceManager.DatabaseWatcher/src/Generated/AlertRuleResourceData.Serialization.cs b/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/src/Generated/AlertRuleResourceData.Serialization.cs new file mode 100644 index 000000000000..080c88758721 --- /dev/null +++ b/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/src/Generated/AlertRuleResourceData.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.DatabaseWatcher.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.DatabaseWatcher +{ + public partial class AlertRuleResourceData : 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(AlertRuleResourceData)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (Optional.IsDefined(Properties)) + { + writer.WritePropertyName("properties"u8); + writer.WriteObjectValue(Properties, options); + } + } + + AlertRuleResourceData 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(AlertRuleResourceData)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAlertRuleResourceData(document.RootElement, options); + } + + internal static AlertRuleResourceData DeserializeAlertRuleResourceData(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + AlertRuleResourceProperties 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 = AlertRuleResourceProperties.DeserializeAlertRuleResourceProperties(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 AlertRuleResourceData( + 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(AlertRuleResourceData)} does not support writing '{options.Format}' format."); + } + } + + AlertRuleResourceData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeAlertRuleResourceData(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(AlertRuleResourceData)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/src/Generated/AlertRuleResourceData.cs b/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/src/Generated/AlertRuleResourceData.cs new file mode 100644 index 000000000000..496720664a3a --- /dev/null +++ b/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/src/Generated/AlertRuleResourceData.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.DatabaseWatcher.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.DatabaseWatcher +{ + /// + /// A class representing the AlertRuleResource data model. + /// Concrete proxy resource types can be created by aliasing this type using a specific property type. + /// + public partial class AlertRuleResourceData : 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 AlertRuleResourceData() + { + } + + /// 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 AlertRuleResourceData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, AlertRuleResourceProperties properties, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) + { + Properties = properties; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The resource-specific properties for this resource. + public AlertRuleResourceProperties Properties { get; set; } + } +} diff --git a/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/src/Generated/ArmDatabaseWatcherModelFactory.cs b/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/src/Generated/ArmDatabaseWatcherModelFactory.cs new file mode 100644 index 000000000000..338627741f12 --- /dev/null +++ b/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/src/Generated/ArmDatabaseWatcherModelFactory.cs @@ -0,0 +1,312 @@ +// 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.DatabaseWatcher.Models +{ + /// Model factory for models. + public static partial class ArmDatabaseWatcherModelFactory + { + /// 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 SharedPrivateLinkResourceData SharedPrivateLinkResourceData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, SharedPrivateLinkResourceProperties properties = null) + { + return new SharedPrivateLinkResourceData( + id, + name, + resourceType, + systemData, + properties, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The resource ID of the resource the shared private link resource is for. + /// The group id from the provider of resource the shared private link resource is for. + /// The request message for requesting approval of the shared private link resource. + /// The DNS zone segment to be included in the DNS name of the shared private link. Value is required for Azure Data Explorer clusters and SQL managed instances, and must be omitted for SQL logical servers and key vaults. The value is the second segment of the host FQDN name of the resource that the shared private link resource is for. For example: if the host name is 'adx-cluster-21187695.eastus.kusto.windows.net', then the value is 'eastus'; if the host name is 'sql-mi-23961134.767d5869f605.database.windows.net', then the value is '767d5869f605'. + /// Status of the shared private link resource. Can be Pending, Approved, Rejected or Disconnected. + /// The provisioning state of the resource. + /// A new instance for mocking. + public static SharedPrivateLinkResourceProperties SharedPrivateLinkResourceProperties(ResourceIdentifier privateLinkResourceId = null, string groupId = null, string requestMessage = null, string dnsZone = null, SharedPrivateLinkResourceStatus? status = null, ResourceProvisioningState? provisioningState = null) + { + return new SharedPrivateLinkResourceProperties( + privateLinkResourceId, + groupId, + requestMessage, + dnsZone, + status, + provisioningState, + 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 TargetData TargetData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, TargetProperties properties = null) + { + return new TargetData( + id, + name, + resourceType, + systemData, + properties, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Discriminator property for TargetProperties. + /// The type of authentication to use when connecting to a target. + /// To use SQL authentication when connecting to targets, specify the vault where the login name and password secrets are stored. + /// The FQDN host name of the server to use in the connection string when connecting to a target. For example, for an Azure SQL logical server in the Azure commercial cloud, the value might be 'sql-logical-server-22092780.database.windows.net'; for an Azure SQL managed instance in the Azure commercial cloud, the value might be 'sql-mi-39441134.767d5869f605.database.windows.net'. Port number and instance name must be specified separately. + /// The provisioning state of the resource. + /// A new instance for mocking. + public static TargetProperties TargetProperties(string targetType = null, TargetAuthenticationType targetAuthenticationType = default, VaultSecret targetVault = null, string connectionServerName = null, ResourceProvisioningState? provisioningState = null) + { + return new UnknownTargetProperties( + targetType, + targetAuthenticationType, + targetVault, + connectionServerName, + provisioningState, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The type of authentication to use when connecting to a target. + /// To use SQL authentication when connecting to targets, specify the vault where the login name and password secrets are stored. + /// The FQDN host name of the server to use in the connection string when connecting to a target. For example, for an Azure SQL logical server in the Azure commercial cloud, the value might be 'sql-logical-server-22092780.database.windows.net'; for an Azure SQL managed instance in the Azure commercial cloud, the value might be 'sql-mi-39441134.767d5869f605.database.windows.net'. Port number and instance name must be specified separately. + /// The provisioning state of the resource. + /// The Azure resource ID of an Azure SQL DB database target. + /// Set to true to monitor a high availability replica of specified target, if any. + /// A new instance for mocking. + public static SqlDbSingleDatabaseTargetProperties SqlDbSingleDatabaseTargetProperties(TargetAuthenticationType targetAuthenticationType = default, VaultSecret targetVault = null, string connectionServerName = null, ResourceProvisioningState? provisioningState = null, ResourceIdentifier sqlDbResourceId = null, bool? readIntent = null) + { + return new SqlDbSingleDatabaseTargetProperties( + "SqlDb", + targetAuthenticationType, + targetVault, + connectionServerName, + provisioningState, + serializedAdditionalRawData: null, + sqlDbResourceId, + readIntent); + } + + /// Initializes a new instance of . + /// The type of authentication to use when connecting to a target. + /// To use SQL authentication when connecting to targets, specify the vault where the login name and password secrets are stored. + /// The FQDN host name of the server to use in the connection string when connecting to a target. For example, for an Azure SQL logical server in the Azure commercial cloud, the value might be 'sql-logical-server-22092780.database.windows.net'; for an Azure SQL managed instance in the Azure commercial cloud, the value might be 'sql-mi-39441134.767d5869f605.database.windows.net'. Port number and instance name must be specified separately. + /// The provisioning state of the resource. + /// The Azure resource ID of an Azure SQL DB elastic pool target. + /// The Azure resource ID of the anchor database used to connect to an elastic pool. + /// Set to true to monitor a high availability replica of specified target, if any. + /// A new instance for mocking. + public static SqlDbElasticPoolTargetProperties SqlDbElasticPoolTargetProperties(TargetAuthenticationType targetAuthenticationType = default, VaultSecret targetVault = null, string connectionServerName = null, ResourceProvisioningState? provisioningState = null, ResourceIdentifier sqlEpResourceId = null, ResourceIdentifier anchorDatabaseResourceId = null, bool? readIntent = null) + { + return new SqlDbElasticPoolTargetProperties( + "SqlEp", + targetAuthenticationType, + targetVault, + connectionServerName, + provisioningState, + serializedAdditionalRawData: null, + sqlEpResourceId, + anchorDatabaseResourceId, + readIntent); + } + + /// Initializes a new instance of . + /// The type of authentication to use when connecting to a target. + /// To use SQL authentication when connecting to targets, specify the vault where the login name and password secrets are stored. + /// The FQDN host name of the server to use in the connection string when connecting to a target. For example, for an Azure SQL logical server in the Azure commercial cloud, the value might be 'sql-logical-server-22092780.database.windows.net'; for an Azure SQL managed instance in the Azure commercial cloud, the value might be 'sql-mi-39441134.767d5869f605.database.windows.net'. Port number and instance name must be specified separately. + /// The provisioning state of the resource. + /// The Azure resource ID of an Azure SQL Managed Instance target. + /// The TCP port number to optionally use in the connection string when connecting to an Azure SQL Managed Instance target. + /// Set to true to monitor a high availability replica of specified target, if any. + /// A new instance for mocking. + public static SqlMiTargetProperties SqlMiTargetProperties(TargetAuthenticationType targetAuthenticationType = default, VaultSecret targetVault = null, string connectionServerName = null, ResourceProvisioningState? provisioningState = null, ResourceIdentifier sqlMiResourceId = null, int? connectionTcpPort = null, bool? readIntent = null) + { + return new SqlMiTargetProperties( + "SqlMi", + targetAuthenticationType, + targetVault, + connectionServerName, + provisioningState, + serializedAdditionalRawData: null, + sqlMiResourceId, + connectionTcpPort, + readIntent); + } + + /// 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 HealthValidationData HealthValidationData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, HealthValidationProperties properties = null) + { + return new HealthValidationData( + id, + name, + resourceType, + systemData, + properties, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The start time of health validation, in UTC. + /// The end time of health validation, in UTC. + /// The current health validation status. + /// The list of issues found by health validation. + /// The provisioning state of the health validation resource. + /// A new instance for mocking. + public static HealthValidationProperties HealthValidationProperties(DateTimeOffset startOn = default, DateTimeOffset endOn = default, ValidationStatus status = default, IEnumerable issues = null, ResourceProvisioningState? provisioningState = null) + { + issues ??= new List(); + + return new HealthValidationProperties( + startOn, + endOn, + status, + issues?.ToList(), + provisioningState, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The error code of the issue. + /// The error message of the issue. + /// The additional details for the issue. + /// The recommendation for resolving the issue. + /// The URL related to resolving the issue. + /// The resource ID of the Azure resource related to the issue. + /// The type of the Azure resource related to the issue. + /// A new instance for mocking. + public static ValidationIssue ValidationIssue(string errorCode = null, string errorMessage = null, string additionalDetails = null, string recommendationMessage = null, Uri recommendationUri = null, ResourceIdentifier relatedResourceId = null, string relatedResourceType = null) + { + return new ValidationIssue( + errorCode, + errorMessage, + additionalDetails, + recommendationMessage, + recommendationUri, + relatedResourceId, + relatedResourceType, + 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 AlertRuleResourceData AlertRuleResourceData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, AlertRuleResourceProperties properties = null) + { + return new AlertRuleResourceData( + id, + name, + resourceType, + systemData, + properties, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The resource ID of the alert rule resource. + /// The properties with which the alert rule resource was created. + /// The creation time of the alert rule resource. + /// The provisioning state of the alert rule resource. + /// The template ID associated with alert rule resource. + /// The alert rule template version. + /// A new instance for mocking. + public static AlertRuleResourceProperties AlertRuleResourceProperties(ResourceIdentifier alertRuleResourceId = null, AlertRuleCreationProperty createdWithProperties = default, DateTimeOffset createdOn = default, ResourceProvisioningState? provisioningState = null, string alertRuleTemplateId = null, string alertRuleTemplateVersion = null) + { + return new AlertRuleResourceProperties( + alertRuleResourceId, + createdWithProperties, + createdOn, + provisioningState, + alertRuleTemplateId, + alertRuleTemplateVersion, + serializedAdditionalRawData: null); + } + + /// 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 WatcherData WatcherData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, WatcherProperties properties = null, ManagedServiceIdentityV4 identity = null) + { + tags ??= new Dictionary(); + + return new WatcherData( + id, + name, + resourceType, + systemData, + tags, + location, + properties, + identity, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The data store for collected monitoring data. + /// The monitoring collection status of the watcher. + /// The provisioning state of the resource watcher. + /// The resource ID of a user-assigned managed identity that will be assigned to a new alert rule. + /// A new instance for mocking. + public static WatcherProperties WatcherProperties(Datastore datastore = null, WatcherStatus? status = null, DatabaseWatcherProvisioningState? provisioningState = null, ResourceIdentifier defaultAlertRuleIdentityResourceId = null) + { + return new WatcherProperties(datastore, status, provisioningState, defaultAlertRuleIdentityResourceId, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The service principal ID of the system assigned identity. This property will only be provided for a system assigned identity. + /// The tenant ID of the system assigned identity. This property will only be provided for a system assigned identity. + /// The type of managed identity assigned to this resource. + /// The identities assigned to this resource by the user. + /// A new instance for mocking. + public static ManagedServiceIdentityV4 ManagedServiceIdentityV4(Guid? principalId = null, Guid? tenantId = null, ManagedServiceIdentityType type = default, IDictionary userAssignedIdentities = null) + { + userAssignedIdentities ??= new Dictionary(); + + return new ManagedServiceIdentityV4(principalId, tenantId, type, userAssignedIdentities, serializedAdditionalRawData: null); + } + } +} diff --git a/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/src/Generated/Extensions/DatabaseWatcherExtensions.cs b/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/src/Generated/Extensions/DatabaseWatcherExtensions.cs new file mode 100644 index 000000000000..6e392bbd6658 --- /dev/null +++ b/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/src/Generated/Extensions/DatabaseWatcherExtensions.cs @@ -0,0 +1,295 @@ +// 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.DatabaseWatcher.Mocking; +using Azure.ResourceManager.Resources; + +namespace Azure.ResourceManager.DatabaseWatcher +{ + /// A class to add extension methods to Azure.ResourceManager.DatabaseWatcher. + public static partial class DatabaseWatcherExtensions + { + private static MockableDatabaseWatcherArmClient GetMockableDatabaseWatcherArmClient(ArmClient client) + { + return client.GetCachedClient(client0 => new MockableDatabaseWatcherArmClient(client0)); + } + + private static MockableDatabaseWatcherResourceGroupResource GetMockableDatabaseWatcherResourceGroupResource(ArmResource resource) + { + return resource.GetCachedClient(client => new MockableDatabaseWatcherResourceGroupResource(client, resource.Id)); + } + + private static MockableDatabaseWatcherSubscriptionResource GetMockableDatabaseWatcherSubscriptionResource(ArmResource resource) + { + return resource.GetCachedClient(client => new MockableDatabaseWatcherSubscriptionResource(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 WatcherResource GetWatcherResource(this ArmClient client, ResourceIdentifier id) + { + Argument.AssertNotNull(client, nameof(client)); + + return GetMockableDatabaseWatcherArmClient(client).GetWatcherResource(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 AlertRuleResource GetAlertRuleResource(this ArmClient client, ResourceIdentifier id) + { + Argument.AssertNotNull(client, nameof(client)); + + return GetMockableDatabaseWatcherArmClient(client).GetAlertRuleResource(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 HealthValidationResource GetHealthValidationResource(this ArmClient client, ResourceIdentifier id) + { + Argument.AssertNotNull(client, nameof(client)); + + return GetMockableDatabaseWatcherArmClient(client).GetHealthValidationResource(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 TargetResource GetTargetResource(this ArmClient client, ResourceIdentifier id) + { + Argument.AssertNotNull(client, nameof(client)); + + return GetMockableDatabaseWatcherArmClient(client).GetTargetResource(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 SharedPrivateLinkResource GetSharedPrivateLinkResource(this ArmClient client, ResourceIdentifier id) + { + Argument.AssertNotNull(client, nameof(client)); + + return GetMockableDatabaseWatcherArmClient(client).GetSharedPrivateLinkResource(id); + } + + /// + /// Gets a collection of WatcherResources 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 WatcherResources and their operations over a WatcherResource. + public static WatcherCollection GetWatchers(this ResourceGroupResource resourceGroupResource) + { + Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource)); + + return GetMockableDatabaseWatcherResourceGroupResource(resourceGroupResource).GetWatchers(); + } + + /// + /// Get a Watcher + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseWatcher/watchers/{watcherName} + /// + /// + /// Operation Id + /// Watcher_Get + /// + /// + /// Default Api Version + /// 2025-01-02 + /// + /// + /// Resource + /// + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The database watcher name. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public static async Task> GetWatcherAsync(this ResourceGroupResource resourceGroupResource, string watcherName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource)); + + return await GetMockableDatabaseWatcherResourceGroupResource(resourceGroupResource).GetWatcherAsync(watcherName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get a Watcher + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseWatcher/watchers/{watcherName} + /// + /// + /// Operation Id + /// Watcher_Get + /// + /// + /// Default Api Version + /// 2025-01-02 + /// + /// + /// Resource + /// + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The database watcher name. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public static Response GetWatcher(this ResourceGroupResource resourceGroupResource, string watcherName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource)); + + return GetMockableDatabaseWatcherResourceGroupResource(resourceGroupResource).GetWatcher(watcherName, cancellationToken); + } + + /// + /// List Watcher resources by subscription ID + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.DatabaseWatcher/watchers + /// + /// + /// Operation Id + /// Watcher_ListBySubscription + /// + /// + /// Default Api Version + /// 2025-01-02 + /// + /// + /// 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 GetWatchersAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); + + return GetMockableDatabaseWatcherSubscriptionResource(subscriptionResource).GetWatchersAsync(cancellationToken); + } + + /// + /// List Watcher resources by subscription ID + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.DatabaseWatcher/watchers + /// + /// + /// Operation Id + /// Watcher_ListBySubscription + /// + /// + /// Default Api Version + /// 2025-01-02 + /// + /// + /// 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 GetWatchers(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); + + return GetMockableDatabaseWatcherSubscriptionResource(subscriptionResource).GetWatchers(cancellationToken); + } + } +} diff --git a/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/src/Generated/Extensions/MockableDatabaseWatcherArmClient.cs b/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/src/Generated/Extensions/MockableDatabaseWatcherArmClient.cs new file mode 100644 index 000000000000..43c0fc1c282d --- /dev/null +++ b/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/src/Generated/Extensions/MockableDatabaseWatcherArmClient.cs @@ -0,0 +1,97 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using Azure.Core; + +namespace Azure.ResourceManager.DatabaseWatcher.Mocking +{ + /// A class to add extension methods to ArmClient. + public partial class MockableDatabaseWatcherArmClient : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected MockableDatabaseWatcherArmClient() + { + } + + /// 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 MockableDatabaseWatcherArmClient(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + internal MockableDatabaseWatcherArmClient(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 WatcherResource GetWatcherResource(ResourceIdentifier id) + { + WatcherResource.ValidateResourceId(id); + return new WatcherResource(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 AlertRuleResource GetAlertRuleResource(ResourceIdentifier id) + { + AlertRuleResource.ValidateResourceId(id); + return new AlertRuleResource(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 HealthValidationResource GetHealthValidationResource(ResourceIdentifier id) + { + HealthValidationResource.ValidateResourceId(id); + return new HealthValidationResource(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 TargetResource GetTargetResource(ResourceIdentifier id) + { + TargetResource.ValidateResourceId(id); + return new TargetResource(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 SharedPrivateLinkResource GetSharedPrivateLinkResource(ResourceIdentifier id) + { + SharedPrivateLinkResource.ValidateResourceId(id); + return new SharedPrivateLinkResource(Client, id); + } + } +} diff --git a/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/src/Generated/Extensions/MockableDatabaseWatcherResourceGroupResource.cs b/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/src/Generated/Extensions/MockableDatabaseWatcherResourceGroupResource.cs new file mode 100644 index 000000000000..9efa41ebf78d --- /dev/null +++ b/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/src/Generated/Extensions/MockableDatabaseWatcherResourceGroupResource.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.DatabaseWatcher.Mocking +{ + /// A class to add extension methods to ResourceGroupResource. + public partial class MockableDatabaseWatcherResourceGroupResource : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected MockableDatabaseWatcherResourceGroupResource() + { + } + + /// 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 MockableDatabaseWatcherResourceGroupResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// Gets a collection of WatcherResources in the ResourceGroupResource. + /// An object representing collection of WatcherResources and their operations over a WatcherResource. + public virtual WatcherCollection GetWatchers() + { + return GetCachedClient(client => new WatcherCollection(client, Id)); + } + + /// + /// Get a Watcher + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseWatcher/watchers/{watcherName} + /// + /// + /// Operation Id + /// Watcher_Get + /// + /// + /// Default Api Version + /// 2025-01-02 + /// + /// + /// Resource + /// + /// + /// + /// + /// The database watcher name. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetWatcherAsync(string watcherName, CancellationToken cancellationToken = default) + { + return await GetWatchers().GetAsync(watcherName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get a Watcher + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseWatcher/watchers/{watcherName} + /// + /// + /// Operation Id + /// Watcher_Get + /// + /// + /// Default Api Version + /// 2025-01-02 + /// + /// + /// Resource + /// + /// + /// + /// + /// The database watcher name. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetWatcher(string watcherName, CancellationToken cancellationToken = default) + { + return GetWatchers().Get(watcherName, cancellationToken); + } + } +} diff --git a/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/src/Generated/Extensions/MockableDatabaseWatcherSubscriptionResource.cs b/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/src/Generated/Extensions/MockableDatabaseWatcherSubscriptionResource.cs new file mode 100644 index 000000000000..9b9e305ea5a0 --- /dev/null +++ b/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/src/Generated/Extensions/MockableDatabaseWatcherSubscriptionResource.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.DatabaseWatcher.Mocking +{ + /// A class to add extension methods to SubscriptionResource. + public partial class MockableDatabaseWatcherSubscriptionResource : ArmResource + { + private ClientDiagnostics _watcherClientDiagnostics; + private WatchersRestOperations _watcherRestClient; + + /// Initializes a new instance of the class for mocking. + protected MockableDatabaseWatcherSubscriptionResource() + { + } + + /// 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 MockableDatabaseWatcherSubscriptionResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + private ClientDiagnostics WatcherClientDiagnostics => _watcherClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.DatabaseWatcher", WatcherResource.ResourceType.Namespace, Diagnostics); + private WatchersRestOperations WatcherRestClient => _watcherRestClient ??= new WatchersRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, GetApiVersionOrNull(WatcherResource.ResourceType)); + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// + /// List Watcher resources by subscription ID + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.DatabaseWatcher/watchers + /// + /// + /// Operation Id + /// Watcher_ListBySubscription + /// + /// + /// Default Api Version + /// 2025-01-02 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetWatchersAsync(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => WatcherRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => WatcherRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new WatcherResource(Client, WatcherData.DeserializeWatcherData(e)), WatcherClientDiagnostics, Pipeline, "MockableDatabaseWatcherSubscriptionResource.GetWatchers", "value", "nextLink", cancellationToken); + } + + /// + /// List Watcher resources by subscription ID + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.DatabaseWatcher/watchers + /// + /// + /// Operation Id + /// Watcher_ListBySubscription + /// + /// + /// Default Api Version + /// 2025-01-02 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetWatchers(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => WatcherRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => WatcherRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new WatcherResource(Client, WatcherData.DeserializeWatcherData(e)), WatcherClientDiagnostics, Pipeline, "MockableDatabaseWatcherSubscriptionResource.GetWatchers", "value", "nextLink", cancellationToken); + } + } +} diff --git a/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/src/Generated/HealthValidationCollection.cs b/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/src/Generated/HealthValidationCollection.cs new file mode 100644 index 000000000000..b9af214f6894 --- /dev/null +++ b/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/src/Generated/HealthValidationCollection.cs @@ -0,0 +1,395 @@ +// 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.DatabaseWatcher +{ + /// + /// 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 GetHealthValidations method from an instance of . + /// + public partial class HealthValidationCollection : ArmCollection, IEnumerable, IAsyncEnumerable + { + private readonly ClientDiagnostics _healthValidationClientDiagnostics; + private readonly HealthValidationsRestOperations _healthValidationRestClient; + + /// Initializes a new instance of the class for mocking. + protected HealthValidationCollection() + { + } + + /// 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 HealthValidationCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _healthValidationClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.DatabaseWatcher", HealthValidationResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(HealthValidationResource.ResourceType, out string healthValidationApiVersion); + _healthValidationRestClient = new HealthValidationsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, healthValidationApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != WatcherResource.ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, WatcherResource.ResourceType), nameof(id)); + } + + /// + /// Get a HealthValidation + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseWatcher/watchers/{watcherName}/healthValidations/{healthValidationName} + /// + /// + /// Operation Id + /// HealthValidation_Get + /// + /// + /// Default Api Version + /// 2025-01-02 + /// + /// + /// Resource + /// + /// + /// + /// + /// The health validation resource name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetAsync(string healthValidationName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(healthValidationName, nameof(healthValidationName)); + + using var scope = _healthValidationClientDiagnostics.CreateScope("HealthValidationCollection.Get"); + scope.Start(); + try + { + var response = await _healthValidationRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, healthValidationName, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new HealthValidationResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a HealthValidation + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseWatcher/watchers/{watcherName}/healthValidations/{healthValidationName} + /// + /// + /// Operation Id + /// HealthValidation_Get + /// + /// + /// Default Api Version + /// 2025-01-02 + /// + /// + /// Resource + /// + /// + /// + /// + /// The health validation resource name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Get(string healthValidationName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(healthValidationName, nameof(healthValidationName)); + + using var scope = _healthValidationClientDiagnostics.CreateScope("HealthValidationCollection.Get"); + scope.Start(); + try + { + var response = _healthValidationRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, healthValidationName, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new HealthValidationResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// List HealthValidation resources by Watcher + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseWatcher/watchers/{watcherName}/healthValidations + /// + /// + /// Operation Id + /// HealthValidation_ListByParent + /// + /// + /// Default Api Version + /// 2025-01-02 + /// + /// + /// 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) => _healthValidationRestClient.CreateListByParentRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _healthValidationRestClient.CreateListByParentNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new HealthValidationResource(Client, HealthValidationData.DeserializeHealthValidationData(e)), _healthValidationClientDiagnostics, Pipeline, "HealthValidationCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// List HealthValidation resources by Watcher + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseWatcher/watchers/{watcherName}/healthValidations + /// + /// + /// Operation Id + /// HealthValidation_ListByParent + /// + /// + /// Default Api Version + /// 2025-01-02 + /// + /// + /// 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) => _healthValidationRestClient.CreateListByParentRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _healthValidationRestClient.CreateListByParentNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new HealthValidationResource(Client, HealthValidationData.DeserializeHealthValidationData(e)), _healthValidationClientDiagnostics, Pipeline, "HealthValidationCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseWatcher/watchers/{watcherName}/healthValidations/{healthValidationName} + /// + /// + /// Operation Id + /// HealthValidation_Get + /// + /// + /// Default Api Version + /// 2025-01-02 + /// + /// + /// Resource + /// + /// + /// + /// + /// The health validation resource name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> ExistsAsync(string healthValidationName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(healthValidationName, nameof(healthValidationName)); + + using var scope = _healthValidationClientDiagnostics.CreateScope("HealthValidationCollection.Exists"); + scope.Start(); + try + { + var response = await _healthValidationRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, healthValidationName, 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.DatabaseWatcher/watchers/{watcherName}/healthValidations/{healthValidationName} + /// + /// + /// Operation Id + /// HealthValidation_Get + /// + /// + /// Default Api Version + /// 2025-01-02 + /// + /// + /// Resource + /// + /// + /// + /// + /// The health validation resource name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Exists(string healthValidationName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(healthValidationName, nameof(healthValidationName)); + + using var scope = _healthValidationClientDiagnostics.CreateScope("HealthValidationCollection.Exists"); + scope.Start(); + try + { + var response = _healthValidationRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, healthValidationName, 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.DatabaseWatcher/watchers/{watcherName}/healthValidations/{healthValidationName} + /// + /// + /// Operation Id + /// HealthValidation_Get + /// + /// + /// Default Api Version + /// 2025-01-02 + /// + /// + /// Resource + /// + /// + /// + /// + /// The health validation resource name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetIfExistsAsync(string healthValidationName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(healthValidationName, nameof(healthValidationName)); + + using var scope = _healthValidationClientDiagnostics.CreateScope("HealthValidationCollection.GetIfExists"); + scope.Start(); + try + { + var response = await _healthValidationRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, healthValidationName, cancellationToken: cancellationToken).ConfigureAwait(false); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new HealthValidationResource(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.DatabaseWatcher/watchers/{watcherName}/healthValidations/{healthValidationName} + /// + /// + /// Operation Id + /// HealthValidation_Get + /// + /// + /// Default Api Version + /// 2025-01-02 + /// + /// + /// Resource + /// + /// + /// + /// + /// The health validation resource name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual NullableResponse GetIfExists(string healthValidationName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(healthValidationName, nameof(healthValidationName)); + + using var scope = _healthValidationClientDiagnostics.CreateScope("HealthValidationCollection.GetIfExists"); + scope.Start(); + try + { + var response = _healthValidationRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, healthValidationName, cancellationToken: cancellationToken); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new HealthValidationResource(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/databasewatcher/Azure.ResourceManager.DatabaseWatcher/src/Generated/HealthValidationData.Serialization.cs b/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/src/Generated/HealthValidationData.Serialization.cs new file mode 100644 index 000000000000..702adcb7971d --- /dev/null +++ b/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/src/Generated/HealthValidationData.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.DatabaseWatcher.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.DatabaseWatcher +{ + public partial class HealthValidationData : 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(HealthValidationData)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (Optional.IsDefined(Properties)) + { + writer.WritePropertyName("properties"u8); + writer.WriteObjectValue(Properties, options); + } + } + + HealthValidationData 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(HealthValidationData)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeHealthValidationData(document.RootElement, options); + } + + internal static HealthValidationData DeserializeHealthValidationData(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + HealthValidationProperties 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 = HealthValidationProperties.DeserializeHealthValidationProperties(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 HealthValidationData( + 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(HealthValidationData)} does not support writing '{options.Format}' format."); + } + } + + HealthValidationData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeHealthValidationData(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(HealthValidationData)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/src/Generated/HealthValidationData.cs b/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/src/Generated/HealthValidationData.cs new file mode 100644 index 000000000000..d261752d66de --- /dev/null +++ b/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/src/Generated/HealthValidationData.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.DatabaseWatcher.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.DatabaseWatcher +{ + /// + /// A class representing the HealthValidation data model. + /// Concrete proxy resource types can be created by aliasing this type using a specific property type. + /// + public partial class HealthValidationData : 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 . + internal HealthValidationData() + { + } + + /// 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 HealthValidationData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, HealthValidationProperties properties, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) + { + Properties = properties; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The resource-specific properties for this resource. + public HealthValidationProperties Properties { get; } + } +} diff --git a/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/src/Generated/HealthValidationResource.Serialization.cs b/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/src/Generated/HealthValidationResource.Serialization.cs new file mode 100644 index 000000000000..86d73ed6ee91 --- /dev/null +++ b/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/src/Generated/HealthValidationResource.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.DatabaseWatcher +{ + public partial class HealthValidationResource : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); + + HealthValidationData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options); + + HealthValidationData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options); + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); + } +} diff --git a/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/src/Generated/HealthValidationResource.cs b/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/src/Generated/HealthValidationResource.cs new file mode 100644 index 000000000000..c43c0dfacf3d --- /dev/null +++ b/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/src/Generated/HealthValidationResource.cs @@ -0,0 +1,255 @@ +// 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.DatabaseWatcher +{ + /// + /// A Class representing a HealthValidation 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 GetHealthValidationResource method. + /// Otherwise you can get one from its parent resource using the GetHealthValidation method. + /// + public partial class HealthValidationResource : ArmResource + { + /// Generate the resource identifier of a instance. + /// The subscriptionId. + /// The resourceGroupName. + /// The watcherName. + /// The healthValidationName. + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string watcherName, string healthValidationName) + { + var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseWatcher/watchers/{watcherName}/healthValidations/{healthValidationName}"; + return new ResourceIdentifier(resourceId); + } + + private readonly ClientDiagnostics _healthValidationClientDiagnostics; + private readonly HealthValidationsRestOperations _healthValidationRestClient; + private readonly HealthValidationData _data; + + /// Gets the resource type for the operations. + public static readonly ResourceType ResourceType = "Microsoft.DatabaseWatcher/watchers/healthValidations"; + + /// Initializes a new instance of the class for mocking. + protected HealthValidationResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal HealthValidationResource(ArmClient client, HealthValidationData 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 HealthValidationResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _healthValidationClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.DatabaseWatcher", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string healthValidationApiVersion); + _healthValidationRestClient = new HealthValidationsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, healthValidationApiVersion); +#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 HealthValidationData 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 HealthValidation + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseWatcher/watchers/{watcherName}/healthValidations/{healthValidationName} + /// + /// + /// Operation Id + /// HealthValidation_Get + /// + /// + /// Default Api Version + /// 2025-01-02 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _healthValidationClientDiagnostics.CreateScope("HealthValidationResource.Get"); + scope.Start(); + try + { + var response = await _healthValidationRestClient.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 HealthValidationResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a HealthValidation + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseWatcher/watchers/{watcherName}/healthValidations/{healthValidationName} + /// + /// + /// Operation Id + /// HealthValidation_Get + /// + /// + /// Default Api Version + /// 2025-01-02 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _healthValidationClientDiagnostics.CreateScope("HealthValidationResource.Get"); + scope.Start(); + try + { + var response = _healthValidationRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new HealthValidationResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Starts health validation for a watcher. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseWatcher/watchers/{watcherName}/healthValidations/{healthValidationName}/startValidation + /// + /// + /// Operation Id + /// HealthValidations_StartValidation + /// + /// + /// Default Api Version + /// 2025-01-02 + /// + /// + /// 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> StartValidationAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _healthValidationClientDiagnostics.CreateScope("HealthValidationResource.StartValidation"); + scope.Start(); + try + { + var response = await _healthValidationRestClient.StartValidationAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + var operation = new DatabaseWatcherArmOperation(new HealthValidationOperationSource(Client), _healthValidationClientDiagnostics, Pipeline, _healthValidationRestClient.CreateStartValidationRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Starts health validation for a watcher. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseWatcher/watchers/{watcherName}/healthValidations/{healthValidationName}/startValidation + /// + /// + /// Operation Id + /// HealthValidations_StartValidation + /// + /// + /// Default Api Version + /// 2025-01-02 + /// + /// + /// 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 StartValidation(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _healthValidationClientDiagnostics.CreateScope("HealthValidationResource.StartValidation"); + scope.Start(); + try + { + var response = _healthValidationRestClient.StartValidation(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + var operation = new DatabaseWatcherArmOperation(new HealthValidationOperationSource(Client), _healthValidationClientDiagnostics, Pipeline, _healthValidationRestClient.CreateStartValidationRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/src/Generated/Internal/Argument.cs b/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/src/Generated/Internal/Argument.cs new file mode 100644 index 000000000000..32f9b26aaec4 --- /dev/null +++ b/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/src/Generated/Internal/Argument.cs @@ -0,0 +1,129 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections; +using System.Collections.Generic; + +namespace Azure.ResourceManager.DatabaseWatcher +{ + internal static class Argument + { + public static void AssertNotNull(T value, string name) + { + if (value is null) + { + throw new ArgumentNullException(name); + } + } + + public static void AssertNotNull(T? value, string name) + where T : struct + { + if (!value.HasValue) + { + throw new ArgumentNullException(name); + } + } + + public static void AssertNotNullOrEmpty(IEnumerable value, string name) + { + if (value is null) + { + throw new ArgumentNullException(name); + } + if (value is ICollection collectionOfT && collectionOfT.Count == 0) + { + throw new ArgumentException("Value cannot be an empty collection.", name); + } + if (value is ICollection collection && collection.Count == 0) + { + throw new ArgumentException("Value cannot be an empty collection.", name); + } + using IEnumerator e = value.GetEnumerator(); + if (!e.MoveNext()) + { + throw new ArgumentException("Value cannot be an empty collection.", name); + } + } + + public static void AssertNotNullOrEmpty(string value, string name) + { + if (value is null) + { + throw new ArgumentNullException(name); + } + if (value.Length == 0) + { + throw new ArgumentException("Value cannot be an empty string.", name); + } + } + + public static void AssertNotNullOrWhiteSpace(string value, string name) + { + if (value is null) + { + throw new ArgumentNullException(name); + } + if (string.IsNullOrWhiteSpace(value)) + { + throw new ArgumentException("Value cannot be empty or contain only white-space characters.", name); + } + } + + public static void AssertNotDefault(ref T value, string name) + where T : struct, IEquatable + { + if (value.Equals(default)) + { + throw new ArgumentException("Value cannot be empty.", name); + } + } + + public static void AssertInRange(T value, T minimum, T maximum, string name) + where T : notnull, IComparable + { + if (minimum.CompareTo(value) > 0) + { + throw new ArgumentOutOfRangeException(name, "Value is less than the minimum allowed."); + } + if (maximum.CompareTo(value) < 0) + { + throw new ArgumentOutOfRangeException(name, "Value is greater than the maximum allowed."); + } + } + + public static void AssertEnumDefined(Type enumType, object value, string name) + { + if (!Enum.IsDefined(enumType, value)) + { + throw new ArgumentException($"Value not defined for {enumType.FullName}.", name); + } + } + + public static T CheckNotNull(T value, string name) + where T : class + { + AssertNotNull(value, name); + return value; + } + + public static string CheckNotNullOrEmpty(string value, string name) + { + AssertNotNullOrEmpty(value, name); + return value; + } + + public static void AssertNull(T value, string name, string message = null) + { + if (value != null) + { + throw new ArgumentException(message ?? "Value must be null.", name); + } + } + } +} diff --git a/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/src/Generated/Internal/ChangeTrackingDictionary.cs b/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/src/Generated/Internal/ChangeTrackingDictionary.cs new file mode 100644 index 000000000000..6afbde7e464c --- /dev/null +++ b/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/src/Generated/Internal/ChangeTrackingDictionary.cs @@ -0,0 +1,167 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections; +using System.Collections.Generic; + +namespace Azure.ResourceManager.DatabaseWatcher +{ + internal class ChangeTrackingDictionary : IDictionary, IReadOnlyDictionary where TKey : notnull + { + private IDictionary _innerDictionary; + + public ChangeTrackingDictionary() + { + } + + public ChangeTrackingDictionary(IDictionary dictionary) + { + if (dictionary == null) + { + return; + } + _innerDictionary = new Dictionary(dictionary); + } + + public ChangeTrackingDictionary(IReadOnlyDictionary dictionary) + { + if (dictionary == null) + { + return; + } + _innerDictionary = new Dictionary(); + foreach (var pair in dictionary) + { + _innerDictionary.Add(pair); + } + } + + public bool IsUndefined => _innerDictionary == null; + + public int Count => IsUndefined ? 0 : EnsureDictionary().Count; + + public bool IsReadOnly => IsUndefined ? false : EnsureDictionary().IsReadOnly; + + public ICollection Keys => IsUndefined ? Array.Empty() : EnsureDictionary().Keys; + + public ICollection Values => IsUndefined ? Array.Empty() : EnsureDictionary().Values; + + public TValue this[TKey key] + { + get + { + if (IsUndefined) + { + throw new KeyNotFoundException(nameof(key)); + } + return EnsureDictionary()[key]; + } + set + { + EnsureDictionary()[key] = value; + } + } + + IEnumerable IReadOnlyDictionary.Keys => Keys; + + IEnumerable IReadOnlyDictionary.Values => Values; + + public IEnumerator> GetEnumerator() + { + if (IsUndefined) + { + IEnumerator> enumerateEmpty() + { + yield break; + } + return enumerateEmpty(); + } + return EnsureDictionary().GetEnumerator(); + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetEnumerator(); + } + + public void Add(KeyValuePair item) + { + EnsureDictionary().Add(item); + } + + public void Clear() + { + EnsureDictionary().Clear(); + } + + public bool Contains(KeyValuePair item) + { + if (IsUndefined) + { + return false; + } + return EnsureDictionary().Contains(item); + } + + public void CopyTo(KeyValuePair[] array, int index) + { + if (IsUndefined) + { + return; + } + EnsureDictionary().CopyTo(array, index); + } + + public bool Remove(KeyValuePair item) + { + if (IsUndefined) + { + return false; + } + return EnsureDictionary().Remove(item); + } + + public void Add(TKey key, TValue value) + { + EnsureDictionary().Add(key, value); + } + + public bool ContainsKey(TKey key) + { + if (IsUndefined) + { + return false; + } + return EnsureDictionary().ContainsKey(key); + } + + public bool Remove(TKey key) + { + if (IsUndefined) + { + return false; + } + return EnsureDictionary().Remove(key); + } + + public bool TryGetValue(TKey key, out TValue value) + { + if (IsUndefined) + { + value = default; + return false; + } + return EnsureDictionary().TryGetValue(key, out value); + } + + public IDictionary EnsureDictionary() + { + return _innerDictionary ??= new Dictionary(); + } + } +} diff --git a/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/src/Generated/Internal/ChangeTrackingList.cs b/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/src/Generated/Internal/ChangeTrackingList.cs new file mode 100644 index 000000000000..7d07be2128e8 --- /dev/null +++ b/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/src/Generated/Internal/ChangeTrackingList.cs @@ -0,0 +1,153 @@ +// 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.Linq; + +namespace Azure.ResourceManager.DatabaseWatcher +{ + internal class ChangeTrackingList : IList, IReadOnlyList + { + private IList _innerList; + + public ChangeTrackingList() + { + } + + public ChangeTrackingList(IList innerList) + { + if (innerList != null) + { + _innerList = innerList; + } + } + + public ChangeTrackingList(IReadOnlyList innerList) + { + if (innerList != null) + { + _innerList = innerList.ToList(); + } + } + + public bool IsUndefined => _innerList == null; + + public int Count => IsUndefined ? 0 : EnsureList().Count; + + public bool IsReadOnly => IsUndefined ? false : EnsureList().IsReadOnly; + + public T this[int index] + { + get + { + if (IsUndefined) + { + throw new ArgumentOutOfRangeException(nameof(index)); + } + return EnsureList()[index]; + } + set + { + if (IsUndefined) + { + throw new ArgumentOutOfRangeException(nameof(index)); + } + EnsureList()[index] = value; + } + } + + public void Reset() + { + _innerList = null; + } + + public IEnumerator GetEnumerator() + { + if (IsUndefined) + { + IEnumerator enumerateEmpty() + { + yield break; + } + return enumerateEmpty(); + } + return EnsureList().GetEnumerator(); + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetEnumerator(); + } + + public void Add(T item) + { + EnsureList().Add(item); + } + + public void Clear() + { + EnsureList().Clear(); + } + + public bool Contains(T item) + { + if (IsUndefined) + { + return false; + } + return EnsureList().Contains(item); + } + + public void CopyTo(T[] array, int arrayIndex) + { + if (IsUndefined) + { + return; + } + EnsureList().CopyTo(array, arrayIndex); + } + + public bool Remove(T item) + { + if (IsUndefined) + { + return false; + } + return EnsureList().Remove(item); + } + + public int IndexOf(T item) + { + if (IsUndefined) + { + return -1; + } + return EnsureList().IndexOf(item); + } + + public void Insert(int index, T item) + { + EnsureList().Insert(index, item); + } + + public void RemoveAt(int index) + { + if (IsUndefined) + { + throw new ArgumentOutOfRangeException(nameof(index)); + } + EnsureList().RemoveAt(index); + } + + public IList EnsureList() + { + return _innerList ??= new List(); + } + } +} diff --git a/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/src/Generated/Internal/ModelSerializationExtensions.cs b/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/src/Generated/Internal/ModelSerializationExtensions.cs new file mode 100644 index 000000000000..042bb5f708f5 --- /dev/null +++ b/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/src/Generated/Internal/ModelSerializationExtensions.cs @@ -0,0 +1,398 @@ +// 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.Diagnostics; +using System.Globalization; +using System.Text.Json; +using System.Xml; +using Azure.Core; + +namespace Azure.ResourceManager.DatabaseWatcher +{ + internal static class ModelSerializationExtensions + { + internal static readonly ModelReaderWriterOptions WireOptions = new ModelReaderWriterOptions("W"); + + public static object GetObject(this JsonElement element) + { + switch (element.ValueKind) + { + case JsonValueKind.String: + return element.GetString(); + case JsonValueKind.Number: + if (element.TryGetInt32(out int intValue)) + { + return intValue; + } + if (element.TryGetInt64(out long longValue)) + { + return longValue; + } + return element.GetDouble(); + case JsonValueKind.True: + return true; + case JsonValueKind.False: + return false; + case JsonValueKind.Undefined: + case JsonValueKind.Null: + return null; + case JsonValueKind.Object: + var dictionary = new Dictionary(); + foreach (var jsonProperty in element.EnumerateObject()) + { + dictionary.Add(jsonProperty.Name, jsonProperty.Value.GetObject()); + } + return dictionary; + case JsonValueKind.Array: + var list = new List(); + foreach (var item in element.EnumerateArray()) + { + list.Add(item.GetObject()); + } + return list.ToArray(); + default: + throw new NotSupportedException($"Not supported value kind {element.ValueKind}"); + } + } + + public static byte[] GetBytesFromBase64(this JsonElement element, string format) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + + return format switch + { + "U" => TypeFormatters.FromBase64UrlString(element.GetRequiredString()), + "D" => element.GetBytesFromBase64(), + _ => throw new ArgumentException($"Format is not supported: '{format}'", nameof(format)) + }; + } + + public static DateTimeOffset GetDateTimeOffset(this JsonElement element, string format) => format switch + { + "U" when element.ValueKind == JsonValueKind.Number => DateTimeOffset.FromUnixTimeSeconds(element.GetInt64()), + _ => TypeFormatters.ParseDateTimeOffset(element.GetString(), format) + }; + + public static TimeSpan GetTimeSpan(this JsonElement element, string format) => TypeFormatters.ParseTimeSpan(element.GetString(), format); + + public static char GetChar(this JsonElement element) + { + if (element.ValueKind == JsonValueKind.String) + { + var text = element.GetString(); + if (text == null || text.Length != 1) + { + throw new NotSupportedException($"Cannot convert \"{text}\" to a char"); + } + return text[0]; + } + else + { + throw new NotSupportedException($"Cannot convert {element.ValueKind} to a char"); + } + } + + [Conditional("DEBUG")] + public static void ThrowNonNullablePropertyIsNull(this JsonProperty property) + { + throw new JsonException($"A property '{property.Name}' defined as non-nullable but received as null from the service. This exception only happens in DEBUG builds of the library and would be ignored in the release build"); + } + + public static string GetRequiredString(this JsonElement element) + { + var value = element.GetString(); + if (value == null) + { + throw new InvalidOperationException($"The requested operation requires an element of type 'String', but the target element has type '{element.ValueKind}'."); + } + return value; + } + + public static void WriteStringValue(this Utf8JsonWriter writer, DateTimeOffset value, string format) + { + writer.WriteStringValue(TypeFormatters.ToString(value, format)); + } + + public static void WriteStringValue(this Utf8JsonWriter writer, DateTime value, string format) + { + writer.WriteStringValue(TypeFormatters.ToString(value, format)); + } + + public static void WriteStringValue(this Utf8JsonWriter writer, TimeSpan value, string format) + { + writer.WriteStringValue(TypeFormatters.ToString(value, format)); + } + + public static void WriteStringValue(this Utf8JsonWriter writer, char value) + { + writer.WriteStringValue(value.ToString(CultureInfo.InvariantCulture)); + } + + public static void WriteBase64StringValue(this Utf8JsonWriter writer, byte[] value, string format) + { + if (value == null) + { + writer.WriteNullValue(); + return; + } + switch (format) + { + case "U": + writer.WriteStringValue(TypeFormatters.ToBase64UrlString(value)); + break; + case "D": + writer.WriteBase64StringValue(value); + break; + default: + throw new ArgumentException($"Format is not supported: '{format}'", nameof(format)); + } + } + + public static void WriteNumberValue(this Utf8JsonWriter writer, DateTimeOffset value, string format) + { + if (format != "U") + { + throw new ArgumentOutOfRangeException(nameof(format), "Only 'U' format is supported when writing a DateTimeOffset as a Number."); + } + writer.WriteNumberValue(value.ToUnixTimeSeconds()); + } + + public static void WriteObjectValue(this Utf8JsonWriter writer, T value, ModelReaderWriterOptions options = null) + { + switch (value) + { + case null: + writer.WriteNullValue(); + break; + case IJsonModel jsonModel: + jsonModel.Write(writer, options ?? WireOptions); + break; + case IUtf8JsonSerializable serializable: + serializable.Write(writer); + break; + case byte[] bytes: + writer.WriteBase64StringValue(bytes); + break; + case BinaryData bytes0: + writer.WriteBase64StringValue(bytes0); + break; + case JsonElement json: + json.WriteTo(writer); + break; + case int i: + writer.WriteNumberValue(i); + break; + case decimal d: + writer.WriteNumberValue(d); + break; + case double d0: + if (double.IsNaN(d0)) + { + writer.WriteStringValue("NaN"); + } + else + { + writer.WriteNumberValue(d0); + } + break; + case float f: + writer.WriteNumberValue(f); + break; + case long l: + writer.WriteNumberValue(l); + break; + case string s: + writer.WriteStringValue(s); + break; + case bool b: + writer.WriteBooleanValue(b); + break; + case Guid g: + writer.WriteStringValue(g); + break; + case DateTimeOffset dateTimeOffset: + writer.WriteStringValue(dateTimeOffset, "O"); + break; + case DateTime dateTime: + writer.WriteStringValue(dateTime, "O"); + break; + case IEnumerable> enumerable: + writer.WriteStartObject(); + foreach (var pair in enumerable) + { + writer.WritePropertyName(pair.Key); + writer.WriteObjectValue(pair.Value, options); + } + writer.WriteEndObject(); + break; + case IEnumerable objectEnumerable: + writer.WriteStartArray(); + foreach (var item in objectEnumerable) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + break; + case TimeSpan timeSpan: + writer.WriteStringValue(timeSpan, "P"); + break; + default: + throw new NotSupportedException($"Not supported type {value.GetType()}"); + } + } + + public static void WriteObjectValue(this Utf8JsonWriter writer, object value, ModelReaderWriterOptions options = null) + { + writer.WriteObjectValue(value, options); + } + + internal static class TypeFormatters + { + private const string RoundtripZFormat = "yyyy-MM-ddTHH:mm:ss.fffffffZ"; + public const string DefaultNumberFormat = "G"; + + public static string ToString(bool value) => value ? "true" : "false"; + + public static string ToString(DateTime value, string format) => value.Kind switch + { + DateTimeKind.Utc => ToString((DateTimeOffset)value, format), + _ => throw new NotSupportedException($"DateTime {value} has a Kind of {value.Kind}. Azure SDK requires it to be UTC. You can call DateTime.SpecifyKind to change Kind property value to DateTimeKind.Utc.") + }; + + public static string ToString(DateTimeOffset value, string format) => format switch + { + "D" => value.ToString("yyyy-MM-dd", CultureInfo.InvariantCulture), + "U" => value.ToUnixTimeSeconds().ToString(CultureInfo.InvariantCulture), + "O" => value.ToUniversalTime().ToString(RoundtripZFormat, CultureInfo.InvariantCulture), + "o" => value.ToUniversalTime().ToString(RoundtripZFormat, CultureInfo.InvariantCulture), + "R" => value.ToString("r", CultureInfo.InvariantCulture), + _ => value.ToString(format, CultureInfo.InvariantCulture) + }; + + public static string ToString(TimeSpan value, string format) => format switch + { + "P" => XmlConvert.ToString(value), + _ => value.ToString(format, CultureInfo.InvariantCulture) + }; + + public static string ToString(byte[] value, string format) => format switch + { + "U" => ToBase64UrlString(value), + "D" => Convert.ToBase64String(value), + _ => throw new ArgumentException($"Format is not supported: '{format}'", nameof(format)) + }; + + public static string ToBase64UrlString(byte[] value) + { + int numWholeOrPartialInputBlocks = checked(value.Length + 2) / 3; + int size = checked(numWholeOrPartialInputBlocks * 4); + char[] output = new char[size]; + + int numBase64Chars = Convert.ToBase64CharArray(value, 0, value.Length, output, 0); + + int i = 0; + for (; i < numBase64Chars; i++) + { + char ch = output[i]; + if (ch == '+') + { + output[i] = '-'; + } + else + { + if (ch == '/') + { + output[i] = '_'; + } + else + { + if (ch == '=') + { + break; + } + } + } + } + + return new string(output, 0, i); + } + + public static byte[] FromBase64UrlString(string value) + { + int paddingCharsToAdd = (value.Length % 4) switch + { + 0 => 0, + 2 => 2, + 3 => 1, + _ => throw new InvalidOperationException("Malformed input") + }; + char[] output = new char[(value.Length + paddingCharsToAdd)]; + int i = 0; + for (; i < value.Length; i++) + { + char ch = value[i]; + if (ch == '-') + { + output[i] = '+'; + } + else + { + if (ch == '_') + { + output[i] = '/'; + } + else + { + output[i] = ch; + } + } + } + + for (; i < output.Length; i++) + { + output[i] = '='; + } + + return Convert.FromBase64CharArray(output, 0, output.Length); + } + + public static DateTimeOffset ParseDateTimeOffset(string value, string format) => format switch + { + "U" => DateTimeOffset.FromUnixTimeSeconds(long.Parse(value, CultureInfo.InvariantCulture)), + _ => DateTimeOffset.Parse(value, CultureInfo.InvariantCulture, DateTimeStyles.AssumeUniversal) + }; + + public static TimeSpan ParseTimeSpan(string value, string format) => format switch + { + "P" => XmlConvert.ToTimeSpan(value), + _ => TimeSpan.ParseExact(value, format, CultureInfo.InvariantCulture) + }; + + public static string ConvertToString(object value, string format = null) => value switch + { + null => "null", + string s => s, + bool b => ToString(b), + int or float or double or long or decimal => ((IFormattable)value).ToString(DefaultNumberFormat, CultureInfo.InvariantCulture), + byte[] b0 when format != null => ToString(b0, format), + IEnumerable s0 => string.Join(",", s0), + DateTimeOffset dateTime when format != null => ToString(dateTime, format), + TimeSpan timeSpan when format != null => ToString(timeSpan, format), + TimeSpan timeSpan0 => XmlConvert.ToString(timeSpan0), + Guid guid => guid.ToString(), + BinaryData binaryData => ConvertToString(binaryData.ToArray(), format), + _ => value.ToString() + }; + } + } +} diff --git a/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/src/Generated/Internal/Optional.cs b/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/src/Generated/Internal/Optional.cs new file mode 100644 index 000000000000..78fe76f53503 --- /dev/null +++ b/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/src/Generated/Internal/Optional.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; + +namespace Azure.ResourceManager.DatabaseWatcher +{ + internal static class Optional + { + public static bool IsCollectionDefined(IEnumerable collection) + { + return !(collection is ChangeTrackingList changeTrackingList && changeTrackingList.IsUndefined); + } + + public static bool IsCollectionDefined(IDictionary collection) + { + return !(collection is ChangeTrackingDictionary changeTrackingDictionary && changeTrackingDictionary.IsUndefined); + } + + public static bool IsCollectionDefined(IReadOnlyDictionary collection) + { + return !(collection is ChangeTrackingDictionary changeTrackingDictionary && changeTrackingDictionary.IsUndefined); + } + + public static bool IsDefined(T? value) + where T : struct + { + return value.HasValue; + } + + public static bool IsDefined(object value) + { + return value != null; + } + + public static bool IsDefined(JsonElement value) + { + return value.ValueKind != JsonValueKind.Undefined; + } + + public static bool IsDefined(string value) + { + return value != null; + } + } +} diff --git a/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/src/Generated/Internal/Utf8JsonRequestContent.cs b/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/src/Generated/Internal/Utf8JsonRequestContent.cs new file mode 100644 index 000000000000..e46e08cbf3ee --- /dev/null +++ b/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/src/Generated/Internal/Utf8JsonRequestContent.cs @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.IO; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; + +namespace Azure.ResourceManager.DatabaseWatcher +{ + internal class Utf8JsonRequestContent : RequestContent + { + private readonly MemoryStream _stream; + private readonly RequestContent _content; + + public Utf8JsonRequestContent() + { + _stream = new MemoryStream(); + _content = Create(_stream); + JsonWriter = new Utf8JsonWriter(_stream); + } + + public Utf8JsonWriter JsonWriter { get; } + + public override async Task WriteToAsync(Stream stream, CancellationToken cancellationToken = default) + { + await JsonWriter.FlushAsync().ConfigureAwait(false); + await _content.WriteToAsync(stream, cancellationToken).ConfigureAwait(false); + } + + public override void WriteTo(Stream stream, CancellationToken cancellationToken = default) + { + JsonWriter.Flush(); + _content.WriteTo(stream, cancellationToken); + } + + public override bool TryComputeLength(out long length) + { + length = JsonWriter.BytesCommitted + JsonWriter.BytesPending; + return true; + } + + public override void Dispose() + { + JsonWriter.Dispose(); + _content.Dispose(); + _stream.Dispose(); + } + } +} diff --git a/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/src/Generated/LongRunningOperation/DatabaseWatcherArmOperation.cs b/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/src/Generated/LongRunningOperation/DatabaseWatcherArmOperation.cs new file mode 100644 index 000000000000..0380185acc37 --- /dev/null +++ b/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/src/Generated/LongRunningOperation/DatabaseWatcherArmOperation.cs @@ -0,0 +1,94 @@ +// 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.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.DatabaseWatcher +{ +#pragma warning disable SA1649 // File name should match first type name + internal class DatabaseWatcherArmOperation : ArmOperation +#pragma warning restore SA1649 // File name should match first type name + { + private readonly OperationInternal _operation; + private readonly RehydrationToken? _completeRehydrationToken; + private readonly NextLinkOperationImplementation _nextLinkOperation; + private readonly string _operationId; + + /// Initializes a new instance of DatabaseWatcherArmOperation for mocking. + protected DatabaseWatcherArmOperation() + { + } + + internal DatabaseWatcherArmOperation(Response response, RehydrationToken? rehydrationToken = null) + { + _operation = OperationInternal.Succeeded(response); + _completeRehydrationToken = rehydrationToken; + _operationId = GetOperationId(rehydrationToken); + } + + internal DatabaseWatcherArmOperation(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, Request request, Response response, OperationFinalStateVia finalStateVia, bool skipApiVersionOverride = false, string apiVersionOverrideValue = null) + { + var nextLinkOperation = NextLinkOperationImplementation.Create(pipeline, request.Method, request.Uri.ToUri(), response, finalStateVia, skipApiVersionOverride, apiVersionOverrideValue); + if (nextLinkOperation is NextLinkOperationImplementation nextLinkOperationValue) + { + _nextLinkOperation = nextLinkOperationValue; + _operationId = _nextLinkOperation.OperationId; + } + else + { + _completeRehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(request.Method, request.Uri.ToUri(), response, finalStateVia); + _operationId = GetOperationId(_completeRehydrationToken); + } + _operation = new OperationInternal(nextLinkOperation, clientDiagnostics, response, "DatabaseWatcherArmOperation", fallbackStrategy: new SequentialDelayStrategy()); + } + + private string GetOperationId(RehydrationToken? rehydrationToken) + { + if (rehydrationToken is null) + { + return null; + } + var lroDetails = ModelReaderWriter.Write(rehydrationToken, ModelReaderWriterOptions.Json).ToObjectFromJson>(); + return lroDetails["id"]; + } + /// + public override string Id => _operationId ?? NextLinkOperationImplementation.NotSet; + + /// + public override RehydrationToken? GetRehydrationToken() => _nextLinkOperation?.GetRehydrationToken() ?? _completeRehydrationToken; + + /// + public override bool HasCompleted => _operation.HasCompleted; + + /// + public override Response GetRawResponse() => _operation.RawResponse; + + /// + public override Response UpdateStatus(CancellationToken cancellationToken = default) => _operation.UpdateStatus(cancellationToken); + + /// + public override ValueTask UpdateStatusAsync(CancellationToken cancellationToken = default) => _operation.UpdateStatusAsync(cancellationToken); + + /// + public override Response WaitForCompletionResponse(CancellationToken cancellationToken = default) => _operation.WaitForCompletionResponse(cancellationToken); + + /// + public override Response WaitForCompletionResponse(TimeSpan pollingInterval, CancellationToken cancellationToken = default) => _operation.WaitForCompletionResponse(pollingInterval, cancellationToken); + + /// + public override ValueTask WaitForCompletionResponseAsync(CancellationToken cancellationToken = default) => _operation.WaitForCompletionResponseAsync(cancellationToken); + + /// + public override ValueTask WaitForCompletionResponseAsync(TimeSpan pollingInterval, CancellationToken cancellationToken = default) => _operation.WaitForCompletionResponseAsync(pollingInterval, cancellationToken); + } +} diff --git a/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/src/Generated/LongRunningOperation/DatabaseWatcherArmOperationOfT.cs b/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/src/Generated/LongRunningOperation/DatabaseWatcherArmOperationOfT.cs new file mode 100644 index 000000000000..7bc2029706fc --- /dev/null +++ b/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/src/Generated/LongRunningOperation/DatabaseWatcherArmOperationOfT.cs @@ -0,0 +1,100 @@ +// 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.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.DatabaseWatcher +{ +#pragma warning disable SA1649 // File name should match first type name + internal class DatabaseWatcherArmOperation : ArmOperation +#pragma warning restore SA1649 // File name should match first type name + { + private readonly OperationInternal _operation; + private readonly RehydrationToken? _completeRehydrationToken; + private readonly NextLinkOperationImplementation _nextLinkOperation; + private readonly string _operationId; + + /// Initializes a new instance of DatabaseWatcherArmOperation for mocking. + protected DatabaseWatcherArmOperation() + { + } + + internal DatabaseWatcherArmOperation(Response response, RehydrationToken? rehydrationToken = null) + { + _operation = OperationInternal.Succeeded(response.GetRawResponse(), response.Value); + _completeRehydrationToken = rehydrationToken; + _operationId = GetOperationId(rehydrationToken); + } + + internal DatabaseWatcherArmOperation(IOperationSource source, ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, Request request, Response response, OperationFinalStateVia finalStateVia, bool skipApiVersionOverride = false, string apiVersionOverrideValue = null) + { + var nextLinkOperation = NextLinkOperationImplementation.Create(pipeline, request.Method, request.Uri.ToUri(), response, finalStateVia, skipApiVersionOverride, apiVersionOverrideValue); + if (nextLinkOperation is NextLinkOperationImplementation nextLinkOperationValue) + { + _nextLinkOperation = nextLinkOperationValue; + _operationId = _nextLinkOperation.OperationId; + } + else + { + _completeRehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(request.Method, request.Uri.ToUri(), response, finalStateVia); + _operationId = GetOperationId(_completeRehydrationToken); + } + _operation = new OperationInternal(NextLinkOperationImplementation.Create(source, nextLinkOperation), clientDiagnostics, response, "DatabaseWatcherArmOperation", fallbackStrategy: new SequentialDelayStrategy()); + } + + private string GetOperationId(RehydrationToken? rehydrationToken) + { + if (rehydrationToken is null) + { + return null; + } + var lroDetails = ModelReaderWriter.Write(rehydrationToken, ModelReaderWriterOptions.Json).ToObjectFromJson>(); + return lroDetails["id"]; + } + /// + public override string Id => _operationId ?? NextLinkOperationImplementation.NotSet; + + /// + public override RehydrationToken? GetRehydrationToken() => _nextLinkOperation?.GetRehydrationToken() ?? _completeRehydrationToken; + + /// + public override T Value => _operation.Value; + + /// + public override bool HasValue => _operation.HasValue; + + /// + public override bool HasCompleted => _operation.HasCompleted; + + /// + public override Response GetRawResponse() => _operation.RawResponse; + + /// + public override Response UpdateStatus(CancellationToken cancellationToken = default) => _operation.UpdateStatus(cancellationToken); + + /// + public override ValueTask UpdateStatusAsync(CancellationToken cancellationToken = default) => _operation.UpdateStatusAsync(cancellationToken); + + /// + public override Response WaitForCompletion(CancellationToken cancellationToken = default) => _operation.WaitForCompletion(cancellationToken); + + /// + public override Response WaitForCompletion(TimeSpan pollingInterval, CancellationToken cancellationToken = default) => _operation.WaitForCompletion(pollingInterval, cancellationToken); + + /// + public override ValueTask> WaitForCompletionAsync(CancellationToken cancellationToken = default) => _operation.WaitForCompletionAsync(cancellationToken); + + /// + public override ValueTask> WaitForCompletionAsync(TimeSpan pollingInterval, CancellationToken cancellationToken = default) => _operation.WaitForCompletionAsync(pollingInterval, cancellationToken); + } +} diff --git a/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/src/Generated/LongRunningOperation/HealthValidationOperationSource.cs b/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/src/Generated/LongRunningOperation/HealthValidationOperationSource.cs new file mode 100644 index 000000000000..1db65fe7c9b6 --- /dev/null +++ b/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/src/Generated/LongRunningOperation/HealthValidationOperationSource.cs @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; + +namespace Azure.ResourceManager.DatabaseWatcher +{ + internal class HealthValidationOperationSource : IOperationSource + { + private readonly ArmClient _client; + + internal HealthValidationOperationSource(ArmClient client) + { + _client = client; + } + + HealthValidationResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) + { + using var document = JsonDocument.Parse(response.ContentStream); + var data = HealthValidationData.DeserializeHealthValidationData(document.RootElement); + return new HealthValidationResource(_client, data); + } + + async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) + { + using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false); + var data = HealthValidationData.DeserializeHealthValidationData(document.RootElement); + return new HealthValidationResource(_client, data); + } + } +} diff --git a/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/src/Generated/LongRunningOperation/SharedPrivateLinkResourceOperationSource.cs b/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/src/Generated/LongRunningOperation/SharedPrivateLinkResourceOperationSource.cs new file mode 100644 index 000000000000..eb2d0282f266 --- /dev/null +++ b/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/src/Generated/LongRunningOperation/SharedPrivateLinkResourceOperationSource.cs @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; + +namespace Azure.ResourceManager.DatabaseWatcher +{ + internal class SharedPrivateLinkResourceOperationSource : IOperationSource + { + private readonly ArmClient _client; + + internal SharedPrivateLinkResourceOperationSource(ArmClient client) + { + _client = client; + } + + SharedPrivateLinkResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) + { + using var document = JsonDocument.Parse(response.ContentStream); + var data = SharedPrivateLinkResourceData.DeserializeSharedPrivateLinkResourceData(document.RootElement); + return new SharedPrivateLinkResource(_client, data); + } + + async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) + { + using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false); + var data = SharedPrivateLinkResourceData.DeserializeSharedPrivateLinkResourceData(document.RootElement); + return new SharedPrivateLinkResource(_client, data); + } + } +} diff --git a/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/src/Generated/LongRunningOperation/WatcherOperationSource.cs b/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/src/Generated/LongRunningOperation/WatcherOperationSource.cs new file mode 100644 index 000000000000..31cbf348dae8 --- /dev/null +++ b/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/src/Generated/LongRunningOperation/WatcherOperationSource.cs @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; + +namespace Azure.ResourceManager.DatabaseWatcher +{ + internal class WatcherOperationSource : IOperationSource + { + private readonly ArmClient _client; + + internal WatcherOperationSource(ArmClient client) + { + _client = client; + } + + WatcherResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) + { + using var document = JsonDocument.Parse(response.ContentStream); + var data = WatcherData.DeserializeWatcherData(document.RootElement); + return new WatcherResource(_client, data); + } + + async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) + { + using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false); + var data = WatcherData.DeserializeWatcherData(document.RootElement); + return new WatcherResource(_client, data); + } + } +} diff --git a/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/src/Generated/Models/AlertRuleCreationProperty.cs b/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/src/Generated/Models/AlertRuleCreationProperty.cs new file mode 100644 index 000000000000..182479a7ce69 --- /dev/null +++ b/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/src/Generated/Models/AlertRuleCreationProperty.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.DatabaseWatcher.Models +{ + /// The properties with which the alert rule resource was created. + public readonly partial struct AlertRuleCreationProperty : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public AlertRuleCreationProperty(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string CreatedWithActionGroupValue = "CreatedWithActionGroup"; + private const string NoneValue = "None"; + + /// The alert rule was created with an action group. + public static AlertRuleCreationProperty CreatedWithActionGroup { get; } = new AlertRuleCreationProperty(CreatedWithActionGroupValue); + /// The alert rule was created with no properties. + public static AlertRuleCreationProperty None { get; } = new AlertRuleCreationProperty(NoneValue); + /// Determines if two values are the same. + public static bool operator ==(AlertRuleCreationProperty left, AlertRuleCreationProperty right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(AlertRuleCreationProperty left, AlertRuleCreationProperty right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator AlertRuleCreationProperty(string value) => new AlertRuleCreationProperty(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is AlertRuleCreationProperty other && Equals(other); + /// + public bool Equals(AlertRuleCreationProperty other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/src/Generated/Models/AlertRuleResourceListResult.Serialization.cs b/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/src/Generated/Models/AlertRuleResourceListResult.Serialization.cs new file mode 100644 index 000000000000..4b6de8bfbc13 --- /dev/null +++ b/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/src/Generated/Models/AlertRuleResourceListResult.Serialization.cs @@ -0,0 +1,151 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.DatabaseWatcher.Models +{ + internal partial class AlertRuleResourceListResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AlertRuleResourceListResult)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var item in Value) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + if (Optional.IsDefined(NextLink)) + { + writer.WritePropertyName("nextLink"u8); + writer.WriteStringValue(NextLink.AbsoluteUri); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + AlertRuleResourceListResult 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(AlertRuleResourceListResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAlertRuleResourceListResult(document.RootElement, options); + } + + internal static AlertRuleResourceListResult DeserializeAlertRuleResourceListResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IReadOnlyList value = default; + Uri nextLink = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(AlertRuleResourceData.DeserializeAlertRuleResourceData(item, options)); + } + value = array; + continue; + } + if (property.NameEquals("nextLink"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + nextLink = new Uri(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new AlertRuleResourceListResult(value, nextLink, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(AlertRuleResourceListResult)} does not support writing '{options.Format}' format."); + } + } + + AlertRuleResourceListResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeAlertRuleResourceListResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(AlertRuleResourceListResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/src/Generated/Models/AlertRuleResourceListResult.cs b/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/src/Generated/Models/AlertRuleResourceListResult.cs new file mode 100644 index 000000000000..3a2a86a9d0e8 --- /dev/null +++ b/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/src/Generated/Models/AlertRuleResourceListResult.cs @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.ResourceManager.DatabaseWatcher.Models +{ + /// The response of a AlertRuleResource list operation. + internal partial class AlertRuleResourceListResult + { + /// + /// 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 AlertRuleResource items on this page. + /// is null. + internal AlertRuleResourceListResult(IEnumerable value) + { + Argument.AssertNotNull(value, nameof(value)); + + Value = value.ToList(); + } + + /// Initializes a new instance of . + /// The AlertRuleResource items on this page. + /// The link to the next page of items. + /// Keeps track of any properties unknown to the library. + internal AlertRuleResourceListResult(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) + { + Value = value; + NextLink = nextLink; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal AlertRuleResourceListResult() + { + } + + /// The AlertRuleResource items on this page. + public IReadOnlyList Value { get; } + /// The link to the next page of items. + public Uri NextLink { get; } + } +} diff --git a/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/src/Generated/Models/AlertRuleResourceProperties.Serialization.cs b/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/src/Generated/Models/AlertRuleResourceProperties.Serialization.cs new file mode 100644 index 000000000000..04ae44267dbc --- /dev/null +++ b/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/src/Generated/Models/AlertRuleResourceProperties.Serialization.cs @@ -0,0 +1,180 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.DatabaseWatcher.Models +{ + public partial class AlertRuleResourceProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AlertRuleResourceProperties)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("alertRuleResourceId"u8); + writer.WriteStringValue(AlertRuleResourceId); + writer.WritePropertyName("createdWithProperties"u8); + writer.WriteStringValue(CreatedWithProperties.ToString()); + writer.WritePropertyName("creationTime"u8); + writer.WriteStringValue(CreatedOn, "O"); + if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) + { + writer.WritePropertyName("provisioningState"u8); + writer.WriteStringValue(ProvisioningState.Value.ToString()); + } + writer.WritePropertyName("alertRuleTemplateId"u8); + writer.WriteStringValue(AlertRuleTemplateId); + writer.WritePropertyName("alertRuleTemplateVersion"u8); + writer.WriteStringValue(AlertRuleTemplateVersion); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + AlertRuleResourceProperties 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(AlertRuleResourceProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAlertRuleResourceProperties(document.RootElement, options); + } + + internal static AlertRuleResourceProperties DeserializeAlertRuleResourceProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ResourceIdentifier alertRuleResourceId = default; + AlertRuleCreationProperty createdWithProperties = default; + DateTimeOffset creationTime = default; + ResourceProvisioningState? provisioningState = default; + string alertRuleTemplateId = default; + string alertRuleTemplateVersion = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("alertRuleResourceId"u8)) + { + alertRuleResourceId = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("createdWithProperties"u8)) + { + createdWithProperties = new AlertRuleCreationProperty(property.Value.GetString()); + continue; + } + if (property.NameEquals("creationTime"u8)) + { + creationTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("provisioningState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + provisioningState = new ResourceProvisioningState(property.Value.GetString()); + continue; + } + if (property.NameEquals("alertRuleTemplateId"u8)) + { + alertRuleTemplateId = property.Value.GetString(); + continue; + } + if (property.NameEquals("alertRuleTemplateVersion"u8)) + { + alertRuleTemplateVersion = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new AlertRuleResourceProperties( + alertRuleResourceId, + createdWithProperties, + creationTime, + provisioningState, + alertRuleTemplateId, + alertRuleTemplateVersion, + 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(AlertRuleResourceProperties)} does not support writing '{options.Format}' format."); + } + } + + AlertRuleResourceProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeAlertRuleResourceProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(AlertRuleResourceProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/src/Generated/Models/AlertRuleResourceProperties.cs b/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/src/Generated/Models/AlertRuleResourceProperties.cs new file mode 100644 index 000000000000..81d7429e72f0 --- /dev/null +++ b/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/src/Generated/Models/AlertRuleResourceProperties.cs @@ -0,0 +1,106 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.ResourceManager.DatabaseWatcher.Models +{ + /// The generic properties of the alert rule proxy resource. + public partial class AlertRuleResourceProperties + { + /// + /// 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 resource ID of the alert rule resource. + /// The properties with which the alert rule resource was created. + /// The creation time of the alert rule resource. + /// The template ID associated with alert rule resource. + /// The alert rule template version. + /// , or is null. + public AlertRuleResourceProperties(ResourceIdentifier alertRuleResourceId, AlertRuleCreationProperty createdWithProperties, DateTimeOffset createdOn, string alertRuleTemplateId, string alertRuleTemplateVersion) + { + Argument.AssertNotNull(alertRuleResourceId, nameof(alertRuleResourceId)); + Argument.AssertNotNull(alertRuleTemplateId, nameof(alertRuleTemplateId)); + Argument.AssertNotNull(alertRuleTemplateVersion, nameof(alertRuleTemplateVersion)); + + AlertRuleResourceId = alertRuleResourceId; + CreatedWithProperties = createdWithProperties; + CreatedOn = createdOn; + AlertRuleTemplateId = alertRuleTemplateId; + AlertRuleTemplateVersion = alertRuleTemplateVersion; + } + + /// Initializes a new instance of . + /// The resource ID of the alert rule resource. + /// The properties with which the alert rule resource was created. + /// The creation time of the alert rule resource. + /// The provisioning state of the alert rule resource. + /// The template ID associated with alert rule resource. + /// The alert rule template version. + /// Keeps track of any properties unknown to the library. + internal AlertRuleResourceProperties(ResourceIdentifier alertRuleResourceId, AlertRuleCreationProperty createdWithProperties, DateTimeOffset createdOn, ResourceProvisioningState? provisioningState, string alertRuleTemplateId, string alertRuleTemplateVersion, IDictionary serializedAdditionalRawData) + { + AlertRuleResourceId = alertRuleResourceId; + CreatedWithProperties = createdWithProperties; + CreatedOn = createdOn; + ProvisioningState = provisioningState; + AlertRuleTemplateId = alertRuleTemplateId; + AlertRuleTemplateVersion = alertRuleTemplateVersion; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal AlertRuleResourceProperties() + { + } + + /// The resource ID of the alert rule resource. + public ResourceIdentifier AlertRuleResourceId { get; set; } + /// The properties with which the alert rule resource was created. + public AlertRuleCreationProperty CreatedWithProperties { get; set; } + /// The creation time of the alert rule resource. + public DateTimeOffset CreatedOn { get; set; } + /// The provisioning state of the alert rule resource. + public ResourceProvisioningState? ProvisioningState { get; } + /// The template ID associated with alert rule resource. + public string AlertRuleTemplateId { get; set; } + /// The alert rule template version. + public string AlertRuleTemplateVersion { get; set; } + } +} diff --git a/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/src/Generated/Models/DatabaseWatcherProvisioningState.cs b/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/src/Generated/Models/DatabaseWatcherProvisioningState.cs new file mode 100644 index 000000000000..1d26cbf74b16 --- /dev/null +++ b/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/src/Generated/Models/DatabaseWatcherProvisioningState.cs @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.DatabaseWatcher.Models +{ + /// The status of the last provisioning operation performed on the resource. + public readonly partial struct DatabaseWatcherProvisioningState : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public DatabaseWatcherProvisioningState(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string SucceededValue = "Succeeded"; + private const string FailedValue = "Failed"; + private const string CanceledValue = "Canceled"; + + /// Resource has been created. + public static DatabaseWatcherProvisioningState Succeeded { get; } = new DatabaseWatcherProvisioningState(SucceededValue); + /// Resource creation failed. + public static DatabaseWatcherProvisioningState Failed { get; } = new DatabaseWatcherProvisioningState(FailedValue); + /// Resource creation was canceled. + public static DatabaseWatcherProvisioningState Canceled { get; } = new DatabaseWatcherProvisioningState(CanceledValue); + /// Determines if two values are the same. + public static bool operator ==(DatabaseWatcherProvisioningState left, DatabaseWatcherProvisioningState right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(DatabaseWatcherProvisioningState left, DatabaseWatcherProvisioningState right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator DatabaseWatcherProvisioningState(string value) => new DatabaseWatcherProvisioningState(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is DatabaseWatcherProvisioningState other && Equals(other); + /// + public bool Equals(DatabaseWatcherProvisioningState other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/src/Generated/Models/Datastore.Serialization.cs b/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/src/Generated/Models/Datastore.Serialization.cs new file mode 100644 index 000000000000..d2a52e768ada --- /dev/null +++ b/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/src/Generated/Models/Datastore.Serialization.cs @@ -0,0 +1,192 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.DatabaseWatcher.Models +{ + public partial class Datastore : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(Datastore)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(AdxClusterResourceId)) + { + writer.WritePropertyName("adxClusterResourceId"u8); + writer.WriteStringValue(AdxClusterResourceId); + } + if (Optional.IsDefined(KustoClusterDisplayName)) + { + writer.WritePropertyName("kustoClusterDisplayName"u8); + writer.WriteStringValue(KustoClusterDisplayName); + } + writer.WritePropertyName("kustoClusterUri"u8); + writer.WriteStringValue(KustoClusterUri); + writer.WritePropertyName("kustoDataIngestionUri"u8); + writer.WriteStringValue(KustoDataIngestionUri); + writer.WritePropertyName("kustoDatabaseName"u8); + writer.WriteStringValue(KustoDatabaseName); + writer.WritePropertyName("kustoManagementUrl"u8); + writer.WriteStringValue(KustoManagementUri); + writer.WritePropertyName("kustoOfferingType"u8); + writer.WriteStringValue(KustoOfferingType.ToString()); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + Datastore 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(Datastore)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDatastore(document.RootElement, options); + } + + internal static Datastore DeserializeDatastore(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ResourceIdentifier adxClusterResourceId = default; + string kustoClusterDisplayName = default; + string kustoClusterUri = default; + string kustoDataIngestionUri = default; + string kustoDatabaseName = default; + string kustoManagementUrl = default; + KustoOfferingType kustoOfferingType = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("adxClusterResourceId"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + adxClusterResourceId = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("kustoClusterDisplayName"u8)) + { + kustoClusterDisplayName = property.Value.GetString(); + continue; + } + if (property.NameEquals("kustoClusterUri"u8)) + { + kustoClusterUri = property.Value.GetString(); + continue; + } + if (property.NameEquals("kustoDataIngestionUri"u8)) + { + kustoDataIngestionUri = property.Value.GetString(); + continue; + } + if (property.NameEquals("kustoDatabaseName"u8)) + { + kustoDatabaseName = property.Value.GetString(); + continue; + } + if (property.NameEquals("kustoManagementUrl"u8)) + { + kustoManagementUrl = property.Value.GetString(); + continue; + } + if (property.NameEquals("kustoOfferingType"u8)) + { + kustoOfferingType = new KustoOfferingType(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new Datastore( + adxClusterResourceId, + kustoClusterDisplayName, + kustoClusterUri, + kustoDataIngestionUri, + kustoDatabaseName, + kustoManagementUrl, + kustoOfferingType, + 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(Datastore)} does not support writing '{options.Format}' format."); + } + } + + Datastore IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeDatastore(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(Datastore)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/src/Generated/Models/Datastore.cs b/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/src/Generated/Models/Datastore.cs new file mode 100644 index 000000000000..a5fb7745f3a7 --- /dev/null +++ b/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/src/Generated/Models/Datastore.cs @@ -0,0 +1,111 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.ResourceManager.DatabaseWatcher.Models +{ + /// The properties of a data store. + public partial class Datastore + { + /// + /// 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 Kusto cluster URI. + /// The Kusto data ingestion URI. + /// The name of a Kusto database. + /// The Kusto management URL. + /// The type of a Kusto offering. + /// , , or is null. + public Datastore(string kustoClusterUri, string kustoDataIngestionUri, string kustoDatabaseName, string kustoManagementUri, KustoOfferingType kustoOfferingType) + { + Argument.AssertNotNull(kustoClusterUri, nameof(kustoClusterUri)); + Argument.AssertNotNull(kustoDataIngestionUri, nameof(kustoDataIngestionUri)); + Argument.AssertNotNull(kustoDatabaseName, nameof(kustoDatabaseName)); + Argument.AssertNotNull(kustoManagementUri, nameof(kustoManagementUri)); + + KustoClusterUri = kustoClusterUri; + KustoDataIngestionUri = kustoDataIngestionUri; + KustoDatabaseName = kustoDatabaseName; + KustoManagementUri = kustoManagementUri; + KustoOfferingType = kustoOfferingType; + } + + /// Initializes a new instance of . + /// The Azure resource ID of an Azure Data Explorer cluster. + /// The Kusto cluster display name. + /// The Kusto cluster URI. + /// The Kusto data ingestion URI. + /// The name of a Kusto database. + /// The Kusto management URL. + /// The type of a Kusto offering. + /// Keeps track of any properties unknown to the library. + internal Datastore(ResourceIdentifier adxClusterResourceId, string kustoClusterDisplayName, string kustoClusterUri, string kustoDataIngestionUri, string kustoDatabaseName, string kustoManagementUri, KustoOfferingType kustoOfferingType, IDictionary serializedAdditionalRawData) + { + AdxClusterResourceId = adxClusterResourceId; + KustoClusterDisplayName = kustoClusterDisplayName; + KustoClusterUri = kustoClusterUri; + KustoDataIngestionUri = kustoDataIngestionUri; + KustoDatabaseName = kustoDatabaseName; + KustoManagementUri = kustoManagementUri; + KustoOfferingType = kustoOfferingType; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal Datastore() + { + } + + /// The Azure resource ID of an Azure Data Explorer cluster. + public ResourceIdentifier AdxClusterResourceId { get; set; } + /// The Kusto cluster display name. + public string KustoClusterDisplayName { get; set; } + /// The Kusto cluster URI. + public string KustoClusterUri { get; set; } + /// The Kusto data ingestion URI. + public string KustoDataIngestionUri { get; set; } + /// The name of a Kusto database. + public string KustoDatabaseName { get; set; } + /// The Kusto management URL. + public string KustoManagementUri { get; set; } + /// The type of a Kusto offering. + public KustoOfferingType KustoOfferingType { get; set; } + } +} diff --git a/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/src/Generated/Models/HealthValidationListResult.Serialization.cs b/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/src/Generated/Models/HealthValidationListResult.Serialization.cs new file mode 100644 index 000000000000..c9bb89b1a451 --- /dev/null +++ b/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/src/Generated/Models/HealthValidationListResult.Serialization.cs @@ -0,0 +1,151 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.DatabaseWatcher.Models +{ + internal partial class HealthValidationListResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(HealthValidationListResult)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var item in Value) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + if (Optional.IsDefined(NextLink)) + { + writer.WritePropertyName("nextLink"u8); + writer.WriteStringValue(NextLink.AbsoluteUri); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + HealthValidationListResult 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(HealthValidationListResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeHealthValidationListResult(document.RootElement, options); + } + + internal static HealthValidationListResult DeserializeHealthValidationListResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IReadOnlyList value = default; + Uri nextLink = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(HealthValidationData.DeserializeHealthValidationData(item, options)); + } + value = array; + continue; + } + if (property.NameEquals("nextLink"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + nextLink = new Uri(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new HealthValidationListResult(value, nextLink, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(HealthValidationListResult)} does not support writing '{options.Format}' format."); + } + } + + HealthValidationListResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeHealthValidationListResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(HealthValidationListResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/src/Generated/Models/HealthValidationListResult.cs b/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/src/Generated/Models/HealthValidationListResult.cs new file mode 100644 index 000000000000..7de6b1d74262 --- /dev/null +++ b/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/src/Generated/Models/HealthValidationListResult.cs @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.ResourceManager.DatabaseWatcher.Models +{ + /// The response of a HealthValidation list operation. + internal partial class HealthValidationListResult + { + /// + /// 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 HealthValidation items on this page. + /// is null. + internal HealthValidationListResult(IEnumerable value) + { + Argument.AssertNotNull(value, nameof(value)); + + Value = value.ToList(); + } + + /// Initializes a new instance of . + /// The HealthValidation items on this page. + /// The link to the next page of items. + /// Keeps track of any properties unknown to the library. + internal HealthValidationListResult(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) + { + Value = value; + NextLink = nextLink; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal HealthValidationListResult() + { + } + + /// The HealthValidation items on this page. + public IReadOnlyList Value { get; } + /// The link to the next page of items. + public Uri NextLink { get; } + } +} diff --git a/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/src/Generated/Models/HealthValidationProperties.Serialization.cs b/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/src/Generated/Models/HealthValidationProperties.Serialization.cs new file mode 100644 index 000000000000..3c80423b8ade --- /dev/null +++ b/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/src/Generated/Models/HealthValidationProperties.Serialization.cs @@ -0,0 +1,193 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.DatabaseWatcher.Models +{ + public partial class HealthValidationProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(HealthValidationProperties)} does not support writing '{format}' format."); + } + + if (options.Format != "W") + { + writer.WritePropertyName("startTime"u8); + writer.WriteStringValue(StartOn, "O"); + } + if (options.Format != "W") + { + writer.WritePropertyName("endTime"u8); + writer.WriteStringValue(EndOn, "O"); + } + if (options.Format != "W") + { + writer.WritePropertyName("status"u8); + writer.WriteStringValue(Status.ToString()); + } + if (options.Format != "W") + { + writer.WritePropertyName("issues"u8); + writer.WriteStartArray(); + foreach (var item in Issues) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) + { + writer.WritePropertyName("provisioningState"u8); + writer.WriteStringValue(ProvisioningState.Value.ToString()); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + HealthValidationProperties 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(HealthValidationProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeHealthValidationProperties(document.RootElement, options); + } + + internal static HealthValidationProperties DeserializeHealthValidationProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + DateTimeOffset startTime = default; + DateTimeOffset endTime = default; + ValidationStatus status = default; + IReadOnlyList issues = default; + ResourceProvisioningState? provisioningState = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("startTime"u8)) + { + startTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("endTime"u8)) + { + endTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("status"u8)) + { + status = new ValidationStatus(property.Value.GetString()); + continue; + } + if (property.NameEquals("issues"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ValidationIssue.DeserializeValidationIssue(item, options)); + } + issues = array; + continue; + } + if (property.NameEquals("provisioningState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + provisioningState = new ResourceProvisioningState(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new HealthValidationProperties( + startTime, + endTime, + status, + issues, + provisioningState, + 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(HealthValidationProperties)} does not support writing '{options.Format}' format."); + } + } + + HealthValidationProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeHealthValidationProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(HealthValidationProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/src/Generated/Models/HealthValidationProperties.cs b/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/src/Generated/Models/HealthValidationProperties.cs new file mode 100644 index 000000000000..963f55c00df1 --- /dev/null +++ b/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/src/Generated/Models/HealthValidationProperties.cs @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.ResourceManager.DatabaseWatcher.Models +{ + /// The generic properties of the health validation resource. + public partial class HealthValidationProperties + { + /// + /// 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 start time of health validation, in UTC. + /// The end time of health validation, in UTC. + /// The current health validation status. + /// The list of issues found by health validation. + internal HealthValidationProperties(DateTimeOffset startOn, DateTimeOffset endOn, ValidationStatus status, IEnumerable issues) + { + StartOn = startOn; + EndOn = endOn; + Status = status; + Issues = issues.ToList(); + } + + /// Initializes a new instance of . + /// The start time of health validation, in UTC. + /// The end time of health validation, in UTC. + /// The current health validation status. + /// The list of issues found by health validation. + /// The provisioning state of the health validation resource. + /// Keeps track of any properties unknown to the library. + internal HealthValidationProperties(DateTimeOffset startOn, DateTimeOffset endOn, ValidationStatus status, IReadOnlyList issues, ResourceProvisioningState? provisioningState, IDictionary serializedAdditionalRawData) + { + StartOn = startOn; + EndOn = endOn; + Status = status; + Issues = issues; + ProvisioningState = provisioningState; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal HealthValidationProperties() + { + } + + /// The start time of health validation, in UTC. + public DateTimeOffset StartOn { get; } + /// The end time of health validation, in UTC. + public DateTimeOffset EndOn { get; } + /// The current health validation status. + public ValidationStatus Status { get; } + /// The list of issues found by health validation. + public IReadOnlyList Issues { get; } + /// The provisioning state of the health validation resource. + public ResourceProvisioningState? ProvisioningState { get; } + } +} diff --git a/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/src/Generated/Models/KustoOfferingType.cs b/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/src/Generated/Models/KustoOfferingType.cs new file mode 100644 index 000000000000..5650f0cb4d19 --- /dev/null +++ b/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/src/Generated/Models/KustoOfferingType.cs @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.DatabaseWatcher.Models +{ + /// The type of Kusto offering. + public readonly partial struct KustoOfferingType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public KustoOfferingType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string AdxValue = "adx"; + private const string FreeValue = "free"; + private const string FabricValue = "fabric"; + + /// The Azure Data Explorer cluster Kusto offering. + public static KustoOfferingType Adx { get; } = new KustoOfferingType(AdxValue); + /// The free Azure Data Explorer cluster Kusto offering. + public static KustoOfferingType Free { get; } = new KustoOfferingType(FreeValue); + /// The Fabric Real-Time Analytics Kusto offering. + public static KustoOfferingType Fabric { get; } = new KustoOfferingType(FabricValue); + /// Determines if two values are the same. + public static bool operator ==(KustoOfferingType left, KustoOfferingType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(KustoOfferingType left, KustoOfferingType right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator KustoOfferingType(string value) => new KustoOfferingType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is KustoOfferingType other && Equals(other); + /// + public bool Equals(KustoOfferingType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/src/Generated/Models/ManagedServiceIdentityType.cs b/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/src/Generated/Models/ManagedServiceIdentityType.cs new file mode 100644 index 000000000000..bf830748c396 --- /dev/null +++ b/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/src/Generated/Models/ManagedServiceIdentityType.cs @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.DatabaseWatcher.Models +{ + /// Type of managed service identity (where both SystemAssigned and UserAssigned types are allowed). + public readonly partial struct ManagedServiceIdentityType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public ManagedServiceIdentityType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string NoneValue = "None"; + private const string SystemAssignedValue = "SystemAssigned"; + private const string UserAssignedValue = "UserAssigned"; + private const string SystemAndUserAssignedValue = "SystemAssigned, UserAssigned"; + + /// No managed identity. + public static ManagedServiceIdentityType None { get; } = new ManagedServiceIdentityType(NoneValue); + /// System assigned managed identity. + public static ManagedServiceIdentityType SystemAssigned { get; } = new ManagedServiceIdentityType(SystemAssignedValue); + /// User assigned managed identity. + public static ManagedServiceIdentityType UserAssigned { get; } = new ManagedServiceIdentityType(UserAssignedValue); + /// System and user assigned managed identity. + public static ManagedServiceIdentityType SystemAndUserAssigned { get; } = new ManagedServiceIdentityType(SystemAndUserAssignedValue); + /// Determines if two values are the same. + public static bool operator ==(ManagedServiceIdentityType left, ManagedServiceIdentityType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(ManagedServiceIdentityType left, ManagedServiceIdentityType right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator ManagedServiceIdentityType(string value) => new ManagedServiceIdentityType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is ManagedServiceIdentityType other && Equals(other); + /// + public bool Equals(ManagedServiceIdentityType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/src/Generated/Models/ManagedServiceIdentityV4.Serialization.cs b/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/src/Generated/Models/ManagedServiceIdentityV4.Serialization.cs new file mode 100644 index 000000000000..6f6c061eb3c8 --- /dev/null +++ b/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/src/Generated/Models/ManagedServiceIdentityV4.Serialization.cs @@ -0,0 +1,183 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.DatabaseWatcher.Models +{ + public partial class ManagedServiceIdentityV4 : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ManagedServiceIdentityV4)} does not support writing '{format}' format."); + } + + if (options.Format != "W" && Optional.IsDefined(PrincipalId)) + { + writer.WritePropertyName("principalId"u8); + writer.WriteStringValue(PrincipalId.Value); + } + if (options.Format != "W" && Optional.IsDefined(TenantId)) + { + writer.WritePropertyName("tenantId"u8); + writer.WriteStringValue(TenantId.Value); + } + writer.WritePropertyName("type"u8); + writer.WriteStringValue(Type.ToString()); + if (Optional.IsCollectionDefined(UserAssignedIdentities)) + { + writer.WritePropertyName("userAssignedIdentities"u8); + writer.WriteStartObject(); + foreach (var item in UserAssignedIdentities) + { + writer.WritePropertyName(item.Key); + JsonSerializer.Serialize(writer, item.Value); + } + writer.WriteEndObject(); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + ManagedServiceIdentityV4 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(ManagedServiceIdentityV4)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeManagedServiceIdentityV4(document.RootElement, options); + } + + internal static ManagedServiceIdentityV4 DeserializeManagedServiceIdentityV4(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Guid? principalId = default; + Guid? tenantId = default; + ManagedServiceIdentityType type = default; + IDictionary userAssignedIdentities = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("principalId"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + principalId = property.Value.GetGuid(); + continue; + } + if (property.NameEquals("tenantId"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + tenantId = property.Value.GetGuid(); + continue; + } + if (property.NameEquals("type"u8)) + { + type = new ManagedServiceIdentityType(property.Value.GetString()); + continue; + } + if (property.NameEquals("userAssignedIdentities"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var property0 in property.Value.EnumerateObject()) + { + dictionary.Add(property0.Name, JsonSerializer.Deserialize(property0.Value.GetRawText())); + } + userAssignedIdentities = dictionary; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ManagedServiceIdentityV4(principalId, tenantId, type, userAssignedIdentities ?? new ChangeTrackingDictionary(), 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(ManagedServiceIdentityV4)} does not support writing '{options.Format}' format."); + } + } + + ManagedServiceIdentityV4 IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeManagedServiceIdentityV4(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ManagedServiceIdentityV4)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/src/Generated/Models/ManagedServiceIdentityV4.cs b/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/src/Generated/Models/ManagedServiceIdentityV4.cs new file mode 100644 index 000000000000..284c3a903ae7 --- /dev/null +++ b/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/src/Generated/Models/ManagedServiceIdentityV4.cs @@ -0,0 +1,86 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.DatabaseWatcher.Models +{ + /// Managed service identity (system assigned and/or user assigned identities). + public partial class ManagedServiceIdentityV4 + { + /// + /// 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 type of managed identity assigned to this resource. + public ManagedServiceIdentityV4(ManagedServiceIdentityType type) + { + Type = type; + UserAssignedIdentities = new ChangeTrackingDictionary(); + } + + /// Initializes a new instance of . + /// The service principal ID of the system assigned identity. This property will only be provided for a system assigned identity. + /// The tenant ID of the system assigned identity. This property will only be provided for a system assigned identity. + /// The type of managed identity assigned to this resource. + /// The identities assigned to this resource by the user. + /// Keeps track of any properties unknown to the library. + internal ManagedServiceIdentityV4(Guid? principalId, Guid? tenantId, ManagedServiceIdentityType type, IDictionary userAssignedIdentities, IDictionary serializedAdditionalRawData) + { + PrincipalId = principalId; + TenantId = tenantId; + Type = type; + UserAssignedIdentities = userAssignedIdentities; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal ManagedServiceIdentityV4() + { + } + + /// The service principal ID of the system assigned identity. This property will only be provided for a system assigned identity. + public Guid? PrincipalId { get; } + /// The tenant ID of the system assigned identity. This property will only be provided for a system assigned identity. + public Guid? TenantId { get; } + /// The type of managed identity assigned to this resource. + public ManagedServiceIdentityType Type { get; set; } + /// The identities assigned to this resource by the user. + public IDictionary UserAssignedIdentities { get; } + } +} diff --git a/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/src/Generated/Models/ResourceProvisioningState.cs b/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/src/Generated/Models/ResourceProvisioningState.cs new file mode 100644 index 000000000000..ef613439b6ab --- /dev/null +++ b/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/src/Generated/Models/ResourceProvisioningState.cs @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.DatabaseWatcher.Models +{ + /// The provisioning state of a resource type. + public readonly partial struct ResourceProvisioningState : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public ResourceProvisioningState(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string SucceededValue = "Succeeded"; + private const string FailedValue = "Failed"; + private const string CanceledValue = "Canceled"; + + /// Resource has been created. + public static ResourceProvisioningState Succeeded { get; } = new ResourceProvisioningState(SucceededValue); + /// Resource creation failed. + public static ResourceProvisioningState Failed { get; } = new ResourceProvisioningState(FailedValue); + /// Resource creation was canceled. + public static ResourceProvisioningState Canceled { get; } = new ResourceProvisioningState(CanceledValue); + /// Determines if two values are the same. + public static bool operator ==(ResourceProvisioningState left, ResourceProvisioningState right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(ResourceProvisioningState left, ResourceProvisioningState right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator ResourceProvisioningState(string value) => new ResourceProvisioningState(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is ResourceProvisioningState other && Equals(other); + /// + public bool Equals(ResourceProvisioningState other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/src/Generated/Models/SharedPrivateLinkResourceListResult.Serialization.cs b/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/src/Generated/Models/SharedPrivateLinkResourceListResult.Serialization.cs new file mode 100644 index 000000000000..d5dd91e594f4 --- /dev/null +++ b/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/src/Generated/Models/SharedPrivateLinkResourceListResult.Serialization.cs @@ -0,0 +1,151 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.DatabaseWatcher.Models +{ + internal partial class SharedPrivateLinkResourceListResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SharedPrivateLinkResourceListResult)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var item in Value) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + if (Optional.IsDefined(NextLink)) + { + writer.WritePropertyName("nextLink"u8); + writer.WriteStringValue(NextLink.AbsoluteUri); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + SharedPrivateLinkResourceListResult 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(SharedPrivateLinkResourceListResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeSharedPrivateLinkResourceListResult(document.RootElement, options); + } + + internal static SharedPrivateLinkResourceListResult DeserializeSharedPrivateLinkResourceListResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IReadOnlyList value = default; + Uri nextLink = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(SharedPrivateLinkResourceData.DeserializeSharedPrivateLinkResourceData(item, options)); + } + value = array; + continue; + } + if (property.NameEquals("nextLink"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + nextLink = new Uri(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new SharedPrivateLinkResourceListResult(value, nextLink, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(SharedPrivateLinkResourceListResult)} does not support writing '{options.Format}' format."); + } + } + + SharedPrivateLinkResourceListResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeSharedPrivateLinkResourceListResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(SharedPrivateLinkResourceListResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/src/Generated/Models/SharedPrivateLinkResourceListResult.cs b/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/src/Generated/Models/SharedPrivateLinkResourceListResult.cs new file mode 100644 index 000000000000..bc7a9e3ee202 --- /dev/null +++ b/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/src/Generated/Models/SharedPrivateLinkResourceListResult.cs @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.ResourceManager.DatabaseWatcher.Models +{ + /// The response of a SharedPrivateLinkResource list operation. + internal partial class SharedPrivateLinkResourceListResult + { + /// + /// 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 SharedPrivateLinkResource items on this page. + /// is null. + internal SharedPrivateLinkResourceListResult(IEnumerable value) + { + Argument.AssertNotNull(value, nameof(value)); + + Value = value.ToList(); + } + + /// Initializes a new instance of . + /// The SharedPrivateLinkResource items on this page. + /// The link to the next page of items. + /// Keeps track of any properties unknown to the library. + internal SharedPrivateLinkResourceListResult(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) + { + Value = value; + NextLink = nextLink; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal SharedPrivateLinkResourceListResult() + { + } + + /// The SharedPrivateLinkResource items on this page. + public IReadOnlyList Value { get; } + /// The link to the next page of items. + public Uri NextLink { get; } + } +} diff --git a/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/src/Generated/Models/SharedPrivateLinkResourceProperties.Serialization.cs b/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/src/Generated/Models/SharedPrivateLinkResourceProperties.Serialization.cs new file mode 100644 index 000000000000..188661a910af --- /dev/null +++ b/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/src/Generated/Models/SharedPrivateLinkResourceProperties.Serialization.cs @@ -0,0 +1,190 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.DatabaseWatcher.Models +{ + public partial class SharedPrivateLinkResourceProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SharedPrivateLinkResourceProperties)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("privateLinkResourceId"u8); + writer.WriteStringValue(PrivateLinkResourceId); + writer.WritePropertyName("groupId"u8); + writer.WriteStringValue(GroupId); + writer.WritePropertyName("requestMessage"u8); + writer.WriteStringValue(RequestMessage); + if (Optional.IsDefined(DnsZone)) + { + writer.WritePropertyName("dnsZone"u8); + writer.WriteStringValue(DnsZone); + } + if (options.Format != "W" && Optional.IsDefined(Status)) + { + writer.WritePropertyName("status"u8); + writer.WriteStringValue(Status.Value.ToString()); + } + if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) + { + writer.WritePropertyName("provisioningState"u8); + writer.WriteStringValue(ProvisioningState.Value.ToString()); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + SharedPrivateLinkResourceProperties 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(SharedPrivateLinkResourceProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeSharedPrivateLinkResourceProperties(document.RootElement, options); + } + + internal static SharedPrivateLinkResourceProperties DeserializeSharedPrivateLinkResourceProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ResourceIdentifier privateLinkResourceId = default; + string groupId = default; + string requestMessage = default; + string dnsZone = default; + SharedPrivateLinkResourceStatus? status = default; + ResourceProvisioningState? provisioningState = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("privateLinkResourceId"u8)) + { + privateLinkResourceId = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("groupId"u8)) + { + groupId = property.Value.GetString(); + continue; + } + if (property.NameEquals("requestMessage"u8)) + { + requestMessage = property.Value.GetString(); + continue; + } + if (property.NameEquals("dnsZone"u8)) + { + dnsZone = property.Value.GetString(); + continue; + } + if (property.NameEquals("status"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + status = new SharedPrivateLinkResourceStatus(property.Value.GetString()); + continue; + } + if (property.NameEquals("provisioningState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + provisioningState = new ResourceProvisioningState(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new SharedPrivateLinkResourceProperties( + privateLinkResourceId, + groupId, + requestMessage, + dnsZone, + status, + provisioningState, + 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(SharedPrivateLinkResourceProperties)} does not support writing '{options.Format}' format."); + } + } + + SharedPrivateLinkResourceProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeSharedPrivateLinkResourceProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(SharedPrivateLinkResourceProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/src/Generated/Models/SharedPrivateLinkResourceProperties.cs b/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/src/Generated/Models/SharedPrivateLinkResourceProperties.cs new file mode 100644 index 000000000000..e7a80cc7cca3 --- /dev/null +++ b/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/src/Generated/Models/SharedPrivateLinkResourceProperties.cs @@ -0,0 +1,102 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.ResourceManager.DatabaseWatcher.Models +{ + /// The generic properties of a Shared Private Link resource. + public partial class SharedPrivateLinkResourceProperties + { + /// + /// 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 resource ID of the resource the shared private link resource is for. + /// The group id from the provider of resource the shared private link resource is for. + /// The request message for requesting approval of the shared private link resource. + /// , or is null. + public SharedPrivateLinkResourceProperties(ResourceIdentifier privateLinkResourceId, string groupId, string requestMessage) + { + Argument.AssertNotNull(privateLinkResourceId, nameof(privateLinkResourceId)); + Argument.AssertNotNull(groupId, nameof(groupId)); + Argument.AssertNotNull(requestMessage, nameof(requestMessage)); + + PrivateLinkResourceId = privateLinkResourceId; + GroupId = groupId; + RequestMessage = requestMessage; + } + + /// Initializes a new instance of . + /// The resource ID of the resource the shared private link resource is for. + /// The group id from the provider of resource the shared private link resource is for. + /// The request message for requesting approval of the shared private link resource. + /// The DNS zone segment to be included in the DNS name of the shared private link. Value is required for Azure Data Explorer clusters and SQL managed instances, and must be omitted for SQL logical servers and key vaults. The value is the second segment of the host FQDN name of the resource that the shared private link resource is for. For example: if the host name is 'adx-cluster-21187695.eastus.kusto.windows.net', then the value is 'eastus'; if the host name is 'sql-mi-23961134.767d5869f605.database.windows.net', then the value is '767d5869f605'. + /// Status of the shared private link resource. Can be Pending, Approved, Rejected or Disconnected. + /// The provisioning state of the resource. + /// Keeps track of any properties unknown to the library. + internal SharedPrivateLinkResourceProperties(ResourceIdentifier privateLinkResourceId, string groupId, string requestMessage, string dnsZone, SharedPrivateLinkResourceStatus? status, ResourceProvisioningState? provisioningState, IDictionary serializedAdditionalRawData) + { + PrivateLinkResourceId = privateLinkResourceId; + GroupId = groupId; + RequestMessage = requestMessage; + DnsZone = dnsZone; + Status = status; + ProvisioningState = provisioningState; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal SharedPrivateLinkResourceProperties() + { + } + + /// The resource ID of the resource the shared private link resource is for. + public ResourceIdentifier PrivateLinkResourceId { get; set; } + /// The group id from the provider of resource the shared private link resource is for. + public string GroupId { get; set; } + /// The request message for requesting approval of the shared private link resource. + public string RequestMessage { get; set; } + /// The DNS zone segment to be included in the DNS name of the shared private link. Value is required for Azure Data Explorer clusters and SQL managed instances, and must be omitted for SQL logical servers and key vaults. The value is the second segment of the host FQDN name of the resource that the shared private link resource is for. For example: if the host name is 'adx-cluster-21187695.eastus.kusto.windows.net', then the value is 'eastus'; if the host name is 'sql-mi-23961134.767d5869f605.database.windows.net', then the value is '767d5869f605'. + public string DnsZone { get; set; } + /// Status of the shared private link resource. Can be Pending, Approved, Rejected or Disconnected. + public SharedPrivateLinkResourceStatus? Status { get; } + /// The provisioning state of the resource. + public ResourceProvisioningState? ProvisioningState { get; } + } +} diff --git a/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/src/Generated/Models/SharedPrivateLinkResourceStatus.cs b/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/src/Generated/Models/SharedPrivateLinkResourceStatus.cs new file mode 100644 index 000000000000..b0ac514fd1d4 --- /dev/null +++ b/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/src/Generated/Models/SharedPrivateLinkResourceStatus.cs @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.DatabaseWatcher.Models +{ + /// Status of the shared private link resource. Can be Pending, Approved, Rejected or Disconnected. + public readonly partial struct SharedPrivateLinkResourceStatus : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public SharedPrivateLinkResourceStatus(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string PendingValue = "Pending"; + private const string ApprovedValue = "Approved"; + private const string RejectedValue = "Rejected"; + private const string DisconnectedValue = "Disconnected"; + + /// The shared private link connection request was not yet authorized by the resource owner. + public static SharedPrivateLinkResourceStatus Pending { get; } = new SharedPrivateLinkResourceStatus(PendingValue); + /// The shared private link connection request was approved by the resource owner. + public static SharedPrivateLinkResourceStatus Approved { get; } = new SharedPrivateLinkResourceStatus(ApprovedValue); + /// The shared private link connection request was rejected by the resource owner. + public static SharedPrivateLinkResourceStatus Rejected { get; } = new SharedPrivateLinkResourceStatus(RejectedValue); + /// The shared private link connection request was disconnected by the resource owner. + public static SharedPrivateLinkResourceStatus Disconnected { get; } = new SharedPrivateLinkResourceStatus(DisconnectedValue); + /// Determines if two values are the same. + public static bool operator ==(SharedPrivateLinkResourceStatus left, SharedPrivateLinkResourceStatus right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(SharedPrivateLinkResourceStatus left, SharedPrivateLinkResourceStatus right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator SharedPrivateLinkResourceStatus(string value) => new SharedPrivateLinkResourceStatus(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is SharedPrivateLinkResourceStatus other && Equals(other); + /// + public bool Equals(SharedPrivateLinkResourceStatus other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/src/Generated/Models/SqlDbElasticPoolTargetProperties.Serialization.cs b/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/src/Generated/Models/SqlDbElasticPoolTargetProperties.Serialization.cs new file mode 100644 index 000000000000..4573e62e8fdb --- /dev/null +++ b/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/src/Generated/Models/SqlDbElasticPoolTargetProperties.Serialization.cs @@ -0,0 +1,182 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.DatabaseWatcher.Models +{ + public partial class SqlDbElasticPoolTargetProperties : 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(SqlDbElasticPoolTargetProperties)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + writer.WritePropertyName("sqlEpResourceId"u8); + writer.WriteStringValue(SqlEpResourceId); + writer.WritePropertyName("anchorDatabaseResourceId"u8); + writer.WriteStringValue(AnchorDatabaseResourceId); + if (Optional.IsDefined(ReadIntent)) + { + writer.WritePropertyName("readIntent"u8); + writer.WriteBooleanValue(ReadIntent.Value); + } + } + + SqlDbElasticPoolTargetProperties 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(SqlDbElasticPoolTargetProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeSqlDbElasticPoolTargetProperties(document.RootElement, options); + } + + internal static SqlDbElasticPoolTargetProperties DeserializeSqlDbElasticPoolTargetProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ResourceIdentifier sqlEpResourceId = default; + ResourceIdentifier anchorDatabaseResourceId = default; + bool? readIntent = default; + string targetType = default; + TargetAuthenticationType targetAuthenticationType = default; + VaultSecret targetVault = default; + string connectionServerName = default; + ResourceProvisioningState? provisioningState = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("sqlEpResourceId"u8)) + { + sqlEpResourceId = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("anchorDatabaseResourceId"u8)) + { + anchorDatabaseResourceId = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("readIntent"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + readIntent = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("targetType"u8)) + { + targetType = property.Value.GetString(); + continue; + } + if (property.NameEquals("targetAuthenticationType"u8)) + { + targetAuthenticationType = new TargetAuthenticationType(property.Value.GetString()); + continue; + } + if (property.NameEquals("targetVault"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + targetVault = VaultSecret.DeserializeVaultSecret(property.Value, options); + continue; + } + if (property.NameEquals("connectionServerName"u8)) + { + connectionServerName = property.Value.GetString(); + continue; + } + if (property.NameEquals("provisioningState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + provisioningState = new ResourceProvisioningState(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new SqlDbElasticPoolTargetProperties( + targetType, + targetAuthenticationType, + targetVault, + connectionServerName, + provisioningState, + serializedAdditionalRawData, + sqlEpResourceId, + anchorDatabaseResourceId, + readIntent); + } + + 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(SqlDbElasticPoolTargetProperties)} does not support writing '{options.Format}' format."); + } + } + + SqlDbElasticPoolTargetProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeSqlDbElasticPoolTargetProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(SqlDbElasticPoolTargetProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/src/Generated/Models/SqlDbElasticPoolTargetProperties.cs b/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/src/Generated/Models/SqlDbElasticPoolTargetProperties.cs new file mode 100644 index 000000000000..3b1bc634e486 --- /dev/null +++ b/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/src/Generated/Models/SqlDbElasticPoolTargetProperties.cs @@ -0,0 +1,64 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.ResourceManager.DatabaseWatcher.Models +{ + /// The properties specific to an elastic pool in Azure SQL Database. + public partial class SqlDbElasticPoolTargetProperties : TargetProperties + { + /// Initializes a new instance of . + /// The type of authentication to use when connecting to a target. + /// The FQDN host name of the server to use in the connection string when connecting to a target. For example, for an Azure SQL logical server in the Azure commercial cloud, the value might be 'sql-logical-server-22092780.database.windows.net'; for an Azure SQL managed instance in the Azure commercial cloud, the value might be 'sql-mi-39441134.767d5869f605.database.windows.net'. Port number and instance name must be specified separately. + /// The Azure resource ID of an Azure SQL DB elastic pool target. + /// The Azure resource ID of the anchor database used to connect to an elastic pool. + /// , or is null. + public SqlDbElasticPoolTargetProperties(TargetAuthenticationType targetAuthenticationType, string connectionServerName, ResourceIdentifier sqlEpResourceId, ResourceIdentifier anchorDatabaseResourceId) : base(targetAuthenticationType, connectionServerName) + { + Argument.AssertNotNull(connectionServerName, nameof(connectionServerName)); + Argument.AssertNotNull(sqlEpResourceId, nameof(sqlEpResourceId)); + Argument.AssertNotNull(anchorDatabaseResourceId, nameof(anchorDatabaseResourceId)); + + SqlEpResourceId = sqlEpResourceId; + AnchorDatabaseResourceId = anchorDatabaseResourceId; + TargetType = "SqlEp"; + } + + /// Initializes a new instance of . + /// Discriminator property for TargetProperties. + /// The type of authentication to use when connecting to a target. + /// To use SQL authentication when connecting to targets, specify the vault where the login name and password secrets are stored. + /// The FQDN host name of the server to use in the connection string when connecting to a target. For example, for an Azure SQL logical server in the Azure commercial cloud, the value might be 'sql-logical-server-22092780.database.windows.net'; for an Azure SQL managed instance in the Azure commercial cloud, the value might be 'sql-mi-39441134.767d5869f605.database.windows.net'. Port number and instance name must be specified separately. + /// The provisioning state of the resource. + /// Keeps track of any properties unknown to the library. + /// The Azure resource ID of an Azure SQL DB elastic pool target. + /// The Azure resource ID of the anchor database used to connect to an elastic pool. + /// Set to true to monitor a high availability replica of specified target, if any. + internal SqlDbElasticPoolTargetProperties(string targetType, TargetAuthenticationType targetAuthenticationType, VaultSecret targetVault, string connectionServerName, ResourceProvisioningState? provisioningState, IDictionary serializedAdditionalRawData, ResourceIdentifier sqlEpResourceId, ResourceIdentifier anchorDatabaseResourceId, bool? readIntent) : base(targetType, targetAuthenticationType, targetVault, connectionServerName, provisioningState, serializedAdditionalRawData) + { + SqlEpResourceId = sqlEpResourceId; + AnchorDatabaseResourceId = anchorDatabaseResourceId; + ReadIntent = readIntent; + TargetType = targetType ?? "SqlEp"; + } + + /// Initializes a new instance of for deserialization. + internal SqlDbElasticPoolTargetProperties() + { + } + + /// The Azure resource ID of an Azure SQL DB elastic pool target. + public ResourceIdentifier SqlEpResourceId { get; set; } + /// The Azure resource ID of the anchor database used to connect to an elastic pool. + public ResourceIdentifier AnchorDatabaseResourceId { get; set; } + /// Set to true to monitor a high availability replica of specified target, if any. + public bool? ReadIntent { get; set; } + } +} diff --git a/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/src/Generated/Models/SqlDbSingleDatabaseTargetProperties.Serialization.cs b/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/src/Generated/Models/SqlDbSingleDatabaseTargetProperties.Serialization.cs new file mode 100644 index 000000000000..f43750b9adfa --- /dev/null +++ b/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/src/Generated/Models/SqlDbSingleDatabaseTargetProperties.Serialization.cs @@ -0,0 +1,173 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.DatabaseWatcher.Models +{ + public partial class SqlDbSingleDatabaseTargetProperties : 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(SqlDbSingleDatabaseTargetProperties)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + writer.WritePropertyName("sqlDbResourceId"u8); + writer.WriteStringValue(SqlDbResourceId); + if (Optional.IsDefined(ReadIntent)) + { + writer.WritePropertyName("readIntent"u8); + writer.WriteBooleanValue(ReadIntent.Value); + } + } + + SqlDbSingleDatabaseTargetProperties 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(SqlDbSingleDatabaseTargetProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeSqlDbSingleDatabaseTargetProperties(document.RootElement, options); + } + + internal static SqlDbSingleDatabaseTargetProperties DeserializeSqlDbSingleDatabaseTargetProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ResourceIdentifier sqlDbResourceId = default; + bool? readIntent = default; + string targetType = default; + TargetAuthenticationType targetAuthenticationType = default; + VaultSecret targetVault = default; + string connectionServerName = default; + ResourceProvisioningState? provisioningState = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("sqlDbResourceId"u8)) + { + sqlDbResourceId = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("readIntent"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + readIntent = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("targetType"u8)) + { + targetType = property.Value.GetString(); + continue; + } + if (property.NameEquals("targetAuthenticationType"u8)) + { + targetAuthenticationType = new TargetAuthenticationType(property.Value.GetString()); + continue; + } + if (property.NameEquals("targetVault"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + targetVault = VaultSecret.DeserializeVaultSecret(property.Value, options); + continue; + } + if (property.NameEquals("connectionServerName"u8)) + { + connectionServerName = property.Value.GetString(); + continue; + } + if (property.NameEquals("provisioningState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + provisioningState = new ResourceProvisioningState(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new SqlDbSingleDatabaseTargetProperties( + targetType, + targetAuthenticationType, + targetVault, + connectionServerName, + provisioningState, + serializedAdditionalRawData, + sqlDbResourceId, + readIntent); + } + + 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(SqlDbSingleDatabaseTargetProperties)} does not support writing '{options.Format}' format."); + } + } + + SqlDbSingleDatabaseTargetProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeSqlDbSingleDatabaseTargetProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(SqlDbSingleDatabaseTargetProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/src/Generated/Models/SqlDbSingleDatabaseTargetProperties.cs b/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/src/Generated/Models/SqlDbSingleDatabaseTargetProperties.cs new file mode 100644 index 000000000000..e91b17ceb4bc --- /dev/null +++ b/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/src/Generated/Models/SqlDbSingleDatabaseTargetProperties.cs @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.ResourceManager.DatabaseWatcher.Models +{ + /// The properties specific to a database in Azure SQL Database. + public partial class SqlDbSingleDatabaseTargetProperties : TargetProperties + { + /// Initializes a new instance of . + /// The type of authentication to use when connecting to a target. + /// The FQDN host name of the server to use in the connection string when connecting to a target. For example, for an Azure SQL logical server in the Azure commercial cloud, the value might be 'sql-logical-server-22092780.database.windows.net'; for an Azure SQL managed instance in the Azure commercial cloud, the value might be 'sql-mi-39441134.767d5869f605.database.windows.net'. Port number and instance name must be specified separately. + /// The Azure resource ID of an Azure SQL DB database target. + /// or is null. + public SqlDbSingleDatabaseTargetProperties(TargetAuthenticationType targetAuthenticationType, string connectionServerName, ResourceIdentifier sqlDbResourceId) : base(targetAuthenticationType, connectionServerName) + { + Argument.AssertNotNull(connectionServerName, nameof(connectionServerName)); + Argument.AssertNotNull(sqlDbResourceId, nameof(sqlDbResourceId)); + + SqlDbResourceId = sqlDbResourceId; + TargetType = "SqlDb"; + } + + /// Initializes a new instance of . + /// Discriminator property for TargetProperties. + /// The type of authentication to use when connecting to a target. + /// To use SQL authentication when connecting to targets, specify the vault where the login name and password secrets are stored. + /// The FQDN host name of the server to use in the connection string when connecting to a target. For example, for an Azure SQL logical server in the Azure commercial cloud, the value might be 'sql-logical-server-22092780.database.windows.net'; for an Azure SQL managed instance in the Azure commercial cloud, the value might be 'sql-mi-39441134.767d5869f605.database.windows.net'. Port number and instance name must be specified separately. + /// The provisioning state of the resource. + /// Keeps track of any properties unknown to the library. + /// The Azure resource ID of an Azure SQL DB database target. + /// Set to true to monitor a high availability replica of specified target, if any. + internal SqlDbSingleDatabaseTargetProperties(string targetType, TargetAuthenticationType targetAuthenticationType, VaultSecret targetVault, string connectionServerName, ResourceProvisioningState? provisioningState, IDictionary serializedAdditionalRawData, ResourceIdentifier sqlDbResourceId, bool? readIntent) : base(targetType, targetAuthenticationType, targetVault, connectionServerName, provisioningState, serializedAdditionalRawData) + { + SqlDbResourceId = sqlDbResourceId; + ReadIntent = readIntent; + TargetType = targetType ?? "SqlDb"; + } + + /// Initializes a new instance of for deserialization. + internal SqlDbSingleDatabaseTargetProperties() + { + } + + /// The Azure resource ID of an Azure SQL DB database target. + public ResourceIdentifier SqlDbResourceId { get; set; } + /// Set to true to monitor a high availability replica of specified target, if any. + public bool? ReadIntent { get; set; } + } +} diff --git a/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/src/Generated/Models/SqlMiTargetProperties.Serialization.cs b/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/src/Generated/Models/SqlMiTargetProperties.Serialization.cs new file mode 100644 index 000000000000..5689a5a1dceb --- /dev/null +++ b/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/src/Generated/Models/SqlMiTargetProperties.Serialization.cs @@ -0,0 +1,189 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.DatabaseWatcher.Models +{ + public partial class SqlMiTargetProperties : 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(SqlMiTargetProperties)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + writer.WritePropertyName("sqlMiResourceId"u8); + writer.WriteStringValue(SqlMiResourceId); + if (Optional.IsDefined(ConnectionTcpPort)) + { + writer.WritePropertyName("connectionTcpPort"u8); + writer.WriteNumberValue(ConnectionTcpPort.Value); + } + if (Optional.IsDefined(ReadIntent)) + { + writer.WritePropertyName("readIntent"u8); + writer.WriteBooleanValue(ReadIntent.Value); + } + } + + SqlMiTargetProperties 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(SqlMiTargetProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeSqlMiTargetProperties(document.RootElement, options); + } + + internal static SqlMiTargetProperties DeserializeSqlMiTargetProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ResourceIdentifier sqlMiResourceId = default; + int? connectionTcpPort = default; + bool? readIntent = default; + string targetType = default; + TargetAuthenticationType targetAuthenticationType = default; + VaultSecret targetVault = default; + string connectionServerName = default; + ResourceProvisioningState? provisioningState = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("sqlMiResourceId"u8)) + { + sqlMiResourceId = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("connectionTcpPort"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + connectionTcpPort = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("readIntent"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + readIntent = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("targetType"u8)) + { + targetType = property.Value.GetString(); + continue; + } + if (property.NameEquals("targetAuthenticationType"u8)) + { + targetAuthenticationType = new TargetAuthenticationType(property.Value.GetString()); + continue; + } + if (property.NameEquals("targetVault"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + targetVault = VaultSecret.DeserializeVaultSecret(property.Value, options); + continue; + } + if (property.NameEquals("connectionServerName"u8)) + { + connectionServerName = property.Value.GetString(); + continue; + } + if (property.NameEquals("provisioningState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + provisioningState = new ResourceProvisioningState(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new SqlMiTargetProperties( + targetType, + targetAuthenticationType, + targetVault, + connectionServerName, + provisioningState, + serializedAdditionalRawData, + sqlMiResourceId, + connectionTcpPort, + readIntent); + } + + 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(SqlMiTargetProperties)} does not support writing '{options.Format}' format."); + } + } + + SqlMiTargetProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeSqlMiTargetProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(SqlMiTargetProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/src/Generated/Models/SqlMiTargetProperties.cs b/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/src/Generated/Models/SqlMiTargetProperties.cs new file mode 100644 index 000000000000..42d4e454cc90 --- /dev/null +++ b/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/src/Generated/Models/SqlMiTargetProperties.cs @@ -0,0 +1,61 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.ResourceManager.DatabaseWatcher.Models +{ + /// The properties specific to Azure SQL Managed Instance targets. + public partial class SqlMiTargetProperties : TargetProperties + { + /// Initializes a new instance of . + /// The type of authentication to use when connecting to a target. + /// The FQDN host name of the server to use in the connection string when connecting to a target. For example, for an Azure SQL logical server in the Azure commercial cloud, the value might be 'sql-logical-server-22092780.database.windows.net'; for an Azure SQL managed instance in the Azure commercial cloud, the value might be 'sql-mi-39441134.767d5869f605.database.windows.net'. Port number and instance name must be specified separately. + /// The Azure resource ID of an Azure SQL Managed Instance target. + /// or is null. + public SqlMiTargetProperties(TargetAuthenticationType targetAuthenticationType, string connectionServerName, ResourceIdentifier sqlMiResourceId) : base(targetAuthenticationType, connectionServerName) + { + Argument.AssertNotNull(connectionServerName, nameof(connectionServerName)); + Argument.AssertNotNull(sqlMiResourceId, nameof(sqlMiResourceId)); + + SqlMiResourceId = sqlMiResourceId; + TargetType = "SqlMi"; + } + + /// Initializes a new instance of . + /// Discriminator property for TargetProperties. + /// The type of authentication to use when connecting to a target. + /// To use SQL authentication when connecting to targets, specify the vault where the login name and password secrets are stored. + /// The FQDN host name of the server to use in the connection string when connecting to a target. For example, for an Azure SQL logical server in the Azure commercial cloud, the value might be 'sql-logical-server-22092780.database.windows.net'; for an Azure SQL managed instance in the Azure commercial cloud, the value might be 'sql-mi-39441134.767d5869f605.database.windows.net'. Port number and instance name must be specified separately. + /// The provisioning state of the resource. + /// Keeps track of any properties unknown to the library. + /// The Azure resource ID of an Azure SQL Managed Instance target. + /// The TCP port number to optionally use in the connection string when connecting to an Azure SQL Managed Instance target. + /// Set to true to monitor a high availability replica of specified target, if any. + internal SqlMiTargetProperties(string targetType, TargetAuthenticationType targetAuthenticationType, VaultSecret targetVault, string connectionServerName, ResourceProvisioningState? provisioningState, IDictionary serializedAdditionalRawData, ResourceIdentifier sqlMiResourceId, int? connectionTcpPort, bool? readIntent) : base(targetType, targetAuthenticationType, targetVault, connectionServerName, provisioningState, serializedAdditionalRawData) + { + SqlMiResourceId = sqlMiResourceId; + ConnectionTcpPort = connectionTcpPort; + ReadIntent = readIntent; + TargetType = targetType ?? "SqlMi"; + } + + /// Initializes a new instance of for deserialization. + internal SqlMiTargetProperties() + { + } + + /// The Azure resource ID of an Azure SQL Managed Instance target. + public ResourceIdentifier SqlMiResourceId { get; set; } + /// The TCP port number to optionally use in the connection string when connecting to an Azure SQL Managed Instance target. + public int? ConnectionTcpPort { get; set; } + /// Set to true to monitor a high availability replica of specified target, if any. + public bool? ReadIntent { get; set; } + } +} diff --git a/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/src/Generated/Models/TargetAuthenticationType.cs b/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/src/Generated/Models/TargetAuthenticationType.cs new file mode 100644 index 000000000000..c75adb8f1d8a --- /dev/null +++ b/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/src/Generated/Models/TargetAuthenticationType.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.DatabaseWatcher.Models +{ + /// The type of authentication to use when connecting to a target. + public readonly partial struct TargetAuthenticationType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public TargetAuthenticationType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string AadValue = "Aad"; + private const string SqlValue = "Sql"; + + /// The Azure Active Directory authentication. + public static TargetAuthenticationType Aad { get; } = new TargetAuthenticationType(AadValue); + /// The SQL password authentication. + public static TargetAuthenticationType Sql { get; } = new TargetAuthenticationType(SqlValue); + /// Determines if two values are the same. + public static bool operator ==(TargetAuthenticationType left, TargetAuthenticationType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(TargetAuthenticationType left, TargetAuthenticationType right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator TargetAuthenticationType(string value) => new TargetAuthenticationType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is TargetAuthenticationType other && Equals(other); + /// + public bool Equals(TargetAuthenticationType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/src/Generated/Models/TargetListResult.Serialization.cs b/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/src/Generated/Models/TargetListResult.Serialization.cs new file mode 100644 index 000000000000..2f49056cd2f0 --- /dev/null +++ b/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/src/Generated/Models/TargetListResult.Serialization.cs @@ -0,0 +1,151 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.DatabaseWatcher.Models +{ + internal partial class TargetListResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(TargetListResult)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var item in Value) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + if (Optional.IsDefined(NextLink)) + { + writer.WritePropertyName("nextLink"u8); + writer.WriteStringValue(NextLink.AbsoluteUri); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + TargetListResult 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(TargetListResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeTargetListResult(document.RootElement, options); + } + + internal static TargetListResult DeserializeTargetListResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IReadOnlyList value = default; + Uri nextLink = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(TargetData.DeserializeTargetData(item, options)); + } + value = array; + continue; + } + if (property.NameEquals("nextLink"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + nextLink = new Uri(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new TargetListResult(value, nextLink, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(TargetListResult)} does not support writing '{options.Format}' format."); + } + } + + TargetListResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeTargetListResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(TargetListResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/src/Generated/Models/TargetListResult.cs b/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/src/Generated/Models/TargetListResult.cs new file mode 100644 index 000000000000..259a91b4264e --- /dev/null +++ b/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/src/Generated/Models/TargetListResult.cs @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.ResourceManager.DatabaseWatcher.Models +{ + /// The response of a Target list operation. + internal partial class TargetListResult + { + /// + /// 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 Target items on this page. + /// is null. + internal TargetListResult(IEnumerable value) + { + Argument.AssertNotNull(value, nameof(value)); + + Value = value.ToList(); + } + + /// Initializes a new instance of . + /// The Target items on this page. + /// The link to the next page of items. + /// Keeps track of any properties unknown to the library. + internal TargetListResult(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) + { + Value = value; + NextLink = nextLink; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal TargetListResult() + { + } + + /// The Target items on this page. + public IReadOnlyList Value { get; } + /// The link to the next page of items. + public Uri NextLink { get; } + } +} diff --git a/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/src/Generated/Models/TargetProperties.Serialization.cs b/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/src/Generated/Models/TargetProperties.Serialization.cs new file mode 100644 index 000000000000..339824717aae --- /dev/null +++ b/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/src/Generated/Models/TargetProperties.Serialization.cs @@ -0,0 +1,133 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.DatabaseWatcher.Models +{ + [PersistableModelProxy(typeof(UnknownTargetProperties))] + public partial class TargetProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(TargetProperties)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("targetType"u8); + writer.WriteStringValue(TargetType); + writer.WritePropertyName("targetAuthenticationType"u8); + writer.WriteStringValue(TargetAuthenticationType.ToString()); + if (Optional.IsDefined(TargetVault)) + { + writer.WritePropertyName("targetVault"u8); + writer.WriteObjectValue(TargetVault, options); + } + writer.WritePropertyName("connectionServerName"u8); + writer.WriteStringValue(ConnectionServerName); + if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) + { + writer.WritePropertyName("provisioningState"u8); + writer.WriteStringValue(ProvisioningState.Value.ToString()); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + TargetProperties 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(TargetProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeTargetProperties(document.RootElement, options); + } + + internal static TargetProperties DeserializeTargetProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + if (element.TryGetProperty("targetType", out JsonElement discriminator)) + { + switch (discriminator.GetString()) + { + case "SqlDb": return SqlDbSingleDatabaseTargetProperties.DeserializeSqlDbSingleDatabaseTargetProperties(element, options); + case "SqlEp": return SqlDbElasticPoolTargetProperties.DeserializeSqlDbElasticPoolTargetProperties(element, options); + case "SqlMi": return SqlMiTargetProperties.DeserializeSqlMiTargetProperties(element, options); + } + } + return UnknownTargetProperties.DeserializeUnknownTargetProperties(element, options); + } + + 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(TargetProperties)} does not support writing '{options.Format}' format."); + } + } + + TargetProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeTargetProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(TargetProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/src/Generated/Models/TargetProperties.cs b/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/src/Generated/Models/TargetProperties.cs new file mode 100644 index 000000000000..d1adb92b5d4d --- /dev/null +++ b/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/src/Generated/Models/TargetProperties.cs @@ -0,0 +1,97 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.DatabaseWatcher.Models +{ + /// + /// The generic properties of a target. + /// 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 . + /// + public abstract partial class TargetProperties + { + /// + /// 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 protected IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The type of authentication to use when connecting to a target. + /// The FQDN host name of the server to use in the connection string when connecting to a target. For example, for an Azure SQL logical server in the Azure commercial cloud, the value might be 'sql-logical-server-22092780.database.windows.net'; for an Azure SQL managed instance in the Azure commercial cloud, the value might be 'sql-mi-39441134.767d5869f605.database.windows.net'. Port number and instance name must be specified separately. + /// is null. + protected TargetProperties(TargetAuthenticationType targetAuthenticationType, string connectionServerName) + { + Argument.AssertNotNull(connectionServerName, nameof(connectionServerName)); + + TargetAuthenticationType = targetAuthenticationType; + ConnectionServerName = connectionServerName; + } + + /// Initializes a new instance of . + /// Discriminator property for TargetProperties. + /// The type of authentication to use when connecting to a target. + /// To use SQL authentication when connecting to targets, specify the vault where the login name and password secrets are stored. + /// The FQDN host name of the server to use in the connection string when connecting to a target. For example, for an Azure SQL logical server in the Azure commercial cloud, the value might be 'sql-logical-server-22092780.database.windows.net'; for an Azure SQL managed instance in the Azure commercial cloud, the value might be 'sql-mi-39441134.767d5869f605.database.windows.net'. Port number and instance name must be specified separately. + /// The provisioning state of the resource. + /// Keeps track of any properties unknown to the library. + internal TargetProperties(string targetType, TargetAuthenticationType targetAuthenticationType, VaultSecret targetVault, string connectionServerName, ResourceProvisioningState? provisioningState, IDictionary serializedAdditionalRawData) + { + TargetType = targetType; + TargetAuthenticationType = targetAuthenticationType; + TargetVault = targetVault; + ConnectionServerName = connectionServerName; + ProvisioningState = provisioningState; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal TargetProperties() + { + } + + /// Discriminator property for TargetProperties. + internal string TargetType { get; set; } + /// The type of authentication to use when connecting to a target. + public TargetAuthenticationType TargetAuthenticationType { get; set; } + /// To use SQL authentication when connecting to targets, specify the vault where the login name and password secrets are stored. + public VaultSecret TargetVault { get; set; } + /// The FQDN host name of the server to use in the connection string when connecting to a target. For example, for an Azure SQL logical server in the Azure commercial cloud, the value might be 'sql-logical-server-22092780.database.windows.net'; for an Azure SQL managed instance in the Azure commercial cloud, the value might be 'sql-mi-39441134.767d5869f605.database.windows.net'. Port number and instance name must be specified separately. + public string ConnectionServerName { get; set; } + /// The provisioning state of the resource. + public ResourceProvisioningState? ProvisioningState { get; } + } +} diff --git a/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/src/Generated/Models/UnknownTargetProperties.Serialization.cs b/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/src/Generated/Models/UnknownTargetProperties.Serialization.cs new file mode 100644 index 000000000000..8839205ad17b --- /dev/null +++ b/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/src/Generated/Models/UnknownTargetProperties.Serialization.cs @@ -0,0 +1,148 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.DatabaseWatcher.Models +{ + internal partial class UnknownTargetProperties : 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(TargetProperties)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + } + + TargetProperties 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(TargetProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeTargetProperties(document.RootElement, options); + } + + internal static UnknownTargetProperties DeserializeUnknownTargetProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string targetType = "Unknown"; + TargetAuthenticationType targetAuthenticationType = default; + VaultSecret targetVault = default; + string connectionServerName = default; + ResourceProvisioningState? provisioningState = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("targetType"u8)) + { + targetType = property.Value.GetString(); + continue; + } + if (property.NameEquals("targetAuthenticationType"u8)) + { + targetAuthenticationType = new TargetAuthenticationType(property.Value.GetString()); + continue; + } + if (property.NameEquals("targetVault"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + targetVault = VaultSecret.DeserializeVaultSecret(property.Value, options); + continue; + } + if (property.NameEquals("connectionServerName"u8)) + { + connectionServerName = property.Value.GetString(); + continue; + } + if (property.NameEquals("provisioningState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + provisioningState = new ResourceProvisioningState(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new UnknownTargetProperties( + targetType, + targetAuthenticationType, + targetVault, + connectionServerName, + provisioningState, + 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(TargetProperties)} does not support writing '{options.Format}' format."); + } + } + + TargetProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeTargetProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(TargetProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/src/Generated/Models/UnknownTargetProperties.cs b/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/src/Generated/Models/UnknownTargetProperties.cs new file mode 100644 index 000000000000..76b54f72ec12 --- /dev/null +++ b/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/src/Generated/Models/UnknownTargetProperties.cs @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.DatabaseWatcher.Models +{ + /// Unknown version of TargetProperties. + internal partial class UnknownTargetProperties : TargetProperties + { + /// Initializes a new instance of . + /// Discriminator property for TargetProperties. + /// The type of authentication to use when connecting to a target. + /// To use SQL authentication when connecting to targets, specify the vault where the login name and password secrets are stored. + /// The FQDN host name of the server to use in the connection string when connecting to a target. For example, for an Azure SQL logical server in the Azure commercial cloud, the value might be 'sql-logical-server-22092780.database.windows.net'; for an Azure SQL managed instance in the Azure commercial cloud, the value might be 'sql-mi-39441134.767d5869f605.database.windows.net'. Port number and instance name must be specified separately. + /// The provisioning state of the resource. + /// Keeps track of any properties unknown to the library. + internal UnknownTargetProperties(string targetType, TargetAuthenticationType targetAuthenticationType, VaultSecret targetVault, string connectionServerName, ResourceProvisioningState? provisioningState, IDictionary serializedAdditionalRawData) : base(targetType, targetAuthenticationType, targetVault, connectionServerName, provisioningState, serializedAdditionalRawData) + { + TargetType = targetType ?? "Unknown"; + } + + /// Initializes a new instance of for deserialization. + internal UnknownTargetProperties() + { + } + } +} diff --git a/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/src/Generated/Models/ValidationIssue.Serialization.cs b/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/src/Generated/Models/ValidationIssue.Serialization.cs new file mode 100644 index 000000000000..310bd65bc1e2 --- /dev/null +++ b/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/src/Generated/Models/ValidationIssue.Serialization.cs @@ -0,0 +1,211 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.DatabaseWatcher.Models +{ + public partial class ValidationIssue : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ValidationIssue)} does not support writing '{format}' format."); + } + + if (options.Format != "W") + { + writer.WritePropertyName("errorCode"u8); + writer.WriteStringValue(ErrorCode); + } + if (options.Format != "W") + { + writer.WritePropertyName("errorMessage"u8); + writer.WriteStringValue(ErrorMessage); + } + if (options.Format != "W" && Optional.IsDefined(AdditionalDetails)) + { + writer.WritePropertyName("additionalDetails"u8); + writer.WriteStringValue(AdditionalDetails); + } + if (options.Format != "W") + { + writer.WritePropertyName("recommendationMessage"u8); + writer.WriteStringValue(RecommendationMessage); + } + if (options.Format != "W" && Optional.IsDefined(RecommendationUri)) + { + writer.WritePropertyName("recommendationUrl"u8); + writer.WriteStringValue(RecommendationUri.AbsoluteUri); + } + if (options.Format != "W" && Optional.IsDefined(RelatedResourceId)) + { + writer.WritePropertyName("relatedResourceId"u8); + writer.WriteStringValue(RelatedResourceId); + } + if (options.Format != "W" && Optional.IsDefined(RelatedResourceType)) + { + writer.WritePropertyName("relatedResourceType"u8); + writer.WriteStringValue(RelatedResourceType); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + ValidationIssue 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(ValidationIssue)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeValidationIssue(document.RootElement, options); + } + + internal static ValidationIssue DeserializeValidationIssue(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string errorCode = default; + string errorMessage = default; + string additionalDetails = default; + string recommendationMessage = default; + Uri recommendationUrl = default; + ResourceIdentifier relatedResourceId = default; + string relatedResourceType = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("errorCode"u8)) + { + errorCode = property.Value.GetString(); + continue; + } + if (property.NameEquals("errorMessage"u8)) + { + errorMessage = property.Value.GetString(); + continue; + } + if (property.NameEquals("additionalDetails"u8)) + { + additionalDetails = property.Value.GetString(); + continue; + } + if (property.NameEquals("recommendationMessage"u8)) + { + recommendationMessage = property.Value.GetString(); + continue; + } + if (property.NameEquals("recommendationUrl"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + recommendationUrl = new Uri(property.Value.GetString()); + continue; + } + if (property.NameEquals("relatedResourceId"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + relatedResourceId = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("relatedResourceType"u8)) + { + relatedResourceType = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ValidationIssue( + errorCode, + errorMessage, + additionalDetails, + recommendationMessage, + recommendationUrl, + relatedResourceId, + relatedResourceType, + 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(ValidationIssue)} does not support writing '{options.Format}' format."); + } + } + + ValidationIssue IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeValidationIssue(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ValidationIssue)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/src/Generated/Models/ValidationIssue.cs b/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/src/Generated/Models/ValidationIssue.cs new file mode 100644 index 000000000000..5cf33b03fc68 --- /dev/null +++ b/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/src/Generated/Models/ValidationIssue.cs @@ -0,0 +1,101 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.ResourceManager.DatabaseWatcher.Models +{ + /// The model of a health validation issue. + public partial class ValidationIssue + { + /// + /// 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 error code of the issue. + /// The error message of the issue. + /// The recommendation for resolving the issue. + internal ValidationIssue(string errorCode, string errorMessage, string recommendationMessage) + { + ErrorCode = errorCode; + ErrorMessage = errorMessage; + RecommendationMessage = recommendationMessage; + } + + /// Initializes a new instance of . + /// The error code of the issue. + /// The error message of the issue. + /// The additional details for the issue. + /// The recommendation for resolving the issue. + /// The URL related to resolving the issue. + /// The resource ID of the Azure resource related to the issue. + /// The type of the Azure resource related to the issue. + /// Keeps track of any properties unknown to the library. + internal ValidationIssue(string errorCode, string errorMessage, string additionalDetails, string recommendationMessage, Uri recommendationUri, ResourceIdentifier relatedResourceId, string relatedResourceType, IDictionary serializedAdditionalRawData) + { + ErrorCode = errorCode; + ErrorMessage = errorMessage; + AdditionalDetails = additionalDetails; + RecommendationMessage = recommendationMessage; + RecommendationUri = recommendationUri; + RelatedResourceId = relatedResourceId; + RelatedResourceType = relatedResourceType; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal ValidationIssue() + { + } + + /// The error code of the issue. + public string ErrorCode { get; } + /// The error message of the issue. + public string ErrorMessage { get; } + /// The additional details for the issue. + public string AdditionalDetails { get; } + /// The recommendation for resolving the issue. + public string RecommendationMessage { get; } + /// The URL related to resolving the issue. + public Uri RecommendationUri { get; } + /// The resource ID of the Azure resource related to the issue. + public ResourceIdentifier RelatedResourceId { get; } + /// The type of the Azure resource related to the issue. + public string RelatedResourceType { get; } + } +} diff --git a/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/src/Generated/Models/ValidationStatus.cs b/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/src/Generated/Models/ValidationStatus.cs new file mode 100644 index 000000000000..91cdfb16fa7a --- /dev/null +++ b/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/src/Generated/Models/ValidationStatus.cs @@ -0,0 +1,63 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.DatabaseWatcher.Models +{ + /// Health validation status. + public readonly partial struct ValidationStatus : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public ValidationStatus(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string NotStartedValue = "NotStarted"; + private const string RunningValue = "Running"; + private const string SucceededValue = "Succeeded"; + private const string FailedValue = "Failed"; + private const string CanceledValue = "Canceled"; + private const string TimedOutValue = "TimedOut"; + + /// Health validation has not started. + public static ValidationStatus NotStarted { get; } = new ValidationStatus(NotStartedValue); + /// Health validation is running. + public static ValidationStatus Running { get; } = new ValidationStatus(RunningValue); + /// Health validation completed successfully. + public static ValidationStatus Succeeded { get; } = new ValidationStatus(SucceededValue); + /// Health validation failed. + public static ValidationStatus Failed { get; } = new ValidationStatus(FailedValue); + /// Health validation was canceled. + public static ValidationStatus Canceled { get; } = new ValidationStatus(CanceledValue); + /// Health validation timed out. + public static ValidationStatus TimedOut { get; } = new ValidationStatus(TimedOutValue); + /// Determines if two values are the same. + public static bool operator ==(ValidationStatus left, ValidationStatus right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(ValidationStatus left, ValidationStatus right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator ValidationStatus(string value) => new ValidationStatus(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is ValidationStatus other && Equals(other); + /// + public bool Equals(ValidationStatus other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/src/Generated/Models/VaultSecret.Serialization.cs b/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/src/Generated/Models/VaultSecret.Serialization.cs new file mode 100644 index 000000000000..fb1f3c4357b8 --- /dev/null +++ b/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/src/Generated/Models/VaultSecret.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; + +namespace Azure.ResourceManager.DatabaseWatcher.Models +{ + public partial class VaultSecret : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(VaultSecret)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(AkvResourceId)) + { + writer.WritePropertyName("akvResourceId"u8); + writer.WriteStringValue(AkvResourceId); + } + if (Optional.IsDefined(AkvTargetUser)) + { + writer.WritePropertyName("akvTargetUser"u8); + writer.WriteStringValue(AkvTargetUser); + } + if (Optional.IsDefined(AkvTargetPassword)) + { + writer.WritePropertyName("akvTargetPassword"u8); + writer.WriteStringValue(AkvTargetPassword); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + VaultSecret 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(VaultSecret)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeVaultSecret(document.RootElement, options); + } + + internal static VaultSecret DeserializeVaultSecret(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ResourceIdentifier akvResourceId = default; + string akvTargetUser = default; + string akvTargetPassword = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("akvResourceId"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + akvResourceId = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("akvTargetUser"u8)) + { + akvTargetUser = property.Value.GetString(); + continue; + } + if (property.NameEquals("akvTargetPassword"u8)) + { + akvTargetPassword = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new VaultSecret(akvResourceId, akvTargetUser, akvTargetPassword, 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(VaultSecret)} does not support writing '{options.Format}' format."); + } + } + + VaultSecret IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeVaultSecret(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(VaultSecret)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/src/Generated/Models/VaultSecret.cs b/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/src/Generated/Models/VaultSecret.cs new file mode 100644 index 000000000000..0a2c32493558 --- /dev/null +++ b/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/src/Generated/Models/VaultSecret.cs @@ -0,0 +1,74 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.ResourceManager.DatabaseWatcher.Models +{ + /// The vault specific details required if using SQL authentication to connect to a target. + public partial class VaultSecret + { + /// + /// 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 VaultSecret() + { + } + + /// Initializes a new instance of . + /// The Azure resource ID of the Key Vault instance storing database authentication secrets. + /// The path to the Key Vault secret storing the login name (aka user name, aka account name) for authentication to a target. + /// The path to the Key Vault secret storing the password for authentication to a target. + /// Keeps track of any properties unknown to the library. + internal VaultSecret(ResourceIdentifier akvResourceId, string akvTargetUser, string akvTargetPassword, IDictionary serializedAdditionalRawData) + { + AkvResourceId = akvResourceId; + AkvTargetUser = akvTargetUser; + AkvTargetPassword = akvTargetPassword; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The Azure resource ID of the Key Vault instance storing database authentication secrets. + public ResourceIdentifier AkvResourceId { get; set; } + /// The path to the Key Vault secret storing the login name (aka user name, aka account name) for authentication to a target. + public string AkvTargetUser { get; set; } + /// The path to the Key Vault secret storing the password for authentication to a target. + public string AkvTargetPassword { get; set; } + } +} diff --git a/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/src/Generated/Models/WatcherListResult.Serialization.cs b/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/src/Generated/Models/WatcherListResult.Serialization.cs new file mode 100644 index 000000000000..de252e1abb9e --- /dev/null +++ b/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/src/Generated/Models/WatcherListResult.Serialization.cs @@ -0,0 +1,151 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.DatabaseWatcher.Models +{ + internal partial class WatcherListResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(WatcherListResult)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var item in Value) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + if (Optional.IsDefined(NextLink)) + { + writer.WritePropertyName("nextLink"u8); + writer.WriteStringValue(NextLink.AbsoluteUri); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + WatcherListResult 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(WatcherListResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeWatcherListResult(document.RootElement, options); + } + + internal static WatcherListResult DeserializeWatcherListResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IReadOnlyList value = default; + Uri nextLink = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(WatcherData.DeserializeWatcherData(item, options)); + } + value = array; + continue; + } + if (property.NameEquals("nextLink"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + nextLink = new Uri(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new WatcherListResult(value, nextLink, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(WatcherListResult)} does not support writing '{options.Format}' format."); + } + } + + WatcherListResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeWatcherListResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(WatcherListResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/src/Generated/Models/WatcherListResult.cs b/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/src/Generated/Models/WatcherListResult.cs new file mode 100644 index 000000000000..13fbd3c33992 --- /dev/null +++ b/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/src/Generated/Models/WatcherListResult.cs @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.ResourceManager.DatabaseWatcher.Models +{ + /// The response of a Watcher list operation. + internal partial class WatcherListResult + { + /// + /// 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 Watcher items on this page. + /// is null. + internal WatcherListResult(IEnumerable value) + { + Argument.AssertNotNull(value, nameof(value)); + + Value = value.ToList(); + } + + /// Initializes a new instance of . + /// The Watcher items on this page. + /// The link to the next page of items. + /// Keeps track of any properties unknown to the library. + internal WatcherListResult(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) + { + Value = value; + NextLink = nextLink; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal WatcherListResult() + { + } + + /// The Watcher items on this page. + public IReadOnlyList Value { get; } + /// The link to the next page of items. + public Uri NextLink { get; } + } +} diff --git a/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/src/Generated/Models/WatcherPatch.Serialization.cs b/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/src/Generated/Models/WatcherPatch.Serialization.cs new file mode 100644 index 000000000000..700a3eb45267 --- /dev/null +++ b/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/src/Generated/Models/WatcherPatch.Serialization.cs @@ -0,0 +1,174 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.DatabaseWatcher.Models +{ + public partial class WatcherPatch : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(WatcherPatch)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(Identity)) + { + writer.WritePropertyName("identity"u8); + writer.WriteObjectValue(Identity, options); + } + if (Optional.IsCollectionDefined(Tags)) + { + writer.WritePropertyName("tags"u8); + writer.WriteStartObject(); + foreach (var item in Tags) + { + writer.WritePropertyName(item.Key); + writer.WriteStringValue(item.Value); + } + writer.WriteEndObject(); + } + if (Optional.IsDefined(Properties)) + { + writer.WritePropertyName("properties"u8); + writer.WriteObjectValue(Properties, options); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + WatcherPatch 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(WatcherPatch)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeWatcherPatch(document.RootElement, options); + } + + internal static WatcherPatch DeserializeWatcherPatch(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ManagedServiceIdentityV4 identity = default; + IDictionary tags = default; + WatcherUpdateProperties properties = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("identity"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + identity = ManagedServiceIdentityV4.DeserializeManagedServiceIdentityV4(property.Value, options); + 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("properties"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + properties = WatcherUpdateProperties.DeserializeWatcherUpdateProperties(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new WatcherPatch(identity, tags ?? new ChangeTrackingDictionary(), 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(WatcherPatch)} does not support writing '{options.Format}' format."); + } + } + + WatcherPatch IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeWatcherPatch(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(WatcherPatch)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/src/Generated/Models/WatcherPatch.cs b/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/src/Generated/Models/WatcherPatch.cs new file mode 100644 index 000000000000..59324b3e1f44 --- /dev/null +++ b/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/src/Generated/Models/WatcherPatch.cs @@ -0,0 +1,74 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.DatabaseWatcher.Models +{ + /// The type used for update operations of the Watcher. + public partial class WatcherPatch + { + /// + /// 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 WatcherPatch() + { + Tags = new ChangeTrackingDictionary(); + } + + /// Initializes a new instance of . + /// The managed service identities assigned to this resource. + /// Resource tags. + /// The resource-specific properties for this resource. + /// Keeps track of any properties unknown to the library. + internal WatcherPatch(ManagedServiceIdentityV4 identity, IDictionary tags, WatcherUpdateProperties properties, IDictionary serializedAdditionalRawData) + { + Identity = identity; + Tags = tags; + Properties = properties; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The managed service identities assigned to this resource. + public ManagedServiceIdentityV4 Identity { get; set; } + /// Resource tags. + public IDictionary Tags { get; } + /// The resource-specific properties for this resource. + public WatcherUpdateProperties Properties { get; set; } + } +} diff --git a/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/src/Generated/Models/WatcherProperties.Serialization.cs b/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/src/Generated/Models/WatcherProperties.Serialization.cs new file mode 100644 index 000000000000..4ab4881f4833 --- /dev/null +++ b/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/src/Generated/Models/WatcherProperties.Serialization.cs @@ -0,0 +1,178 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.DatabaseWatcher.Models +{ + public partial class WatcherProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(WatcherProperties)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(Datastore)) + { + writer.WritePropertyName("datastore"u8); + writer.WriteObjectValue(Datastore, options); + } + if (options.Format != "W" && Optional.IsDefined(Status)) + { + writer.WritePropertyName("status"u8); + writer.WriteStringValue(Status.Value.ToString()); + } + if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) + { + writer.WritePropertyName("provisioningState"u8); + writer.WriteStringValue(ProvisioningState.Value.ToString()); + } + if (Optional.IsDefined(DefaultAlertRuleIdentityResourceId)) + { + writer.WritePropertyName("defaultAlertRuleIdentityResourceId"u8); + writer.WriteStringValue(DefaultAlertRuleIdentityResourceId); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + WatcherProperties 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(WatcherProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeWatcherProperties(document.RootElement, options); + } + + internal static WatcherProperties DeserializeWatcherProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Datastore datastore = default; + WatcherStatus? status = default; + DatabaseWatcherProvisioningState? provisioningState = default; + ResourceIdentifier defaultAlertRuleIdentityResourceId = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("datastore"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + datastore = Datastore.DeserializeDatastore(property.Value, options); + continue; + } + if (property.NameEquals("status"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + status = new WatcherStatus(property.Value.GetString()); + continue; + } + if (property.NameEquals("provisioningState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + provisioningState = new DatabaseWatcherProvisioningState(property.Value.GetString()); + continue; + } + if (property.NameEquals("defaultAlertRuleIdentityResourceId"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + defaultAlertRuleIdentityResourceId = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new WatcherProperties(datastore, status, provisioningState, defaultAlertRuleIdentityResourceId, 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(WatcherProperties)} does not support writing '{options.Format}' format."); + } + } + + WatcherProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeWatcherProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(WatcherProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/src/Generated/Models/WatcherProperties.cs b/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/src/Generated/Models/WatcherProperties.cs new file mode 100644 index 000000000000..1d6b63a67ef7 --- /dev/null +++ b/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/src/Generated/Models/WatcherProperties.cs @@ -0,0 +1,78 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.ResourceManager.DatabaseWatcher.Models +{ + /// The RP specific properties of the resource. + public partial class WatcherProperties + { + /// + /// 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 WatcherProperties() + { + } + + /// Initializes a new instance of . + /// The data store for collected monitoring data. + /// The monitoring collection status of the watcher. + /// The provisioning state of the resource watcher. + /// The resource ID of a user-assigned managed identity that will be assigned to a new alert rule. + /// Keeps track of any properties unknown to the library. + internal WatcherProperties(Datastore datastore, WatcherStatus? status, DatabaseWatcherProvisioningState? provisioningState, ResourceIdentifier defaultAlertRuleIdentityResourceId, IDictionary serializedAdditionalRawData) + { + Datastore = datastore; + Status = status; + ProvisioningState = provisioningState; + DefaultAlertRuleIdentityResourceId = defaultAlertRuleIdentityResourceId; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The data store for collected monitoring data. + public Datastore Datastore { get; set; } + /// The monitoring collection status of the watcher. + public WatcherStatus? Status { get; } + /// The provisioning state of the resource watcher. + public DatabaseWatcherProvisioningState? ProvisioningState { get; } + /// The resource ID of a user-assigned managed identity that will be assigned to a new alert rule. + public ResourceIdentifier DefaultAlertRuleIdentityResourceId { get; set; } + } +} diff --git a/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/src/Generated/Models/WatcherStatus.cs b/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/src/Generated/Models/WatcherStatus.cs new file mode 100644 index 000000000000..302a581fe79e --- /dev/null +++ b/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/src/Generated/Models/WatcherStatus.cs @@ -0,0 +1,60 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.DatabaseWatcher.Models +{ + /// The monitoring collection status of a watcher. + public readonly partial struct WatcherStatus : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public WatcherStatus(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string StartingValue = "Starting"; + private const string RunningValue = "Running"; + private const string StoppingValue = "Stopping"; + private const string StoppedValue = "Stopped"; + private const string DeletingValue = "Deleting"; + + /// Denotes the watcher is in a starting state. + public static WatcherStatus Starting { get; } = new WatcherStatus(StartingValue); + /// Denotes the watcher is in a running state. + public static WatcherStatus Running { get; } = new WatcherStatus(RunningValue); + /// Denotes the watcher is in a stopping state. + public static WatcherStatus Stopping { get; } = new WatcherStatus(StoppingValue); + /// Denotes the watcher is in a stopped state. + public static WatcherStatus Stopped { get; } = new WatcherStatus(StoppedValue); + /// Denotes the watcher is in a deleting state. + public static WatcherStatus Deleting { get; } = new WatcherStatus(DeletingValue); + /// Determines if two values are the same. + public static bool operator ==(WatcherStatus left, WatcherStatus right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(WatcherStatus left, WatcherStatus right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator WatcherStatus(string value) => new WatcherStatus(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is WatcherStatus other && Equals(other); + /// + public bool Equals(WatcherStatus other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/src/Generated/Models/WatcherUpdateProperties.Serialization.cs b/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/src/Generated/Models/WatcherUpdateProperties.Serialization.cs new file mode 100644 index 000000000000..02dbddbb9cdd --- /dev/null +++ b/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/src/Generated/Models/WatcherUpdateProperties.Serialization.cs @@ -0,0 +1,148 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.DatabaseWatcher.Models +{ + public partial class WatcherUpdateProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(WatcherUpdateProperties)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(Datastore)) + { + writer.WritePropertyName("datastore"u8); + writer.WriteObjectValue(Datastore, options); + } + if (Optional.IsDefined(DefaultAlertRuleIdentityResourceId)) + { + writer.WritePropertyName("defaultAlertRuleIdentityResourceId"u8); + writer.WriteStringValue(DefaultAlertRuleIdentityResourceId); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + WatcherUpdateProperties 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(WatcherUpdateProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeWatcherUpdateProperties(document.RootElement, options); + } + + internal static WatcherUpdateProperties DeserializeWatcherUpdateProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Datastore datastore = default; + ResourceIdentifier defaultAlertRuleIdentityResourceId = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("datastore"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + datastore = Datastore.DeserializeDatastore(property.Value, options); + continue; + } + if (property.NameEquals("defaultAlertRuleIdentityResourceId"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + defaultAlertRuleIdentityResourceId = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new WatcherUpdateProperties(datastore, defaultAlertRuleIdentityResourceId, 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(WatcherUpdateProperties)} does not support writing '{options.Format}' format."); + } + } + + WatcherUpdateProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeWatcherUpdateProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(WatcherUpdateProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/src/Generated/Models/WatcherUpdateProperties.cs b/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/src/Generated/Models/WatcherUpdateProperties.cs new file mode 100644 index 000000000000..efbe98de6d9e --- /dev/null +++ b/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/src/Generated/Models/WatcherUpdateProperties.cs @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.ResourceManager.DatabaseWatcher.Models +{ + /// The updatable properties of the Watcher. + public partial class WatcherUpdateProperties + { + /// + /// 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 WatcherUpdateProperties() + { + } + + /// Initializes a new instance of . + /// The data store for collected monitoring data. + /// The resource ID of a user-assigned managed identity that will be assigned to a new alert rule. + /// Keeps track of any properties unknown to the library. + internal WatcherUpdateProperties(Datastore datastore, ResourceIdentifier defaultAlertRuleIdentityResourceId, IDictionary serializedAdditionalRawData) + { + Datastore = datastore; + DefaultAlertRuleIdentityResourceId = defaultAlertRuleIdentityResourceId; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The data store for collected monitoring data. + public Datastore Datastore { get; set; } + /// The resource ID of a user-assigned managed identity that will be assigned to a new alert rule. + public ResourceIdentifier DefaultAlertRuleIdentityResourceId { get; set; } + } +} diff --git a/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/src/Generated/ProviderConstants.cs b/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/src/Generated/ProviderConstants.cs new file mode 100644 index 000000000000..4bbac7bcb68c --- /dev/null +++ b/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/src/Generated/ProviderConstants.cs @@ -0,0 +1,16 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.DatabaseWatcher +{ + internal static class ProviderConstants + { + public static string DefaultProviderNamespace { get; } = ClientDiagnostics.GetResourceProviderNamespace(typeof(ProviderConstants).Assembly); + } +} diff --git a/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/src/Generated/RestOperations/AlertRuleResourcesRestOperations.cs b/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/src/Generated/RestOperations/AlertRuleResourcesRestOperations.cs new file mode 100644 index 000000000000..2c9fb5ca2e7f --- /dev/null +++ b/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/src/Generated/RestOperations/AlertRuleResourcesRestOperations.cs @@ -0,0 +1,523 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.DatabaseWatcher.Models; + +namespace Azure.ResourceManager.DatabaseWatcher +{ + internal partial class AlertRuleResourcesRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of AlertRuleResourcesRestOperations. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// The application id to use for user agent. + /// Service host. + /// The API version to use for this operation. + /// or is null. + public AlertRuleResourcesRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + { + _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); + _endpoint = endpoint ?? new Uri("https://management.azure.com"); + _apiVersion = apiVersion ?? "2025-01-02"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string watcherName, string alertRuleResourceName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DatabaseWatcher/watchers/", false); + uri.AppendPath(watcherName, true); + uri.AppendPath("/alertRuleResources/", false); + uri.AppendPath(alertRuleResourceName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string watcherName, string alertRuleResourceName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DatabaseWatcher/watchers/", false); + uri.AppendPath(watcherName, true); + uri.AppendPath("/alertRuleResources/", false); + uri.AppendPath(alertRuleResourceName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Get a AlertRuleResource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The database watcher name. + /// The alert rule proxy resource name. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task> GetAsync(string subscriptionId, string resourceGroupName, string watcherName, string alertRuleResourceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(watcherName, nameof(watcherName)); + Argument.AssertNotNullOrEmpty(alertRuleResourceName, nameof(alertRuleResourceName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, watcherName, alertRuleResourceName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + AlertRuleResourceData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = AlertRuleResourceData.DeserializeAlertRuleResourceData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((AlertRuleResourceData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// Get a AlertRuleResource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The database watcher name. + /// The alert rule proxy resource name. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response Get(string subscriptionId, string resourceGroupName, string watcherName, string alertRuleResourceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(watcherName, nameof(watcherName)); + Argument.AssertNotNullOrEmpty(alertRuleResourceName, nameof(alertRuleResourceName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, watcherName, alertRuleResourceName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + AlertRuleResourceData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = AlertRuleResourceData.DeserializeAlertRuleResourceData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((AlertRuleResourceData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateCreateOrUpdateRequestUri(string subscriptionId, string resourceGroupName, string watcherName, string alertRuleResourceName, AlertRuleResourceData data) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DatabaseWatcher/watchers/", false); + uri.AppendPath(watcherName, true); + uri.AppendPath("/alertRuleResources/", false); + uri.AppendPath(alertRuleResourceName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string resourceGroupName, string watcherName, string alertRuleResourceName, AlertRuleResourceData data) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Put; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DatabaseWatcher/watchers/", false); + uri.AppendPath(watcherName, true); + uri.AppendPath("/alertRuleResources/", false); + uri.AppendPath(alertRuleResourceName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(data, ModelSerializationExtensions.WireOptions); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Create a AlertRuleResource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The database watcher name. + /// The alert rule proxy resource name. + /// Resource create parameters. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task> CreateOrUpdateAsync(string subscriptionId, string resourceGroupName, string watcherName, string alertRuleResourceName, AlertRuleResourceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(watcherName, nameof(watcherName)); + Argument.AssertNotNullOrEmpty(alertRuleResourceName, nameof(alertRuleResourceName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, watcherName, alertRuleResourceName, data); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 201: + { + AlertRuleResourceData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = AlertRuleResourceData.DeserializeAlertRuleResourceData(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Create a AlertRuleResource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The database watcher name. + /// The alert rule proxy resource name. + /// Resource create parameters. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response CreateOrUpdate(string subscriptionId, string resourceGroupName, string watcherName, string alertRuleResourceName, AlertRuleResourceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(watcherName, nameof(watcherName)); + Argument.AssertNotNullOrEmpty(alertRuleResourceName, nameof(alertRuleResourceName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, watcherName, alertRuleResourceName, data); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 201: + { + AlertRuleResourceData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = AlertRuleResourceData.DeserializeAlertRuleResourceData(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string resourceGroupName, string watcherName, string alertRuleResourceName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DatabaseWatcher/watchers/", false); + uri.AppendPath(watcherName, true); + uri.AppendPath("/alertRuleResources/", false); + uri.AppendPath(alertRuleResourceName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string watcherName, string alertRuleResourceName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Delete; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DatabaseWatcher/watchers/", false); + uri.AppendPath(watcherName, true); + uri.AppendPath("/alertRuleResources/", false); + uri.AppendPath(alertRuleResourceName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Delete a AlertRuleResource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The database watcher name. + /// The alert rule proxy resource name. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task DeleteAsync(string subscriptionId, string resourceGroupName, string watcherName, string alertRuleResourceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(watcherName, nameof(watcherName)); + Argument.AssertNotNullOrEmpty(alertRuleResourceName, nameof(alertRuleResourceName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, watcherName, alertRuleResourceName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Delete a AlertRuleResource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The database watcher name. + /// The alert rule proxy resource name. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response Delete(string subscriptionId, string resourceGroupName, string watcherName, string alertRuleResourceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(watcherName, nameof(watcherName)); + Argument.AssertNotNullOrEmpty(alertRuleResourceName, nameof(alertRuleResourceName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, watcherName, alertRuleResourceName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListByParentRequestUri(string subscriptionId, string resourceGroupName, string watcherName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DatabaseWatcher/watchers/", false); + uri.AppendPath(watcherName, true); + uri.AppendPath("/alertRuleResources", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateListByParentRequest(string subscriptionId, string resourceGroupName, string watcherName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DatabaseWatcher/watchers/", false); + uri.AppendPath(watcherName, true); + uri.AppendPath("/alertRuleResources", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List AlertRuleResource resources by Watcher. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The database watcher name. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> ListByParentAsync(string subscriptionId, string resourceGroupName, string watcherName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(watcherName, nameof(watcherName)); + + using var message = CreateListByParentRequest(subscriptionId, resourceGroupName, watcherName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + AlertRuleResourceListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = AlertRuleResourceListResult.DeserializeAlertRuleResourceListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List AlertRuleResource resources by Watcher. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The database watcher name. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response ListByParent(string subscriptionId, string resourceGroupName, string watcherName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(watcherName, nameof(watcherName)); + + using var message = CreateListByParentRequest(subscriptionId, resourceGroupName, watcherName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + AlertRuleResourceListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = AlertRuleResourceListResult.DeserializeAlertRuleResourceListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListByParentNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string watcherName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateListByParentNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string watcherName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List AlertRuleResource resources by Watcher. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The database watcher name. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> ListByParentNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string watcherName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(watcherName, nameof(watcherName)); + + using var message = CreateListByParentNextPageRequest(nextLink, subscriptionId, resourceGroupName, watcherName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + AlertRuleResourceListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = AlertRuleResourceListResult.DeserializeAlertRuleResourceListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List AlertRuleResource resources by Watcher. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The database watcher name. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response ListByParentNextPage(string nextLink, string subscriptionId, string resourceGroupName, string watcherName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(watcherName, nameof(watcherName)); + + using var message = CreateListByParentNextPageRequest(nextLink, subscriptionId, resourceGroupName, watcherName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + AlertRuleResourceListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = AlertRuleResourceListResult.DeserializeAlertRuleResourceListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/src/Generated/RestOperations/HealthValidationsRestOperations.cs b/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/src/Generated/RestOperations/HealthValidationsRestOperations.cs new file mode 100644 index 000000000000..37df4a8b8142 --- /dev/null +++ b/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/src/Generated/RestOperations/HealthValidationsRestOperations.cs @@ -0,0 +1,415 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.DatabaseWatcher.Models; + +namespace Azure.ResourceManager.DatabaseWatcher +{ + internal partial class HealthValidationsRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of HealthValidationsRestOperations. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// The application id to use for user agent. + /// Service host. + /// The API version to use for this operation. + /// or is null. + public HealthValidationsRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + { + _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); + _endpoint = endpoint ?? new Uri("https://management.azure.com"); + _apiVersion = apiVersion ?? "2025-01-02"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string watcherName, string healthValidationName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DatabaseWatcher/watchers/", false); + uri.AppendPath(watcherName, true); + uri.AppendPath("/healthValidations/", false); + uri.AppendPath(healthValidationName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string watcherName, string healthValidationName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DatabaseWatcher/watchers/", false); + uri.AppendPath(watcherName, true); + uri.AppendPath("/healthValidations/", false); + uri.AppendPath(healthValidationName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Get a HealthValidation. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The database watcher name. + /// The health validation resource name. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task> GetAsync(string subscriptionId, string resourceGroupName, string watcherName, string healthValidationName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(watcherName, nameof(watcherName)); + Argument.AssertNotNullOrEmpty(healthValidationName, nameof(healthValidationName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, watcherName, healthValidationName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + HealthValidationData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = HealthValidationData.DeserializeHealthValidationData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((HealthValidationData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// Get a HealthValidation. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The database watcher name. + /// The health validation resource name. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response Get(string subscriptionId, string resourceGroupName, string watcherName, string healthValidationName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(watcherName, nameof(watcherName)); + Argument.AssertNotNullOrEmpty(healthValidationName, nameof(healthValidationName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, watcherName, healthValidationName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + HealthValidationData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = HealthValidationData.DeserializeHealthValidationData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((HealthValidationData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListByParentRequestUri(string subscriptionId, string resourceGroupName, string watcherName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DatabaseWatcher/watchers/", false); + uri.AppendPath(watcherName, true); + uri.AppendPath("/healthValidations", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateListByParentRequest(string subscriptionId, string resourceGroupName, string watcherName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DatabaseWatcher/watchers/", false); + uri.AppendPath(watcherName, true); + uri.AppendPath("/healthValidations", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List HealthValidation resources by Watcher. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The database watcher name. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> ListByParentAsync(string subscriptionId, string resourceGroupName, string watcherName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(watcherName, nameof(watcherName)); + + using var message = CreateListByParentRequest(subscriptionId, resourceGroupName, watcherName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + HealthValidationListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = HealthValidationListResult.DeserializeHealthValidationListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List HealthValidation resources by Watcher. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The database watcher name. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response ListByParent(string subscriptionId, string resourceGroupName, string watcherName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(watcherName, nameof(watcherName)); + + using var message = CreateListByParentRequest(subscriptionId, resourceGroupName, watcherName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + HealthValidationListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = HealthValidationListResult.DeserializeHealthValidationListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateStartValidationRequestUri(string subscriptionId, string resourceGroupName, string watcherName, string healthValidationName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DatabaseWatcher/watchers/", false); + uri.AppendPath(watcherName, true); + uri.AppendPath("/healthValidations/", false); + uri.AppendPath(healthValidationName, true); + uri.AppendPath("/startValidation", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateStartValidationRequest(string subscriptionId, string resourceGroupName, string watcherName, string healthValidationName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DatabaseWatcher/watchers/", false); + uri.AppendPath(watcherName, true); + uri.AppendPath("/healthValidations/", false); + uri.AppendPath(healthValidationName, true); + uri.AppendPath("/startValidation", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Starts health validation for a watcher. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The database watcher name. + /// The health validation resource name. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task StartValidationAsync(string subscriptionId, string resourceGroupName, string watcherName, string healthValidationName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(watcherName, nameof(watcherName)); + Argument.AssertNotNullOrEmpty(healthValidationName, nameof(healthValidationName)); + + using var message = CreateStartValidationRequest(subscriptionId, resourceGroupName, watcherName, healthValidationName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 202: + case 200: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Starts health validation for a watcher. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The database watcher name. + /// The health validation resource name. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response StartValidation(string subscriptionId, string resourceGroupName, string watcherName, string healthValidationName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(watcherName, nameof(watcherName)); + Argument.AssertNotNullOrEmpty(healthValidationName, nameof(healthValidationName)); + + using var message = CreateStartValidationRequest(subscriptionId, resourceGroupName, watcherName, healthValidationName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 202: + case 200: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListByParentNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string watcherName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateListByParentNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string watcherName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List HealthValidation resources by Watcher. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The database watcher name. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> ListByParentNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string watcherName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(watcherName, nameof(watcherName)); + + using var message = CreateListByParentNextPageRequest(nextLink, subscriptionId, resourceGroupName, watcherName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + HealthValidationListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = HealthValidationListResult.DeserializeHealthValidationListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List HealthValidation resources by Watcher. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The database watcher name. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response ListByParentNextPage(string nextLink, string subscriptionId, string resourceGroupName, string watcherName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(watcherName, nameof(watcherName)); + + using var message = CreateListByParentNextPageRequest(nextLink, subscriptionId, resourceGroupName, watcherName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + HealthValidationListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = HealthValidationListResult.DeserializeHealthValidationListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/src/Generated/RestOperations/SharedPrivateLinkResourcesRestOperations.cs b/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/src/Generated/RestOperations/SharedPrivateLinkResourcesRestOperations.cs new file mode 100644 index 000000000000..3ab54b61518a --- /dev/null +++ b/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/src/Generated/RestOperations/SharedPrivateLinkResourcesRestOperations.cs @@ -0,0 +1,513 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.DatabaseWatcher.Models; + +namespace Azure.ResourceManager.DatabaseWatcher +{ + internal partial class SharedPrivateLinkResourcesRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of SharedPrivateLinkResourcesRestOperations. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// The application id to use for user agent. + /// Service host. + /// The API version to use for this operation. + /// or is null. + public SharedPrivateLinkResourcesRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + { + _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); + _endpoint = endpoint ?? new Uri("https://management.azure.com"); + _apiVersion = apiVersion ?? "2025-01-02"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string watcherName, string sharedPrivateLinkResourceName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DatabaseWatcher/watchers/", false); + uri.AppendPath(watcherName, true); + uri.AppendPath("/sharedPrivateLinkResources/", false); + uri.AppendPath(sharedPrivateLinkResourceName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string watcherName, string sharedPrivateLinkResourceName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DatabaseWatcher/watchers/", false); + uri.AppendPath(watcherName, true); + uri.AppendPath("/sharedPrivateLinkResources/", false); + uri.AppendPath(sharedPrivateLinkResourceName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Get a SharedPrivateLinkResource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The database watcher name. + /// The Shared Private Link resource name. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task> GetAsync(string subscriptionId, string resourceGroupName, string watcherName, string sharedPrivateLinkResourceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(watcherName, nameof(watcherName)); + Argument.AssertNotNullOrEmpty(sharedPrivateLinkResourceName, nameof(sharedPrivateLinkResourceName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, watcherName, sharedPrivateLinkResourceName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + SharedPrivateLinkResourceData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = SharedPrivateLinkResourceData.DeserializeSharedPrivateLinkResourceData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((SharedPrivateLinkResourceData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// Get a SharedPrivateLinkResource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The database watcher name. + /// The Shared Private Link resource name. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response Get(string subscriptionId, string resourceGroupName, string watcherName, string sharedPrivateLinkResourceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(watcherName, nameof(watcherName)); + Argument.AssertNotNullOrEmpty(sharedPrivateLinkResourceName, nameof(sharedPrivateLinkResourceName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, watcherName, sharedPrivateLinkResourceName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + SharedPrivateLinkResourceData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = SharedPrivateLinkResourceData.DeserializeSharedPrivateLinkResourceData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((SharedPrivateLinkResourceData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateCreateRequestUri(string subscriptionId, string resourceGroupName, string watcherName, string sharedPrivateLinkResourceName, SharedPrivateLinkResourceData data) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DatabaseWatcher/watchers/", false); + uri.AppendPath(watcherName, true); + uri.AppendPath("/sharedPrivateLinkResources/", false); + uri.AppendPath(sharedPrivateLinkResourceName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateCreateRequest(string subscriptionId, string resourceGroupName, string watcherName, string sharedPrivateLinkResourceName, SharedPrivateLinkResourceData data) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Put; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DatabaseWatcher/watchers/", false); + uri.AppendPath(watcherName, true); + uri.AppendPath("/sharedPrivateLinkResources/", false); + uri.AppendPath(sharedPrivateLinkResourceName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(data, ModelSerializationExtensions.WireOptions); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Create a SharedPrivateLinkResource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The database watcher name. + /// The Shared Private Link resource name. + /// Resource create parameters. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task CreateAsync(string subscriptionId, string resourceGroupName, string watcherName, string sharedPrivateLinkResourceName, SharedPrivateLinkResourceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(watcherName, nameof(watcherName)); + Argument.AssertNotNullOrEmpty(sharedPrivateLinkResourceName, nameof(sharedPrivateLinkResourceName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateRequest(subscriptionId, resourceGroupName, watcherName, sharedPrivateLinkResourceName, data); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 201: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Create a SharedPrivateLinkResource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The database watcher name. + /// The Shared Private Link resource name. + /// Resource create parameters. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response Create(string subscriptionId, string resourceGroupName, string watcherName, string sharedPrivateLinkResourceName, SharedPrivateLinkResourceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(watcherName, nameof(watcherName)); + Argument.AssertNotNullOrEmpty(sharedPrivateLinkResourceName, nameof(sharedPrivateLinkResourceName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateRequest(subscriptionId, resourceGroupName, watcherName, sharedPrivateLinkResourceName, data); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 201: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string resourceGroupName, string watcherName, string sharedPrivateLinkResourceName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DatabaseWatcher/watchers/", false); + uri.AppendPath(watcherName, true); + uri.AppendPath("/sharedPrivateLinkResources/", false); + uri.AppendPath(sharedPrivateLinkResourceName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string watcherName, string sharedPrivateLinkResourceName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Delete; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DatabaseWatcher/watchers/", false); + uri.AppendPath(watcherName, true); + uri.AppendPath("/sharedPrivateLinkResources/", false); + uri.AppendPath(sharedPrivateLinkResourceName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Delete a SharedPrivateLinkResource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The database watcher name. + /// The Shared Private Link resource name. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task DeleteAsync(string subscriptionId, string resourceGroupName, string watcherName, string sharedPrivateLinkResourceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(watcherName, nameof(watcherName)); + Argument.AssertNotNullOrEmpty(sharedPrivateLinkResourceName, nameof(sharedPrivateLinkResourceName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, watcherName, sharedPrivateLinkResourceName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Delete a SharedPrivateLinkResource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The database watcher name. + /// The Shared Private Link resource name. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response Delete(string subscriptionId, string resourceGroupName, string watcherName, string sharedPrivateLinkResourceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(watcherName, nameof(watcherName)); + Argument.AssertNotNullOrEmpty(sharedPrivateLinkResourceName, nameof(sharedPrivateLinkResourceName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, watcherName, sharedPrivateLinkResourceName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListByWatcherRequestUri(string subscriptionId, string resourceGroupName, string watcherName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DatabaseWatcher/watchers/", false); + uri.AppendPath(watcherName, true); + uri.AppendPath("/sharedPrivateLinkResources", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateListByWatcherRequest(string subscriptionId, string resourceGroupName, string watcherName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DatabaseWatcher/watchers/", false); + uri.AppendPath(watcherName, true); + uri.AppendPath("/sharedPrivateLinkResources", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List SharedPrivateLinkResource resources by Watcher. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The database watcher name. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> ListByWatcherAsync(string subscriptionId, string resourceGroupName, string watcherName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(watcherName, nameof(watcherName)); + + using var message = CreateListByWatcherRequest(subscriptionId, resourceGroupName, watcherName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + SharedPrivateLinkResourceListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = SharedPrivateLinkResourceListResult.DeserializeSharedPrivateLinkResourceListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List SharedPrivateLinkResource resources by Watcher. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The database watcher name. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response ListByWatcher(string subscriptionId, string resourceGroupName, string watcherName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(watcherName, nameof(watcherName)); + + using var message = CreateListByWatcherRequest(subscriptionId, resourceGroupName, watcherName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + SharedPrivateLinkResourceListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = SharedPrivateLinkResourceListResult.DeserializeSharedPrivateLinkResourceListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListByWatcherNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string watcherName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateListByWatcherNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string watcherName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List SharedPrivateLinkResource resources by Watcher. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The database watcher name. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> ListByWatcherNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string watcherName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(watcherName, nameof(watcherName)); + + using var message = CreateListByWatcherNextPageRequest(nextLink, subscriptionId, resourceGroupName, watcherName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + SharedPrivateLinkResourceListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = SharedPrivateLinkResourceListResult.DeserializeSharedPrivateLinkResourceListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List SharedPrivateLinkResource resources by Watcher. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The database watcher name. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response ListByWatcherNextPage(string nextLink, string subscriptionId, string resourceGroupName, string watcherName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(watcherName, nameof(watcherName)); + + using var message = CreateListByWatcherNextPageRequest(nextLink, subscriptionId, resourceGroupName, watcherName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + SharedPrivateLinkResourceListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = SharedPrivateLinkResourceListResult.DeserializeSharedPrivateLinkResourceListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/src/Generated/RestOperations/TargetsRestOperations.cs b/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/src/Generated/RestOperations/TargetsRestOperations.cs new file mode 100644 index 000000000000..373a87db6065 --- /dev/null +++ b/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/src/Generated/RestOperations/TargetsRestOperations.cs @@ -0,0 +1,523 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.DatabaseWatcher.Models; + +namespace Azure.ResourceManager.DatabaseWatcher +{ + internal partial class TargetsRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of TargetsRestOperations. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// The application id to use for user agent. + /// Service host. + /// The API version to use for this operation. + /// or is null. + public TargetsRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + { + _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); + _endpoint = endpoint ?? new Uri("https://management.azure.com"); + _apiVersion = apiVersion ?? "2025-01-02"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string watcherName, string targetName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DatabaseWatcher/watchers/", false); + uri.AppendPath(watcherName, true); + uri.AppendPath("/targets/", false); + uri.AppendPath(targetName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string watcherName, string targetName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DatabaseWatcher/watchers/", false); + uri.AppendPath(watcherName, true); + uri.AppendPath("/targets/", false); + uri.AppendPath(targetName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Get a Target. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The database watcher name. + /// The target resource name. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task> GetAsync(string subscriptionId, string resourceGroupName, string watcherName, string targetName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(watcherName, nameof(watcherName)); + Argument.AssertNotNullOrEmpty(targetName, nameof(targetName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, watcherName, targetName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + TargetData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = TargetData.DeserializeTargetData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((TargetData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// Get a Target. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The database watcher name. + /// The target resource name. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response Get(string subscriptionId, string resourceGroupName, string watcherName, string targetName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(watcherName, nameof(watcherName)); + Argument.AssertNotNullOrEmpty(targetName, nameof(targetName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, watcherName, targetName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + TargetData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = TargetData.DeserializeTargetData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((TargetData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateCreateOrUpdateRequestUri(string subscriptionId, string resourceGroupName, string watcherName, string targetName, TargetData data) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DatabaseWatcher/watchers/", false); + uri.AppendPath(watcherName, true); + uri.AppendPath("/targets/", false); + uri.AppendPath(targetName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string resourceGroupName, string watcherName, string targetName, TargetData data) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Put; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DatabaseWatcher/watchers/", false); + uri.AppendPath(watcherName, true); + uri.AppendPath("/targets/", false); + uri.AppendPath(targetName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(data, ModelSerializationExtensions.WireOptions); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Create a Target. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The database watcher name. + /// The target resource name. + /// Resource create parameters. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task> CreateOrUpdateAsync(string subscriptionId, string resourceGroupName, string watcherName, string targetName, TargetData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(watcherName, nameof(watcherName)); + Argument.AssertNotNullOrEmpty(targetName, nameof(targetName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, watcherName, targetName, data); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 201: + { + TargetData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = TargetData.DeserializeTargetData(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Create a Target. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The database watcher name. + /// The target resource name. + /// Resource create parameters. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response CreateOrUpdate(string subscriptionId, string resourceGroupName, string watcherName, string targetName, TargetData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(watcherName, nameof(watcherName)); + Argument.AssertNotNullOrEmpty(targetName, nameof(targetName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, watcherName, targetName, data); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 201: + { + TargetData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = TargetData.DeserializeTargetData(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string resourceGroupName, string watcherName, string targetName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DatabaseWatcher/watchers/", false); + uri.AppendPath(watcherName, true); + uri.AppendPath("/targets/", false); + uri.AppendPath(targetName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string watcherName, string targetName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Delete; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DatabaseWatcher/watchers/", false); + uri.AppendPath(watcherName, true); + uri.AppendPath("/targets/", false); + uri.AppendPath(targetName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Delete a Target. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The database watcher name. + /// The target resource name. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task DeleteAsync(string subscriptionId, string resourceGroupName, string watcherName, string targetName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(watcherName, nameof(watcherName)); + Argument.AssertNotNullOrEmpty(targetName, nameof(targetName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, watcherName, targetName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Delete a Target. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The database watcher name. + /// The target resource name. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response Delete(string subscriptionId, string resourceGroupName, string watcherName, string targetName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(watcherName, nameof(watcherName)); + Argument.AssertNotNullOrEmpty(targetName, nameof(targetName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, watcherName, targetName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListByWatcherRequestUri(string subscriptionId, string resourceGroupName, string watcherName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DatabaseWatcher/watchers/", false); + uri.AppendPath(watcherName, true); + uri.AppendPath("/targets", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateListByWatcherRequest(string subscriptionId, string resourceGroupName, string watcherName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DatabaseWatcher/watchers/", false); + uri.AppendPath(watcherName, true); + uri.AppendPath("/targets", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List Target resources by Watcher. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The database watcher name. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> ListByWatcherAsync(string subscriptionId, string resourceGroupName, string watcherName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(watcherName, nameof(watcherName)); + + using var message = CreateListByWatcherRequest(subscriptionId, resourceGroupName, watcherName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + TargetListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = TargetListResult.DeserializeTargetListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List Target resources by Watcher. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The database watcher name. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response ListByWatcher(string subscriptionId, string resourceGroupName, string watcherName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(watcherName, nameof(watcherName)); + + using var message = CreateListByWatcherRequest(subscriptionId, resourceGroupName, watcherName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + TargetListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = TargetListResult.DeserializeTargetListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListByWatcherNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string watcherName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateListByWatcherNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string watcherName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List Target resources by Watcher. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The database watcher name. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> ListByWatcherNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string watcherName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(watcherName, nameof(watcherName)); + + using var message = CreateListByWatcherNextPageRequest(nextLink, subscriptionId, resourceGroupName, watcherName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + TargetListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = TargetListResult.DeserializeTargetListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List Target resources by Watcher. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The database watcher name. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response ListByWatcherNextPage(string nextLink, string subscriptionId, string resourceGroupName, string watcherName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(watcherName, nameof(watcherName)); + + using var message = CreateListByWatcherNextPageRequest(nextLink, subscriptionId, resourceGroupName, watcherName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + TargetListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = TargetListResult.DeserializeTargetListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/src/Generated/RestOperations/WatchersRestOperations.cs b/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/src/Generated/RestOperations/WatchersRestOperations.cs new file mode 100644 index 000000000000..5d32fbe3a59d --- /dev/null +++ b/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/src/Generated/RestOperations/WatchersRestOperations.cs @@ -0,0 +1,895 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.DatabaseWatcher.Models; + +namespace Azure.ResourceManager.DatabaseWatcher +{ + internal partial class WatchersRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of WatchersRestOperations. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// The application id to use for user agent. + /// Service host. + /// The API version to use for this operation. + /// or is null. + public WatchersRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + { + _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); + _endpoint = endpoint ?? new Uri("https://management.azure.com"); + _apiVersion = apiVersion ?? "2025-01-02"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string watcherName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DatabaseWatcher/watchers/", false); + uri.AppendPath(watcherName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string watcherName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DatabaseWatcher/watchers/", false); + uri.AppendPath(watcherName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Get a Watcher. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The database watcher name. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> GetAsync(string subscriptionId, string resourceGroupName, string watcherName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(watcherName, nameof(watcherName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, watcherName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + WatcherData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = WatcherData.DeserializeWatcherData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((WatcherData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// Get a Watcher. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The database watcher name. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response Get(string subscriptionId, string resourceGroupName, string watcherName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(watcherName, nameof(watcherName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, watcherName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + WatcherData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = WatcherData.DeserializeWatcherData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((WatcherData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateCreateOrUpdateRequestUri(string subscriptionId, string resourceGroupName, string watcherName, WatcherData data) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DatabaseWatcher/watchers/", false); + uri.AppendPath(watcherName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string resourceGroupName, string watcherName, WatcherData data) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Put; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DatabaseWatcher/watchers/", false); + uri.AppendPath(watcherName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(data, ModelSerializationExtensions.WireOptions); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Create a Watcher. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The database watcher name. + /// Resource create parameters. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task CreateOrUpdateAsync(string subscriptionId, string resourceGroupName, string watcherName, WatcherData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(watcherName, nameof(watcherName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, watcherName, data); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 201: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Create a Watcher. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The database watcher name. + /// Resource create parameters. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response CreateOrUpdate(string subscriptionId, string resourceGroupName, string watcherName, WatcherData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(watcherName, nameof(watcherName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, watcherName, data); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 201: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateUpdateRequestUri(string subscriptionId, string resourceGroupName, string watcherName, WatcherPatch patch) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DatabaseWatcher/watchers/", false); + uri.AppendPath(watcherName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceGroupName, string watcherName, WatcherPatch patch) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Patch; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DatabaseWatcher/watchers/", false); + uri.AppendPath(watcherName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(patch, ModelSerializationExtensions.WireOptions); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Update a Watcher. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The database watcher name. + /// The resource properties to be updated. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task UpdateAsync(string subscriptionId, string resourceGroupName, string watcherName, WatcherPatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(watcherName, nameof(watcherName)); + Argument.AssertNotNull(patch, nameof(patch)); + + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, watcherName, patch); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Update a Watcher. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The database watcher name. + /// The resource properties to be updated. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response Update(string subscriptionId, string resourceGroupName, string watcherName, WatcherPatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(watcherName, nameof(watcherName)); + Argument.AssertNotNull(patch, nameof(patch)); + + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, watcherName, patch); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string resourceGroupName, string watcherName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DatabaseWatcher/watchers/", false); + uri.AppendPath(watcherName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string watcherName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Delete; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DatabaseWatcher/watchers/", false); + uri.AppendPath(watcherName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Delete a Watcher. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The database watcher name. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task DeleteAsync(string subscriptionId, string resourceGroupName, string watcherName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(watcherName, nameof(watcherName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, watcherName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Delete a Watcher. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The database watcher name. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response Delete(string subscriptionId, string resourceGroupName, string watcherName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(watcherName, nameof(watcherName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, watcherName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListByResourceGroupRequestUri(string subscriptionId, string resourceGroupName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DatabaseWatcher/watchers", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateListByResourceGroupRequest(string subscriptionId, string resourceGroupName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DatabaseWatcher/watchers", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List Watcher resources by resource group. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + public async Task> ListByResourceGroupAsync(string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + + using var message = CreateListByResourceGroupRequest(subscriptionId, resourceGroupName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + WatcherListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = WatcherListResult.DeserializeWatcherListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List Watcher resources by resource group. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + public Response ListByResourceGroup(string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + + using var message = CreateListByResourceGroupRequest(subscriptionId, resourceGroupName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + WatcherListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = WatcherListResult.DeserializeWatcherListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListBySubscriptionRequestUri(string subscriptionId) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/providers/Microsoft.DatabaseWatcher/watchers", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateListBySubscriptionRequest(string subscriptionId) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/providers/Microsoft.DatabaseWatcher/watchers", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List Watcher resources by subscription ID. + /// The ID of the target subscription. The value must be an UUID. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + public async Task> ListBySubscriptionAsync(string subscriptionId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + + using var message = CreateListBySubscriptionRequest(subscriptionId); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + WatcherListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = WatcherListResult.DeserializeWatcherListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List Watcher resources by subscription ID. + /// The ID of the target subscription. The value must be an UUID. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + public Response ListBySubscription(string subscriptionId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + + using var message = CreateListBySubscriptionRequest(subscriptionId); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + WatcherListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = WatcherListResult.DeserializeWatcherListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateStartRequestUri(string subscriptionId, string resourceGroupName, string watcherName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DatabaseWatcher/watchers/", false); + uri.AppendPath(watcherName, true); + uri.AppendPath("/start", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateStartRequest(string subscriptionId, string resourceGroupName, string watcherName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DatabaseWatcher/watchers/", false); + uri.AppendPath(watcherName, true); + uri.AppendPath("/start", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// The action to start monitoring all targets configured for a database watcher. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The database watcher name. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task StartAsync(string subscriptionId, string resourceGroupName, string watcherName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(watcherName, nameof(watcherName)); + + using var message = CreateStartRequest(subscriptionId, resourceGroupName, watcherName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 202: + case 200: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// The action to start monitoring all targets configured for a database watcher. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The database watcher name. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response Start(string subscriptionId, string resourceGroupName, string watcherName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(watcherName, nameof(watcherName)); + + using var message = CreateStartRequest(subscriptionId, resourceGroupName, watcherName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 202: + case 200: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateStopRequestUri(string subscriptionId, string resourceGroupName, string watcherName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DatabaseWatcher/watchers/", false); + uri.AppendPath(watcherName, true); + uri.AppendPath("/stop", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateStopRequest(string subscriptionId, string resourceGroupName, string watcherName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DatabaseWatcher/watchers/", false); + uri.AppendPath(watcherName, true); + uri.AppendPath("/stop", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// The action to stop monitoring all targets configured for a database watcher. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The database watcher name. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task StopAsync(string subscriptionId, string resourceGroupName, string watcherName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(watcherName, nameof(watcherName)); + + using var message = CreateStopRequest(subscriptionId, resourceGroupName, watcherName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 202: + case 200: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// The action to stop monitoring all targets configured for a database watcher. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The database watcher name. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response Stop(string subscriptionId, string resourceGroupName, string watcherName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(watcherName, nameof(watcherName)); + + using var message = CreateStopRequest(subscriptionId, resourceGroupName, watcherName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 202: + case 200: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListByResourceGroupNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateListByResourceGroupNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List Watcher resources by resource group. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The cancellation token to use. + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + public async Task> ListByResourceGroupNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + + using var message = CreateListByResourceGroupNextPageRequest(nextLink, subscriptionId, resourceGroupName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + WatcherListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = WatcherListResult.DeserializeWatcherListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List Watcher resources by resource group. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The cancellation token to use. + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + public Response ListByResourceGroupNextPage(string nextLink, string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + + using var message = CreateListByResourceGroupNextPageRequest(nextLink, subscriptionId, resourceGroupName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + WatcherListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = WatcherListResult.DeserializeWatcherListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListBySubscriptionNextPageRequestUri(string nextLink, string subscriptionId) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateListBySubscriptionNextPageRequest(string nextLink, string subscriptionId) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List Watcher resources by subscription ID. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + public async Task> ListBySubscriptionNextPageAsync(string nextLink, string subscriptionId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + + using var message = CreateListBySubscriptionNextPageRequest(nextLink, subscriptionId); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + WatcherListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = WatcherListResult.DeserializeWatcherListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List Watcher resources by subscription ID. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + public Response ListBySubscriptionNextPage(string nextLink, string subscriptionId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + + using var message = CreateListBySubscriptionNextPageRequest(nextLink, subscriptionId); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + WatcherListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = WatcherListResult.DeserializeWatcherListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/src/Generated/SharedPrivateLinkResource.Serialization.cs b/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/src/Generated/SharedPrivateLinkResource.Serialization.cs new file mode 100644 index 000000000000..f50fbe916eab --- /dev/null +++ b/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/src/Generated/SharedPrivateLinkResource.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.DatabaseWatcher +{ + public partial class SharedPrivateLinkResource : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); + + SharedPrivateLinkResourceData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options); + + SharedPrivateLinkResourceData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options); + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); + } +} diff --git a/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/src/Generated/SharedPrivateLinkResource.cs b/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/src/Generated/SharedPrivateLinkResource.cs new file mode 100644 index 000000000000..9a49a30dacff --- /dev/null +++ b/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/src/Generated/SharedPrivateLinkResource.cs @@ -0,0 +1,347 @@ +// 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.DatabaseWatcher +{ + /// + /// A Class representing a SharedPrivateLinkResource 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 GetSharedPrivateLinkResource method. + /// Otherwise you can get one from its parent resource using the GetSharedPrivateLinkResource method. + /// + public partial class SharedPrivateLinkResource : ArmResource + { + /// Generate the resource identifier of a instance. + /// The subscriptionId. + /// The resourceGroupName. + /// The watcherName. + /// The sharedPrivateLinkResourceName. + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string watcherName, string sharedPrivateLinkResourceName) + { + var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseWatcher/watchers/{watcherName}/sharedPrivateLinkResources/{sharedPrivateLinkResourceName}"; + return new ResourceIdentifier(resourceId); + } + + private readonly ClientDiagnostics _sharedPrivateLinkResourceClientDiagnostics; + private readonly SharedPrivateLinkResourcesRestOperations _sharedPrivateLinkResourceRestClient; + private readonly SharedPrivateLinkResourceData _data; + + /// Gets the resource type for the operations. + public static readonly ResourceType ResourceType = "Microsoft.DatabaseWatcher/watchers/sharedPrivateLinkResources"; + + /// Initializes a new instance of the class for mocking. + protected SharedPrivateLinkResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal SharedPrivateLinkResource(ArmClient client, SharedPrivateLinkResourceData 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 SharedPrivateLinkResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _sharedPrivateLinkResourceClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.DatabaseWatcher", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string sharedPrivateLinkResourceApiVersion); + _sharedPrivateLinkResourceRestClient = new SharedPrivateLinkResourcesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, sharedPrivateLinkResourceApiVersion); +#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 SharedPrivateLinkResourceData 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 SharedPrivateLinkResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseWatcher/watchers/{watcherName}/sharedPrivateLinkResources/{sharedPrivateLinkResourceName} + /// + /// + /// Operation Id + /// SharedPrivateLinkResource_Get + /// + /// + /// Default Api Version + /// 2025-01-02 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _sharedPrivateLinkResourceClientDiagnostics.CreateScope("SharedPrivateLinkResource.Get"); + scope.Start(); + try + { + var response = await _sharedPrivateLinkResourceRestClient.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 SharedPrivateLinkResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a SharedPrivateLinkResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseWatcher/watchers/{watcherName}/sharedPrivateLinkResources/{sharedPrivateLinkResourceName} + /// + /// + /// Operation Id + /// SharedPrivateLinkResource_Get + /// + /// + /// Default Api Version + /// 2025-01-02 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _sharedPrivateLinkResourceClientDiagnostics.CreateScope("SharedPrivateLinkResource.Get"); + scope.Start(); + try + { + var response = _sharedPrivateLinkResourceRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new SharedPrivateLinkResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Delete a SharedPrivateLinkResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseWatcher/watchers/{watcherName}/sharedPrivateLinkResources/{sharedPrivateLinkResourceName} + /// + /// + /// Operation Id + /// SharedPrivateLinkResource_Delete + /// + /// + /// Default Api Version + /// 2025-01-02 + /// + /// + /// 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 = _sharedPrivateLinkResourceClientDiagnostics.CreateScope("SharedPrivateLinkResource.Delete"); + scope.Start(); + try + { + var response = await _sharedPrivateLinkResourceRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + var operation = new DatabaseWatcherArmOperation(_sharedPrivateLinkResourceClientDiagnostics, Pipeline, _sharedPrivateLinkResourceRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Delete a SharedPrivateLinkResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseWatcher/watchers/{watcherName}/sharedPrivateLinkResources/{sharedPrivateLinkResourceName} + /// + /// + /// Operation Id + /// SharedPrivateLinkResource_Delete + /// + /// + /// Default Api Version + /// 2025-01-02 + /// + /// + /// 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 = _sharedPrivateLinkResourceClientDiagnostics.CreateScope("SharedPrivateLinkResource.Delete"); + scope.Start(); + try + { + var response = _sharedPrivateLinkResourceRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + var operation = new DatabaseWatcherArmOperation(_sharedPrivateLinkResourceClientDiagnostics, Pipeline, _sharedPrivateLinkResourceRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletionResponse(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Create a SharedPrivateLinkResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseWatcher/watchers/{watcherName}/sharedPrivateLinkResources/{sharedPrivateLinkResourceName} + /// + /// + /// Operation Id + /// SharedPrivateLinkResource_Create + /// + /// + /// Default Api Version + /// 2025-01-02 + /// + /// + /// 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, SharedPrivateLinkResourceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _sharedPrivateLinkResourceClientDiagnostics.CreateScope("SharedPrivateLinkResource.Update"); + scope.Start(); + try + { + var response = await _sharedPrivateLinkResourceRestClient.CreateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, cancellationToken).ConfigureAwait(false); + var operation = new DatabaseWatcherArmOperation(new SharedPrivateLinkResourceOperationSource(Client), _sharedPrivateLinkResourceClientDiagnostics, Pipeline, _sharedPrivateLinkResourceRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, 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 SharedPrivateLinkResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseWatcher/watchers/{watcherName}/sharedPrivateLinkResources/{sharedPrivateLinkResourceName} + /// + /// + /// Operation Id + /// SharedPrivateLinkResource_Create + /// + /// + /// Default Api Version + /// 2025-01-02 + /// + /// + /// 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, SharedPrivateLinkResourceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _sharedPrivateLinkResourceClientDiagnostics.CreateScope("SharedPrivateLinkResource.Update"); + scope.Start(); + try + { + var response = _sharedPrivateLinkResourceRestClient.Create(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, cancellationToken); + var operation = new DatabaseWatcherArmOperation(new SharedPrivateLinkResourceOperationSource(Client), _sharedPrivateLinkResourceClientDiagnostics, Pipeline, _sharedPrivateLinkResourceRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/src/Generated/SharedPrivateLinkResourceCollection.cs b/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/src/Generated/SharedPrivateLinkResourceCollection.cs new file mode 100644 index 000000000000..381ddc746320 --- /dev/null +++ b/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/src/Generated/SharedPrivateLinkResourceCollection.cs @@ -0,0 +1,493 @@ +// 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.DatabaseWatcher +{ + /// + /// 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 GetSharedPrivateLinkResources method from an instance of . + /// + public partial class SharedPrivateLinkResourceCollection : ArmCollection, IEnumerable, IAsyncEnumerable + { + private readonly ClientDiagnostics _sharedPrivateLinkResourceClientDiagnostics; + private readonly SharedPrivateLinkResourcesRestOperations _sharedPrivateLinkResourceRestClient; + + /// Initializes a new instance of the class for mocking. + protected SharedPrivateLinkResourceCollection() + { + } + + /// 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 SharedPrivateLinkResourceCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _sharedPrivateLinkResourceClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.DatabaseWatcher", SharedPrivateLinkResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(SharedPrivateLinkResource.ResourceType, out string sharedPrivateLinkResourceApiVersion); + _sharedPrivateLinkResourceRestClient = new SharedPrivateLinkResourcesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, sharedPrivateLinkResourceApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != WatcherResource.ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, WatcherResource.ResourceType), nameof(id)); + } + + /// + /// Create a SharedPrivateLinkResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseWatcher/watchers/{watcherName}/sharedPrivateLinkResources/{sharedPrivateLinkResourceName} + /// + /// + /// Operation Id + /// SharedPrivateLinkResource_Create + /// + /// + /// Default Api Version + /// 2025-01-02 + /// + /// + /// 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 Shared Private Link resource name. + /// 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 sharedPrivateLinkResourceName, SharedPrivateLinkResourceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(sharedPrivateLinkResourceName, nameof(sharedPrivateLinkResourceName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _sharedPrivateLinkResourceClientDiagnostics.CreateScope("SharedPrivateLinkResourceCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = await _sharedPrivateLinkResourceRestClient.CreateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, sharedPrivateLinkResourceName, data, cancellationToken).ConfigureAwait(false); + var operation = new DatabaseWatcherArmOperation(new SharedPrivateLinkResourceOperationSource(Client), _sharedPrivateLinkResourceClientDiagnostics, Pipeline, _sharedPrivateLinkResourceRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, sharedPrivateLinkResourceName, 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 SharedPrivateLinkResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseWatcher/watchers/{watcherName}/sharedPrivateLinkResources/{sharedPrivateLinkResourceName} + /// + /// + /// Operation Id + /// SharedPrivateLinkResource_Create + /// + /// + /// Default Api Version + /// 2025-01-02 + /// + /// + /// 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 Shared Private Link resource name. + /// 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 sharedPrivateLinkResourceName, SharedPrivateLinkResourceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(sharedPrivateLinkResourceName, nameof(sharedPrivateLinkResourceName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _sharedPrivateLinkResourceClientDiagnostics.CreateScope("SharedPrivateLinkResourceCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = _sharedPrivateLinkResourceRestClient.Create(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, sharedPrivateLinkResourceName, data, cancellationToken); + var operation = new DatabaseWatcherArmOperation(new SharedPrivateLinkResourceOperationSource(Client), _sharedPrivateLinkResourceClientDiagnostics, Pipeline, _sharedPrivateLinkResourceRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, sharedPrivateLinkResourceName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a SharedPrivateLinkResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseWatcher/watchers/{watcherName}/sharedPrivateLinkResources/{sharedPrivateLinkResourceName} + /// + /// + /// Operation Id + /// SharedPrivateLinkResource_Get + /// + /// + /// Default Api Version + /// 2025-01-02 + /// + /// + /// Resource + /// + /// + /// + /// + /// The Shared Private Link resource name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetAsync(string sharedPrivateLinkResourceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(sharedPrivateLinkResourceName, nameof(sharedPrivateLinkResourceName)); + + using var scope = _sharedPrivateLinkResourceClientDiagnostics.CreateScope("SharedPrivateLinkResourceCollection.Get"); + scope.Start(); + try + { + var response = await _sharedPrivateLinkResourceRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, sharedPrivateLinkResourceName, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new SharedPrivateLinkResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a SharedPrivateLinkResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseWatcher/watchers/{watcherName}/sharedPrivateLinkResources/{sharedPrivateLinkResourceName} + /// + /// + /// Operation Id + /// SharedPrivateLinkResource_Get + /// + /// + /// Default Api Version + /// 2025-01-02 + /// + /// + /// Resource + /// + /// + /// + /// + /// The Shared Private Link resource name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Get(string sharedPrivateLinkResourceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(sharedPrivateLinkResourceName, nameof(sharedPrivateLinkResourceName)); + + using var scope = _sharedPrivateLinkResourceClientDiagnostics.CreateScope("SharedPrivateLinkResourceCollection.Get"); + scope.Start(); + try + { + var response = _sharedPrivateLinkResourceRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, sharedPrivateLinkResourceName, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new SharedPrivateLinkResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// List SharedPrivateLinkResource resources by Watcher + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseWatcher/watchers/{watcherName}/sharedPrivateLinkResources + /// + /// + /// Operation Id + /// SharedPrivateLinkResource_ListByWatcher + /// + /// + /// Default Api Version + /// 2025-01-02 + /// + /// + /// 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) => _sharedPrivateLinkResourceRestClient.CreateListByWatcherRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _sharedPrivateLinkResourceRestClient.CreateListByWatcherNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new SharedPrivateLinkResource(Client, SharedPrivateLinkResourceData.DeserializeSharedPrivateLinkResourceData(e)), _sharedPrivateLinkResourceClientDiagnostics, Pipeline, "SharedPrivateLinkResourceCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// List SharedPrivateLinkResource resources by Watcher + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseWatcher/watchers/{watcherName}/sharedPrivateLinkResources + /// + /// + /// Operation Id + /// SharedPrivateLinkResource_ListByWatcher + /// + /// + /// Default Api Version + /// 2025-01-02 + /// + /// + /// 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) => _sharedPrivateLinkResourceRestClient.CreateListByWatcherRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _sharedPrivateLinkResourceRestClient.CreateListByWatcherNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new SharedPrivateLinkResource(Client, SharedPrivateLinkResourceData.DeserializeSharedPrivateLinkResourceData(e)), _sharedPrivateLinkResourceClientDiagnostics, Pipeline, "SharedPrivateLinkResourceCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseWatcher/watchers/{watcherName}/sharedPrivateLinkResources/{sharedPrivateLinkResourceName} + /// + /// + /// Operation Id + /// SharedPrivateLinkResource_Get + /// + /// + /// Default Api Version + /// 2025-01-02 + /// + /// + /// Resource + /// + /// + /// + /// + /// The Shared Private Link resource name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> ExistsAsync(string sharedPrivateLinkResourceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(sharedPrivateLinkResourceName, nameof(sharedPrivateLinkResourceName)); + + using var scope = _sharedPrivateLinkResourceClientDiagnostics.CreateScope("SharedPrivateLinkResourceCollection.Exists"); + scope.Start(); + try + { + var response = await _sharedPrivateLinkResourceRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, sharedPrivateLinkResourceName, 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.DatabaseWatcher/watchers/{watcherName}/sharedPrivateLinkResources/{sharedPrivateLinkResourceName} + /// + /// + /// Operation Id + /// SharedPrivateLinkResource_Get + /// + /// + /// Default Api Version + /// 2025-01-02 + /// + /// + /// Resource + /// + /// + /// + /// + /// The Shared Private Link resource name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Exists(string sharedPrivateLinkResourceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(sharedPrivateLinkResourceName, nameof(sharedPrivateLinkResourceName)); + + using var scope = _sharedPrivateLinkResourceClientDiagnostics.CreateScope("SharedPrivateLinkResourceCollection.Exists"); + scope.Start(); + try + { + var response = _sharedPrivateLinkResourceRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, sharedPrivateLinkResourceName, 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.DatabaseWatcher/watchers/{watcherName}/sharedPrivateLinkResources/{sharedPrivateLinkResourceName} + /// + /// + /// Operation Id + /// SharedPrivateLinkResource_Get + /// + /// + /// Default Api Version + /// 2025-01-02 + /// + /// + /// Resource + /// + /// + /// + /// + /// The Shared Private Link resource name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetIfExistsAsync(string sharedPrivateLinkResourceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(sharedPrivateLinkResourceName, nameof(sharedPrivateLinkResourceName)); + + using var scope = _sharedPrivateLinkResourceClientDiagnostics.CreateScope("SharedPrivateLinkResourceCollection.GetIfExists"); + scope.Start(); + try + { + var response = await _sharedPrivateLinkResourceRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, sharedPrivateLinkResourceName, cancellationToken: cancellationToken).ConfigureAwait(false); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new SharedPrivateLinkResource(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.DatabaseWatcher/watchers/{watcherName}/sharedPrivateLinkResources/{sharedPrivateLinkResourceName} + /// + /// + /// Operation Id + /// SharedPrivateLinkResource_Get + /// + /// + /// Default Api Version + /// 2025-01-02 + /// + /// + /// Resource + /// + /// + /// + /// + /// The Shared Private Link resource name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual NullableResponse GetIfExists(string sharedPrivateLinkResourceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(sharedPrivateLinkResourceName, nameof(sharedPrivateLinkResourceName)); + + using var scope = _sharedPrivateLinkResourceClientDiagnostics.CreateScope("SharedPrivateLinkResourceCollection.GetIfExists"); + scope.Start(); + try + { + var response = _sharedPrivateLinkResourceRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, sharedPrivateLinkResourceName, cancellationToken: cancellationToken); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new SharedPrivateLinkResource(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/databasewatcher/Azure.ResourceManager.DatabaseWatcher/src/Generated/SharedPrivateLinkResourceData.Serialization.cs b/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/src/Generated/SharedPrivateLinkResourceData.Serialization.cs new file mode 100644 index 000000000000..00e69ad597b8 --- /dev/null +++ b/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/src/Generated/SharedPrivateLinkResourceData.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.DatabaseWatcher.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.DatabaseWatcher +{ + public partial class SharedPrivateLinkResourceData : 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(SharedPrivateLinkResourceData)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (Optional.IsDefined(Properties)) + { + writer.WritePropertyName("properties"u8); + writer.WriteObjectValue(Properties, options); + } + } + + SharedPrivateLinkResourceData 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(SharedPrivateLinkResourceData)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeSharedPrivateLinkResourceData(document.RootElement, options); + } + + internal static SharedPrivateLinkResourceData DeserializeSharedPrivateLinkResourceData(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + SharedPrivateLinkResourceProperties 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 = SharedPrivateLinkResourceProperties.DeserializeSharedPrivateLinkResourceProperties(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 SharedPrivateLinkResourceData( + 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(SharedPrivateLinkResourceData)} does not support writing '{options.Format}' format."); + } + } + + SharedPrivateLinkResourceData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeSharedPrivateLinkResourceData(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(SharedPrivateLinkResourceData)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/src/Generated/SharedPrivateLinkResourceData.cs b/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/src/Generated/SharedPrivateLinkResourceData.cs new file mode 100644 index 000000000000..45f2b1b41d87 --- /dev/null +++ b/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/src/Generated/SharedPrivateLinkResourceData.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.DatabaseWatcher.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.DatabaseWatcher +{ + /// + /// A class representing the SharedPrivateLinkResource data model. + /// Concrete proxy resource types can be created by aliasing this type using a specific property type. + /// + public partial class SharedPrivateLinkResourceData : 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 SharedPrivateLinkResourceData() + { + } + + /// 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 SharedPrivateLinkResourceData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, SharedPrivateLinkResourceProperties properties, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) + { + Properties = properties; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The resource-specific properties for this resource. + public SharedPrivateLinkResourceProperties Properties { get; set; } + } +} diff --git a/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/src/Generated/TargetCollection.cs b/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/src/Generated/TargetCollection.cs new file mode 100644 index 000000000000..4dbbaeab8572 --- /dev/null +++ b/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/src/Generated/TargetCollection.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.DatabaseWatcher +{ + /// + /// 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 GetTargets method from an instance of . + /// + public partial class TargetCollection : ArmCollection, IEnumerable, IAsyncEnumerable + { + private readonly ClientDiagnostics _targetClientDiagnostics; + private readonly TargetsRestOperations _targetRestClient; + + /// Initializes a new instance of the class for mocking. + protected TargetCollection() + { + } + + /// 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 TargetCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _targetClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.DatabaseWatcher", TargetResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(TargetResource.ResourceType, out string targetApiVersion); + _targetRestClient = new TargetsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, targetApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != WatcherResource.ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, WatcherResource.ResourceType), nameof(id)); + } + + /// + /// Create a Target + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseWatcher/watchers/{watcherName}/targets/{targetName} + /// + /// + /// Operation Id + /// Target_CreateOrUpdate + /// + /// + /// Default Api Version + /// 2025-01-02 + /// + /// + /// 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 target resource name. + /// 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 targetName, TargetData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(targetName, nameof(targetName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _targetClientDiagnostics.CreateScope("TargetCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = await _targetRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, targetName, data, cancellationToken).ConfigureAwait(false); + var uri = _targetRestClient.CreateCreateOrUpdateRequestUri(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, targetName, data); + var rehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(RequestMethod.Put, uri.ToUri(), uri.ToString(), "None", null, OperationFinalStateVia.OriginalUri.ToString()); + var operation = new DatabaseWatcherArmOperation(Response.FromValue(new TargetResource(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 Target + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseWatcher/watchers/{watcherName}/targets/{targetName} + /// + /// + /// Operation Id + /// Target_CreateOrUpdate + /// + /// + /// Default Api Version + /// 2025-01-02 + /// + /// + /// 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 target resource name. + /// 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 targetName, TargetData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(targetName, nameof(targetName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _targetClientDiagnostics.CreateScope("TargetCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = _targetRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, targetName, data, cancellationToken); + var uri = _targetRestClient.CreateCreateOrUpdateRequestUri(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, targetName, data); + var rehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(RequestMethod.Put, uri.ToUri(), uri.ToString(), "None", null, OperationFinalStateVia.OriginalUri.ToString()); + var operation = new DatabaseWatcherArmOperation(Response.FromValue(new TargetResource(Client, response), response.GetRawResponse()), rehydrationToken); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a Target + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseWatcher/watchers/{watcherName}/targets/{targetName} + /// + /// + /// Operation Id + /// Target_Get + /// + /// + /// Default Api Version + /// 2025-01-02 + /// + /// + /// Resource + /// + /// + /// + /// + /// The target resource name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetAsync(string targetName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(targetName, nameof(targetName)); + + using var scope = _targetClientDiagnostics.CreateScope("TargetCollection.Get"); + scope.Start(); + try + { + var response = await _targetRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, targetName, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new TargetResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a Target + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseWatcher/watchers/{watcherName}/targets/{targetName} + /// + /// + /// Operation Id + /// Target_Get + /// + /// + /// Default Api Version + /// 2025-01-02 + /// + /// + /// Resource + /// + /// + /// + /// + /// The target resource name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Get(string targetName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(targetName, nameof(targetName)); + + using var scope = _targetClientDiagnostics.CreateScope("TargetCollection.Get"); + scope.Start(); + try + { + var response = _targetRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, targetName, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new TargetResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// List Target resources by Watcher + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseWatcher/watchers/{watcherName}/targets + /// + /// + /// Operation Id + /// Target_ListByWatcher + /// + /// + /// Default Api Version + /// 2025-01-02 + /// + /// + /// 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) => _targetRestClient.CreateListByWatcherRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _targetRestClient.CreateListByWatcherNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new TargetResource(Client, TargetData.DeserializeTargetData(e)), _targetClientDiagnostics, Pipeline, "TargetCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// List Target resources by Watcher + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseWatcher/watchers/{watcherName}/targets + /// + /// + /// Operation Id + /// Target_ListByWatcher + /// + /// + /// Default Api Version + /// 2025-01-02 + /// + /// + /// 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) => _targetRestClient.CreateListByWatcherRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _targetRestClient.CreateListByWatcherNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new TargetResource(Client, TargetData.DeserializeTargetData(e)), _targetClientDiagnostics, Pipeline, "TargetCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseWatcher/watchers/{watcherName}/targets/{targetName} + /// + /// + /// Operation Id + /// Target_Get + /// + /// + /// Default Api Version + /// 2025-01-02 + /// + /// + /// Resource + /// + /// + /// + /// + /// The target resource name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> ExistsAsync(string targetName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(targetName, nameof(targetName)); + + using var scope = _targetClientDiagnostics.CreateScope("TargetCollection.Exists"); + scope.Start(); + try + { + var response = await _targetRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, targetName, 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.DatabaseWatcher/watchers/{watcherName}/targets/{targetName} + /// + /// + /// Operation Id + /// Target_Get + /// + /// + /// Default Api Version + /// 2025-01-02 + /// + /// + /// Resource + /// + /// + /// + /// + /// The target resource name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Exists(string targetName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(targetName, nameof(targetName)); + + using var scope = _targetClientDiagnostics.CreateScope("TargetCollection.Exists"); + scope.Start(); + try + { + var response = _targetRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, targetName, 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.DatabaseWatcher/watchers/{watcherName}/targets/{targetName} + /// + /// + /// Operation Id + /// Target_Get + /// + /// + /// Default Api Version + /// 2025-01-02 + /// + /// + /// Resource + /// + /// + /// + /// + /// The target resource name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetIfExistsAsync(string targetName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(targetName, nameof(targetName)); + + using var scope = _targetClientDiagnostics.CreateScope("TargetCollection.GetIfExists"); + scope.Start(); + try + { + var response = await _targetRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, targetName, cancellationToken: cancellationToken).ConfigureAwait(false); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new TargetResource(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.DatabaseWatcher/watchers/{watcherName}/targets/{targetName} + /// + /// + /// Operation Id + /// Target_Get + /// + /// + /// Default Api Version + /// 2025-01-02 + /// + /// + /// Resource + /// + /// + /// + /// + /// The target resource name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual NullableResponse GetIfExists(string targetName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(targetName, nameof(targetName)); + + using var scope = _targetClientDiagnostics.CreateScope("TargetCollection.GetIfExists"); + scope.Start(); + try + { + var response = _targetRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, targetName, cancellationToken: cancellationToken); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new TargetResource(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/databasewatcher/Azure.ResourceManager.DatabaseWatcher/src/Generated/TargetData.Serialization.cs b/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/src/Generated/TargetData.Serialization.cs new file mode 100644 index 000000000000..516a1a20c363 --- /dev/null +++ b/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/src/Generated/TargetData.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.DatabaseWatcher.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.DatabaseWatcher +{ + public partial class TargetData : 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(TargetData)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (Optional.IsDefined(Properties)) + { + writer.WritePropertyName("properties"u8); + writer.WriteObjectValue(Properties, options); + } + } + + TargetData 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(TargetData)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeTargetData(document.RootElement, options); + } + + internal static TargetData DeserializeTargetData(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + TargetProperties 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 = TargetProperties.DeserializeTargetProperties(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 TargetData( + 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(TargetData)} does not support writing '{options.Format}' format."); + } + } + + TargetData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeTargetData(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(TargetData)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/src/Generated/TargetData.cs b/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/src/Generated/TargetData.cs new file mode 100644 index 000000000000..04dda036ff16 --- /dev/null +++ b/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/src/Generated/TargetData.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.DatabaseWatcher.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.DatabaseWatcher +{ + /// + /// A class representing the Target data model. + /// Concrete proxy resource types can be created by aliasing this type using a specific property type. + /// + public partial class TargetData : 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 TargetData() + { + } + + /// 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 . + /// + /// Keeps track of any properties unknown to the library. + internal TargetData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, TargetProperties 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 , and . + /// + public TargetProperties Properties { get; set; } + } +} diff --git a/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/src/Generated/TargetResource.Serialization.cs b/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/src/Generated/TargetResource.Serialization.cs new file mode 100644 index 000000000000..64a7c916ca21 --- /dev/null +++ b/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/src/Generated/TargetResource.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.DatabaseWatcher +{ + public partial class TargetResource : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); + + TargetData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options); + + TargetData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options); + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); + } +} diff --git a/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/src/Generated/TargetResource.cs b/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/src/Generated/TargetResource.cs new file mode 100644 index 000000000000..654e6c42cde4 --- /dev/null +++ b/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/src/Generated/TargetResource.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.DatabaseWatcher +{ + /// + /// A Class representing a Target 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 GetTargetResource method. + /// Otherwise you can get one from its parent resource using the GetTarget method. + /// + public partial class TargetResource : ArmResource + { + /// Generate the resource identifier of a instance. + /// The subscriptionId. + /// The resourceGroupName. + /// The watcherName. + /// The targetName. + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string watcherName, string targetName) + { + var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseWatcher/watchers/{watcherName}/targets/{targetName}"; + return new ResourceIdentifier(resourceId); + } + + private readonly ClientDiagnostics _targetClientDiagnostics; + private readonly TargetsRestOperations _targetRestClient; + private readonly TargetData _data; + + /// Gets the resource type for the operations. + public static readonly ResourceType ResourceType = "Microsoft.DatabaseWatcher/watchers/targets"; + + /// Initializes a new instance of the class for mocking. + protected TargetResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal TargetResource(ArmClient client, TargetData 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 TargetResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _targetClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.DatabaseWatcher", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string targetApiVersion); + _targetRestClient = new TargetsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, targetApiVersion); +#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 TargetData 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 Target + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseWatcher/watchers/{watcherName}/targets/{targetName} + /// + /// + /// Operation Id + /// Target_Get + /// + /// + /// Default Api Version + /// 2025-01-02 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _targetClientDiagnostics.CreateScope("TargetResource.Get"); + scope.Start(); + try + { + var response = await _targetRestClient.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 TargetResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a Target + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseWatcher/watchers/{watcherName}/targets/{targetName} + /// + /// + /// Operation Id + /// Target_Get + /// + /// + /// Default Api Version + /// 2025-01-02 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _targetClientDiagnostics.CreateScope("TargetResource.Get"); + scope.Start(); + try + { + var response = _targetRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new TargetResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Delete a Target + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseWatcher/watchers/{watcherName}/targets/{targetName} + /// + /// + /// Operation Id + /// Target_Delete + /// + /// + /// Default Api Version + /// 2025-01-02 + /// + /// + /// 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 = _targetClientDiagnostics.CreateScope("TargetResource.Delete"); + scope.Start(); + try + { + var response = await _targetRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + var uri = _targetRestClient.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 DatabaseWatcherArmOperation(response, rehydrationToken); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Delete a Target + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseWatcher/watchers/{watcherName}/targets/{targetName} + /// + /// + /// Operation Id + /// Target_Delete + /// + /// + /// Default Api Version + /// 2025-01-02 + /// + /// + /// 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 = _targetClientDiagnostics.CreateScope("TargetResource.Delete"); + scope.Start(); + try + { + var response = _targetRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + var uri = _targetRestClient.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 DatabaseWatcherArmOperation(response, rehydrationToken); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletionResponse(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Create a Target + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseWatcher/watchers/{watcherName}/targets/{targetName} + /// + /// + /// Operation Id + /// Target_CreateOrUpdate + /// + /// + /// Default Api Version + /// 2025-01-02 + /// + /// + /// 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, TargetData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _targetClientDiagnostics.CreateScope("TargetResource.Update"); + scope.Start(); + try + { + var response = await _targetRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, cancellationToken).ConfigureAwait(false); + var uri = _targetRestClient.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 DatabaseWatcherArmOperation(Response.FromValue(new TargetResource(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 Target + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseWatcher/watchers/{watcherName}/targets/{targetName} + /// + /// + /// Operation Id + /// Target_CreateOrUpdate + /// + /// + /// Default Api Version + /// 2025-01-02 + /// + /// + /// 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, TargetData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _targetClientDiagnostics.CreateScope("TargetResource.Update"); + scope.Start(); + try + { + var response = _targetRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, cancellationToken); + var uri = _targetRestClient.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 DatabaseWatcherArmOperation(Response.FromValue(new TargetResource(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/databasewatcher/Azure.ResourceManager.DatabaseWatcher/src/Generated/WatcherCollection.cs b/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/src/Generated/WatcherCollection.cs new file mode 100644 index 000000000000..4ec24987d6d6 --- /dev/null +++ b/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/src/Generated/WatcherCollection.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.DatabaseWatcher +{ + /// + /// 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 GetWatchers method from an instance of . + /// + public partial class WatcherCollection : ArmCollection, IEnumerable, IAsyncEnumerable + { + private readonly ClientDiagnostics _watcherClientDiagnostics; + private readonly WatchersRestOperations _watcherRestClient; + + /// Initializes a new instance of the class for mocking. + protected WatcherCollection() + { + } + + /// 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 WatcherCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _watcherClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.DatabaseWatcher", WatcherResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(WatcherResource.ResourceType, out string watcherApiVersion); + _watcherRestClient = new WatchersRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, watcherApiVersion); +#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 Watcher + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseWatcher/watchers/{watcherName} + /// + /// + /// Operation Id + /// Watcher_CreateOrUpdate + /// + /// + /// Default Api Version + /// 2025-01-02 + /// + /// + /// 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 database watcher name. + /// 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 watcherName, WatcherData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(watcherName, nameof(watcherName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _watcherClientDiagnostics.CreateScope("WatcherCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = await _watcherRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, watcherName, data, cancellationToken).ConfigureAwait(false); + var operation = new DatabaseWatcherArmOperation(new WatcherOperationSource(Client), _watcherClientDiagnostics, Pipeline, _watcherRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, watcherName, 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 Watcher + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseWatcher/watchers/{watcherName} + /// + /// + /// Operation Id + /// Watcher_CreateOrUpdate + /// + /// + /// Default Api Version + /// 2025-01-02 + /// + /// + /// 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 database watcher name. + /// 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 watcherName, WatcherData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(watcherName, nameof(watcherName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _watcherClientDiagnostics.CreateScope("WatcherCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = _watcherRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, watcherName, data, cancellationToken); + var operation = new DatabaseWatcherArmOperation(new WatcherOperationSource(Client), _watcherClientDiagnostics, Pipeline, _watcherRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, watcherName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a Watcher + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseWatcher/watchers/{watcherName} + /// + /// + /// Operation Id + /// Watcher_Get + /// + /// + /// Default Api Version + /// 2025-01-02 + /// + /// + /// Resource + /// + /// + /// + /// + /// The database watcher name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetAsync(string watcherName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(watcherName, nameof(watcherName)); + + using var scope = _watcherClientDiagnostics.CreateScope("WatcherCollection.Get"); + scope.Start(); + try + { + var response = await _watcherRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, watcherName, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new WatcherResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a Watcher + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseWatcher/watchers/{watcherName} + /// + /// + /// Operation Id + /// Watcher_Get + /// + /// + /// Default Api Version + /// 2025-01-02 + /// + /// + /// Resource + /// + /// + /// + /// + /// The database watcher name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Get(string watcherName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(watcherName, nameof(watcherName)); + + using var scope = _watcherClientDiagnostics.CreateScope("WatcherCollection.Get"); + scope.Start(); + try + { + var response = _watcherRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, watcherName, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new WatcherResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// List Watcher resources by resource group + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseWatcher/watchers + /// + /// + /// Operation Id + /// Watcher_ListByResourceGroup + /// + /// + /// Default Api Version + /// 2025-01-02 + /// + /// + /// 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) => _watcherRestClient.CreateListByResourceGroupRequest(Id.SubscriptionId, Id.ResourceGroupName); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _watcherRestClient.CreateListByResourceGroupNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new WatcherResource(Client, WatcherData.DeserializeWatcherData(e)), _watcherClientDiagnostics, Pipeline, "WatcherCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// List Watcher resources by resource group + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseWatcher/watchers + /// + /// + /// Operation Id + /// Watcher_ListByResourceGroup + /// + /// + /// Default Api Version + /// 2025-01-02 + /// + /// + /// 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) => _watcherRestClient.CreateListByResourceGroupRequest(Id.SubscriptionId, Id.ResourceGroupName); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _watcherRestClient.CreateListByResourceGroupNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new WatcherResource(Client, WatcherData.DeserializeWatcherData(e)), _watcherClientDiagnostics, Pipeline, "WatcherCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseWatcher/watchers/{watcherName} + /// + /// + /// Operation Id + /// Watcher_Get + /// + /// + /// Default Api Version + /// 2025-01-02 + /// + /// + /// Resource + /// + /// + /// + /// + /// The database watcher name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> ExistsAsync(string watcherName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(watcherName, nameof(watcherName)); + + using var scope = _watcherClientDiagnostics.CreateScope("WatcherCollection.Exists"); + scope.Start(); + try + { + var response = await _watcherRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, watcherName, 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.DatabaseWatcher/watchers/{watcherName} + /// + /// + /// Operation Id + /// Watcher_Get + /// + /// + /// Default Api Version + /// 2025-01-02 + /// + /// + /// Resource + /// + /// + /// + /// + /// The database watcher name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Exists(string watcherName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(watcherName, nameof(watcherName)); + + using var scope = _watcherClientDiagnostics.CreateScope("WatcherCollection.Exists"); + scope.Start(); + try + { + var response = _watcherRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, watcherName, 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.DatabaseWatcher/watchers/{watcherName} + /// + /// + /// Operation Id + /// Watcher_Get + /// + /// + /// Default Api Version + /// 2025-01-02 + /// + /// + /// Resource + /// + /// + /// + /// + /// The database watcher name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetIfExistsAsync(string watcherName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(watcherName, nameof(watcherName)); + + using var scope = _watcherClientDiagnostics.CreateScope("WatcherCollection.GetIfExists"); + scope.Start(); + try + { + var response = await _watcherRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, watcherName, cancellationToken: cancellationToken).ConfigureAwait(false); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new WatcherResource(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.DatabaseWatcher/watchers/{watcherName} + /// + /// + /// Operation Id + /// Watcher_Get + /// + /// + /// Default Api Version + /// 2025-01-02 + /// + /// + /// Resource + /// + /// + /// + /// + /// The database watcher name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual NullableResponse GetIfExists(string watcherName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(watcherName, nameof(watcherName)); + + using var scope = _watcherClientDiagnostics.CreateScope("WatcherCollection.GetIfExists"); + scope.Start(); + try + { + var response = _watcherRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, watcherName, cancellationToken: cancellationToken); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new WatcherResource(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/databasewatcher/Azure.ResourceManager.DatabaseWatcher/src/Generated/WatcherData.Serialization.cs b/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/src/Generated/WatcherData.Serialization.cs new file mode 100644 index 000000000000..132d2e09dc8c --- /dev/null +++ b/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/src/Generated/WatcherData.Serialization.cs @@ -0,0 +1,194 @@ +// 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.DatabaseWatcher.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.DatabaseWatcher +{ + public partial class WatcherData : 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(WatcherData)} 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); + writer.WriteObjectValue(Identity, options); + } + } + + WatcherData 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(WatcherData)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeWatcherData(document.RootElement, options); + } + + internal static WatcherData DeserializeWatcherData(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + WatcherProperties properties = default; + ManagedServiceIdentityV4 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 = WatcherProperties.DeserializeWatcherProperties(property.Value, options); + continue; + } + if (property.NameEquals("identity"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + identity = ManagedServiceIdentityV4.DeserializeManagedServiceIdentityV4(property.Value, options); + 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 WatcherData( + 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(WatcherData)} does not support writing '{options.Format}' format."); + } + } + + WatcherData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeWatcherData(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(WatcherData)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/src/Generated/WatcherData.cs b/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/src/Generated/WatcherData.cs new file mode 100644 index 000000000000..db4ed0ffd517 --- /dev/null +++ b/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/src/Generated/WatcherData.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.DatabaseWatcher.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.DatabaseWatcher +{ + /// + /// A class representing the Watcher data model. + /// The DatabaseWatcherProviderHub resource. + /// + public partial class WatcherData : 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 WatcherData(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 WatcherData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, WatcherProperties properties, ManagedServiceIdentityV4 identity, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) + { + Properties = properties; + Identity = identity; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal WatcherData() + { + } + + /// The resource-specific properties for this resource. + public WatcherProperties Properties { get; set; } + /// The managed service identities assigned to this resource. + public ManagedServiceIdentityV4 Identity { get; set; } + } +} diff --git a/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/src/Generated/WatcherResource.Serialization.cs b/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/src/Generated/WatcherResource.Serialization.cs new file mode 100644 index 000000000000..3d31f027fcdd --- /dev/null +++ b/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/src/Generated/WatcherResource.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.DatabaseWatcher +{ + public partial class WatcherResource : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); + + WatcherData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options); + + WatcherData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options); + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); + } +} diff --git a/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/src/Generated/WatcherResource.cs b/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/src/Generated/WatcherResource.cs new file mode 100644 index 000000000000..7b83019f45da --- /dev/null +++ b/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/src/Generated/WatcherResource.cs @@ -0,0 +1,1151 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.DatabaseWatcher.Models; +using Azure.ResourceManager.Resources; + +namespace Azure.ResourceManager.DatabaseWatcher +{ + /// + /// A Class representing a Watcher 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 GetWatcherResource method. + /// Otherwise you can get one from its parent resource using the GetWatcher method. + /// + public partial class WatcherResource : ArmResource + { + /// Generate the resource identifier of a instance. + /// The subscriptionId. + /// The resourceGroupName. + /// The watcherName. + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string watcherName) + { + var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseWatcher/watchers/{watcherName}"; + return new ResourceIdentifier(resourceId); + } + + private readonly ClientDiagnostics _watcherClientDiagnostics; + private readonly WatchersRestOperations _watcherRestClient; + private readonly WatcherData _data; + + /// Gets the resource type for the operations. + public static readonly ResourceType ResourceType = "Microsoft.DatabaseWatcher/watchers"; + + /// Initializes a new instance of the class for mocking. + protected WatcherResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal WatcherResource(ArmClient client, WatcherData 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 WatcherResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _watcherClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.DatabaseWatcher", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string watcherApiVersion); + _watcherRestClient = new WatchersRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, watcherApiVersion); +#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 WatcherData 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)); + } + + /// Gets a collection of AlertRuleResources in the Watcher. + /// An object representing collection of AlertRuleResources and their operations over a AlertRuleResource. + public virtual AlertRuleResourceCollection GetAlertRuleResources() + { + return GetCachedClient(client => new AlertRuleResourceCollection(client, Id)); + } + + /// + /// Get a AlertRuleResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseWatcher/watchers/{watcherName}/alertRuleResources/{alertRuleResourceName} + /// + /// + /// Operation Id + /// AlertRuleResource_Get + /// + /// + /// Default Api Version + /// 2025-01-02 + /// + /// + /// Resource + /// + /// + /// + /// + /// The alert rule proxy resource name. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetAlertRuleResourceAsync(string alertRuleResourceName, CancellationToken cancellationToken = default) + { + return await GetAlertRuleResources().GetAsync(alertRuleResourceName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get a AlertRuleResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseWatcher/watchers/{watcherName}/alertRuleResources/{alertRuleResourceName} + /// + /// + /// Operation Id + /// AlertRuleResource_Get + /// + /// + /// Default Api Version + /// 2025-01-02 + /// + /// + /// Resource + /// + /// + /// + /// + /// The alert rule proxy resource name. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetAlertRuleResource(string alertRuleResourceName, CancellationToken cancellationToken = default) + { + return GetAlertRuleResources().Get(alertRuleResourceName, cancellationToken); + } + + /// Gets a collection of HealthValidationResources in the Watcher. + /// An object representing collection of HealthValidationResources and their operations over a HealthValidationResource. + public virtual HealthValidationCollection GetHealthValidations() + { + return GetCachedClient(client => new HealthValidationCollection(client, Id)); + } + + /// + /// Get a HealthValidation + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseWatcher/watchers/{watcherName}/healthValidations/{healthValidationName} + /// + /// + /// Operation Id + /// HealthValidation_Get + /// + /// + /// Default Api Version + /// 2025-01-02 + /// + /// + /// Resource + /// + /// + /// + /// + /// The health validation resource name. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetHealthValidationAsync(string healthValidationName, CancellationToken cancellationToken = default) + { + return await GetHealthValidations().GetAsync(healthValidationName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get a HealthValidation + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseWatcher/watchers/{watcherName}/healthValidations/{healthValidationName} + /// + /// + /// Operation Id + /// HealthValidation_Get + /// + /// + /// Default Api Version + /// 2025-01-02 + /// + /// + /// Resource + /// + /// + /// + /// + /// The health validation resource name. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetHealthValidation(string healthValidationName, CancellationToken cancellationToken = default) + { + return GetHealthValidations().Get(healthValidationName, cancellationToken); + } + + /// Gets a collection of TargetResources in the Watcher. + /// An object representing collection of TargetResources and their operations over a TargetResource. + public virtual TargetCollection GetTargets() + { + return GetCachedClient(client => new TargetCollection(client, Id)); + } + + /// + /// Get a Target + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseWatcher/watchers/{watcherName}/targets/{targetName} + /// + /// + /// Operation Id + /// Target_Get + /// + /// + /// Default Api Version + /// 2025-01-02 + /// + /// + /// Resource + /// + /// + /// + /// + /// The target resource name. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetTargetAsync(string targetName, CancellationToken cancellationToken = default) + { + return await GetTargets().GetAsync(targetName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get a Target + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseWatcher/watchers/{watcherName}/targets/{targetName} + /// + /// + /// Operation Id + /// Target_Get + /// + /// + /// Default Api Version + /// 2025-01-02 + /// + /// + /// Resource + /// + /// + /// + /// + /// The target resource name. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetTarget(string targetName, CancellationToken cancellationToken = default) + { + return GetTargets().Get(targetName, cancellationToken); + } + + /// Gets a collection of SharedPrivateLinkResources in the Watcher. + /// An object representing collection of SharedPrivateLinkResources and their operations over a SharedPrivateLinkResource. + public virtual SharedPrivateLinkResourceCollection GetSharedPrivateLinkResources() + { + return GetCachedClient(client => new SharedPrivateLinkResourceCollection(client, Id)); + } + + /// + /// Get a SharedPrivateLinkResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseWatcher/watchers/{watcherName}/sharedPrivateLinkResources/{sharedPrivateLinkResourceName} + /// + /// + /// Operation Id + /// SharedPrivateLinkResource_Get + /// + /// + /// Default Api Version + /// 2025-01-02 + /// + /// + /// Resource + /// + /// + /// + /// + /// The Shared Private Link resource name. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetSharedPrivateLinkResourceAsync(string sharedPrivateLinkResourceName, CancellationToken cancellationToken = default) + { + return await GetSharedPrivateLinkResources().GetAsync(sharedPrivateLinkResourceName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get a SharedPrivateLinkResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseWatcher/watchers/{watcherName}/sharedPrivateLinkResources/{sharedPrivateLinkResourceName} + /// + /// + /// Operation Id + /// SharedPrivateLinkResource_Get + /// + /// + /// Default Api Version + /// 2025-01-02 + /// + /// + /// Resource + /// + /// + /// + /// + /// The Shared Private Link resource name. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetSharedPrivateLinkResource(string sharedPrivateLinkResourceName, CancellationToken cancellationToken = default) + { + return GetSharedPrivateLinkResources().Get(sharedPrivateLinkResourceName, cancellationToken); + } + + /// + /// Get a Watcher + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseWatcher/watchers/{watcherName} + /// + /// + /// Operation Id + /// Watcher_Get + /// + /// + /// Default Api Version + /// 2025-01-02 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _watcherClientDiagnostics.CreateScope("WatcherResource.Get"); + scope.Start(); + try + { + var response = await _watcherRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new WatcherResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a Watcher + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseWatcher/watchers/{watcherName} + /// + /// + /// Operation Id + /// Watcher_Get + /// + /// + /// Default Api Version + /// 2025-01-02 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _watcherClientDiagnostics.CreateScope("WatcherResource.Get"); + scope.Start(); + try + { + var response = _watcherRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new WatcherResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Delete a Watcher + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseWatcher/watchers/{watcherName} + /// + /// + /// Operation Id + /// Watcher_Delete + /// + /// + /// Default Api Version + /// 2025-01-02 + /// + /// + /// 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 = _watcherClientDiagnostics.CreateScope("WatcherResource.Delete"); + scope.Start(); + try + { + var response = await _watcherRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + var operation = new DatabaseWatcherArmOperation(_watcherClientDiagnostics, Pipeline, _watcherRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Delete a Watcher + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseWatcher/watchers/{watcherName} + /// + /// + /// Operation Id + /// Watcher_Delete + /// + /// + /// Default Api Version + /// 2025-01-02 + /// + /// + /// 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 = _watcherClientDiagnostics.CreateScope("WatcherResource.Delete"); + scope.Start(); + try + { + var response = _watcherRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + var operation = new DatabaseWatcherArmOperation(_watcherClientDiagnostics, Pipeline, _watcherRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletionResponse(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Update a Watcher + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseWatcher/watchers/{watcherName} + /// + /// + /// Operation Id + /// Watcher_Update + /// + /// + /// Default Api Version + /// 2025-01-02 + /// + /// + /// 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 resource properties to be updated. + /// The cancellation token to use. + /// is null. + public virtual async Task> UpdateAsync(WaitUntil waitUntil, WatcherPatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(patch, nameof(patch)); + + using var scope = _watcherClientDiagnostics.CreateScope("WatcherResource.Update"); + scope.Start(); + try + { + var response = await _watcherRestClient.UpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch, cancellationToken).ConfigureAwait(false); + var operation = new DatabaseWatcherArmOperation(new WatcherOperationSource(Client), _watcherClientDiagnostics, Pipeline, _watcherRestClient.CreateUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Update a Watcher + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseWatcher/watchers/{watcherName} + /// + /// + /// Operation Id + /// Watcher_Update + /// + /// + /// Default Api Version + /// 2025-01-02 + /// + /// + /// 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 resource properties to be updated. + /// The cancellation token to use. + /// is null. + public virtual ArmOperation Update(WaitUntil waitUntil, WatcherPatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(patch, nameof(patch)); + + using var scope = _watcherClientDiagnostics.CreateScope("WatcherResource.Update"); + scope.Start(); + try + { + var response = _watcherRestClient.Update(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch, cancellationToken); + var operation = new DatabaseWatcherArmOperation(new WatcherOperationSource(Client), _watcherClientDiagnostics, Pipeline, _watcherRestClient.CreateUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// The action to start monitoring all targets configured for a database watcher. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseWatcher/watchers/{watcherName}/start + /// + /// + /// Operation Id + /// Watchers_Start + /// + /// + /// Default Api Version + /// 2025-01-02 + /// + /// + /// 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 StartAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _watcherClientDiagnostics.CreateScope("WatcherResource.Start"); + scope.Start(); + try + { + var response = await _watcherRestClient.StartAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + var operation = new DatabaseWatcherArmOperation(_watcherClientDiagnostics, Pipeline, _watcherRestClient.CreateStartRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// The action to start monitoring all targets configured for a database watcher. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseWatcher/watchers/{watcherName}/start + /// + /// + /// Operation Id + /// Watchers_Start + /// + /// + /// Default Api Version + /// 2025-01-02 + /// + /// + /// 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 Start(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _watcherClientDiagnostics.CreateScope("WatcherResource.Start"); + scope.Start(); + try + { + var response = _watcherRestClient.Start(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + var operation = new DatabaseWatcherArmOperation(_watcherClientDiagnostics, Pipeline, _watcherRestClient.CreateStartRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletionResponse(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// The action to stop monitoring all targets configured for a database watcher. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseWatcher/watchers/{watcherName}/stop + /// + /// + /// Operation Id + /// Watchers_Stop + /// + /// + /// Default Api Version + /// 2025-01-02 + /// + /// + /// 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 StopAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _watcherClientDiagnostics.CreateScope("WatcherResource.Stop"); + scope.Start(); + try + { + var response = await _watcherRestClient.StopAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + var operation = new DatabaseWatcherArmOperation(_watcherClientDiagnostics, Pipeline, _watcherRestClient.CreateStopRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// The action to stop monitoring all targets configured for a database watcher. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseWatcher/watchers/{watcherName}/stop + /// + /// + /// Operation Id + /// Watchers_Stop + /// + /// + /// Default Api Version + /// 2025-01-02 + /// + /// + /// 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 Stop(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _watcherClientDiagnostics.CreateScope("WatcherResource.Stop"); + scope.Start(); + try + { + var response = _watcherRestClient.Stop(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + var operation = new DatabaseWatcherArmOperation(_watcherClientDiagnostics, Pipeline, _watcherRestClient.CreateStopRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletionResponse(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Add a tag to the current resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseWatcher/watchers/{watcherName} + /// + /// + /// Operation Id + /// Watcher_Get + /// + /// + /// Default Api Version + /// 2025-01-02 + /// + /// + /// Resource + /// + /// + /// + /// + /// The key for the tag. + /// The value for the tag. + /// The cancellation token to use. + /// or is null. + public virtual async Task> AddTagAsync(string key, string value, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(key, nameof(key)); + Argument.AssertNotNull(value, nameof(value)); + + using var scope = _watcherClientDiagnostics.CreateScope("WatcherResource.AddTag"); + scope.Start(); + try + { + if (await CanUseTagResourceAsync(cancellationToken: cancellationToken).ConfigureAwait(false)) + { + var originalTags = await GetTagResource().GetAsync(cancellationToken).ConfigureAwait(false); + originalTags.Value.Data.TagValues[key] = value; + await GetTagResource().CreateOrUpdateAsync(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken).ConfigureAwait(false); + var originalResponse = await _watcherRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new WatcherResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; + var patch = new WatcherPatch(); + foreach (var tag in current.Tags) + { + patch.Tags.Add(tag); + } + patch.Tags[key] = value; + var result = await UpdateAsync(WaitUntil.Completed, patch, cancellationToken: cancellationToken).ConfigureAwait(false); + return Response.FromValue(result.Value, result.GetRawResponse()); + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Add a tag to the current resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseWatcher/watchers/{watcherName} + /// + /// + /// Operation Id + /// Watcher_Get + /// + /// + /// Default Api Version + /// 2025-01-02 + /// + /// + /// Resource + /// + /// + /// + /// + /// The key for the tag. + /// The value for the tag. + /// The cancellation token to use. + /// or is null. + public virtual Response AddTag(string key, string value, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(key, nameof(key)); + Argument.AssertNotNull(value, nameof(value)); + + using var scope = _watcherClientDiagnostics.CreateScope("WatcherResource.AddTag"); + scope.Start(); + try + { + if (CanUseTagResource(cancellationToken: cancellationToken)) + { + var originalTags = GetTagResource().Get(cancellationToken); + originalTags.Value.Data.TagValues[key] = value; + GetTagResource().CreateOrUpdate(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken); + var originalResponse = _watcherRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + return Response.FromValue(new WatcherResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = Get(cancellationToken: cancellationToken).Value.Data; + var patch = new WatcherPatch(); + foreach (var tag in current.Tags) + { + patch.Tags.Add(tag); + } + patch.Tags[key] = value; + var result = Update(WaitUntil.Completed, patch, cancellationToken: cancellationToken); + return Response.FromValue(result.Value, result.GetRawResponse()); + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Replace the tags on the resource with the given set. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseWatcher/watchers/{watcherName} + /// + /// + /// Operation Id + /// Watcher_Get + /// + /// + /// Default Api Version + /// 2025-01-02 + /// + /// + /// Resource + /// + /// + /// + /// + /// The set of tags to use as replacement. + /// The cancellation token to use. + /// is null. + public virtual async Task> SetTagsAsync(IDictionary tags, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(tags, nameof(tags)); + + using var scope = _watcherClientDiagnostics.CreateScope("WatcherResource.SetTags"); + scope.Start(); + try + { + if (await CanUseTagResourceAsync(cancellationToken: cancellationToken).ConfigureAwait(false)) + { + await GetTagResource().DeleteAsync(WaitUntil.Completed, cancellationToken: cancellationToken).ConfigureAwait(false); + var originalTags = await GetTagResource().GetAsync(cancellationToken).ConfigureAwait(false); + originalTags.Value.Data.TagValues.ReplaceWith(tags); + await GetTagResource().CreateOrUpdateAsync(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken).ConfigureAwait(false); + var originalResponse = await _watcherRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new WatcherResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; + var patch = new WatcherPatch(); + patch.Tags.ReplaceWith(tags); + var result = await UpdateAsync(WaitUntil.Completed, patch, cancellationToken: cancellationToken).ConfigureAwait(false); + return Response.FromValue(result.Value, result.GetRawResponse()); + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Replace the tags on the resource with the given set. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseWatcher/watchers/{watcherName} + /// + /// + /// Operation Id + /// Watcher_Get + /// + /// + /// Default Api Version + /// 2025-01-02 + /// + /// + /// Resource + /// + /// + /// + /// + /// The set of tags to use as replacement. + /// The cancellation token to use. + /// is null. + public virtual Response SetTags(IDictionary tags, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(tags, nameof(tags)); + + using var scope = _watcherClientDiagnostics.CreateScope("WatcherResource.SetTags"); + scope.Start(); + try + { + if (CanUseTagResource(cancellationToken: cancellationToken)) + { + GetTagResource().Delete(WaitUntil.Completed, cancellationToken: cancellationToken); + var originalTags = GetTagResource().Get(cancellationToken); + originalTags.Value.Data.TagValues.ReplaceWith(tags); + GetTagResource().CreateOrUpdate(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken); + var originalResponse = _watcherRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + return Response.FromValue(new WatcherResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = Get(cancellationToken: cancellationToken).Value.Data; + var patch = new WatcherPatch(); + patch.Tags.ReplaceWith(tags); + var result = Update(WaitUntil.Completed, patch, cancellationToken: cancellationToken); + return Response.FromValue(result.Value, result.GetRawResponse()); + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Removes a tag by key from the resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseWatcher/watchers/{watcherName} + /// + /// + /// Operation Id + /// Watcher_Get + /// + /// + /// Default Api Version + /// 2025-01-02 + /// + /// + /// Resource + /// + /// + /// + /// + /// The key for the tag. + /// The cancellation token to use. + /// is null. + public virtual async Task> RemoveTagAsync(string key, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(key, nameof(key)); + + using var scope = _watcherClientDiagnostics.CreateScope("WatcherResource.RemoveTag"); + scope.Start(); + try + { + if (await CanUseTagResourceAsync(cancellationToken: cancellationToken).ConfigureAwait(false)) + { + var originalTags = await GetTagResource().GetAsync(cancellationToken).ConfigureAwait(false); + originalTags.Value.Data.TagValues.Remove(key); + await GetTagResource().CreateOrUpdateAsync(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken).ConfigureAwait(false); + var originalResponse = await _watcherRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new WatcherResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; + var patch = new WatcherPatch(); + foreach (var tag in current.Tags) + { + patch.Tags.Add(tag); + } + patch.Tags.Remove(key); + var result = await UpdateAsync(WaitUntil.Completed, patch, cancellationToken: cancellationToken).ConfigureAwait(false); + return Response.FromValue(result.Value, result.GetRawResponse()); + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Removes a tag by key from the resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseWatcher/watchers/{watcherName} + /// + /// + /// Operation Id + /// Watcher_Get + /// + /// + /// Default Api Version + /// 2025-01-02 + /// + /// + /// Resource + /// + /// + /// + /// + /// The key for the tag. + /// The cancellation token to use. + /// is null. + public virtual Response RemoveTag(string key, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(key, nameof(key)); + + using var scope = _watcherClientDiagnostics.CreateScope("WatcherResource.RemoveTag"); + scope.Start(); + try + { + if (CanUseTagResource(cancellationToken: cancellationToken)) + { + var originalTags = GetTagResource().Get(cancellationToken); + originalTags.Value.Data.TagValues.Remove(key); + GetTagResource().CreateOrUpdate(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken); + var originalResponse = _watcherRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + return Response.FromValue(new WatcherResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = Get(cancellationToken: cancellationToken).Value.Data; + var patch = new WatcherPatch(); + foreach (var tag in current.Tags) + { + patch.Tags.Add(tag); + } + patch.Tags.Remove(key); + var result = Update(WaitUntil.Completed, patch, cancellationToken: cancellationToken); + return Response.FromValue(result.Value, result.GetRawResponse()); + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/src/Properties/AssemblyInfo.cs b/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/src/Properties/AssemblyInfo.cs new file mode 100644 index 000000000000..700c78e5dd7e --- /dev/null +++ b/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/src/Properties/AssemblyInfo.cs @@ -0,0 +1,11 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System.Runtime.CompilerServices; + +[assembly: InternalsVisibleTo("Azure.ResourceManager.DatabaseWatcher.Tests, PublicKey = 0024000004800000940000000602000000240000525341310004000001000100d15ddcb29688295338af4b7686603fe614abd555e09efba8fb88ee09e1f7b1ccaeed2e8f823fa9eef3fdd60217fc012ea67d2479751a0b8c087a4185541b851bd8b16f8d91b840e51b1cb0ba6fe647997e57429265e85ef62d565db50a69ae1647d54d7bd855e4db3d8a91510e5bcbd0edfbbecaa20a7bd9ae74593daa7b11b4")] + +// Replace Microsoft.Test with the correct resource provider namepace for your service and uncomment. +// See https://docs.microsoft.com/en-us/azure/azure-resource-manager/management/azure-services-resource-providers +// for the list of possible values. +[assembly: Azure.Core.AzureResourceProviderNamespace("DatabaseWatcher")] diff --git a/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/tests/Azure.ResourceManager.DatabaseWatcher.Tests.csproj b/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/tests/Azure.ResourceManager.DatabaseWatcher.Tests.csproj new file mode 100644 index 000000000000..4107c22780fe --- /dev/null +++ b/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/tests/Azure.ResourceManager.DatabaseWatcher.Tests.csproj @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/tests/DatabaseWatcherManagementTestBase.cs b/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/tests/DatabaseWatcherManagementTestBase.cs new file mode 100644 index 000000000000..752ee1ad5c2e --- /dev/null +++ b/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/tests/DatabaseWatcherManagementTestBase.cs @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using Azure; +using Azure.Core; +using Azure.Core.TestFramework; +using Azure.ResourceManager; +using Azure.ResourceManager.Resources; +using Azure.ResourceManager.TestFramework; +using NUnit.Framework; +using System.Threading.Tasks; + +namespace Azure.ResourceManager.DatabaseWatcher.Tests +{ + public class DatabaseWatcherManagementTestBase : ManagementRecordedTestBase + { + protected ArmClient Client { get; private set; } + protected SubscriptionResource DefaultSubscription { get; private set; } + + protected DatabaseWatcherManagementTestBase(bool isAsync, RecordedTestMode mode) + : base(isAsync, mode) + { + } + + protected DatabaseWatcherManagementTestBase(bool isAsync) + : base(isAsync) + { + } + + [SetUp] + public async Task CreateCommonClient() + { + Client = GetArmClient(); + DefaultSubscription = await Client.GetDefaultSubscriptionAsync().ConfigureAwait(false); + } + + protected async Task CreateResourceGroup(SubscriptionResource subscription, string rgNamePrefix, AzureLocation location) + { + string rgName = Recording.GenerateAssetName(rgNamePrefix); + ResourceGroupData input = new ResourceGroupData(location); + var lro = await subscription.GetResourceGroups().CreateOrUpdateAsync(WaitUntil.Completed, rgName, input); + return lro.Value; + } + } +} diff --git a/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/tests/DatabaseWatcherManagementTestEnvironment.cs b/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/tests/DatabaseWatcherManagementTestEnvironment.cs new file mode 100644 index 000000000000..8c72583b0fea --- /dev/null +++ b/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/tests/DatabaseWatcherManagementTestEnvironment.cs @@ -0,0 +1,11 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using Azure.Core.TestFramework; + +namespace Azure.ResourceManager.DatabaseWatcher.Tests +{ + public class DatabaseWatcherManagementTestEnvironment : TestEnvironment + { + } +} diff --git a/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/tsp-location.yaml b/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/tsp-location.yaml new file mode 100644 index 000000000000..a2eef93f4d75 --- /dev/null +++ b/sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher/tsp-location.yaml @@ -0,0 +1,4 @@ +directory: specification/databasewatcher/DatabaseWatcher.Management +commit: 676334a284e5136f0a0721d6ae844bb04332f579 +repo: Azure/azure-rest-api-specs +additionalDirectories: diff --git a/sdk/databasewatcher/ci.mgmt.yml b/sdk/databasewatcher/ci.mgmt.yml new file mode 100644 index 000000000000..939cabda31dd --- /dev/null +++ b/sdk/databasewatcher/ci.mgmt.yml @@ -0,0 +1,26 @@ +# NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. + +trigger: none + +pr: + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/databasewatcher /ci.mgmt.yml + - sdk/databasewatcher /Azure.ResourceManager.DatabaseWatcher / + + +extends: + template: /eng/pipelines/templates/stages/archetype-sdk-client.yml + parameters: + ServiceDirectory: databasewatcher + ArtifactName: packages + LimitForPullRequest: true + Artifacts: + - name: Azure.ResourceManager.DatabaseWatcher + safeName: AzureResourceManagerDatabaseWatcher diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/tsp-location.yaml b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/tsp-location.yaml index d39a7fa40086..4f610368f3b0 100644 --- a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/tsp-location.yaml +++ b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/tsp-location.yaml @@ -1,3 +1,4 @@ -directory: specification\deviceregistry\DeviceRegistry.Management -commit: df7c9b730f08e00dbe543b57235b36666563ff7d +directory: specification/deviceregistry/DeviceRegistry.Management +commit: 676334a284e5136f0a0721d6ae844bb04332f579 repo: Azure/azure-rest-api-specs +additionalDirectories: diff --git a/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/api/Azure.ResourceManager.DevOpsInfrastructure.net8.0.cs b/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/api/Azure.ResourceManager.DevOpsInfrastructure.net8.0.cs index 86448afdc637..257cbf40ba48 100644 --- a/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/api/Azure.ResourceManager.DevOpsInfrastructure.net8.0.cs +++ b/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/api/Azure.ResourceManager.DevOpsInfrastructure.net8.0.cs @@ -2,6 +2,8 @@ namespace Azure.ResourceManager.DevOpsInfrastructure { public static partial class DevOpsInfrastructureExtensions { + public static Azure.Response CheckNameAvailabilityPool(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, Azure.ResourceManager.DevOpsInfrastructure.Models.CheckNameAvailability body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static System.Threading.Tasks.Task> CheckNameAvailabilityPoolAsync(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, Azure.ResourceManager.DevOpsInfrastructure.Models.CheckNameAvailability body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public static Azure.Response GetDevOpsPool(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string poolName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public static System.Threading.Tasks.Task> GetDevOpsPoolAsync(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string poolName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public static Azure.ResourceManager.DevOpsInfrastructure.DevOpsPoolResource GetDevOpsPoolResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } @@ -91,6 +93,8 @@ protected MockableDevOpsInfrastructureResourceGroupResource() { } public partial class MockableDevOpsInfrastructureSubscriptionResource : Azure.ResourceManager.ArmResource { protected MockableDevOpsInfrastructureSubscriptionResource() { } + public virtual Azure.Response CheckNameAvailabilityPool(Azure.ResourceManager.DevOpsInfrastructure.Models.CheckNameAvailability body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CheckNameAvailabilityPoolAsync(Azure.ResourceManager.DevOpsInfrastructure.Models.CheckNameAvailability body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Pageable GetDevOpsPools(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.AsyncPageable GetDevOpsPoolsAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Pageable GetSkusByLocation(string locationName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } @@ -103,6 +107,7 @@ namespace Azure.ResourceManager.DevOpsInfrastructure.Models { public static partial class ArmDevOpsInfrastructureModelFactory { + public static Azure.ResourceManager.DevOpsInfrastructure.Models.CheckNameAvailabilityResult CheckNameAvailabilityResult(Azure.ResourceManager.DevOpsInfrastructure.Models.AvailabilityStatus available = default(Azure.ResourceManager.DevOpsInfrastructure.Models.AvailabilityStatus), string message = null, string name = null, Azure.ResourceManager.DevOpsInfrastructure.Models.CheckNameAvailabilityReason reason = default(Azure.ResourceManager.DevOpsInfrastructure.Models.CheckNameAvailabilityReason)) { throw null; } public static Azure.ResourceManager.DevOpsInfrastructure.Models.DevOpsImageVersion DevOpsImageVersion(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, string imageVersion = null) { throw null; } public static Azure.ResourceManager.DevOpsInfrastructure.DevOpsPoolData DevOpsPoolData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), Azure.ResourceManager.DevOpsInfrastructure.Models.DevOpsPoolProperties properties = null, Azure.ResourceManager.Models.ManagedServiceIdentity identity = null) { throw null; } public static Azure.ResourceManager.DevOpsInfrastructure.Models.DevOpsResourceDetails DevOpsResourceDetails(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.DevOpsInfrastructure.Models.DevOpsResourceDetailsProperties properties = null) { throw null; } @@ -128,6 +133,86 @@ protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter write string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct AvailabilityStatus : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public AvailabilityStatus(string value) { throw null; } + public static Azure.ResourceManager.DevOpsInfrastructure.Models.AvailabilityStatus Available { get { throw null; } } + public static Azure.ResourceManager.DevOpsInfrastructure.Models.AvailabilityStatus Unavailable { get { throw null; } } + public bool Equals(Azure.ResourceManager.DevOpsInfrastructure.Models.AvailabilityStatus other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.DevOpsInfrastructure.Models.AvailabilityStatus left, Azure.ResourceManager.DevOpsInfrastructure.Models.AvailabilityStatus right) { throw null; } + public static implicit operator Azure.ResourceManager.DevOpsInfrastructure.Models.AvailabilityStatus (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.DevOpsInfrastructure.Models.AvailabilityStatus left, Azure.ResourceManager.DevOpsInfrastructure.Models.AvailabilityStatus right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct CertificateStoreNameOption : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public CertificateStoreNameOption(string value) { throw null; } + public static Azure.ResourceManager.DevOpsInfrastructure.Models.CertificateStoreNameOption My { get { throw null; } } + public static Azure.ResourceManager.DevOpsInfrastructure.Models.CertificateStoreNameOption Root { get { throw null; } } + public bool Equals(Azure.ResourceManager.DevOpsInfrastructure.Models.CertificateStoreNameOption other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.DevOpsInfrastructure.Models.CertificateStoreNameOption left, Azure.ResourceManager.DevOpsInfrastructure.Models.CertificateStoreNameOption right) { throw null; } + public static implicit operator Azure.ResourceManager.DevOpsInfrastructure.Models.CertificateStoreNameOption (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.DevOpsInfrastructure.Models.CertificateStoreNameOption left, Azure.ResourceManager.DevOpsInfrastructure.Models.CertificateStoreNameOption right) { throw null; } + public override string ToString() { throw null; } + } + public partial class CheckNameAvailability : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public CheckNameAvailability(string name, Azure.ResourceManager.DevOpsInfrastructure.Models.DevOpsInfrastructureResourceType type) { } + public string Name { get { throw null; } } + public Azure.ResourceManager.DevOpsInfrastructure.Models.DevOpsInfrastructureResourceType Type { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DevOpsInfrastructure.Models.CheckNameAvailability System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DevOpsInfrastructure.Models.CheckNameAvailability System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct CheckNameAvailabilityReason : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public CheckNameAvailabilityReason(string value) { throw null; } + public static Azure.ResourceManager.DevOpsInfrastructure.Models.CheckNameAvailabilityReason AlreadyExists { get { throw null; } } + public static Azure.ResourceManager.DevOpsInfrastructure.Models.CheckNameAvailabilityReason Invalid { get { throw null; } } + public bool Equals(Azure.ResourceManager.DevOpsInfrastructure.Models.CheckNameAvailabilityReason other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.DevOpsInfrastructure.Models.CheckNameAvailabilityReason left, Azure.ResourceManager.DevOpsInfrastructure.Models.CheckNameAvailabilityReason right) { throw null; } + public static implicit operator Azure.ResourceManager.DevOpsInfrastructure.Models.CheckNameAvailabilityReason (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.DevOpsInfrastructure.Models.CheckNameAvailabilityReason left, Azure.ResourceManager.DevOpsInfrastructure.Models.CheckNameAvailabilityReason right) { throw null; } + public override string ToString() { throw null; } + } + public partial class CheckNameAvailabilityResult : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal CheckNameAvailabilityResult() { } + public Azure.ResourceManager.DevOpsInfrastructure.Models.AvailabilityStatus Available { get { throw null; } } + public string Message { get { throw null; } } + public string Name { get { throw null; } } + public Azure.ResourceManager.DevOpsInfrastructure.Models.CheckNameAvailabilityReason Reason { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DevOpsInfrastructure.Models.CheckNameAvailabilityResult System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DevOpsInfrastructure.Models.CheckNameAvailabilityResult System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } public partial class DevOpsAzureOrganizationProfile : Azure.ResourceManager.DevOpsInfrastructure.Models.DevOpsOrganizationProfile, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public DevOpsAzureOrganizationProfile(System.Collections.Generic.IEnumerable organizations) { } @@ -284,6 +369,23 @@ protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter write public override string ToString() { throw null; } } [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct DevOpsInfrastructureResourceType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public DevOpsInfrastructureResourceType(string value) { throw null; } + public static Azure.ResourceManager.DevOpsInfrastructure.Models.DevOpsInfrastructureResourceType MicrosoftDevOpsInfrastructurePools { get { throw null; } } + public bool Equals(Azure.ResourceManager.DevOpsInfrastructure.Models.DevOpsInfrastructureResourceType other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.DevOpsInfrastructure.Models.DevOpsInfrastructureResourceType left, Azure.ResourceManager.DevOpsInfrastructure.Models.DevOpsInfrastructureResourceType right) { throw null; } + public static implicit operator Azure.ResourceManager.DevOpsInfrastructure.Models.DevOpsInfrastructureResourceType (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.DevOpsInfrastructure.Models.DevOpsInfrastructureResourceType left, Azure.ResourceManager.DevOpsInfrastructure.Models.DevOpsInfrastructureResourceType right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] public readonly partial struct DevOpsLogonType : System.IEquatable { private readonly object _dummy; @@ -304,6 +406,7 @@ protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter write public partial class DevOpsOrganization : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public DevOpsOrganization(System.Uri uri) { } + public bool? OpenAccess { get { throw null; } set { } } public int? Parallelism { get { throw null; } set { } } public System.Collections.Generic.IList Projects { get { throw null; } } public System.Uri Uri { get { throw null; } set { } } @@ -382,6 +485,7 @@ public partial class DevOpsPoolVmImage : System.ClientModel.Primitives.IJsonMode public DevOpsPoolVmImage() { } public System.Collections.Generic.IList Aliases { get { throw null; } } public string Buffer { get { throw null; } set { } } + public Azure.ResourceManager.DevOpsInfrastructure.Models.EphemeralType? EphemeralType { get { throw null; } set { } } public string ResourceId { get { throw null; } set { } } public string WellKnownImageName { get { throw null; } set { } } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } @@ -568,6 +672,25 @@ protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter write string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct EphemeralType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public EphemeralType(string value) { throw null; } + public static Azure.ResourceManager.DevOpsInfrastructure.Models.EphemeralType Automatic { get { throw null; } } + public static Azure.ResourceManager.DevOpsInfrastructure.Models.EphemeralType CacheDisk { get { throw null; } } + public static Azure.ResourceManager.DevOpsInfrastructure.Models.EphemeralType ResourceDisk { get { throw null; } } + public bool Equals(Azure.ResourceManager.DevOpsInfrastructure.Models.EphemeralType other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.DevOpsInfrastructure.Models.EphemeralType left, Azure.ResourceManager.DevOpsInfrastructure.Models.EphemeralType right) { throw null; } + public static implicit operator Azure.ResourceManager.DevOpsInfrastructure.Models.EphemeralType (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.DevOpsInfrastructure.Models.EphemeralType left, Azure.ResourceManager.DevOpsInfrastructure.Models.EphemeralType right) { throw null; } + public override string ToString() { throw null; } + } public partial class ManualResourcePredictionsProfile : Azure.ResourceManager.DevOpsInfrastructure.Models.ResourcePredictionsProfile, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public ManualResourcePredictionsProfile() { } @@ -757,6 +880,7 @@ public partial class SecretsManagementSettings : System.ClientModel.Primitives.I { public SecretsManagementSettings(System.Collections.Generic.IEnumerable observedCertificates, bool keyExportable) { } public string CertificateStoreLocation { get { throw null; } set { } } + public Azure.ResourceManager.DevOpsInfrastructure.Models.CertificateStoreNameOption? CertificateStoreName { get { throw null; } set { } } public bool KeyExportable { get { throw null; } set { } } public System.Collections.Generic.IList ObservedCertificates { get { throw null; } } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } diff --git a/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/api/Azure.ResourceManager.DevOpsInfrastructure.netstandard2.0.cs b/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/api/Azure.ResourceManager.DevOpsInfrastructure.netstandard2.0.cs index 86448afdc637..257cbf40ba48 100644 --- a/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/api/Azure.ResourceManager.DevOpsInfrastructure.netstandard2.0.cs +++ b/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/api/Azure.ResourceManager.DevOpsInfrastructure.netstandard2.0.cs @@ -2,6 +2,8 @@ namespace Azure.ResourceManager.DevOpsInfrastructure { public static partial class DevOpsInfrastructureExtensions { + public static Azure.Response CheckNameAvailabilityPool(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, Azure.ResourceManager.DevOpsInfrastructure.Models.CheckNameAvailability body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static System.Threading.Tasks.Task> CheckNameAvailabilityPoolAsync(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, Azure.ResourceManager.DevOpsInfrastructure.Models.CheckNameAvailability body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public static Azure.Response GetDevOpsPool(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string poolName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public static System.Threading.Tasks.Task> GetDevOpsPoolAsync(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string poolName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public static Azure.ResourceManager.DevOpsInfrastructure.DevOpsPoolResource GetDevOpsPoolResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } @@ -91,6 +93,8 @@ protected MockableDevOpsInfrastructureResourceGroupResource() { } public partial class MockableDevOpsInfrastructureSubscriptionResource : Azure.ResourceManager.ArmResource { protected MockableDevOpsInfrastructureSubscriptionResource() { } + public virtual Azure.Response CheckNameAvailabilityPool(Azure.ResourceManager.DevOpsInfrastructure.Models.CheckNameAvailability body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CheckNameAvailabilityPoolAsync(Azure.ResourceManager.DevOpsInfrastructure.Models.CheckNameAvailability body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Pageable GetDevOpsPools(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.AsyncPageable GetDevOpsPoolsAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Pageable GetSkusByLocation(string locationName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } @@ -103,6 +107,7 @@ namespace Azure.ResourceManager.DevOpsInfrastructure.Models { public static partial class ArmDevOpsInfrastructureModelFactory { + public static Azure.ResourceManager.DevOpsInfrastructure.Models.CheckNameAvailabilityResult CheckNameAvailabilityResult(Azure.ResourceManager.DevOpsInfrastructure.Models.AvailabilityStatus available = default(Azure.ResourceManager.DevOpsInfrastructure.Models.AvailabilityStatus), string message = null, string name = null, Azure.ResourceManager.DevOpsInfrastructure.Models.CheckNameAvailabilityReason reason = default(Azure.ResourceManager.DevOpsInfrastructure.Models.CheckNameAvailabilityReason)) { throw null; } public static Azure.ResourceManager.DevOpsInfrastructure.Models.DevOpsImageVersion DevOpsImageVersion(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, string imageVersion = null) { throw null; } public static Azure.ResourceManager.DevOpsInfrastructure.DevOpsPoolData DevOpsPoolData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), Azure.ResourceManager.DevOpsInfrastructure.Models.DevOpsPoolProperties properties = null, Azure.ResourceManager.Models.ManagedServiceIdentity identity = null) { throw null; } public static Azure.ResourceManager.DevOpsInfrastructure.Models.DevOpsResourceDetails DevOpsResourceDetails(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.DevOpsInfrastructure.Models.DevOpsResourceDetailsProperties properties = null) { throw null; } @@ -128,6 +133,86 @@ protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter write string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct AvailabilityStatus : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public AvailabilityStatus(string value) { throw null; } + public static Azure.ResourceManager.DevOpsInfrastructure.Models.AvailabilityStatus Available { get { throw null; } } + public static Azure.ResourceManager.DevOpsInfrastructure.Models.AvailabilityStatus Unavailable { get { throw null; } } + public bool Equals(Azure.ResourceManager.DevOpsInfrastructure.Models.AvailabilityStatus other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.DevOpsInfrastructure.Models.AvailabilityStatus left, Azure.ResourceManager.DevOpsInfrastructure.Models.AvailabilityStatus right) { throw null; } + public static implicit operator Azure.ResourceManager.DevOpsInfrastructure.Models.AvailabilityStatus (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.DevOpsInfrastructure.Models.AvailabilityStatus left, Azure.ResourceManager.DevOpsInfrastructure.Models.AvailabilityStatus right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct CertificateStoreNameOption : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public CertificateStoreNameOption(string value) { throw null; } + public static Azure.ResourceManager.DevOpsInfrastructure.Models.CertificateStoreNameOption My { get { throw null; } } + public static Azure.ResourceManager.DevOpsInfrastructure.Models.CertificateStoreNameOption Root { get { throw null; } } + public bool Equals(Azure.ResourceManager.DevOpsInfrastructure.Models.CertificateStoreNameOption other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.DevOpsInfrastructure.Models.CertificateStoreNameOption left, Azure.ResourceManager.DevOpsInfrastructure.Models.CertificateStoreNameOption right) { throw null; } + public static implicit operator Azure.ResourceManager.DevOpsInfrastructure.Models.CertificateStoreNameOption (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.DevOpsInfrastructure.Models.CertificateStoreNameOption left, Azure.ResourceManager.DevOpsInfrastructure.Models.CertificateStoreNameOption right) { throw null; } + public override string ToString() { throw null; } + } + public partial class CheckNameAvailability : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public CheckNameAvailability(string name, Azure.ResourceManager.DevOpsInfrastructure.Models.DevOpsInfrastructureResourceType type) { } + public string Name { get { throw null; } } + public Azure.ResourceManager.DevOpsInfrastructure.Models.DevOpsInfrastructureResourceType Type { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DevOpsInfrastructure.Models.CheckNameAvailability System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DevOpsInfrastructure.Models.CheckNameAvailability System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct CheckNameAvailabilityReason : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public CheckNameAvailabilityReason(string value) { throw null; } + public static Azure.ResourceManager.DevOpsInfrastructure.Models.CheckNameAvailabilityReason AlreadyExists { get { throw null; } } + public static Azure.ResourceManager.DevOpsInfrastructure.Models.CheckNameAvailabilityReason Invalid { get { throw null; } } + public bool Equals(Azure.ResourceManager.DevOpsInfrastructure.Models.CheckNameAvailabilityReason other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.DevOpsInfrastructure.Models.CheckNameAvailabilityReason left, Azure.ResourceManager.DevOpsInfrastructure.Models.CheckNameAvailabilityReason right) { throw null; } + public static implicit operator Azure.ResourceManager.DevOpsInfrastructure.Models.CheckNameAvailabilityReason (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.DevOpsInfrastructure.Models.CheckNameAvailabilityReason left, Azure.ResourceManager.DevOpsInfrastructure.Models.CheckNameAvailabilityReason right) { throw null; } + public override string ToString() { throw null; } + } + public partial class CheckNameAvailabilityResult : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal CheckNameAvailabilityResult() { } + public Azure.ResourceManager.DevOpsInfrastructure.Models.AvailabilityStatus Available { get { throw null; } } + public string Message { get { throw null; } } + public string Name { get { throw null; } } + public Azure.ResourceManager.DevOpsInfrastructure.Models.CheckNameAvailabilityReason Reason { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DevOpsInfrastructure.Models.CheckNameAvailabilityResult System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DevOpsInfrastructure.Models.CheckNameAvailabilityResult System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } public partial class DevOpsAzureOrganizationProfile : Azure.ResourceManager.DevOpsInfrastructure.Models.DevOpsOrganizationProfile, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public DevOpsAzureOrganizationProfile(System.Collections.Generic.IEnumerable organizations) { } @@ -284,6 +369,23 @@ protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter write public override string ToString() { throw null; } } [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct DevOpsInfrastructureResourceType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public DevOpsInfrastructureResourceType(string value) { throw null; } + public static Azure.ResourceManager.DevOpsInfrastructure.Models.DevOpsInfrastructureResourceType MicrosoftDevOpsInfrastructurePools { get { throw null; } } + public bool Equals(Azure.ResourceManager.DevOpsInfrastructure.Models.DevOpsInfrastructureResourceType other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.DevOpsInfrastructure.Models.DevOpsInfrastructureResourceType left, Azure.ResourceManager.DevOpsInfrastructure.Models.DevOpsInfrastructureResourceType right) { throw null; } + public static implicit operator Azure.ResourceManager.DevOpsInfrastructure.Models.DevOpsInfrastructureResourceType (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.DevOpsInfrastructure.Models.DevOpsInfrastructureResourceType left, Azure.ResourceManager.DevOpsInfrastructure.Models.DevOpsInfrastructureResourceType right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] public readonly partial struct DevOpsLogonType : System.IEquatable { private readonly object _dummy; @@ -304,6 +406,7 @@ protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter write public partial class DevOpsOrganization : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public DevOpsOrganization(System.Uri uri) { } + public bool? OpenAccess { get { throw null; } set { } } public int? Parallelism { get { throw null; } set { } } public System.Collections.Generic.IList Projects { get { throw null; } } public System.Uri Uri { get { throw null; } set { } } @@ -382,6 +485,7 @@ public partial class DevOpsPoolVmImage : System.ClientModel.Primitives.IJsonMode public DevOpsPoolVmImage() { } public System.Collections.Generic.IList Aliases { get { throw null; } } public string Buffer { get { throw null; } set { } } + public Azure.ResourceManager.DevOpsInfrastructure.Models.EphemeralType? EphemeralType { get { throw null; } set { } } public string ResourceId { get { throw null; } set { } } public string WellKnownImageName { get { throw null; } set { } } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } @@ -568,6 +672,25 @@ protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter write string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct EphemeralType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public EphemeralType(string value) { throw null; } + public static Azure.ResourceManager.DevOpsInfrastructure.Models.EphemeralType Automatic { get { throw null; } } + public static Azure.ResourceManager.DevOpsInfrastructure.Models.EphemeralType CacheDisk { get { throw null; } } + public static Azure.ResourceManager.DevOpsInfrastructure.Models.EphemeralType ResourceDisk { get { throw null; } } + public bool Equals(Azure.ResourceManager.DevOpsInfrastructure.Models.EphemeralType other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.DevOpsInfrastructure.Models.EphemeralType left, Azure.ResourceManager.DevOpsInfrastructure.Models.EphemeralType right) { throw null; } + public static implicit operator Azure.ResourceManager.DevOpsInfrastructure.Models.EphemeralType (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.DevOpsInfrastructure.Models.EphemeralType left, Azure.ResourceManager.DevOpsInfrastructure.Models.EphemeralType right) { throw null; } + public override string ToString() { throw null; } + } public partial class ManualResourcePredictionsProfile : Azure.ResourceManager.DevOpsInfrastructure.Models.ResourcePredictionsProfile, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public ManualResourcePredictionsProfile() { } @@ -757,6 +880,7 @@ public partial class SecretsManagementSettings : System.ClientModel.Primitives.I { public SecretsManagementSettings(System.Collections.Generic.IEnumerable observedCertificates, bool keyExportable) { } public string CertificateStoreLocation { get { throw null; } set { } } + public Azure.ResourceManager.DevOpsInfrastructure.Models.CertificateStoreNameOption? CertificateStoreName { get { throw null; } set { } } public bool KeyExportable { get { throw null; } set { } } public System.Collections.Generic.IList ObservedCertificates { get { throw null; } } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } diff --git a/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/samples/Generated/Samples/Sample_DevOpsPoolCollection.cs b/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/samples/Generated/Samples/Sample_DevOpsPoolCollection.cs index c380856cbc2a..5a0bb2ef594f 100644 --- a/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/samples/Generated/Samples/Sample_DevOpsPoolCollection.cs +++ b/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/samples/Generated/Samples/Sample_DevOpsPoolCollection.cs @@ -21,7 +21,7 @@ public partial class Sample_DevOpsPoolCollection [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_PoolsCreateOrUpdate() { - // Generated from example definition: 2024-10-19/CreateOrUpdatePool.json + // Generated from example definition: 2025-01-21/CreateOrUpdatePool.json // this example is just showing the usage of "Pool_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 @@ -46,13 +46,26 @@ public async Task CreateOrUpdate_PoolsCreateOrUpdate() Properties = new DevOpsPoolProperties(10, new DevOpsAzureOrganizationProfile(new DevOpsOrganization[] { new DevOpsOrganization(new Uri("https://mseng.visualstudio.com")) +{ +OpenAccess = true, +} }), new DevOpsStatelessAgentProfile(), new DevOpsVmssFabricProfile(new DevOpsAzureSku("Standard_D4ads_v5"), new DevOpsPoolVmImage[] { new DevOpsPoolVmImage { ResourceId = "/MicrosoftWindowsServer/WindowsServer/2019-Datacenter/latest", +EphemeralType = EphemeralType.Automatic, } - }), "/subscriptions/222e81d0-cf38-4dab-baa5-289bf16baaa4/resourceGroups/rg-1es-devcenter/providers/Microsoft.DevCenter/projects/1ES") + }) + { + OSProfile = new DevOpsOSProfile + { + SecretsManagementSettings = new SecretsManagementSettings(new Uri[] { new Uri("https://abc.vault.azure.net/secrets/one") }, false) + { + CertificateStoreName = CertificateStoreNameOption.Root, + }, + }, + }, "/subscriptions/222e81d0-cf38-4dab-baa5-289bf16baaa4/resourceGroups/rg-1es-devcenter/providers/Microsoft.DevCenter/projects/1ES") { ProvisioningState = DevOpsInfrastructureProvisioningState.Succeeded, }, @@ -71,7 +84,7 @@ public async Task CreateOrUpdate_PoolsCreateOrUpdate() [Ignore("Only validating compilation of examples")] public async Task Get_PoolsGet() { - // Generated from example definition: 2024-10-19/GetPool.json + // Generated from example definition: 2025-01-21/GetPool.json // this example is just showing the usage of "Pool_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -104,7 +117,7 @@ public async Task Get_PoolsGet() [Ignore("Only validating compilation of examples")] public async Task GetAll_PoolsListByResourceGroup() { - // Generated from example definition: 2024-10-19/ListPoolsBySubscriptionAndResourceGroup.json + // Generated from example definition: 2025-01-21/ListPoolsBySubscriptionAndResourceGroup.json // this example is just showing the usage of "Pool_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 @@ -139,7 +152,7 @@ public async Task GetAll_PoolsListByResourceGroup() [Ignore("Only validating compilation of examples")] public async Task Exists_PoolsGet() { - // Generated from example definition: 2024-10-19/GetPool.json + // Generated from example definition: 2025-01-21/GetPool.json // this example is just showing the usage of "Pool_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 @@ -168,7 +181,7 @@ public async Task Exists_PoolsGet() [Ignore("Only validating compilation of examples")] public async Task GetIfExists_PoolsGet() { - // Generated from example definition: 2024-10-19/GetPool.json + // Generated from example definition: 2025-01-21/GetPool.json // this example is just showing the usage of "Pool_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/samples/Generated/Samples/Sample_DevOpsPoolResource.cs b/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/samples/Generated/Samples/Sample_DevOpsPoolResource.cs index a4b685804527..35b6bc86998c 100644 --- a/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/samples/Generated/Samples/Sample_DevOpsPoolResource.cs +++ b/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/samples/Generated/Samples/Sample_DevOpsPoolResource.cs @@ -20,7 +20,7 @@ public partial class Sample_DevOpsPoolResource [Ignore("Only validating compilation of examples")] public async Task Get_PoolsGet() { - // Generated from example definition: 2024-10-19/GetPool.json + // Generated from example definition: 2025-01-21/GetPool.json // this example is just showing the usage of "Pool_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 @@ -50,7 +50,7 @@ public async Task Get_PoolsGet() [Ignore("Only validating compilation of examples")] public async Task Delete_PoolsDelete() { - // Generated from example definition: 2024-10-19/DeletePool.json + // Generated from example definition: 2025-01-21/DeletePool.json // this example is just showing the usage of "Pool_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 @@ -76,7 +76,7 @@ public async Task Delete_PoolsDelete() [Ignore("Only validating compilation of examples")] public async Task Update_PoolsUpdate() { - // Generated from example definition: 2024-10-19/UpdatePool.json + // Generated from example definition: 2025-01-21/UpdatePool.json // this example is just showing the usage of "Pool_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 @@ -108,7 +108,7 @@ public async Task Update_PoolsUpdate() [Ignore("Only validating compilation of examples")] public async Task GetResourceDetails_ResourceDetailsListByPool() { - // Generated from example definition: 2024-10-19/ResourceDetails_ListByPool.json + // Generated from example definition: 2025-01-21/ResourceDetails_ListByPool.json // this example is just showing the usage of "ResourceDetailsObject_ListByPool" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/samples/Generated/Samples/Sample_ResourceGroupResourceExtensions.cs b/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/samples/Generated/Samples/Sample_ResourceGroupResourceExtensions.cs index b3f54cb97955..812ebf638b70 100644 --- a/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/samples/Generated/Samples/Sample_ResourceGroupResourceExtensions.cs +++ b/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/samples/Generated/Samples/Sample_ResourceGroupResourceExtensions.cs @@ -21,7 +21,7 @@ public partial class Sample_ResourceGroupResourceExtensions [Ignore("Only validating compilation of examples")] public async Task GetImageVersionsByImage_ImageVersionsListByImage() { - // Generated from example definition: 2024-10-19/ImageVersions_ListByImage.json + // Generated from example definition: 2025-01-21/ImageVersions_ListByImage.json // this example is just showing the usage of "ImageVersion_ListByImage" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/samples/Generated/Samples/Sample_SubscriptionResourceExtensions.cs b/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/samples/Generated/Samples/Sample_SubscriptionResourceExtensions.cs index 97546467a4f7..bf121c2d49c4 100644 --- a/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/samples/Generated/Samples/Sample_SubscriptionResourceExtensions.cs +++ b/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/samples/Generated/Samples/Sample_SubscriptionResourceExtensions.cs @@ -21,7 +21,7 @@ public partial class Sample_SubscriptionResourceExtensions [Ignore("Only validating compilation of examples")] public async Task GetDevOpsPools_PoolsListBySubscription() { - // Generated from example definition: 2024-10-19/ListPoolsBySubscription.json + // Generated from example definition: 2025-01-21/ListPoolsBySubscription.json // this example is just showing the usage of "Pool_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 @@ -48,11 +48,36 @@ public async Task GetDevOpsPools_PoolsListBySubscription() Console.WriteLine("Succeeded"); } + [Test] + [Ignore("Only validating compilation of examples")] + public async Task CheckNameAvailabilityPool_PoolsCheckNameAvailability() + { + // Generated from example definition: 2025-01-21/Pools_CheckNameAvailability.json + // this example is just showing the usage of "Pools_CheckNameAvailability" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details 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 = "a2e95d27-c161-4b61-bda4-11512c14c2c2"; + ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(subscriptionId); + SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId); + + // invoke the operation + CheckNameAvailability body = new CheckNameAvailability("mydevopspool", DevOpsInfrastructureResourceType.MicrosoftDevOpsInfrastructurePools); + CheckNameAvailabilityResult result = await subscriptionResource.CheckNameAvailabilityPoolAsync(body); + + Console.WriteLine($"Succeeded: {result}"); + } + [Test] [Ignore("Only validating compilation of examples")] public async Task GetSkusByLocation_SkuListByLocation() { - // Generated from example definition: 2024-10-19/Sku_ListByLocation.json + // Generated from example definition: 2025-01-21/Sku_ListByLocation.json // this example is just showing the usage of "ResourceSku_ListByLocation" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -80,7 +105,7 @@ public async Task GetSkusByLocation_SkuListByLocation() [Ignore("Only validating compilation of examples")] public async Task GetUsages_SubscriptionUsagesUsages() { - // Generated from example definition: 2024-10-19/SubscriptionUsages_Usages.json + // Generated from example definition: 2025-01-21/SubscriptionUsages_Usages.json // this example is just showing the usage of "SubscriptionUsages_GetUsages" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/src/Generated/ArmDevOpsInfrastructureModelFactory.cs b/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/src/Generated/ArmDevOpsInfrastructureModelFactory.cs index b6121565a165..06c09857f702 100644 --- a/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/src/Generated/ArmDevOpsInfrastructureModelFactory.cs +++ b/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/src/Generated/ArmDevOpsInfrastructureModelFactory.cs @@ -220,5 +220,16 @@ public static DevOpsPoolData DevOpsPoolData(ResourceIdentifier id = null, string identity, serializedAdditionalRawData: null); } + + /// Initializes a new instance of . + /// Availability status of the name. + /// A message explaining why the name is unavailable. Will be null if the name is available. + /// The name whose availability was checked. + /// The reason code explaining why the name is unavailable. Will be null if the name is available. + /// A new instance for mocking. + public static CheckNameAvailabilityResult CheckNameAvailabilityResult(AvailabilityStatus available = default, string message = null, string name = null, CheckNameAvailabilityReason reason = default) + { + return new CheckNameAvailabilityResult(available, message, name, reason, serializedAdditionalRawData: null); + } } } diff --git a/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/src/Generated/DevOpsPoolCollection.cs b/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/src/Generated/DevOpsPoolCollection.cs index 1e2ea411a868..7373fd2c720c 100644 --- a/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/src/Generated/DevOpsPoolCollection.cs +++ b/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/src/Generated/DevOpsPoolCollection.cs @@ -65,7 +65,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-10-19 + /// 2025-01-21 /// /// /// Resource @@ -114,7 +114,7 @@ public virtual async Task> CreateOrUpdateAsync( /// /// /// Default Api Version - /// 2024-10-19 + /// 2025-01-21 /// /// /// Resource @@ -163,7 +163,7 @@ public virtual ArmOperation CreateOrUpdate(WaitUntil waitUnt /// /// /// Default Api Version - /// 2024-10-19 + /// 2025-01-21 /// /// /// Resource @@ -208,7 +208,7 @@ public virtual async Task> GetAsync(string poolName /// /// /// Default Api Version - /// 2024-10-19 + /// 2025-01-21 /// /// /// Resource @@ -253,7 +253,7 @@ public virtual Response Get(string poolName, CancellationTok /// /// /// Default Api Version - /// 2024-10-19 + /// 2025-01-21 /// /// /// Resource @@ -283,7 +283,7 @@ public virtual AsyncPageable GetAllAsync(CancellationToken c /// /// /// Default Api Version - /// 2024-10-19 + /// 2025-01-21 /// /// /// Resource @@ -313,7 +313,7 @@ public virtual Pageable GetAll(CancellationToken cancellatio /// /// /// Default Api Version - /// 2024-10-19 + /// 2025-01-21 /// /// /// Resource @@ -356,7 +356,7 @@ public virtual async Task> ExistsAsync(string poolName, Cancellat /// /// /// Default Api Version - /// 2024-10-19 + /// 2025-01-21 /// /// /// Resource @@ -399,7 +399,7 @@ public virtual Response Exists(string poolName, CancellationToken cancella /// /// /// Default Api Version - /// 2024-10-19 + /// 2025-01-21 /// /// /// Resource @@ -444,7 +444,7 @@ public virtual async Task> GetIfExistsAsync /// /// /// Default Api Version - /// 2024-10-19 + /// 2025-01-21 /// /// /// Resource diff --git a/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/src/Generated/DevOpsPoolResource.cs b/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/src/Generated/DevOpsPoolResource.cs index a3b6aeebb638..cd7b24c30bf8 100644 --- a/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/src/Generated/DevOpsPoolResource.cs +++ b/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/src/Generated/DevOpsPoolResource.cs @@ -108,7 +108,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-10-19 + /// 2025-01-21 /// /// /// Resource @@ -148,7 +148,7 @@ public virtual async Task> GetAsync(CancellationTok /// /// /// Default Api Version - /// 2024-10-19 + /// 2025-01-21 /// /// /// Resource @@ -188,7 +188,7 @@ public virtual Response Get(CancellationToken cancellationTo /// /// /// Default Api Version - /// 2024-10-19 + /// 2025-01-21 /// /// /// Resource @@ -230,7 +230,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2024-10-19 + /// 2025-01-21 /// /// /// Resource @@ -272,7 +272,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2024-10-19 + /// 2025-01-21 /// /// /// Resource @@ -318,7 +318,7 @@ public virtual async Task> UpdateAsync(WaitUnti /// /// /// Default Api Version - /// 2024-10-19 + /// 2025-01-21 /// /// /// Resource @@ -364,7 +364,7 @@ public virtual ArmOperation Update(WaitUntil waitUntil, DevO /// /// /// Default Api Version - /// 2024-10-19 + /// 2025-01-21 /// /// /// @@ -390,7 +390,7 @@ public virtual AsyncPageable GetResourceDetailsAsync(Canc /// /// /// Default Api Version - /// 2024-10-19 + /// 2025-01-21 /// /// /// @@ -416,7 +416,7 @@ public virtual Pageable GetResourceDetails(CancellationTo /// /// /// Default Api Version - /// 2024-10-19 + /// 2025-01-21 /// /// /// Resource @@ -478,7 +478,7 @@ public virtual async Task> AddTagAsync(string key, /// /// /// Default Api Version - /// 2024-10-19 + /// 2025-01-21 /// /// /// Resource @@ -540,7 +540,7 @@ public virtual Response AddTag(string key, string value, Can /// /// /// Default Api Version - /// 2024-10-19 + /// 2025-01-21 /// /// /// Resource @@ -597,7 +597,7 @@ public virtual async Task> SetTagsAsync(IDictionary /// /// /// Default Api Version - /// 2024-10-19 + /// 2025-01-21 /// /// /// Resource @@ -654,7 +654,7 @@ public virtual Response SetTags(IDictionary /// /// /// Default Api Version - /// 2024-10-19 + /// 2025-01-21 /// /// /// Resource @@ -714,7 +714,7 @@ public virtual async Task> RemoveTagAsync(string ke /// /// /// Default Api Version - /// 2024-10-19 + /// 2025-01-21 /// /// /// Resource diff --git a/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/src/Generated/Extensions/DevOpsInfrastructureExtensions.cs b/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/src/Generated/Extensions/DevOpsInfrastructureExtensions.cs index 3e3e44d9dcd3..a85b1cb206f9 100644 --- a/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/src/Generated/Extensions/DevOpsInfrastructureExtensions.cs +++ b/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/src/Generated/Extensions/DevOpsInfrastructureExtensions.cs @@ -82,7 +82,7 @@ public static DevOpsPoolCollection GetDevOpsPools(this ResourceGroupResource res /// /// /// Default Api Version - /// 2024-10-19 + /// 2025-01-21 /// /// /// Resource @@ -120,7 +120,7 @@ public static async Task> GetDevOpsPoolAsync(this R /// /// /// Default Api Version - /// 2024-10-19 + /// 2025-01-21 /// /// /// Resource @@ -158,7 +158,7 @@ public static Response GetDevOpsPool(this ResourceGroupResou /// /// /// Default Api Version - /// 2024-10-19 + /// 2025-01-21 /// /// /// @@ -192,7 +192,7 @@ public static AsyncPageable GetImageVersionsByImageAsync(thi /// /// /// Default Api Version - /// 2024-10-19 + /// 2025-01-21 /// /// /// @@ -226,7 +226,7 @@ public static Pageable GetImageVersionsByImage(this Resource /// /// /// Default Api Version - /// 2024-10-19 + /// 2025-01-21 /// /// /// Resource @@ -262,7 +262,7 @@ public static AsyncPageable GetDevOpsPoolsAsync(this Subscri /// /// /// Default Api Version - /// 2024-10-19 + /// 2025-01-21 /// /// /// Resource @@ -285,6 +285,78 @@ public static Pageable GetDevOpsPools(this SubscriptionResou return GetMockableDevOpsInfrastructureSubscriptionResource(subscriptionResource).GetDevOpsPools(cancellationToken); } + /// + /// Checks that the pool name is valid and is not already in use. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.DevOpsInfrastructure/checkNameAvailability + /// + /// + /// Operation Id + /// Pools_CheckNameAvailability + /// + /// + /// Default Api Version + /// 2025-01-21 + /// + /// + /// Resource + /// + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The CheckAvailability request. + /// The cancellation token to use. + /// or is null. + public static async Task> CheckNameAvailabilityPoolAsync(this SubscriptionResource subscriptionResource, CheckNameAvailability body, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); + + return await GetMockableDevOpsInfrastructureSubscriptionResource(subscriptionResource).CheckNameAvailabilityPoolAsync(body, cancellationToken).ConfigureAwait(false); + } + + /// + /// Checks that the pool name is valid and is not already in use. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.DevOpsInfrastructure/checkNameAvailability + /// + /// + /// Operation Id + /// Pools_CheckNameAvailability + /// + /// + /// Default Api Version + /// 2025-01-21 + /// + /// + /// Resource + /// + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The CheckAvailability request. + /// The cancellation token to use. + /// or is null. + public static Response CheckNameAvailabilityPool(this SubscriptionResource subscriptionResource, CheckNameAvailability body, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); + + return GetMockableDevOpsInfrastructureSubscriptionResource(subscriptionResource).CheckNameAvailabilityPool(body, cancellationToken); + } + /// /// List ResourceSku resources by subscription ID /// @@ -298,7 +370,7 @@ public static Pageable GetDevOpsPools(this SubscriptionResou /// /// /// Default Api Version - /// 2024-10-19 + /// 2025-01-21 /// /// /// @@ -332,7 +404,7 @@ public static AsyncPageable GetSkusByLocationAsync(this Subsc /// /// /// Default Api Version - /// 2024-10-19 + /// 2025-01-21 /// /// /// @@ -366,7 +438,7 @@ public static Pageable GetSkusByLocation(this SubscriptionRes /// /// /// Default Api Version - /// 2024-10-19 + /// 2025-01-21 /// /// /// @@ -399,7 +471,7 @@ public static AsyncPageable GetUsagesAsync(this Subscriptio /// /// /// Default Api Version - /// 2024-10-19 + /// 2025-01-21 /// /// /// diff --git a/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/src/Generated/Extensions/MockableDevOpsInfrastructureResourceGroupResource.cs b/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/src/Generated/Extensions/MockableDevOpsInfrastructureResourceGroupResource.cs index fbfc1fee6226..f5787074c63d 100644 --- a/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/src/Generated/Extensions/MockableDevOpsInfrastructureResourceGroupResource.cs +++ b/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/src/Generated/Extensions/MockableDevOpsInfrastructureResourceGroupResource.cs @@ -62,7 +62,7 @@ public virtual DevOpsPoolCollection GetDevOpsPools() /// /// /// Default Api Version - /// 2024-10-19 + /// 2025-01-21 /// /// /// Resource @@ -93,7 +93,7 @@ public virtual async Task> GetDevOpsPoolAsync(strin /// /// /// Default Api Version - /// 2024-10-19 + /// 2025-01-21 /// /// /// Resource @@ -124,7 +124,7 @@ public virtual Response GetDevOpsPool(string poolName, Cance /// /// /// Default Api Version - /// 2024-10-19 + /// 2025-01-21 /// /// /// @@ -155,7 +155,7 @@ public virtual AsyncPageable GetImageVersionsByImageAsync(st /// /// /// Default Api Version - /// 2024-10-19 + /// 2025-01-21 /// /// /// diff --git a/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/src/Generated/Extensions/MockableDevOpsInfrastructureSubscriptionResource.cs b/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/src/Generated/Extensions/MockableDevOpsInfrastructureSubscriptionResource.cs index 224f919ee0d4..f8f46cdffa0e 100644 --- a/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/src/Generated/Extensions/MockableDevOpsInfrastructureSubscriptionResource.cs +++ b/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/src/Generated/Extensions/MockableDevOpsInfrastructureSubscriptionResource.cs @@ -7,6 +7,7 @@ using System; using System.Threading; +using System.Threading.Tasks; using Autorest.CSharp.Core; using Azure.Core; using Azure.Core.Pipeline; @@ -62,7 +63,7 @@ private string GetApiVersionOrNull(ResourceType resourceType) /// /// /// Default Api Version - /// 2024-10-19 + /// 2025-01-21 /// /// /// Resource @@ -92,7 +93,7 @@ public virtual AsyncPageable GetDevOpsPoolsAsync(Cancellatio /// /// /// Default Api Version - /// 2024-10-19 + /// 2025-01-21 /// /// /// Resource @@ -109,6 +110,90 @@ public virtual Pageable GetDevOpsPools(CancellationToken can return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new DevOpsPoolResource(Client, DevOpsPoolData.DeserializeDevOpsPoolData(e)), DevOpsPoolPoolsClientDiagnostics, Pipeline, "MockableDevOpsInfrastructureSubscriptionResource.GetDevOpsPools", "value", "nextLink", cancellationToken); } + /// + /// Checks that the pool name is valid and is not already in use. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.DevOpsInfrastructure/checkNameAvailability + /// + /// + /// Operation Id + /// Pools_CheckNameAvailability + /// + /// + /// Default Api Version + /// 2025-01-21 + /// + /// + /// Resource + /// + /// + /// + /// + /// The CheckAvailability request. + /// The cancellation token to use. + /// is null. + public virtual async Task> CheckNameAvailabilityPoolAsync(CheckNameAvailability body, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(body, nameof(body)); + + using var scope = DevOpsPoolPoolsClientDiagnostics.CreateScope("MockableDevOpsInfrastructureSubscriptionResource.CheckNameAvailabilityPool"); + scope.Start(); + try + { + var response = await DevOpsPoolPoolsRestClient.CheckNameAvailabilityAsync(Id.SubscriptionId, body, cancellationToken).ConfigureAwait(false); + return response; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Checks that the pool name is valid and is not already in use. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.DevOpsInfrastructure/checkNameAvailability + /// + /// + /// Operation Id + /// Pools_CheckNameAvailability + /// + /// + /// Default Api Version + /// 2025-01-21 + /// + /// + /// Resource + /// + /// + /// + /// + /// The CheckAvailability request. + /// The cancellation token to use. + /// is null. + public virtual Response CheckNameAvailabilityPool(CheckNameAvailability body, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(body, nameof(body)); + + using var scope = DevOpsPoolPoolsClientDiagnostics.CreateScope("MockableDevOpsInfrastructureSubscriptionResource.CheckNameAvailabilityPool"); + scope.Start(); + try + { + var response = DevOpsPoolPoolsRestClient.CheckNameAvailability(Id.SubscriptionId, body, cancellationToken); + return response; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + /// /// List ResourceSku resources by subscription ID /// @@ -122,7 +207,7 @@ public virtual Pageable GetDevOpsPools(CancellationToken can /// /// /// Default Api Version - /// 2024-10-19 + /// 2025-01-21 /// /// /// @@ -153,7 +238,7 @@ public virtual AsyncPageable GetSkusByLocationAsync(string lo /// /// /// Default Api Version - /// 2024-10-19 + /// 2025-01-21 /// /// /// @@ -184,7 +269,7 @@ public virtual Pageable GetSkusByLocation(string locationName /// /// /// Default Api Version - /// 2024-10-19 + /// 2025-01-21 /// /// /// @@ -211,7 +296,7 @@ public virtual AsyncPageable GetUsagesAsync(AzureLocation l /// /// /// Default Api Version - /// 2024-10-19 + /// 2025-01-21 /// /// /// diff --git a/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/src/Generated/Models/AvailabilityStatus.cs b/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/src/Generated/Models/AvailabilityStatus.cs new file mode 100644 index 000000000000..6d18aa34fb56 --- /dev/null +++ b/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/src/Generated/Models/AvailabilityStatus.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.DevOpsInfrastructure.Models +{ + /// AvailabilityStatus of a name. + public readonly partial struct AvailabilityStatus : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public AvailabilityStatus(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string AvailableValue = "Available"; + private const string UnavailableValue = "Unavailable"; + + /// The name is available. + public static AvailabilityStatus Available { get; } = new AvailabilityStatus(AvailableValue); + /// The name is unavailable. + public static AvailabilityStatus Unavailable { get; } = new AvailabilityStatus(UnavailableValue); + /// Determines if two values are the same. + public static bool operator ==(AvailabilityStatus left, AvailabilityStatus right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(AvailabilityStatus left, AvailabilityStatus right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator AvailabilityStatus(string value) => new AvailabilityStatus(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is AvailabilityStatus other && Equals(other); + /// + public bool Equals(AvailabilityStatus other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/src/Generated/Models/CertificateStoreNameOption.cs b/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/src/Generated/Models/CertificateStoreNameOption.cs new file mode 100644 index 000000000000..5027fb886be1 --- /dev/null +++ b/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/src/Generated/Models/CertificateStoreNameOption.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.DevOpsInfrastructure.Models +{ + /// The certificate store name type. + public readonly partial struct CertificateStoreNameOption : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public CertificateStoreNameOption(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string MyValue = "My"; + private const string RootValue = "Root"; + + /// The X.509 certificate store for personal certificates. + public static CertificateStoreNameOption My { get; } = new CertificateStoreNameOption(MyValue); + /// The X.509 certificate store for trusted root certificate authorities (CAs). + public static CertificateStoreNameOption Root { get; } = new CertificateStoreNameOption(RootValue); + /// Determines if two values are the same. + public static bool operator ==(CertificateStoreNameOption left, CertificateStoreNameOption right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(CertificateStoreNameOption left, CertificateStoreNameOption right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator CertificateStoreNameOption(string value) => new CertificateStoreNameOption(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is CertificateStoreNameOption other && Equals(other); + /// + public bool Equals(CertificateStoreNameOption other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/src/Generated/Models/CheckNameAvailability.Serialization.cs b/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/src/Generated/Models/CheckNameAvailability.Serialization.cs new file mode 100644 index 000000000000..1abe69fc8230 --- /dev/null +++ b/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/src/Generated/Models/CheckNameAvailability.Serialization.cs @@ -0,0 +1,134 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.DevOpsInfrastructure.Models +{ + public partial class CheckNameAvailability : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(CheckNameAvailability)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name); + writer.WritePropertyName("type"u8); + writer.WriteStringValue(Type.ToString()); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + CheckNameAvailability 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(CheckNameAvailability)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeCheckNameAvailability(document.RootElement, options); + } + + internal static CheckNameAvailability DeserializeCheckNameAvailability(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string name = default; + DevOpsInfrastructureResourceType type = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("type"u8)) + { + type = new DevOpsInfrastructureResourceType(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new CheckNameAvailability(name, type, 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(CheckNameAvailability)} does not support writing '{options.Format}' format."); + } + } + + CheckNameAvailability IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeCheckNameAvailability(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(CheckNameAvailability)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/src/Generated/Models/CheckNameAvailability.cs b/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/src/Generated/Models/CheckNameAvailability.cs new file mode 100644 index 000000000000..62c886d554e5 --- /dev/null +++ b/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/src/Generated/Models/CheckNameAvailability.cs @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.DevOpsInfrastructure.Models +{ + /// The parameters used to check the availability of a resource. + public partial class CheckNameAvailability + { + /// + /// 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 name of the resource. + /// The type of resource that is used as the scope of the availability check. + /// is null. + public CheckNameAvailability(string name, DevOpsInfrastructureResourceType type) + { + Argument.AssertNotNull(name, nameof(name)); + + Name = name; + Type = type; + } + + /// Initializes a new instance of . + /// The name of the resource. + /// The type of resource that is used as the scope of the availability check. + /// Keeps track of any properties unknown to the library. + internal CheckNameAvailability(string name, DevOpsInfrastructureResourceType type, IDictionary serializedAdditionalRawData) + { + Name = name; + Type = type; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal CheckNameAvailability() + { + } + + /// The name of the resource. + public string Name { get; } + /// The type of resource that is used as the scope of the availability check. + public DevOpsInfrastructureResourceType Type { get; } + } +} diff --git a/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/src/Generated/Models/CheckNameAvailabilityReason.cs b/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/src/Generated/Models/CheckNameAvailabilityReason.cs new file mode 100644 index 000000000000..4f0bf5b350a3 --- /dev/null +++ b/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/src/Generated/Models/CheckNameAvailabilityReason.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.DevOpsInfrastructure.Models +{ + /// The reason code explaining why the name is unavailable. Will be null if the name is available. + public readonly partial struct CheckNameAvailabilityReason : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public CheckNameAvailabilityReason(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string InvalidValue = "Invalid"; + private const string AlreadyExistsValue = "AlreadyExists"; + + /// The name is invalid. + public static CheckNameAvailabilityReason Invalid { get; } = new CheckNameAvailabilityReason(InvalidValue); + /// The name already exists. + public static CheckNameAvailabilityReason AlreadyExists { get; } = new CheckNameAvailabilityReason(AlreadyExistsValue); + /// Determines if two values are the same. + public static bool operator ==(CheckNameAvailabilityReason left, CheckNameAvailabilityReason right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(CheckNameAvailabilityReason left, CheckNameAvailabilityReason right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator CheckNameAvailabilityReason(string value) => new CheckNameAvailabilityReason(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is CheckNameAvailabilityReason other && Equals(other); + /// + public bool Equals(CheckNameAvailabilityReason other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/src/Generated/Models/CheckNameAvailabilityResult.Serialization.cs b/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/src/Generated/Models/CheckNameAvailabilityResult.Serialization.cs new file mode 100644 index 000000000000..a0da8928d23a --- /dev/null +++ b/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/src/Generated/Models/CheckNameAvailabilityResult.Serialization.cs @@ -0,0 +1,150 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.DevOpsInfrastructure.Models +{ + public partial class CheckNameAvailabilityResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(CheckNameAvailabilityResult)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("available"u8); + writer.WriteStringValue(Available.ToString()); + writer.WritePropertyName("message"u8); + writer.WriteStringValue(Message); + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name); + writer.WritePropertyName("reason"u8); + writer.WriteStringValue(Reason.ToString()); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + CheckNameAvailabilityResult 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(CheckNameAvailabilityResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeCheckNameAvailabilityResult(document.RootElement, options); + } + + internal static CheckNameAvailabilityResult DeserializeCheckNameAvailabilityResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + AvailabilityStatus available = default; + string message = default; + string name = default; + CheckNameAvailabilityReason reason = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("available"u8)) + { + available = new AvailabilityStatus(property.Value.GetString()); + continue; + } + if (property.NameEquals("message"u8)) + { + message = property.Value.GetString(); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("reason"u8)) + { + reason = new CheckNameAvailabilityReason(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new CheckNameAvailabilityResult(available, message, name, reason, 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(CheckNameAvailabilityResult)} does not support writing '{options.Format}' format."); + } + } + + CheckNameAvailabilityResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeCheckNameAvailabilityResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(CheckNameAvailabilityResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/src/Generated/Models/CheckNameAvailabilityResult.cs b/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/src/Generated/Models/CheckNameAvailabilityResult.cs new file mode 100644 index 000000000000..e41317ea87be --- /dev/null +++ b/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/src/Generated/Models/CheckNameAvailabilityResult.cs @@ -0,0 +1,94 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.DevOpsInfrastructure.Models +{ + /// The CheckNameAvailability operation response. + public partial class CheckNameAvailabilityResult + { + /// + /// 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 . + /// Availability status of the name. + /// A message explaining why the name is unavailable. Will be null if the name is available. + /// The name whose availability was checked. + /// The reason code explaining why the name is unavailable. Will be null if the name is available. + /// or is null. + internal CheckNameAvailabilityResult(AvailabilityStatus available, string message, string name, CheckNameAvailabilityReason reason) + { + Argument.AssertNotNull(message, nameof(message)); + Argument.AssertNotNull(name, nameof(name)); + + Available = available; + Message = message; + Name = name; + Reason = reason; + } + + /// Initializes a new instance of . + /// Availability status of the name. + /// A message explaining why the name is unavailable. Will be null if the name is available. + /// The name whose availability was checked. + /// The reason code explaining why the name is unavailable. Will be null if the name is available. + /// Keeps track of any properties unknown to the library. + internal CheckNameAvailabilityResult(AvailabilityStatus available, string message, string name, CheckNameAvailabilityReason reason, IDictionary serializedAdditionalRawData) + { + Available = available; + Message = message; + Name = name; + Reason = reason; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal CheckNameAvailabilityResult() + { + } + + /// Availability status of the name. + public AvailabilityStatus Available { get; } + /// A message explaining why the name is unavailable. Will be null if the name is available. + public string Message { get; } + /// The name whose availability was checked. + public string Name { get; } + /// The reason code explaining why the name is unavailable. Will be null if the name is available. + public CheckNameAvailabilityReason Reason { get; } + } +} diff --git a/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/src/Generated/Models/DevOpsInfrastructureResourceType.cs b/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/src/Generated/Models/DevOpsInfrastructureResourceType.cs new file mode 100644 index 000000000000..6579f2c59af9 --- /dev/null +++ b/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/src/Generated/Models/DevOpsInfrastructureResourceType.cs @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.DevOpsInfrastructure.Models +{ + /// The type of resource. + public readonly partial struct DevOpsInfrastructureResourceType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public DevOpsInfrastructureResourceType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string MicrosoftDevOpsInfrastructurePoolsValue = "Microsoft.DevOpsInfrastructure/pools"; + + /// DevOpsInfrastructure pool resource. + public static DevOpsInfrastructureResourceType MicrosoftDevOpsInfrastructurePools { get; } = new DevOpsInfrastructureResourceType(MicrosoftDevOpsInfrastructurePoolsValue); + /// Determines if two values are the same. + public static bool operator ==(DevOpsInfrastructureResourceType left, DevOpsInfrastructureResourceType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(DevOpsInfrastructureResourceType left, DevOpsInfrastructureResourceType right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator DevOpsInfrastructureResourceType(string value) => new DevOpsInfrastructureResourceType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is DevOpsInfrastructureResourceType other && Equals(other); + /// + public bool Equals(DevOpsInfrastructureResourceType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/src/Generated/Models/DevOpsOrganization.Serialization.cs b/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/src/Generated/Models/DevOpsOrganization.Serialization.cs index c5fe16dff19b..6e8c4378894c 100644 --- a/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/src/Generated/Models/DevOpsOrganization.Serialization.cs +++ b/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/src/Generated/Models/DevOpsOrganization.Serialization.cs @@ -51,6 +51,11 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("parallelism"u8); writer.WriteNumberValue(Parallelism.Value); } + if (Optional.IsDefined(OpenAccess)) + { + writer.WritePropertyName("openAccess"u8); + writer.WriteBooleanValue(OpenAccess.Value); + } if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -91,6 +96,7 @@ internal static DevOpsOrganization DeserializeDevOpsOrganization(JsonElement ele Uri url = default; IList projects = default; int? parallelism = default; + bool? openAccess = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -123,13 +129,22 @@ internal static DevOpsOrganization DeserializeDevOpsOrganization(JsonElement ele parallelism = property.Value.GetInt32(); continue; } + if (property.NameEquals("openAccess"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + openAccess = property.Value.GetBoolean(); + continue; + } if (options.Format != "W") { rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); } } serializedAdditionalRawData = rawDataDictionary; - return new DevOpsOrganization(url, projects ?? new ChangeTrackingList(), parallelism, serializedAdditionalRawData); + return new DevOpsOrganization(url, projects ?? new ChangeTrackingList(), parallelism, openAccess, serializedAdditionalRawData); } BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) diff --git a/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/src/Generated/Models/DevOpsOrganization.cs b/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/src/Generated/Models/DevOpsOrganization.cs index c811965dd068..0452f359220f 100644 --- a/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/src/Generated/Models/DevOpsOrganization.cs +++ b/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/src/Generated/Models/DevOpsOrganization.cs @@ -60,12 +60,14 @@ public DevOpsOrganization(Uri uri) /// The Azure DevOps organization URL in which the pool should be created. /// Optional list of projects in which the pool should be created. /// How many machines can be created at maximum in this organization out of the maximumConcurrency of the pool. + /// Determines if the pool should have open access to all projects in this organization. /// Keeps track of any properties unknown to the library. - internal DevOpsOrganization(Uri uri, IList projects, int? parallelism, IDictionary serializedAdditionalRawData) + internal DevOpsOrganization(Uri uri, IList projects, int? parallelism, bool? openAccess, IDictionary serializedAdditionalRawData) { Uri = uri; Projects = projects; Parallelism = parallelism; + OpenAccess = openAccess; _serializedAdditionalRawData = serializedAdditionalRawData; } @@ -80,5 +82,7 @@ internal DevOpsOrganization() public IList Projects { get; } /// How many machines can be created at maximum in this organization out of the maximumConcurrency of the pool. public int? Parallelism { get; set; } + /// Determines if the pool should have open access to all projects in this organization. + public bool? OpenAccess { get; set; } } } diff --git a/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/src/Generated/Models/DevOpsPoolVmImage.Serialization.cs b/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/src/Generated/Models/DevOpsPoolVmImage.Serialization.cs index 899cb9091b97..e16abc1a6754 100644 --- a/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/src/Generated/Models/DevOpsPoolVmImage.Serialization.cs +++ b/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/src/Generated/Models/DevOpsPoolVmImage.Serialization.cs @@ -59,6 +59,11 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("buffer"u8); writer.WriteStringValue(Buffer); } + if (Optional.IsDefined(EphemeralType)) + { + writer.WritePropertyName("ephemeralType"u8); + writer.WriteStringValue(EphemeralType.Value.ToString()); + } if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -100,6 +105,7 @@ internal static DevOpsPoolVmImage DeserializeDevOpsPoolVmImage(JsonElement eleme string wellKnownImageName = default; IList aliases = default; string buffer = default; + EphemeralType? ephemeralType = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -133,13 +139,28 @@ internal static DevOpsPoolVmImage DeserializeDevOpsPoolVmImage(JsonElement eleme buffer = property.Value.GetString(); continue; } + if (property.NameEquals("ephemeralType"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + ephemeralType = new EphemeralType(property.Value.GetString()); + continue; + } if (options.Format != "W") { rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); } } serializedAdditionalRawData = rawDataDictionary; - return new DevOpsPoolVmImage(resourceId, wellKnownImageName, aliases ?? new ChangeTrackingList(), buffer, serializedAdditionalRawData); + return new DevOpsPoolVmImage( + resourceId, + wellKnownImageName, + aliases ?? new ChangeTrackingList(), + buffer, + ephemeralType, + serializedAdditionalRawData); } BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) diff --git a/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/src/Generated/Models/DevOpsPoolVmImage.cs b/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/src/Generated/Models/DevOpsPoolVmImage.cs index 62da13c18c4e..e14eee5a9b74 100644 --- a/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/src/Generated/Models/DevOpsPoolVmImage.cs +++ b/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/src/Generated/Models/DevOpsPoolVmImage.cs @@ -56,13 +56,15 @@ public DevOpsPoolVmImage() /// The image to use from a well-known set of images made available to customers. /// List of aliases to reference the image by. /// The percentage of the buffer to be allocated to this image. + /// The ephemeral type of the image. /// Keeps track of any properties unknown to the library. - internal DevOpsPoolVmImage(string resourceId, string wellKnownImageName, IList aliases, string buffer, IDictionary serializedAdditionalRawData) + internal DevOpsPoolVmImage(string resourceId, string wellKnownImageName, IList aliases, string buffer, EphemeralType? ephemeralType, IDictionary serializedAdditionalRawData) { ResourceId = resourceId; WellKnownImageName = wellKnownImageName; Aliases = aliases; Buffer = buffer; + EphemeralType = ephemeralType; _serializedAdditionalRawData = serializedAdditionalRawData; } @@ -74,5 +76,7 @@ internal DevOpsPoolVmImage(string resourceId, string wellKnownImageName, IList Aliases { get; } /// The percentage of the buffer to be allocated to this image. public string Buffer { get; set; } + /// The ephemeral type of the image. + public EphemeralType? EphemeralType { get; set; } } } diff --git a/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/src/Generated/Models/EphemeralType.cs b/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/src/Generated/Models/EphemeralType.cs new file mode 100644 index 000000000000..22740c036b08 --- /dev/null +++ b/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/src/Generated/Models/EphemeralType.cs @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.DevOpsInfrastructure.Models +{ + /// The type of Ephemeral option the pool will use on underlying VMs when loading this image. + public readonly partial struct EphemeralType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public EphemeralType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string AutomaticValue = "Automatic"; + private const string CacheDiskValue = "CacheDisk"; + private const string ResourceDiskValue = "ResourceDisk"; + + /// Ephemeral is handled by Managed DevOps Pools service. + public static EphemeralType Automatic { get; } = new EphemeralType(AutomaticValue); + /// CacheDisk ephemeral only, requires that the SKU has a cache that is large enough for the image. + public static EphemeralType CacheDisk { get; } = new EphemeralType(CacheDiskValue); + /// ResourceDisk ephemeral only, requires only that the SKU supports it. + public static EphemeralType ResourceDisk { get; } = new EphemeralType(ResourceDiskValue); + /// Determines if two values are the same. + public static bool operator ==(EphemeralType left, EphemeralType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(EphemeralType left, EphemeralType right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator EphemeralType(string value) => new EphemeralType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is EphemeralType other && Equals(other); + /// + public bool Equals(EphemeralType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/src/Generated/Models/SecretsManagementSettings.Serialization.cs b/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/src/Generated/Models/SecretsManagementSettings.Serialization.cs index 8586fc37da26..f0e44da441ec 100644 --- a/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/src/Generated/Models/SecretsManagementSettings.Serialization.cs +++ b/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/src/Generated/Models/SecretsManagementSettings.Serialization.cs @@ -39,6 +39,11 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("certificateStoreLocation"u8); writer.WriteStringValue(CertificateStoreLocation); } + if (Optional.IsDefined(CertificateStoreName)) + { + writer.WritePropertyName("certificateStoreName"u8); + writer.WriteStringValue(CertificateStoreName.Value.ToString()); + } writer.WritePropertyName("observedCertificates"u8); writer.WriteStartArray(); foreach (var item in ObservedCertificates) @@ -91,6 +96,7 @@ internal static SecretsManagementSettings DeserializeSecretsManagementSettings(J return null; } string certificateStoreLocation = default; + CertificateStoreNameOption? certificateStoreName = default; IList observedCertificates = default; bool keyExportable = default; IDictionary serializedAdditionalRawData = default; @@ -102,6 +108,15 @@ internal static SecretsManagementSettings DeserializeSecretsManagementSettings(J certificateStoreLocation = property.Value.GetString(); continue; } + if (property.NameEquals("certificateStoreName"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + certificateStoreName = new CertificateStoreNameOption(property.Value.GetString()); + continue; + } if (property.NameEquals("observedCertificates"u8)) { List array = new List(); @@ -130,7 +145,7 @@ internal static SecretsManagementSettings DeserializeSecretsManagementSettings(J } } serializedAdditionalRawData = rawDataDictionary; - return new SecretsManagementSettings(certificateStoreLocation, observedCertificates, keyExportable, serializedAdditionalRawData); + return new SecretsManagementSettings(certificateStoreLocation, certificateStoreName, observedCertificates, keyExportable, serializedAdditionalRawData); } BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) diff --git a/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/src/Generated/Models/SecretsManagementSettings.cs b/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/src/Generated/Models/SecretsManagementSettings.cs index 7abbf15aff0d..31ab5987c6dd 100644 --- a/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/src/Generated/Models/SecretsManagementSettings.cs +++ b/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/src/Generated/Models/SecretsManagementSettings.cs @@ -60,12 +60,14 @@ public SecretsManagementSettings(IEnumerable observedCertificates, bool key /// Initializes a new instance of . /// Where to store certificates on the machine. + /// Name of the certificate store to use on the machine, currently 'My' and 'Root' are supported. /// The list of certificates to install on all machines in the pool. /// Defines if the key of the certificates should be exportable. /// Keeps track of any properties unknown to the library. - internal SecretsManagementSettings(string certificateStoreLocation, IList observedCertificates, bool keyExportable, IDictionary serializedAdditionalRawData) + internal SecretsManagementSettings(string certificateStoreLocation, CertificateStoreNameOption? certificateStoreName, IList observedCertificates, bool keyExportable, IDictionary serializedAdditionalRawData) { CertificateStoreLocation = certificateStoreLocation; + CertificateStoreName = certificateStoreName; ObservedCertificates = observedCertificates; KeyExportable = keyExportable; _serializedAdditionalRawData = serializedAdditionalRawData; @@ -78,6 +80,8 @@ internal SecretsManagementSettings() /// Where to store certificates on the machine. public string CertificateStoreLocation { get; set; } + /// Name of the certificate store to use on the machine, currently 'My' and 'Root' are supported. + public CertificateStoreNameOption? CertificateStoreName { get; set; } /// The list of certificates to install on all machines in the pool. public IList ObservedCertificates { get; } /// Defines if the key of the certificates should be exportable. diff --git a/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/src/Generated/RestOperations/ImageVersionsRestOperations.cs b/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/src/Generated/RestOperations/ImageVersionsRestOperations.cs index d99ce4db4901..4c87591a8f4b 100644 --- a/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/src/Generated/RestOperations/ImageVersionsRestOperations.cs +++ b/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/src/Generated/RestOperations/ImageVersionsRestOperations.cs @@ -32,7 +32,7 @@ public ImageVersionsRestOperations(HttpPipeline pipeline, string applicationId, { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-10-19"; + _apiVersion = apiVersion ?? "2025-01-21"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/src/Generated/RestOperations/PoolsRestOperations.cs b/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/src/Generated/RestOperations/PoolsRestOperations.cs index f1005eb73419..4d76059953f4 100644 --- a/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/src/Generated/RestOperations/PoolsRestOperations.cs +++ b/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/src/Generated/RestOperations/PoolsRestOperations.cs @@ -32,7 +32,7 @@ public PoolsRestOperations(HttpPipeline pipeline, string applicationId, Uri endp { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-10-19"; + _apiVersion = apiVersion ?? "2025-01-21"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } @@ -564,6 +564,92 @@ public Response ListBySubscription(string subscriptionId, Cancel } } + internal RequestUriBuilder CreateCheckNameAvailabilityRequestUri(string subscriptionId, CheckNameAvailability body) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/providers/Microsoft.DevOpsInfrastructure/checkNameAvailability", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateCheckNameAvailabilityRequest(string subscriptionId, CheckNameAvailability body) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/providers/Microsoft.DevOpsInfrastructure/checkNameAvailability", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(body, ModelSerializationExtensions.WireOptions); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Checks that the pool name is valid and is not already in use. + /// The ID of the target subscription. The value must be an UUID. + /// The CheckAvailability request. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + public async Task> CheckNameAvailabilityAsync(string subscriptionId, CheckNameAvailability body, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNull(body, nameof(body)); + + using var message = CreateCheckNameAvailabilityRequest(subscriptionId, body); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + CheckNameAvailabilityResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = CheckNameAvailabilityResult.DeserializeCheckNameAvailabilityResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Checks that the pool name is valid and is not already in use. + /// The ID of the target subscription. The value must be an UUID. + /// The CheckAvailability request. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + public Response CheckNameAvailability(string subscriptionId, CheckNameAvailability body, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNull(body, nameof(body)); + + using var message = CreateCheckNameAvailabilityRequest(subscriptionId, body); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + CheckNameAvailabilityResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = CheckNameAvailabilityResult.DeserializeCheckNameAvailabilityResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + internal RequestUriBuilder CreateListByResourceGroupNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName) { var uri = new RawRequestUriBuilder(); diff --git a/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/src/Generated/RestOperations/ResourceDetailsRestOperations.cs b/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/src/Generated/RestOperations/ResourceDetailsRestOperations.cs index 991d05cc6df2..7582c047adb3 100644 --- a/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/src/Generated/RestOperations/ResourceDetailsRestOperations.cs +++ b/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/src/Generated/RestOperations/ResourceDetailsRestOperations.cs @@ -32,7 +32,7 @@ public ResourceDetailsRestOperations(HttpPipeline pipeline, string applicationId { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-10-19"; + _apiVersion = apiVersion ?? "2025-01-21"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/src/Generated/RestOperations/SkuRestOperations.cs b/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/src/Generated/RestOperations/SkuRestOperations.cs index 440151280b09..76886acea1df 100644 --- a/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/src/Generated/RestOperations/SkuRestOperations.cs +++ b/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/src/Generated/RestOperations/SkuRestOperations.cs @@ -32,7 +32,7 @@ public SkuRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoi { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-10-19"; + _apiVersion = apiVersion ?? "2025-01-21"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/src/Generated/RestOperations/SubscriptionUsagesRestOperations.cs b/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/src/Generated/RestOperations/SubscriptionUsagesRestOperations.cs index 31da558f182f..31cb93876ffb 100644 --- a/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/src/Generated/RestOperations/SubscriptionUsagesRestOperations.cs +++ b/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/src/Generated/RestOperations/SubscriptionUsagesRestOperations.cs @@ -32,7 +32,7 @@ public SubscriptionUsagesRestOperations(HttpPipeline pipeline, string applicatio { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-10-19"; + _apiVersion = apiVersion ?? "2025-01-21"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/tsp-location.yaml b/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/tsp-location.yaml index bea97fb31977..66bd363cecd9 100644 --- a/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/tsp-location.yaml +++ b/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/tsp-location.yaml @@ -1,3 +1,4 @@ -directory: specification/devopsinfrastructure -commit: f37b54b187bac95237c62478a10b94e9cff236f3 -repo: Azure/azure-rest-api-specs \ No newline at end of file +directory: specification/devopsinfrastructure/Microsoft.DevOpsInfrastructure.Management +commit: 676334a284e5136f0a0721d6ae844bb04332f579 +repo: Azure/azure-rest-api-specs +additionalDirectories: diff --git a/sdk/edgeworkloadsecurity/Azure.ResourceManager.SecretsStoreExtension/Azure.ResourceManager.SecretsStoreExtension.sln b/sdk/edgeworkloadsecurity/Azure.ResourceManager.SecretsStoreExtension/Azure.ResourceManager.SecretsStoreExtension.sln new file mode 100644 index 000000000000..7fcb23ea74c2 --- /dev/null +++ b/sdk/edgeworkloadsecurity/Azure.ResourceManager.SecretsStoreExtension/Azure.ResourceManager.SecretsStoreExtension.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.SecretsStoreExtension.Samples", "samples\Azure.ResourceManager.SecretsStoreExtension.Samples.csproj", "{7A2DFF15-5746-49F4-BD0F-C6C35337088A}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Azure.ResourceManager.SecretsStoreExtension", "src\Azure.ResourceManager.SecretsStoreExtension.csproj", "{28FF4005-4467-4E36-92E7-DEA27DEB1519}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Azure.ResourceManager.SecretsStoreExtension.Tests", "tests\Azure.ResourceManager.SecretsStoreExtension.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/edgeworkloadsecurity/Azure.ResourceManager.SecretsStoreExtension/CHANGELOG.md b/sdk/edgeworkloadsecurity/Azure.ResourceManager.SecretsStoreExtension/CHANGELOG.md new file mode 100644 index 000000000000..8b33f0fedccc --- /dev/null +++ b/sdk/edgeworkloadsecurity/Azure.ResourceManager.SecretsStoreExtension/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/edgeworkloadsecurity/Azure.ResourceManager.SecretsStoreExtension/Directory.Build.props b/sdk/edgeworkloadsecurity/Azure.ResourceManager.SecretsStoreExtension/Directory.Build.props new file mode 100644 index 000000000000..63bd836ad44b --- /dev/null +++ b/sdk/edgeworkloadsecurity/Azure.ResourceManager.SecretsStoreExtension/Directory.Build.props @@ -0,0 +1,6 @@ + + + + diff --git a/sdk/edgeworkloadsecurity/Azure.ResourceManager.SecretsStoreExtension/README.md b/sdk/edgeworkloadsecurity/Azure.ResourceManager.SecretsStoreExtension/README.md new file mode 100644 index 000000000000..9783f2218f26 --- /dev/null +++ b/sdk/edgeworkloadsecurity/Azure.ResourceManager.SecretsStoreExtension/README.md @@ -0,0 +1,80 @@ +# Microsoft Azure SecretsStoreExtension 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 SecretsStoreExtension management library for .NET with [NuGet](https://www.nuget.org/): + +```dotnetcli +dotnet add package Azure.ResourceManager.SecretsStoreExtension --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/edgeworkloadsecurity/Azure.ResourceManager.SecretsStoreExtension/api/Azure.ResourceManager.SecretsStoreExtension.net8.0.cs b/sdk/edgeworkloadsecurity/Azure.ResourceManager.SecretsStoreExtension/api/Azure.ResourceManager.SecretsStoreExtension.net8.0.cs new file mode 100644 index 000000000000..25b648a521ab --- /dev/null +++ b/sdk/edgeworkloadsecurity/Azure.ResourceManager.SecretsStoreExtension/api/Azure.ResourceManager.SecretsStoreExtension.net8.0.cs @@ -0,0 +1,346 @@ +namespace Azure.ResourceManager.SecretsStoreExtension +{ + public partial class AzureKeyVaultSecretProviderClassCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected AzureKeyVaultSecretProviderClassCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string azureKeyVaultSecretProviderClassName, Azure.ResourceManager.SecretsStoreExtension.AzureKeyVaultSecretProviderClassData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string azureKeyVaultSecretProviderClassName, Azure.ResourceManager.SecretsStoreExtension.AzureKeyVaultSecretProviderClassData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string azureKeyVaultSecretProviderClassName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string azureKeyVaultSecretProviderClassName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string azureKeyVaultSecretProviderClassName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string azureKeyVaultSecretProviderClassName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string azureKeyVaultSecretProviderClassName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string azureKeyVaultSecretProviderClassName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class AzureKeyVaultSecretProviderClassData : Azure.ResourceManager.Models.TrackedResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public AzureKeyVaultSecretProviderClassData(Azure.Core.AzureLocation location) { } + public Azure.ResourceManager.Resources.Models.ExtendedLocation ExtendedLocation { get { throw null; } set { } } + public Azure.ResourceManager.SecretsStoreExtension.Models.AzureKeyVaultSecretProviderClassProperties Properties { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.SecretsStoreExtension.AzureKeyVaultSecretProviderClassData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.SecretsStoreExtension.AzureKeyVaultSecretProviderClassData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class AzureKeyVaultSecretProviderClassResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected AzureKeyVaultSecretProviderClassResource() { } + public virtual Azure.ResourceManager.SecretsStoreExtension.AzureKeyVaultSecretProviderClassData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public virtual Azure.Response AddTag(string key, string value, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> AddTagAsync(string key, string value, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string azureKeyVaultSecretProviderClassName) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response RemoveTag(string key, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> RemoveTagAsync(string key, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response SetTags(System.Collections.Generic.IDictionary tags, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> SetTagsAsync(System.Collections.Generic.IDictionary tags, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + Azure.ResourceManager.SecretsStoreExtension.AzureKeyVaultSecretProviderClassData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.SecretsStoreExtension.AzureKeyVaultSecretProviderClassData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.SecretsStoreExtension.Models.AzureKeyVaultSecretProviderClassPatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.SecretsStoreExtension.Models.AzureKeyVaultSecretProviderClassPatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public static partial class SecretsStoreExtensionExtensions + { + public static Azure.Response GetAzureKeyVaultSecretProviderClass(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string azureKeyVaultSecretProviderClassName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static System.Threading.Tasks.Task> GetAzureKeyVaultSecretProviderClassAsync(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string azureKeyVaultSecretProviderClassName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.ResourceManager.SecretsStoreExtension.AzureKeyVaultSecretProviderClassCollection GetAzureKeyVaultSecretProviderClasses(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource) { throw null; } + public static Azure.Pageable GetAzureKeyVaultSecretProviderClasses(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.AsyncPageable GetAzureKeyVaultSecretProviderClassesAsync(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.ResourceManager.SecretsStoreExtension.AzureKeyVaultSecretProviderClassResource GetAzureKeyVaultSecretProviderClassResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.Response GetSecretSync(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string secretSyncName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static System.Threading.Tasks.Task> GetSecretSyncAsync(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string secretSyncName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.ResourceManager.SecretsStoreExtension.SecretSyncResource GetSecretSyncResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.SecretsStoreExtension.SecretSyncCollection GetSecretSyncs(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource) { throw null; } + public static Azure.Pageable GetSecretSyncs(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.AsyncPageable GetSecretSyncsAsync(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class SecretSyncCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected SecretSyncCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string secretSyncName, Azure.ResourceManager.SecretsStoreExtension.SecretSyncData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string secretSyncName, Azure.ResourceManager.SecretsStoreExtension.SecretSyncData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string secretSyncName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string secretSyncName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string secretSyncName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string secretSyncName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string secretSyncName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string secretSyncName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class SecretSyncData : Azure.ResourceManager.Models.TrackedResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public SecretSyncData(Azure.Core.AzureLocation location) { } + public Azure.ResourceManager.Resources.Models.ExtendedLocation ExtendedLocation { get { throw null; } set { } } + public Azure.ResourceManager.SecretsStoreExtension.Models.SecretSyncProperties Properties { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.SecretsStoreExtension.SecretSyncData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.SecretsStoreExtension.SecretSyncData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class SecretSyncResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected SecretSyncResource() { } + public virtual Azure.ResourceManager.SecretsStoreExtension.SecretSyncData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public virtual Azure.Response AddTag(string key, string value, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> AddTagAsync(string key, string value, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string secretSyncName) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response RemoveTag(string key, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> RemoveTagAsync(string key, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response SetTags(System.Collections.Generic.IDictionary tags, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> SetTagsAsync(System.Collections.Generic.IDictionary tags, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + Azure.ResourceManager.SecretsStoreExtension.SecretSyncData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.SecretsStoreExtension.SecretSyncData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.SecretsStoreExtension.Models.SecretSyncPatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.SecretsStoreExtension.Models.SecretSyncPatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } +} +namespace Azure.ResourceManager.SecretsStoreExtension.Mocking +{ + public partial class MockableSecretsStoreExtensionArmClient : Azure.ResourceManager.ArmResource + { + protected MockableSecretsStoreExtensionArmClient() { } + public virtual Azure.ResourceManager.SecretsStoreExtension.AzureKeyVaultSecretProviderClassResource GetAzureKeyVaultSecretProviderClassResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.SecretsStoreExtension.SecretSyncResource GetSecretSyncResource(Azure.Core.ResourceIdentifier id) { throw null; } + } + public partial class MockableSecretsStoreExtensionResourceGroupResource : Azure.ResourceManager.ArmResource + { + protected MockableSecretsStoreExtensionResourceGroupResource() { } + public virtual Azure.Response GetAzureKeyVaultSecretProviderClass(string azureKeyVaultSecretProviderClassName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAzureKeyVaultSecretProviderClassAsync(string azureKeyVaultSecretProviderClassName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.SecretsStoreExtension.AzureKeyVaultSecretProviderClassCollection GetAzureKeyVaultSecretProviderClasses() { throw null; } + public virtual Azure.Response GetSecretSync(string secretSyncName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetSecretSyncAsync(string secretSyncName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.SecretsStoreExtension.SecretSyncCollection GetSecretSyncs() { throw null; } + } + public partial class MockableSecretsStoreExtensionSubscriptionResource : Azure.ResourceManager.ArmResource + { + protected MockableSecretsStoreExtensionSubscriptionResource() { } + public virtual Azure.Pageable GetAzureKeyVaultSecretProviderClasses(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAzureKeyVaultSecretProviderClassesAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetSecretSyncs(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetSecretSyncsAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } +} +namespace Azure.ResourceManager.SecretsStoreExtension.Models +{ + public static partial class ArmSecretsStoreExtensionModelFactory + { + public static Azure.ResourceManager.SecretsStoreExtension.AzureKeyVaultSecretProviderClassData AzureKeyVaultSecretProviderClassData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), Azure.ResourceManager.SecretsStoreExtension.Models.AzureKeyVaultSecretProviderClassProperties properties = null, Azure.ResourceManager.Resources.Models.ExtendedLocation extendedLocation = null) { throw null; } + public static Azure.ResourceManager.SecretsStoreExtension.Models.AzureKeyVaultSecretProviderClassProperties AzureKeyVaultSecretProviderClassProperties(string keyvaultName = null, string clientId = null, string tenantId = null, string objects = null, Azure.ResourceManager.SecretsStoreExtension.Models.ProvisioningState? provisioningState = default(Azure.ResourceManager.SecretsStoreExtension.Models.ProvisioningState?)) { throw null; } + public static Azure.ResourceManager.SecretsStoreExtension.Models.SecretSyncCondition SecretSyncCondition(System.DateTimeOffset? lastTransitionOn = default(System.DateTimeOffset?), string message = null, long? observedGeneration = default(long?), string reason = null, Azure.ResourceManager.SecretsStoreExtension.Models.StatusConditionType status = default(Azure.ResourceManager.SecretsStoreExtension.Models.StatusConditionType), string type = null) { throw null; } + public static Azure.ResourceManager.SecretsStoreExtension.SecretSyncData SecretSyncData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), Azure.ResourceManager.SecretsStoreExtension.Models.SecretSyncProperties properties = null, Azure.ResourceManager.Resources.Models.ExtendedLocation extendedLocation = null) { throw null; } + public static Azure.ResourceManager.SecretsStoreExtension.Models.SecretSyncProperties SecretSyncProperties(string secretProviderClassName = null, string serviceAccountName = null, Azure.ResourceManager.SecretsStoreExtension.Models.KubernetesSecretType kubernetesSecretType = default(Azure.ResourceManager.SecretsStoreExtension.Models.KubernetesSecretType), string forceSynchronization = null, System.Collections.Generic.IEnumerable objectSecretMapping = null, Azure.ResourceManager.SecretsStoreExtension.Models.SecretSyncStatus status = null, Azure.ResourceManager.SecretsStoreExtension.Models.ProvisioningState? provisioningState = default(Azure.ResourceManager.SecretsStoreExtension.Models.ProvisioningState?)) { throw null; } + public static Azure.ResourceManager.SecretsStoreExtension.Models.SecretSyncStatus SecretSyncStatus(System.DateTimeOffset? lastSuccessfulSyncOn = default(System.DateTimeOffset?), System.Collections.Generic.IEnumerable conditions = null) { throw null; } + } + public partial class AzureKeyVaultSecretProviderClassPatch : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public AzureKeyVaultSecretProviderClassPatch() { } + public Azure.ResourceManager.SecretsStoreExtension.Models.AzureKeyVaultSecretProviderClassUpdateProperties Properties { get { throw null; } set { } } + public System.Collections.Generic.IDictionary Tags { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.SecretsStoreExtension.Models.AzureKeyVaultSecretProviderClassPatch System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.SecretsStoreExtension.Models.AzureKeyVaultSecretProviderClassPatch System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class AzureKeyVaultSecretProviderClassProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public AzureKeyVaultSecretProviderClassProperties(string keyvaultName, string clientId, string tenantId) { } + public string ClientId { get { throw null; } set { } } + public string KeyvaultName { get { throw null; } set { } } + public string Objects { get { throw null; } set { } } + public Azure.ResourceManager.SecretsStoreExtension.Models.ProvisioningState? ProvisioningState { get { throw null; } } + public string TenantId { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.SecretsStoreExtension.Models.AzureKeyVaultSecretProviderClassProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.SecretsStoreExtension.Models.AzureKeyVaultSecretProviderClassProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class AzureKeyVaultSecretProviderClassUpdateProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public AzureKeyVaultSecretProviderClassUpdateProperties() { } + public string ClientId { get { throw null; } set { } } + public string KeyvaultName { get { throw null; } set { } } + public string Objects { get { throw null; } set { } } + public string TenantId { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.SecretsStoreExtension.Models.AzureKeyVaultSecretProviderClassUpdateProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.SecretsStoreExtension.Models.AzureKeyVaultSecretProviderClassUpdateProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class KubernetesSecretObjectMapping : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public KubernetesSecretObjectMapping(string sourcePath, string targetKey) { } + public string SourcePath { get { throw null; } set { } } + public string TargetKey { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.SecretsStoreExtension.Models.KubernetesSecretObjectMapping System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.SecretsStoreExtension.Models.KubernetesSecretObjectMapping System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct KubernetesSecretType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public KubernetesSecretType(string value) { throw null; } + public static Azure.ResourceManager.SecretsStoreExtension.Models.KubernetesSecretType Opaque { get { throw null; } } + public static Azure.ResourceManager.SecretsStoreExtension.Models.KubernetesSecretType Tls { get { throw null; } } + public bool Equals(Azure.ResourceManager.SecretsStoreExtension.Models.KubernetesSecretType other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.SecretsStoreExtension.Models.KubernetesSecretType left, Azure.ResourceManager.SecretsStoreExtension.Models.KubernetesSecretType right) { throw null; } + public static implicit operator Azure.ResourceManager.SecretsStoreExtension.Models.KubernetesSecretType (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.SecretsStoreExtension.Models.KubernetesSecretType left, Azure.ResourceManager.SecretsStoreExtension.Models.KubernetesSecretType right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct ProvisioningState : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public ProvisioningState(string value) { throw null; } + public static Azure.ResourceManager.SecretsStoreExtension.Models.ProvisioningState Canceled { get { throw null; } } + public static Azure.ResourceManager.SecretsStoreExtension.Models.ProvisioningState Failed { get { throw null; } } + public static Azure.ResourceManager.SecretsStoreExtension.Models.ProvisioningState Succeeded { get { throw null; } } + public bool Equals(Azure.ResourceManager.SecretsStoreExtension.Models.ProvisioningState other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.SecretsStoreExtension.Models.ProvisioningState left, Azure.ResourceManager.SecretsStoreExtension.Models.ProvisioningState right) { throw null; } + public static implicit operator Azure.ResourceManager.SecretsStoreExtension.Models.ProvisioningState (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.SecretsStoreExtension.Models.ProvisioningState left, Azure.ResourceManager.SecretsStoreExtension.Models.ProvisioningState right) { throw null; } + public override string ToString() { throw null; } + } + public partial class SecretSyncCondition : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal SecretSyncCondition() { } + public System.DateTimeOffset? LastTransitionOn { get { throw null; } } + public string Message { get { throw null; } } + public long? ObservedGeneration { get { throw null; } } + public string Reason { get { throw null; } } + public Azure.ResourceManager.SecretsStoreExtension.Models.StatusConditionType Status { get { throw null; } } + public string Type { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.SecretsStoreExtension.Models.SecretSyncCondition System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.SecretsStoreExtension.Models.SecretSyncCondition System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class SecretSyncPatch : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public SecretSyncPatch() { } + public Azure.ResourceManager.SecretsStoreExtension.Models.SecretSyncUpdateProperties Properties { get { throw null; } set { } } + public System.Collections.Generic.IDictionary Tags { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.SecretsStoreExtension.Models.SecretSyncPatch System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.SecretsStoreExtension.Models.SecretSyncPatch System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class SecretSyncProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public SecretSyncProperties(string secretProviderClassName, string serviceAccountName, Azure.ResourceManager.SecretsStoreExtension.Models.KubernetesSecretType kubernetesSecretType, System.Collections.Generic.IEnumerable objectSecretMapping) { } + public string ForceSynchronization { get { throw null; } set { } } + public Azure.ResourceManager.SecretsStoreExtension.Models.KubernetesSecretType KubernetesSecretType { get { throw null; } set { } } + public System.Collections.Generic.IList ObjectSecretMapping { get { throw null; } } + public Azure.ResourceManager.SecretsStoreExtension.Models.ProvisioningState? ProvisioningState { get { throw null; } } + public string SecretProviderClassName { get { throw null; } set { } } + public string ServiceAccountName { get { throw null; } set { } } + public Azure.ResourceManager.SecretsStoreExtension.Models.SecretSyncStatus Status { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.SecretsStoreExtension.Models.SecretSyncProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.SecretsStoreExtension.Models.SecretSyncProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class SecretSyncStatus : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal SecretSyncStatus() { } + public System.Collections.Generic.IReadOnlyList Conditions { get { throw null; } } + public System.DateTimeOffset? LastSuccessfulSyncOn { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.SecretsStoreExtension.Models.SecretSyncStatus System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.SecretsStoreExtension.Models.SecretSyncStatus System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class SecretSyncUpdateProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public SecretSyncUpdateProperties() { } + public string ForceSynchronization { get { throw null; } set { } } + public Azure.ResourceManager.SecretsStoreExtension.Models.KubernetesSecretType? KubernetesSecretType { get { throw null; } set { } } + public System.Collections.Generic.IList ObjectSecretMapping { get { throw null; } } + public string SecretProviderClassName { get { throw null; } set { } } + public string ServiceAccountName { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.SecretsStoreExtension.Models.SecretSyncUpdateProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.SecretsStoreExtension.Models.SecretSyncUpdateProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct StatusConditionType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public StatusConditionType(string value) { throw null; } + public static Azure.ResourceManager.SecretsStoreExtension.Models.StatusConditionType False { get { throw null; } } + public static Azure.ResourceManager.SecretsStoreExtension.Models.StatusConditionType True { get { throw null; } } + public static Azure.ResourceManager.SecretsStoreExtension.Models.StatusConditionType Unknown { get { throw null; } } + public bool Equals(Azure.ResourceManager.SecretsStoreExtension.Models.StatusConditionType other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.SecretsStoreExtension.Models.StatusConditionType left, Azure.ResourceManager.SecretsStoreExtension.Models.StatusConditionType right) { throw null; } + public static implicit operator Azure.ResourceManager.SecretsStoreExtension.Models.StatusConditionType (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.SecretsStoreExtension.Models.StatusConditionType left, Azure.ResourceManager.SecretsStoreExtension.Models.StatusConditionType right) { throw null; } + public override string ToString() { throw null; } + } +} diff --git a/sdk/edgeworkloadsecurity/Azure.ResourceManager.SecretsStoreExtension/api/Azure.ResourceManager.SecretsStoreExtension.netstandard2.0.cs b/sdk/edgeworkloadsecurity/Azure.ResourceManager.SecretsStoreExtension/api/Azure.ResourceManager.SecretsStoreExtension.netstandard2.0.cs new file mode 100644 index 000000000000..25b648a521ab --- /dev/null +++ b/sdk/edgeworkloadsecurity/Azure.ResourceManager.SecretsStoreExtension/api/Azure.ResourceManager.SecretsStoreExtension.netstandard2.0.cs @@ -0,0 +1,346 @@ +namespace Azure.ResourceManager.SecretsStoreExtension +{ + public partial class AzureKeyVaultSecretProviderClassCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected AzureKeyVaultSecretProviderClassCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string azureKeyVaultSecretProviderClassName, Azure.ResourceManager.SecretsStoreExtension.AzureKeyVaultSecretProviderClassData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string azureKeyVaultSecretProviderClassName, Azure.ResourceManager.SecretsStoreExtension.AzureKeyVaultSecretProviderClassData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string azureKeyVaultSecretProviderClassName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string azureKeyVaultSecretProviderClassName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string azureKeyVaultSecretProviderClassName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string azureKeyVaultSecretProviderClassName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string azureKeyVaultSecretProviderClassName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string azureKeyVaultSecretProviderClassName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class AzureKeyVaultSecretProviderClassData : Azure.ResourceManager.Models.TrackedResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public AzureKeyVaultSecretProviderClassData(Azure.Core.AzureLocation location) { } + public Azure.ResourceManager.Resources.Models.ExtendedLocation ExtendedLocation { get { throw null; } set { } } + public Azure.ResourceManager.SecretsStoreExtension.Models.AzureKeyVaultSecretProviderClassProperties Properties { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.SecretsStoreExtension.AzureKeyVaultSecretProviderClassData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.SecretsStoreExtension.AzureKeyVaultSecretProviderClassData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class AzureKeyVaultSecretProviderClassResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected AzureKeyVaultSecretProviderClassResource() { } + public virtual Azure.ResourceManager.SecretsStoreExtension.AzureKeyVaultSecretProviderClassData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public virtual Azure.Response AddTag(string key, string value, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> AddTagAsync(string key, string value, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string azureKeyVaultSecretProviderClassName) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response RemoveTag(string key, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> RemoveTagAsync(string key, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response SetTags(System.Collections.Generic.IDictionary tags, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> SetTagsAsync(System.Collections.Generic.IDictionary tags, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + Azure.ResourceManager.SecretsStoreExtension.AzureKeyVaultSecretProviderClassData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.SecretsStoreExtension.AzureKeyVaultSecretProviderClassData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.SecretsStoreExtension.Models.AzureKeyVaultSecretProviderClassPatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.SecretsStoreExtension.Models.AzureKeyVaultSecretProviderClassPatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public static partial class SecretsStoreExtensionExtensions + { + public static Azure.Response GetAzureKeyVaultSecretProviderClass(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string azureKeyVaultSecretProviderClassName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static System.Threading.Tasks.Task> GetAzureKeyVaultSecretProviderClassAsync(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string azureKeyVaultSecretProviderClassName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.ResourceManager.SecretsStoreExtension.AzureKeyVaultSecretProviderClassCollection GetAzureKeyVaultSecretProviderClasses(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource) { throw null; } + public static Azure.Pageable GetAzureKeyVaultSecretProviderClasses(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.AsyncPageable GetAzureKeyVaultSecretProviderClassesAsync(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.ResourceManager.SecretsStoreExtension.AzureKeyVaultSecretProviderClassResource GetAzureKeyVaultSecretProviderClassResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.Response GetSecretSync(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string secretSyncName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static System.Threading.Tasks.Task> GetSecretSyncAsync(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string secretSyncName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.ResourceManager.SecretsStoreExtension.SecretSyncResource GetSecretSyncResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.SecretsStoreExtension.SecretSyncCollection GetSecretSyncs(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource) { throw null; } + public static Azure.Pageable GetSecretSyncs(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.AsyncPageable GetSecretSyncsAsync(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class SecretSyncCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected SecretSyncCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string secretSyncName, Azure.ResourceManager.SecretsStoreExtension.SecretSyncData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string secretSyncName, Azure.ResourceManager.SecretsStoreExtension.SecretSyncData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string secretSyncName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string secretSyncName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string secretSyncName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string secretSyncName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string secretSyncName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string secretSyncName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class SecretSyncData : Azure.ResourceManager.Models.TrackedResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public SecretSyncData(Azure.Core.AzureLocation location) { } + public Azure.ResourceManager.Resources.Models.ExtendedLocation ExtendedLocation { get { throw null; } set { } } + public Azure.ResourceManager.SecretsStoreExtension.Models.SecretSyncProperties Properties { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.SecretsStoreExtension.SecretSyncData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.SecretsStoreExtension.SecretSyncData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class SecretSyncResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected SecretSyncResource() { } + public virtual Azure.ResourceManager.SecretsStoreExtension.SecretSyncData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public virtual Azure.Response AddTag(string key, string value, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> AddTagAsync(string key, string value, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string secretSyncName) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response RemoveTag(string key, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> RemoveTagAsync(string key, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response SetTags(System.Collections.Generic.IDictionary tags, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> SetTagsAsync(System.Collections.Generic.IDictionary tags, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + Azure.ResourceManager.SecretsStoreExtension.SecretSyncData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.SecretsStoreExtension.SecretSyncData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.SecretsStoreExtension.Models.SecretSyncPatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.SecretsStoreExtension.Models.SecretSyncPatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } +} +namespace Azure.ResourceManager.SecretsStoreExtension.Mocking +{ + public partial class MockableSecretsStoreExtensionArmClient : Azure.ResourceManager.ArmResource + { + protected MockableSecretsStoreExtensionArmClient() { } + public virtual Azure.ResourceManager.SecretsStoreExtension.AzureKeyVaultSecretProviderClassResource GetAzureKeyVaultSecretProviderClassResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.SecretsStoreExtension.SecretSyncResource GetSecretSyncResource(Azure.Core.ResourceIdentifier id) { throw null; } + } + public partial class MockableSecretsStoreExtensionResourceGroupResource : Azure.ResourceManager.ArmResource + { + protected MockableSecretsStoreExtensionResourceGroupResource() { } + public virtual Azure.Response GetAzureKeyVaultSecretProviderClass(string azureKeyVaultSecretProviderClassName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAzureKeyVaultSecretProviderClassAsync(string azureKeyVaultSecretProviderClassName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.SecretsStoreExtension.AzureKeyVaultSecretProviderClassCollection GetAzureKeyVaultSecretProviderClasses() { throw null; } + public virtual Azure.Response GetSecretSync(string secretSyncName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetSecretSyncAsync(string secretSyncName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.SecretsStoreExtension.SecretSyncCollection GetSecretSyncs() { throw null; } + } + public partial class MockableSecretsStoreExtensionSubscriptionResource : Azure.ResourceManager.ArmResource + { + protected MockableSecretsStoreExtensionSubscriptionResource() { } + public virtual Azure.Pageable GetAzureKeyVaultSecretProviderClasses(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAzureKeyVaultSecretProviderClassesAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetSecretSyncs(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetSecretSyncsAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } +} +namespace Azure.ResourceManager.SecretsStoreExtension.Models +{ + public static partial class ArmSecretsStoreExtensionModelFactory + { + public static Azure.ResourceManager.SecretsStoreExtension.AzureKeyVaultSecretProviderClassData AzureKeyVaultSecretProviderClassData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), Azure.ResourceManager.SecretsStoreExtension.Models.AzureKeyVaultSecretProviderClassProperties properties = null, Azure.ResourceManager.Resources.Models.ExtendedLocation extendedLocation = null) { throw null; } + public static Azure.ResourceManager.SecretsStoreExtension.Models.AzureKeyVaultSecretProviderClassProperties AzureKeyVaultSecretProviderClassProperties(string keyvaultName = null, string clientId = null, string tenantId = null, string objects = null, Azure.ResourceManager.SecretsStoreExtension.Models.ProvisioningState? provisioningState = default(Azure.ResourceManager.SecretsStoreExtension.Models.ProvisioningState?)) { throw null; } + public static Azure.ResourceManager.SecretsStoreExtension.Models.SecretSyncCondition SecretSyncCondition(System.DateTimeOffset? lastTransitionOn = default(System.DateTimeOffset?), string message = null, long? observedGeneration = default(long?), string reason = null, Azure.ResourceManager.SecretsStoreExtension.Models.StatusConditionType status = default(Azure.ResourceManager.SecretsStoreExtension.Models.StatusConditionType), string type = null) { throw null; } + public static Azure.ResourceManager.SecretsStoreExtension.SecretSyncData SecretSyncData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), Azure.ResourceManager.SecretsStoreExtension.Models.SecretSyncProperties properties = null, Azure.ResourceManager.Resources.Models.ExtendedLocation extendedLocation = null) { throw null; } + public static Azure.ResourceManager.SecretsStoreExtension.Models.SecretSyncProperties SecretSyncProperties(string secretProviderClassName = null, string serviceAccountName = null, Azure.ResourceManager.SecretsStoreExtension.Models.KubernetesSecretType kubernetesSecretType = default(Azure.ResourceManager.SecretsStoreExtension.Models.KubernetesSecretType), string forceSynchronization = null, System.Collections.Generic.IEnumerable objectSecretMapping = null, Azure.ResourceManager.SecretsStoreExtension.Models.SecretSyncStatus status = null, Azure.ResourceManager.SecretsStoreExtension.Models.ProvisioningState? provisioningState = default(Azure.ResourceManager.SecretsStoreExtension.Models.ProvisioningState?)) { throw null; } + public static Azure.ResourceManager.SecretsStoreExtension.Models.SecretSyncStatus SecretSyncStatus(System.DateTimeOffset? lastSuccessfulSyncOn = default(System.DateTimeOffset?), System.Collections.Generic.IEnumerable conditions = null) { throw null; } + } + public partial class AzureKeyVaultSecretProviderClassPatch : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public AzureKeyVaultSecretProviderClassPatch() { } + public Azure.ResourceManager.SecretsStoreExtension.Models.AzureKeyVaultSecretProviderClassUpdateProperties Properties { get { throw null; } set { } } + public System.Collections.Generic.IDictionary Tags { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.SecretsStoreExtension.Models.AzureKeyVaultSecretProviderClassPatch System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.SecretsStoreExtension.Models.AzureKeyVaultSecretProviderClassPatch System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class AzureKeyVaultSecretProviderClassProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public AzureKeyVaultSecretProviderClassProperties(string keyvaultName, string clientId, string tenantId) { } + public string ClientId { get { throw null; } set { } } + public string KeyvaultName { get { throw null; } set { } } + public string Objects { get { throw null; } set { } } + public Azure.ResourceManager.SecretsStoreExtension.Models.ProvisioningState? ProvisioningState { get { throw null; } } + public string TenantId { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.SecretsStoreExtension.Models.AzureKeyVaultSecretProviderClassProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.SecretsStoreExtension.Models.AzureKeyVaultSecretProviderClassProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class AzureKeyVaultSecretProviderClassUpdateProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public AzureKeyVaultSecretProviderClassUpdateProperties() { } + public string ClientId { get { throw null; } set { } } + public string KeyvaultName { get { throw null; } set { } } + public string Objects { get { throw null; } set { } } + public string TenantId { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.SecretsStoreExtension.Models.AzureKeyVaultSecretProviderClassUpdateProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.SecretsStoreExtension.Models.AzureKeyVaultSecretProviderClassUpdateProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class KubernetesSecretObjectMapping : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public KubernetesSecretObjectMapping(string sourcePath, string targetKey) { } + public string SourcePath { get { throw null; } set { } } + public string TargetKey { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.SecretsStoreExtension.Models.KubernetesSecretObjectMapping System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.SecretsStoreExtension.Models.KubernetesSecretObjectMapping System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct KubernetesSecretType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public KubernetesSecretType(string value) { throw null; } + public static Azure.ResourceManager.SecretsStoreExtension.Models.KubernetesSecretType Opaque { get { throw null; } } + public static Azure.ResourceManager.SecretsStoreExtension.Models.KubernetesSecretType Tls { get { throw null; } } + public bool Equals(Azure.ResourceManager.SecretsStoreExtension.Models.KubernetesSecretType other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.SecretsStoreExtension.Models.KubernetesSecretType left, Azure.ResourceManager.SecretsStoreExtension.Models.KubernetesSecretType right) { throw null; } + public static implicit operator Azure.ResourceManager.SecretsStoreExtension.Models.KubernetesSecretType (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.SecretsStoreExtension.Models.KubernetesSecretType left, Azure.ResourceManager.SecretsStoreExtension.Models.KubernetesSecretType right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct ProvisioningState : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public ProvisioningState(string value) { throw null; } + public static Azure.ResourceManager.SecretsStoreExtension.Models.ProvisioningState Canceled { get { throw null; } } + public static Azure.ResourceManager.SecretsStoreExtension.Models.ProvisioningState Failed { get { throw null; } } + public static Azure.ResourceManager.SecretsStoreExtension.Models.ProvisioningState Succeeded { get { throw null; } } + public bool Equals(Azure.ResourceManager.SecretsStoreExtension.Models.ProvisioningState other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.SecretsStoreExtension.Models.ProvisioningState left, Azure.ResourceManager.SecretsStoreExtension.Models.ProvisioningState right) { throw null; } + public static implicit operator Azure.ResourceManager.SecretsStoreExtension.Models.ProvisioningState (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.SecretsStoreExtension.Models.ProvisioningState left, Azure.ResourceManager.SecretsStoreExtension.Models.ProvisioningState right) { throw null; } + public override string ToString() { throw null; } + } + public partial class SecretSyncCondition : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal SecretSyncCondition() { } + public System.DateTimeOffset? LastTransitionOn { get { throw null; } } + public string Message { get { throw null; } } + public long? ObservedGeneration { get { throw null; } } + public string Reason { get { throw null; } } + public Azure.ResourceManager.SecretsStoreExtension.Models.StatusConditionType Status { get { throw null; } } + public string Type { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.SecretsStoreExtension.Models.SecretSyncCondition System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.SecretsStoreExtension.Models.SecretSyncCondition System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class SecretSyncPatch : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public SecretSyncPatch() { } + public Azure.ResourceManager.SecretsStoreExtension.Models.SecretSyncUpdateProperties Properties { get { throw null; } set { } } + public System.Collections.Generic.IDictionary Tags { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.SecretsStoreExtension.Models.SecretSyncPatch System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.SecretsStoreExtension.Models.SecretSyncPatch System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class SecretSyncProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public SecretSyncProperties(string secretProviderClassName, string serviceAccountName, Azure.ResourceManager.SecretsStoreExtension.Models.KubernetesSecretType kubernetesSecretType, System.Collections.Generic.IEnumerable objectSecretMapping) { } + public string ForceSynchronization { get { throw null; } set { } } + public Azure.ResourceManager.SecretsStoreExtension.Models.KubernetesSecretType KubernetesSecretType { get { throw null; } set { } } + public System.Collections.Generic.IList ObjectSecretMapping { get { throw null; } } + public Azure.ResourceManager.SecretsStoreExtension.Models.ProvisioningState? ProvisioningState { get { throw null; } } + public string SecretProviderClassName { get { throw null; } set { } } + public string ServiceAccountName { get { throw null; } set { } } + public Azure.ResourceManager.SecretsStoreExtension.Models.SecretSyncStatus Status { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.SecretsStoreExtension.Models.SecretSyncProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.SecretsStoreExtension.Models.SecretSyncProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class SecretSyncStatus : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal SecretSyncStatus() { } + public System.Collections.Generic.IReadOnlyList Conditions { get { throw null; } } + public System.DateTimeOffset? LastSuccessfulSyncOn { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.SecretsStoreExtension.Models.SecretSyncStatus System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.SecretsStoreExtension.Models.SecretSyncStatus System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class SecretSyncUpdateProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public SecretSyncUpdateProperties() { } + public string ForceSynchronization { get { throw null; } set { } } + public Azure.ResourceManager.SecretsStoreExtension.Models.KubernetesSecretType? KubernetesSecretType { get { throw null; } set { } } + public System.Collections.Generic.IList ObjectSecretMapping { get { throw null; } } + public string SecretProviderClassName { get { throw null; } set { } } + public string ServiceAccountName { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.SecretsStoreExtension.Models.SecretSyncUpdateProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.SecretsStoreExtension.Models.SecretSyncUpdateProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct StatusConditionType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public StatusConditionType(string value) { throw null; } + public static Azure.ResourceManager.SecretsStoreExtension.Models.StatusConditionType False { get { throw null; } } + public static Azure.ResourceManager.SecretsStoreExtension.Models.StatusConditionType True { get { throw null; } } + public static Azure.ResourceManager.SecretsStoreExtension.Models.StatusConditionType Unknown { get { throw null; } } + public bool Equals(Azure.ResourceManager.SecretsStoreExtension.Models.StatusConditionType other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.SecretsStoreExtension.Models.StatusConditionType left, Azure.ResourceManager.SecretsStoreExtension.Models.StatusConditionType right) { throw null; } + public static implicit operator Azure.ResourceManager.SecretsStoreExtension.Models.StatusConditionType (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.SecretsStoreExtension.Models.StatusConditionType left, Azure.ResourceManager.SecretsStoreExtension.Models.StatusConditionType right) { throw null; } + public override string ToString() { throw null; } + } +} diff --git a/sdk/edgeworkloadsecurity/Azure.ResourceManager.SecretsStoreExtension/assets.json b/sdk/edgeworkloadsecurity/Azure.ResourceManager.SecretsStoreExtension/assets.json new file mode 100644 index 000000000000..ec76ab9ac35f --- /dev/null +++ b/sdk/edgeworkloadsecurity/Azure.ResourceManager.SecretsStoreExtension/assets.json @@ -0,0 +1,7 @@ + +{ + "AssetsRepo": "Azure/azure-sdk-assets", + "AssetsRepoPrefixPath": "net", + "TagPrefix": "net/secretsstoreextension/Azure.ResourceManager.SecretsStoreExtension", + "Tag": "" +} diff --git a/sdk/edgeworkloadsecurity/Azure.ResourceManager.SecretsStoreExtension/samples/Azure.ResourceManager.SecretsStoreExtension.Samples.csproj b/sdk/edgeworkloadsecurity/Azure.ResourceManager.SecretsStoreExtension/samples/Azure.ResourceManager.SecretsStoreExtension.Samples.csproj new file mode 100644 index 000000000000..d0092ec948a0 --- /dev/null +++ b/sdk/edgeworkloadsecurity/Azure.ResourceManager.SecretsStoreExtension/samples/Azure.ResourceManager.SecretsStoreExtension.Samples.csproj @@ -0,0 +1,13 @@ + + + + + + + + + + + + + diff --git a/sdk/edgeworkloadsecurity/Azure.ResourceManager.SecretsStoreExtension/samples/Generated/Samples/Sample_AzureKeyVaultSecretProviderClassCollection.cs b/sdk/edgeworkloadsecurity/Azure.ResourceManager.SecretsStoreExtension/samples/Generated/Samples/Sample_AzureKeyVaultSecretProviderClassCollection.cs new file mode 100644 index 000000000000..2e2fec4ab478 --- /dev/null +++ b/sdk/edgeworkloadsecurity/Azure.ResourceManager.SecretsStoreExtension/samples/Generated/Samples/Sample_AzureKeyVaultSecretProviderClassCollection.cs @@ -0,0 +1,208 @@ +// 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 Azure.ResourceManager.Resources.Models; +using Azure.ResourceManager.SecretsStoreExtension.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.SecretsStoreExtension.Samples +{ + public partial class Sample_AzureKeyVaultSecretProviderClassCollection + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task CreateOrUpdate_AzureKeyVaultSecretProviderClassesCreateOrUpdate() + { + // Generated from example definition: 2024-08-21-preview/AzureKeyVaultSecretProviderClasses_CreateOrUpdate_MaximumSet_Gen.json + // this example is just showing the usage of "AzureKeyVaultSecretProviderClass_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "rg-ssc-example"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this AzureKeyVaultSecretProviderClassResource + AzureKeyVaultSecretProviderClassCollection collection = resourceGroupResource.GetAzureKeyVaultSecretProviderClasses(); + + // invoke the operation + string azureKeyVaultSecretProviderClassName = "akvspc-ssc-example"; + AzureKeyVaultSecretProviderClassData data = new AzureKeyVaultSecretProviderClassData(new AzureLocation("eastus")) + { + Properties = new AzureKeyVaultSecretProviderClassProperties("example-ssc-key-vault", "00000000-0000-0000-0000-000000000000", "00000000-0000-0000-0000-000000000000") + { + Objects = "array: |\n - |\n objectName: my-secret-object\n objectType: secret\n objectVersionHistory: 1", + }, + ExtendedLocation = new ExtendedLocation + { + Name = "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg-ssc-example/providers/Microsoft.ExtendedLocation/customLocations/example-custom-location", + }, + Tags = +{ +["example-tag"] = "example-tag-value" +}, + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, azureKeyVaultSecretProviderClassName, data); + AzureKeyVaultSecretProviderClassResource 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 + AzureKeyVaultSecretProviderClassData 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_AzureKeyVaultSecretProviderClassesGet() + { + // Generated from example definition: 2024-08-21-preview/AzureKeyVaultSecretProviderClasses_Get_MaximumSet_Gen.json + // this example is just showing the usage of "AzureKeyVaultSecretProviderClass_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 = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "rg-ssc-example"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this AzureKeyVaultSecretProviderClassResource + AzureKeyVaultSecretProviderClassCollection collection = resourceGroupResource.GetAzureKeyVaultSecretProviderClasses(); + + // invoke the operation + string azureKeyVaultSecretProviderClassName = "akvspc-ssc-example"; + AzureKeyVaultSecretProviderClassResource result = await collection.GetAsync(azureKeyVaultSecretProviderClassName); + + // 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 + AzureKeyVaultSecretProviderClassData 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_AzureKeyVaultSecretProviderClassesListByResourceGroup() + { + // Generated from example definition: 2024-08-21-preview/AzureKeyVaultSecretProviderClasses_ListByResourceGroup_MaximumSet_Gen.json + // this example is just showing the usage of "AzureKeyVaultSecretProviderClass_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 = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "rg-ssc-example"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this AzureKeyVaultSecretProviderClassResource + AzureKeyVaultSecretProviderClassCollection collection = resourceGroupResource.GetAzureKeyVaultSecretProviderClasses(); + + // invoke the operation and iterate over the result + await foreach (AzureKeyVaultSecretProviderClassResource 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 + AzureKeyVaultSecretProviderClassData 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_AzureKeyVaultSecretProviderClassesGet() + { + // Generated from example definition: 2024-08-21-preview/AzureKeyVaultSecretProviderClasses_Get_MaximumSet_Gen.json + // this example is just showing the usage of "AzureKeyVaultSecretProviderClass_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 = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "rg-ssc-example"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this AzureKeyVaultSecretProviderClassResource + AzureKeyVaultSecretProviderClassCollection collection = resourceGroupResource.GetAzureKeyVaultSecretProviderClasses(); + + // invoke the operation + string azureKeyVaultSecretProviderClassName = "akvspc-ssc-example"; + bool result = await collection.ExistsAsync(azureKeyVaultSecretProviderClassName); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetIfExists_AzureKeyVaultSecretProviderClassesGet() + { + // Generated from example definition: 2024-08-21-preview/AzureKeyVaultSecretProviderClasses_Get_MaximumSet_Gen.json + // this example is just showing the usage of "AzureKeyVaultSecretProviderClass_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 = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "rg-ssc-example"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this AzureKeyVaultSecretProviderClassResource + AzureKeyVaultSecretProviderClassCollection collection = resourceGroupResource.GetAzureKeyVaultSecretProviderClasses(); + + // invoke the operation + string azureKeyVaultSecretProviderClassName = "akvspc-ssc-example"; + NullableResponse response = await collection.GetIfExistsAsync(azureKeyVaultSecretProviderClassName); + AzureKeyVaultSecretProviderClassResource 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 + AzureKeyVaultSecretProviderClassData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + } +} diff --git a/sdk/edgeworkloadsecurity/Azure.ResourceManager.SecretsStoreExtension/samples/Generated/Samples/Sample_AzureKeyVaultSecretProviderClassResource.cs b/sdk/edgeworkloadsecurity/Azure.ResourceManager.SecretsStoreExtension/samples/Generated/Samples/Sample_AzureKeyVaultSecretProviderClassResource.cs new file mode 100644 index 000000000000..616e0fbd97fd --- /dev/null +++ b/sdk/edgeworkloadsecurity/Azure.ResourceManager.SecretsStoreExtension/samples/Generated/Samples/Sample_AzureKeyVaultSecretProviderClassResource.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.SecretsStoreExtension.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.SecretsStoreExtension.Samples +{ + public partial class Sample_AzureKeyVaultSecretProviderClassResource + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_AzureKeyVaultSecretProviderClassesGet() + { + // Generated from example definition: 2024-08-21-preview/AzureKeyVaultSecretProviderClasses_Get_MaximumSet_Gen.json + // this example is just showing the usage of "AzureKeyVaultSecretProviderClass_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 AzureKeyVaultSecretProviderClassResource created on azure + // for more information of creating AzureKeyVaultSecretProviderClassResource, please refer to the document of AzureKeyVaultSecretProviderClassResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "rg-ssc-example"; + string azureKeyVaultSecretProviderClassName = "akvspc-ssc-example"; + ResourceIdentifier azureKeyVaultSecretProviderClassResourceId = AzureKeyVaultSecretProviderClassResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, azureKeyVaultSecretProviderClassName); + AzureKeyVaultSecretProviderClassResource azureKeyVaultSecretProviderClass = client.GetAzureKeyVaultSecretProviderClassResource(azureKeyVaultSecretProviderClassResourceId); + + // invoke the operation + AzureKeyVaultSecretProviderClassResource result = await azureKeyVaultSecretProviderClass.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 + AzureKeyVaultSecretProviderClassData 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_AzureKeyVaultSecretProviderClassesDelete() + { + // Generated from example definition: 2024-08-21-preview/AzureKeyVaultSecretProviderClasses_Delete_MaximumSet_Gen.json + // this example is just showing the usage of "AzureKeyVaultSecretProviderClass_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 AzureKeyVaultSecretProviderClassResource created on azure + // for more information of creating AzureKeyVaultSecretProviderClassResource, please refer to the document of AzureKeyVaultSecretProviderClassResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "rg-ssc-example"; + string azureKeyVaultSecretProviderClassName = "akvspc-ssc-example"; + ResourceIdentifier azureKeyVaultSecretProviderClassResourceId = AzureKeyVaultSecretProviderClassResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, azureKeyVaultSecretProviderClassName); + AzureKeyVaultSecretProviderClassResource azureKeyVaultSecretProviderClass = client.GetAzureKeyVaultSecretProviderClassResource(azureKeyVaultSecretProviderClassResourceId); + + // invoke the operation + await azureKeyVaultSecretProviderClass.DeleteAsync(WaitUntil.Completed); + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Update_AzureKeyVaultSecretProviderClassesUpdate() + { + // Generated from example definition: 2024-08-21-preview/AzureKeyVaultSecretProviderClasses_Update_MaximumSet_Gen.json + // this example is just showing the usage of "AzureKeyVaultSecretProviderClass_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 AzureKeyVaultSecretProviderClassResource created on azure + // for more information of creating AzureKeyVaultSecretProviderClassResource, please refer to the document of AzureKeyVaultSecretProviderClassResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "rg-ssc-example"; + string azureKeyVaultSecretProviderClassName = "akvspc-ssc-example"; + ResourceIdentifier azureKeyVaultSecretProviderClassResourceId = AzureKeyVaultSecretProviderClassResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, azureKeyVaultSecretProviderClassName); + AzureKeyVaultSecretProviderClassResource azureKeyVaultSecretProviderClass = client.GetAzureKeyVaultSecretProviderClassResource(azureKeyVaultSecretProviderClassResourceId); + + // invoke the operation + AzureKeyVaultSecretProviderClassPatch patch = new AzureKeyVaultSecretProviderClassPatch + { + Tags = +{ +["example-tag"] = "example-tag-value" +}, + Properties = new AzureKeyVaultSecretProviderClassUpdateProperties + { + KeyvaultName = "example-ssc-key-vault", + ClientId = "00000000-0000-0000-0000-000000000000", + TenantId = "00000000-0000-0000-0000-000000000000", + Objects = "array: |\n - |\n objectName: my-secret-object\n objectType: secret\n objectVersionHistory: 1", + }, + }; + ArmOperation lro = await azureKeyVaultSecretProviderClass.UpdateAsync(WaitUntil.Completed, patch); + AzureKeyVaultSecretProviderClassResource 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 + AzureKeyVaultSecretProviderClassData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/edgeworkloadsecurity/Azure.ResourceManager.SecretsStoreExtension/samples/Generated/Samples/Sample_SecretSyncCollection.cs b/sdk/edgeworkloadsecurity/Azure.ResourceManager.SecretsStoreExtension/samples/Generated/Samples/Sample_SecretSyncCollection.cs new file mode 100644 index 000000000000..d778174dd80a --- /dev/null +++ b/sdk/edgeworkloadsecurity/Azure.ResourceManager.SecretsStoreExtension/samples/Generated/Samples/Sample_SecretSyncCollection.cs @@ -0,0 +1,208 @@ +// 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 Azure.ResourceManager.Resources.Models; +using Azure.ResourceManager.SecretsStoreExtension.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.SecretsStoreExtension.Samples +{ + public partial class Sample_SecretSyncCollection + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task CreateOrUpdate_SecretSyncsCreateOrUpdate() + { + // Generated from example definition: 2024-08-21-preview/SecretSyncs_CreateOrUpdate_MaximumSet_Gen.json + // this example is just showing the usage of "SecretSync_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "rg-ssc-example"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this SecretSyncResource + SecretSyncCollection collection = resourceGroupResource.GetSecretSyncs(); + + // invoke the operation + string secretSyncName = "secretsync-ssc-example"; + SecretSyncData data = new SecretSyncData(new AzureLocation("eastus")) + { + Properties = new SecretSyncProperties("akvspc-ssc-example", "example-k8s-sa-name", KubernetesSecretType.Opaque, new KubernetesSecretObjectMapping[] + { +new KubernetesSecretObjectMapping("kv-secret-name/0", "kv-secret-name/0") + }), + ExtendedLocation = new ExtendedLocation + { + Name = "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg-ssc-example/providers/Microsoft.ExtendedLocation/customLocations/example-custom-location", + }, + Tags = +{ +["example-tag"] = "example-tag-value" +}, + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, secretSyncName, data); + SecretSyncResource 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 + SecretSyncData 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_SecretSyncsGet() + { + // Generated from example definition: 2024-08-21-preview/SecretSyncs_Get_MaximumSet_Gen.json + // this example is just showing the usage of "SecretSync_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 = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "rg-ssc-example"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this SecretSyncResource + SecretSyncCollection collection = resourceGroupResource.GetSecretSyncs(); + + // invoke the operation + string secretSyncName = "secretsync-ssc-example"; + SecretSyncResource result = await collection.GetAsync(secretSyncName); + + // 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 + SecretSyncData 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_SecretSyncsListByResourceGroup() + { + // Generated from example definition: 2024-08-21-preview/SecretSyncs_ListByResourceGroup_MaximumSet_Gen.json + // this example is just showing the usage of "SecretSync_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 = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "rg-ssc-example"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this SecretSyncResource + SecretSyncCollection collection = resourceGroupResource.GetSecretSyncs(); + + // invoke the operation and iterate over the result + await foreach (SecretSyncResource 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 + SecretSyncData 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_SecretSyncsGet() + { + // Generated from example definition: 2024-08-21-preview/SecretSyncs_Get_MaximumSet_Gen.json + // this example is just showing the usage of "SecretSync_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 = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "rg-ssc-example"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this SecretSyncResource + SecretSyncCollection collection = resourceGroupResource.GetSecretSyncs(); + + // invoke the operation + string secretSyncName = "secretsync-ssc-example"; + bool result = await collection.ExistsAsync(secretSyncName); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetIfExists_SecretSyncsGet() + { + // Generated from example definition: 2024-08-21-preview/SecretSyncs_Get_MaximumSet_Gen.json + // this example is just showing the usage of "SecretSync_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 = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "rg-ssc-example"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this SecretSyncResource + SecretSyncCollection collection = resourceGroupResource.GetSecretSyncs(); + + // invoke the operation + string secretSyncName = "secretsync-ssc-example"; + NullableResponse response = await collection.GetIfExistsAsync(secretSyncName); + SecretSyncResource 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 + SecretSyncData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + } +} diff --git a/sdk/edgeworkloadsecurity/Azure.ResourceManager.SecretsStoreExtension/samples/Generated/Samples/Sample_SecretSyncResource.cs b/sdk/edgeworkloadsecurity/Azure.ResourceManager.SecretsStoreExtension/samples/Generated/Samples/Sample_SecretSyncResource.cs new file mode 100644 index 000000000000..91beb50cc454 --- /dev/null +++ b/sdk/edgeworkloadsecurity/Azure.ResourceManager.SecretsStoreExtension/samples/Generated/Samples/Sample_SecretSyncResource.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.SecretsStoreExtension.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.SecretsStoreExtension.Samples +{ + public partial class Sample_SecretSyncResource + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_SecretSyncsGet() + { + // Generated from example definition: 2024-08-21-preview/SecretSyncs_Get_MaximumSet_Gen.json + // this example is just showing the usage of "SecretSync_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 SecretSyncResource created on azure + // for more information of creating SecretSyncResource, please refer to the document of SecretSyncResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "rg-ssc-example"; + string secretSyncName = "secretsync-ssc-example"; + ResourceIdentifier secretSyncResourceId = SecretSyncResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, secretSyncName); + SecretSyncResource secretSync = client.GetSecretSyncResource(secretSyncResourceId); + + // invoke the operation + SecretSyncResource result = await secretSync.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 + SecretSyncData 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_SecretSyncsDelete() + { + // Generated from example definition: 2024-08-21-preview/SecretSyncs_Delete_MaximumSet_Gen.json + // this example is just showing the usage of "SecretSync_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 SecretSyncResource created on azure + // for more information of creating SecretSyncResource, please refer to the document of SecretSyncResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "rg-ssc-example"; + string secretSyncName = "secretsync-ssc-example"; + ResourceIdentifier secretSyncResourceId = SecretSyncResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, secretSyncName); + SecretSyncResource secretSync = client.GetSecretSyncResource(secretSyncResourceId); + + // invoke the operation + await secretSync.DeleteAsync(WaitUntil.Completed); + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Update_SecretSyncsUpdate() + { + // Generated from example definition: 2024-08-21-preview/SecretSyncs_Update_MaximumSet_Gen.json + // this example is just showing the usage of "SecretSync_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 SecretSyncResource created on azure + // for more information of creating SecretSyncResource, please refer to the document of SecretSyncResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "rg-ssc-example"; + string secretSyncName = "secretsync-ssc-example"; + ResourceIdentifier secretSyncResourceId = SecretSyncResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, secretSyncName); + SecretSyncResource secretSync = client.GetSecretSyncResource(secretSyncResourceId); + + // invoke the operation + SecretSyncPatch patch = new SecretSyncPatch + { + Tags = +{ +["example-tag"] = "example-tag-value" +}, + Properties = new SecretSyncUpdateProperties + { + SecretProviderClassName = "jttlpenhtpxfrrlxdsmqqvmvtmgqrficvqngkggjwciilrexenlstxncyvkqcydxrivkioujssncoaiysdklfouukczzdbxniipbyiqsarqaespuqrbbydwtdaulllostoomntkadklihemfpeffvuyvyilequiqewzspaootvkibrynbqrsbiptjdhywynvydaadprdc", + ServiceAccountName = "fcldqfdfpktndlntuoxicsftelhefevovmlycflfwzckvamiqjnjugandqaqqeccsbzztfmmeunvhsafgerbcsdbnmsyqivygornebbkusuvphwghgouxvcbvmbydqjzoxextnyowsnyymadniwdrrxtogeveldpejixmsrzzfqkquaxdpzwvecevqwasxgxxchrfa", + KubernetesSecretType = KubernetesSecretType.Opaque, + ForceSynchronization = "arbitrarystring", + ObjectSecretMapping = { new KubernetesSecretObjectMapping("ssrzmbvdiomkvzrdsyilwlfzicfydnbjwjsnohrppkukjddrunfslkrnexunuckmghixdssposvndpiqchpqrkjuqbapoisvqdvgstvdonsmlpsmticfvuhqlofpaxfdg", "lojegeqiqfjxyblfxhxloccqzwgpgcelrwqwsbsltcjvjvceejgdrmxhenokxrylhynkltvqntjcvujjrppzvcxyivxeksgmzhifrcklizbpntdepzdl") }, + }, + }; + ArmOperation lro = await secretSync.UpdateAsync(WaitUntil.Completed, patch); + SecretSyncResource 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 + SecretSyncData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/edgeworkloadsecurity/Azure.ResourceManager.SecretsStoreExtension/samples/Generated/Samples/Sample_SubscriptionResourceExtensions.cs b/sdk/edgeworkloadsecurity/Azure.ResourceManager.SecretsStoreExtension/samples/Generated/Samples/Sample_SubscriptionResourceExtensions.cs new file mode 100644 index 000000000000..0a3d98724284 --- /dev/null +++ b/sdk/edgeworkloadsecurity/Azure.ResourceManager.SecretsStoreExtension/samples/Generated/Samples/Sample_SubscriptionResourceExtensions.cs @@ -0,0 +1,81 @@ +// 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.SecretsStoreExtension.Samples +{ + public partial class Sample_SubscriptionResourceExtensions + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetAzureKeyVaultSecretProviderClasses_AzureKeyVaultSecretProviderClassesListBySubscription() + { + // Generated from example definition: 2024-08-21-preview/AzureKeyVaultSecretProviderClasses_ListBySubscription_MaximumSet_Gen.json + // this example is just showing the usage of "AzureKeyVaultSecretProviderClass_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 = "00000000-0000-0000-0000-000000000000"; + ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(subscriptionId); + SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId); + + // invoke the operation and iterate over the result + await foreach (AzureKeyVaultSecretProviderClassResource item in subscriptionResource.GetAzureKeyVaultSecretProviderClassesAsync()) + { + // 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 + AzureKeyVaultSecretProviderClassData 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 GetSecretSyncs_SecretSyncsListBySubscription() + { + // Generated from example definition: 2024-08-21-preview/SecretSyncs_ListBySubscription_MaximumSet_Gen.json + // this example is just showing the usage of "SecretSync_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 = "00000000-0000-0000-0000-000000000000"; + ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(subscriptionId); + SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId); + + // invoke the operation and iterate over the result + await foreach (SecretSyncResource item in subscriptionResource.GetSecretSyncsAsync()) + { + // 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 + SecretSyncData 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/edgeworkloadsecurity/Azure.ResourceManager.SecretsStoreExtension/src/Azure.ResourceManager.SecretsStoreExtension.csproj b/sdk/edgeworkloadsecurity/Azure.ResourceManager.SecretsStoreExtension/src/Azure.ResourceManager.SecretsStoreExtension.csproj new file mode 100644 index 000000000000..1198b8554e01 --- /dev/null +++ b/sdk/edgeworkloadsecurity/Azure.ResourceManager.SecretsStoreExtension/src/Azure.ResourceManager.SecretsStoreExtension.csproj @@ -0,0 +1,8 @@ + + + Azure Resource Manager client SDK for Azure resource provider SecretsStoreExtension. + 1.0.0-beta.1 + azure;management;arm;resource manager;secretsstoreextension + Azure.ResourceManager.SecretsStoreExtension + + diff --git a/sdk/edgeworkloadsecurity/Azure.ResourceManager.SecretsStoreExtension/src/Generated/ArmSecretsStoreExtensionModelFactory.cs b/sdk/edgeworkloadsecurity/Azure.ResourceManager.SecretsStoreExtension/src/Generated/ArmSecretsStoreExtensionModelFactory.cs new file mode 100644 index 000000000000..e3f4a5326ccc --- /dev/null +++ b/sdk/edgeworkloadsecurity/Azure.ResourceManager.SecretsStoreExtension/src/Generated/ArmSecretsStoreExtensionModelFactory.cs @@ -0,0 +1,145 @@ +// 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; +using Azure.ResourceManager.Resources.Models; + +namespace Azure.ResourceManager.SecretsStoreExtension.Models +{ + /// Model factory for models. + public static partial class ArmSecretsStoreExtensionModelFactory + { + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The tags. + /// The location. + /// The resource-specific properties for this resource. + /// + /// A new instance for mocking. + public static SecretSyncData SecretSyncData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, SecretSyncProperties properties = null, ExtendedLocation extendedLocation = null) + { + tags ??= new Dictionary(); + + return new SecretSyncData( + id, + name, + resourceType, + systemData, + tags, + location, + properties, + extendedLocation, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// SecretProviderClassName specifies the name of the SecretProviderClass resource, which contains the information needed to access the cloud provider secret store. + /// ServiceAccountName specifies the name of the service account used to access the cloud provider secret store. The audience field in the service account token must be passed as parameter in the controller configuration. The audience is used when requesting a token from the API server for the service account; the supported audiences are defined by each provider. + /// Type specifies the type of the Kubernetes secret object, e.g. "Opaque" or"kubernetes.io/tls". The controller must have permission to create secrets of the specified type. + /// ForceSynchronization can be used to force the secret synchronization. The secret synchronization is triggered by changing the value in this field. This field is not used to resolve synchronization conflicts. + /// An array of SecretObjectData that maps secret data from the external secret provider to the Kubernetes secret. Each entry specifies the source secret in the external provider and the corresponding key in the Kubernetes secret. + /// SecretSyncStatus defines the observed state of the secret synchronization process. + /// Provisioning state of the SecretSync instance. + /// A new instance for mocking. + public static SecretSyncProperties SecretSyncProperties(string secretProviderClassName = null, string serviceAccountName = null, KubernetesSecretType kubernetesSecretType = default, string forceSynchronization = null, IEnumerable objectSecretMapping = null, SecretSyncStatus status = null, ProvisioningState? provisioningState = null) + { + objectSecretMapping ??= new List(); + + return new SecretSyncProperties( + secretProviderClassName, + serviceAccountName, + kubernetesSecretType, + forceSynchronization, + objectSecretMapping?.ToList(), + status, + provisioningState, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// LastSuccessfulSyncTime represents the last time the secret was retrieved from the Provider and updated. + /// Conditions represent the status of the secret create and update processes. The status can be True, False, or Unknown with various reasons and messages explaining the state. Examples of reasons include CreateSucceeded, ProviderError, InvalidClusterSecretLabelError, InvalidClusterSecretAnnotationError, UnknownError, ValidatingAdmissionPolicyCheckFailed, UserInputValidationFailed, ControllerSpcError, ControllerInternalError, NoValueChange, and ValueChangeOrForceUpdateDetected. + /// A new instance for mocking. + public static SecretSyncStatus SecretSyncStatus(DateTimeOffset? lastSuccessfulSyncOn = null, IEnumerable conditions = null) + { + conditions ??= new List(); + + return new SecretSyncStatus(lastSuccessfulSyncOn, conditions?.ToList(), serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// LastTransitionTime is the last time the condition transitioned from one status to another. This should be when the underlying condition changed. If that is not known, then using the time when the API field changed is acceptable. + /// Message is a human readable message indicating details about the transition. This may be an empty string. + /// ObservedGeneration represents the .metadata.generation that the condition was set based upon. For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date with respect to the current state of the instance. + /// Reason contains a programmatic identifier indicating the reason for the condition's last transition. Producers of specific condition types may define expected values and meanings for this field, and whether the values are considered a guaranteed API. The value should be a CamelCase string. This field may not be empty. + /// Status of the condition, one of True, False, Unknown. + /// Type of condition in CamelCase or in foo.example.com/CamelCase. Many .condition.type values are consistent across resources like Available, but because arbitrary conditions can be useful (see .node.status.conditions), the ability to de-conflict is important. The regex it matches is (dns1123SubdomainFmt/)?(qualifiedNameFmt). + /// A new instance for mocking. + public static SecretSyncCondition SecretSyncCondition(DateTimeOffset? lastTransitionOn = null, string message = null, long? observedGeneration = null, string reason = null, StatusConditionType status = default, string type = null) + { + return new SecretSyncCondition( + lastTransitionOn, + message, + observedGeneration, + reason, + status, + type, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The tags. + /// The location. + /// The resource-specific properties for this resource. + /// + /// A new instance for mocking. + public static AzureKeyVaultSecretProviderClassData AzureKeyVaultSecretProviderClassData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, AzureKeyVaultSecretProviderClassProperties properties = null, ExtendedLocation extendedLocation = null) + { + tags ??= new Dictionary(); + + return new AzureKeyVaultSecretProviderClassData( + id, + name, + resourceType, + systemData, + tags, + location, + properties, + extendedLocation, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The name of the Azure Key Vault to sync secrets from. + /// The user assigned managed identity client ID that should be used to access the Azure Key Vault. + /// The Azure Active Directory tenant ID that should be used for authenticating requests to the Azure Key Vault. + /// Objects defines the desired state of synced K8s secret objects. + /// Provisioning state of the AzureKeyVaultSecretProviderClass instance. + /// A new instance for mocking. + public static AzureKeyVaultSecretProviderClassProperties AzureKeyVaultSecretProviderClassProperties(string keyvaultName = null, string clientId = null, string tenantId = null, string objects = null, ProvisioningState? provisioningState = null) + { + return new AzureKeyVaultSecretProviderClassProperties( + keyvaultName, + clientId, + tenantId, + objects, + provisioningState, + serializedAdditionalRawData: null); + } + } +} diff --git a/sdk/edgeworkloadsecurity/Azure.ResourceManager.SecretsStoreExtension/src/Generated/AzureKeyVaultSecretProviderClassCollection.cs b/sdk/edgeworkloadsecurity/Azure.ResourceManager.SecretsStoreExtension/src/Generated/AzureKeyVaultSecretProviderClassCollection.cs new file mode 100644 index 000000000000..7ad2d6bb4858 --- /dev/null +++ b/sdk/edgeworkloadsecurity/Azure.ResourceManager.SecretsStoreExtension/src/Generated/AzureKeyVaultSecretProviderClassCollection.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.SecretsStoreExtension +{ + /// + /// 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 GetAzureKeyVaultSecretProviderClasses method from an instance of . + /// + public partial class AzureKeyVaultSecretProviderClassCollection : ArmCollection, IEnumerable, IAsyncEnumerable + { + private readonly ClientDiagnostics _azureKeyVaultSecretProviderClassClientDiagnostics; + private readonly AzureKeyVaultSecretProviderClassesRestOperations _azureKeyVaultSecretProviderClassRestClient; + + /// Initializes a new instance of the class for mocking. + protected AzureKeyVaultSecretProviderClassCollection() + { + } + + /// 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 AzureKeyVaultSecretProviderClassCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _azureKeyVaultSecretProviderClassClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.SecretsStoreExtension", AzureKeyVaultSecretProviderClassResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(AzureKeyVaultSecretProviderClassResource.ResourceType, out string azureKeyVaultSecretProviderClassApiVersion); + _azureKeyVaultSecretProviderClassRestClient = new AzureKeyVaultSecretProviderClassesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, azureKeyVaultSecretProviderClassApiVersion); +#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)); + } + + /// + /// Creates, or updates, an AzureKeyVaultSecretProviderClass instance. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SecretSyncController/azureKeyVaultSecretProviderClasses/{azureKeyVaultSecretProviderClassName} + /// + /// + /// Operation Id + /// AzureKeyVaultSecretProviderClass_CreateOrUpdate + /// + /// + /// Default Api Version + /// 2024-08-21-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The name of the AzureKeyVaultSecretProviderClass. + /// 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 azureKeyVaultSecretProviderClassName, AzureKeyVaultSecretProviderClassData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(azureKeyVaultSecretProviderClassName, nameof(azureKeyVaultSecretProviderClassName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _azureKeyVaultSecretProviderClassClientDiagnostics.CreateScope("AzureKeyVaultSecretProviderClassCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = await _azureKeyVaultSecretProviderClassRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, azureKeyVaultSecretProviderClassName, data, cancellationToken).ConfigureAwait(false); + var operation = new SecretsStoreExtensionArmOperation(new AzureKeyVaultSecretProviderClassOperationSource(Client), _azureKeyVaultSecretProviderClassClientDiagnostics, Pipeline, _azureKeyVaultSecretProviderClassRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, azureKeyVaultSecretProviderClassName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Creates, or updates, an AzureKeyVaultSecretProviderClass instance. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SecretSyncController/azureKeyVaultSecretProviderClasses/{azureKeyVaultSecretProviderClassName} + /// + /// + /// Operation Id + /// AzureKeyVaultSecretProviderClass_CreateOrUpdate + /// + /// + /// Default Api Version + /// 2024-08-21-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The name of the AzureKeyVaultSecretProviderClass. + /// 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 azureKeyVaultSecretProviderClassName, AzureKeyVaultSecretProviderClassData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(azureKeyVaultSecretProviderClassName, nameof(azureKeyVaultSecretProviderClassName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _azureKeyVaultSecretProviderClassClientDiagnostics.CreateScope("AzureKeyVaultSecretProviderClassCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = _azureKeyVaultSecretProviderClassRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, azureKeyVaultSecretProviderClassName, data, cancellationToken); + var operation = new SecretsStoreExtensionArmOperation(new AzureKeyVaultSecretProviderClassOperationSource(Client), _azureKeyVaultSecretProviderClassClientDiagnostics, Pipeline, _azureKeyVaultSecretProviderClassRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, azureKeyVaultSecretProviderClassName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets the properties of an AzureKeyVaultSecretProviderClass instance. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SecretSyncController/azureKeyVaultSecretProviderClasses/{azureKeyVaultSecretProviderClassName} + /// + /// + /// Operation Id + /// AzureKeyVaultSecretProviderClass_Get + /// + /// + /// Default Api Version + /// 2024-08-21-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the AzureKeyVaultSecretProviderClass. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetAsync(string azureKeyVaultSecretProviderClassName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(azureKeyVaultSecretProviderClassName, nameof(azureKeyVaultSecretProviderClassName)); + + using var scope = _azureKeyVaultSecretProviderClassClientDiagnostics.CreateScope("AzureKeyVaultSecretProviderClassCollection.Get"); + scope.Start(); + try + { + var response = await _azureKeyVaultSecretProviderClassRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, azureKeyVaultSecretProviderClassName, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new AzureKeyVaultSecretProviderClassResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets the properties of an AzureKeyVaultSecretProviderClass instance. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SecretSyncController/azureKeyVaultSecretProviderClasses/{azureKeyVaultSecretProviderClassName} + /// + /// + /// Operation Id + /// AzureKeyVaultSecretProviderClass_Get + /// + /// + /// Default Api Version + /// 2024-08-21-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the AzureKeyVaultSecretProviderClass. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Get(string azureKeyVaultSecretProviderClassName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(azureKeyVaultSecretProviderClassName, nameof(azureKeyVaultSecretProviderClassName)); + + using var scope = _azureKeyVaultSecretProviderClassClientDiagnostics.CreateScope("AzureKeyVaultSecretProviderClassCollection.Get"); + scope.Start(); + try + { + var response = _azureKeyVaultSecretProviderClassRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, azureKeyVaultSecretProviderClassName, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new AzureKeyVaultSecretProviderClassResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Lists the AzureKeyVaultSecretProviderClass instances within a resource group. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SecretSyncController/azureKeyVaultSecretProviderClasses + /// + /// + /// Operation Id + /// AzureKeyVaultSecretProviderClass_ListByResourceGroup + /// + /// + /// Default Api Version + /// 2024-08-21-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) => _azureKeyVaultSecretProviderClassRestClient.CreateListByResourceGroupRequest(Id.SubscriptionId, Id.ResourceGroupName); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _azureKeyVaultSecretProviderClassRestClient.CreateListByResourceGroupNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new AzureKeyVaultSecretProviderClassResource(Client, AzureKeyVaultSecretProviderClassData.DeserializeAzureKeyVaultSecretProviderClassData(e)), _azureKeyVaultSecretProviderClassClientDiagnostics, Pipeline, "AzureKeyVaultSecretProviderClassCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Lists the AzureKeyVaultSecretProviderClass instances within a resource group. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SecretSyncController/azureKeyVaultSecretProviderClasses + /// + /// + /// Operation Id + /// AzureKeyVaultSecretProviderClass_ListByResourceGroup + /// + /// + /// Default Api Version + /// 2024-08-21-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) => _azureKeyVaultSecretProviderClassRestClient.CreateListByResourceGroupRequest(Id.SubscriptionId, Id.ResourceGroupName); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _azureKeyVaultSecretProviderClassRestClient.CreateListByResourceGroupNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new AzureKeyVaultSecretProviderClassResource(Client, AzureKeyVaultSecretProviderClassData.DeserializeAzureKeyVaultSecretProviderClassData(e)), _azureKeyVaultSecretProviderClassClientDiagnostics, Pipeline, "AzureKeyVaultSecretProviderClassCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SecretSyncController/azureKeyVaultSecretProviderClasses/{azureKeyVaultSecretProviderClassName} + /// + /// + /// Operation Id + /// AzureKeyVaultSecretProviderClass_Get + /// + /// + /// Default Api Version + /// 2024-08-21-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the AzureKeyVaultSecretProviderClass. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> ExistsAsync(string azureKeyVaultSecretProviderClassName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(azureKeyVaultSecretProviderClassName, nameof(azureKeyVaultSecretProviderClassName)); + + using var scope = _azureKeyVaultSecretProviderClassClientDiagnostics.CreateScope("AzureKeyVaultSecretProviderClassCollection.Exists"); + scope.Start(); + try + { + var response = await _azureKeyVaultSecretProviderClassRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, azureKeyVaultSecretProviderClassName, 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.SecretSyncController/azureKeyVaultSecretProviderClasses/{azureKeyVaultSecretProviderClassName} + /// + /// + /// Operation Id + /// AzureKeyVaultSecretProviderClass_Get + /// + /// + /// Default Api Version + /// 2024-08-21-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the AzureKeyVaultSecretProviderClass. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Exists(string azureKeyVaultSecretProviderClassName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(azureKeyVaultSecretProviderClassName, nameof(azureKeyVaultSecretProviderClassName)); + + using var scope = _azureKeyVaultSecretProviderClassClientDiagnostics.CreateScope("AzureKeyVaultSecretProviderClassCollection.Exists"); + scope.Start(); + try + { + var response = _azureKeyVaultSecretProviderClassRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, azureKeyVaultSecretProviderClassName, 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.SecretSyncController/azureKeyVaultSecretProviderClasses/{azureKeyVaultSecretProviderClassName} + /// + /// + /// Operation Id + /// AzureKeyVaultSecretProviderClass_Get + /// + /// + /// Default Api Version + /// 2024-08-21-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the AzureKeyVaultSecretProviderClass. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetIfExistsAsync(string azureKeyVaultSecretProviderClassName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(azureKeyVaultSecretProviderClassName, nameof(azureKeyVaultSecretProviderClassName)); + + using var scope = _azureKeyVaultSecretProviderClassClientDiagnostics.CreateScope("AzureKeyVaultSecretProviderClassCollection.GetIfExists"); + scope.Start(); + try + { + var response = await _azureKeyVaultSecretProviderClassRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, azureKeyVaultSecretProviderClassName, cancellationToken: cancellationToken).ConfigureAwait(false); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new AzureKeyVaultSecretProviderClassResource(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.SecretSyncController/azureKeyVaultSecretProviderClasses/{azureKeyVaultSecretProviderClassName} + /// + /// + /// Operation Id + /// AzureKeyVaultSecretProviderClass_Get + /// + /// + /// Default Api Version + /// 2024-08-21-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the AzureKeyVaultSecretProviderClass. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual NullableResponse GetIfExists(string azureKeyVaultSecretProviderClassName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(azureKeyVaultSecretProviderClassName, nameof(azureKeyVaultSecretProviderClassName)); + + using var scope = _azureKeyVaultSecretProviderClassClientDiagnostics.CreateScope("AzureKeyVaultSecretProviderClassCollection.GetIfExists"); + scope.Start(); + try + { + var response = _azureKeyVaultSecretProviderClassRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, azureKeyVaultSecretProviderClassName, cancellationToken: cancellationToken); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new AzureKeyVaultSecretProviderClassResource(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/edgeworkloadsecurity/Azure.ResourceManager.SecretsStoreExtension/src/Generated/AzureKeyVaultSecretProviderClassData.Serialization.cs b/sdk/edgeworkloadsecurity/Azure.ResourceManager.SecretsStoreExtension/src/Generated/AzureKeyVaultSecretProviderClassData.Serialization.cs new file mode 100644 index 000000000000..b26f569086d6 --- /dev/null +++ b/sdk/edgeworkloadsecurity/Azure.ResourceManager.SecretsStoreExtension/src/Generated/AzureKeyVaultSecretProviderClassData.Serialization.cs @@ -0,0 +1,195 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.Models; +using Azure.ResourceManager.Resources.Models; +using Azure.ResourceManager.SecretsStoreExtension.Models; + +namespace Azure.ResourceManager.SecretsStoreExtension +{ + public partial class AzureKeyVaultSecretProviderClassData : 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(AzureKeyVaultSecretProviderClassData)} 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(ExtendedLocation)) + { + writer.WritePropertyName("extendedLocation"u8); + JsonSerializer.Serialize(writer, ExtendedLocation); + } + } + + AzureKeyVaultSecretProviderClassData 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(AzureKeyVaultSecretProviderClassData)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAzureKeyVaultSecretProviderClassData(document.RootElement, options); + } + + internal static AzureKeyVaultSecretProviderClassData DeserializeAzureKeyVaultSecretProviderClassData(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + AzureKeyVaultSecretProviderClassProperties properties = default; + ExtendedLocation extendedLocation = 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 = AzureKeyVaultSecretProviderClassProperties.DeserializeAzureKeyVaultSecretProviderClassProperties(property.Value, options); + continue; + } + if (property.NameEquals("extendedLocation"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + extendedLocation = JsonSerializer.Deserialize(property.Value.GetRawText()); + 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 AzureKeyVaultSecretProviderClassData( + id, + name, + type, + systemData, + tags ?? new ChangeTrackingDictionary(), + location, + properties, + extendedLocation, + 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(AzureKeyVaultSecretProviderClassData)} does not support writing '{options.Format}' format."); + } + } + + AzureKeyVaultSecretProviderClassData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeAzureKeyVaultSecretProviderClassData(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(AzureKeyVaultSecretProviderClassData)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/edgeworkloadsecurity/Azure.ResourceManager.SecretsStoreExtension/src/Generated/AzureKeyVaultSecretProviderClassData.cs b/sdk/edgeworkloadsecurity/Azure.ResourceManager.SecretsStoreExtension/src/Generated/AzureKeyVaultSecretProviderClassData.cs new file mode 100644 index 000000000000..1224c7e04072 --- /dev/null +++ b/sdk/edgeworkloadsecurity/Azure.ResourceManager.SecretsStoreExtension/src/Generated/AzureKeyVaultSecretProviderClassData.cs @@ -0,0 +1,88 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; +using Azure.ResourceManager.Models; +using Azure.ResourceManager.Resources.Models; +using Azure.ResourceManager.SecretsStoreExtension.Models; + +namespace Azure.ResourceManager.SecretsStoreExtension +{ + /// + /// A class representing the AzureKeyVaultSecretProviderClass data model. + /// The AzureKeyVaultSecretProviderClass resource. + /// + public partial class AzureKeyVaultSecretProviderClassData : 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 AzureKeyVaultSecretProviderClassData(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. + /// + /// Keeps track of any properties unknown to the library. + internal AzureKeyVaultSecretProviderClassData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, AzureKeyVaultSecretProviderClassProperties properties, ExtendedLocation extendedLocation, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) + { + Properties = properties; + ExtendedLocation = extendedLocation; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal AzureKeyVaultSecretProviderClassData() + { + } + + /// The resource-specific properties for this resource. + public AzureKeyVaultSecretProviderClassProperties Properties { get; set; } + /// Gets or sets the extended location. + public ExtendedLocation ExtendedLocation { get; set; } + } +} diff --git a/sdk/edgeworkloadsecurity/Azure.ResourceManager.SecretsStoreExtension/src/Generated/AzureKeyVaultSecretProviderClassResource.Serialization.cs b/sdk/edgeworkloadsecurity/Azure.ResourceManager.SecretsStoreExtension/src/Generated/AzureKeyVaultSecretProviderClassResource.Serialization.cs new file mode 100644 index 000000000000..e0a3a2e42192 --- /dev/null +++ b/sdk/edgeworkloadsecurity/Azure.ResourceManager.SecretsStoreExtension/src/Generated/AzureKeyVaultSecretProviderClassResource.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.SecretsStoreExtension +{ + public partial class AzureKeyVaultSecretProviderClassResource : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); + + AzureKeyVaultSecretProviderClassData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options); + + AzureKeyVaultSecretProviderClassData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options); + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); + } +} diff --git a/sdk/edgeworkloadsecurity/Azure.ResourceManager.SecretsStoreExtension/src/Generated/AzureKeyVaultSecretProviderClassResource.cs b/sdk/edgeworkloadsecurity/Azure.ResourceManager.SecretsStoreExtension/src/Generated/AzureKeyVaultSecretProviderClassResource.cs new file mode 100644 index 000000000000..f12a0d5408a7 --- /dev/null +++ b/sdk/edgeworkloadsecurity/Azure.ResourceManager.SecretsStoreExtension/src/Generated/AzureKeyVaultSecretProviderClassResource.cs @@ -0,0 +1,707 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.Resources; +using Azure.ResourceManager.SecretsStoreExtension.Models; + +namespace Azure.ResourceManager.SecretsStoreExtension +{ + /// + /// A Class representing an AzureKeyVaultSecretProviderClass 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 GetAzureKeyVaultSecretProviderClassResource method. + /// Otherwise you can get one from its parent resource using the GetAzureKeyVaultSecretProviderClass method. + /// + public partial class AzureKeyVaultSecretProviderClassResource : ArmResource + { + /// Generate the resource identifier of a instance. + /// The subscriptionId. + /// The resourceGroupName. + /// The azureKeyVaultSecretProviderClassName. + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string azureKeyVaultSecretProviderClassName) + { + var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SecretSyncController/azureKeyVaultSecretProviderClasses/{azureKeyVaultSecretProviderClassName}"; + return new ResourceIdentifier(resourceId); + } + + private readonly ClientDiagnostics _azureKeyVaultSecretProviderClassClientDiagnostics; + private readonly AzureKeyVaultSecretProviderClassesRestOperations _azureKeyVaultSecretProviderClassRestClient; + private readonly AzureKeyVaultSecretProviderClassData _data; + + /// Gets the resource type for the operations. + public static readonly ResourceType ResourceType = "Microsoft.SecretSyncController/azureKeyVaultSecretProviderClasses"; + + /// Initializes a new instance of the class for mocking. + protected AzureKeyVaultSecretProviderClassResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal AzureKeyVaultSecretProviderClassResource(ArmClient client, AzureKeyVaultSecretProviderClassData 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 AzureKeyVaultSecretProviderClassResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _azureKeyVaultSecretProviderClassClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.SecretsStoreExtension", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string azureKeyVaultSecretProviderClassApiVersion); + _azureKeyVaultSecretProviderClassRestClient = new AzureKeyVaultSecretProviderClassesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, azureKeyVaultSecretProviderClassApiVersion); +#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 AzureKeyVaultSecretProviderClassData 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)); + } + + /// + /// Gets the properties of an AzureKeyVaultSecretProviderClass instance. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SecretSyncController/azureKeyVaultSecretProviderClasses/{azureKeyVaultSecretProviderClassName} + /// + /// + /// Operation Id + /// AzureKeyVaultSecretProviderClass_Get + /// + /// + /// Default Api Version + /// 2024-08-21-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _azureKeyVaultSecretProviderClassClientDiagnostics.CreateScope("AzureKeyVaultSecretProviderClassResource.Get"); + scope.Start(); + try + { + var response = await _azureKeyVaultSecretProviderClassRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new AzureKeyVaultSecretProviderClassResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets the properties of an AzureKeyVaultSecretProviderClass instance. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SecretSyncController/azureKeyVaultSecretProviderClasses/{azureKeyVaultSecretProviderClassName} + /// + /// + /// Operation Id + /// AzureKeyVaultSecretProviderClass_Get + /// + /// + /// Default Api Version + /// 2024-08-21-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _azureKeyVaultSecretProviderClassClientDiagnostics.CreateScope("AzureKeyVaultSecretProviderClassResource.Get"); + scope.Start(); + try + { + var response = _azureKeyVaultSecretProviderClassRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new AzureKeyVaultSecretProviderClassResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Deletes an AzureKeyVaultSecretProviderClass instance. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SecretSyncController/azureKeyVaultSecretProviderClasses/{azureKeyVaultSecretProviderClassName} + /// + /// + /// Operation Id + /// AzureKeyVaultSecretProviderClass_Delete + /// + /// + /// Default Api Version + /// 2024-08-21-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 = _azureKeyVaultSecretProviderClassClientDiagnostics.CreateScope("AzureKeyVaultSecretProviderClassResource.Delete"); + scope.Start(); + try + { + var response = await _azureKeyVaultSecretProviderClassRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + var operation = new SecretsStoreExtensionArmOperation(_azureKeyVaultSecretProviderClassClientDiagnostics, Pipeline, _azureKeyVaultSecretProviderClassRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Deletes an AzureKeyVaultSecretProviderClass instance. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SecretSyncController/azureKeyVaultSecretProviderClasses/{azureKeyVaultSecretProviderClassName} + /// + /// + /// Operation Id + /// AzureKeyVaultSecretProviderClass_Delete + /// + /// + /// Default Api Version + /// 2024-08-21-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 = _azureKeyVaultSecretProviderClassClientDiagnostics.CreateScope("AzureKeyVaultSecretProviderClassResource.Delete"); + scope.Start(); + try + { + var response = _azureKeyVaultSecretProviderClassRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + var operation = new SecretsStoreExtensionArmOperation(_azureKeyVaultSecretProviderClassClientDiagnostics, Pipeline, _azureKeyVaultSecretProviderClassRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletionResponse(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Updates an AzureKeyVaultSecretProviderClass instance. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SecretSyncController/azureKeyVaultSecretProviderClasses/{azureKeyVaultSecretProviderClassName} + /// + /// + /// Operation Id + /// AzureKeyVaultSecretProviderClass_Update + /// + /// + /// Default Api Version + /// 2024-08-21-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 resource properties to be updated. + /// The cancellation token to use. + /// is null. + public virtual async Task> UpdateAsync(WaitUntil waitUntil, AzureKeyVaultSecretProviderClassPatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(patch, nameof(patch)); + + using var scope = _azureKeyVaultSecretProviderClassClientDiagnostics.CreateScope("AzureKeyVaultSecretProviderClassResource.Update"); + scope.Start(); + try + { + var response = await _azureKeyVaultSecretProviderClassRestClient.UpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch, cancellationToken).ConfigureAwait(false); + var operation = new SecretsStoreExtensionArmOperation(new AzureKeyVaultSecretProviderClassOperationSource(Client), _azureKeyVaultSecretProviderClassClientDiagnostics, Pipeline, _azureKeyVaultSecretProviderClassRestClient.CreateUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Updates an AzureKeyVaultSecretProviderClass instance. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SecretSyncController/azureKeyVaultSecretProviderClasses/{azureKeyVaultSecretProviderClassName} + /// + /// + /// Operation Id + /// AzureKeyVaultSecretProviderClass_Update + /// + /// + /// Default Api Version + /// 2024-08-21-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 resource properties to be updated. + /// The cancellation token to use. + /// is null. + public virtual ArmOperation Update(WaitUntil waitUntil, AzureKeyVaultSecretProviderClassPatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(patch, nameof(patch)); + + using var scope = _azureKeyVaultSecretProviderClassClientDiagnostics.CreateScope("AzureKeyVaultSecretProviderClassResource.Update"); + scope.Start(); + try + { + var response = _azureKeyVaultSecretProviderClassRestClient.Update(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch, cancellationToken); + var operation = new SecretsStoreExtensionArmOperation(new AzureKeyVaultSecretProviderClassOperationSource(Client), _azureKeyVaultSecretProviderClassClientDiagnostics, Pipeline, _azureKeyVaultSecretProviderClassRestClient.CreateUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Add a tag to the current resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SecretSyncController/azureKeyVaultSecretProviderClasses/{azureKeyVaultSecretProviderClassName} + /// + /// + /// Operation Id + /// AzureKeyVaultSecretProviderClass_Get + /// + /// + /// Default Api Version + /// 2024-08-21-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The key for the tag. + /// The value for the tag. + /// The cancellation token to use. + /// or is null. + public virtual async Task> AddTagAsync(string key, string value, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(key, nameof(key)); + Argument.AssertNotNull(value, nameof(value)); + + using var scope = _azureKeyVaultSecretProviderClassClientDiagnostics.CreateScope("AzureKeyVaultSecretProviderClassResource.AddTag"); + scope.Start(); + try + { + if (await CanUseTagResourceAsync(cancellationToken: cancellationToken).ConfigureAwait(false)) + { + var originalTags = await GetTagResource().GetAsync(cancellationToken).ConfigureAwait(false); + originalTags.Value.Data.TagValues[key] = value; + await GetTagResource().CreateOrUpdateAsync(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken).ConfigureAwait(false); + var originalResponse = await _azureKeyVaultSecretProviderClassRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new AzureKeyVaultSecretProviderClassResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; + var patch = new AzureKeyVaultSecretProviderClassPatch(); + foreach (var tag in current.Tags) + { + patch.Tags.Add(tag); + } + patch.Tags[key] = value; + var result = await UpdateAsync(WaitUntil.Completed, patch, cancellationToken: cancellationToken).ConfigureAwait(false); + return Response.FromValue(result.Value, result.GetRawResponse()); + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Add a tag to the current resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SecretSyncController/azureKeyVaultSecretProviderClasses/{azureKeyVaultSecretProviderClassName} + /// + /// + /// Operation Id + /// AzureKeyVaultSecretProviderClass_Get + /// + /// + /// Default Api Version + /// 2024-08-21-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The key for the tag. + /// The value for the tag. + /// The cancellation token to use. + /// or is null. + public virtual Response AddTag(string key, string value, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(key, nameof(key)); + Argument.AssertNotNull(value, nameof(value)); + + using var scope = _azureKeyVaultSecretProviderClassClientDiagnostics.CreateScope("AzureKeyVaultSecretProviderClassResource.AddTag"); + scope.Start(); + try + { + if (CanUseTagResource(cancellationToken: cancellationToken)) + { + var originalTags = GetTagResource().Get(cancellationToken); + originalTags.Value.Data.TagValues[key] = value; + GetTagResource().CreateOrUpdate(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken); + var originalResponse = _azureKeyVaultSecretProviderClassRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + return Response.FromValue(new AzureKeyVaultSecretProviderClassResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = Get(cancellationToken: cancellationToken).Value.Data; + var patch = new AzureKeyVaultSecretProviderClassPatch(); + foreach (var tag in current.Tags) + { + patch.Tags.Add(tag); + } + patch.Tags[key] = value; + var result = Update(WaitUntil.Completed, patch, cancellationToken: cancellationToken); + return Response.FromValue(result.Value, result.GetRawResponse()); + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Replace the tags on the resource with the given set. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SecretSyncController/azureKeyVaultSecretProviderClasses/{azureKeyVaultSecretProviderClassName} + /// + /// + /// Operation Id + /// AzureKeyVaultSecretProviderClass_Get + /// + /// + /// Default Api Version + /// 2024-08-21-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The set of tags to use as replacement. + /// The cancellation token to use. + /// is null. + public virtual async Task> SetTagsAsync(IDictionary tags, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(tags, nameof(tags)); + + using var scope = _azureKeyVaultSecretProviderClassClientDiagnostics.CreateScope("AzureKeyVaultSecretProviderClassResource.SetTags"); + scope.Start(); + try + { + if (await CanUseTagResourceAsync(cancellationToken: cancellationToken).ConfigureAwait(false)) + { + await GetTagResource().DeleteAsync(WaitUntil.Completed, cancellationToken: cancellationToken).ConfigureAwait(false); + var originalTags = await GetTagResource().GetAsync(cancellationToken).ConfigureAwait(false); + originalTags.Value.Data.TagValues.ReplaceWith(tags); + await GetTagResource().CreateOrUpdateAsync(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken).ConfigureAwait(false); + var originalResponse = await _azureKeyVaultSecretProviderClassRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new AzureKeyVaultSecretProviderClassResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; + var patch = new AzureKeyVaultSecretProviderClassPatch(); + patch.Tags.ReplaceWith(tags); + var result = await UpdateAsync(WaitUntil.Completed, patch, cancellationToken: cancellationToken).ConfigureAwait(false); + return Response.FromValue(result.Value, result.GetRawResponse()); + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Replace the tags on the resource with the given set. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SecretSyncController/azureKeyVaultSecretProviderClasses/{azureKeyVaultSecretProviderClassName} + /// + /// + /// Operation Id + /// AzureKeyVaultSecretProviderClass_Get + /// + /// + /// Default Api Version + /// 2024-08-21-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The set of tags to use as replacement. + /// The cancellation token to use. + /// is null. + public virtual Response SetTags(IDictionary tags, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(tags, nameof(tags)); + + using var scope = _azureKeyVaultSecretProviderClassClientDiagnostics.CreateScope("AzureKeyVaultSecretProviderClassResource.SetTags"); + scope.Start(); + try + { + if (CanUseTagResource(cancellationToken: cancellationToken)) + { + GetTagResource().Delete(WaitUntil.Completed, cancellationToken: cancellationToken); + var originalTags = GetTagResource().Get(cancellationToken); + originalTags.Value.Data.TagValues.ReplaceWith(tags); + GetTagResource().CreateOrUpdate(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken); + var originalResponse = _azureKeyVaultSecretProviderClassRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + return Response.FromValue(new AzureKeyVaultSecretProviderClassResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = Get(cancellationToken: cancellationToken).Value.Data; + var patch = new AzureKeyVaultSecretProviderClassPatch(); + patch.Tags.ReplaceWith(tags); + var result = Update(WaitUntil.Completed, patch, cancellationToken: cancellationToken); + return Response.FromValue(result.Value, result.GetRawResponse()); + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Removes a tag by key from the resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SecretSyncController/azureKeyVaultSecretProviderClasses/{azureKeyVaultSecretProviderClassName} + /// + /// + /// Operation Id + /// AzureKeyVaultSecretProviderClass_Get + /// + /// + /// Default Api Version + /// 2024-08-21-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The key for the tag. + /// The cancellation token to use. + /// is null. + public virtual async Task> RemoveTagAsync(string key, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(key, nameof(key)); + + using var scope = _azureKeyVaultSecretProviderClassClientDiagnostics.CreateScope("AzureKeyVaultSecretProviderClassResource.RemoveTag"); + scope.Start(); + try + { + if (await CanUseTagResourceAsync(cancellationToken: cancellationToken).ConfigureAwait(false)) + { + var originalTags = await GetTagResource().GetAsync(cancellationToken).ConfigureAwait(false); + originalTags.Value.Data.TagValues.Remove(key); + await GetTagResource().CreateOrUpdateAsync(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken).ConfigureAwait(false); + var originalResponse = await _azureKeyVaultSecretProviderClassRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new AzureKeyVaultSecretProviderClassResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; + var patch = new AzureKeyVaultSecretProviderClassPatch(); + foreach (var tag in current.Tags) + { + patch.Tags.Add(tag); + } + patch.Tags.Remove(key); + var result = await UpdateAsync(WaitUntil.Completed, patch, cancellationToken: cancellationToken).ConfigureAwait(false); + return Response.FromValue(result.Value, result.GetRawResponse()); + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Removes a tag by key from the resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SecretSyncController/azureKeyVaultSecretProviderClasses/{azureKeyVaultSecretProviderClassName} + /// + /// + /// Operation Id + /// AzureKeyVaultSecretProviderClass_Get + /// + /// + /// Default Api Version + /// 2024-08-21-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The key for the tag. + /// The cancellation token to use. + /// is null. + public virtual Response RemoveTag(string key, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(key, nameof(key)); + + using var scope = _azureKeyVaultSecretProviderClassClientDiagnostics.CreateScope("AzureKeyVaultSecretProviderClassResource.RemoveTag"); + scope.Start(); + try + { + if (CanUseTagResource(cancellationToken: cancellationToken)) + { + var originalTags = GetTagResource().Get(cancellationToken); + originalTags.Value.Data.TagValues.Remove(key); + GetTagResource().CreateOrUpdate(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken); + var originalResponse = _azureKeyVaultSecretProviderClassRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + return Response.FromValue(new AzureKeyVaultSecretProviderClassResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = Get(cancellationToken: cancellationToken).Value.Data; + var patch = new AzureKeyVaultSecretProviderClassPatch(); + foreach (var tag in current.Tags) + { + patch.Tags.Add(tag); + } + patch.Tags.Remove(key); + var result = Update(WaitUntil.Completed, patch, cancellationToken: cancellationToken); + return Response.FromValue(result.Value, result.GetRawResponse()); + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/edgeworkloadsecurity/Azure.ResourceManager.SecretsStoreExtension/src/Generated/Extensions/MockableSecretsStoreExtensionArmClient.cs b/sdk/edgeworkloadsecurity/Azure.ResourceManager.SecretsStoreExtension/src/Generated/Extensions/MockableSecretsStoreExtensionArmClient.cs new file mode 100644 index 000000000000..4903dcc46299 --- /dev/null +++ b/sdk/edgeworkloadsecurity/Azure.ResourceManager.SecretsStoreExtension/src/Generated/Extensions/MockableSecretsStoreExtensionArmClient.cs @@ -0,0 +1,61 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using Azure.Core; + +namespace Azure.ResourceManager.SecretsStoreExtension.Mocking +{ + /// A class to add extension methods to ArmClient. + public partial class MockableSecretsStoreExtensionArmClient : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected MockableSecretsStoreExtensionArmClient() + { + } + + /// 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 MockableSecretsStoreExtensionArmClient(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + internal MockableSecretsStoreExtensionArmClient(ArmClient client) : this(client, ResourceIdentifier.Root) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// + /// 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 AzureKeyVaultSecretProviderClassResource GetAzureKeyVaultSecretProviderClassResource(ResourceIdentifier id) + { + AzureKeyVaultSecretProviderClassResource.ValidateResourceId(id); + return new AzureKeyVaultSecretProviderClassResource(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 SecretSyncResource GetSecretSyncResource(ResourceIdentifier id) + { + SecretSyncResource.ValidateResourceId(id); + return new SecretSyncResource(Client, id); + } + } +} diff --git a/sdk/edgeworkloadsecurity/Azure.ResourceManager.SecretsStoreExtension/src/Generated/Extensions/MockableSecretsStoreExtensionResourceGroupResource.cs b/sdk/edgeworkloadsecurity/Azure.ResourceManager.SecretsStoreExtension/src/Generated/Extensions/MockableSecretsStoreExtensionResourceGroupResource.cs new file mode 100644 index 000000000000..8c32644d5b13 --- /dev/null +++ b/sdk/edgeworkloadsecurity/Azure.ResourceManager.SecretsStoreExtension/src/Generated/Extensions/MockableSecretsStoreExtensionResourceGroupResource.cs @@ -0,0 +1,174 @@ +// 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.SecretsStoreExtension.Mocking +{ + /// A class to add extension methods to ResourceGroupResource. + public partial class MockableSecretsStoreExtensionResourceGroupResource : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected MockableSecretsStoreExtensionResourceGroupResource() + { + } + + /// 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 MockableSecretsStoreExtensionResourceGroupResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// Gets a collection of AzureKeyVaultSecretProviderClassResources in the ResourceGroupResource. + /// An object representing collection of AzureKeyVaultSecretProviderClassResources and their operations over a AzureKeyVaultSecretProviderClassResource. + public virtual AzureKeyVaultSecretProviderClassCollection GetAzureKeyVaultSecretProviderClasses() + { + return GetCachedClient(client => new AzureKeyVaultSecretProviderClassCollection(client, Id)); + } + + /// + /// Gets the properties of an AzureKeyVaultSecretProviderClass instance. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SecretSyncController/azureKeyVaultSecretProviderClasses/{azureKeyVaultSecretProviderClassName} + /// + /// + /// Operation Id + /// AzureKeyVaultSecretProviderClass_Get + /// + /// + /// Default Api Version + /// 2024-08-21-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the AzureKeyVaultSecretProviderClass. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetAzureKeyVaultSecretProviderClassAsync(string azureKeyVaultSecretProviderClassName, CancellationToken cancellationToken = default) + { + return await GetAzureKeyVaultSecretProviderClasses().GetAsync(azureKeyVaultSecretProviderClassName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets the properties of an AzureKeyVaultSecretProviderClass instance. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SecretSyncController/azureKeyVaultSecretProviderClasses/{azureKeyVaultSecretProviderClassName} + /// + /// + /// Operation Id + /// AzureKeyVaultSecretProviderClass_Get + /// + /// + /// Default Api Version + /// 2024-08-21-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the AzureKeyVaultSecretProviderClass. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetAzureKeyVaultSecretProviderClass(string azureKeyVaultSecretProviderClassName, CancellationToken cancellationToken = default) + { + return GetAzureKeyVaultSecretProviderClasses().Get(azureKeyVaultSecretProviderClassName, cancellationToken); + } + + /// Gets a collection of SecretSyncResources in the ResourceGroupResource. + /// An object representing collection of SecretSyncResources and their operations over a SecretSyncResource. + public virtual SecretSyncCollection GetSecretSyncs() + { + return GetCachedClient(client => new SecretSyncCollection(client, Id)); + } + + /// + /// Gets the properties of a SecretSync instance. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SecretSyncController/secretSyncs/{secretSyncName} + /// + /// + /// Operation Id + /// SecretSync_Get + /// + /// + /// Default Api Version + /// 2024-08-21-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the SecretSync. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetSecretSyncAsync(string secretSyncName, CancellationToken cancellationToken = default) + { + return await GetSecretSyncs().GetAsync(secretSyncName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets the properties of a SecretSync instance. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SecretSyncController/secretSyncs/{secretSyncName} + /// + /// + /// Operation Id + /// SecretSync_Get + /// + /// + /// Default Api Version + /// 2024-08-21-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the SecretSync. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetSecretSync(string secretSyncName, CancellationToken cancellationToken = default) + { + return GetSecretSyncs().Get(secretSyncName, cancellationToken); + } + } +} diff --git a/sdk/edgeworkloadsecurity/Azure.ResourceManager.SecretsStoreExtension/src/Generated/Extensions/MockableSecretsStoreExtensionSubscriptionResource.cs b/sdk/edgeworkloadsecurity/Azure.ResourceManager.SecretsStoreExtension/src/Generated/Extensions/MockableSecretsStoreExtensionSubscriptionResource.cs new file mode 100644 index 000000000000..d159e0453630 --- /dev/null +++ b/sdk/edgeworkloadsecurity/Azure.ResourceManager.SecretsStoreExtension/src/Generated/Extensions/MockableSecretsStoreExtensionSubscriptionResource.cs @@ -0,0 +1,166 @@ +// 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.SecretsStoreExtension.Mocking +{ + /// A class to add extension methods to SubscriptionResource. + public partial class MockableSecretsStoreExtensionSubscriptionResource : ArmResource + { + private ClientDiagnostics _azureKeyVaultSecretProviderClassClientDiagnostics; + private AzureKeyVaultSecretProviderClassesRestOperations _azureKeyVaultSecretProviderClassRestClient; + private ClientDiagnostics _secretSyncClientDiagnostics; + private SecretSyncsRestOperations _secretSyncRestClient; + + /// Initializes a new instance of the class for mocking. + protected MockableSecretsStoreExtensionSubscriptionResource() + { + } + + /// 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 MockableSecretsStoreExtensionSubscriptionResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + private ClientDiagnostics AzureKeyVaultSecretProviderClassClientDiagnostics => _azureKeyVaultSecretProviderClassClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.SecretsStoreExtension", AzureKeyVaultSecretProviderClassResource.ResourceType.Namespace, Diagnostics); + private AzureKeyVaultSecretProviderClassesRestOperations AzureKeyVaultSecretProviderClassRestClient => _azureKeyVaultSecretProviderClassRestClient ??= new AzureKeyVaultSecretProviderClassesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, GetApiVersionOrNull(AzureKeyVaultSecretProviderClassResource.ResourceType)); + private ClientDiagnostics SecretSyncClientDiagnostics => _secretSyncClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.SecretsStoreExtension", SecretSyncResource.ResourceType.Namespace, Diagnostics); + private SecretSyncsRestOperations SecretSyncRestClient => _secretSyncRestClient ??= new SecretSyncsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, GetApiVersionOrNull(SecretSyncResource.ResourceType)); + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// + /// Lists the AzureKeyVaultSecretProviderClass instances within an Azure subscription. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.SecretSyncController/azureKeyVaultSecretProviderClasses + /// + /// + /// Operation Id + /// AzureKeyVaultSecretProviderClass_ListBySubscription + /// + /// + /// Default Api Version + /// 2024-08-21-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetAzureKeyVaultSecretProviderClassesAsync(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => AzureKeyVaultSecretProviderClassRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => AzureKeyVaultSecretProviderClassRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new AzureKeyVaultSecretProviderClassResource(Client, AzureKeyVaultSecretProviderClassData.DeserializeAzureKeyVaultSecretProviderClassData(e)), AzureKeyVaultSecretProviderClassClientDiagnostics, Pipeline, "MockableSecretsStoreExtensionSubscriptionResource.GetAzureKeyVaultSecretProviderClasses", "value", "nextLink", cancellationToken); + } + + /// + /// Lists the AzureKeyVaultSecretProviderClass instances within an Azure subscription. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.SecretSyncController/azureKeyVaultSecretProviderClasses + /// + /// + /// Operation Id + /// AzureKeyVaultSecretProviderClass_ListBySubscription + /// + /// + /// Default Api Version + /// 2024-08-21-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetAzureKeyVaultSecretProviderClasses(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => AzureKeyVaultSecretProviderClassRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => AzureKeyVaultSecretProviderClassRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new AzureKeyVaultSecretProviderClassResource(Client, AzureKeyVaultSecretProviderClassData.DeserializeAzureKeyVaultSecretProviderClassData(e)), AzureKeyVaultSecretProviderClassClientDiagnostics, Pipeline, "MockableSecretsStoreExtensionSubscriptionResource.GetAzureKeyVaultSecretProviderClasses", "value", "nextLink", cancellationToken); + } + + /// + /// Lists the SecretSync instances within an Azure subscription. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.SecretSyncController/secretSyncs + /// + /// + /// Operation Id + /// SecretSync_ListBySubscription + /// + /// + /// Default Api Version + /// 2024-08-21-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetSecretSyncsAsync(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => SecretSyncRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => SecretSyncRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new SecretSyncResource(Client, SecretSyncData.DeserializeSecretSyncData(e)), SecretSyncClientDiagnostics, Pipeline, "MockableSecretsStoreExtensionSubscriptionResource.GetSecretSyncs", "value", "nextLink", cancellationToken); + } + + /// + /// Lists the SecretSync instances within an Azure subscription. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.SecretSyncController/secretSyncs + /// + /// + /// Operation Id + /// SecretSync_ListBySubscription + /// + /// + /// Default Api Version + /// 2024-08-21-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetSecretSyncs(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => SecretSyncRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => SecretSyncRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new SecretSyncResource(Client, SecretSyncData.DeserializeSecretSyncData(e)), SecretSyncClientDiagnostics, Pipeline, "MockableSecretsStoreExtensionSubscriptionResource.GetSecretSyncs", "value", "nextLink", cancellationToken); + } + } +} diff --git a/sdk/edgeworkloadsecurity/Azure.ResourceManager.SecretsStoreExtension/src/Generated/Extensions/SecretsStoreExtensionExtensions.cs b/sdk/edgeworkloadsecurity/Azure.ResourceManager.SecretsStoreExtension/src/Generated/Extensions/SecretsStoreExtensionExtensions.cs new file mode 100644 index 000000000000..7c44868ba598 --- /dev/null +++ b/sdk/edgeworkloadsecurity/Azure.ResourceManager.SecretsStoreExtension/src/Generated/Extensions/SecretsStoreExtensionExtensions.cs @@ -0,0 +1,403 @@ +// 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.Resources; +using Azure.ResourceManager.SecretsStoreExtension.Mocking; + +namespace Azure.ResourceManager.SecretsStoreExtension +{ + /// A class to add extension methods to Azure.ResourceManager.SecretsStoreExtension. + public static partial class SecretsStoreExtensionExtensions + { + private static MockableSecretsStoreExtensionArmClient GetMockableSecretsStoreExtensionArmClient(ArmClient client) + { + return client.GetCachedClient(client0 => new MockableSecretsStoreExtensionArmClient(client0)); + } + + private static MockableSecretsStoreExtensionResourceGroupResource GetMockableSecretsStoreExtensionResourceGroupResource(ArmResource resource) + { + return resource.GetCachedClient(client => new MockableSecretsStoreExtensionResourceGroupResource(client, resource.Id)); + } + + private static MockableSecretsStoreExtensionSubscriptionResource GetMockableSecretsStoreExtensionSubscriptionResource(ArmResource resource) + { + return resource.GetCachedClient(client => new MockableSecretsStoreExtensionSubscriptionResource(client, resource.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 AzureKeyVaultSecretProviderClassResource GetAzureKeyVaultSecretProviderClassResource(this ArmClient client, ResourceIdentifier id) + { + Argument.AssertNotNull(client, nameof(client)); + + return GetMockableSecretsStoreExtensionArmClient(client).GetAzureKeyVaultSecretProviderClassResource(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 SecretSyncResource GetSecretSyncResource(this ArmClient client, ResourceIdentifier id) + { + Argument.AssertNotNull(client, nameof(client)); + + return GetMockableSecretsStoreExtensionArmClient(client).GetSecretSyncResource(id); + } + + /// + /// Gets a collection of AzureKeyVaultSecretProviderClassResources 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 AzureKeyVaultSecretProviderClassResources and their operations over a AzureKeyVaultSecretProviderClassResource. + public static AzureKeyVaultSecretProviderClassCollection GetAzureKeyVaultSecretProviderClasses(this ResourceGroupResource resourceGroupResource) + { + Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource)); + + return GetMockableSecretsStoreExtensionResourceGroupResource(resourceGroupResource).GetAzureKeyVaultSecretProviderClasses(); + } + + /// + /// Gets the properties of an AzureKeyVaultSecretProviderClass instance. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SecretSyncController/azureKeyVaultSecretProviderClasses/{azureKeyVaultSecretProviderClassName} + /// + /// + /// Operation Id + /// AzureKeyVaultSecretProviderClass_Get + /// + /// + /// Default Api Version + /// 2024-08-21-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The name of the AzureKeyVaultSecretProviderClass. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public static async Task> GetAzureKeyVaultSecretProviderClassAsync(this ResourceGroupResource resourceGroupResource, string azureKeyVaultSecretProviderClassName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource)); + + return await GetMockableSecretsStoreExtensionResourceGroupResource(resourceGroupResource).GetAzureKeyVaultSecretProviderClassAsync(azureKeyVaultSecretProviderClassName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets the properties of an AzureKeyVaultSecretProviderClass instance. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SecretSyncController/azureKeyVaultSecretProviderClasses/{azureKeyVaultSecretProviderClassName} + /// + /// + /// Operation Id + /// AzureKeyVaultSecretProviderClass_Get + /// + /// + /// Default Api Version + /// 2024-08-21-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The name of the AzureKeyVaultSecretProviderClass. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public static Response GetAzureKeyVaultSecretProviderClass(this ResourceGroupResource resourceGroupResource, string azureKeyVaultSecretProviderClassName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource)); + + return GetMockableSecretsStoreExtensionResourceGroupResource(resourceGroupResource).GetAzureKeyVaultSecretProviderClass(azureKeyVaultSecretProviderClassName, cancellationToken); + } + + /// + /// Gets a collection of SecretSyncResources 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 SecretSyncResources and their operations over a SecretSyncResource. + public static SecretSyncCollection GetSecretSyncs(this ResourceGroupResource resourceGroupResource) + { + Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource)); + + return GetMockableSecretsStoreExtensionResourceGroupResource(resourceGroupResource).GetSecretSyncs(); + } + + /// + /// Gets the properties of a SecretSync instance. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SecretSyncController/secretSyncs/{secretSyncName} + /// + /// + /// Operation Id + /// SecretSync_Get + /// + /// + /// Default Api Version + /// 2024-08-21-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The name of the SecretSync. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public static async Task> GetSecretSyncAsync(this ResourceGroupResource resourceGroupResource, string secretSyncName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource)); + + return await GetMockableSecretsStoreExtensionResourceGroupResource(resourceGroupResource).GetSecretSyncAsync(secretSyncName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets the properties of a SecretSync instance. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SecretSyncController/secretSyncs/{secretSyncName} + /// + /// + /// Operation Id + /// SecretSync_Get + /// + /// + /// Default Api Version + /// 2024-08-21-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The name of the SecretSync. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public static Response GetSecretSync(this ResourceGroupResource resourceGroupResource, string secretSyncName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource)); + + return GetMockableSecretsStoreExtensionResourceGroupResource(resourceGroupResource).GetSecretSync(secretSyncName, cancellationToken); + } + + /// + /// Lists the AzureKeyVaultSecretProviderClass instances within an Azure subscription. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.SecretSyncController/azureKeyVaultSecretProviderClasses + /// + /// + /// Operation Id + /// AzureKeyVaultSecretProviderClass_ListBySubscription + /// + /// + /// Default Api Version + /// 2024-08-21-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 GetAzureKeyVaultSecretProviderClassesAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); + + return GetMockableSecretsStoreExtensionSubscriptionResource(subscriptionResource).GetAzureKeyVaultSecretProviderClassesAsync(cancellationToken); + } + + /// + /// Lists the AzureKeyVaultSecretProviderClass instances within an Azure subscription. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.SecretSyncController/azureKeyVaultSecretProviderClasses + /// + /// + /// Operation Id + /// AzureKeyVaultSecretProviderClass_ListBySubscription + /// + /// + /// Default Api Version + /// 2024-08-21-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 GetAzureKeyVaultSecretProviderClasses(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); + + return GetMockableSecretsStoreExtensionSubscriptionResource(subscriptionResource).GetAzureKeyVaultSecretProviderClasses(cancellationToken); + } + + /// + /// Lists the SecretSync instances within an Azure subscription. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.SecretSyncController/secretSyncs + /// + /// + /// Operation Id + /// SecretSync_ListBySubscription + /// + /// + /// Default Api Version + /// 2024-08-21-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 GetSecretSyncsAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); + + return GetMockableSecretsStoreExtensionSubscriptionResource(subscriptionResource).GetSecretSyncsAsync(cancellationToken); + } + + /// + /// Lists the SecretSync instances within an Azure subscription. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.SecretSyncController/secretSyncs + /// + /// + /// Operation Id + /// SecretSync_ListBySubscription + /// + /// + /// Default Api Version + /// 2024-08-21-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 GetSecretSyncs(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); + + return GetMockableSecretsStoreExtensionSubscriptionResource(subscriptionResource).GetSecretSyncs(cancellationToken); + } + } +} diff --git a/sdk/edgeworkloadsecurity/Azure.ResourceManager.SecretsStoreExtension/src/Generated/Internal/Argument.cs b/sdk/edgeworkloadsecurity/Azure.ResourceManager.SecretsStoreExtension/src/Generated/Internal/Argument.cs new file mode 100644 index 000000000000..6cdd3b1396e5 --- /dev/null +++ b/sdk/edgeworkloadsecurity/Azure.ResourceManager.SecretsStoreExtension/src/Generated/Internal/Argument.cs @@ -0,0 +1,129 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections; +using System.Collections.Generic; + +namespace Azure.ResourceManager.SecretsStoreExtension +{ + internal static class Argument + { + public static void AssertNotNull(T value, string name) + { + if (value is null) + { + throw new ArgumentNullException(name); + } + } + + public static void AssertNotNull(T? value, string name) + where T : struct + { + if (!value.HasValue) + { + throw new ArgumentNullException(name); + } + } + + public static void AssertNotNullOrEmpty(IEnumerable value, string name) + { + if (value is null) + { + throw new ArgumentNullException(name); + } + if (value is ICollection collectionOfT && collectionOfT.Count == 0) + { + throw new ArgumentException("Value cannot be an empty collection.", name); + } + if (value is ICollection collection && collection.Count == 0) + { + throw new ArgumentException("Value cannot be an empty collection.", name); + } + using IEnumerator e = value.GetEnumerator(); + if (!e.MoveNext()) + { + throw new ArgumentException("Value cannot be an empty collection.", name); + } + } + + public static void AssertNotNullOrEmpty(string value, string name) + { + if (value is null) + { + throw new ArgumentNullException(name); + } + if (value.Length == 0) + { + throw new ArgumentException("Value cannot be an empty string.", name); + } + } + + public static void AssertNotNullOrWhiteSpace(string value, string name) + { + if (value is null) + { + throw new ArgumentNullException(name); + } + if (string.IsNullOrWhiteSpace(value)) + { + throw new ArgumentException("Value cannot be empty or contain only white-space characters.", name); + } + } + + public static void AssertNotDefault(ref T value, string name) + where T : struct, IEquatable + { + if (value.Equals(default)) + { + throw new ArgumentException("Value cannot be empty.", name); + } + } + + public static void AssertInRange(T value, T minimum, T maximum, string name) + where T : notnull, IComparable + { + if (minimum.CompareTo(value) > 0) + { + throw new ArgumentOutOfRangeException(name, "Value is less than the minimum allowed."); + } + if (maximum.CompareTo(value) < 0) + { + throw new ArgumentOutOfRangeException(name, "Value is greater than the maximum allowed."); + } + } + + public static void AssertEnumDefined(Type enumType, object value, string name) + { + if (!Enum.IsDefined(enumType, value)) + { + throw new ArgumentException($"Value not defined for {enumType.FullName}.", name); + } + } + + public static T CheckNotNull(T value, string name) + where T : class + { + AssertNotNull(value, name); + return value; + } + + public static string CheckNotNullOrEmpty(string value, string name) + { + AssertNotNullOrEmpty(value, name); + return value; + } + + public static void AssertNull(T value, string name, string message = null) + { + if (value != null) + { + throw new ArgumentException(message ?? "Value must be null.", name); + } + } + } +} diff --git a/sdk/edgeworkloadsecurity/Azure.ResourceManager.SecretsStoreExtension/src/Generated/Internal/ChangeTrackingDictionary.cs b/sdk/edgeworkloadsecurity/Azure.ResourceManager.SecretsStoreExtension/src/Generated/Internal/ChangeTrackingDictionary.cs new file mode 100644 index 000000000000..5192ce1963d5 --- /dev/null +++ b/sdk/edgeworkloadsecurity/Azure.ResourceManager.SecretsStoreExtension/src/Generated/Internal/ChangeTrackingDictionary.cs @@ -0,0 +1,167 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections; +using System.Collections.Generic; + +namespace Azure.ResourceManager.SecretsStoreExtension +{ + internal class ChangeTrackingDictionary : IDictionary, IReadOnlyDictionary where TKey : notnull + { + private IDictionary _innerDictionary; + + public ChangeTrackingDictionary() + { + } + + public ChangeTrackingDictionary(IDictionary dictionary) + { + if (dictionary == null) + { + return; + } + _innerDictionary = new Dictionary(dictionary); + } + + public ChangeTrackingDictionary(IReadOnlyDictionary dictionary) + { + if (dictionary == null) + { + return; + } + _innerDictionary = new Dictionary(); + foreach (var pair in dictionary) + { + _innerDictionary.Add(pair); + } + } + + public bool IsUndefined => _innerDictionary == null; + + public int Count => IsUndefined ? 0 : EnsureDictionary().Count; + + public bool IsReadOnly => IsUndefined ? false : EnsureDictionary().IsReadOnly; + + public ICollection Keys => IsUndefined ? Array.Empty() : EnsureDictionary().Keys; + + public ICollection Values => IsUndefined ? Array.Empty() : EnsureDictionary().Values; + + public TValue this[TKey key] + { + get + { + if (IsUndefined) + { + throw new KeyNotFoundException(nameof(key)); + } + return EnsureDictionary()[key]; + } + set + { + EnsureDictionary()[key] = value; + } + } + + IEnumerable IReadOnlyDictionary.Keys => Keys; + + IEnumerable IReadOnlyDictionary.Values => Values; + + public IEnumerator> GetEnumerator() + { + if (IsUndefined) + { + IEnumerator> enumerateEmpty() + { + yield break; + } + return enumerateEmpty(); + } + return EnsureDictionary().GetEnumerator(); + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetEnumerator(); + } + + public void Add(KeyValuePair item) + { + EnsureDictionary().Add(item); + } + + public void Clear() + { + EnsureDictionary().Clear(); + } + + public bool Contains(KeyValuePair item) + { + if (IsUndefined) + { + return false; + } + return EnsureDictionary().Contains(item); + } + + public void CopyTo(KeyValuePair[] array, int index) + { + if (IsUndefined) + { + return; + } + EnsureDictionary().CopyTo(array, index); + } + + public bool Remove(KeyValuePair item) + { + if (IsUndefined) + { + return false; + } + return EnsureDictionary().Remove(item); + } + + public void Add(TKey key, TValue value) + { + EnsureDictionary().Add(key, value); + } + + public bool ContainsKey(TKey key) + { + if (IsUndefined) + { + return false; + } + return EnsureDictionary().ContainsKey(key); + } + + public bool Remove(TKey key) + { + if (IsUndefined) + { + return false; + } + return EnsureDictionary().Remove(key); + } + + public bool TryGetValue(TKey key, out TValue value) + { + if (IsUndefined) + { + value = default; + return false; + } + return EnsureDictionary().TryGetValue(key, out value); + } + + public IDictionary EnsureDictionary() + { + return _innerDictionary ??= new Dictionary(); + } + } +} diff --git a/sdk/edgeworkloadsecurity/Azure.ResourceManager.SecretsStoreExtension/src/Generated/Internal/ChangeTrackingList.cs b/sdk/edgeworkloadsecurity/Azure.ResourceManager.SecretsStoreExtension/src/Generated/Internal/ChangeTrackingList.cs new file mode 100644 index 000000000000..c7dafad335d0 --- /dev/null +++ b/sdk/edgeworkloadsecurity/Azure.ResourceManager.SecretsStoreExtension/src/Generated/Internal/ChangeTrackingList.cs @@ -0,0 +1,153 @@ +// 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.Linq; + +namespace Azure.ResourceManager.SecretsStoreExtension +{ + internal class ChangeTrackingList : IList, IReadOnlyList + { + private IList _innerList; + + public ChangeTrackingList() + { + } + + public ChangeTrackingList(IList innerList) + { + if (innerList != null) + { + _innerList = innerList; + } + } + + public ChangeTrackingList(IReadOnlyList innerList) + { + if (innerList != null) + { + _innerList = innerList.ToList(); + } + } + + public bool IsUndefined => _innerList == null; + + public int Count => IsUndefined ? 0 : EnsureList().Count; + + public bool IsReadOnly => IsUndefined ? false : EnsureList().IsReadOnly; + + public T this[int index] + { + get + { + if (IsUndefined) + { + throw new ArgumentOutOfRangeException(nameof(index)); + } + return EnsureList()[index]; + } + set + { + if (IsUndefined) + { + throw new ArgumentOutOfRangeException(nameof(index)); + } + EnsureList()[index] = value; + } + } + + public void Reset() + { + _innerList = null; + } + + public IEnumerator GetEnumerator() + { + if (IsUndefined) + { + IEnumerator enumerateEmpty() + { + yield break; + } + return enumerateEmpty(); + } + return EnsureList().GetEnumerator(); + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetEnumerator(); + } + + public void Add(T item) + { + EnsureList().Add(item); + } + + public void Clear() + { + EnsureList().Clear(); + } + + public bool Contains(T item) + { + if (IsUndefined) + { + return false; + } + return EnsureList().Contains(item); + } + + public void CopyTo(T[] array, int arrayIndex) + { + if (IsUndefined) + { + return; + } + EnsureList().CopyTo(array, arrayIndex); + } + + public bool Remove(T item) + { + if (IsUndefined) + { + return false; + } + return EnsureList().Remove(item); + } + + public int IndexOf(T item) + { + if (IsUndefined) + { + return -1; + } + return EnsureList().IndexOf(item); + } + + public void Insert(int index, T item) + { + EnsureList().Insert(index, item); + } + + public void RemoveAt(int index) + { + if (IsUndefined) + { + throw new ArgumentOutOfRangeException(nameof(index)); + } + EnsureList().RemoveAt(index); + } + + public IList EnsureList() + { + return _innerList ??= new List(); + } + } +} diff --git a/sdk/edgeworkloadsecurity/Azure.ResourceManager.SecretsStoreExtension/src/Generated/Internal/ModelSerializationExtensions.cs b/sdk/edgeworkloadsecurity/Azure.ResourceManager.SecretsStoreExtension/src/Generated/Internal/ModelSerializationExtensions.cs new file mode 100644 index 000000000000..8c10256223b3 --- /dev/null +++ b/sdk/edgeworkloadsecurity/Azure.ResourceManager.SecretsStoreExtension/src/Generated/Internal/ModelSerializationExtensions.cs @@ -0,0 +1,398 @@ +// 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.Diagnostics; +using System.Globalization; +using System.Text.Json; +using System.Xml; +using Azure.Core; + +namespace Azure.ResourceManager.SecretsStoreExtension +{ + internal static class ModelSerializationExtensions + { + internal static readonly ModelReaderWriterOptions WireOptions = new ModelReaderWriterOptions("W"); + + public static object GetObject(this JsonElement element) + { + switch (element.ValueKind) + { + case JsonValueKind.String: + return element.GetString(); + case JsonValueKind.Number: + if (element.TryGetInt32(out int intValue)) + { + return intValue; + } + if (element.TryGetInt64(out long longValue)) + { + return longValue; + } + return element.GetDouble(); + case JsonValueKind.True: + return true; + case JsonValueKind.False: + return false; + case JsonValueKind.Undefined: + case JsonValueKind.Null: + return null; + case JsonValueKind.Object: + var dictionary = new Dictionary(); + foreach (var jsonProperty in element.EnumerateObject()) + { + dictionary.Add(jsonProperty.Name, jsonProperty.Value.GetObject()); + } + return dictionary; + case JsonValueKind.Array: + var list = new List(); + foreach (var item in element.EnumerateArray()) + { + list.Add(item.GetObject()); + } + return list.ToArray(); + default: + throw new NotSupportedException($"Not supported value kind {element.ValueKind}"); + } + } + + public static byte[] GetBytesFromBase64(this JsonElement element, string format) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + + return format switch + { + "U" => TypeFormatters.FromBase64UrlString(element.GetRequiredString()), + "D" => element.GetBytesFromBase64(), + _ => throw new ArgumentException($"Format is not supported: '{format}'", nameof(format)) + }; + } + + public static DateTimeOffset GetDateTimeOffset(this JsonElement element, string format) => format switch + { + "U" when element.ValueKind == JsonValueKind.Number => DateTimeOffset.FromUnixTimeSeconds(element.GetInt64()), + _ => TypeFormatters.ParseDateTimeOffset(element.GetString(), format) + }; + + public static TimeSpan GetTimeSpan(this JsonElement element, string format) => TypeFormatters.ParseTimeSpan(element.GetString(), format); + + public static char GetChar(this JsonElement element) + { + if (element.ValueKind == JsonValueKind.String) + { + var text = element.GetString(); + if (text == null || text.Length != 1) + { + throw new NotSupportedException($"Cannot convert \"{text}\" to a char"); + } + return text[0]; + } + else + { + throw new NotSupportedException($"Cannot convert {element.ValueKind} to a char"); + } + } + + [Conditional("DEBUG")] + public static void ThrowNonNullablePropertyIsNull(this JsonProperty property) + { + throw new JsonException($"A property '{property.Name}' defined as non-nullable but received as null from the service. This exception only happens in DEBUG builds of the library and would be ignored in the release build"); + } + + public static string GetRequiredString(this JsonElement element) + { + var value = element.GetString(); + if (value == null) + { + throw new InvalidOperationException($"The requested operation requires an element of type 'String', but the target element has type '{element.ValueKind}'."); + } + return value; + } + + public static void WriteStringValue(this Utf8JsonWriter writer, DateTimeOffset value, string format) + { + writer.WriteStringValue(TypeFormatters.ToString(value, format)); + } + + public static void WriteStringValue(this Utf8JsonWriter writer, DateTime value, string format) + { + writer.WriteStringValue(TypeFormatters.ToString(value, format)); + } + + public static void WriteStringValue(this Utf8JsonWriter writer, TimeSpan value, string format) + { + writer.WriteStringValue(TypeFormatters.ToString(value, format)); + } + + public static void WriteStringValue(this Utf8JsonWriter writer, char value) + { + writer.WriteStringValue(value.ToString(CultureInfo.InvariantCulture)); + } + + public static void WriteBase64StringValue(this Utf8JsonWriter writer, byte[] value, string format) + { + if (value == null) + { + writer.WriteNullValue(); + return; + } + switch (format) + { + case "U": + writer.WriteStringValue(TypeFormatters.ToBase64UrlString(value)); + break; + case "D": + writer.WriteBase64StringValue(value); + break; + default: + throw new ArgumentException($"Format is not supported: '{format}'", nameof(format)); + } + } + + public static void WriteNumberValue(this Utf8JsonWriter writer, DateTimeOffset value, string format) + { + if (format != "U") + { + throw new ArgumentOutOfRangeException(nameof(format), "Only 'U' format is supported when writing a DateTimeOffset as a Number."); + } + writer.WriteNumberValue(value.ToUnixTimeSeconds()); + } + + public static void WriteObjectValue(this Utf8JsonWriter writer, T value, ModelReaderWriterOptions options = null) + { + switch (value) + { + case null: + writer.WriteNullValue(); + break; + case IJsonModel jsonModel: + jsonModel.Write(writer, options ?? WireOptions); + break; + case IUtf8JsonSerializable serializable: + serializable.Write(writer); + break; + case byte[] bytes: + writer.WriteBase64StringValue(bytes); + break; + case BinaryData bytes0: + writer.WriteBase64StringValue(bytes0); + break; + case JsonElement json: + json.WriteTo(writer); + break; + case int i: + writer.WriteNumberValue(i); + break; + case decimal d: + writer.WriteNumberValue(d); + break; + case double d0: + if (double.IsNaN(d0)) + { + writer.WriteStringValue("NaN"); + } + else + { + writer.WriteNumberValue(d0); + } + break; + case float f: + writer.WriteNumberValue(f); + break; + case long l: + writer.WriteNumberValue(l); + break; + case string s: + writer.WriteStringValue(s); + break; + case bool b: + writer.WriteBooleanValue(b); + break; + case Guid g: + writer.WriteStringValue(g); + break; + case DateTimeOffset dateTimeOffset: + writer.WriteStringValue(dateTimeOffset, "O"); + break; + case DateTime dateTime: + writer.WriteStringValue(dateTime, "O"); + break; + case IEnumerable> enumerable: + writer.WriteStartObject(); + foreach (var pair in enumerable) + { + writer.WritePropertyName(pair.Key); + writer.WriteObjectValue(pair.Value, options); + } + writer.WriteEndObject(); + break; + case IEnumerable objectEnumerable: + writer.WriteStartArray(); + foreach (var item in objectEnumerable) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + break; + case TimeSpan timeSpan: + writer.WriteStringValue(timeSpan, "P"); + break; + default: + throw new NotSupportedException($"Not supported type {value.GetType()}"); + } + } + + public static void WriteObjectValue(this Utf8JsonWriter writer, object value, ModelReaderWriterOptions options = null) + { + writer.WriteObjectValue(value, options); + } + + internal static class TypeFormatters + { + private const string RoundtripZFormat = "yyyy-MM-ddTHH:mm:ss.fffffffZ"; + public const string DefaultNumberFormat = "G"; + + public static string ToString(bool value) => value ? "true" : "false"; + + public static string ToString(DateTime value, string format) => value.Kind switch + { + DateTimeKind.Utc => ToString((DateTimeOffset)value, format), + _ => throw new NotSupportedException($"DateTime {value} has a Kind of {value.Kind}. Azure SDK requires it to be UTC. You can call DateTime.SpecifyKind to change Kind property value to DateTimeKind.Utc.") + }; + + public static string ToString(DateTimeOffset value, string format) => format switch + { + "D" => value.ToString("yyyy-MM-dd", CultureInfo.InvariantCulture), + "U" => value.ToUnixTimeSeconds().ToString(CultureInfo.InvariantCulture), + "O" => value.ToUniversalTime().ToString(RoundtripZFormat, CultureInfo.InvariantCulture), + "o" => value.ToUniversalTime().ToString(RoundtripZFormat, CultureInfo.InvariantCulture), + "R" => value.ToString("r", CultureInfo.InvariantCulture), + _ => value.ToString(format, CultureInfo.InvariantCulture) + }; + + public static string ToString(TimeSpan value, string format) => format switch + { + "P" => XmlConvert.ToString(value), + _ => value.ToString(format, CultureInfo.InvariantCulture) + }; + + public static string ToString(byte[] value, string format) => format switch + { + "U" => ToBase64UrlString(value), + "D" => Convert.ToBase64String(value), + _ => throw new ArgumentException($"Format is not supported: '{format}'", nameof(format)) + }; + + public static string ToBase64UrlString(byte[] value) + { + int numWholeOrPartialInputBlocks = checked(value.Length + 2) / 3; + int size = checked(numWholeOrPartialInputBlocks * 4); + char[] output = new char[size]; + + int numBase64Chars = Convert.ToBase64CharArray(value, 0, value.Length, output, 0); + + int i = 0; + for (; i < numBase64Chars; i++) + { + char ch = output[i]; + if (ch == '+') + { + output[i] = '-'; + } + else + { + if (ch == '/') + { + output[i] = '_'; + } + else + { + if (ch == '=') + { + break; + } + } + } + } + + return new string(output, 0, i); + } + + public static byte[] FromBase64UrlString(string value) + { + int paddingCharsToAdd = (value.Length % 4) switch + { + 0 => 0, + 2 => 2, + 3 => 1, + _ => throw new InvalidOperationException("Malformed input") + }; + char[] output = new char[(value.Length + paddingCharsToAdd)]; + int i = 0; + for (; i < value.Length; i++) + { + char ch = value[i]; + if (ch == '-') + { + output[i] = '+'; + } + else + { + if (ch == '_') + { + output[i] = '/'; + } + else + { + output[i] = ch; + } + } + } + + for (; i < output.Length; i++) + { + output[i] = '='; + } + + return Convert.FromBase64CharArray(output, 0, output.Length); + } + + public static DateTimeOffset ParseDateTimeOffset(string value, string format) => format switch + { + "U" => DateTimeOffset.FromUnixTimeSeconds(long.Parse(value, CultureInfo.InvariantCulture)), + _ => DateTimeOffset.Parse(value, CultureInfo.InvariantCulture, DateTimeStyles.AssumeUniversal) + }; + + public static TimeSpan ParseTimeSpan(string value, string format) => format switch + { + "P" => XmlConvert.ToTimeSpan(value), + _ => TimeSpan.ParseExact(value, format, CultureInfo.InvariantCulture) + }; + + public static string ConvertToString(object value, string format = null) => value switch + { + null => "null", + string s => s, + bool b => ToString(b), + int or float or double or long or decimal => ((IFormattable)value).ToString(DefaultNumberFormat, CultureInfo.InvariantCulture), + byte[] b0 when format != null => ToString(b0, format), + IEnumerable s0 => string.Join(",", s0), + DateTimeOffset dateTime when format != null => ToString(dateTime, format), + TimeSpan timeSpan when format != null => ToString(timeSpan, format), + TimeSpan timeSpan0 => XmlConvert.ToString(timeSpan0), + Guid guid => guid.ToString(), + BinaryData binaryData => ConvertToString(binaryData.ToArray(), format), + _ => value.ToString() + }; + } + } +} diff --git a/sdk/edgeworkloadsecurity/Azure.ResourceManager.SecretsStoreExtension/src/Generated/Internal/Optional.cs b/sdk/edgeworkloadsecurity/Azure.ResourceManager.SecretsStoreExtension/src/Generated/Internal/Optional.cs new file mode 100644 index 000000000000..644b867699a9 --- /dev/null +++ b/sdk/edgeworkloadsecurity/Azure.ResourceManager.SecretsStoreExtension/src/Generated/Internal/Optional.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; + +namespace Azure.ResourceManager.SecretsStoreExtension +{ + internal static class Optional + { + public static bool IsCollectionDefined(IEnumerable collection) + { + return !(collection is ChangeTrackingList changeTrackingList && changeTrackingList.IsUndefined); + } + + public static bool IsCollectionDefined(IDictionary collection) + { + return !(collection is ChangeTrackingDictionary changeTrackingDictionary && changeTrackingDictionary.IsUndefined); + } + + public static bool IsCollectionDefined(IReadOnlyDictionary collection) + { + return !(collection is ChangeTrackingDictionary changeTrackingDictionary && changeTrackingDictionary.IsUndefined); + } + + public static bool IsDefined(T? value) + where T : struct + { + return value.HasValue; + } + + public static bool IsDefined(object value) + { + return value != null; + } + + public static bool IsDefined(JsonElement value) + { + return value.ValueKind != JsonValueKind.Undefined; + } + + public static bool IsDefined(string value) + { + return value != null; + } + } +} diff --git a/sdk/edgeworkloadsecurity/Azure.ResourceManager.SecretsStoreExtension/src/Generated/Internal/Utf8JsonRequestContent.cs b/sdk/edgeworkloadsecurity/Azure.ResourceManager.SecretsStoreExtension/src/Generated/Internal/Utf8JsonRequestContent.cs new file mode 100644 index 000000000000..22b3c476099e --- /dev/null +++ b/sdk/edgeworkloadsecurity/Azure.ResourceManager.SecretsStoreExtension/src/Generated/Internal/Utf8JsonRequestContent.cs @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.IO; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; + +namespace Azure.ResourceManager.SecretsStoreExtension +{ + internal class Utf8JsonRequestContent : RequestContent + { + private readonly MemoryStream _stream; + private readonly RequestContent _content; + + public Utf8JsonRequestContent() + { + _stream = new MemoryStream(); + _content = Create(_stream); + JsonWriter = new Utf8JsonWriter(_stream); + } + + public Utf8JsonWriter JsonWriter { get; } + + public override async Task WriteToAsync(Stream stream, CancellationToken cancellationToken = default) + { + await JsonWriter.FlushAsync().ConfigureAwait(false); + await _content.WriteToAsync(stream, cancellationToken).ConfigureAwait(false); + } + + public override void WriteTo(Stream stream, CancellationToken cancellationToken = default) + { + JsonWriter.Flush(); + _content.WriteTo(stream, cancellationToken); + } + + public override bool TryComputeLength(out long length) + { + length = JsonWriter.BytesCommitted + JsonWriter.BytesPending; + return true; + } + + public override void Dispose() + { + JsonWriter.Dispose(); + _content.Dispose(); + _stream.Dispose(); + } + } +} diff --git a/sdk/edgeworkloadsecurity/Azure.ResourceManager.SecretsStoreExtension/src/Generated/LongRunningOperation/AzureKeyVaultSecretProviderClassOperationSource.cs b/sdk/edgeworkloadsecurity/Azure.ResourceManager.SecretsStoreExtension/src/Generated/LongRunningOperation/AzureKeyVaultSecretProviderClassOperationSource.cs new file mode 100644 index 000000000000..9c59c8228047 --- /dev/null +++ b/sdk/edgeworkloadsecurity/Azure.ResourceManager.SecretsStoreExtension/src/Generated/LongRunningOperation/AzureKeyVaultSecretProviderClassOperationSource.cs @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; + +namespace Azure.ResourceManager.SecretsStoreExtension +{ + internal class AzureKeyVaultSecretProviderClassOperationSource : IOperationSource + { + private readonly ArmClient _client; + + internal AzureKeyVaultSecretProviderClassOperationSource(ArmClient client) + { + _client = client; + } + + AzureKeyVaultSecretProviderClassResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) + { + using var document = JsonDocument.Parse(response.ContentStream); + var data = AzureKeyVaultSecretProviderClassData.DeserializeAzureKeyVaultSecretProviderClassData(document.RootElement); + return new AzureKeyVaultSecretProviderClassResource(_client, data); + } + + async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) + { + using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false); + var data = AzureKeyVaultSecretProviderClassData.DeserializeAzureKeyVaultSecretProviderClassData(document.RootElement); + return new AzureKeyVaultSecretProviderClassResource(_client, data); + } + } +} diff --git a/sdk/edgeworkloadsecurity/Azure.ResourceManager.SecretsStoreExtension/src/Generated/LongRunningOperation/SecretSyncOperationSource.cs b/sdk/edgeworkloadsecurity/Azure.ResourceManager.SecretsStoreExtension/src/Generated/LongRunningOperation/SecretSyncOperationSource.cs new file mode 100644 index 000000000000..b59c659e70ba --- /dev/null +++ b/sdk/edgeworkloadsecurity/Azure.ResourceManager.SecretsStoreExtension/src/Generated/LongRunningOperation/SecretSyncOperationSource.cs @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; + +namespace Azure.ResourceManager.SecretsStoreExtension +{ + internal class SecretSyncOperationSource : IOperationSource + { + private readonly ArmClient _client; + + internal SecretSyncOperationSource(ArmClient client) + { + _client = client; + } + + SecretSyncResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) + { + using var document = JsonDocument.Parse(response.ContentStream); + var data = SecretSyncData.DeserializeSecretSyncData(document.RootElement); + return new SecretSyncResource(_client, data); + } + + async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) + { + using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false); + var data = SecretSyncData.DeserializeSecretSyncData(document.RootElement); + return new SecretSyncResource(_client, data); + } + } +} diff --git a/sdk/edgeworkloadsecurity/Azure.ResourceManager.SecretsStoreExtension/src/Generated/LongRunningOperation/SecretsStoreExtensionArmOperation.cs b/sdk/edgeworkloadsecurity/Azure.ResourceManager.SecretsStoreExtension/src/Generated/LongRunningOperation/SecretsStoreExtensionArmOperation.cs new file mode 100644 index 000000000000..27aad176952b --- /dev/null +++ b/sdk/edgeworkloadsecurity/Azure.ResourceManager.SecretsStoreExtension/src/Generated/LongRunningOperation/SecretsStoreExtensionArmOperation.cs @@ -0,0 +1,94 @@ +// 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.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.SecretsStoreExtension +{ +#pragma warning disable SA1649 // File name should match first type name + internal class SecretsStoreExtensionArmOperation : ArmOperation +#pragma warning restore SA1649 // File name should match first type name + { + private readonly OperationInternal _operation; + private readonly RehydrationToken? _completeRehydrationToken; + private readonly NextLinkOperationImplementation _nextLinkOperation; + private readonly string _operationId; + + /// Initializes a new instance of SecretsStoreExtensionArmOperation for mocking. + protected SecretsStoreExtensionArmOperation() + { + } + + internal SecretsStoreExtensionArmOperation(Response response, RehydrationToken? rehydrationToken = null) + { + _operation = OperationInternal.Succeeded(response); + _completeRehydrationToken = rehydrationToken; + _operationId = GetOperationId(rehydrationToken); + } + + internal SecretsStoreExtensionArmOperation(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, Request request, Response response, OperationFinalStateVia finalStateVia, bool skipApiVersionOverride = false, string apiVersionOverrideValue = null) + { + var nextLinkOperation = NextLinkOperationImplementation.Create(pipeline, request.Method, request.Uri.ToUri(), response, finalStateVia, skipApiVersionOverride, apiVersionOverrideValue); + if (nextLinkOperation is NextLinkOperationImplementation nextLinkOperationValue) + { + _nextLinkOperation = nextLinkOperationValue; + _operationId = _nextLinkOperation.OperationId; + } + else + { + _completeRehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(request.Method, request.Uri.ToUri(), response, finalStateVia); + _operationId = GetOperationId(_completeRehydrationToken); + } + _operation = new OperationInternal(nextLinkOperation, clientDiagnostics, response, "SecretsStoreExtensionArmOperation", fallbackStrategy: new SequentialDelayStrategy()); + } + + private string GetOperationId(RehydrationToken? rehydrationToken) + { + if (rehydrationToken is null) + { + return null; + } + var lroDetails = ModelReaderWriter.Write(rehydrationToken, ModelReaderWriterOptions.Json).ToObjectFromJson>(); + return lroDetails["id"]; + } + /// + public override string Id => _operationId ?? NextLinkOperationImplementation.NotSet; + + /// + public override RehydrationToken? GetRehydrationToken() => _nextLinkOperation?.GetRehydrationToken() ?? _completeRehydrationToken; + + /// + public override bool HasCompleted => _operation.HasCompleted; + + /// + public override Response GetRawResponse() => _operation.RawResponse; + + /// + public override Response UpdateStatus(CancellationToken cancellationToken = default) => _operation.UpdateStatus(cancellationToken); + + /// + public override ValueTask UpdateStatusAsync(CancellationToken cancellationToken = default) => _operation.UpdateStatusAsync(cancellationToken); + + /// + public override Response WaitForCompletionResponse(CancellationToken cancellationToken = default) => _operation.WaitForCompletionResponse(cancellationToken); + + /// + public override Response WaitForCompletionResponse(TimeSpan pollingInterval, CancellationToken cancellationToken = default) => _operation.WaitForCompletionResponse(pollingInterval, cancellationToken); + + /// + public override ValueTask WaitForCompletionResponseAsync(CancellationToken cancellationToken = default) => _operation.WaitForCompletionResponseAsync(cancellationToken); + + /// + public override ValueTask WaitForCompletionResponseAsync(TimeSpan pollingInterval, CancellationToken cancellationToken = default) => _operation.WaitForCompletionResponseAsync(pollingInterval, cancellationToken); + } +} diff --git a/sdk/edgeworkloadsecurity/Azure.ResourceManager.SecretsStoreExtension/src/Generated/LongRunningOperation/SecretsStoreExtensionArmOperationOfT.cs b/sdk/edgeworkloadsecurity/Azure.ResourceManager.SecretsStoreExtension/src/Generated/LongRunningOperation/SecretsStoreExtensionArmOperationOfT.cs new file mode 100644 index 000000000000..f4bf9be94add --- /dev/null +++ b/sdk/edgeworkloadsecurity/Azure.ResourceManager.SecretsStoreExtension/src/Generated/LongRunningOperation/SecretsStoreExtensionArmOperationOfT.cs @@ -0,0 +1,100 @@ +// 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.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.SecretsStoreExtension +{ +#pragma warning disable SA1649 // File name should match first type name + internal class SecretsStoreExtensionArmOperation : ArmOperation +#pragma warning restore SA1649 // File name should match first type name + { + private readonly OperationInternal _operation; + private readonly RehydrationToken? _completeRehydrationToken; + private readonly NextLinkOperationImplementation _nextLinkOperation; + private readonly string _operationId; + + /// Initializes a new instance of SecretsStoreExtensionArmOperation for mocking. + protected SecretsStoreExtensionArmOperation() + { + } + + internal SecretsStoreExtensionArmOperation(Response response, RehydrationToken? rehydrationToken = null) + { + _operation = OperationInternal.Succeeded(response.GetRawResponse(), response.Value); + _completeRehydrationToken = rehydrationToken; + _operationId = GetOperationId(rehydrationToken); + } + + internal SecretsStoreExtensionArmOperation(IOperationSource source, ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, Request request, Response response, OperationFinalStateVia finalStateVia, bool skipApiVersionOverride = false, string apiVersionOverrideValue = null) + { + var nextLinkOperation = NextLinkOperationImplementation.Create(pipeline, request.Method, request.Uri.ToUri(), response, finalStateVia, skipApiVersionOverride, apiVersionOverrideValue); + if (nextLinkOperation is NextLinkOperationImplementation nextLinkOperationValue) + { + _nextLinkOperation = nextLinkOperationValue; + _operationId = _nextLinkOperation.OperationId; + } + else + { + _completeRehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(request.Method, request.Uri.ToUri(), response, finalStateVia); + _operationId = GetOperationId(_completeRehydrationToken); + } + _operation = new OperationInternal(NextLinkOperationImplementation.Create(source, nextLinkOperation), clientDiagnostics, response, "SecretsStoreExtensionArmOperation", fallbackStrategy: new SequentialDelayStrategy()); + } + + private string GetOperationId(RehydrationToken? rehydrationToken) + { + if (rehydrationToken is null) + { + return null; + } + var lroDetails = ModelReaderWriter.Write(rehydrationToken, ModelReaderWriterOptions.Json).ToObjectFromJson>(); + return lroDetails["id"]; + } + /// + public override string Id => _operationId ?? NextLinkOperationImplementation.NotSet; + + /// + public override RehydrationToken? GetRehydrationToken() => _nextLinkOperation?.GetRehydrationToken() ?? _completeRehydrationToken; + + /// + public override T Value => _operation.Value; + + /// + public override bool HasValue => _operation.HasValue; + + /// + public override bool HasCompleted => _operation.HasCompleted; + + /// + public override Response GetRawResponse() => _operation.RawResponse; + + /// + public override Response UpdateStatus(CancellationToken cancellationToken = default) => _operation.UpdateStatus(cancellationToken); + + /// + public override ValueTask UpdateStatusAsync(CancellationToken cancellationToken = default) => _operation.UpdateStatusAsync(cancellationToken); + + /// + public override Response WaitForCompletion(CancellationToken cancellationToken = default) => _operation.WaitForCompletion(cancellationToken); + + /// + public override Response WaitForCompletion(TimeSpan pollingInterval, CancellationToken cancellationToken = default) => _operation.WaitForCompletion(pollingInterval, cancellationToken); + + /// + public override ValueTask> WaitForCompletionAsync(CancellationToken cancellationToken = default) => _operation.WaitForCompletionAsync(cancellationToken); + + /// + public override ValueTask> WaitForCompletionAsync(TimeSpan pollingInterval, CancellationToken cancellationToken = default) => _operation.WaitForCompletionAsync(pollingInterval, cancellationToken); + } +} diff --git a/sdk/edgeworkloadsecurity/Azure.ResourceManager.SecretsStoreExtension/src/Generated/Models/AzureKeyVaultSecretProviderClassListResult.Serialization.cs b/sdk/edgeworkloadsecurity/Azure.ResourceManager.SecretsStoreExtension/src/Generated/Models/AzureKeyVaultSecretProviderClassListResult.Serialization.cs new file mode 100644 index 000000000000..bf215f6ba359 --- /dev/null +++ b/sdk/edgeworkloadsecurity/Azure.ResourceManager.SecretsStoreExtension/src/Generated/Models/AzureKeyVaultSecretProviderClassListResult.Serialization.cs @@ -0,0 +1,151 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.SecretsStoreExtension.Models +{ + internal partial class AzureKeyVaultSecretProviderClassListResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AzureKeyVaultSecretProviderClassListResult)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var item in Value) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + if (Optional.IsDefined(NextLink)) + { + writer.WritePropertyName("nextLink"u8); + writer.WriteStringValue(NextLink.AbsoluteUri); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + AzureKeyVaultSecretProviderClassListResult 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(AzureKeyVaultSecretProviderClassListResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAzureKeyVaultSecretProviderClassListResult(document.RootElement, options); + } + + internal static AzureKeyVaultSecretProviderClassListResult DeserializeAzureKeyVaultSecretProviderClassListResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IReadOnlyList value = default; + Uri nextLink = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(AzureKeyVaultSecretProviderClassData.DeserializeAzureKeyVaultSecretProviderClassData(item, options)); + } + value = array; + continue; + } + if (property.NameEquals("nextLink"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + nextLink = new Uri(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new AzureKeyVaultSecretProviderClassListResult(value, nextLink, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(AzureKeyVaultSecretProviderClassListResult)} does not support writing '{options.Format}' format."); + } + } + + AzureKeyVaultSecretProviderClassListResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeAzureKeyVaultSecretProviderClassListResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(AzureKeyVaultSecretProviderClassListResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/edgeworkloadsecurity/Azure.ResourceManager.SecretsStoreExtension/src/Generated/Models/AzureKeyVaultSecretProviderClassListResult.cs b/sdk/edgeworkloadsecurity/Azure.ResourceManager.SecretsStoreExtension/src/Generated/Models/AzureKeyVaultSecretProviderClassListResult.cs new file mode 100644 index 000000000000..8756936be78d --- /dev/null +++ b/sdk/edgeworkloadsecurity/Azure.ResourceManager.SecretsStoreExtension/src/Generated/Models/AzureKeyVaultSecretProviderClassListResult.cs @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.ResourceManager.SecretsStoreExtension.Models +{ + /// The response of a AzureKeyVaultSecretProviderClass list operation. + internal partial class AzureKeyVaultSecretProviderClassListResult + { + /// + /// 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 AzureKeyVaultSecretProviderClass items on this page. + /// is null. + internal AzureKeyVaultSecretProviderClassListResult(IEnumerable value) + { + Argument.AssertNotNull(value, nameof(value)); + + Value = value.ToList(); + } + + /// Initializes a new instance of . + /// The AzureKeyVaultSecretProviderClass items on this page. + /// The link to the next page of items. + /// Keeps track of any properties unknown to the library. + internal AzureKeyVaultSecretProviderClassListResult(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) + { + Value = value; + NextLink = nextLink; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal AzureKeyVaultSecretProviderClassListResult() + { + } + + /// The AzureKeyVaultSecretProviderClass items on this page. + public IReadOnlyList Value { get; } + /// The link to the next page of items. + public Uri NextLink { get; } + } +} diff --git a/sdk/edgeworkloadsecurity/Azure.ResourceManager.SecretsStoreExtension/src/Generated/Models/AzureKeyVaultSecretProviderClassPatch.Serialization.cs b/sdk/edgeworkloadsecurity/Azure.ResourceManager.SecretsStoreExtension/src/Generated/Models/AzureKeyVaultSecretProviderClassPatch.Serialization.cs new file mode 100644 index 000000000000..03b818f2bbf3 --- /dev/null +++ b/sdk/edgeworkloadsecurity/Azure.ResourceManager.SecretsStoreExtension/src/Generated/Models/AzureKeyVaultSecretProviderClassPatch.Serialization.cs @@ -0,0 +1,159 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.SecretsStoreExtension.Models +{ + public partial class AzureKeyVaultSecretProviderClassPatch : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AzureKeyVaultSecretProviderClassPatch)} does not support writing '{format}' format."); + } + + if (Optional.IsCollectionDefined(Tags)) + { + writer.WritePropertyName("tags"u8); + writer.WriteStartObject(); + foreach (var item in Tags) + { + writer.WritePropertyName(item.Key); + writer.WriteStringValue(item.Value); + } + writer.WriteEndObject(); + } + if (Optional.IsDefined(Properties)) + { + writer.WritePropertyName("properties"u8); + writer.WriteObjectValue(Properties, options); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + AzureKeyVaultSecretProviderClassPatch 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(AzureKeyVaultSecretProviderClassPatch)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAzureKeyVaultSecretProviderClassPatch(document.RootElement, options); + } + + internal static AzureKeyVaultSecretProviderClassPatch DeserializeAzureKeyVaultSecretProviderClassPatch(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IDictionary tags = default; + AzureKeyVaultSecretProviderClassUpdateProperties properties = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("tags"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var property0 in property.Value.EnumerateObject()) + { + dictionary.Add(property0.Name, property0.Value.GetString()); + } + tags = dictionary; + continue; + } + if (property.NameEquals("properties"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + properties = AzureKeyVaultSecretProviderClassUpdateProperties.DeserializeAzureKeyVaultSecretProviderClassUpdateProperties(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new AzureKeyVaultSecretProviderClassPatch(tags ?? new ChangeTrackingDictionary(), 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(AzureKeyVaultSecretProviderClassPatch)} does not support writing '{options.Format}' format."); + } + } + + AzureKeyVaultSecretProviderClassPatch IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeAzureKeyVaultSecretProviderClassPatch(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(AzureKeyVaultSecretProviderClassPatch)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/edgeworkloadsecurity/Azure.ResourceManager.SecretsStoreExtension/src/Generated/Models/AzureKeyVaultSecretProviderClassPatch.cs b/sdk/edgeworkloadsecurity/Azure.ResourceManager.SecretsStoreExtension/src/Generated/Models/AzureKeyVaultSecretProviderClassPatch.cs new file mode 100644 index 000000000000..9816d553cdd3 --- /dev/null +++ b/sdk/edgeworkloadsecurity/Azure.ResourceManager.SecretsStoreExtension/src/Generated/Models/AzureKeyVaultSecretProviderClassPatch.cs @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.SecretsStoreExtension.Models +{ + /// The type used for update operations of the AzureKeyVaultSecretProviderClass. + public partial class AzureKeyVaultSecretProviderClassPatch + { + /// + /// 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 AzureKeyVaultSecretProviderClassPatch() + { + Tags = new ChangeTrackingDictionary(); + } + + /// Initializes a new instance of . + /// Resource tags. + /// The resource-specific properties for this resource. + /// Keeps track of any properties unknown to the library. + internal AzureKeyVaultSecretProviderClassPatch(IDictionary tags, AzureKeyVaultSecretProviderClassUpdateProperties properties, IDictionary serializedAdditionalRawData) + { + Tags = tags; + Properties = properties; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Resource tags. + public IDictionary Tags { get; } + /// The resource-specific properties for this resource. + public AzureKeyVaultSecretProviderClassUpdateProperties Properties { get; set; } + } +} diff --git a/sdk/edgeworkloadsecurity/Azure.ResourceManager.SecretsStoreExtension/src/Generated/Models/AzureKeyVaultSecretProviderClassProperties.Serialization.cs b/sdk/edgeworkloadsecurity/Azure.ResourceManager.SecretsStoreExtension/src/Generated/Models/AzureKeyVaultSecretProviderClassProperties.Serialization.cs new file mode 100644 index 000000000000..1982d325cc55 --- /dev/null +++ b/sdk/edgeworkloadsecurity/Azure.ResourceManager.SecretsStoreExtension/src/Generated/Models/AzureKeyVaultSecretProviderClassProperties.Serialization.cs @@ -0,0 +1,174 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.SecretsStoreExtension.Models +{ + public partial class AzureKeyVaultSecretProviderClassProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AzureKeyVaultSecretProviderClassProperties)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("keyvaultName"u8); + writer.WriteStringValue(KeyvaultName); + writer.WritePropertyName("clientId"u8); + writer.WriteStringValue(ClientId); + writer.WritePropertyName("tenantId"u8); + writer.WriteStringValue(TenantId); + if (Optional.IsDefined(Objects)) + { + writer.WritePropertyName("objects"u8); + writer.WriteStringValue(Objects); + } + if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) + { + writer.WritePropertyName("provisioningState"u8); + writer.WriteStringValue(ProvisioningState.Value.ToString()); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + AzureKeyVaultSecretProviderClassProperties 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(AzureKeyVaultSecretProviderClassProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAzureKeyVaultSecretProviderClassProperties(document.RootElement, options); + } + + internal static AzureKeyVaultSecretProviderClassProperties DeserializeAzureKeyVaultSecretProviderClassProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string keyvaultName = default; + string clientId = default; + string tenantId = default; + string objects = default; + ProvisioningState? provisioningState = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("keyvaultName"u8)) + { + keyvaultName = property.Value.GetString(); + continue; + } + if (property.NameEquals("clientId"u8)) + { + clientId = property.Value.GetString(); + continue; + } + if (property.NameEquals("tenantId"u8)) + { + tenantId = property.Value.GetString(); + continue; + } + if (property.NameEquals("objects"u8)) + { + objects = property.Value.GetString(); + continue; + } + if (property.NameEquals("provisioningState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + provisioningState = new ProvisioningState(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new AzureKeyVaultSecretProviderClassProperties( + keyvaultName, + clientId, + tenantId, + objects, + provisioningState, + 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(AzureKeyVaultSecretProviderClassProperties)} does not support writing '{options.Format}' format."); + } + } + + AzureKeyVaultSecretProviderClassProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeAzureKeyVaultSecretProviderClassProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(AzureKeyVaultSecretProviderClassProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/edgeworkloadsecurity/Azure.ResourceManager.SecretsStoreExtension/src/Generated/Models/AzureKeyVaultSecretProviderClassProperties.cs b/sdk/edgeworkloadsecurity/Azure.ResourceManager.SecretsStoreExtension/src/Generated/Models/AzureKeyVaultSecretProviderClassProperties.cs new file mode 100644 index 000000000000..4f5aa33eac3e --- /dev/null +++ b/sdk/edgeworkloadsecurity/Azure.ResourceManager.SecretsStoreExtension/src/Generated/Models/AzureKeyVaultSecretProviderClassProperties.cs @@ -0,0 +1,97 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.SecretsStoreExtension.Models +{ + /// The properties of the AzureKeyVaultSecretProviderClass. + public partial class AzureKeyVaultSecretProviderClassProperties + { + /// + /// 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 name of the Azure Key Vault to sync secrets from. + /// The user assigned managed identity client ID that should be used to access the Azure Key Vault. + /// The Azure Active Directory tenant ID that should be used for authenticating requests to the Azure Key Vault. + /// , or is null. + public AzureKeyVaultSecretProviderClassProperties(string keyvaultName, string clientId, string tenantId) + { + Argument.AssertNotNull(keyvaultName, nameof(keyvaultName)); + Argument.AssertNotNull(clientId, nameof(clientId)); + Argument.AssertNotNull(tenantId, nameof(tenantId)); + + KeyvaultName = keyvaultName; + ClientId = clientId; + TenantId = tenantId; + } + + /// Initializes a new instance of . + /// The name of the Azure Key Vault to sync secrets from. + /// The user assigned managed identity client ID that should be used to access the Azure Key Vault. + /// The Azure Active Directory tenant ID that should be used for authenticating requests to the Azure Key Vault. + /// Objects defines the desired state of synced K8s secret objects. + /// Provisioning state of the AzureKeyVaultSecretProviderClass instance. + /// Keeps track of any properties unknown to the library. + internal AzureKeyVaultSecretProviderClassProperties(string keyvaultName, string clientId, string tenantId, string objects, ProvisioningState? provisioningState, IDictionary serializedAdditionalRawData) + { + KeyvaultName = keyvaultName; + ClientId = clientId; + TenantId = tenantId; + Objects = objects; + ProvisioningState = provisioningState; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal AzureKeyVaultSecretProviderClassProperties() + { + } + + /// The name of the Azure Key Vault to sync secrets from. + public string KeyvaultName { get; set; } + /// The user assigned managed identity client ID that should be used to access the Azure Key Vault. + public string ClientId { get; set; } + /// The Azure Active Directory tenant ID that should be used for authenticating requests to the Azure Key Vault. + public string TenantId { get; set; } + /// Objects defines the desired state of synced K8s secret objects. + public string Objects { get; set; } + /// Provisioning state of the AzureKeyVaultSecretProviderClass instance. + public ProvisioningState? ProvisioningState { get; } + } +} diff --git a/sdk/edgeworkloadsecurity/Azure.ResourceManager.SecretsStoreExtension/src/Generated/Models/AzureKeyVaultSecretProviderClassUpdateProperties.Serialization.cs b/sdk/edgeworkloadsecurity/Azure.ResourceManager.SecretsStoreExtension/src/Generated/Models/AzureKeyVaultSecretProviderClassUpdateProperties.Serialization.cs new file mode 100644 index 000000000000..a67de0029f25 --- /dev/null +++ b/sdk/edgeworkloadsecurity/Azure.ResourceManager.SecretsStoreExtension/src/Generated/Models/AzureKeyVaultSecretProviderClassUpdateProperties.Serialization.cs @@ -0,0 +1,162 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.SecretsStoreExtension.Models +{ + public partial class AzureKeyVaultSecretProviderClassUpdateProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AzureKeyVaultSecretProviderClassUpdateProperties)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(KeyvaultName)) + { + writer.WritePropertyName("keyvaultName"u8); + writer.WriteStringValue(KeyvaultName); + } + if (Optional.IsDefined(ClientId)) + { + writer.WritePropertyName("clientId"u8); + writer.WriteStringValue(ClientId); + } + if (Optional.IsDefined(TenantId)) + { + writer.WritePropertyName("tenantId"u8); + writer.WriteStringValue(TenantId); + } + if (Optional.IsDefined(Objects)) + { + writer.WritePropertyName("objects"u8); + writer.WriteStringValue(Objects); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + AzureKeyVaultSecretProviderClassUpdateProperties 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(AzureKeyVaultSecretProviderClassUpdateProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAzureKeyVaultSecretProviderClassUpdateProperties(document.RootElement, options); + } + + internal static AzureKeyVaultSecretProviderClassUpdateProperties DeserializeAzureKeyVaultSecretProviderClassUpdateProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string keyvaultName = default; + string clientId = default; + string tenantId = default; + string objects = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("keyvaultName"u8)) + { + keyvaultName = property.Value.GetString(); + continue; + } + if (property.NameEquals("clientId"u8)) + { + clientId = property.Value.GetString(); + continue; + } + if (property.NameEquals("tenantId"u8)) + { + tenantId = property.Value.GetString(); + continue; + } + if (property.NameEquals("objects"u8)) + { + objects = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new AzureKeyVaultSecretProviderClassUpdateProperties(keyvaultName, clientId, tenantId, objects, 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(AzureKeyVaultSecretProviderClassUpdateProperties)} does not support writing '{options.Format}' format."); + } + } + + AzureKeyVaultSecretProviderClassUpdateProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeAzureKeyVaultSecretProviderClassUpdateProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(AzureKeyVaultSecretProviderClassUpdateProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/edgeworkloadsecurity/Azure.ResourceManager.SecretsStoreExtension/src/Generated/Models/AzureKeyVaultSecretProviderClassUpdateProperties.cs b/sdk/edgeworkloadsecurity/Azure.ResourceManager.SecretsStoreExtension/src/Generated/Models/AzureKeyVaultSecretProviderClassUpdateProperties.cs new file mode 100644 index 000000000000..8871ec453a6f --- /dev/null +++ b/sdk/edgeworkloadsecurity/Azure.ResourceManager.SecretsStoreExtension/src/Generated/Models/AzureKeyVaultSecretProviderClassUpdateProperties.cs @@ -0,0 +1,77 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.SecretsStoreExtension.Models +{ + /// The updatable properties of the AzureKeyVaultSecretProviderClass. + public partial class AzureKeyVaultSecretProviderClassUpdateProperties + { + /// + /// 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 AzureKeyVaultSecretProviderClassUpdateProperties() + { + } + + /// Initializes a new instance of . + /// The name of the Azure Key Vault to sync secrets from. + /// The user assigned managed identity client ID that should be used to access the Azure Key Vault. + /// The Azure Active Directory tenant ID that should be used for authenticating requests to the Azure Key Vault. + /// Objects defines the desired state of synced K8s secret objects. + /// Keeps track of any properties unknown to the library. + internal AzureKeyVaultSecretProviderClassUpdateProperties(string keyvaultName, string clientId, string tenantId, string objects, IDictionary serializedAdditionalRawData) + { + KeyvaultName = keyvaultName; + ClientId = clientId; + TenantId = tenantId; + Objects = objects; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The name of the Azure Key Vault to sync secrets from. + public string KeyvaultName { get; set; } + /// The user assigned managed identity client ID that should be used to access the Azure Key Vault. + public string ClientId { get; set; } + /// The Azure Active Directory tenant ID that should be used for authenticating requests to the Azure Key Vault. + public string TenantId { get; set; } + /// Objects defines the desired state of synced K8s secret objects. + public string Objects { get; set; } + } +} diff --git a/sdk/edgeworkloadsecurity/Azure.ResourceManager.SecretsStoreExtension/src/Generated/Models/KubernetesSecretObjectMapping.Serialization.cs b/sdk/edgeworkloadsecurity/Azure.ResourceManager.SecretsStoreExtension/src/Generated/Models/KubernetesSecretObjectMapping.Serialization.cs new file mode 100644 index 000000000000..227145e11cf1 --- /dev/null +++ b/sdk/edgeworkloadsecurity/Azure.ResourceManager.SecretsStoreExtension/src/Generated/Models/KubernetesSecretObjectMapping.Serialization.cs @@ -0,0 +1,134 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.SecretsStoreExtension.Models +{ + public partial class KubernetesSecretObjectMapping : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(KubernetesSecretObjectMapping)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("sourcePath"u8); + writer.WriteStringValue(SourcePath); + writer.WritePropertyName("targetKey"u8); + writer.WriteStringValue(TargetKey); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + KubernetesSecretObjectMapping 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(KubernetesSecretObjectMapping)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeKubernetesSecretObjectMapping(document.RootElement, options); + } + + internal static KubernetesSecretObjectMapping DeserializeKubernetesSecretObjectMapping(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string sourcePath = default; + string targetKey = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("sourcePath"u8)) + { + sourcePath = property.Value.GetString(); + continue; + } + if (property.NameEquals("targetKey"u8)) + { + targetKey = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new KubernetesSecretObjectMapping(sourcePath, targetKey, 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(KubernetesSecretObjectMapping)} does not support writing '{options.Format}' format."); + } + } + + KubernetesSecretObjectMapping IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeKubernetesSecretObjectMapping(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(KubernetesSecretObjectMapping)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/edgeworkloadsecurity/Azure.ResourceManager.SecretsStoreExtension/src/Generated/Models/KubernetesSecretObjectMapping.cs b/sdk/edgeworkloadsecurity/Azure.ResourceManager.SecretsStoreExtension/src/Generated/Models/KubernetesSecretObjectMapping.cs new file mode 100644 index 000000000000..6215cee11c1b --- /dev/null +++ b/sdk/edgeworkloadsecurity/Azure.ResourceManager.SecretsStoreExtension/src/Generated/Models/KubernetesSecretObjectMapping.cs @@ -0,0 +1,82 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.SecretsStoreExtension.Models +{ + /// Properties defining the mapping between a cloud secret store object and a Kubernetes Secret. + public partial class KubernetesSecretObjectMapping + { + /// + /// 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 . + /// SourcePath is the identifier for the secret data as defined by the external secret provider. This is the key or path to the secret in the provider's system, which gets mounted to a specific path in the pod. The value should match the name of the secret as specified in the SecretProviderClass's objects array. + /// TargetKey is the key in the Kubernetes secret's data field where the secret value will be stored. This key is used to reference the secret data within Kubernetes, and it should be unique within the secret. + /// or is null. + public KubernetesSecretObjectMapping(string sourcePath, string targetKey) + { + Argument.AssertNotNull(sourcePath, nameof(sourcePath)); + Argument.AssertNotNull(targetKey, nameof(targetKey)); + + SourcePath = sourcePath; + TargetKey = targetKey; + } + + /// Initializes a new instance of . + /// SourcePath is the identifier for the secret data as defined by the external secret provider. This is the key or path to the secret in the provider's system, which gets mounted to a specific path in the pod. The value should match the name of the secret as specified in the SecretProviderClass's objects array. + /// TargetKey is the key in the Kubernetes secret's data field where the secret value will be stored. This key is used to reference the secret data within Kubernetes, and it should be unique within the secret. + /// Keeps track of any properties unknown to the library. + internal KubernetesSecretObjectMapping(string sourcePath, string targetKey, IDictionary serializedAdditionalRawData) + { + SourcePath = sourcePath; + TargetKey = targetKey; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal KubernetesSecretObjectMapping() + { + } + + /// SourcePath is the identifier for the secret data as defined by the external secret provider. This is the key or path to the secret in the provider's system, which gets mounted to a specific path in the pod. The value should match the name of the secret as specified in the SecretProviderClass's objects array. + public string SourcePath { get; set; } + /// TargetKey is the key in the Kubernetes secret's data field where the secret value will be stored. This key is used to reference the secret data within Kubernetes, and it should be unique within the secret. + public string TargetKey { get; set; } + } +} diff --git a/sdk/edgeworkloadsecurity/Azure.ResourceManager.SecretsStoreExtension/src/Generated/Models/KubernetesSecretType.cs b/sdk/edgeworkloadsecurity/Azure.ResourceManager.SecretsStoreExtension/src/Generated/Models/KubernetesSecretType.cs new file mode 100644 index 000000000000..44a8f0b0c321 --- /dev/null +++ b/sdk/edgeworkloadsecurity/Azure.ResourceManager.SecretsStoreExtension/src/Generated/Models/KubernetesSecretType.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.SecretsStoreExtension.Models +{ + /// Supported Kubernetes secret types. + public readonly partial struct KubernetesSecretType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public KubernetesSecretType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string OpaqueValue = "Opaque"; + private const string TlsValue = "kubernetes.io/tls"; + + /// Opaque is the default secret type. + public static KubernetesSecretType Opaque { get; } = new KubernetesSecretType(OpaqueValue); + /// The kubernetes.io/tls secret type is for storing a certificate and its associated key that are typically used for TLS. + public static KubernetesSecretType Tls { get; } = new KubernetesSecretType(TlsValue); + /// Determines if two values are the same. + public static bool operator ==(KubernetesSecretType left, KubernetesSecretType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(KubernetesSecretType left, KubernetesSecretType right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator KubernetesSecretType(string value) => new KubernetesSecretType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is KubernetesSecretType other && Equals(other); + /// + public bool Equals(KubernetesSecretType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/edgeworkloadsecurity/Azure.ResourceManager.SecretsStoreExtension/src/Generated/Models/ProvisioningState.cs b/sdk/edgeworkloadsecurity/Azure.ResourceManager.SecretsStoreExtension/src/Generated/Models/ProvisioningState.cs new file mode 100644 index 000000000000..7d9485d78e3d --- /dev/null +++ b/sdk/edgeworkloadsecurity/Azure.ResourceManager.SecretsStoreExtension/src/Generated/Models/ProvisioningState.cs @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.SecretsStoreExtension.Models +{ + /// Provisioning state of the resource. + public readonly partial struct ProvisioningState : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public ProvisioningState(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string SucceededValue = "Succeeded"; + private const string FailedValue = "Failed"; + private const string CanceledValue = "Canceled"; + + /// Resource has been created. + public static ProvisioningState Succeeded { get; } = new ProvisioningState(SucceededValue); + /// Resource creation failed. + public static ProvisioningState Failed { get; } = new ProvisioningState(FailedValue); + /// Resource creation was canceled. + public static ProvisioningState Canceled { get; } = new ProvisioningState(CanceledValue); + /// Determines if two values are the same. + public static bool operator ==(ProvisioningState left, ProvisioningState right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(ProvisioningState left, ProvisioningState right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator ProvisioningState(string value) => new ProvisioningState(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is ProvisioningState other && Equals(other); + /// + public bool Equals(ProvisioningState other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/edgeworkloadsecurity/Azure.ResourceManager.SecretsStoreExtension/src/Generated/Models/SecretSyncCondition.Serialization.cs b/sdk/edgeworkloadsecurity/Azure.ResourceManager.SecretsStoreExtension/src/Generated/Models/SecretSyncCondition.Serialization.cs new file mode 100644 index 000000000000..3ae445f39a59 --- /dev/null +++ b/sdk/edgeworkloadsecurity/Azure.ResourceManager.SecretsStoreExtension/src/Generated/Models/SecretSyncCondition.Serialization.cs @@ -0,0 +1,199 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.SecretsStoreExtension.Models +{ + public partial class SecretSyncCondition : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SecretSyncCondition)} does not support writing '{format}' format."); + } + + if (options.Format != "W" && Optional.IsDefined(LastTransitionOn)) + { + writer.WritePropertyName("lastTransitionTime"u8); + writer.WriteStringValue(LastTransitionOn.Value, "O"); + } + if (options.Format != "W") + { + writer.WritePropertyName("message"u8); + writer.WriteStringValue(Message); + } + if (options.Format != "W" && Optional.IsDefined(ObservedGeneration)) + { + writer.WritePropertyName("observedGeneration"u8); + writer.WriteNumberValue(ObservedGeneration.Value); + } + if (options.Format != "W") + { + writer.WritePropertyName("reason"u8); + writer.WriteStringValue(Reason); + } + if (options.Format != "W") + { + writer.WritePropertyName("status"u8); + writer.WriteStringValue(Status.ToString()); + } + if (options.Format != "W") + { + writer.WritePropertyName("type"u8); + writer.WriteStringValue(Type); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + SecretSyncCondition 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(SecretSyncCondition)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeSecretSyncCondition(document.RootElement, options); + } + + internal static SecretSyncCondition DeserializeSecretSyncCondition(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + DateTimeOffset? lastTransitionTime = default; + string message = default; + long? observedGeneration = default; + string reason = default; + StatusConditionType status = default; + string type = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("lastTransitionTime"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + lastTransitionTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("message"u8)) + { + message = property.Value.GetString(); + continue; + } + if (property.NameEquals("observedGeneration"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + observedGeneration = property.Value.GetInt64(); + continue; + } + if (property.NameEquals("reason"u8)) + { + reason = property.Value.GetString(); + continue; + } + if (property.NameEquals("status"u8)) + { + status = new StatusConditionType(property.Value.GetString()); + continue; + } + if (property.NameEquals("type"u8)) + { + type = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new SecretSyncCondition( + lastTransitionTime, + message, + observedGeneration, + reason, + status, + type, + 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(SecretSyncCondition)} does not support writing '{options.Format}' format."); + } + } + + SecretSyncCondition IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeSecretSyncCondition(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(SecretSyncCondition)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/edgeworkloadsecurity/Azure.ResourceManager.SecretsStoreExtension/src/Generated/Models/SecretSyncCondition.cs b/sdk/edgeworkloadsecurity/Azure.ResourceManager.SecretsStoreExtension/src/Generated/Models/SecretSyncCondition.cs new file mode 100644 index 000000000000..381ce12ae6bf --- /dev/null +++ b/sdk/edgeworkloadsecurity/Azure.ResourceManager.SecretsStoreExtension/src/Generated/Models/SecretSyncCondition.cs @@ -0,0 +1,98 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.SecretsStoreExtension.Models +{ + /// A condition represents the status of the secret create and update processes. + public partial class SecretSyncCondition + { + /// + /// 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 . + /// Message is a human readable message indicating details about the transition. This may be an empty string. + /// Reason contains a programmatic identifier indicating the reason for the condition's last transition. Producers of specific condition types may define expected values and meanings for this field, and whether the values are considered a guaranteed API. The value should be a CamelCase string. This field may not be empty. + /// Status of the condition, one of True, False, Unknown. + /// Type of condition in CamelCase or in foo.example.com/CamelCase. Many .condition.type values are consistent across resources like Available, but because arbitrary conditions can be useful (see .node.status.conditions), the ability to de-conflict is important. The regex it matches is (dns1123SubdomainFmt/)?(qualifiedNameFmt). + internal SecretSyncCondition(string message, string reason, StatusConditionType status, string type) + { + Message = message; + Reason = reason; + Status = status; + Type = type; + } + + /// Initializes a new instance of . + /// LastTransitionTime is the last time the condition transitioned from one status to another. This should be when the underlying condition changed. If that is not known, then using the time when the API field changed is acceptable. + /// Message is a human readable message indicating details about the transition. This may be an empty string. + /// ObservedGeneration represents the .metadata.generation that the condition was set based upon. For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date with respect to the current state of the instance. + /// Reason contains a programmatic identifier indicating the reason for the condition's last transition. Producers of specific condition types may define expected values and meanings for this field, and whether the values are considered a guaranteed API. The value should be a CamelCase string. This field may not be empty. + /// Status of the condition, one of True, False, Unknown. + /// Type of condition in CamelCase or in foo.example.com/CamelCase. Many .condition.type values are consistent across resources like Available, but because arbitrary conditions can be useful (see .node.status.conditions), the ability to de-conflict is important. The regex it matches is (dns1123SubdomainFmt/)?(qualifiedNameFmt). + /// Keeps track of any properties unknown to the library. + internal SecretSyncCondition(DateTimeOffset? lastTransitionOn, string message, long? observedGeneration, string reason, StatusConditionType status, string type, IDictionary serializedAdditionalRawData) + { + LastTransitionOn = lastTransitionOn; + Message = message; + ObservedGeneration = observedGeneration; + Reason = reason; + Status = status; + Type = type; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal SecretSyncCondition() + { + } + + /// LastTransitionTime is the last time the condition transitioned from one status to another. This should be when the underlying condition changed. If that is not known, then using the time when the API field changed is acceptable. + public DateTimeOffset? LastTransitionOn { get; } + /// Message is a human readable message indicating details about the transition. This may be an empty string. + public string Message { get; } + /// ObservedGeneration represents the .metadata.generation that the condition was set based upon. For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date with respect to the current state of the instance. + public long? ObservedGeneration { get; } + /// Reason contains a programmatic identifier indicating the reason for the condition's last transition. Producers of specific condition types may define expected values and meanings for this field, and whether the values are considered a guaranteed API. The value should be a CamelCase string. This field may not be empty. + public string Reason { get; } + /// Status of the condition, one of True, False, Unknown. + public StatusConditionType Status { get; } + /// Type of condition in CamelCase or in foo.example.com/CamelCase. Many .condition.type values are consistent across resources like Available, but because arbitrary conditions can be useful (see .node.status.conditions), the ability to de-conflict is important. The regex it matches is (dns1123SubdomainFmt/)?(qualifiedNameFmt). + public string Type { get; } + } +} diff --git a/sdk/edgeworkloadsecurity/Azure.ResourceManager.SecretsStoreExtension/src/Generated/Models/SecretSyncListResult.Serialization.cs b/sdk/edgeworkloadsecurity/Azure.ResourceManager.SecretsStoreExtension/src/Generated/Models/SecretSyncListResult.Serialization.cs new file mode 100644 index 000000000000..ed49bc213fa1 --- /dev/null +++ b/sdk/edgeworkloadsecurity/Azure.ResourceManager.SecretsStoreExtension/src/Generated/Models/SecretSyncListResult.Serialization.cs @@ -0,0 +1,151 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.SecretsStoreExtension.Models +{ + internal partial class SecretSyncListResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SecretSyncListResult)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var item in Value) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + if (Optional.IsDefined(NextLink)) + { + writer.WritePropertyName("nextLink"u8); + writer.WriteStringValue(NextLink.AbsoluteUri); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + SecretSyncListResult 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(SecretSyncListResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeSecretSyncListResult(document.RootElement, options); + } + + internal static SecretSyncListResult DeserializeSecretSyncListResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IReadOnlyList value = default; + Uri nextLink = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(SecretSyncData.DeserializeSecretSyncData(item, options)); + } + value = array; + continue; + } + if (property.NameEquals("nextLink"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + nextLink = new Uri(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new SecretSyncListResult(value, nextLink, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(SecretSyncListResult)} does not support writing '{options.Format}' format."); + } + } + + SecretSyncListResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeSecretSyncListResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(SecretSyncListResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/edgeworkloadsecurity/Azure.ResourceManager.SecretsStoreExtension/src/Generated/Models/SecretSyncListResult.cs b/sdk/edgeworkloadsecurity/Azure.ResourceManager.SecretsStoreExtension/src/Generated/Models/SecretSyncListResult.cs new file mode 100644 index 000000000000..e127d189a9ab --- /dev/null +++ b/sdk/edgeworkloadsecurity/Azure.ResourceManager.SecretsStoreExtension/src/Generated/Models/SecretSyncListResult.cs @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.ResourceManager.SecretsStoreExtension.Models +{ + /// The response of a SecretSync list operation. + internal partial class SecretSyncListResult + { + /// + /// 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 SecretSync items on this page. + /// is null. + internal SecretSyncListResult(IEnumerable value) + { + Argument.AssertNotNull(value, nameof(value)); + + Value = value.ToList(); + } + + /// Initializes a new instance of . + /// The SecretSync items on this page. + /// The link to the next page of items. + /// Keeps track of any properties unknown to the library. + internal SecretSyncListResult(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) + { + Value = value; + NextLink = nextLink; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal SecretSyncListResult() + { + } + + /// The SecretSync items on this page. + public IReadOnlyList Value { get; } + /// The link to the next page of items. + public Uri NextLink { get; } + } +} diff --git a/sdk/edgeworkloadsecurity/Azure.ResourceManager.SecretsStoreExtension/src/Generated/Models/SecretSyncPatch.Serialization.cs b/sdk/edgeworkloadsecurity/Azure.ResourceManager.SecretsStoreExtension/src/Generated/Models/SecretSyncPatch.Serialization.cs new file mode 100644 index 000000000000..74e4ef7f0629 --- /dev/null +++ b/sdk/edgeworkloadsecurity/Azure.ResourceManager.SecretsStoreExtension/src/Generated/Models/SecretSyncPatch.Serialization.cs @@ -0,0 +1,159 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.SecretsStoreExtension.Models +{ + public partial class SecretSyncPatch : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SecretSyncPatch)} does not support writing '{format}' format."); + } + + if (Optional.IsCollectionDefined(Tags)) + { + writer.WritePropertyName("tags"u8); + writer.WriteStartObject(); + foreach (var item in Tags) + { + writer.WritePropertyName(item.Key); + writer.WriteStringValue(item.Value); + } + writer.WriteEndObject(); + } + if (Optional.IsDefined(Properties)) + { + writer.WritePropertyName("properties"u8); + writer.WriteObjectValue(Properties, options); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + SecretSyncPatch 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(SecretSyncPatch)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeSecretSyncPatch(document.RootElement, options); + } + + internal static SecretSyncPatch DeserializeSecretSyncPatch(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IDictionary tags = default; + SecretSyncUpdateProperties properties = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("tags"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var property0 in property.Value.EnumerateObject()) + { + dictionary.Add(property0.Name, property0.Value.GetString()); + } + tags = dictionary; + continue; + } + if (property.NameEquals("properties"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + properties = SecretSyncUpdateProperties.DeserializeSecretSyncUpdateProperties(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new SecretSyncPatch(tags ?? new ChangeTrackingDictionary(), 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(SecretSyncPatch)} does not support writing '{options.Format}' format."); + } + } + + SecretSyncPatch IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeSecretSyncPatch(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(SecretSyncPatch)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/edgeworkloadsecurity/Azure.ResourceManager.SecretsStoreExtension/src/Generated/Models/SecretSyncPatch.cs b/sdk/edgeworkloadsecurity/Azure.ResourceManager.SecretsStoreExtension/src/Generated/Models/SecretSyncPatch.cs new file mode 100644 index 000000000000..01b1a16a1242 --- /dev/null +++ b/sdk/edgeworkloadsecurity/Azure.ResourceManager.SecretsStoreExtension/src/Generated/Models/SecretSyncPatch.cs @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.SecretsStoreExtension.Models +{ + /// The type used for update operations of the SecretSync. + public partial class SecretSyncPatch + { + /// + /// 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 SecretSyncPatch() + { + Tags = new ChangeTrackingDictionary(); + } + + /// Initializes a new instance of . + /// Resource tags. + /// The resource-specific properties for this resource. + /// Keeps track of any properties unknown to the library. + internal SecretSyncPatch(IDictionary tags, SecretSyncUpdateProperties properties, IDictionary serializedAdditionalRawData) + { + Tags = tags; + Properties = properties; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Resource tags. + public IDictionary Tags { get; } + /// The resource-specific properties for this resource. + public SecretSyncUpdateProperties Properties { get; set; } + } +} diff --git a/sdk/edgeworkloadsecurity/Azure.ResourceManager.SecretsStoreExtension/src/Generated/Models/SecretSyncProperties.Serialization.cs b/sdk/edgeworkloadsecurity/Azure.ResourceManager.SecretsStoreExtension/src/Generated/Models/SecretSyncProperties.Serialization.cs new file mode 100644 index 000000000000..af0fb4317dc7 --- /dev/null +++ b/sdk/edgeworkloadsecurity/Azure.ResourceManager.SecretsStoreExtension/src/Generated/Models/SecretSyncProperties.Serialization.cs @@ -0,0 +1,209 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.SecretsStoreExtension.Models +{ + public partial class SecretSyncProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SecretSyncProperties)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("secretProviderClassName"u8); + writer.WriteStringValue(SecretProviderClassName); + writer.WritePropertyName("serviceAccountName"u8); + writer.WriteStringValue(ServiceAccountName); + writer.WritePropertyName("kubernetesSecretType"u8); + writer.WriteStringValue(KubernetesSecretType.ToString()); + if (Optional.IsDefined(ForceSynchronization)) + { + writer.WritePropertyName("forceSynchronization"u8); + writer.WriteStringValue(ForceSynchronization); + } + writer.WritePropertyName("objectSecretMapping"u8); + writer.WriteStartArray(); + foreach (var item in ObjectSecretMapping) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + if (options.Format != "W" && Optional.IsDefined(Status)) + { + writer.WritePropertyName("status"u8); + writer.WriteObjectValue(Status, options); + } + if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) + { + writer.WritePropertyName("provisioningState"u8); + writer.WriteStringValue(ProvisioningState.Value.ToString()); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + SecretSyncProperties 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(SecretSyncProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeSecretSyncProperties(document.RootElement, options); + } + + internal static SecretSyncProperties DeserializeSecretSyncProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string secretProviderClassName = default; + string serviceAccountName = default; + KubernetesSecretType kubernetesSecretType = default; + string forceSynchronization = default; + IList objectSecretMapping = default; + SecretSyncStatus status = default; + ProvisioningState? provisioningState = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("secretProviderClassName"u8)) + { + secretProviderClassName = property.Value.GetString(); + continue; + } + if (property.NameEquals("serviceAccountName"u8)) + { + serviceAccountName = property.Value.GetString(); + continue; + } + if (property.NameEquals("kubernetesSecretType"u8)) + { + kubernetesSecretType = new KubernetesSecretType(property.Value.GetString()); + continue; + } + if (property.NameEquals("forceSynchronization"u8)) + { + forceSynchronization = property.Value.GetString(); + continue; + } + if (property.NameEquals("objectSecretMapping"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(KubernetesSecretObjectMapping.DeserializeKubernetesSecretObjectMapping(item, options)); + } + objectSecretMapping = array; + continue; + } + if (property.NameEquals("status"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + status = SecretSyncStatus.DeserializeSecretSyncStatus(property.Value, options); + continue; + } + if (property.NameEquals("provisioningState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + provisioningState = new ProvisioningState(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new SecretSyncProperties( + secretProviderClassName, + serviceAccountName, + kubernetesSecretType, + forceSynchronization, + objectSecretMapping, + status, + provisioningState, + 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(SecretSyncProperties)} does not support writing '{options.Format}' format."); + } + } + + SecretSyncProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeSecretSyncProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(SecretSyncProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/edgeworkloadsecurity/Azure.ResourceManager.SecretsStoreExtension/src/Generated/Models/SecretSyncProperties.cs b/sdk/edgeworkloadsecurity/Azure.ResourceManager.SecretsStoreExtension/src/Generated/Models/SecretSyncProperties.cs new file mode 100644 index 000000000000..06ecef615919 --- /dev/null +++ b/sdk/edgeworkloadsecurity/Azure.ResourceManager.SecretsStoreExtension/src/Generated/Models/SecretSyncProperties.cs @@ -0,0 +1,108 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.ResourceManager.SecretsStoreExtension.Models +{ + /// The properties of the SecretSync instance. + public partial class SecretSyncProperties + { + /// + /// 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 . + /// SecretProviderClassName specifies the name of the SecretProviderClass resource, which contains the information needed to access the cloud provider secret store. + /// ServiceAccountName specifies the name of the service account used to access the cloud provider secret store. The audience field in the service account token must be passed as parameter in the controller configuration. The audience is used when requesting a token from the API server for the service account; the supported audiences are defined by each provider. + /// Type specifies the type of the Kubernetes secret object, e.g. "Opaque" or"kubernetes.io/tls". The controller must have permission to create secrets of the specified type. + /// An array of SecretObjectData that maps secret data from the external secret provider to the Kubernetes secret. Each entry specifies the source secret in the external provider and the corresponding key in the Kubernetes secret. + /// , or is null. + public SecretSyncProperties(string secretProviderClassName, string serviceAccountName, KubernetesSecretType kubernetesSecretType, IEnumerable objectSecretMapping) + { + Argument.AssertNotNull(secretProviderClassName, nameof(secretProviderClassName)); + Argument.AssertNotNull(serviceAccountName, nameof(serviceAccountName)); + Argument.AssertNotNull(objectSecretMapping, nameof(objectSecretMapping)); + + SecretProviderClassName = secretProviderClassName; + ServiceAccountName = serviceAccountName; + KubernetesSecretType = kubernetesSecretType; + ObjectSecretMapping = objectSecretMapping.ToList(); + } + + /// Initializes a new instance of . + /// SecretProviderClassName specifies the name of the SecretProviderClass resource, which contains the information needed to access the cloud provider secret store. + /// ServiceAccountName specifies the name of the service account used to access the cloud provider secret store. The audience field in the service account token must be passed as parameter in the controller configuration. The audience is used when requesting a token from the API server for the service account; the supported audiences are defined by each provider. + /// Type specifies the type of the Kubernetes secret object, e.g. "Opaque" or"kubernetes.io/tls". The controller must have permission to create secrets of the specified type. + /// ForceSynchronization can be used to force the secret synchronization. The secret synchronization is triggered by changing the value in this field. This field is not used to resolve synchronization conflicts. + /// An array of SecretObjectData that maps secret data from the external secret provider to the Kubernetes secret. Each entry specifies the source secret in the external provider and the corresponding key in the Kubernetes secret. + /// SecretSyncStatus defines the observed state of the secret synchronization process. + /// Provisioning state of the SecretSync instance. + /// Keeps track of any properties unknown to the library. + internal SecretSyncProperties(string secretProviderClassName, string serviceAccountName, KubernetesSecretType kubernetesSecretType, string forceSynchronization, IList objectSecretMapping, SecretSyncStatus status, ProvisioningState? provisioningState, IDictionary serializedAdditionalRawData) + { + SecretProviderClassName = secretProviderClassName; + ServiceAccountName = serviceAccountName; + KubernetesSecretType = kubernetesSecretType; + ForceSynchronization = forceSynchronization; + ObjectSecretMapping = objectSecretMapping; + Status = status; + ProvisioningState = provisioningState; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal SecretSyncProperties() + { + } + + /// SecretProviderClassName specifies the name of the SecretProviderClass resource, which contains the information needed to access the cloud provider secret store. + public string SecretProviderClassName { get; set; } + /// ServiceAccountName specifies the name of the service account used to access the cloud provider secret store. The audience field in the service account token must be passed as parameter in the controller configuration. The audience is used when requesting a token from the API server for the service account; the supported audiences are defined by each provider. + public string ServiceAccountName { get; set; } + /// Type specifies the type of the Kubernetes secret object, e.g. "Opaque" or"kubernetes.io/tls". The controller must have permission to create secrets of the specified type. + public KubernetesSecretType KubernetesSecretType { get; set; } + /// ForceSynchronization can be used to force the secret synchronization. The secret synchronization is triggered by changing the value in this field. This field is not used to resolve synchronization conflicts. + public string ForceSynchronization { get; set; } + /// An array of SecretObjectData that maps secret data from the external secret provider to the Kubernetes secret. Each entry specifies the source secret in the external provider and the corresponding key in the Kubernetes secret. + public IList ObjectSecretMapping { get; } + /// SecretSyncStatus defines the observed state of the secret synchronization process. + public SecretSyncStatus Status { get; } + /// Provisioning state of the SecretSync instance. + public ProvisioningState? ProvisioningState { get; } + } +} diff --git a/sdk/edgeworkloadsecurity/Azure.ResourceManager.SecretsStoreExtension/src/Generated/Models/SecretSyncStatus.Serialization.cs b/sdk/edgeworkloadsecurity/Azure.ResourceManager.SecretsStoreExtension/src/Generated/Models/SecretSyncStatus.Serialization.cs new file mode 100644 index 000000000000..188bec74ee2d --- /dev/null +++ b/sdk/edgeworkloadsecurity/Azure.ResourceManager.SecretsStoreExtension/src/Generated/Models/SecretSyncStatus.Serialization.cs @@ -0,0 +1,158 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.SecretsStoreExtension.Models +{ + public partial class SecretSyncStatus : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SecretSyncStatus)} does not support writing '{format}' format."); + } + + if (options.Format != "W" && Optional.IsDefined(LastSuccessfulSyncOn)) + { + writer.WritePropertyName("lastSuccessfulSyncTime"u8); + writer.WriteStringValue(LastSuccessfulSyncOn.Value, "O"); + } + if (options.Format != "W" && Optional.IsCollectionDefined(Conditions)) + { + writer.WritePropertyName("conditions"u8); + writer.WriteStartArray(); + foreach (var item in Conditions) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + SecretSyncStatus 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(SecretSyncStatus)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeSecretSyncStatus(document.RootElement, options); + } + + internal static SecretSyncStatus DeserializeSecretSyncStatus(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + DateTimeOffset? lastSuccessfulSyncTime = default; + IReadOnlyList conditions = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("lastSuccessfulSyncTime"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + lastSuccessfulSyncTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("conditions"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(SecretSyncCondition.DeserializeSecretSyncCondition(item, options)); + } + conditions = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new SecretSyncStatus(lastSuccessfulSyncTime, conditions ?? new ChangeTrackingList(), serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(SecretSyncStatus)} does not support writing '{options.Format}' format."); + } + } + + SecretSyncStatus IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeSecretSyncStatus(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(SecretSyncStatus)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/edgeworkloadsecurity/Azure.ResourceManager.SecretsStoreExtension/src/Generated/Models/SecretSyncStatus.cs b/sdk/edgeworkloadsecurity/Azure.ResourceManager.SecretsStoreExtension/src/Generated/Models/SecretSyncStatus.cs new file mode 100644 index 000000000000..66e1646e429b --- /dev/null +++ b/sdk/edgeworkloadsecurity/Azure.ResourceManager.SecretsStoreExtension/src/Generated/Models/SecretSyncStatus.cs @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.SecretsStoreExtension.Models +{ + /// SecretSyncStatus defines the observed state of the secret synchronization process. + public partial class SecretSyncStatus + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + internal SecretSyncStatus() + { + Conditions = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// LastSuccessfulSyncTime represents the last time the secret was retrieved from the Provider and updated. + /// Conditions represent the status of the secret create and update processes. The status can be True, False, or Unknown with various reasons and messages explaining the state. Examples of reasons include CreateSucceeded, ProviderError, InvalidClusterSecretLabelError, InvalidClusterSecretAnnotationError, UnknownError, ValidatingAdmissionPolicyCheckFailed, UserInputValidationFailed, ControllerSpcError, ControllerInternalError, NoValueChange, and ValueChangeOrForceUpdateDetected. + /// Keeps track of any properties unknown to the library. + internal SecretSyncStatus(DateTimeOffset? lastSuccessfulSyncOn, IReadOnlyList conditions, IDictionary serializedAdditionalRawData) + { + LastSuccessfulSyncOn = lastSuccessfulSyncOn; + Conditions = conditions; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// LastSuccessfulSyncTime represents the last time the secret was retrieved from the Provider and updated. + public DateTimeOffset? LastSuccessfulSyncOn { get; } + /// Conditions represent the status of the secret create and update processes. The status can be True, False, or Unknown with various reasons and messages explaining the state. Examples of reasons include CreateSucceeded, ProviderError, InvalidClusterSecretLabelError, InvalidClusterSecretAnnotationError, UnknownError, ValidatingAdmissionPolicyCheckFailed, UserInputValidationFailed, ControllerSpcError, ControllerInternalError, NoValueChange, and ValueChangeOrForceUpdateDetected. + public IReadOnlyList Conditions { get; } + } +} diff --git a/sdk/edgeworkloadsecurity/Azure.ResourceManager.SecretsStoreExtension/src/Generated/Models/SecretSyncUpdateProperties.Serialization.cs b/sdk/edgeworkloadsecurity/Azure.ResourceManager.SecretsStoreExtension/src/Generated/Models/SecretSyncUpdateProperties.Serialization.cs new file mode 100644 index 000000000000..89bfd36adf7a --- /dev/null +++ b/sdk/edgeworkloadsecurity/Azure.ResourceManager.SecretsStoreExtension/src/Generated/Models/SecretSyncUpdateProperties.Serialization.cs @@ -0,0 +1,197 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.SecretsStoreExtension.Models +{ + public partial class SecretSyncUpdateProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SecretSyncUpdateProperties)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(SecretProviderClassName)) + { + writer.WritePropertyName("secretProviderClassName"u8); + writer.WriteStringValue(SecretProviderClassName); + } + if (Optional.IsDefined(ServiceAccountName)) + { + writer.WritePropertyName("serviceAccountName"u8); + writer.WriteStringValue(ServiceAccountName); + } + if (Optional.IsDefined(KubernetesSecretType)) + { + writer.WritePropertyName("kubernetesSecretType"u8); + writer.WriteStringValue(KubernetesSecretType.Value.ToString()); + } + if (Optional.IsDefined(ForceSynchronization)) + { + writer.WritePropertyName("forceSynchronization"u8); + writer.WriteStringValue(ForceSynchronization); + } + if (Optional.IsCollectionDefined(ObjectSecretMapping)) + { + writer.WritePropertyName("objectSecretMapping"u8); + writer.WriteStartArray(); + foreach (var item in ObjectSecretMapping) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + SecretSyncUpdateProperties 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(SecretSyncUpdateProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeSecretSyncUpdateProperties(document.RootElement, options); + } + + internal static SecretSyncUpdateProperties DeserializeSecretSyncUpdateProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string secretProviderClassName = default; + string serviceAccountName = default; + KubernetesSecretType? kubernetesSecretType = default; + string forceSynchronization = default; + IList objectSecretMapping = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("secretProviderClassName"u8)) + { + secretProviderClassName = property.Value.GetString(); + continue; + } + if (property.NameEquals("serviceAccountName"u8)) + { + serviceAccountName = property.Value.GetString(); + continue; + } + if (property.NameEquals("kubernetesSecretType"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + kubernetesSecretType = new KubernetesSecretType(property.Value.GetString()); + continue; + } + if (property.NameEquals("forceSynchronization"u8)) + { + forceSynchronization = property.Value.GetString(); + continue; + } + if (property.NameEquals("objectSecretMapping"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(KubernetesSecretObjectMapping.DeserializeKubernetesSecretObjectMapping(item, options)); + } + objectSecretMapping = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new SecretSyncUpdateProperties( + secretProviderClassName, + serviceAccountName, + kubernetesSecretType, + forceSynchronization, + objectSecretMapping ?? new ChangeTrackingList(), + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(SecretSyncUpdateProperties)} does not support writing '{options.Format}' format."); + } + } + + SecretSyncUpdateProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeSecretSyncUpdateProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(SecretSyncUpdateProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/edgeworkloadsecurity/Azure.ResourceManager.SecretsStoreExtension/src/Generated/Models/SecretSyncUpdateProperties.cs b/sdk/edgeworkloadsecurity/Azure.ResourceManager.SecretsStoreExtension/src/Generated/Models/SecretSyncUpdateProperties.cs new file mode 100644 index 000000000000..7efa6c10509f --- /dev/null +++ b/sdk/edgeworkloadsecurity/Azure.ResourceManager.SecretsStoreExtension/src/Generated/Models/SecretSyncUpdateProperties.cs @@ -0,0 +1,82 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.SecretsStoreExtension.Models +{ + /// The updatable properties of the SecretSync. + public partial class SecretSyncUpdateProperties + { + /// + /// 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 SecretSyncUpdateProperties() + { + ObjectSecretMapping = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// SecretProviderClassName specifies the name of the SecretProviderClass resource, which contains the information needed to access the cloud provider secret store. + /// ServiceAccountName specifies the name of the service account used to access the cloud provider secret store. The audience field in the service account token must be passed as parameter in the controller configuration. The audience is used when requesting a token from the API server for the service account; the supported audiences are defined by each provider. + /// Type specifies the type of the Kubernetes secret object, e.g. "Opaque" or"kubernetes.io/tls". The controller must have permission to create secrets of the specified type. + /// ForceSynchronization can be used to force the secret synchronization. The secret synchronization is triggered by changing the value in this field. This field is not used to resolve synchronization conflicts. + /// An array of SecretObjectData that maps secret data from the external secret provider to the Kubernetes secret. Each entry specifies the source secret in the external provider and the corresponding key in the Kubernetes secret. + /// Keeps track of any properties unknown to the library. + internal SecretSyncUpdateProperties(string secretProviderClassName, string serviceAccountName, KubernetesSecretType? kubernetesSecretType, string forceSynchronization, IList objectSecretMapping, IDictionary serializedAdditionalRawData) + { + SecretProviderClassName = secretProviderClassName; + ServiceAccountName = serviceAccountName; + KubernetesSecretType = kubernetesSecretType; + ForceSynchronization = forceSynchronization; + ObjectSecretMapping = objectSecretMapping; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// SecretProviderClassName specifies the name of the SecretProviderClass resource, which contains the information needed to access the cloud provider secret store. + public string SecretProviderClassName { get; set; } + /// ServiceAccountName specifies the name of the service account used to access the cloud provider secret store. The audience field in the service account token must be passed as parameter in the controller configuration. The audience is used when requesting a token from the API server for the service account; the supported audiences are defined by each provider. + public string ServiceAccountName { get; set; } + /// Type specifies the type of the Kubernetes secret object, e.g. "Opaque" or"kubernetes.io/tls". The controller must have permission to create secrets of the specified type. + public KubernetesSecretType? KubernetesSecretType { get; set; } + /// ForceSynchronization can be used to force the secret synchronization. The secret synchronization is triggered by changing the value in this field. This field is not used to resolve synchronization conflicts. + public string ForceSynchronization { get; set; } + /// An array of SecretObjectData that maps secret data from the external secret provider to the Kubernetes secret. Each entry specifies the source secret in the external provider and the corresponding key in the Kubernetes secret. + public IList ObjectSecretMapping { get; } + } +} diff --git a/sdk/edgeworkloadsecurity/Azure.ResourceManager.SecretsStoreExtension/src/Generated/Models/StatusConditionType.cs b/sdk/edgeworkloadsecurity/Azure.ResourceManager.SecretsStoreExtension/src/Generated/Models/StatusConditionType.cs new file mode 100644 index 000000000000..811a6bfacddf --- /dev/null +++ b/sdk/edgeworkloadsecurity/Azure.ResourceManager.SecretsStoreExtension/src/Generated/Models/StatusConditionType.cs @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.SecretsStoreExtension.Models +{ + /// Status conditions types. + public readonly partial struct StatusConditionType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public StatusConditionType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string TrueValue = "True"; + private const string FalseValue = "False"; + private const string UnknownValue = "Unknown"; + + /// The status is true. + public static StatusConditionType True { get; } = new StatusConditionType(TrueValue); + /// The status is false. + public static StatusConditionType False { get; } = new StatusConditionType(FalseValue); + /// The status is unknown. + public static StatusConditionType Unknown { get; } = new StatusConditionType(UnknownValue); + /// Determines if two values are the same. + public static bool operator ==(StatusConditionType left, StatusConditionType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(StatusConditionType left, StatusConditionType right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator StatusConditionType(string value) => new StatusConditionType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is StatusConditionType other && Equals(other); + /// + public bool Equals(StatusConditionType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/edgeworkloadsecurity/Azure.ResourceManager.SecretsStoreExtension/src/Generated/ProviderConstants.cs b/sdk/edgeworkloadsecurity/Azure.ResourceManager.SecretsStoreExtension/src/Generated/ProviderConstants.cs new file mode 100644 index 000000000000..1b9edbef5fd9 --- /dev/null +++ b/sdk/edgeworkloadsecurity/Azure.ResourceManager.SecretsStoreExtension/src/Generated/ProviderConstants.cs @@ -0,0 +1,16 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.SecretsStoreExtension +{ + internal static class ProviderConstants + { + public static string DefaultProviderNamespace { get; } = ClientDiagnostics.GetResourceProviderNamespace(typeof(ProviderConstants).Assembly); + } +} diff --git a/sdk/edgeworkloadsecurity/Azure.ResourceManager.SecretsStoreExtension/src/Generated/RestOperations/AzureKeyVaultSecretProviderClassesRestOperations.cs b/sdk/edgeworkloadsecurity/Azure.ResourceManager.SecretsStoreExtension/src/Generated/RestOperations/AzureKeyVaultSecretProviderClassesRestOperations.cs new file mode 100644 index 000000000000..a93f6590ce40 --- /dev/null +++ b/sdk/edgeworkloadsecurity/Azure.ResourceManager.SecretsStoreExtension/src/Generated/RestOperations/AzureKeyVaultSecretProviderClassesRestOperations.cs @@ -0,0 +1,723 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.SecretsStoreExtension.Models; + +namespace Azure.ResourceManager.SecretsStoreExtension +{ + internal partial class AzureKeyVaultSecretProviderClassesRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of AzureKeyVaultSecretProviderClassesRestOperations. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// The application id to use for user agent. + /// Service host. + /// The API version to use for this operation. + /// or is null. + public AzureKeyVaultSecretProviderClassesRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + { + _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); + _endpoint = endpoint ?? new Uri("https://management.azure.com"); + _apiVersion = apiVersion ?? "2024-08-21-preview"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string azureKeyVaultSecretProviderClassName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.SecretSyncController/azureKeyVaultSecretProviderClasses/", false); + uri.AppendPath(azureKeyVaultSecretProviderClassName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string azureKeyVaultSecretProviderClassName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.SecretSyncController/azureKeyVaultSecretProviderClasses/", false); + uri.AppendPath(azureKeyVaultSecretProviderClassName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Gets the properties of an AzureKeyVaultSecretProviderClass instance. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the AzureKeyVaultSecretProviderClass. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> GetAsync(string subscriptionId, string resourceGroupName, string azureKeyVaultSecretProviderClassName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(azureKeyVaultSecretProviderClassName, nameof(azureKeyVaultSecretProviderClassName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, azureKeyVaultSecretProviderClassName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + AzureKeyVaultSecretProviderClassData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = AzureKeyVaultSecretProviderClassData.DeserializeAzureKeyVaultSecretProviderClassData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((AzureKeyVaultSecretProviderClassData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// Gets the properties of an AzureKeyVaultSecretProviderClass instance. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the AzureKeyVaultSecretProviderClass. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response Get(string subscriptionId, string resourceGroupName, string azureKeyVaultSecretProviderClassName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(azureKeyVaultSecretProviderClassName, nameof(azureKeyVaultSecretProviderClassName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, azureKeyVaultSecretProviderClassName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + AzureKeyVaultSecretProviderClassData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = AzureKeyVaultSecretProviderClassData.DeserializeAzureKeyVaultSecretProviderClassData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((AzureKeyVaultSecretProviderClassData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateCreateOrUpdateRequestUri(string subscriptionId, string resourceGroupName, string azureKeyVaultSecretProviderClassName, AzureKeyVaultSecretProviderClassData data) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.SecretSyncController/azureKeyVaultSecretProviderClasses/", false); + uri.AppendPath(azureKeyVaultSecretProviderClassName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string resourceGroupName, string azureKeyVaultSecretProviderClassName, AzureKeyVaultSecretProviderClassData data) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Put; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.SecretSyncController/azureKeyVaultSecretProviderClasses/", false); + uri.AppendPath(azureKeyVaultSecretProviderClassName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(data, ModelSerializationExtensions.WireOptions); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Creates, or updates, an AzureKeyVaultSecretProviderClass instance. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the AzureKeyVaultSecretProviderClass. + /// Resource create parameters. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task CreateOrUpdateAsync(string subscriptionId, string resourceGroupName, string azureKeyVaultSecretProviderClassName, AzureKeyVaultSecretProviderClassData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(azureKeyVaultSecretProviderClassName, nameof(azureKeyVaultSecretProviderClassName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, azureKeyVaultSecretProviderClassName, data); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 201: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Creates, or updates, an AzureKeyVaultSecretProviderClass instance. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the AzureKeyVaultSecretProviderClass. + /// Resource create parameters. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response CreateOrUpdate(string subscriptionId, string resourceGroupName, string azureKeyVaultSecretProviderClassName, AzureKeyVaultSecretProviderClassData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(azureKeyVaultSecretProviderClassName, nameof(azureKeyVaultSecretProviderClassName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, azureKeyVaultSecretProviderClassName, data); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 201: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateUpdateRequestUri(string subscriptionId, string resourceGroupName, string azureKeyVaultSecretProviderClassName, AzureKeyVaultSecretProviderClassPatch patch) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.SecretSyncController/azureKeyVaultSecretProviderClasses/", false); + uri.AppendPath(azureKeyVaultSecretProviderClassName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceGroupName, string azureKeyVaultSecretProviderClassName, AzureKeyVaultSecretProviderClassPatch patch) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Patch; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.SecretSyncController/azureKeyVaultSecretProviderClasses/", false); + uri.AppendPath(azureKeyVaultSecretProviderClassName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(patch, ModelSerializationExtensions.WireOptions); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Updates an AzureKeyVaultSecretProviderClass instance. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the AzureKeyVaultSecretProviderClass. + /// The resource properties to be updated. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task UpdateAsync(string subscriptionId, string resourceGroupName, string azureKeyVaultSecretProviderClassName, AzureKeyVaultSecretProviderClassPatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(azureKeyVaultSecretProviderClassName, nameof(azureKeyVaultSecretProviderClassName)); + Argument.AssertNotNull(patch, nameof(patch)); + + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, azureKeyVaultSecretProviderClassName, patch); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Updates an AzureKeyVaultSecretProviderClass instance. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the AzureKeyVaultSecretProviderClass. + /// The resource properties to be updated. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response Update(string subscriptionId, string resourceGroupName, string azureKeyVaultSecretProviderClassName, AzureKeyVaultSecretProviderClassPatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(azureKeyVaultSecretProviderClassName, nameof(azureKeyVaultSecretProviderClassName)); + Argument.AssertNotNull(patch, nameof(patch)); + + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, azureKeyVaultSecretProviderClassName, patch); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string resourceGroupName, string azureKeyVaultSecretProviderClassName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.SecretSyncController/azureKeyVaultSecretProviderClasses/", false); + uri.AppendPath(azureKeyVaultSecretProviderClassName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string azureKeyVaultSecretProviderClassName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Delete; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.SecretSyncController/azureKeyVaultSecretProviderClasses/", false); + uri.AppendPath(azureKeyVaultSecretProviderClassName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Deletes an AzureKeyVaultSecretProviderClass instance. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the AzureKeyVaultSecretProviderClass. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task DeleteAsync(string subscriptionId, string resourceGroupName, string azureKeyVaultSecretProviderClassName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(azureKeyVaultSecretProviderClassName, nameof(azureKeyVaultSecretProviderClassName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, azureKeyVaultSecretProviderClassName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Deletes an AzureKeyVaultSecretProviderClass instance. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the AzureKeyVaultSecretProviderClass. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response Delete(string subscriptionId, string resourceGroupName, string azureKeyVaultSecretProviderClassName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(azureKeyVaultSecretProviderClassName, nameof(azureKeyVaultSecretProviderClassName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, azureKeyVaultSecretProviderClassName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListByResourceGroupRequestUri(string subscriptionId, string resourceGroupName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.SecretSyncController/azureKeyVaultSecretProviderClasses", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateListByResourceGroupRequest(string subscriptionId, string resourceGroupName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.SecretSyncController/azureKeyVaultSecretProviderClasses", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Lists the AzureKeyVaultSecretProviderClass instances within a resource group. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + public async Task> ListByResourceGroupAsync(string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + + using var message = CreateListByResourceGroupRequest(subscriptionId, resourceGroupName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + AzureKeyVaultSecretProviderClassListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = AzureKeyVaultSecretProviderClassListResult.DeserializeAzureKeyVaultSecretProviderClassListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Lists the AzureKeyVaultSecretProviderClass instances within a resource group. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + public Response ListByResourceGroup(string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + + using var message = CreateListByResourceGroupRequest(subscriptionId, resourceGroupName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + AzureKeyVaultSecretProviderClassListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = AzureKeyVaultSecretProviderClassListResult.DeserializeAzureKeyVaultSecretProviderClassListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListBySubscriptionRequestUri(string subscriptionId) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/providers/Microsoft.SecretSyncController/azureKeyVaultSecretProviderClasses", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateListBySubscriptionRequest(string subscriptionId) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/providers/Microsoft.SecretSyncController/azureKeyVaultSecretProviderClasses", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Lists the AzureKeyVaultSecretProviderClass instances within an Azure subscription. + /// The ID of the target subscription. The value must be an UUID. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + public async Task> ListBySubscriptionAsync(string subscriptionId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + + using var message = CreateListBySubscriptionRequest(subscriptionId); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + AzureKeyVaultSecretProviderClassListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = AzureKeyVaultSecretProviderClassListResult.DeserializeAzureKeyVaultSecretProviderClassListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Lists the AzureKeyVaultSecretProviderClass instances within an Azure subscription. + /// The ID of the target subscription. The value must be an UUID. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + public Response ListBySubscription(string subscriptionId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + + using var message = CreateListBySubscriptionRequest(subscriptionId); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + AzureKeyVaultSecretProviderClassListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = AzureKeyVaultSecretProviderClassListResult.DeserializeAzureKeyVaultSecretProviderClassListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListByResourceGroupNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateListByResourceGroupNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Lists the AzureKeyVaultSecretProviderClass instances within a resource group. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The cancellation token to use. + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + public async Task> ListByResourceGroupNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + + using var message = CreateListByResourceGroupNextPageRequest(nextLink, subscriptionId, resourceGroupName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + AzureKeyVaultSecretProviderClassListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = AzureKeyVaultSecretProviderClassListResult.DeserializeAzureKeyVaultSecretProviderClassListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Lists the AzureKeyVaultSecretProviderClass instances within a resource group. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The cancellation token to use. + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + public Response ListByResourceGroupNextPage(string nextLink, string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + + using var message = CreateListByResourceGroupNextPageRequest(nextLink, subscriptionId, resourceGroupName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + AzureKeyVaultSecretProviderClassListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = AzureKeyVaultSecretProviderClassListResult.DeserializeAzureKeyVaultSecretProviderClassListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListBySubscriptionNextPageRequestUri(string nextLink, string subscriptionId) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateListBySubscriptionNextPageRequest(string nextLink, string subscriptionId) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Lists the AzureKeyVaultSecretProviderClass instances within an Azure subscription. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + public async Task> ListBySubscriptionNextPageAsync(string nextLink, string subscriptionId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + + using var message = CreateListBySubscriptionNextPageRequest(nextLink, subscriptionId); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + AzureKeyVaultSecretProviderClassListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = AzureKeyVaultSecretProviderClassListResult.DeserializeAzureKeyVaultSecretProviderClassListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Lists the AzureKeyVaultSecretProviderClass instances within an Azure subscription. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + public Response ListBySubscriptionNextPage(string nextLink, string subscriptionId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + + using var message = CreateListBySubscriptionNextPageRequest(nextLink, subscriptionId); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + AzureKeyVaultSecretProviderClassListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = AzureKeyVaultSecretProviderClassListResult.DeserializeAzureKeyVaultSecretProviderClassListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/edgeworkloadsecurity/Azure.ResourceManager.SecretsStoreExtension/src/Generated/RestOperations/SecretSyncsRestOperations.cs b/sdk/edgeworkloadsecurity/Azure.ResourceManager.SecretsStoreExtension/src/Generated/RestOperations/SecretSyncsRestOperations.cs new file mode 100644 index 000000000000..85fe92db2282 --- /dev/null +++ b/sdk/edgeworkloadsecurity/Azure.ResourceManager.SecretsStoreExtension/src/Generated/RestOperations/SecretSyncsRestOperations.cs @@ -0,0 +1,723 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.SecretsStoreExtension.Models; + +namespace Azure.ResourceManager.SecretsStoreExtension +{ + internal partial class SecretSyncsRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of SecretSyncsRestOperations. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// The application id to use for user agent. + /// Service host. + /// The API version to use for this operation. + /// or is null. + public SecretSyncsRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + { + _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); + _endpoint = endpoint ?? new Uri("https://management.azure.com"); + _apiVersion = apiVersion ?? "2024-08-21-preview"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string secretSyncName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.SecretSyncController/secretSyncs/", false); + uri.AppendPath(secretSyncName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string secretSyncName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.SecretSyncController/secretSyncs/", false); + uri.AppendPath(secretSyncName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Gets the properties of a SecretSync instance. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the SecretSync. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> GetAsync(string subscriptionId, string resourceGroupName, string secretSyncName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(secretSyncName, nameof(secretSyncName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, secretSyncName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + SecretSyncData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = SecretSyncData.DeserializeSecretSyncData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((SecretSyncData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// Gets the properties of a SecretSync instance. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the SecretSync. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response Get(string subscriptionId, string resourceGroupName, string secretSyncName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(secretSyncName, nameof(secretSyncName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, secretSyncName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + SecretSyncData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = SecretSyncData.DeserializeSecretSyncData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((SecretSyncData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateCreateOrUpdateRequestUri(string subscriptionId, string resourceGroupName, string secretSyncName, SecretSyncData data) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.SecretSyncController/secretSyncs/", false); + uri.AppendPath(secretSyncName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string resourceGroupName, string secretSyncName, SecretSyncData data) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Put; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.SecretSyncController/secretSyncs/", false); + uri.AppendPath(secretSyncName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(data, ModelSerializationExtensions.WireOptions); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Creates new or updates a SecretSync instance. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the SecretSync. + /// Resource create parameters. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task CreateOrUpdateAsync(string subscriptionId, string resourceGroupName, string secretSyncName, SecretSyncData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(secretSyncName, nameof(secretSyncName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, secretSyncName, data); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 201: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Creates new or updates a SecretSync instance. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the SecretSync. + /// Resource create parameters. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response CreateOrUpdate(string subscriptionId, string resourceGroupName, string secretSyncName, SecretSyncData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(secretSyncName, nameof(secretSyncName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, secretSyncName, data); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 201: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateUpdateRequestUri(string subscriptionId, string resourceGroupName, string secretSyncName, SecretSyncPatch patch) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.SecretSyncController/secretSyncs/", false); + uri.AppendPath(secretSyncName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceGroupName, string secretSyncName, SecretSyncPatch patch) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Patch; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.SecretSyncController/secretSyncs/", false); + uri.AppendPath(secretSyncName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(patch, ModelSerializationExtensions.WireOptions); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Updates a SecretSync instance. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the SecretSync. + /// The resource properties to be updated. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task UpdateAsync(string subscriptionId, string resourceGroupName, string secretSyncName, SecretSyncPatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(secretSyncName, nameof(secretSyncName)); + Argument.AssertNotNull(patch, nameof(patch)); + + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, secretSyncName, patch); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Updates a SecretSync instance. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the SecretSync. + /// The resource properties to be updated. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response Update(string subscriptionId, string resourceGroupName, string secretSyncName, SecretSyncPatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(secretSyncName, nameof(secretSyncName)); + Argument.AssertNotNull(patch, nameof(patch)); + + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, secretSyncName, patch); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string resourceGroupName, string secretSyncName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.SecretSyncController/secretSyncs/", false); + uri.AppendPath(secretSyncName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string secretSyncName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Delete; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.SecretSyncController/secretSyncs/", false); + uri.AppendPath(secretSyncName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Deletes a SecretSync instance. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the SecretSync. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task DeleteAsync(string subscriptionId, string resourceGroupName, string secretSyncName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(secretSyncName, nameof(secretSyncName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, secretSyncName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Deletes a SecretSync instance. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the SecretSync. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response Delete(string subscriptionId, string resourceGroupName, string secretSyncName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(secretSyncName, nameof(secretSyncName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, secretSyncName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListByResourceGroupRequestUri(string subscriptionId, string resourceGroupName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.SecretSyncController/secretSyncs", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateListByResourceGroupRequest(string subscriptionId, string resourceGroupName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.SecretSyncController/secretSyncs", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Lists the SecretSync instances within a resource group. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + public async Task> ListByResourceGroupAsync(string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + + using var message = CreateListByResourceGroupRequest(subscriptionId, resourceGroupName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + SecretSyncListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = SecretSyncListResult.DeserializeSecretSyncListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Lists the SecretSync instances within a resource group. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + public Response ListByResourceGroup(string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + + using var message = CreateListByResourceGroupRequest(subscriptionId, resourceGroupName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + SecretSyncListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = SecretSyncListResult.DeserializeSecretSyncListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListBySubscriptionRequestUri(string subscriptionId) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/providers/Microsoft.SecretSyncController/secretSyncs", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateListBySubscriptionRequest(string subscriptionId) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/providers/Microsoft.SecretSyncController/secretSyncs", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Lists the SecretSync instances within an Azure subscription. + /// The ID of the target subscription. The value must be an UUID. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + public async Task> ListBySubscriptionAsync(string subscriptionId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + + using var message = CreateListBySubscriptionRequest(subscriptionId); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + SecretSyncListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = SecretSyncListResult.DeserializeSecretSyncListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Lists the SecretSync instances within an Azure subscription. + /// The ID of the target subscription. The value must be an UUID. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + public Response ListBySubscription(string subscriptionId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + + using var message = CreateListBySubscriptionRequest(subscriptionId); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + SecretSyncListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = SecretSyncListResult.DeserializeSecretSyncListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListByResourceGroupNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateListByResourceGroupNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Lists the SecretSync instances within a resource group. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The cancellation token to use. + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + public async Task> ListByResourceGroupNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + + using var message = CreateListByResourceGroupNextPageRequest(nextLink, subscriptionId, resourceGroupName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + SecretSyncListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = SecretSyncListResult.DeserializeSecretSyncListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Lists the SecretSync instances within a resource group. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The cancellation token to use. + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + public Response ListByResourceGroupNextPage(string nextLink, string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + + using var message = CreateListByResourceGroupNextPageRequest(nextLink, subscriptionId, resourceGroupName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + SecretSyncListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = SecretSyncListResult.DeserializeSecretSyncListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListBySubscriptionNextPageRequestUri(string nextLink, string subscriptionId) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateListBySubscriptionNextPageRequest(string nextLink, string subscriptionId) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Lists the SecretSync instances within an Azure subscription. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + public async Task> ListBySubscriptionNextPageAsync(string nextLink, string subscriptionId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + + using var message = CreateListBySubscriptionNextPageRequest(nextLink, subscriptionId); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + SecretSyncListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = SecretSyncListResult.DeserializeSecretSyncListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Lists the SecretSync instances within an Azure subscription. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + public Response ListBySubscriptionNextPage(string nextLink, string subscriptionId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + + using var message = CreateListBySubscriptionNextPageRequest(nextLink, subscriptionId); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + SecretSyncListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = SecretSyncListResult.DeserializeSecretSyncListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/edgeworkloadsecurity/Azure.ResourceManager.SecretsStoreExtension/src/Generated/SecretSyncCollection.cs b/sdk/edgeworkloadsecurity/Azure.ResourceManager.SecretsStoreExtension/src/Generated/SecretSyncCollection.cs new file mode 100644 index 000000000000..90636837d6f8 --- /dev/null +++ b/sdk/edgeworkloadsecurity/Azure.ResourceManager.SecretsStoreExtension/src/Generated/SecretSyncCollection.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.SecretsStoreExtension +{ + /// + /// 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 GetSecretSyncs method from an instance of . + /// + public partial class SecretSyncCollection : ArmCollection, IEnumerable, IAsyncEnumerable + { + private readonly ClientDiagnostics _secretSyncClientDiagnostics; + private readonly SecretSyncsRestOperations _secretSyncRestClient; + + /// Initializes a new instance of the class for mocking. + protected SecretSyncCollection() + { + } + + /// 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 SecretSyncCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _secretSyncClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.SecretsStoreExtension", SecretSyncResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(SecretSyncResource.ResourceType, out string secretSyncApiVersion); + _secretSyncRestClient = new SecretSyncsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, secretSyncApiVersion); +#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)); + } + + /// + /// Creates new or updates a SecretSync instance. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SecretSyncController/secretSyncs/{secretSyncName} + /// + /// + /// Operation Id + /// SecretSync_CreateOrUpdate + /// + /// + /// Default Api Version + /// 2024-08-21-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The name of the SecretSync. + /// 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 secretSyncName, SecretSyncData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(secretSyncName, nameof(secretSyncName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _secretSyncClientDiagnostics.CreateScope("SecretSyncCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = await _secretSyncRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, secretSyncName, data, cancellationToken).ConfigureAwait(false); + var operation = new SecretsStoreExtensionArmOperation(new SecretSyncOperationSource(Client), _secretSyncClientDiagnostics, Pipeline, _secretSyncRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, secretSyncName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Creates new or updates a SecretSync instance. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SecretSyncController/secretSyncs/{secretSyncName} + /// + /// + /// Operation Id + /// SecretSync_CreateOrUpdate + /// + /// + /// Default Api Version + /// 2024-08-21-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The name of the SecretSync. + /// 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 secretSyncName, SecretSyncData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(secretSyncName, nameof(secretSyncName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _secretSyncClientDiagnostics.CreateScope("SecretSyncCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = _secretSyncRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, secretSyncName, data, cancellationToken); + var operation = new SecretsStoreExtensionArmOperation(new SecretSyncOperationSource(Client), _secretSyncClientDiagnostics, Pipeline, _secretSyncRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, secretSyncName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets the properties of a SecretSync instance. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SecretSyncController/secretSyncs/{secretSyncName} + /// + /// + /// Operation Id + /// SecretSync_Get + /// + /// + /// Default Api Version + /// 2024-08-21-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the SecretSync. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetAsync(string secretSyncName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(secretSyncName, nameof(secretSyncName)); + + using var scope = _secretSyncClientDiagnostics.CreateScope("SecretSyncCollection.Get"); + scope.Start(); + try + { + var response = await _secretSyncRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, secretSyncName, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new SecretSyncResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets the properties of a SecretSync instance. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SecretSyncController/secretSyncs/{secretSyncName} + /// + /// + /// Operation Id + /// SecretSync_Get + /// + /// + /// Default Api Version + /// 2024-08-21-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the SecretSync. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Get(string secretSyncName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(secretSyncName, nameof(secretSyncName)); + + using var scope = _secretSyncClientDiagnostics.CreateScope("SecretSyncCollection.Get"); + scope.Start(); + try + { + var response = _secretSyncRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, secretSyncName, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new SecretSyncResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Lists the SecretSync instances within a resource group. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SecretSyncController/secretSyncs + /// + /// + /// Operation Id + /// SecretSync_ListByResourceGroup + /// + /// + /// Default Api Version + /// 2024-08-21-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) => _secretSyncRestClient.CreateListByResourceGroupRequest(Id.SubscriptionId, Id.ResourceGroupName); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _secretSyncRestClient.CreateListByResourceGroupNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new SecretSyncResource(Client, SecretSyncData.DeserializeSecretSyncData(e)), _secretSyncClientDiagnostics, Pipeline, "SecretSyncCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Lists the SecretSync instances within a resource group. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SecretSyncController/secretSyncs + /// + /// + /// Operation Id + /// SecretSync_ListByResourceGroup + /// + /// + /// Default Api Version + /// 2024-08-21-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) => _secretSyncRestClient.CreateListByResourceGroupRequest(Id.SubscriptionId, Id.ResourceGroupName); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _secretSyncRestClient.CreateListByResourceGroupNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new SecretSyncResource(Client, SecretSyncData.DeserializeSecretSyncData(e)), _secretSyncClientDiagnostics, Pipeline, "SecretSyncCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SecretSyncController/secretSyncs/{secretSyncName} + /// + /// + /// Operation Id + /// SecretSync_Get + /// + /// + /// Default Api Version + /// 2024-08-21-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the SecretSync. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> ExistsAsync(string secretSyncName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(secretSyncName, nameof(secretSyncName)); + + using var scope = _secretSyncClientDiagnostics.CreateScope("SecretSyncCollection.Exists"); + scope.Start(); + try + { + var response = await _secretSyncRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, secretSyncName, 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.SecretSyncController/secretSyncs/{secretSyncName} + /// + /// + /// Operation Id + /// SecretSync_Get + /// + /// + /// Default Api Version + /// 2024-08-21-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the SecretSync. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Exists(string secretSyncName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(secretSyncName, nameof(secretSyncName)); + + using var scope = _secretSyncClientDiagnostics.CreateScope("SecretSyncCollection.Exists"); + scope.Start(); + try + { + var response = _secretSyncRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, secretSyncName, 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.SecretSyncController/secretSyncs/{secretSyncName} + /// + /// + /// Operation Id + /// SecretSync_Get + /// + /// + /// Default Api Version + /// 2024-08-21-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the SecretSync. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetIfExistsAsync(string secretSyncName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(secretSyncName, nameof(secretSyncName)); + + using var scope = _secretSyncClientDiagnostics.CreateScope("SecretSyncCollection.GetIfExists"); + scope.Start(); + try + { + var response = await _secretSyncRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, secretSyncName, cancellationToken: cancellationToken).ConfigureAwait(false); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new SecretSyncResource(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.SecretSyncController/secretSyncs/{secretSyncName} + /// + /// + /// Operation Id + /// SecretSync_Get + /// + /// + /// Default Api Version + /// 2024-08-21-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the SecretSync. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual NullableResponse GetIfExists(string secretSyncName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(secretSyncName, nameof(secretSyncName)); + + using var scope = _secretSyncClientDiagnostics.CreateScope("SecretSyncCollection.GetIfExists"); + scope.Start(); + try + { + var response = _secretSyncRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, secretSyncName, cancellationToken: cancellationToken); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new SecretSyncResource(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/edgeworkloadsecurity/Azure.ResourceManager.SecretsStoreExtension/src/Generated/SecretSyncData.Serialization.cs b/sdk/edgeworkloadsecurity/Azure.ResourceManager.SecretsStoreExtension/src/Generated/SecretSyncData.Serialization.cs new file mode 100644 index 000000000000..55de2733a1de --- /dev/null +++ b/sdk/edgeworkloadsecurity/Azure.ResourceManager.SecretsStoreExtension/src/Generated/SecretSyncData.Serialization.cs @@ -0,0 +1,195 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.Models; +using Azure.ResourceManager.Resources.Models; +using Azure.ResourceManager.SecretsStoreExtension.Models; + +namespace Azure.ResourceManager.SecretsStoreExtension +{ + public partial class SecretSyncData : 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(SecretSyncData)} 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(ExtendedLocation)) + { + writer.WritePropertyName("extendedLocation"u8); + JsonSerializer.Serialize(writer, ExtendedLocation); + } + } + + SecretSyncData 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(SecretSyncData)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeSecretSyncData(document.RootElement, options); + } + + internal static SecretSyncData DeserializeSecretSyncData(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + SecretSyncProperties properties = default; + ExtendedLocation extendedLocation = 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 = SecretSyncProperties.DeserializeSecretSyncProperties(property.Value, options); + continue; + } + if (property.NameEquals("extendedLocation"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + extendedLocation = JsonSerializer.Deserialize(property.Value.GetRawText()); + 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 SecretSyncData( + id, + name, + type, + systemData, + tags ?? new ChangeTrackingDictionary(), + location, + properties, + extendedLocation, + 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(SecretSyncData)} does not support writing '{options.Format}' format."); + } + } + + SecretSyncData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeSecretSyncData(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(SecretSyncData)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/edgeworkloadsecurity/Azure.ResourceManager.SecretsStoreExtension/src/Generated/SecretSyncData.cs b/sdk/edgeworkloadsecurity/Azure.ResourceManager.SecretsStoreExtension/src/Generated/SecretSyncData.cs new file mode 100644 index 000000000000..7e2eef8e5d51 --- /dev/null +++ b/sdk/edgeworkloadsecurity/Azure.ResourceManager.SecretsStoreExtension/src/Generated/SecretSyncData.cs @@ -0,0 +1,88 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; +using Azure.ResourceManager.Models; +using Azure.ResourceManager.Resources.Models; +using Azure.ResourceManager.SecretsStoreExtension.Models; + +namespace Azure.ResourceManager.SecretsStoreExtension +{ + /// + /// A class representing the SecretSync data model. + /// The SecretSync resource. + /// + public partial class SecretSyncData : 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 SecretSyncData(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. + /// + /// Keeps track of any properties unknown to the library. + internal SecretSyncData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, SecretSyncProperties properties, ExtendedLocation extendedLocation, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) + { + Properties = properties; + ExtendedLocation = extendedLocation; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal SecretSyncData() + { + } + + /// The resource-specific properties for this resource. + public SecretSyncProperties Properties { get; set; } + /// Gets or sets the extended location. + public ExtendedLocation ExtendedLocation { get; set; } + } +} diff --git a/sdk/edgeworkloadsecurity/Azure.ResourceManager.SecretsStoreExtension/src/Generated/SecretSyncResource.Serialization.cs b/sdk/edgeworkloadsecurity/Azure.ResourceManager.SecretsStoreExtension/src/Generated/SecretSyncResource.Serialization.cs new file mode 100644 index 000000000000..f1813c853f61 --- /dev/null +++ b/sdk/edgeworkloadsecurity/Azure.ResourceManager.SecretsStoreExtension/src/Generated/SecretSyncResource.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.SecretsStoreExtension +{ + public partial class SecretSyncResource : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); + + SecretSyncData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options); + + SecretSyncData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options); + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); + } +} diff --git a/sdk/edgeworkloadsecurity/Azure.ResourceManager.SecretsStoreExtension/src/Generated/SecretSyncResource.cs b/sdk/edgeworkloadsecurity/Azure.ResourceManager.SecretsStoreExtension/src/Generated/SecretSyncResource.cs new file mode 100644 index 000000000000..b93aa29c7797 --- /dev/null +++ b/sdk/edgeworkloadsecurity/Azure.ResourceManager.SecretsStoreExtension/src/Generated/SecretSyncResource.cs @@ -0,0 +1,707 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.Resources; +using Azure.ResourceManager.SecretsStoreExtension.Models; + +namespace Azure.ResourceManager.SecretsStoreExtension +{ + /// + /// A Class representing a SecretSync 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 GetSecretSyncResource method. + /// Otherwise you can get one from its parent resource using the GetSecretSync method. + /// + public partial class SecretSyncResource : ArmResource + { + /// Generate the resource identifier of a instance. + /// The subscriptionId. + /// The resourceGroupName. + /// The secretSyncName. + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string secretSyncName) + { + var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SecretSyncController/secretSyncs/{secretSyncName}"; + return new ResourceIdentifier(resourceId); + } + + private readonly ClientDiagnostics _secretSyncClientDiagnostics; + private readonly SecretSyncsRestOperations _secretSyncRestClient; + private readonly SecretSyncData _data; + + /// Gets the resource type for the operations. + public static readonly ResourceType ResourceType = "Microsoft.SecretSyncController/secretSyncs"; + + /// Initializes a new instance of the class for mocking. + protected SecretSyncResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal SecretSyncResource(ArmClient client, SecretSyncData 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 SecretSyncResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _secretSyncClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.SecretsStoreExtension", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string secretSyncApiVersion); + _secretSyncRestClient = new SecretSyncsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, secretSyncApiVersion); +#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 SecretSyncData 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)); + } + + /// + /// Gets the properties of a SecretSync instance. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SecretSyncController/secretSyncs/{secretSyncName} + /// + /// + /// Operation Id + /// SecretSync_Get + /// + /// + /// Default Api Version + /// 2024-08-21-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _secretSyncClientDiagnostics.CreateScope("SecretSyncResource.Get"); + scope.Start(); + try + { + var response = await _secretSyncRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new SecretSyncResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets the properties of a SecretSync instance. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SecretSyncController/secretSyncs/{secretSyncName} + /// + /// + /// Operation Id + /// SecretSync_Get + /// + /// + /// Default Api Version + /// 2024-08-21-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _secretSyncClientDiagnostics.CreateScope("SecretSyncResource.Get"); + scope.Start(); + try + { + var response = _secretSyncRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new SecretSyncResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Deletes a SecretSync instance. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SecretSyncController/secretSyncs/{secretSyncName} + /// + /// + /// Operation Id + /// SecretSync_Delete + /// + /// + /// Default Api Version + /// 2024-08-21-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 = _secretSyncClientDiagnostics.CreateScope("SecretSyncResource.Delete"); + scope.Start(); + try + { + var response = await _secretSyncRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + var operation = new SecretsStoreExtensionArmOperation(_secretSyncClientDiagnostics, Pipeline, _secretSyncRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Deletes a SecretSync instance. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SecretSyncController/secretSyncs/{secretSyncName} + /// + /// + /// Operation Id + /// SecretSync_Delete + /// + /// + /// Default Api Version + /// 2024-08-21-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 = _secretSyncClientDiagnostics.CreateScope("SecretSyncResource.Delete"); + scope.Start(); + try + { + var response = _secretSyncRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + var operation = new SecretsStoreExtensionArmOperation(_secretSyncClientDiagnostics, Pipeline, _secretSyncRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletionResponse(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Updates a SecretSync instance. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SecretSyncController/secretSyncs/{secretSyncName} + /// + /// + /// Operation Id + /// SecretSync_Update + /// + /// + /// Default Api Version + /// 2024-08-21-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 resource properties to be updated. + /// The cancellation token to use. + /// is null. + public virtual async Task> UpdateAsync(WaitUntil waitUntil, SecretSyncPatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(patch, nameof(patch)); + + using var scope = _secretSyncClientDiagnostics.CreateScope("SecretSyncResource.Update"); + scope.Start(); + try + { + var response = await _secretSyncRestClient.UpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch, cancellationToken).ConfigureAwait(false); + var operation = new SecretsStoreExtensionArmOperation(new SecretSyncOperationSource(Client), _secretSyncClientDiagnostics, Pipeline, _secretSyncRestClient.CreateUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Updates a SecretSync instance. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SecretSyncController/secretSyncs/{secretSyncName} + /// + /// + /// Operation Id + /// SecretSync_Update + /// + /// + /// Default Api Version + /// 2024-08-21-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 resource properties to be updated. + /// The cancellation token to use. + /// is null. + public virtual ArmOperation Update(WaitUntil waitUntil, SecretSyncPatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(patch, nameof(patch)); + + using var scope = _secretSyncClientDiagnostics.CreateScope("SecretSyncResource.Update"); + scope.Start(); + try + { + var response = _secretSyncRestClient.Update(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch, cancellationToken); + var operation = new SecretsStoreExtensionArmOperation(new SecretSyncOperationSource(Client), _secretSyncClientDiagnostics, Pipeline, _secretSyncRestClient.CreateUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Add a tag to the current resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SecretSyncController/secretSyncs/{secretSyncName} + /// + /// + /// Operation Id + /// SecretSync_Get + /// + /// + /// Default Api Version + /// 2024-08-21-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The key for the tag. + /// The value for the tag. + /// The cancellation token to use. + /// or is null. + public virtual async Task> AddTagAsync(string key, string value, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(key, nameof(key)); + Argument.AssertNotNull(value, nameof(value)); + + using var scope = _secretSyncClientDiagnostics.CreateScope("SecretSyncResource.AddTag"); + scope.Start(); + try + { + if (await CanUseTagResourceAsync(cancellationToken: cancellationToken).ConfigureAwait(false)) + { + var originalTags = await GetTagResource().GetAsync(cancellationToken).ConfigureAwait(false); + originalTags.Value.Data.TagValues[key] = value; + await GetTagResource().CreateOrUpdateAsync(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken).ConfigureAwait(false); + var originalResponse = await _secretSyncRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new SecretSyncResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; + var patch = new SecretSyncPatch(); + foreach (var tag in current.Tags) + { + patch.Tags.Add(tag); + } + patch.Tags[key] = value; + var result = await UpdateAsync(WaitUntil.Completed, patch, cancellationToken: cancellationToken).ConfigureAwait(false); + return Response.FromValue(result.Value, result.GetRawResponse()); + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Add a tag to the current resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SecretSyncController/secretSyncs/{secretSyncName} + /// + /// + /// Operation Id + /// SecretSync_Get + /// + /// + /// Default Api Version + /// 2024-08-21-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The key for the tag. + /// The value for the tag. + /// The cancellation token to use. + /// or is null. + public virtual Response AddTag(string key, string value, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(key, nameof(key)); + Argument.AssertNotNull(value, nameof(value)); + + using var scope = _secretSyncClientDiagnostics.CreateScope("SecretSyncResource.AddTag"); + scope.Start(); + try + { + if (CanUseTagResource(cancellationToken: cancellationToken)) + { + var originalTags = GetTagResource().Get(cancellationToken); + originalTags.Value.Data.TagValues[key] = value; + GetTagResource().CreateOrUpdate(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken); + var originalResponse = _secretSyncRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + return Response.FromValue(new SecretSyncResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = Get(cancellationToken: cancellationToken).Value.Data; + var patch = new SecretSyncPatch(); + foreach (var tag in current.Tags) + { + patch.Tags.Add(tag); + } + patch.Tags[key] = value; + var result = Update(WaitUntil.Completed, patch, cancellationToken: cancellationToken); + return Response.FromValue(result.Value, result.GetRawResponse()); + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Replace the tags on the resource with the given set. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SecretSyncController/secretSyncs/{secretSyncName} + /// + /// + /// Operation Id + /// SecretSync_Get + /// + /// + /// Default Api Version + /// 2024-08-21-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The set of tags to use as replacement. + /// The cancellation token to use. + /// is null. + public virtual async Task> SetTagsAsync(IDictionary tags, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(tags, nameof(tags)); + + using var scope = _secretSyncClientDiagnostics.CreateScope("SecretSyncResource.SetTags"); + scope.Start(); + try + { + if (await CanUseTagResourceAsync(cancellationToken: cancellationToken).ConfigureAwait(false)) + { + await GetTagResource().DeleteAsync(WaitUntil.Completed, cancellationToken: cancellationToken).ConfigureAwait(false); + var originalTags = await GetTagResource().GetAsync(cancellationToken).ConfigureAwait(false); + originalTags.Value.Data.TagValues.ReplaceWith(tags); + await GetTagResource().CreateOrUpdateAsync(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken).ConfigureAwait(false); + var originalResponse = await _secretSyncRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new SecretSyncResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; + var patch = new SecretSyncPatch(); + patch.Tags.ReplaceWith(tags); + var result = await UpdateAsync(WaitUntil.Completed, patch, cancellationToken: cancellationToken).ConfigureAwait(false); + return Response.FromValue(result.Value, result.GetRawResponse()); + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Replace the tags on the resource with the given set. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SecretSyncController/secretSyncs/{secretSyncName} + /// + /// + /// Operation Id + /// SecretSync_Get + /// + /// + /// Default Api Version + /// 2024-08-21-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The set of tags to use as replacement. + /// The cancellation token to use. + /// is null. + public virtual Response SetTags(IDictionary tags, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(tags, nameof(tags)); + + using var scope = _secretSyncClientDiagnostics.CreateScope("SecretSyncResource.SetTags"); + scope.Start(); + try + { + if (CanUseTagResource(cancellationToken: cancellationToken)) + { + GetTagResource().Delete(WaitUntil.Completed, cancellationToken: cancellationToken); + var originalTags = GetTagResource().Get(cancellationToken); + originalTags.Value.Data.TagValues.ReplaceWith(tags); + GetTagResource().CreateOrUpdate(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken); + var originalResponse = _secretSyncRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + return Response.FromValue(new SecretSyncResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = Get(cancellationToken: cancellationToken).Value.Data; + var patch = new SecretSyncPatch(); + patch.Tags.ReplaceWith(tags); + var result = Update(WaitUntil.Completed, patch, cancellationToken: cancellationToken); + return Response.FromValue(result.Value, result.GetRawResponse()); + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Removes a tag by key from the resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SecretSyncController/secretSyncs/{secretSyncName} + /// + /// + /// Operation Id + /// SecretSync_Get + /// + /// + /// Default Api Version + /// 2024-08-21-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The key for the tag. + /// The cancellation token to use. + /// is null. + public virtual async Task> RemoveTagAsync(string key, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(key, nameof(key)); + + using var scope = _secretSyncClientDiagnostics.CreateScope("SecretSyncResource.RemoveTag"); + scope.Start(); + try + { + if (await CanUseTagResourceAsync(cancellationToken: cancellationToken).ConfigureAwait(false)) + { + var originalTags = await GetTagResource().GetAsync(cancellationToken).ConfigureAwait(false); + originalTags.Value.Data.TagValues.Remove(key); + await GetTagResource().CreateOrUpdateAsync(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken).ConfigureAwait(false); + var originalResponse = await _secretSyncRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new SecretSyncResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; + var patch = new SecretSyncPatch(); + foreach (var tag in current.Tags) + { + patch.Tags.Add(tag); + } + patch.Tags.Remove(key); + var result = await UpdateAsync(WaitUntil.Completed, patch, cancellationToken: cancellationToken).ConfigureAwait(false); + return Response.FromValue(result.Value, result.GetRawResponse()); + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Removes a tag by key from the resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SecretSyncController/secretSyncs/{secretSyncName} + /// + /// + /// Operation Id + /// SecretSync_Get + /// + /// + /// Default Api Version + /// 2024-08-21-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The key for the tag. + /// The cancellation token to use. + /// is null. + public virtual Response RemoveTag(string key, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(key, nameof(key)); + + using var scope = _secretSyncClientDiagnostics.CreateScope("SecretSyncResource.RemoveTag"); + scope.Start(); + try + { + if (CanUseTagResource(cancellationToken: cancellationToken)) + { + var originalTags = GetTagResource().Get(cancellationToken); + originalTags.Value.Data.TagValues.Remove(key); + GetTagResource().CreateOrUpdate(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken); + var originalResponse = _secretSyncRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + return Response.FromValue(new SecretSyncResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = Get(cancellationToken: cancellationToken).Value.Data; + var patch = new SecretSyncPatch(); + foreach (var tag in current.Tags) + { + patch.Tags.Add(tag); + } + patch.Tags.Remove(key); + var result = Update(WaitUntil.Completed, patch, cancellationToken: cancellationToken); + return Response.FromValue(result.Value, result.GetRawResponse()); + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/edgeworkloadsecurity/Azure.ResourceManager.SecretsStoreExtension/src/Properties/AssemblyInfo.cs b/sdk/edgeworkloadsecurity/Azure.ResourceManager.SecretsStoreExtension/src/Properties/AssemblyInfo.cs new file mode 100644 index 000000000000..c524cff48064 --- /dev/null +++ b/sdk/edgeworkloadsecurity/Azure.ResourceManager.SecretsStoreExtension/src/Properties/AssemblyInfo.cs @@ -0,0 +1,11 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System.Runtime.CompilerServices; + +[assembly: InternalsVisibleTo("Azure.ResourceManager.SecretsStoreExtension.Tests, PublicKey = 0024000004800000940000000602000000240000525341310004000001000100d15ddcb29688295338af4b7686603fe614abd555e09efba8fb88ee09e1f7b1ccaeed2e8f823fa9eef3fdd60217fc012ea67d2479751a0b8c087a4185541b851bd8b16f8d91b840e51b1cb0ba6fe647997e57429265e85ef62d565db50a69ae1647d54d7bd855e4db3d8a91510e5bcbd0edfbbecaa20a7bd9ae74593daa7b11b4")] + +// Replace Microsoft.Test with the correct resource provider namepace for your service and uncomment. +// See https://docs.microsoft.com/en-us/azure/azure-resource-manager/management/azure-services-resource-providers +// for the list of possible values. +[assembly: Azure.Core.AzureResourceProviderNamespace("SecretsStoreExtension")] diff --git a/sdk/edgeworkloadsecurity/Azure.ResourceManager.SecretsStoreExtension/tests/Azure.ResourceManager.SecretsStoreExtension.Tests.csproj b/sdk/edgeworkloadsecurity/Azure.ResourceManager.SecretsStoreExtension/tests/Azure.ResourceManager.SecretsStoreExtension.Tests.csproj new file mode 100644 index 000000000000..59bad16dad6e --- /dev/null +++ b/sdk/edgeworkloadsecurity/Azure.ResourceManager.SecretsStoreExtension/tests/Azure.ResourceManager.SecretsStoreExtension.Tests.csproj @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/sdk/edgeworkloadsecurity/Azure.ResourceManager.SecretsStoreExtension/tests/SecretsStoreExtensionManagementTestBase.cs b/sdk/edgeworkloadsecurity/Azure.ResourceManager.SecretsStoreExtension/tests/SecretsStoreExtensionManagementTestBase.cs new file mode 100644 index 000000000000..7e9627fca2f5 --- /dev/null +++ b/sdk/edgeworkloadsecurity/Azure.ResourceManager.SecretsStoreExtension/tests/SecretsStoreExtensionManagementTestBase.cs @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using Azure; +using Azure.Core; +using Azure.Core.TestFramework; +using Azure.ResourceManager; +using Azure.ResourceManager.Resources; +using Azure.ResourceManager.TestFramework; +using NUnit.Framework; +using System.Threading.Tasks; + +namespace Azure.ResourceManager.SecretsStoreExtension.Tests +{ + public class SecretsStoreExtensionManagementTestBase : ManagementRecordedTestBase + { + protected ArmClient Client { get; private set; } + protected SubscriptionResource DefaultSubscription { get; private set; } + + protected SecretsStoreExtensionManagementTestBase(bool isAsync, RecordedTestMode mode) + : base(isAsync, mode) + { + } + + protected SecretsStoreExtensionManagementTestBase(bool isAsync) + : base(isAsync) + { + } + + [SetUp] + public async Task CreateCommonClient() + { + Client = GetArmClient(); + DefaultSubscription = await Client.GetDefaultSubscriptionAsync().ConfigureAwait(false); + } + + protected async Task CreateResourceGroup(SubscriptionResource subscription, string rgNamePrefix, AzureLocation location) + { + string rgName = Recording.GenerateAssetName(rgNamePrefix); + ResourceGroupData input = new ResourceGroupData(location); + var lro = await subscription.GetResourceGroups().CreateOrUpdateAsync(WaitUntil.Completed, rgName, input); + return lro.Value; + } + } +} diff --git a/sdk/edgeworkloadsecurity/Azure.ResourceManager.SecretsStoreExtension/tests/SecretsStoreExtensionManagementTestEnvironment.cs b/sdk/edgeworkloadsecurity/Azure.ResourceManager.SecretsStoreExtension/tests/SecretsStoreExtensionManagementTestEnvironment.cs new file mode 100644 index 000000000000..5cf2a0cf0b72 --- /dev/null +++ b/sdk/edgeworkloadsecurity/Azure.ResourceManager.SecretsStoreExtension/tests/SecretsStoreExtensionManagementTestEnvironment.cs @@ -0,0 +1,11 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using Azure.Core.TestFramework; + +namespace Azure.ResourceManager.SecretsStoreExtension.Tests +{ + public class SecretsStoreExtensionManagementTestEnvironment : TestEnvironment + { + } +} diff --git a/sdk/edgeworkloadsecurity/Azure.ResourceManager.SecretsStoreExtension/tsp-location.yaml b/sdk/edgeworkloadsecurity/Azure.ResourceManager.SecretsStoreExtension/tsp-location.yaml new file mode 100644 index 000000000000..ee3e278467e9 --- /dev/null +++ b/sdk/edgeworkloadsecurity/Azure.ResourceManager.SecretsStoreExtension/tsp-location.yaml @@ -0,0 +1,4 @@ +directory: specification/ews/SecretSyncController.Management +commit: 676334a284e5136f0a0721d6ae844bb04332f579 +repo: Azure/azure-rest-api-specs +additionalDirectories: diff --git a/sdk/edgeworkloadsecurity/ci.mgmt.yml b/sdk/edgeworkloadsecurity/ci.mgmt.yml new file mode 100644 index 000000000000..c2472957d0de --- /dev/null +++ b/sdk/edgeworkloadsecurity/ci.mgmt.yml @@ -0,0 +1,26 @@ +# NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. + +trigger: none + +pr: + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/edgeworkloadsecurity /ci.mgmt.yml + - sdk/edgeworkloadsecurity /Azure.ResourceManager.SecretsStoreExtension / + + +extends: + template: /eng/pipelines/templates/stages/archetype-sdk-client.yml + parameters: + ServiceDirectory: edgeworkloadsecurity + ArtifactName: packages + LimitForPullRequest: true + Artifacts: + - name: Azure.ResourceManager.SecretsStoreExtension + safeName: AzureResourceManagerSecretsStoreExtension diff --git a/sdk/impactreporting/Azure.ResourceManager.ImpactReporting/Azure.ResourceManager.ImpactReporting.sln b/sdk/impactreporting/Azure.ResourceManager.ImpactReporting/Azure.ResourceManager.ImpactReporting.sln new file mode 100644 index 000000000000..8045641aab8e --- /dev/null +++ b/sdk/impactreporting/Azure.ResourceManager.ImpactReporting/Azure.ResourceManager.ImpactReporting.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.ImpactReporting.Samples", "samples\Azure.ResourceManager.ImpactReporting.Samples.csproj", "{7A2DFF15-5746-49F4-BD0F-C6C35337088A}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Azure.ResourceManager.ImpactReporting", "src\Azure.ResourceManager.ImpactReporting.csproj", "{28FF4005-4467-4E36-92E7-DEA27DEB1519}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Azure.ResourceManager.ImpactReporting.Tests", "tests\Azure.ResourceManager.ImpactReporting.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/impactreporting/Azure.ResourceManager.ImpactReporting/CHANGELOG.md b/sdk/impactreporting/Azure.ResourceManager.ImpactReporting/CHANGELOG.md new file mode 100644 index 000000000000..8b33f0fedccc --- /dev/null +++ b/sdk/impactreporting/Azure.ResourceManager.ImpactReporting/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/impactreporting/Azure.ResourceManager.ImpactReporting/Directory.Build.props b/sdk/impactreporting/Azure.ResourceManager.ImpactReporting/Directory.Build.props new file mode 100644 index 000000000000..63bd836ad44b --- /dev/null +++ b/sdk/impactreporting/Azure.ResourceManager.ImpactReporting/Directory.Build.props @@ -0,0 +1,6 @@ + + + + diff --git a/sdk/impactreporting/Azure.ResourceManager.ImpactReporting/README.md b/sdk/impactreporting/Azure.ResourceManager.ImpactReporting/README.md new file mode 100644 index 000000000000..ab99941d030e --- /dev/null +++ b/sdk/impactreporting/Azure.ResourceManager.ImpactReporting/README.md @@ -0,0 +1,80 @@ +# Microsoft Azure ImpactReporting 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 ImpactReporting management library for .NET with [NuGet](https://www.nuget.org/): + +```dotnetcli +dotnet add package Azure.ResourceManager.ImpactReporting --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/impactreporting/Azure.ResourceManager.ImpactReporting/api/Azure.ResourceManager.ImpactReporting.net8.0.cs b/sdk/impactreporting/Azure.ResourceManager.ImpactReporting/api/Azure.ResourceManager.ImpactReporting.net8.0.cs new file mode 100644 index 000000000000..4db467f25c36 --- /dev/null +++ b/sdk/impactreporting/Azure.ResourceManager.ImpactReporting/api/Azure.ResourceManager.ImpactReporting.net8.0.cs @@ -0,0 +1,616 @@ +namespace Azure.ResourceManager.ImpactReporting +{ + public partial class ConnectorCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected ConnectorCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string connectorName, Azure.ResourceManager.ImpactReporting.ConnectorData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string connectorName, Azure.ResourceManager.ImpactReporting.ConnectorData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string connectorName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string connectorName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string connectorName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string connectorName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string connectorName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string connectorName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class ConnectorData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ConnectorData() { } + public Azure.ResourceManager.ImpactReporting.Models.ConnectorProperties Properties { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ImpactReporting.ConnectorData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ImpactReporting.ConnectorData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ConnectorResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected ConnectorResource() { } + public virtual Azure.ResourceManager.ImpactReporting.ConnectorData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string connectorName) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + Azure.ResourceManager.ImpactReporting.ConnectorData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ImpactReporting.ConnectorData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public virtual Azure.Response Update(Azure.ResourceManager.ImpactReporting.Models.ConnectorPatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.ResourceManager.ImpactReporting.Models.ConnectorPatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class ImpactCategoryCollection : Azure.ResourceManager.ArmCollection + { + protected ImpactCategoryCollection() { } + public virtual Azure.Response Exists(string impactCategoryName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string impactCategoryName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string impactCategoryName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(string resourceType, string categoryName = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(string resourceType, string categoryName = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string impactCategoryName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string impactCategoryName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string impactCategoryName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class ImpactCategoryData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal ImpactCategoryData() { } + public Azure.ResourceManager.ImpactReporting.Models.ImpactCategoryProperties Properties { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ImpactReporting.ImpactCategoryData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ImpactReporting.ImpactCategoryData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ImpactCategoryResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected ImpactCategoryResource() { } + public virtual Azure.ResourceManager.ImpactReporting.ImpactCategoryData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string impactCategoryName) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + Azure.ResourceManager.ImpactReporting.ImpactCategoryData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ImpactReporting.ImpactCategoryData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public static partial class ImpactReportingExtensions + { + public static Azure.Response GetConnector(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, string connectorName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static System.Threading.Tasks.Task> GetConnectorAsync(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, string connectorName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.ResourceManager.ImpactReporting.ConnectorResource GetConnectorResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.ImpactReporting.ConnectorCollection GetConnectors(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource) { throw null; } + public static Azure.ResourceManager.ImpactReporting.ImpactCategoryCollection GetImpactCategories(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource) { throw null; } + public static Azure.Response GetImpactCategory(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, string impactCategoryName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static System.Threading.Tasks.Task> GetImpactCategoryAsync(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, string impactCategoryName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.ResourceManager.ImpactReporting.ImpactCategoryResource GetImpactCategoryResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.ImpactReporting.InsightResource GetInsightResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.Response GetWorkloadImpact(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, string workloadImpactName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static System.Threading.Tasks.Task> GetWorkloadImpactAsync(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, string workloadImpactName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.ResourceManager.ImpactReporting.WorkloadImpactResource GetWorkloadImpactResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.ImpactReporting.WorkloadImpactCollection GetWorkloadImpacts(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource) { throw null; } + } + public partial class InsightCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected InsightCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string insightName, Azure.ResourceManager.ImpactReporting.InsightData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string insightName, Azure.ResourceManager.ImpactReporting.InsightData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string insightName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string insightName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string insightName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string insightName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string insightName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string insightName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class InsightData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public InsightData() { } + public Azure.ResourceManager.ImpactReporting.Models.InsightProperties Properties { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ImpactReporting.InsightData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ImpactReporting.InsightData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class InsightResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected InsightResource() { } + public virtual Azure.ResourceManager.ImpactReporting.InsightData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string workloadImpactName, string insightName) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + Azure.ResourceManager.ImpactReporting.InsightData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ImpactReporting.InsightData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.ImpactReporting.InsightData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.ImpactReporting.InsightData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class WorkloadImpactCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected WorkloadImpactCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string workloadImpactName, Azure.ResourceManager.ImpactReporting.WorkloadImpactData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string workloadImpactName, Azure.ResourceManager.ImpactReporting.WorkloadImpactData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string workloadImpactName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string workloadImpactName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string workloadImpactName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string workloadImpactName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string workloadImpactName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string workloadImpactName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class WorkloadImpactData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public WorkloadImpactData() { } + public Azure.ResourceManager.ImpactReporting.Models.WorkloadImpactProperties Properties { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ImpactReporting.WorkloadImpactData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ImpactReporting.WorkloadImpactData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class WorkloadImpactResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected WorkloadImpactResource() { } + public virtual Azure.ResourceManager.ImpactReporting.WorkloadImpactData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string workloadImpactName) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response GetInsight(string insightName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetInsightAsync(string insightName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.ImpactReporting.InsightCollection GetInsights() { throw null; } + Azure.ResourceManager.ImpactReporting.WorkloadImpactData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ImpactReporting.WorkloadImpactData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.ImpactReporting.WorkloadImpactData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.ImpactReporting.WorkloadImpactData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } +} +namespace Azure.ResourceManager.ImpactReporting.Mocking +{ + public partial class MockableImpactReportingArmClient : Azure.ResourceManager.ArmResource + { + protected MockableImpactReportingArmClient() { } + public virtual Azure.ResourceManager.ImpactReporting.ConnectorResource GetConnectorResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.ImpactReporting.ImpactCategoryResource GetImpactCategoryResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.ImpactReporting.InsightResource GetInsightResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.ImpactReporting.WorkloadImpactResource GetWorkloadImpactResource(Azure.Core.ResourceIdentifier id) { throw null; } + } + public partial class MockableImpactReportingSubscriptionResource : Azure.ResourceManager.ArmResource + { + protected MockableImpactReportingSubscriptionResource() { } + public virtual Azure.Response GetConnector(string connectorName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetConnectorAsync(string connectorName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.ImpactReporting.ConnectorCollection GetConnectors() { throw null; } + public virtual Azure.ResourceManager.ImpactReporting.ImpactCategoryCollection GetImpactCategories() { throw null; } + public virtual Azure.Response GetImpactCategory(string impactCategoryName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetImpactCategoryAsync(string impactCategoryName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response GetWorkloadImpact(string workloadImpactName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetWorkloadImpactAsync(string workloadImpactName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.ImpactReporting.WorkloadImpactCollection GetWorkloadImpacts() { throw null; } + } +} +namespace Azure.ResourceManager.ImpactReporting.Models +{ + public static partial class ArmImpactReportingModelFactory + { + public static Azure.ResourceManager.ImpactReporting.ConnectorData ConnectorData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.ImpactReporting.Models.ConnectorProperties properties = null) { throw null; } + public static Azure.ResourceManager.ImpactReporting.Models.ConnectorProperties ConnectorProperties(Azure.ResourceManager.ImpactReporting.Models.ProvisioningState? provisioningState = default(Azure.ResourceManager.ImpactReporting.Models.ProvisioningState?), string connectorId = null, string tenantId = null, Azure.ResourceManager.ImpactReporting.Models.Platform connectorType = default(Azure.ResourceManager.ImpactReporting.Models.Platform), System.DateTimeOffset lastRunTimeStamp = default(System.DateTimeOffset)) { throw null; } + public static Azure.ResourceManager.ImpactReporting.ImpactCategoryData ImpactCategoryData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.ImpactReporting.Models.ImpactCategoryProperties properties = null) { throw null; } + public static Azure.ResourceManager.ImpactReporting.Models.ImpactCategoryProperties ImpactCategoryProperties(Azure.ResourceManager.ImpactReporting.Models.ProvisioningState? provisioningState = default(Azure.ResourceManager.ImpactReporting.Models.ProvisioningState?), string categoryId = null, string parentCategoryId = null, string description = null, System.Collections.Generic.IEnumerable requiredImpactProperties = null) { throw null; } + public static Azure.ResourceManager.ImpactReporting.InsightData InsightData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.ImpactReporting.Models.InsightProperties properties = null) { throw null; } + public static Azure.ResourceManager.ImpactReporting.Models.InsightProperties InsightProperties(Azure.ResourceManager.ImpactReporting.Models.ProvisioningState? provisioningState = default(Azure.ResourceManager.ImpactReporting.Models.ProvisioningState?), string category = null, string status = null, string eventId = null, string groupId = null, Azure.ResourceManager.ImpactReporting.Models.Content content = null, System.DateTimeOffset? eventOn = default(System.DateTimeOffset?), string insightUniqueId = null, Azure.ResourceManager.ImpactReporting.Models.ImpactDetails impact = null, Azure.ResourceManager.ImpactReporting.Models.InsightPropertiesAdditionalDetails additionalDetails = null) { throw null; } + public static Azure.ResourceManager.ImpactReporting.Models.RequiredImpactProperties RequiredImpactProperties(string name = null, System.Collections.Generic.IEnumerable allowedValues = null) { throw null; } + public static Azure.ResourceManager.ImpactReporting.WorkloadImpactData WorkloadImpactData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.ImpactReporting.Models.WorkloadImpactProperties properties = null) { throw null; } + public static Azure.ResourceManager.ImpactReporting.Models.WorkloadImpactProperties WorkloadImpactProperties(Azure.ResourceManager.ImpactReporting.Models.ProvisioningState? provisioningState = default(Azure.ResourceManager.ImpactReporting.Models.ProvisioningState?), System.DateTimeOffset startOn = default(System.DateTimeOffset), System.DateTimeOffset? endOn = default(System.DateTimeOffset?), string impactedResourceId = null, string impactUniqueId = null, System.DateTimeOffset? reportedTimeUtc = default(System.DateTimeOffset?), string impactCategory = null, string impactDescription = null, System.Collections.Generic.IEnumerable armCorrelationIds = null, System.Collections.Generic.IEnumerable performance = null, Azure.ResourceManager.ImpactReporting.Models.Connectivity connectivity = null, Azure.ResourceManager.ImpactReporting.Models.WorkloadImpactPropertiesAdditionalProperties additionalProperties = null, Azure.ResourceManager.ImpactReporting.Models.ErrorDetailProperties errorDetails = null, Azure.ResourceManager.ImpactReporting.Models.Workload workload = null, string impactGroupId = null, Azure.ResourceManager.ImpactReporting.Models.ConfidenceLevel? confidenceLevel = default(Azure.ResourceManager.ImpactReporting.Models.ConfidenceLevel?), Azure.ResourceManager.ImpactReporting.Models.ClientIncidentDetails clientIncidentDetails = null) { throw null; } + } + public partial class ClientIncidentDetails : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ClientIncidentDetails() { } + public string ClientIncidentId { get { throw null; } set { } } + public Azure.ResourceManager.ImpactReporting.Models.IncidentSource? ClientIncidentSource { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ImpactReporting.Models.ClientIncidentDetails System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ImpactReporting.Models.ClientIncidentDetails System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct ConfidenceLevel : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public ConfidenceLevel(string value) { throw null; } + public static Azure.ResourceManager.ImpactReporting.Models.ConfidenceLevel High { get { throw null; } } + public static Azure.ResourceManager.ImpactReporting.Models.ConfidenceLevel Low { get { throw null; } } + public static Azure.ResourceManager.ImpactReporting.Models.ConfidenceLevel Medium { get { throw null; } } + public bool Equals(Azure.ResourceManager.ImpactReporting.Models.ConfidenceLevel other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.ImpactReporting.Models.ConfidenceLevel left, Azure.ResourceManager.ImpactReporting.Models.ConfidenceLevel right) { throw null; } + public static implicit operator Azure.ResourceManager.ImpactReporting.Models.ConfidenceLevel (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.ImpactReporting.Models.ConfidenceLevel left, Azure.ResourceManager.ImpactReporting.Models.ConfidenceLevel right) { throw null; } + public override string ToString() { throw null; } + } + public partial class Connectivity : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public Connectivity() { } + public int? Port { get { throw null; } set { } } + public Azure.ResourceManager.ImpactReporting.Models.Protocol? Protocol { get { throw null; } set { } } + public string SourceAzureResourceId { get { throw null; } set { } } + public string TargetAzureResourceId { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ImpactReporting.Models.Connectivity System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ImpactReporting.Models.Connectivity System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ConnectorPatch : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ConnectorPatch() { } + public Azure.ResourceManager.ImpactReporting.Models.Platform? ConnectorType { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ImpactReporting.Models.ConnectorPatch System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ImpactReporting.Models.ConnectorPatch System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ConnectorProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ConnectorProperties(string connectorId, string tenantId, Azure.ResourceManager.ImpactReporting.Models.Platform connectorType, System.DateTimeOffset lastRunTimeStamp) { } + public string ConnectorId { get { throw null; } } + public Azure.ResourceManager.ImpactReporting.Models.Platform ConnectorType { get { throw null; } set { } } + public System.DateTimeOffset LastRunTimeStamp { get { throw null; } } + public Azure.ResourceManager.ImpactReporting.Models.ProvisioningState? ProvisioningState { get { throw null; } } + public string TenantId { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ImpactReporting.Models.ConnectorProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ImpactReporting.Models.ConnectorProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class Content : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public Content(string title, string description) { } + public string Description { get { throw null; } set { } } + public string Title { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ImpactReporting.Models.Content System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ImpactReporting.Models.Content System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ErrorDetailProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ErrorDetailProperties() { } + public string ErrorCode { get { throw null; } set { } } + public string ErrorMessage { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ImpactReporting.Models.ErrorDetailProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ImpactReporting.Models.ErrorDetailProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ExpectedValueRange : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ExpectedValueRange(double min, double max) { } + public double Max { get { throw null; } set { } } + public double Min { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ImpactReporting.Models.ExpectedValueRange System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ImpactReporting.Models.ExpectedValueRange System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ImpactCategoryProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal ImpactCategoryProperties() { } + public string CategoryId { get { throw null; } } + public string Description { get { throw null; } } + public string ParentCategoryId { get { throw null; } } + public Azure.ResourceManager.ImpactReporting.Models.ProvisioningState? ProvisioningState { get { throw null; } } + public System.Collections.Generic.IReadOnlyList RequiredImpactProperties { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ImpactReporting.Models.ImpactCategoryProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ImpactReporting.Models.ImpactCategoryProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ImpactDetails : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ImpactDetails(string impactedResourceId, System.DateTimeOffset startOn, string impactId) { } + public System.DateTimeOffset? EndOn { get { throw null; } set { } } + public string ImpactedResourceId { get { throw null; } set { } } + public string ImpactId { get { throw null; } set { } } + public System.DateTimeOffset StartOn { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ImpactReporting.Models.ImpactDetails System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ImpactReporting.Models.ImpactDetails System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct IncidentSource : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public IncidentSource(string value) { throw null; } + public static Azure.ResourceManager.ImpactReporting.Models.IncidentSource AzureDevops { get { throw null; } } + public static Azure.ResourceManager.ImpactReporting.Models.IncidentSource ICM { get { throw null; } } + public static Azure.ResourceManager.ImpactReporting.Models.IncidentSource Jira { get { throw null; } } + public static Azure.ResourceManager.ImpactReporting.Models.IncidentSource Other { get { throw null; } } + public static Azure.ResourceManager.ImpactReporting.Models.IncidentSource ServiceNow { get { throw null; } } + public bool Equals(Azure.ResourceManager.ImpactReporting.Models.IncidentSource other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.ImpactReporting.Models.IncidentSource left, Azure.ResourceManager.ImpactReporting.Models.IncidentSource right) { throw null; } + public static implicit operator Azure.ResourceManager.ImpactReporting.Models.IncidentSource (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.ImpactReporting.Models.IncidentSource left, Azure.ResourceManager.ImpactReporting.Models.IncidentSource right) { throw null; } + public override string ToString() { throw null; } + } + public partial class InsightProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public InsightProperties(string category, Azure.ResourceManager.ImpactReporting.Models.Content content, string insightUniqueId, Azure.ResourceManager.ImpactReporting.Models.ImpactDetails impact) { } + public Azure.ResourceManager.ImpactReporting.Models.InsightPropertiesAdditionalDetails AdditionalDetails { get { throw null; } set { } } + public string Category { get { throw null; } set { } } + public Azure.ResourceManager.ImpactReporting.Models.Content Content { get { throw null; } set { } } + public string EventId { get { throw null; } set { } } + public System.DateTimeOffset? EventOn { get { throw null; } set { } } + public string GroupId { get { throw null; } set { } } + public Azure.ResourceManager.ImpactReporting.Models.ImpactDetails Impact { get { throw null; } set { } } + public string InsightUniqueId { get { throw null; } set { } } + public Azure.ResourceManager.ImpactReporting.Models.ProvisioningState? ProvisioningState { get { throw null; } } + public string Status { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ImpactReporting.Models.InsightProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ImpactReporting.Models.InsightProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class InsightPropertiesAdditionalDetails : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public InsightPropertiesAdditionalDetails() { } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ImpactReporting.Models.InsightPropertiesAdditionalDetails System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ImpactReporting.Models.InsightPropertiesAdditionalDetails System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct MetricUnit : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public MetricUnit(string value) { throw null; } + public static Azure.ResourceManager.ImpactReporting.Models.MetricUnit Bytes { get { throw null; } } + public static Azure.ResourceManager.ImpactReporting.Models.MetricUnit ByteSeconds { get { throw null; } } + public static Azure.ResourceManager.ImpactReporting.Models.MetricUnit BytesPerSecond { get { throw null; } } + public static Azure.ResourceManager.ImpactReporting.Models.MetricUnit Cores { get { throw null; } } + public static Azure.ResourceManager.ImpactReporting.Models.MetricUnit Count { get { throw null; } } + public static Azure.ResourceManager.ImpactReporting.Models.MetricUnit CountPerSecond { get { throw null; } } + public static Azure.ResourceManager.ImpactReporting.Models.MetricUnit MilliCores { get { throw null; } } + public static Azure.ResourceManager.ImpactReporting.Models.MetricUnit MilliSeconds { get { throw null; } } + public static Azure.ResourceManager.ImpactReporting.Models.MetricUnit NanoCores { get { throw null; } } + public static Azure.ResourceManager.ImpactReporting.Models.MetricUnit Other { get { throw null; } } + public static Azure.ResourceManager.ImpactReporting.Models.MetricUnit Percent { get { throw null; } } + public static Azure.ResourceManager.ImpactReporting.Models.MetricUnit Seconds { get { throw null; } } + public bool Equals(Azure.ResourceManager.ImpactReporting.Models.MetricUnit other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.ImpactReporting.Models.MetricUnit left, Azure.ResourceManager.ImpactReporting.Models.MetricUnit right) { throw null; } + public static implicit operator Azure.ResourceManager.ImpactReporting.Models.MetricUnit (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.ImpactReporting.Models.MetricUnit left, Azure.ResourceManager.ImpactReporting.Models.MetricUnit right) { throw null; } + public override string ToString() { throw null; } + } + public partial class Performance : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public Performance() { } + public double? Actual { get { throw null; } set { } } + public double? Expected { get { throw null; } set { } } + public Azure.ResourceManager.ImpactReporting.Models.ExpectedValueRange ExpectedValueRange { get { throw null; } set { } } + public string MetricName { get { throw null; } set { } } + public Azure.ResourceManager.ImpactReporting.Models.MetricUnit? Unit { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ImpactReporting.Models.Performance System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ImpactReporting.Models.Performance System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct Platform : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public Platform(string value) { throw null; } + public static Azure.ResourceManager.ImpactReporting.Models.Platform AzureMonitor { get { throw null; } } + public bool Equals(Azure.ResourceManager.ImpactReporting.Models.Platform other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.ImpactReporting.Models.Platform left, Azure.ResourceManager.ImpactReporting.Models.Platform right) { throw null; } + public static implicit operator Azure.ResourceManager.ImpactReporting.Models.Platform (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.ImpactReporting.Models.Platform left, Azure.ResourceManager.ImpactReporting.Models.Platform right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct Protocol : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public Protocol(string value) { throw null; } + public static Azure.ResourceManager.ImpactReporting.Models.Protocol FTP { get { throw null; } } + public static Azure.ResourceManager.ImpactReporting.Models.Protocol HTTP { get { throw null; } } + public static Azure.ResourceManager.ImpactReporting.Models.Protocol HTTPS { get { throw null; } } + public static Azure.ResourceManager.ImpactReporting.Models.Protocol Other { get { throw null; } } + public static Azure.ResourceManager.ImpactReporting.Models.Protocol RDP { get { throw null; } } + public static Azure.ResourceManager.ImpactReporting.Models.Protocol SSH { get { throw null; } } + public static Azure.ResourceManager.ImpactReporting.Models.Protocol TCP { get { throw null; } } + public static Azure.ResourceManager.ImpactReporting.Models.Protocol UDP { get { throw null; } } + public bool Equals(Azure.ResourceManager.ImpactReporting.Models.Protocol other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.ImpactReporting.Models.Protocol left, Azure.ResourceManager.ImpactReporting.Models.Protocol right) { throw null; } + public static implicit operator Azure.ResourceManager.ImpactReporting.Models.Protocol (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.ImpactReporting.Models.Protocol left, Azure.ResourceManager.ImpactReporting.Models.Protocol right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct ProvisioningState : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public ProvisioningState(string value) { throw null; } + public static Azure.ResourceManager.ImpactReporting.Models.ProvisioningState Canceled { get { throw null; } } + public static Azure.ResourceManager.ImpactReporting.Models.ProvisioningState Failed { get { throw null; } } + public static Azure.ResourceManager.ImpactReporting.Models.ProvisioningState Succeeded { get { throw null; } } + public bool Equals(Azure.ResourceManager.ImpactReporting.Models.ProvisioningState other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.ImpactReporting.Models.ProvisioningState left, Azure.ResourceManager.ImpactReporting.Models.ProvisioningState right) { throw null; } + public static implicit operator Azure.ResourceManager.ImpactReporting.Models.ProvisioningState (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.ImpactReporting.Models.ProvisioningState left, Azure.ResourceManager.ImpactReporting.Models.ProvisioningState right) { throw null; } + public override string ToString() { throw null; } + } + public partial class RequiredImpactProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal RequiredImpactProperties() { } + public System.Collections.Generic.IReadOnlyList AllowedValues { get { throw null; } } + public string Name { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ImpactReporting.Models.RequiredImpactProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ImpactReporting.Models.RequiredImpactProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct Toolset : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public Toolset(string value) { throw null; } + public static Azure.ResourceManager.ImpactReporting.Models.Toolset Ansible { get { throw null; } } + public static Azure.ResourceManager.ImpactReporting.Models.Toolset ARM { get { throw null; } } + public static Azure.ResourceManager.ImpactReporting.Models.Toolset Chef { get { throw null; } } + public static Azure.ResourceManager.ImpactReporting.Models.Toolset Other { get { throw null; } } + public static Azure.ResourceManager.ImpactReporting.Models.Toolset Portal { get { throw null; } } + public static Azure.ResourceManager.ImpactReporting.Models.Toolset Puppet { get { throw null; } } + public static Azure.ResourceManager.ImpactReporting.Models.Toolset SDK { get { throw null; } } + public static Azure.ResourceManager.ImpactReporting.Models.Toolset Shell { get { throw null; } } + public static Azure.ResourceManager.ImpactReporting.Models.Toolset Terraform { get { throw null; } } + public bool Equals(Azure.ResourceManager.ImpactReporting.Models.Toolset other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.ImpactReporting.Models.Toolset left, Azure.ResourceManager.ImpactReporting.Models.Toolset right) { throw null; } + public static implicit operator Azure.ResourceManager.ImpactReporting.Models.Toolset (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.ImpactReporting.Models.Toolset left, Azure.ResourceManager.ImpactReporting.Models.Toolset right) { throw null; } + public override string ToString() { throw null; } + } + public partial class Workload : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public Workload() { } + public string Context { get { throw null; } set { } } + public Azure.ResourceManager.ImpactReporting.Models.Toolset? Toolset { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ImpactReporting.Models.Workload System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ImpactReporting.Models.Workload System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class WorkloadImpactProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public WorkloadImpactProperties(System.DateTimeOffset startOn, string impactedResourceId, string impactCategory) { } + public Azure.ResourceManager.ImpactReporting.Models.WorkloadImpactPropertiesAdditionalProperties AdditionalProperties { get { throw null; } set { } } + public System.Collections.Generic.IList ArmCorrelationIds { get { throw null; } } + public Azure.ResourceManager.ImpactReporting.Models.ClientIncidentDetails ClientIncidentDetails { get { throw null; } set { } } + public Azure.ResourceManager.ImpactReporting.Models.ConfidenceLevel? ConfidenceLevel { get { throw null; } set { } } + public Azure.ResourceManager.ImpactReporting.Models.Connectivity Connectivity { get { throw null; } set { } } + public System.DateTimeOffset? EndOn { get { throw null; } set { } } + public Azure.ResourceManager.ImpactReporting.Models.ErrorDetailProperties ErrorDetails { get { throw null; } set { } } + public string ImpactCategory { get { throw null; } set { } } + public string ImpactDescription { get { throw null; } set { } } + public string ImpactedResourceId { get { throw null; } set { } } + public string ImpactGroupId { get { throw null; } set { } } + public string ImpactUniqueId { get { throw null; } } + public System.Collections.Generic.IList Performance { get { throw null; } } + public Azure.ResourceManager.ImpactReporting.Models.ProvisioningState? ProvisioningState { get { throw null; } } + public System.DateTimeOffset? ReportedTimeUtc { get { throw null; } } + public System.DateTimeOffset StartOn { get { throw null; } set { } } + public Azure.ResourceManager.ImpactReporting.Models.Workload Workload { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ImpactReporting.Models.WorkloadImpactProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ImpactReporting.Models.WorkloadImpactProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class WorkloadImpactPropertiesAdditionalProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public WorkloadImpactPropertiesAdditionalProperties() { } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ImpactReporting.Models.WorkloadImpactPropertiesAdditionalProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ImpactReporting.Models.WorkloadImpactPropertiesAdditionalProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } +} diff --git a/sdk/impactreporting/Azure.ResourceManager.ImpactReporting/api/Azure.ResourceManager.ImpactReporting.netstandard2.0.cs b/sdk/impactreporting/Azure.ResourceManager.ImpactReporting/api/Azure.ResourceManager.ImpactReporting.netstandard2.0.cs new file mode 100644 index 000000000000..4db467f25c36 --- /dev/null +++ b/sdk/impactreporting/Azure.ResourceManager.ImpactReporting/api/Azure.ResourceManager.ImpactReporting.netstandard2.0.cs @@ -0,0 +1,616 @@ +namespace Azure.ResourceManager.ImpactReporting +{ + public partial class ConnectorCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected ConnectorCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string connectorName, Azure.ResourceManager.ImpactReporting.ConnectorData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string connectorName, Azure.ResourceManager.ImpactReporting.ConnectorData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string connectorName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string connectorName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string connectorName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string connectorName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string connectorName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string connectorName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class ConnectorData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ConnectorData() { } + public Azure.ResourceManager.ImpactReporting.Models.ConnectorProperties Properties { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ImpactReporting.ConnectorData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ImpactReporting.ConnectorData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ConnectorResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected ConnectorResource() { } + public virtual Azure.ResourceManager.ImpactReporting.ConnectorData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string connectorName) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + Azure.ResourceManager.ImpactReporting.ConnectorData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ImpactReporting.ConnectorData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public virtual Azure.Response Update(Azure.ResourceManager.ImpactReporting.Models.ConnectorPatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.ResourceManager.ImpactReporting.Models.ConnectorPatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class ImpactCategoryCollection : Azure.ResourceManager.ArmCollection + { + protected ImpactCategoryCollection() { } + public virtual Azure.Response Exists(string impactCategoryName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string impactCategoryName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string impactCategoryName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(string resourceType, string categoryName = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(string resourceType, string categoryName = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string impactCategoryName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string impactCategoryName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string impactCategoryName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class ImpactCategoryData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal ImpactCategoryData() { } + public Azure.ResourceManager.ImpactReporting.Models.ImpactCategoryProperties Properties { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ImpactReporting.ImpactCategoryData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ImpactReporting.ImpactCategoryData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ImpactCategoryResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected ImpactCategoryResource() { } + public virtual Azure.ResourceManager.ImpactReporting.ImpactCategoryData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string impactCategoryName) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + Azure.ResourceManager.ImpactReporting.ImpactCategoryData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ImpactReporting.ImpactCategoryData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public static partial class ImpactReportingExtensions + { + public static Azure.Response GetConnector(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, string connectorName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static System.Threading.Tasks.Task> GetConnectorAsync(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, string connectorName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.ResourceManager.ImpactReporting.ConnectorResource GetConnectorResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.ImpactReporting.ConnectorCollection GetConnectors(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource) { throw null; } + public static Azure.ResourceManager.ImpactReporting.ImpactCategoryCollection GetImpactCategories(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource) { throw null; } + public static Azure.Response GetImpactCategory(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, string impactCategoryName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static System.Threading.Tasks.Task> GetImpactCategoryAsync(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, string impactCategoryName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.ResourceManager.ImpactReporting.ImpactCategoryResource GetImpactCategoryResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.ImpactReporting.InsightResource GetInsightResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.Response GetWorkloadImpact(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, string workloadImpactName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static System.Threading.Tasks.Task> GetWorkloadImpactAsync(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, string workloadImpactName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.ResourceManager.ImpactReporting.WorkloadImpactResource GetWorkloadImpactResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.ImpactReporting.WorkloadImpactCollection GetWorkloadImpacts(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource) { throw null; } + } + public partial class InsightCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected InsightCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string insightName, Azure.ResourceManager.ImpactReporting.InsightData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string insightName, Azure.ResourceManager.ImpactReporting.InsightData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string insightName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string insightName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string insightName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string insightName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string insightName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string insightName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class InsightData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public InsightData() { } + public Azure.ResourceManager.ImpactReporting.Models.InsightProperties Properties { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ImpactReporting.InsightData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ImpactReporting.InsightData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class InsightResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected InsightResource() { } + public virtual Azure.ResourceManager.ImpactReporting.InsightData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string workloadImpactName, string insightName) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + Azure.ResourceManager.ImpactReporting.InsightData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ImpactReporting.InsightData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.ImpactReporting.InsightData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.ImpactReporting.InsightData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class WorkloadImpactCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected WorkloadImpactCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string workloadImpactName, Azure.ResourceManager.ImpactReporting.WorkloadImpactData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string workloadImpactName, Azure.ResourceManager.ImpactReporting.WorkloadImpactData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string workloadImpactName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string workloadImpactName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string workloadImpactName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string workloadImpactName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string workloadImpactName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string workloadImpactName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class WorkloadImpactData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public WorkloadImpactData() { } + public Azure.ResourceManager.ImpactReporting.Models.WorkloadImpactProperties Properties { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ImpactReporting.WorkloadImpactData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ImpactReporting.WorkloadImpactData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class WorkloadImpactResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected WorkloadImpactResource() { } + public virtual Azure.ResourceManager.ImpactReporting.WorkloadImpactData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string workloadImpactName) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response GetInsight(string insightName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetInsightAsync(string insightName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.ImpactReporting.InsightCollection GetInsights() { throw null; } + Azure.ResourceManager.ImpactReporting.WorkloadImpactData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ImpactReporting.WorkloadImpactData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.ImpactReporting.WorkloadImpactData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.ImpactReporting.WorkloadImpactData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } +} +namespace Azure.ResourceManager.ImpactReporting.Mocking +{ + public partial class MockableImpactReportingArmClient : Azure.ResourceManager.ArmResource + { + protected MockableImpactReportingArmClient() { } + public virtual Azure.ResourceManager.ImpactReporting.ConnectorResource GetConnectorResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.ImpactReporting.ImpactCategoryResource GetImpactCategoryResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.ImpactReporting.InsightResource GetInsightResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.ImpactReporting.WorkloadImpactResource GetWorkloadImpactResource(Azure.Core.ResourceIdentifier id) { throw null; } + } + public partial class MockableImpactReportingSubscriptionResource : Azure.ResourceManager.ArmResource + { + protected MockableImpactReportingSubscriptionResource() { } + public virtual Azure.Response GetConnector(string connectorName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetConnectorAsync(string connectorName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.ImpactReporting.ConnectorCollection GetConnectors() { throw null; } + public virtual Azure.ResourceManager.ImpactReporting.ImpactCategoryCollection GetImpactCategories() { throw null; } + public virtual Azure.Response GetImpactCategory(string impactCategoryName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetImpactCategoryAsync(string impactCategoryName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response GetWorkloadImpact(string workloadImpactName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetWorkloadImpactAsync(string workloadImpactName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.ImpactReporting.WorkloadImpactCollection GetWorkloadImpacts() { throw null; } + } +} +namespace Azure.ResourceManager.ImpactReporting.Models +{ + public static partial class ArmImpactReportingModelFactory + { + public static Azure.ResourceManager.ImpactReporting.ConnectorData ConnectorData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.ImpactReporting.Models.ConnectorProperties properties = null) { throw null; } + public static Azure.ResourceManager.ImpactReporting.Models.ConnectorProperties ConnectorProperties(Azure.ResourceManager.ImpactReporting.Models.ProvisioningState? provisioningState = default(Azure.ResourceManager.ImpactReporting.Models.ProvisioningState?), string connectorId = null, string tenantId = null, Azure.ResourceManager.ImpactReporting.Models.Platform connectorType = default(Azure.ResourceManager.ImpactReporting.Models.Platform), System.DateTimeOffset lastRunTimeStamp = default(System.DateTimeOffset)) { throw null; } + public static Azure.ResourceManager.ImpactReporting.ImpactCategoryData ImpactCategoryData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.ImpactReporting.Models.ImpactCategoryProperties properties = null) { throw null; } + public static Azure.ResourceManager.ImpactReporting.Models.ImpactCategoryProperties ImpactCategoryProperties(Azure.ResourceManager.ImpactReporting.Models.ProvisioningState? provisioningState = default(Azure.ResourceManager.ImpactReporting.Models.ProvisioningState?), string categoryId = null, string parentCategoryId = null, string description = null, System.Collections.Generic.IEnumerable requiredImpactProperties = null) { throw null; } + public static Azure.ResourceManager.ImpactReporting.InsightData InsightData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.ImpactReporting.Models.InsightProperties properties = null) { throw null; } + public static Azure.ResourceManager.ImpactReporting.Models.InsightProperties InsightProperties(Azure.ResourceManager.ImpactReporting.Models.ProvisioningState? provisioningState = default(Azure.ResourceManager.ImpactReporting.Models.ProvisioningState?), string category = null, string status = null, string eventId = null, string groupId = null, Azure.ResourceManager.ImpactReporting.Models.Content content = null, System.DateTimeOffset? eventOn = default(System.DateTimeOffset?), string insightUniqueId = null, Azure.ResourceManager.ImpactReporting.Models.ImpactDetails impact = null, Azure.ResourceManager.ImpactReporting.Models.InsightPropertiesAdditionalDetails additionalDetails = null) { throw null; } + public static Azure.ResourceManager.ImpactReporting.Models.RequiredImpactProperties RequiredImpactProperties(string name = null, System.Collections.Generic.IEnumerable allowedValues = null) { throw null; } + public static Azure.ResourceManager.ImpactReporting.WorkloadImpactData WorkloadImpactData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.ImpactReporting.Models.WorkloadImpactProperties properties = null) { throw null; } + public static Azure.ResourceManager.ImpactReporting.Models.WorkloadImpactProperties WorkloadImpactProperties(Azure.ResourceManager.ImpactReporting.Models.ProvisioningState? provisioningState = default(Azure.ResourceManager.ImpactReporting.Models.ProvisioningState?), System.DateTimeOffset startOn = default(System.DateTimeOffset), System.DateTimeOffset? endOn = default(System.DateTimeOffset?), string impactedResourceId = null, string impactUniqueId = null, System.DateTimeOffset? reportedTimeUtc = default(System.DateTimeOffset?), string impactCategory = null, string impactDescription = null, System.Collections.Generic.IEnumerable armCorrelationIds = null, System.Collections.Generic.IEnumerable performance = null, Azure.ResourceManager.ImpactReporting.Models.Connectivity connectivity = null, Azure.ResourceManager.ImpactReporting.Models.WorkloadImpactPropertiesAdditionalProperties additionalProperties = null, Azure.ResourceManager.ImpactReporting.Models.ErrorDetailProperties errorDetails = null, Azure.ResourceManager.ImpactReporting.Models.Workload workload = null, string impactGroupId = null, Azure.ResourceManager.ImpactReporting.Models.ConfidenceLevel? confidenceLevel = default(Azure.ResourceManager.ImpactReporting.Models.ConfidenceLevel?), Azure.ResourceManager.ImpactReporting.Models.ClientIncidentDetails clientIncidentDetails = null) { throw null; } + } + public partial class ClientIncidentDetails : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ClientIncidentDetails() { } + public string ClientIncidentId { get { throw null; } set { } } + public Azure.ResourceManager.ImpactReporting.Models.IncidentSource? ClientIncidentSource { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ImpactReporting.Models.ClientIncidentDetails System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ImpactReporting.Models.ClientIncidentDetails System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct ConfidenceLevel : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public ConfidenceLevel(string value) { throw null; } + public static Azure.ResourceManager.ImpactReporting.Models.ConfidenceLevel High { get { throw null; } } + public static Azure.ResourceManager.ImpactReporting.Models.ConfidenceLevel Low { get { throw null; } } + public static Azure.ResourceManager.ImpactReporting.Models.ConfidenceLevel Medium { get { throw null; } } + public bool Equals(Azure.ResourceManager.ImpactReporting.Models.ConfidenceLevel other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.ImpactReporting.Models.ConfidenceLevel left, Azure.ResourceManager.ImpactReporting.Models.ConfidenceLevel right) { throw null; } + public static implicit operator Azure.ResourceManager.ImpactReporting.Models.ConfidenceLevel (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.ImpactReporting.Models.ConfidenceLevel left, Azure.ResourceManager.ImpactReporting.Models.ConfidenceLevel right) { throw null; } + public override string ToString() { throw null; } + } + public partial class Connectivity : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public Connectivity() { } + public int? Port { get { throw null; } set { } } + public Azure.ResourceManager.ImpactReporting.Models.Protocol? Protocol { get { throw null; } set { } } + public string SourceAzureResourceId { get { throw null; } set { } } + public string TargetAzureResourceId { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ImpactReporting.Models.Connectivity System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ImpactReporting.Models.Connectivity System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ConnectorPatch : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ConnectorPatch() { } + public Azure.ResourceManager.ImpactReporting.Models.Platform? ConnectorType { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ImpactReporting.Models.ConnectorPatch System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ImpactReporting.Models.ConnectorPatch System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ConnectorProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ConnectorProperties(string connectorId, string tenantId, Azure.ResourceManager.ImpactReporting.Models.Platform connectorType, System.DateTimeOffset lastRunTimeStamp) { } + public string ConnectorId { get { throw null; } } + public Azure.ResourceManager.ImpactReporting.Models.Platform ConnectorType { get { throw null; } set { } } + public System.DateTimeOffset LastRunTimeStamp { get { throw null; } } + public Azure.ResourceManager.ImpactReporting.Models.ProvisioningState? ProvisioningState { get { throw null; } } + public string TenantId { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ImpactReporting.Models.ConnectorProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ImpactReporting.Models.ConnectorProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class Content : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public Content(string title, string description) { } + public string Description { get { throw null; } set { } } + public string Title { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ImpactReporting.Models.Content System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ImpactReporting.Models.Content System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ErrorDetailProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ErrorDetailProperties() { } + public string ErrorCode { get { throw null; } set { } } + public string ErrorMessage { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ImpactReporting.Models.ErrorDetailProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ImpactReporting.Models.ErrorDetailProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ExpectedValueRange : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ExpectedValueRange(double min, double max) { } + public double Max { get { throw null; } set { } } + public double Min { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ImpactReporting.Models.ExpectedValueRange System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ImpactReporting.Models.ExpectedValueRange System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ImpactCategoryProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal ImpactCategoryProperties() { } + public string CategoryId { get { throw null; } } + public string Description { get { throw null; } } + public string ParentCategoryId { get { throw null; } } + public Azure.ResourceManager.ImpactReporting.Models.ProvisioningState? ProvisioningState { get { throw null; } } + public System.Collections.Generic.IReadOnlyList RequiredImpactProperties { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ImpactReporting.Models.ImpactCategoryProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ImpactReporting.Models.ImpactCategoryProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ImpactDetails : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ImpactDetails(string impactedResourceId, System.DateTimeOffset startOn, string impactId) { } + public System.DateTimeOffset? EndOn { get { throw null; } set { } } + public string ImpactedResourceId { get { throw null; } set { } } + public string ImpactId { get { throw null; } set { } } + public System.DateTimeOffset StartOn { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ImpactReporting.Models.ImpactDetails System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ImpactReporting.Models.ImpactDetails System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct IncidentSource : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public IncidentSource(string value) { throw null; } + public static Azure.ResourceManager.ImpactReporting.Models.IncidentSource AzureDevops { get { throw null; } } + public static Azure.ResourceManager.ImpactReporting.Models.IncidentSource ICM { get { throw null; } } + public static Azure.ResourceManager.ImpactReporting.Models.IncidentSource Jira { get { throw null; } } + public static Azure.ResourceManager.ImpactReporting.Models.IncidentSource Other { get { throw null; } } + public static Azure.ResourceManager.ImpactReporting.Models.IncidentSource ServiceNow { get { throw null; } } + public bool Equals(Azure.ResourceManager.ImpactReporting.Models.IncidentSource other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.ImpactReporting.Models.IncidentSource left, Azure.ResourceManager.ImpactReporting.Models.IncidentSource right) { throw null; } + public static implicit operator Azure.ResourceManager.ImpactReporting.Models.IncidentSource (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.ImpactReporting.Models.IncidentSource left, Azure.ResourceManager.ImpactReporting.Models.IncidentSource right) { throw null; } + public override string ToString() { throw null; } + } + public partial class InsightProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public InsightProperties(string category, Azure.ResourceManager.ImpactReporting.Models.Content content, string insightUniqueId, Azure.ResourceManager.ImpactReporting.Models.ImpactDetails impact) { } + public Azure.ResourceManager.ImpactReporting.Models.InsightPropertiesAdditionalDetails AdditionalDetails { get { throw null; } set { } } + public string Category { get { throw null; } set { } } + public Azure.ResourceManager.ImpactReporting.Models.Content Content { get { throw null; } set { } } + public string EventId { get { throw null; } set { } } + public System.DateTimeOffset? EventOn { get { throw null; } set { } } + public string GroupId { get { throw null; } set { } } + public Azure.ResourceManager.ImpactReporting.Models.ImpactDetails Impact { get { throw null; } set { } } + public string InsightUniqueId { get { throw null; } set { } } + public Azure.ResourceManager.ImpactReporting.Models.ProvisioningState? ProvisioningState { get { throw null; } } + public string Status { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ImpactReporting.Models.InsightProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ImpactReporting.Models.InsightProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class InsightPropertiesAdditionalDetails : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public InsightPropertiesAdditionalDetails() { } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ImpactReporting.Models.InsightPropertiesAdditionalDetails System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ImpactReporting.Models.InsightPropertiesAdditionalDetails System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct MetricUnit : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public MetricUnit(string value) { throw null; } + public static Azure.ResourceManager.ImpactReporting.Models.MetricUnit Bytes { get { throw null; } } + public static Azure.ResourceManager.ImpactReporting.Models.MetricUnit ByteSeconds { get { throw null; } } + public static Azure.ResourceManager.ImpactReporting.Models.MetricUnit BytesPerSecond { get { throw null; } } + public static Azure.ResourceManager.ImpactReporting.Models.MetricUnit Cores { get { throw null; } } + public static Azure.ResourceManager.ImpactReporting.Models.MetricUnit Count { get { throw null; } } + public static Azure.ResourceManager.ImpactReporting.Models.MetricUnit CountPerSecond { get { throw null; } } + public static Azure.ResourceManager.ImpactReporting.Models.MetricUnit MilliCores { get { throw null; } } + public static Azure.ResourceManager.ImpactReporting.Models.MetricUnit MilliSeconds { get { throw null; } } + public static Azure.ResourceManager.ImpactReporting.Models.MetricUnit NanoCores { get { throw null; } } + public static Azure.ResourceManager.ImpactReporting.Models.MetricUnit Other { get { throw null; } } + public static Azure.ResourceManager.ImpactReporting.Models.MetricUnit Percent { get { throw null; } } + public static Azure.ResourceManager.ImpactReporting.Models.MetricUnit Seconds { get { throw null; } } + public bool Equals(Azure.ResourceManager.ImpactReporting.Models.MetricUnit other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.ImpactReporting.Models.MetricUnit left, Azure.ResourceManager.ImpactReporting.Models.MetricUnit right) { throw null; } + public static implicit operator Azure.ResourceManager.ImpactReporting.Models.MetricUnit (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.ImpactReporting.Models.MetricUnit left, Azure.ResourceManager.ImpactReporting.Models.MetricUnit right) { throw null; } + public override string ToString() { throw null; } + } + public partial class Performance : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public Performance() { } + public double? Actual { get { throw null; } set { } } + public double? Expected { get { throw null; } set { } } + public Azure.ResourceManager.ImpactReporting.Models.ExpectedValueRange ExpectedValueRange { get { throw null; } set { } } + public string MetricName { get { throw null; } set { } } + public Azure.ResourceManager.ImpactReporting.Models.MetricUnit? Unit { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ImpactReporting.Models.Performance System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ImpactReporting.Models.Performance System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct Platform : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public Platform(string value) { throw null; } + public static Azure.ResourceManager.ImpactReporting.Models.Platform AzureMonitor { get { throw null; } } + public bool Equals(Azure.ResourceManager.ImpactReporting.Models.Platform other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.ImpactReporting.Models.Platform left, Azure.ResourceManager.ImpactReporting.Models.Platform right) { throw null; } + public static implicit operator Azure.ResourceManager.ImpactReporting.Models.Platform (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.ImpactReporting.Models.Platform left, Azure.ResourceManager.ImpactReporting.Models.Platform right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct Protocol : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public Protocol(string value) { throw null; } + public static Azure.ResourceManager.ImpactReporting.Models.Protocol FTP { get { throw null; } } + public static Azure.ResourceManager.ImpactReporting.Models.Protocol HTTP { get { throw null; } } + public static Azure.ResourceManager.ImpactReporting.Models.Protocol HTTPS { get { throw null; } } + public static Azure.ResourceManager.ImpactReporting.Models.Protocol Other { get { throw null; } } + public static Azure.ResourceManager.ImpactReporting.Models.Protocol RDP { get { throw null; } } + public static Azure.ResourceManager.ImpactReporting.Models.Protocol SSH { get { throw null; } } + public static Azure.ResourceManager.ImpactReporting.Models.Protocol TCP { get { throw null; } } + public static Azure.ResourceManager.ImpactReporting.Models.Protocol UDP { get { throw null; } } + public bool Equals(Azure.ResourceManager.ImpactReporting.Models.Protocol other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.ImpactReporting.Models.Protocol left, Azure.ResourceManager.ImpactReporting.Models.Protocol right) { throw null; } + public static implicit operator Azure.ResourceManager.ImpactReporting.Models.Protocol (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.ImpactReporting.Models.Protocol left, Azure.ResourceManager.ImpactReporting.Models.Protocol right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct ProvisioningState : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public ProvisioningState(string value) { throw null; } + public static Azure.ResourceManager.ImpactReporting.Models.ProvisioningState Canceled { get { throw null; } } + public static Azure.ResourceManager.ImpactReporting.Models.ProvisioningState Failed { get { throw null; } } + public static Azure.ResourceManager.ImpactReporting.Models.ProvisioningState Succeeded { get { throw null; } } + public bool Equals(Azure.ResourceManager.ImpactReporting.Models.ProvisioningState other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.ImpactReporting.Models.ProvisioningState left, Azure.ResourceManager.ImpactReporting.Models.ProvisioningState right) { throw null; } + public static implicit operator Azure.ResourceManager.ImpactReporting.Models.ProvisioningState (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.ImpactReporting.Models.ProvisioningState left, Azure.ResourceManager.ImpactReporting.Models.ProvisioningState right) { throw null; } + public override string ToString() { throw null; } + } + public partial class RequiredImpactProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal RequiredImpactProperties() { } + public System.Collections.Generic.IReadOnlyList AllowedValues { get { throw null; } } + public string Name { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ImpactReporting.Models.RequiredImpactProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ImpactReporting.Models.RequiredImpactProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct Toolset : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public Toolset(string value) { throw null; } + public static Azure.ResourceManager.ImpactReporting.Models.Toolset Ansible { get { throw null; } } + public static Azure.ResourceManager.ImpactReporting.Models.Toolset ARM { get { throw null; } } + public static Azure.ResourceManager.ImpactReporting.Models.Toolset Chef { get { throw null; } } + public static Azure.ResourceManager.ImpactReporting.Models.Toolset Other { get { throw null; } } + public static Azure.ResourceManager.ImpactReporting.Models.Toolset Portal { get { throw null; } } + public static Azure.ResourceManager.ImpactReporting.Models.Toolset Puppet { get { throw null; } } + public static Azure.ResourceManager.ImpactReporting.Models.Toolset SDK { get { throw null; } } + public static Azure.ResourceManager.ImpactReporting.Models.Toolset Shell { get { throw null; } } + public static Azure.ResourceManager.ImpactReporting.Models.Toolset Terraform { get { throw null; } } + public bool Equals(Azure.ResourceManager.ImpactReporting.Models.Toolset other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.ImpactReporting.Models.Toolset left, Azure.ResourceManager.ImpactReporting.Models.Toolset right) { throw null; } + public static implicit operator Azure.ResourceManager.ImpactReporting.Models.Toolset (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.ImpactReporting.Models.Toolset left, Azure.ResourceManager.ImpactReporting.Models.Toolset right) { throw null; } + public override string ToString() { throw null; } + } + public partial class Workload : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public Workload() { } + public string Context { get { throw null; } set { } } + public Azure.ResourceManager.ImpactReporting.Models.Toolset? Toolset { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ImpactReporting.Models.Workload System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ImpactReporting.Models.Workload System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class WorkloadImpactProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public WorkloadImpactProperties(System.DateTimeOffset startOn, string impactedResourceId, string impactCategory) { } + public Azure.ResourceManager.ImpactReporting.Models.WorkloadImpactPropertiesAdditionalProperties AdditionalProperties { get { throw null; } set { } } + public System.Collections.Generic.IList ArmCorrelationIds { get { throw null; } } + public Azure.ResourceManager.ImpactReporting.Models.ClientIncidentDetails ClientIncidentDetails { get { throw null; } set { } } + public Azure.ResourceManager.ImpactReporting.Models.ConfidenceLevel? ConfidenceLevel { get { throw null; } set { } } + public Azure.ResourceManager.ImpactReporting.Models.Connectivity Connectivity { get { throw null; } set { } } + public System.DateTimeOffset? EndOn { get { throw null; } set { } } + public Azure.ResourceManager.ImpactReporting.Models.ErrorDetailProperties ErrorDetails { get { throw null; } set { } } + public string ImpactCategory { get { throw null; } set { } } + public string ImpactDescription { get { throw null; } set { } } + public string ImpactedResourceId { get { throw null; } set { } } + public string ImpactGroupId { get { throw null; } set { } } + public string ImpactUniqueId { get { throw null; } } + public System.Collections.Generic.IList Performance { get { throw null; } } + public Azure.ResourceManager.ImpactReporting.Models.ProvisioningState? ProvisioningState { get { throw null; } } + public System.DateTimeOffset? ReportedTimeUtc { get { throw null; } } + public System.DateTimeOffset StartOn { get { throw null; } set { } } + public Azure.ResourceManager.ImpactReporting.Models.Workload Workload { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ImpactReporting.Models.WorkloadImpactProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ImpactReporting.Models.WorkloadImpactProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class WorkloadImpactPropertiesAdditionalProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public WorkloadImpactPropertiesAdditionalProperties() { } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ImpactReporting.Models.WorkloadImpactPropertiesAdditionalProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ImpactReporting.Models.WorkloadImpactPropertiesAdditionalProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } +} diff --git a/sdk/impactreporting/Azure.ResourceManager.ImpactReporting/assets.json b/sdk/impactreporting/Azure.ResourceManager.ImpactReporting/assets.json new file mode 100644 index 000000000000..547ee1975d7d --- /dev/null +++ b/sdk/impactreporting/Azure.ResourceManager.ImpactReporting/assets.json @@ -0,0 +1,7 @@ + +{ + "AssetsRepo": "Azure/azure-sdk-assets", + "AssetsRepoPrefixPath": "net", + "TagPrefix": "net/impactreporting/Azure.ResourceManager.ImpactReporting", + "Tag": "" +} diff --git a/sdk/impactreporting/Azure.ResourceManager.ImpactReporting/samples/Azure.ResourceManager.ImpactReporting.Samples.csproj b/sdk/impactreporting/Azure.ResourceManager.ImpactReporting/samples/Azure.ResourceManager.ImpactReporting.Samples.csproj new file mode 100644 index 000000000000..01724b6d9e57 --- /dev/null +++ b/sdk/impactreporting/Azure.ResourceManager.ImpactReporting/samples/Azure.ResourceManager.ImpactReporting.Samples.csproj @@ -0,0 +1,13 @@ + + + + + + + + + + + + + diff --git a/sdk/impactreporting/Azure.ResourceManager.ImpactReporting/samples/Generated/Samples/Sample_ConnectorCollection.cs b/sdk/impactreporting/Azure.ResourceManager.ImpactReporting/samples/Generated/Samples/Sample_ConnectorCollection.cs new file mode 100644 index 000000000000..269ee514ecfb --- /dev/null +++ b/sdk/impactreporting/Azure.ResourceManager.ImpactReporting/samples/Generated/Samples/Sample_ConnectorCollection.cs @@ -0,0 +1,191 @@ +// 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.ImpactReporting.Models; +using Azure.ResourceManager.Resources; +using NUnit.Framework; + +namespace Azure.ResourceManager.ImpactReporting.Samples +{ + public partial class Sample_ConnectorCollection + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task CreateOrUpdate_ConnectorsCreateOrUpdate() + { + // Generated from example definition: 2024-05-01-preview/Connectors_CreateOrUpdate.json + // this example is just showing the usage of "Connector_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 SubscriptionResource created on azure + // for more information of creating SubscriptionResource, please refer to the document of SubscriptionResource + string subscriptionId = "74f5e23f-d4d9-410a-bb4d-8f0608adb10d"; + ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(subscriptionId); + SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId); + + // get the collection of this ConnectorResource + ConnectorCollection collection = subscriptionResource.GetConnectors(); + + // invoke the operation + string connectorName = "testconnector1"; + ConnectorData data = new ConnectorData + { + Properties = new ConnectorProperties(null, null, Platform.AzureMonitor, default), + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, connectorName, data); + ConnectorResource 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 + ConnectorData 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_ConnectorsGet() + { + // Generated from example definition: 2024-05-01-preview/Connectors_Get.json + // this example is just showing the usage of "Connector_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 SubscriptionResource created on azure + // for more information of creating SubscriptionResource, please refer to the document of SubscriptionResource + string subscriptionId = "74f5e23f-d4d9-410a-bb4d-8f0608adb10d"; + ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(subscriptionId); + SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId); + + // get the collection of this ConnectorResource + ConnectorCollection collection = subscriptionResource.GetConnectors(); + + // invoke the operation + string connectorName = "testconnector1"; + ConnectorResource result = await collection.GetAsync(connectorName); + + // 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 + ConnectorData 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_ConnectorsListBySubscription() + { + // Generated from example definition: 2024-05-01-preview/Connectors_ListBySubscription.json + // this example is just showing the usage of "Connector_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 = "74f5e23f-d4d9-410a-bb4d-8f0608adb10d"; + ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(subscriptionId); + SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId); + + // get the collection of this ConnectorResource + ConnectorCollection collection = subscriptionResource.GetConnectors(); + + // invoke the operation and iterate over the result + await foreach (ConnectorResource 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 + ConnectorData 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_ConnectorsGet() + { + // Generated from example definition: 2024-05-01-preview/Connectors_Get.json + // this example is just showing the usage of "Connector_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 SubscriptionResource created on azure + // for more information of creating SubscriptionResource, please refer to the document of SubscriptionResource + string subscriptionId = "74f5e23f-d4d9-410a-bb4d-8f0608adb10d"; + ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(subscriptionId); + SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId); + + // get the collection of this ConnectorResource + ConnectorCollection collection = subscriptionResource.GetConnectors(); + + // invoke the operation + string connectorName = "testconnector1"; + bool result = await collection.ExistsAsync(connectorName); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetIfExists_ConnectorsGet() + { + // Generated from example definition: 2024-05-01-preview/Connectors_Get.json + // this example is just showing the usage of "Connector_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 SubscriptionResource created on azure + // for more information of creating SubscriptionResource, please refer to the document of SubscriptionResource + string subscriptionId = "74f5e23f-d4d9-410a-bb4d-8f0608adb10d"; + ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(subscriptionId); + SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId); + + // get the collection of this ConnectorResource + ConnectorCollection collection = subscriptionResource.GetConnectors(); + + // invoke the operation + string connectorName = "testconnector1"; + NullableResponse response = await collection.GetIfExistsAsync(connectorName); + ConnectorResource 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 + ConnectorData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + } +} diff --git a/sdk/impactreporting/Azure.ResourceManager.ImpactReporting/samples/Generated/Samples/Sample_ConnectorResource.cs b/sdk/impactreporting/Azure.ResourceManager.ImpactReporting/samples/Generated/Samples/Sample_ConnectorResource.cs new file mode 100644 index 000000000000..efc8966b25cf --- /dev/null +++ b/sdk/impactreporting/Azure.ResourceManager.ImpactReporting/samples/Generated/Samples/Sample_ConnectorResource.cs @@ -0,0 +1,106 @@ +// 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.ImpactReporting.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.ImpactReporting.Samples +{ + public partial class Sample_ConnectorResource + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_ConnectorsGet() + { + // Generated from example definition: 2024-05-01-preview/Connectors_Get.json + // this example is just showing the usage of "Connector_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 ConnectorResource created on azure + // for more information of creating ConnectorResource, please refer to the document of ConnectorResource + string subscriptionId = "74f5e23f-d4d9-410a-bb4d-8f0608adb10d"; + string connectorName = "testconnector1"; + ResourceIdentifier connectorResourceId = ConnectorResource.CreateResourceIdentifier(subscriptionId, connectorName); + ConnectorResource connector = client.GetConnectorResource(connectorResourceId); + + // invoke the operation + ConnectorResource result = await connector.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 + ConnectorData 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_ConnectorsDelete() + { + // Generated from example definition: 2024-05-01-preview/Connectors_Delete.json + // this example is just showing the usage of "Connector_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 ConnectorResource created on azure + // for more information of creating ConnectorResource, please refer to the document of ConnectorResource + string subscriptionId = "8F74B371-8573-4773-9BDA-D546505BDB3A"; + string connectorName = "testconnector1"; + ResourceIdentifier connectorResourceId = ConnectorResource.CreateResourceIdentifier(subscriptionId, connectorName); + ConnectorResource connector = client.GetConnectorResource(connectorResourceId); + + // invoke the operation + await connector.DeleteAsync(WaitUntil.Completed); + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Update_ConnectorsUpdate() + { + // Generated from example definition: 2024-05-01-preview/Connectors_Update.json + // this example is just showing the usage of "Connector_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 ConnectorResource created on azure + // for more information of creating ConnectorResource, please refer to the document of ConnectorResource + string subscriptionId = "74f5e23f-d4d9-410a-bb4d-8f0608adb10d"; + string connectorName = "testconnector1"; + ResourceIdentifier connectorResourceId = ConnectorResource.CreateResourceIdentifier(subscriptionId, connectorName); + ConnectorResource connector = client.GetConnectorResource(connectorResourceId); + + // invoke the operation + ConnectorPatch patch = new ConnectorPatch + { + ConnectorType = Platform.AzureMonitor, + }; + ConnectorResource result = await connector.UpdateAsync(patch); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + ConnectorData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/impactreporting/Azure.ResourceManager.ImpactReporting/samples/Generated/Samples/Sample_ImpactCategoryCollection.cs b/sdk/impactreporting/Azure.ResourceManager.ImpactReporting/samples/Generated/Samples/Sample_ImpactCategoryCollection.cs new file mode 100644 index 000000000000..65a75ca469b4 --- /dev/null +++ b/sdk/impactreporting/Azure.ResourceManager.ImpactReporting/samples/Generated/Samples/Sample_ImpactCategoryCollection.cs @@ -0,0 +1,154 @@ +// 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.ImpactReporting.Samples +{ + public partial class Sample_ImpactCategoryCollection + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_GetWorkloadImpactResourceByName() + { + // Generated from example definition: 2024-05-01-preview/ImpactCategories_Get.json + // this example is just showing the usage of "ImpactCategory_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 SubscriptionResource created on azure + // for more information of creating SubscriptionResource, please refer to the document of SubscriptionResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(subscriptionId); + SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId); + + // get the collection of this ImpactCategoryResource + ImpactCategoryCollection collection = subscriptionResource.GetImpactCategories(); + + // invoke the operation + string impactCategoryName = "ARMOperation.Create"; + ImpactCategoryResource result = await collection.GetAsync(impactCategoryName); + + // 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 + ImpactCategoryData 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_GetImpactCategoriesListBySubscription() + { + // Generated from example definition: 2024-05-01-preview/ImpactCategories_ListBySubscription.json + // this example is just showing the usage of "ImpactCategory_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 = "00000000-0000-0000-0000-000000000000"; + ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(subscriptionId); + SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId); + + // get the collection of this ImpactCategoryResource + ImpactCategoryCollection collection = subscriptionResource.GetImpactCategories(); + + // invoke the operation and iterate over the result + string resourceType = "microsoft.compute/virtualmachines"; + await foreach (ImpactCategoryResource item in collection.GetAllAsync(resourceType)) + { + // 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 + ImpactCategoryData 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_GetWorkloadImpactResourceByName() + { + // Generated from example definition: 2024-05-01-preview/ImpactCategories_Get.json + // this example is just showing the usage of "ImpactCategory_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 SubscriptionResource created on azure + // for more information of creating SubscriptionResource, please refer to the document of SubscriptionResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(subscriptionId); + SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId); + + // get the collection of this ImpactCategoryResource + ImpactCategoryCollection collection = subscriptionResource.GetImpactCategories(); + + // invoke the operation + string impactCategoryName = "ARMOperation.Create"; + bool result = await collection.ExistsAsync(impactCategoryName); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetIfExists_GetWorkloadImpactResourceByName() + { + // Generated from example definition: 2024-05-01-preview/ImpactCategories_Get.json + // this example is just showing the usage of "ImpactCategory_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 SubscriptionResource created on azure + // for more information of creating SubscriptionResource, please refer to the document of SubscriptionResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(subscriptionId); + SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId); + + // get the collection of this ImpactCategoryResource + ImpactCategoryCollection collection = subscriptionResource.GetImpactCategories(); + + // invoke the operation + string impactCategoryName = "ARMOperation.Create"; + NullableResponse response = await collection.GetIfExistsAsync(impactCategoryName); + ImpactCategoryResource 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 + ImpactCategoryData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + } +} diff --git a/sdk/impactreporting/Azure.ResourceManager.ImpactReporting/samples/Generated/Samples/Sample_ImpactCategoryResource.cs b/sdk/impactreporting/Azure.ResourceManager.ImpactReporting/samples/Generated/Samples/Sample_ImpactCategoryResource.cs new file mode 100644 index 000000000000..1764be354dc9 --- /dev/null +++ b/sdk/impactreporting/Azure.ResourceManager.ImpactReporting/samples/Generated/Samples/Sample_ImpactCategoryResource.cs @@ -0,0 +1,47 @@ +// 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 NUnit.Framework; + +namespace Azure.ResourceManager.ImpactReporting.Samples +{ + public partial class Sample_ImpactCategoryResource + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_GetWorkloadImpactResourceByName() + { + // Generated from example definition: 2024-05-01-preview/ImpactCategories_Get.json + // this example is just showing the usage of "ImpactCategory_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 ImpactCategoryResource created on azure + // for more information of creating ImpactCategoryResource, please refer to the document of ImpactCategoryResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string impactCategoryName = "ARMOperation.Create"; + ResourceIdentifier impactCategoryResourceId = ImpactCategoryResource.CreateResourceIdentifier(subscriptionId, impactCategoryName); + ImpactCategoryResource impactCategory = client.GetImpactCategoryResource(impactCategoryResourceId); + + // invoke the operation + ImpactCategoryResource result = await impactCategory.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 + ImpactCategoryData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/impactreporting/Azure.ResourceManager.ImpactReporting/samples/Generated/Samples/Sample_InsightCollection.cs b/sdk/impactreporting/Azure.ResourceManager.ImpactReporting/samples/Generated/Samples/Sample_InsightCollection.cs new file mode 100644 index 000000000000..38c33592e5bf --- /dev/null +++ b/sdk/impactreporting/Azure.ResourceManager.ImpactReporting/samples/Generated/Samples/Sample_InsightCollection.cs @@ -0,0 +1,405 @@ +// 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.ImpactReporting.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.ImpactReporting.Samples +{ + public partial class Sample_InsightCollection + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task CreateOrUpdate_CreatingAnInsight() + { + // Generated from example definition: 2024-05-01-preview/Insights_Create.json + // this example is just showing the usage of "Insight_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 WorkloadImpactResource created on azure + // for more information of creating WorkloadImpactResource, please refer to the document of WorkloadImpactResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string workloadImpactName = "impactid22"; + ResourceIdentifier workloadImpactResourceId = WorkloadImpactResource.CreateResourceIdentifier(subscriptionId, workloadImpactName); + WorkloadImpactResource workloadImpact = client.GetWorkloadImpactResource(workloadImpactResourceId); + + // get the collection of this InsightResource + InsightCollection collection = workloadImpact.GetInsights(); + + // invoke the operation + string insightName = "insightId12"; + InsightData data = new InsightData + { + Properties = new InsightProperties("repair", new Content("Impact Has been correlated to an outage", "At 2018-11-08T00:00:00Z UTC, your services dependent on these resources VM1 may have experienced an issue.
We have identified an outage that affected these resources(s). You can look at outage information on NL2W-VCZ link.
"), "00000000-0000-0000-0000-000000000000", new ImpactDetails("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resource-rg/providers/Microsoft.Sql/sqlserver/dbservername", DateTimeOffset.Parse("2023-06-15T01:00:00.009223Z"), "/subscriptions/00000000-0000-0000-0000-000000000000/providers/microsoft.Impact/workloadImpacts/impactid22")) + { + Status = "resolved", + EventOn = DateTimeOffset.Parse("2023-06-15T04:00:00.009223Z"), + }, + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, insightName, data); + InsightResource 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 + InsightData 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_GetInsightSampleForDiagnosticsCategory() + { + // Generated from example definition: 2024-05-01-preview/Insights_Get_diagnostics.json + // this example is just showing the usage of "Insight_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 WorkloadImpactResource created on azure + // for more information of creating WorkloadImpactResource, please refer to the document of WorkloadImpactResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string workloadImpactName = "impactid"; + ResourceIdentifier workloadImpactResourceId = WorkloadImpactResource.CreateResourceIdentifier(subscriptionId, workloadImpactName); + WorkloadImpactResource workloadImpact = client.GetWorkloadImpactResource(workloadImpactResourceId); + + // get the collection of this InsightResource + InsightCollection collection = workloadImpact.GetInsights(); + + // invoke the operation + string insightName = "insight1"; + InsightResource result = await collection.GetAsync(insightName); + + // 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 + InsightData 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_GetInsightSampleForMitigationActionCategory() + { + // Generated from example definition: 2024-05-01-preview/Insights_Get_mitigationAction.json + // this example is just showing the usage of "Insight_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 WorkloadImpactResource created on azure + // for more information of creating WorkloadImpactResource, please refer to the document of WorkloadImpactResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string workloadImpactName = "impactId"; + ResourceIdentifier workloadImpactResourceId = WorkloadImpactResource.CreateResourceIdentifier(subscriptionId, workloadImpactName); + WorkloadImpactResource workloadImpact = client.GetWorkloadImpactResource(workloadImpactResourceId); + + // get the collection of this InsightResource + InsightCollection collection = workloadImpact.GetInsights(); + + // invoke the operation + string insightName = "HPCUASucceeded"; + InsightResource result = await collection.GetAsync(insightName); + + // 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 + InsightData 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_GetInsightSampleForServiceHealthCategory() + { + // Generated from example definition: 2024-05-01-preview/Insights_Get_servicehealth.json + // this example is just showing the usage of "Insight_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 WorkloadImpactResource created on azure + // for more information of creating WorkloadImpactResource, please refer to the document of WorkloadImpactResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string workloadImpactName = "impactid"; + ResourceIdentifier workloadImpactResourceId = WorkloadImpactResource.CreateResourceIdentifier(subscriptionId, workloadImpactName); + WorkloadImpactResource workloadImpact = client.GetWorkloadImpactResource(workloadImpactResourceId); + + // get the collection of this InsightResource + InsightCollection collection = workloadImpact.GetInsights(); + + // invoke the operation + string insightName = "insightname"; + InsightResource result = await collection.GetAsync(insightName); + + // 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 + InsightData 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_ListInsightResourcesByWorkloadImpactName() + { + // Generated from example definition: 2024-05-01-preview/Insights_ListBySubscription.json + // this example is just showing the usage of "Insight_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 WorkloadImpactResource created on azure + // for more information of creating WorkloadImpactResource, please refer to the document of WorkloadImpactResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string workloadImpactName = "impactid22"; + ResourceIdentifier workloadImpactResourceId = WorkloadImpactResource.CreateResourceIdentifier(subscriptionId, workloadImpactName); + WorkloadImpactResource workloadImpact = client.GetWorkloadImpactResource(workloadImpactResourceId); + + // get the collection of this InsightResource + InsightCollection collection = workloadImpact.GetInsights(); + + // invoke the operation and iterate over the result + await foreach (InsightResource 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 + InsightData 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_GetInsightSampleForDiagnosticsCategory() + { + // Generated from example definition: 2024-05-01-preview/Insights_Get_diagnostics.json + // this example is just showing the usage of "Insight_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 WorkloadImpactResource created on azure + // for more information of creating WorkloadImpactResource, please refer to the document of WorkloadImpactResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string workloadImpactName = "impactid"; + ResourceIdentifier workloadImpactResourceId = WorkloadImpactResource.CreateResourceIdentifier(subscriptionId, workloadImpactName); + WorkloadImpactResource workloadImpact = client.GetWorkloadImpactResource(workloadImpactResourceId); + + // get the collection of this InsightResource + InsightCollection collection = workloadImpact.GetInsights(); + + // invoke the operation + string insightName = "insight1"; + bool result = await collection.ExistsAsync(insightName); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Exists_GetInsightSampleForMitigationActionCategory() + { + // Generated from example definition: 2024-05-01-preview/Insights_Get_mitigationAction.json + // this example is just showing the usage of "Insight_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 WorkloadImpactResource created on azure + // for more information of creating WorkloadImpactResource, please refer to the document of WorkloadImpactResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string workloadImpactName = "impactId"; + ResourceIdentifier workloadImpactResourceId = WorkloadImpactResource.CreateResourceIdentifier(subscriptionId, workloadImpactName); + WorkloadImpactResource workloadImpact = client.GetWorkloadImpactResource(workloadImpactResourceId); + + // get the collection of this InsightResource + InsightCollection collection = workloadImpact.GetInsights(); + + // invoke the operation + string insightName = "HPCUASucceeded"; + bool result = await collection.ExistsAsync(insightName); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Exists_GetInsightSampleForServiceHealthCategory() + { + // Generated from example definition: 2024-05-01-preview/Insights_Get_servicehealth.json + // this example is just showing the usage of "Insight_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 WorkloadImpactResource created on azure + // for more information of creating WorkloadImpactResource, please refer to the document of WorkloadImpactResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string workloadImpactName = "impactid"; + ResourceIdentifier workloadImpactResourceId = WorkloadImpactResource.CreateResourceIdentifier(subscriptionId, workloadImpactName); + WorkloadImpactResource workloadImpact = client.GetWorkloadImpactResource(workloadImpactResourceId); + + // get the collection of this InsightResource + InsightCollection collection = workloadImpact.GetInsights(); + + // invoke the operation + string insightName = "insightname"; + bool result = await collection.ExistsAsync(insightName); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetIfExists_GetInsightSampleForDiagnosticsCategory() + { + // Generated from example definition: 2024-05-01-preview/Insights_Get_diagnostics.json + // this example is just showing the usage of "Insight_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 WorkloadImpactResource created on azure + // for more information of creating WorkloadImpactResource, please refer to the document of WorkloadImpactResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string workloadImpactName = "impactid"; + ResourceIdentifier workloadImpactResourceId = WorkloadImpactResource.CreateResourceIdentifier(subscriptionId, workloadImpactName); + WorkloadImpactResource workloadImpact = client.GetWorkloadImpactResource(workloadImpactResourceId); + + // get the collection of this InsightResource + InsightCollection collection = workloadImpact.GetInsights(); + + // invoke the operation + string insightName = "insight1"; + NullableResponse response = await collection.GetIfExistsAsync(insightName); + InsightResource 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 + InsightData 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 GetIfExists_GetInsightSampleForMitigationActionCategory() + { + // Generated from example definition: 2024-05-01-preview/Insights_Get_mitigationAction.json + // this example is just showing the usage of "Insight_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 WorkloadImpactResource created on azure + // for more information of creating WorkloadImpactResource, please refer to the document of WorkloadImpactResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string workloadImpactName = "impactId"; + ResourceIdentifier workloadImpactResourceId = WorkloadImpactResource.CreateResourceIdentifier(subscriptionId, workloadImpactName); + WorkloadImpactResource workloadImpact = client.GetWorkloadImpactResource(workloadImpactResourceId); + + // get the collection of this InsightResource + InsightCollection collection = workloadImpact.GetInsights(); + + // invoke the operation + string insightName = "HPCUASucceeded"; + NullableResponse response = await collection.GetIfExistsAsync(insightName); + InsightResource 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 + InsightData 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 GetIfExists_GetInsightSampleForServiceHealthCategory() + { + // Generated from example definition: 2024-05-01-preview/Insights_Get_servicehealth.json + // this example is just showing the usage of "Insight_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 WorkloadImpactResource created on azure + // for more information of creating WorkloadImpactResource, please refer to the document of WorkloadImpactResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string workloadImpactName = "impactid"; + ResourceIdentifier workloadImpactResourceId = WorkloadImpactResource.CreateResourceIdentifier(subscriptionId, workloadImpactName); + WorkloadImpactResource workloadImpact = client.GetWorkloadImpactResource(workloadImpactResourceId); + + // get the collection of this InsightResource + InsightCollection collection = workloadImpact.GetInsights(); + + // invoke the operation + string insightName = "insightname"; + NullableResponse response = await collection.GetIfExistsAsync(insightName); + InsightResource 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 + InsightData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + } +} diff --git a/sdk/impactreporting/Azure.ResourceManager.ImpactReporting/samples/Generated/Samples/Sample_InsightResource.cs b/sdk/impactreporting/Azure.ResourceManager.ImpactReporting/samples/Generated/Samples/Sample_InsightResource.cs new file mode 100644 index 000000000000..a5e82a2cd079 --- /dev/null +++ b/sdk/impactreporting/Azure.ResourceManager.ImpactReporting/samples/Generated/Samples/Sample_InsightResource.cs @@ -0,0 +1,174 @@ +// 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.ImpactReporting.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.ImpactReporting.Samples +{ + public partial class Sample_InsightResource + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_GetInsightSampleForDiagnosticsCategory() + { + // Generated from example definition: 2024-05-01-preview/Insights_Get_diagnostics.json + // this example is just showing the usage of "Insight_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 InsightResource created on azure + // for more information of creating InsightResource, please refer to the document of InsightResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string workloadImpactName = "impactid"; + string insightName = "insight1"; + ResourceIdentifier insightResourceId = InsightResource.CreateResourceIdentifier(subscriptionId, workloadImpactName, insightName); + InsightResource insight = client.GetInsightResource(insightResourceId); + + // invoke the operation + InsightResource result = await insight.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 + InsightData 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_GetInsightSampleForMitigationActionCategory() + { + // Generated from example definition: 2024-05-01-preview/Insights_Get_mitigationAction.json + // this example is just showing the usage of "Insight_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 InsightResource created on azure + // for more information of creating InsightResource, please refer to the document of InsightResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string workloadImpactName = "impactId"; + string insightName = "HPCUASucceeded"; + ResourceIdentifier insightResourceId = InsightResource.CreateResourceIdentifier(subscriptionId, workloadImpactName, insightName); + InsightResource insight = client.GetInsightResource(insightResourceId); + + // invoke the operation + InsightResource result = await insight.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 + InsightData 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_GetInsightSampleForServiceHealthCategory() + { + // Generated from example definition: 2024-05-01-preview/Insights_Get_servicehealth.json + // this example is just showing the usage of "Insight_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 InsightResource created on azure + // for more information of creating InsightResource, please refer to the document of InsightResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string workloadImpactName = "impactid"; + string insightName = "insightname"; + ResourceIdentifier insightResourceId = InsightResource.CreateResourceIdentifier(subscriptionId, workloadImpactName, insightName); + InsightResource insight = client.GetInsightResource(insightResourceId); + + // invoke the operation + InsightResource result = await insight.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 + InsightData 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_DeleteAnInsight() + { + // Generated from example definition: 2024-05-01-preview/Insights_Delete.json + // this example is just showing the usage of "Insight_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 InsightResource created on azure + // for more information of creating InsightResource, please refer to the document of InsightResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string workloadImpactName = "impactid22"; + string insightName = "insightId12"; + ResourceIdentifier insightResourceId = InsightResource.CreateResourceIdentifier(subscriptionId, workloadImpactName, insightName); + InsightResource insight = client.GetInsightResource(insightResourceId); + + // invoke the operation + await insight.DeleteAsync(WaitUntil.Completed); + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Update_CreatingAnInsight() + { + // Generated from example definition: 2024-05-01-preview/Insights_Create.json + // this example is just showing the usage of "Insight_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 InsightResource created on azure + // for more information of creating InsightResource, please refer to the document of InsightResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string workloadImpactName = "impactid22"; + string insightName = "insightId12"; + ResourceIdentifier insightResourceId = InsightResource.CreateResourceIdentifier(subscriptionId, workloadImpactName, insightName); + InsightResource insight = client.GetInsightResource(insightResourceId); + + // invoke the operation + InsightData data = new InsightData + { + Properties = new InsightProperties("repair", new Content("Impact Has been correlated to an outage", "At 2018-11-08T00:00:00Z UTC, your services dependent on these resources VM1 may have experienced an issue.
We have identified an outage that affected these resources(s). You can look at outage information on NL2W-VCZ link.
"), "00000000-0000-0000-0000-000000000000", new ImpactDetails("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resource-rg/providers/Microsoft.Sql/sqlserver/dbservername", DateTimeOffset.Parse("2023-06-15T01:00:00.009223Z"), "/subscriptions/00000000-0000-0000-0000-000000000000/providers/microsoft.Impact/workloadImpacts/impactid22")) + { + Status = "resolved", + EventOn = DateTimeOffset.Parse("2023-06-15T04:00:00.009223Z"), + }, + }; + ArmOperation lro = await insight.UpdateAsync(WaitUntil.Completed, data); + InsightResource 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 + InsightData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/impactreporting/Azure.ResourceManager.ImpactReporting/samples/Generated/Samples/Sample_WorkloadImpactCollection.cs b/sdk/impactreporting/Azure.ResourceManager.ImpactReporting/samples/Generated/Samples/Sample_WorkloadImpactCollection.cs new file mode 100644 index 000000000000..6520c4244a99 --- /dev/null +++ b/sdk/impactreporting/Azure.ResourceManager.ImpactReporting/samples/Generated/Samples/Sample_WorkloadImpactCollection.cs @@ -0,0 +1,368 @@ +// 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.ImpactReporting.Models; +using Azure.ResourceManager.Resources; +using NUnit.Framework; + +namespace Azure.ResourceManager.ImpactReporting.Samples +{ + public partial class Sample_WorkloadImpactCollection + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task CreateOrUpdate_ReportingArmOperationFailure() + { + // Generated from example definition: 2024-05-01-preview/WorkloadArmOperation_create.json + // this example is just showing the usage of "WorkloadImpact_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 SubscriptionResource created on azure + // for more information of creating SubscriptionResource, please refer to the document of SubscriptionResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(subscriptionId); + SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId); + + // get the collection of this WorkloadImpactResource + WorkloadImpactCollection collection = subscriptionResource.GetWorkloadImpacts(); + + // invoke the operation + string workloadImpactName = "impact-002"; + WorkloadImpactData data = new WorkloadImpactData + { + Properties = new WorkloadImpactProperties(DateTimeOffset.Parse("2022-06-15T05:59:46.6517821Z"), "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resource-rg/providers/Microsoft.Sql/sqlserver/dbservercontext", "ArmOperation") + { + ImpactDescription = "deletion of resource failed", + ArmCorrelationIds = { "00000000-0000-0000-0000-000000000000" }, + Workload = new Workload + { + Context = "webapp/scenario1", + Toolset = Toolset.Other, + }, + ClientIncidentDetails = new ClientIncidentDetails + { + ClientIncidentId = "AA123", + ClientIncidentSource = IncidentSource.Jira, + }, + }, + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, workloadImpactName, data); + WorkloadImpactResource 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 + WorkloadImpactData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task CreateOrUpdate_ReportingAvailabilityRelatedImpact() + { + // Generated from example definition: 2024-05-01-preview/WorkloadAvailability_Create.json + // this example is just showing the usage of "WorkloadImpact_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 SubscriptionResource created on azure + // for more information of creating SubscriptionResource, please refer to the document of SubscriptionResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(subscriptionId); + SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId); + + // get the collection of this WorkloadImpactResource + WorkloadImpactCollection collection = subscriptionResource.GetWorkloadImpacts(); + + // invoke the operation + string workloadImpactName = "impact-002"; + WorkloadImpactData data = new WorkloadImpactData + { + Properties = new WorkloadImpactProperties(DateTimeOffset.Parse("2022-06-15T05:59:46.6517821Z"), "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resource-rg/providers/Microsoft.Sql/sqlserver/dbservercontext", "Availability") + { + ImpactDescription = "read calls failed", + Workload = new Workload + { + Context = "webapp/scenario1", + Toolset = Toolset.Other, + }, + ClientIncidentDetails = new ClientIncidentDetails + { + ClientIncidentId = "AA123", + ClientIncidentSource = IncidentSource.Jira, + }, + }, + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, workloadImpactName, data); + WorkloadImpactResource 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 + WorkloadImpactData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task CreateOrUpdate_ReportingAConnectivityImpact() + { + // Generated from example definition: 2024-05-01-preview/WorkloadConnectivityImpact_Create.json + // this example is just showing the usage of "WorkloadImpact_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 SubscriptionResource created on azure + // for more information of creating SubscriptionResource, please refer to the document of SubscriptionResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(subscriptionId); + SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId); + + // get the collection of this WorkloadImpactResource + WorkloadImpactCollection collection = subscriptionResource.GetWorkloadImpacts(); + + // invoke the operation + string workloadImpactName = "impact-001"; + WorkloadImpactData data = new WorkloadImpactData + { + Properties = new WorkloadImpactProperties(DateTimeOffset.Parse("2022-06-15T05:59:46.6517821Z"), "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resource-rg/providers/Microsoft.Sql/sqlserver/dbservercontext", "Resource.Connectivity") + { + ImpactDescription = "conection failure", + Connectivity = new Connectivity + { + Protocol = Protocol.TCP, + Port = 1443, + SourceAzureResourceId = "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resourceSub/providers/Microsoft.compute/virtualmachines/vm1", + TargetAzureResourceId = "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resourceSub/providers/Microsoft.compute/virtualmachines/vm2", + }, + Workload = new Workload + { + Context = "webapp/scenario1", + Toolset = Toolset.Other, + }, + ClientIncidentDetails = new ClientIncidentDetails + { + ClientIncidentId = "AA123", + ClientIncidentSource = IncidentSource.Jira, + }, + }, + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, workloadImpactName, data); + WorkloadImpactResource 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 + WorkloadImpactData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task CreateOrUpdate_ReportingPerformanceRelatedImpact() + { + // Generated from example definition: 2024-05-01-preview/WorkloadPerformance_Create.json + // this example is just showing the usage of "WorkloadImpact_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 SubscriptionResource created on azure + // for more information of creating SubscriptionResource, please refer to the document of SubscriptionResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(subscriptionId); + SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId); + + // get the collection of this WorkloadImpactResource + WorkloadImpactCollection collection = subscriptionResource.GetWorkloadImpacts(); + + // invoke the operation + string workloadImpactName = "impact-002"; + WorkloadImpactData data = new WorkloadImpactData + { + Properties = new WorkloadImpactProperties(DateTimeOffset.Parse("2022-06-15T05:59:46.6517821Z"), "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resource-rg/providers/Microsoft.Sql/sqlserver/dbservercontext", "Resource.Performance") + { + ImpactDescription = "high cpu utilization", + Performance = {new Performance +{ +MetricName = "CPU", +Expected = 60, +Actual = 90, +}}, + Workload = new Workload + { + Context = "webapp/scenario1", + Toolset = Toolset.Other, + }, + ClientIncidentDetails = new ClientIncidentDetails + { + ClientIncidentId = "AA123", + ClientIncidentSource = IncidentSource.Jira, + }, + }, + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, workloadImpactName, data); + WorkloadImpactResource 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 + WorkloadImpactData 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_GetWorkloadImpactResourceByNameExample() + { + // Generated from example definition: 2024-05-01-preview/WorkloadImpact_Get.json + // this example is just showing the usage of "WorkloadImpact_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 SubscriptionResource created on azure + // for more information of creating SubscriptionResource, please refer to the document of SubscriptionResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(subscriptionId); + SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId); + + // get the collection of this WorkloadImpactResource + WorkloadImpactCollection collection = subscriptionResource.GetWorkloadImpacts(); + + // invoke the operation + string workloadImpactName = "impact-001"; + WorkloadImpactResource result = await collection.GetAsync(workloadImpactName); + + // 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 + WorkloadImpactData 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_ListWorkloadImpactResourcesBySubscription() + { + // Generated from example definition: 2024-05-01-preview/WorkloadImpacts_ListBySubscription.json + // this example is just showing the usage of "WorkloadImpact_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 = "00000000-0000-0000-0000-000000000000"; + ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(subscriptionId); + SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId); + + // get the collection of this WorkloadImpactResource + WorkloadImpactCollection collection = subscriptionResource.GetWorkloadImpacts(); + + // invoke the operation and iterate over the result + await foreach (WorkloadImpactResource 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 + WorkloadImpactData 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_GetWorkloadImpactResourceByNameExample() + { + // Generated from example definition: 2024-05-01-preview/WorkloadImpact_Get.json + // this example is just showing the usage of "WorkloadImpact_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 SubscriptionResource created on azure + // for more information of creating SubscriptionResource, please refer to the document of SubscriptionResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(subscriptionId); + SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId); + + // get the collection of this WorkloadImpactResource + WorkloadImpactCollection collection = subscriptionResource.GetWorkloadImpacts(); + + // invoke the operation + string workloadImpactName = "impact-001"; + bool result = await collection.ExistsAsync(workloadImpactName); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetIfExists_GetWorkloadImpactResourceByNameExample() + { + // Generated from example definition: 2024-05-01-preview/WorkloadImpact_Get.json + // this example is just showing the usage of "WorkloadImpact_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 SubscriptionResource created on azure + // for more information of creating SubscriptionResource, please refer to the document of SubscriptionResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(subscriptionId); + SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId); + + // get the collection of this WorkloadImpactResource + WorkloadImpactCollection collection = subscriptionResource.GetWorkloadImpacts(); + + // invoke the operation + string workloadImpactName = "impact-001"; + NullableResponse response = await collection.GetIfExistsAsync(workloadImpactName); + WorkloadImpactResource 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 + WorkloadImpactData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + } +} diff --git a/sdk/impactreporting/Azure.ResourceManager.ImpactReporting/samples/Generated/Samples/Sample_WorkloadImpactResource.cs b/sdk/impactreporting/Azure.ResourceManager.ImpactReporting/samples/Generated/Samples/Sample_WorkloadImpactResource.cs new file mode 100644 index 000000000000..6bab7d41a76f --- /dev/null +++ b/sdk/impactreporting/Azure.ResourceManager.ImpactReporting/samples/Generated/Samples/Sample_WorkloadImpactResource.cs @@ -0,0 +1,275 @@ +// 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.ImpactReporting.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.ImpactReporting.Samples +{ + public partial class Sample_WorkloadImpactResource + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_GetWorkloadImpactResourceByNameExample() + { + // Generated from example definition: 2024-05-01-preview/WorkloadImpact_Get.json + // this example is just showing the usage of "WorkloadImpact_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 WorkloadImpactResource created on azure + // for more information of creating WorkloadImpactResource, please refer to the document of WorkloadImpactResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string workloadImpactName = "impact-001"; + ResourceIdentifier workloadImpactResourceId = WorkloadImpactResource.CreateResourceIdentifier(subscriptionId, workloadImpactName); + WorkloadImpactResource workloadImpact = client.GetWorkloadImpactResource(workloadImpactResourceId); + + // invoke the operation + WorkloadImpactResource result = await workloadImpact.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 + WorkloadImpactData 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_DeleteWorkloadImpactResourceByNameExample() + { + // Generated from example definition: 2024-05-01-preview/WorkloadImpact_Delete.json + // this example is just showing the usage of "WorkloadImpact_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 WorkloadImpactResource created on azure + // for more information of creating WorkloadImpactResource, please refer to the document of WorkloadImpactResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string workloadImpactName = "impact-001"; + ResourceIdentifier workloadImpactResourceId = WorkloadImpactResource.CreateResourceIdentifier(subscriptionId, workloadImpactName); + WorkloadImpactResource workloadImpact = client.GetWorkloadImpactResource(workloadImpactResourceId); + + // invoke the operation + await workloadImpact.DeleteAsync(WaitUntil.Completed); + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Update_ReportingArmOperationFailure() + { + // Generated from example definition: 2024-05-01-preview/WorkloadArmOperation_create.json + // this example is just showing the usage of "WorkloadImpact_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 WorkloadImpactResource created on azure + // for more information of creating WorkloadImpactResource, please refer to the document of WorkloadImpactResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string workloadImpactName = "impact-002"; + ResourceIdentifier workloadImpactResourceId = WorkloadImpactResource.CreateResourceIdentifier(subscriptionId, workloadImpactName); + WorkloadImpactResource workloadImpact = client.GetWorkloadImpactResource(workloadImpactResourceId); + + // invoke the operation + WorkloadImpactData data = new WorkloadImpactData + { + Properties = new WorkloadImpactProperties(DateTimeOffset.Parse("2022-06-15T05:59:46.6517821Z"), "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resource-rg/providers/Microsoft.Sql/sqlserver/dbservercontext", "ArmOperation") + { + ImpactDescription = "deletion of resource failed", + ArmCorrelationIds = { "00000000-0000-0000-0000-000000000000" }, + Workload = new Workload + { + Context = "webapp/scenario1", + Toolset = Toolset.Other, + }, + ClientIncidentDetails = new ClientIncidentDetails + { + ClientIncidentId = "AA123", + ClientIncidentSource = IncidentSource.Jira, + }, + }, + }; + ArmOperation lro = await workloadImpact.UpdateAsync(WaitUntil.Completed, data); + WorkloadImpactResource 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 + WorkloadImpactData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Update_ReportingAvailabilityRelatedImpact() + { + // Generated from example definition: 2024-05-01-preview/WorkloadAvailability_Create.json + // this example is just showing the usage of "WorkloadImpact_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 WorkloadImpactResource created on azure + // for more information of creating WorkloadImpactResource, please refer to the document of WorkloadImpactResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string workloadImpactName = "impact-002"; + ResourceIdentifier workloadImpactResourceId = WorkloadImpactResource.CreateResourceIdentifier(subscriptionId, workloadImpactName); + WorkloadImpactResource workloadImpact = client.GetWorkloadImpactResource(workloadImpactResourceId); + + // invoke the operation + WorkloadImpactData data = new WorkloadImpactData + { + Properties = new WorkloadImpactProperties(DateTimeOffset.Parse("2022-06-15T05:59:46.6517821Z"), "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resource-rg/providers/Microsoft.Sql/sqlserver/dbservercontext", "Availability") + { + ImpactDescription = "read calls failed", + Workload = new Workload + { + Context = "webapp/scenario1", + Toolset = Toolset.Other, + }, + ClientIncidentDetails = new ClientIncidentDetails + { + ClientIncidentId = "AA123", + ClientIncidentSource = IncidentSource.Jira, + }, + }, + }; + ArmOperation lro = await workloadImpact.UpdateAsync(WaitUntil.Completed, data); + WorkloadImpactResource 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 + WorkloadImpactData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Update_ReportingAConnectivityImpact() + { + // Generated from example definition: 2024-05-01-preview/WorkloadConnectivityImpact_Create.json + // this example is just showing the usage of "WorkloadImpact_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 WorkloadImpactResource created on azure + // for more information of creating WorkloadImpactResource, please refer to the document of WorkloadImpactResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string workloadImpactName = "impact-001"; + ResourceIdentifier workloadImpactResourceId = WorkloadImpactResource.CreateResourceIdentifier(subscriptionId, workloadImpactName); + WorkloadImpactResource workloadImpact = client.GetWorkloadImpactResource(workloadImpactResourceId); + + // invoke the operation + WorkloadImpactData data = new WorkloadImpactData + { + Properties = new WorkloadImpactProperties(DateTimeOffset.Parse("2022-06-15T05:59:46.6517821Z"), "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resource-rg/providers/Microsoft.Sql/sqlserver/dbservercontext", "Resource.Connectivity") + { + ImpactDescription = "conection failure", + Connectivity = new Connectivity + { + Protocol = Protocol.TCP, + Port = 1443, + SourceAzureResourceId = "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resourceSub/providers/Microsoft.compute/virtualmachines/vm1", + TargetAzureResourceId = "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resourceSub/providers/Microsoft.compute/virtualmachines/vm2", + }, + Workload = new Workload + { + Context = "webapp/scenario1", + Toolset = Toolset.Other, + }, + ClientIncidentDetails = new ClientIncidentDetails + { + ClientIncidentId = "AA123", + ClientIncidentSource = IncidentSource.Jira, + }, + }, + }; + ArmOperation lro = await workloadImpact.UpdateAsync(WaitUntil.Completed, data); + WorkloadImpactResource 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 + WorkloadImpactData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Update_ReportingPerformanceRelatedImpact() + { + // Generated from example definition: 2024-05-01-preview/WorkloadPerformance_Create.json + // this example is just showing the usage of "WorkloadImpact_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 WorkloadImpactResource created on azure + // for more information of creating WorkloadImpactResource, please refer to the document of WorkloadImpactResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string workloadImpactName = "impact-002"; + ResourceIdentifier workloadImpactResourceId = WorkloadImpactResource.CreateResourceIdentifier(subscriptionId, workloadImpactName); + WorkloadImpactResource workloadImpact = client.GetWorkloadImpactResource(workloadImpactResourceId); + + // invoke the operation + WorkloadImpactData data = new WorkloadImpactData + { + Properties = new WorkloadImpactProperties(DateTimeOffset.Parse("2022-06-15T05:59:46.6517821Z"), "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resource-rg/providers/Microsoft.Sql/sqlserver/dbservercontext", "Resource.Performance") + { + ImpactDescription = "high cpu utilization", + Performance = {new Performance +{ +MetricName = "CPU", +Expected = 60, +Actual = 90, +}}, + Workload = new Workload + { + Context = "webapp/scenario1", + Toolset = Toolset.Other, + }, + ClientIncidentDetails = new ClientIncidentDetails + { + ClientIncidentId = "AA123", + ClientIncidentSource = IncidentSource.Jira, + }, + }, + }; + ArmOperation lro = await workloadImpact.UpdateAsync(WaitUntil.Completed, data); + WorkloadImpactResource 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 + WorkloadImpactData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/impactreporting/Azure.ResourceManager.ImpactReporting/src/Azure.ResourceManager.ImpactReporting.csproj b/sdk/impactreporting/Azure.ResourceManager.ImpactReporting/src/Azure.ResourceManager.ImpactReporting.csproj new file mode 100644 index 000000000000..5a6d51438445 --- /dev/null +++ b/sdk/impactreporting/Azure.ResourceManager.ImpactReporting/src/Azure.ResourceManager.ImpactReporting.csproj @@ -0,0 +1,8 @@ + + + Azure Resource Manager client SDK for Azure resource provider ImpactReporting. + 1.0.0-beta.1 + azure;management;arm;resource manager;impactreporting + Azure.ResourceManager.ImpactReporting + + diff --git a/sdk/impactreporting/Azure.ResourceManager.ImpactReporting/src/Generated/ArmImpactReportingModelFactory.cs b/sdk/impactreporting/Azure.ResourceManager.ImpactReporting/src/Generated/ArmImpactReportingModelFactory.cs new file mode 100644 index 000000000000..b3c9fbc3798b --- /dev/null +++ b/sdk/impactreporting/Azure.ResourceManager.ImpactReporting/src/Generated/ArmImpactReportingModelFactory.cs @@ -0,0 +1,213 @@ +// 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.ImpactReporting.Models +{ + /// Model factory for models. + public static partial class ArmImpactReportingModelFactory + { + /// 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 ConnectorData ConnectorData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, ConnectorProperties properties = null) + { + return new ConnectorData( + id, + name, + resourceType, + systemData, + properties, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Resource provisioning state. + /// unique id of the connector. + /// tenant id of this connector. + /// connector type. + /// last run time stamp of this connector in UTC time zone. + /// A new instance for mocking. + public static ConnectorProperties ConnectorProperties(ProvisioningState? provisioningState = null, string connectorId = null, string tenantId = null, Platform connectorType = default, DateTimeOffset lastRunTimeStamp = default) + { + return new ConnectorProperties( + provisioningState, + connectorId, + tenantId, + connectorType, + lastRunTimeStamp, + 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 InsightData InsightData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, InsightProperties properties = null) + { + return new InsightData( + id, + name, + resourceType, + systemData, + properties, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Resource provisioning state. + /// category of the insight. + /// status of the insight. example resolved, repaired, other. + /// Identifier of the event that has been correlated with this insight. This can be used to aggregate insights for the same event. + /// Identifier that can be used to group similar insights. + /// Contains title & description for the insight. + /// Time of the event, which has been correlated the impact. + /// unique id of the insight. + /// details of of the impact for which insight has been generated. + /// additional details of the insight. + /// A new instance for mocking. + public static InsightProperties InsightProperties(ProvisioningState? provisioningState = null, string category = null, string status = null, string eventId = null, string groupId = null, Content content = null, DateTimeOffset? eventOn = null, string insightUniqueId = null, ImpactDetails impact = null, InsightPropertiesAdditionalDetails additionalDetails = null) + { + return new InsightProperties( + provisioningState, + category, + status, + eventId, + groupId, + content, + eventOn, + insightUniqueId, + impact, + additionalDetails, + 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 ImpactCategoryData ImpactCategoryData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, ImpactCategoryProperties properties = null) + { + return new ImpactCategoryData( + id, + name, + resourceType, + systemData, + properties, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Resource provisioning state. + /// Unique ID of the category. + /// Unique ID of the parent category. + /// Description of the category. + /// The workloadImpact properties which are required when reporting with the impact category. + /// A new instance for mocking. + public static ImpactCategoryProperties ImpactCategoryProperties(ProvisioningState? provisioningState = null, string categoryId = null, string parentCategoryId = null, string description = null, IEnumerable requiredImpactProperties = null) + { + requiredImpactProperties ??= new List(); + + return new ImpactCategoryProperties( + provisioningState, + categoryId, + parentCategoryId, + description, + requiredImpactProperties?.ToList(), + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Name of the property. + /// Allowed values values for the property. + /// A new instance for mocking. + public static RequiredImpactProperties RequiredImpactProperties(string name = null, IEnumerable allowedValues = null) + { + allowedValues ??= new List(); + + return new RequiredImpactProperties(name, allowedValues?.ToList(), 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 WorkloadImpactData WorkloadImpactData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, WorkloadImpactProperties properties = null) + { + return new WorkloadImpactData( + id, + name, + resourceType, + systemData, + properties, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Resource provisioning state. + /// Time at which impact was observed. + /// Time at which impact has ended. + /// Azure resource id of the impacted resource. + /// Unique ID of the impact (UUID). + /// Time at which impact is reported. + /// Category of the impact, details can found from /impactCategories API. + /// A detailed description of the impact. + /// The ARM correlation ids, this is important field for control plane related impacts. + /// Details about performance issue. Applicable for performance impacts. + /// Details about connectivity issue. Applicable when root resource causing the issue is not identified. For example, when a VM is impacted due to a network issue, the impacted resource is identified as the VM, but the root cause is the network. In such cases, the connectivity field will have the details about the network issue. + /// Additional fields related to impact, applicable fields per resource type are list under /impactCategories API. + /// ARM error code and error message associated with the impact. + /// Information about the impacted workload. + /// Use this field to group impacts. + /// Degree of confidence on the impact being a platform issue. + /// Client incident details ex: incidentId , incident source. + /// A new instance for mocking. + public static WorkloadImpactProperties WorkloadImpactProperties(ProvisioningState? provisioningState = null, DateTimeOffset startOn = default, DateTimeOffset? endOn = null, string impactedResourceId = null, string impactUniqueId = null, DateTimeOffset? reportedTimeUtc = null, string impactCategory = null, string impactDescription = null, IEnumerable armCorrelationIds = null, IEnumerable performance = null, Connectivity connectivity = null, WorkloadImpactPropertiesAdditionalProperties additionalProperties = null, ErrorDetailProperties errorDetails = null, Workload workload = null, string impactGroupId = null, ConfidenceLevel? confidenceLevel = null, ClientIncidentDetails clientIncidentDetails = null) + { + armCorrelationIds ??= new List(); + performance ??= new List(); + + return new WorkloadImpactProperties( + provisioningState, + startOn, + endOn, + impactedResourceId, + impactUniqueId, + reportedTimeUtc, + impactCategory, + impactDescription, + armCorrelationIds?.ToList(), + performance?.ToList(), + connectivity, + additionalProperties, + errorDetails, + workload, + impactGroupId, + confidenceLevel, + clientIncidentDetails, + serializedAdditionalRawData: null); + } + } +} diff --git a/sdk/impactreporting/Azure.ResourceManager.ImpactReporting/src/Generated/ConnectorCollection.cs b/sdk/impactreporting/Azure.ResourceManager.ImpactReporting/src/Generated/ConnectorCollection.cs new file mode 100644 index 000000000000..259c35fa239e --- /dev/null +++ b/sdk/impactreporting/Azure.ResourceManager.ImpactReporting/src/Generated/ConnectorCollection.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.ImpactReporting +{ + /// + /// 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 GetConnectors method from an instance of . + /// + public partial class ConnectorCollection : ArmCollection, IEnumerable, IAsyncEnumerable + { + private readonly ClientDiagnostics _connectorClientDiagnostics; + private readonly ConnectorsRestOperations _connectorRestClient; + + /// Initializes a new instance of the class for mocking. + protected ConnectorCollection() + { + } + + /// 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 ConnectorCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _connectorClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.ImpactReporting", ConnectorResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ConnectorResource.ResourceType, out string connectorApiVersion); + _connectorRestClient = new ConnectorsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, connectorApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != SubscriptionResource.ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, SubscriptionResource.ResourceType), nameof(id)); + } + + /// + /// Create a Connector + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.Impact/connectors/{connectorName} + /// + /// + /// Operation Id + /// Connector_CreateOrUpdate + /// + /// + /// Default Api Version + /// 2024-05-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 name of the connector. + /// 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 connectorName, ConnectorData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(connectorName, nameof(connectorName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _connectorClientDiagnostics.CreateScope("ConnectorCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = await _connectorRestClient.CreateOrUpdateAsync(Id.SubscriptionId, connectorName, data, cancellationToken).ConfigureAwait(false); + var operation = new ImpactReportingArmOperation(new ConnectorOperationSource(Client), _connectorClientDiagnostics, Pipeline, _connectorRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, connectorName, 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 Connector + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.Impact/connectors/{connectorName} + /// + /// + /// Operation Id + /// Connector_CreateOrUpdate + /// + /// + /// Default Api Version + /// 2024-05-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 name of the connector. + /// 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 connectorName, ConnectorData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(connectorName, nameof(connectorName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _connectorClientDiagnostics.CreateScope("ConnectorCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = _connectorRestClient.CreateOrUpdate(Id.SubscriptionId, connectorName, data, cancellationToken); + var operation = new ImpactReportingArmOperation(new ConnectorOperationSource(Client), _connectorClientDiagnostics, Pipeline, _connectorRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, connectorName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a Connector + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.Impact/connectors/{connectorName} + /// + /// + /// Operation Id + /// Connector_Get + /// + /// + /// Default Api Version + /// 2024-05-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the connector. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetAsync(string connectorName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(connectorName, nameof(connectorName)); + + using var scope = _connectorClientDiagnostics.CreateScope("ConnectorCollection.Get"); + scope.Start(); + try + { + var response = await _connectorRestClient.GetAsync(Id.SubscriptionId, connectorName, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new ConnectorResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a Connector + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.Impact/connectors/{connectorName} + /// + /// + /// Operation Id + /// Connector_Get + /// + /// + /// Default Api Version + /// 2024-05-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the connector. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Get(string connectorName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(connectorName, nameof(connectorName)); + + using var scope = _connectorClientDiagnostics.CreateScope("ConnectorCollection.Get"); + scope.Start(); + try + { + var response = _connectorRestClient.Get(Id.SubscriptionId, connectorName, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new ConnectorResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// List Connector resources by subscription ID + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.Impact/connectors + /// + /// + /// Operation Id + /// Connector_ListBySubscription + /// + /// + /// Default Api Version + /// 2024-05-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) => _connectorRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _connectorRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new ConnectorResource(Client, ConnectorData.DeserializeConnectorData(e)), _connectorClientDiagnostics, Pipeline, "ConnectorCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// List Connector resources by subscription ID + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.Impact/connectors + /// + /// + /// Operation Id + /// Connector_ListBySubscription + /// + /// + /// Default Api Version + /// 2024-05-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) => _connectorRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _connectorRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new ConnectorResource(Client, ConnectorData.DeserializeConnectorData(e)), _connectorClientDiagnostics, Pipeline, "ConnectorCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.Impact/connectors/{connectorName} + /// + /// + /// Operation Id + /// Connector_Get + /// + /// + /// Default Api Version + /// 2024-05-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the connector. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> ExistsAsync(string connectorName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(connectorName, nameof(connectorName)); + + using var scope = _connectorClientDiagnostics.CreateScope("ConnectorCollection.Exists"); + scope.Start(); + try + { + var response = await _connectorRestClient.GetAsync(Id.SubscriptionId, connectorName, 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}/providers/Microsoft.Impact/connectors/{connectorName} + /// + /// + /// Operation Id + /// Connector_Get + /// + /// + /// Default Api Version + /// 2024-05-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the connector. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Exists(string connectorName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(connectorName, nameof(connectorName)); + + using var scope = _connectorClientDiagnostics.CreateScope("ConnectorCollection.Exists"); + scope.Start(); + try + { + var response = _connectorRestClient.Get(Id.SubscriptionId, connectorName, 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}/providers/Microsoft.Impact/connectors/{connectorName} + /// + /// + /// Operation Id + /// Connector_Get + /// + /// + /// Default Api Version + /// 2024-05-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the connector. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetIfExistsAsync(string connectorName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(connectorName, nameof(connectorName)); + + using var scope = _connectorClientDiagnostics.CreateScope("ConnectorCollection.GetIfExists"); + scope.Start(); + try + { + var response = await _connectorRestClient.GetAsync(Id.SubscriptionId, connectorName, cancellationToken: cancellationToken).ConfigureAwait(false); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new ConnectorResource(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}/providers/Microsoft.Impact/connectors/{connectorName} + /// + /// + /// Operation Id + /// Connector_Get + /// + /// + /// Default Api Version + /// 2024-05-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the connector. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual NullableResponse GetIfExists(string connectorName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(connectorName, nameof(connectorName)); + + using var scope = _connectorClientDiagnostics.CreateScope("ConnectorCollection.GetIfExists"); + scope.Start(); + try + { + var response = _connectorRestClient.Get(Id.SubscriptionId, connectorName, cancellationToken: cancellationToken); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new ConnectorResource(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/impactreporting/Azure.ResourceManager.ImpactReporting/src/Generated/ConnectorData.Serialization.cs b/sdk/impactreporting/Azure.ResourceManager.ImpactReporting/src/Generated/ConnectorData.Serialization.cs new file mode 100644 index 000000000000..a6b982278d5c --- /dev/null +++ b/sdk/impactreporting/Azure.ResourceManager.ImpactReporting/src/Generated/ConnectorData.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.ImpactReporting.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.ImpactReporting +{ + public partial class ConnectorData : 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(ConnectorData)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (Optional.IsDefined(Properties)) + { + writer.WritePropertyName("properties"u8); + writer.WriteObjectValue(Properties, options); + } + } + + ConnectorData 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(ConnectorData)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeConnectorData(document.RootElement, options); + } + + internal static ConnectorData DeserializeConnectorData(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ConnectorProperties 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 = ConnectorProperties.DeserializeConnectorProperties(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 ConnectorData( + 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(ConnectorData)} does not support writing '{options.Format}' format."); + } + } + + ConnectorData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeConnectorData(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ConnectorData)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/impactreporting/Azure.ResourceManager.ImpactReporting/src/Generated/ConnectorData.cs b/sdk/impactreporting/Azure.ResourceManager.ImpactReporting/src/Generated/ConnectorData.cs new file mode 100644 index 000000000000..b2d1ae438890 --- /dev/null +++ b/sdk/impactreporting/Azure.ResourceManager.ImpactReporting/src/Generated/ConnectorData.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.ImpactReporting.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.ImpactReporting +{ + /// + /// A class representing the Connector data model. + /// A connector is a resource that can be used to proactively report impacts against workloads in Azure to Microsoft. + /// + public partial class ConnectorData : 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 ConnectorData() + { + } + + /// 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 ConnectorData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, ConnectorProperties properties, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) + { + Properties = properties; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The resource-specific properties for this resource. + public ConnectorProperties Properties { get; set; } + } +} diff --git a/sdk/impactreporting/Azure.ResourceManager.ImpactReporting/src/Generated/ConnectorResource.Serialization.cs b/sdk/impactreporting/Azure.ResourceManager.ImpactReporting/src/Generated/ConnectorResource.Serialization.cs new file mode 100644 index 000000000000..9234dc158038 --- /dev/null +++ b/sdk/impactreporting/Azure.ResourceManager.ImpactReporting/src/Generated/ConnectorResource.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.ImpactReporting +{ + public partial class ConnectorResource : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); + + ConnectorData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options); + + ConnectorData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options); + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); + } +} diff --git a/sdk/impactreporting/Azure.ResourceManager.ImpactReporting/src/Generated/ConnectorResource.cs b/sdk/impactreporting/Azure.ResourceManager.ImpactReporting/src/Generated/ConnectorResource.cs new file mode 100644 index 000000000000..45fb32d37f5e --- /dev/null +++ b/sdk/impactreporting/Azure.ResourceManager.ImpactReporting/src/Generated/ConnectorResource.cs @@ -0,0 +1,343 @@ +// 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; +using Azure.ResourceManager.ImpactReporting.Models; +using Azure.ResourceManager.Resources; + +namespace Azure.ResourceManager.ImpactReporting +{ + /// + /// A Class representing a Connector 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 GetConnectorResource method. + /// Otherwise you can get one from its parent resource using the GetConnector method. + /// + public partial class ConnectorResource : ArmResource + { + /// Generate the resource identifier of a instance. + /// The subscriptionId. + /// The connectorName. + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string connectorName) + { + var resourceId = $"/subscriptions/{subscriptionId}/providers/Microsoft.Impact/connectors/{connectorName}"; + return new ResourceIdentifier(resourceId); + } + + private readonly ClientDiagnostics _connectorClientDiagnostics; + private readonly ConnectorsRestOperations _connectorRestClient; + private readonly ConnectorData _data; + + /// Gets the resource type for the operations. + public static readonly ResourceType ResourceType = "Microsoft.Impact/connectors"; + + /// Initializes a new instance of the class for mocking. + protected ConnectorResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal ConnectorResource(ArmClient client, ConnectorData 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 ConnectorResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _connectorClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.ImpactReporting", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string connectorApiVersion); + _connectorRestClient = new ConnectorsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, connectorApiVersion); +#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 ConnectorData 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 Connector + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.Impact/connectors/{connectorName} + /// + /// + /// Operation Id + /// Connector_Get + /// + /// + /// Default Api Version + /// 2024-05-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _connectorClientDiagnostics.CreateScope("ConnectorResource.Get"); + scope.Start(); + try + { + var response = await _connectorRestClient.GetAsync(Id.SubscriptionId, Id.Name, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new ConnectorResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a Connector + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.Impact/connectors/{connectorName} + /// + /// + /// Operation Id + /// Connector_Get + /// + /// + /// Default Api Version + /// 2024-05-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _connectorClientDiagnostics.CreateScope("ConnectorResource.Get"); + scope.Start(); + try + { + var response = _connectorRestClient.Get(Id.SubscriptionId, Id.Name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new ConnectorResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Delete a Connector + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.Impact/connectors/{connectorName} + /// + /// + /// Operation Id + /// Connector_Delete + /// + /// + /// Default Api Version + /// 2024-05-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 = _connectorClientDiagnostics.CreateScope("ConnectorResource.Delete"); + scope.Start(); + try + { + var response = await _connectorRestClient.DeleteAsync(Id.SubscriptionId, Id.Name, cancellationToken).ConfigureAwait(false); + var uri = _connectorRestClient.CreateDeleteRequestUri(Id.SubscriptionId, Id.Name); + var rehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(RequestMethod.Delete, uri.ToUri(), uri.ToString(), "None", null, OperationFinalStateVia.OriginalUri.ToString()); + var operation = new ImpactReportingArmOperation(response, rehydrationToken); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Delete a Connector + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.Impact/connectors/{connectorName} + /// + /// + /// Operation Id + /// Connector_Delete + /// + /// + /// Default Api Version + /// 2024-05-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 = _connectorClientDiagnostics.CreateScope("ConnectorResource.Delete"); + scope.Start(); + try + { + var response = _connectorRestClient.Delete(Id.SubscriptionId, Id.Name, cancellationToken); + var uri = _connectorRestClient.CreateDeleteRequestUri(Id.SubscriptionId, Id.Name); + var rehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(RequestMethod.Delete, uri.ToUri(), uri.ToString(), "None", null, OperationFinalStateVia.OriginalUri.ToString()); + var operation = new ImpactReportingArmOperation(response, rehydrationToken); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletionResponse(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Update a Connector + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.Impact/connectors/{connectorName} + /// + /// + /// Operation Id + /// Connector_Update + /// + /// + /// Default Api Version + /// 2024-05-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The resource properties to be updated. + /// The cancellation token to use. + /// is null. + public virtual async Task> UpdateAsync(ConnectorPatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(patch, nameof(patch)); + + using var scope = _connectorClientDiagnostics.CreateScope("ConnectorResource.Update"); + scope.Start(); + try + { + var response = await _connectorRestClient.UpdateAsync(Id.SubscriptionId, Id.Name, patch, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new ConnectorResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Update a Connector + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.Impact/connectors/{connectorName} + /// + /// + /// Operation Id + /// Connector_Update + /// + /// + /// Default Api Version + /// 2024-05-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The resource properties to be updated. + /// The cancellation token to use. + /// is null. + public virtual Response Update(ConnectorPatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(patch, nameof(patch)); + + using var scope = _connectorClientDiagnostics.CreateScope("ConnectorResource.Update"); + scope.Start(); + try + { + var response = _connectorRestClient.Update(Id.SubscriptionId, Id.Name, patch, cancellationToken); + return Response.FromValue(new ConnectorResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/impactreporting/Azure.ResourceManager.ImpactReporting/src/Generated/Extensions/ImpactReportingExtensions.cs b/sdk/impactreporting/Azure.ResourceManager.ImpactReporting/src/Generated/Extensions/ImpactReportingExtensions.cs new file mode 100644 index 000000000000..63e82bb6e2b0 --- /dev/null +++ b/sdk/impactreporting/Azure.ResourceManager.ImpactReporting/src/Generated/Extensions/ImpactReportingExtensions.cs @@ -0,0 +1,385 @@ +// 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.ImpactReporting.Mocking; +using Azure.ResourceManager.Resources; + +namespace Azure.ResourceManager.ImpactReporting +{ + /// A class to add extension methods to Azure.ResourceManager.ImpactReporting. + public static partial class ImpactReportingExtensions + { + private static MockableImpactReportingArmClient GetMockableImpactReportingArmClient(ArmClient client) + { + return client.GetCachedClient(client0 => new MockableImpactReportingArmClient(client0)); + } + + private static MockableImpactReportingSubscriptionResource GetMockableImpactReportingSubscriptionResource(ArmResource resource) + { + return resource.GetCachedClient(client => new MockableImpactReportingSubscriptionResource(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 WorkloadImpactResource GetWorkloadImpactResource(this ArmClient client, ResourceIdentifier id) + { + Argument.AssertNotNull(client, nameof(client)); + + return GetMockableImpactReportingArmClient(client).GetWorkloadImpactResource(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 ImpactCategoryResource GetImpactCategoryResource(this ArmClient client, ResourceIdentifier id) + { + Argument.AssertNotNull(client, nameof(client)); + + return GetMockableImpactReportingArmClient(client).GetImpactCategoryResource(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 InsightResource GetInsightResource(this ArmClient client, ResourceIdentifier id) + { + Argument.AssertNotNull(client, nameof(client)); + + return GetMockableImpactReportingArmClient(client).GetInsightResource(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 ConnectorResource GetConnectorResource(this ArmClient client, ResourceIdentifier id) + { + Argument.AssertNotNull(client, nameof(client)); + + return GetMockableImpactReportingArmClient(client).GetConnectorResource(id); + } + + /// + /// Gets a collection of WorkloadImpactResources in the SubscriptionResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// is null. + /// An object representing collection of WorkloadImpactResources and their operations over a WorkloadImpactResource. + public static WorkloadImpactCollection GetWorkloadImpacts(this SubscriptionResource subscriptionResource) + { + Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); + + return GetMockableImpactReportingSubscriptionResource(subscriptionResource).GetWorkloadImpacts(); + } + + /// + /// Get a WorkloadImpact + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.Impact/workloadImpacts/{workloadImpactName} + /// + /// + /// Operation Id + /// WorkloadImpact_Get + /// + /// + /// Default Api Version + /// 2024-05-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// workloadImpact 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> GetWorkloadImpactAsync(this SubscriptionResource subscriptionResource, string workloadImpactName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); + + return await GetMockableImpactReportingSubscriptionResource(subscriptionResource).GetWorkloadImpactAsync(workloadImpactName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get a WorkloadImpact + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.Impact/workloadImpacts/{workloadImpactName} + /// + /// + /// Operation Id + /// WorkloadImpact_Get + /// + /// + /// Default Api Version + /// 2024-05-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// workloadImpact resource. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public static Response GetWorkloadImpact(this SubscriptionResource subscriptionResource, string workloadImpactName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); + + return GetMockableImpactReportingSubscriptionResource(subscriptionResource).GetWorkloadImpact(workloadImpactName, cancellationToken); + } + + /// + /// Gets a collection of ImpactCategoryResources in the SubscriptionResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// is null. + /// An object representing collection of ImpactCategoryResources and their operations over a ImpactCategoryResource. + public static ImpactCategoryCollection GetImpactCategories(this SubscriptionResource subscriptionResource) + { + Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); + + return GetMockableImpactReportingSubscriptionResource(subscriptionResource).GetImpactCategories(); + } + + /// + /// Get a ImpactCategory + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.Impact/impactCategories/{impactCategoryName} + /// + /// + /// Operation Id + /// ImpactCategory_Get + /// + /// + /// Default Api Version + /// 2024-05-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// Name of the impact category. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public static async Task> GetImpactCategoryAsync(this SubscriptionResource subscriptionResource, string impactCategoryName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); + + return await GetMockableImpactReportingSubscriptionResource(subscriptionResource).GetImpactCategoryAsync(impactCategoryName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get a ImpactCategory + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.Impact/impactCategories/{impactCategoryName} + /// + /// + /// Operation Id + /// ImpactCategory_Get + /// + /// + /// Default Api Version + /// 2024-05-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// Name of the impact category. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public static Response GetImpactCategory(this SubscriptionResource subscriptionResource, string impactCategoryName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); + + return GetMockableImpactReportingSubscriptionResource(subscriptionResource).GetImpactCategory(impactCategoryName, cancellationToken); + } + + /// + /// Gets a collection of ConnectorResources in the SubscriptionResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// is null. + /// An object representing collection of ConnectorResources and their operations over a ConnectorResource. + public static ConnectorCollection GetConnectors(this SubscriptionResource subscriptionResource) + { + Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); + + return GetMockableImpactReportingSubscriptionResource(subscriptionResource).GetConnectors(); + } + + /// + /// Get a Connector + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.Impact/connectors/{connectorName} + /// + /// + /// Operation Id + /// Connector_Get + /// + /// + /// Default Api Version + /// 2024-05-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The name of the connector. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public static async Task> GetConnectorAsync(this SubscriptionResource subscriptionResource, string connectorName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); + + return await GetMockableImpactReportingSubscriptionResource(subscriptionResource).GetConnectorAsync(connectorName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get a Connector + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.Impact/connectors/{connectorName} + /// + /// + /// Operation Id + /// Connector_Get + /// + /// + /// Default Api Version + /// 2024-05-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The name of the connector. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public static Response GetConnector(this SubscriptionResource subscriptionResource, string connectorName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); + + return GetMockableImpactReportingSubscriptionResource(subscriptionResource).GetConnector(connectorName, cancellationToken); + } + } +} diff --git a/sdk/impactreporting/Azure.ResourceManager.ImpactReporting/src/Generated/Extensions/MockableImpactReportingArmClient.cs b/sdk/impactreporting/Azure.ResourceManager.ImpactReporting/src/Generated/Extensions/MockableImpactReportingArmClient.cs new file mode 100644 index 000000000000..eb3eaa76ba96 --- /dev/null +++ b/sdk/impactreporting/Azure.ResourceManager.ImpactReporting/src/Generated/Extensions/MockableImpactReportingArmClient.cs @@ -0,0 +1,85 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using Azure.Core; + +namespace Azure.ResourceManager.ImpactReporting.Mocking +{ + /// A class to add extension methods to ArmClient. + public partial class MockableImpactReportingArmClient : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected MockableImpactReportingArmClient() + { + } + + /// 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 MockableImpactReportingArmClient(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + internal MockableImpactReportingArmClient(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 WorkloadImpactResource GetWorkloadImpactResource(ResourceIdentifier id) + { + WorkloadImpactResource.ValidateResourceId(id); + return new WorkloadImpactResource(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 ImpactCategoryResource GetImpactCategoryResource(ResourceIdentifier id) + { + ImpactCategoryResource.ValidateResourceId(id); + return new ImpactCategoryResource(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 InsightResource GetInsightResource(ResourceIdentifier id) + { + InsightResource.ValidateResourceId(id); + return new InsightResource(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 ConnectorResource GetConnectorResource(ResourceIdentifier id) + { + ConnectorResource.ValidateResourceId(id); + return new ConnectorResource(Client, id); + } + } +} diff --git a/sdk/impactreporting/Azure.ResourceManager.ImpactReporting/src/Generated/Extensions/MockableImpactReportingSubscriptionResource.cs b/sdk/impactreporting/Azure.ResourceManager.ImpactReporting/src/Generated/Extensions/MockableImpactReportingSubscriptionResource.cs new file mode 100644 index 000000000000..65d4b48c48b0 --- /dev/null +++ b/sdk/impactreporting/Azure.ResourceManager.ImpactReporting/src/Generated/Extensions/MockableImpactReportingSubscriptionResource.cs @@ -0,0 +1,243 @@ +// 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.ImpactReporting.Mocking +{ + /// A class to add extension methods to SubscriptionResource. + public partial class MockableImpactReportingSubscriptionResource : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected MockableImpactReportingSubscriptionResource() + { + } + + /// 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 MockableImpactReportingSubscriptionResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// Gets a collection of WorkloadImpactResources in the SubscriptionResource. + /// An object representing collection of WorkloadImpactResources and their operations over a WorkloadImpactResource. + public virtual WorkloadImpactCollection GetWorkloadImpacts() + { + return GetCachedClient(client => new WorkloadImpactCollection(client, Id)); + } + + /// + /// Get a WorkloadImpact + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.Impact/workloadImpacts/{workloadImpactName} + /// + /// + /// Operation Id + /// WorkloadImpact_Get + /// + /// + /// Default Api Version + /// 2024-05-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// workloadImpact resource. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetWorkloadImpactAsync(string workloadImpactName, CancellationToken cancellationToken = default) + { + return await GetWorkloadImpacts().GetAsync(workloadImpactName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get a WorkloadImpact + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.Impact/workloadImpacts/{workloadImpactName} + /// + /// + /// Operation Id + /// WorkloadImpact_Get + /// + /// + /// Default Api Version + /// 2024-05-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// workloadImpact resource. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetWorkloadImpact(string workloadImpactName, CancellationToken cancellationToken = default) + { + return GetWorkloadImpacts().Get(workloadImpactName, cancellationToken); + } + + /// Gets a collection of ImpactCategoryResources in the SubscriptionResource. + /// An object representing collection of ImpactCategoryResources and their operations over a ImpactCategoryResource. + public virtual ImpactCategoryCollection GetImpactCategories() + { + return GetCachedClient(client => new ImpactCategoryCollection(client, Id)); + } + + /// + /// Get a ImpactCategory + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.Impact/impactCategories/{impactCategoryName} + /// + /// + /// Operation Id + /// ImpactCategory_Get + /// + /// + /// Default Api Version + /// 2024-05-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the impact category. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetImpactCategoryAsync(string impactCategoryName, CancellationToken cancellationToken = default) + { + return await GetImpactCategories().GetAsync(impactCategoryName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get a ImpactCategory + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.Impact/impactCategories/{impactCategoryName} + /// + /// + /// Operation Id + /// ImpactCategory_Get + /// + /// + /// Default Api Version + /// 2024-05-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the impact category. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetImpactCategory(string impactCategoryName, CancellationToken cancellationToken = default) + { + return GetImpactCategories().Get(impactCategoryName, cancellationToken); + } + + /// Gets a collection of ConnectorResources in the SubscriptionResource. + /// An object representing collection of ConnectorResources and their operations over a ConnectorResource. + public virtual ConnectorCollection GetConnectors() + { + return GetCachedClient(client => new ConnectorCollection(client, Id)); + } + + /// + /// Get a Connector + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.Impact/connectors/{connectorName} + /// + /// + /// Operation Id + /// Connector_Get + /// + /// + /// Default Api Version + /// 2024-05-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the connector. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetConnectorAsync(string connectorName, CancellationToken cancellationToken = default) + { + return await GetConnectors().GetAsync(connectorName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get a Connector + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.Impact/connectors/{connectorName} + /// + /// + /// Operation Id + /// Connector_Get + /// + /// + /// Default Api Version + /// 2024-05-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the connector. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetConnector(string connectorName, CancellationToken cancellationToken = default) + { + return GetConnectors().Get(connectorName, cancellationToken); + } + } +} diff --git a/sdk/impactreporting/Azure.ResourceManager.ImpactReporting/src/Generated/ImpactCategoryCollection.cs b/sdk/impactreporting/Azure.ResourceManager.ImpactReporting/src/Generated/ImpactCategoryCollection.cs new file mode 100644 index 000000000000..a3ea25e4ff0f --- /dev/null +++ b/sdk/impactreporting/Azure.ResourceManager.ImpactReporting/src/Generated/ImpactCategoryCollection.cs @@ -0,0 +1,389 @@ +// 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 Autorest.CSharp.Core; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.Resources; + +namespace Azure.ResourceManager.ImpactReporting +{ + /// + /// 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 GetImpactCategories method from an instance of . + /// + public partial class ImpactCategoryCollection : ArmCollection + { + private readonly ClientDiagnostics _impactCategoryClientDiagnostics; + private readonly ImpactCategoriesRestOperations _impactCategoryRestClient; + + /// Initializes a new instance of the class for mocking. + protected ImpactCategoryCollection() + { + } + + /// 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 ImpactCategoryCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _impactCategoryClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.ImpactReporting", ImpactCategoryResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ImpactCategoryResource.ResourceType, out string impactCategoryApiVersion); + _impactCategoryRestClient = new ImpactCategoriesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, impactCategoryApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != SubscriptionResource.ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, SubscriptionResource.ResourceType), nameof(id)); + } + + /// + /// Get a ImpactCategory + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.Impact/impactCategories/{impactCategoryName} + /// + /// + /// Operation Id + /// ImpactCategory_Get + /// + /// + /// Default Api Version + /// 2024-05-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the impact category. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetAsync(string impactCategoryName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(impactCategoryName, nameof(impactCategoryName)); + + using var scope = _impactCategoryClientDiagnostics.CreateScope("ImpactCategoryCollection.Get"); + scope.Start(); + try + { + var response = await _impactCategoryRestClient.GetAsync(Id.SubscriptionId, impactCategoryName, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new ImpactCategoryResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a ImpactCategory + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.Impact/impactCategories/{impactCategoryName} + /// + /// + /// Operation Id + /// ImpactCategory_Get + /// + /// + /// Default Api Version + /// 2024-05-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the impact category. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Get(string impactCategoryName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(impactCategoryName, nameof(impactCategoryName)); + + using var scope = _impactCategoryClientDiagnostics.CreateScope("ImpactCategoryCollection.Get"); + scope.Start(); + try + { + var response = _impactCategoryRestClient.Get(Id.SubscriptionId, impactCategoryName, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new ImpactCategoryResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// List ImpactCategory resources by subscription + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.Impact/impactCategories + /// + /// + /// Operation Id + /// ImpactCategory_ListBySubscription + /// + /// + /// Default Api Version + /// 2024-05-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Filter by resource type. + /// Filter by category name. + /// The cancellation token to use. + /// is null. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetAllAsync(string resourceType, string categoryName = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(resourceType, nameof(resourceType)); + + HttpMessage FirstPageRequest(int? pageSizeHint) => _impactCategoryRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId, resourceType, categoryName); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _impactCategoryRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId, resourceType, categoryName); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new ImpactCategoryResource(Client, ImpactCategoryData.DeserializeImpactCategoryData(e)), _impactCategoryClientDiagnostics, Pipeline, "ImpactCategoryCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// List ImpactCategory resources by subscription + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.Impact/impactCategories + /// + /// + /// Operation Id + /// ImpactCategory_ListBySubscription + /// + /// + /// Default Api Version + /// 2024-05-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Filter by resource type. + /// Filter by category name. + /// The cancellation token to use. + /// is null. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetAll(string resourceType, string categoryName = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(resourceType, nameof(resourceType)); + + HttpMessage FirstPageRequest(int? pageSizeHint) => _impactCategoryRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId, resourceType, categoryName); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _impactCategoryRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId, resourceType, categoryName); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new ImpactCategoryResource(Client, ImpactCategoryData.DeserializeImpactCategoryData(e)), _impactCategoryClientDiagnostics, Pipeline, "ImpactCategoryCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.Impact/impactCategories/{impactCategoryName} + /// + /// + /// Operation Id + /// ImpactCategory_Get + /// + /// + /// Default Api Version + /// 2024-05-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the impact category. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> ExistsAsync(string impactCategoryName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(impactCategoryName, nameof(impactCategoryName)); + + using var scope = _impactCategoryClientDiagnostics.CreateScope("ImpactCategoryCollection.Exists"); + scope.Start(); + try + { + var response = await _impactCategoryRestClient.GetAsync(Id.SubscriptionId, impactCategoryName, 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}/providers/Microsoft.Impact/impactCategories/{impactCategoryName} + /// + /// + /// Operation Id + /// ImpactCategory_Get + /// + /// + /// Default Api Version + /// 2024-05-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the impact category. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Exists(string impactCategoryName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(impactCategoryName, nameof(impactCategoryName)); + + using var scope = _impactCategoryClientDiagnostics.CreateScope("ImpactCategoryCollection.Exists"); + scope.Start(); + try + { + var response = _impactCategoryRestClient.Get(Id.SubscriptionId, impactCategoryName, 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}/providers/Microsoft.Impact/impactCategories/{impactCategoryName} + /// + /// + /// Operation Id + /// ImpactCategory_Get + /// + /// + /// Default Api Version + /// 2024-05-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the impact category. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetIfExistsAsync(string impactCategoryName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(impactCategoryName, nameof(impactCategoryName)); + + using var scope = _impactCategoryClientDiagnostics.CreateScope("ImpactCategoryCollection.GetIfExists"); + scope.Start(); + try + { + var response = await _impactCategoryRestClient.GetAsync(Id.SubscriptionId, impactCategoryName, cancellationToken: cancellationToken).ConfigureAwait(false); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new ImpactCategoryResource(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}/providers/Microsoft.Impact/impactCategories/{impactCategoryName} + /// + /// + /// Operation Id + /// ImpactCategory_Get + /// + /// + /// Default Api Version + /// 2024-05-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the impact category. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual NullableResponse GetIfExists(string impactCategoryName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(impactCategoryName, nameof(impactCategoryName)); + + using var scope = _impactCategoryClientDiagnostics.CreateScope("ImpactCategoryCollection.GetIfExists"); + scope.Start(); + try + { + var response = _impactCategoryRestClient.Get(Id.SubscriptionId, impactCategoryName, cancellationToken: cancellationToken); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new ImpactCategoryResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/impactreporting/Azure.ResourceManager.ImpactReporting/src/Generated/ImpactCategoryData.Serialization.cs b/sdk/impactreporting/Azure.ResourceManager.ImpactReporting/src/Generated/ImpactCategoryData.Serialization.cs new file mode 100644 index 000000000000..fd506778bdc5 --- /dev/null +++ b/sdk/impactreporting/Azure.ResourceManager.ImpactReporting/src/Generated/ImpactCategoryData.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.ImpactReporting.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.ImpactReporting +{ + public partial class ImpactCategoryData : 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(ImpactCategoryData)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (Optional.IsDefined(Properties)) + { + writer.WritePropertyName("properties"u8); + writer.WriteObjectValue(Properties, options); + } + } + + ImpactCategoryData 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(ImpactCategoryData)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeImpactCategoryData(document.RootElement, options); + } + + internal static ImpactCategoryData DeserializeImpactCategoryData(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ImpactCategoryProperties 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 = ImpactCategoryProperties.DeserializeImpactCategoryProperties(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 ImpactCategoryData( + 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(ImpactCategoryData)} does not support writing '{options.Format}' format."); + } + } + + ImpactCategoryData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeImpactCategoryData(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ImpactCategoryData)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/impactreporting/Azure.ResourceManager.ImpactReporting/src/Generated/ImpactCategoryData.cs b/sdk/impactreporting/Azure.ResourceManager.ImpactReporting/src/Generated/ImpactCategoryData.cs new file mode 100644 index 000000000000..6605b9661ceb --- /dev/null +++ b/sdk/impactreporting/Azure.ResourceManager.ImpactReporting/src/Generated/ImpactCategoryData.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.ImpactReporting.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.ImpactReporting +{ + /// + /// A class representing the ImpactCategory data model. + /// ImpactCategory resource + /// + public partial class ImpactCategoryData : 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 . + internal ImpactCategoryData() + { + } + + /// 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 ImpactCategoryData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, ImpactCategoryProperties properties, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) + { + Properties = properties; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The resource-specific properties for this resource. + public ImpactCategoryProperties Properties { get; } + } +} diff --git a/sdk/impactreporting/Azure.ResourceManager.ImpactReporting/src/Generated/ImpactCategoryResource.Serialization.cs b/sdk/impactreporting/Azure.ResourceManager.ImpactReporting/src/Generated/ImpactCategoryResource.Serialization.cs new file mode 100644 index 000000000000..225490832a38 --- /dev/null +++ b/sdk/impactreporting/Azure.ResourceManager.ImpactReporting/src/Generated/ImpactCategoryResource.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.ImpactReporting +{ + public partial class ImpactCategoryResource : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); + + ImpactCategoryData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options); + + ImpactCategoryData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options); + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); + } +} diff --git a/sdk/impactreporting/Azure.ResourceManager.ImpactReporting/src/Generated/ImpactCategoryResource.cs b/sdk/impactreporting/Azure.ResourceManager.ImpactReporting/src/Generated/ImpactCategoryResource.cs new file mode 100644 index 000000000000..4d1590547b24 --- /dev/null +++ b/sdk/impactreporting/Azure.ResourceManager.ImpactReporting/src/Generated/ImpactCategoryResource.cs @@ -0,0 +1,170 @@ +// 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; +using Azure.ResourceManager.Resources; + +namespace Azure.ResourceManager.ImpactReporting +{ + /// + /// A Class representing an ImpactCategory 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 GetImpactCategoryResource method. + /// Otherwise you can get one from its parent resource using the GetImpactCategory method. + /// + public partial class ImpactCategoryResource : ArmResource + { + /// Generate the resource identifier of a instance. + /// The subscriptionId. + /// The impactCategoryName. + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string impactCategoryName) + { + var resourceId = $"/subscriptions/{subscriptionId}/providers/Microsoft.Impact/impactCategories/{impactCategoryName}"; + return new ResourceIdentifier(resourceId); + } + + private readonly ClientDiagnostics _impactCategoryClientDiagnostics; + private readonly ImpactCategoriesRestOperations _impactCategoryRestClient; + private readonly ImpactCategoryData _data; + + /// Gets the resource type for the operations. + public static readonly ResourceType ResourceType = "Microsoft.Impact/impactCategories"; + + /// Initializes a new instance of the class for mocking. + protected ImpactCategoryResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal ImpactCategoryResource(ArmClient client, ImpactCategoryData 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 ImpactCategoryResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _impactCategoryClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.ImpactReporting", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string impactCategoryApiVersion); + _impactCategoryRestClient = new ImpactCategoriesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, impactCategoryApiVersion); +#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 ImpactCategoryData 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 ImpactCategory + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.Impact/impactCategories/{impactCategoryName} + /// + /// + /// Operation Id + /// ImpactCategory_Get + /// + /// + /// Default Api Version + /// 2024-05-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _impactCategoryClientDiagnostics.CreateScope("ImpactCategoryResource.Get"); + scope.Start(); + try + { + var response = await _impactCategoryRestClient.GetAsync(Id.SubscriptionId, Id.Name, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new ImpactCategoryResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a ImpactCategory + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.Impact/impactCategories/{impactCategoryName} + /// + /// + /// Operation Id + /// ImpactCategory_Get + /// + /// + /// Default Api Version + /// 2024-05-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _impactCategoryClientDiagnostics.CreateScope("ImpactCategoryResource.Get"); + scope.Start(); + try + { + var response = _impactCategoryRestClient.Get(Id.SubscriptionId, Id.Name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new ImpactCategoryResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/impactreporting/Azure.ResourceManager.ImpactReporting/src/Generated/InsightCollection.cs b/sdk/impactreporting/Azure.ResourceManager.ImpactReporting/src/Generated/InsightCollection.cs new file mode 100644 index 000000000000..5f628d8a4a83 --- /dev/null +++ b/sdk/impactreporting/Azure.ResourceManager.ImpactReporting/src/Generated/InsightCollection.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.ImpactReporting +{ + /// + /// 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 GetInsights method from an instance of . + /// + public partial class InsightCollection : ArmCollection, IEnumerable, IAsyncEnumerable + { + private readonly ClientDiagnostics _insightClientDiagnostics; + private readonly InsightsRestOperations _insightRestClient; + + /// Initializes a new instance of the class for mocking. + protected InsightCollection() + { + } + + /// 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 InsightCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _insightClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.ImpactReporting", InsightResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(InsightResource.ResourceType, out string insightApiVersion); + _insightRestClient = new InsightsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, insightApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != WorkloadImpactResource.ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, WorkloadImpactResource.ResourceType), nameof(id)); + } + + /// + /// Create Insight resource, This is Admin only operation + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.Impact/workloadImpacts/{workloadImpactName}/insights/{insightName} + /// + /// + /// Operation Id + /// Insight_Create + /// + /// + /// Default Api Version + /// 2024-05-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 insight. + /// 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 insightName, InsightData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(insightName, nameof(insightName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _insightClientDiagnostics.CreateScope("InsightCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = await _insightRestClient.CreateAsync(Id.SubscriptionId, Id.Name, insightName, data, cancellationToken).ConfigureAwait(false); + var uri = _insightRestClient.CreateCreateRequestUri(Id.SubscriptionId, Id.Name, insightName, data); + var rehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(RequestMethod.Put, uri.ToUri(), uri.ToString(), "None", null, OperationFinalStateVia.OriginalUri.ToString()); + var operation = new ImpactReportingArmOperation(Response.FromValue(new InsightResource(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 Insight resource, This is Admin only operation + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.Impact/workloadImpacts/{workloadImpactName}/insights/{insightName} + /// + /// + /// Operation Id + /// Insight_Create + /// + /// + /// Default Api Version + /// 2024-05-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 insight. + /// 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 insightName, InsightData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(insightName, nameof(insightName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _insightClientDiagnostics.CreateScope("InsightCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = _insightRestClient.Create(Id.SubscriptionId, Id.Name, insightName, data, cancellationToken); + var uri = _insightRestClient.CreateCreateRequestUri(Id.SubscriptionId, Id.Name, insightName, data); + var rehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(RequestMethod.Put, uri.ToUri(), uri.ToString(), "None", null, OperationFinalStateVia.OriginalUri.ToString()); + var operation = new ImpactReportingArmOperation(Response.FromValue(new InsightResource(Client, response), response.GetRawResponse()), rehydrationToken); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get Insight resources by workloadImpactName and insightName + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.Impact/workloadImpacts/{workloadImpactName}/insights/{insightName} + /// + /// + /// Operation Id + /// Insight_Get + /// + /// + /// Default Api Version + /// 2024-05-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the insight. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetAsync(string insightName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(insightName, nameof(insightName)); + + using var scope = _insightClientDiagnostics.CreateScope("InsightCollection.Get"); + scope.Start(); + try + { + var response = await _insightRestClient.GetAsync(Id.SubscriptionId, Id.Name, insightName, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new InsightResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get Insight resources by workloadImpactName and insightName + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.Impact/workloadImpacts/{workloadImpactName}/insights/{insightName} + /// + /// + /// Operation Id + /// Insight_Get + /// + /// + /// Default Api Version + /// 2024-05-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the insight. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Get(string insightName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(insightName, nameof(insightName)); + + using var scope = _insightClientDiagnostics.CreateScope("InsightCollection.Get"); + scope.Start(); + try + { + var response = _insightRestClient.Get(Id.SubscriptionId, Id.Name, insightName, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new InsightResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// List Insight resources by workloadImpactName + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.Impact/workloadImpacts/{workloadImpactName}/insights + /// + /// + /// Operation Id + /// Insight_ListBySubscription + /// + /// + /// Default Api Version + /// 2024-05-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) => _insightRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _insightRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId, Id.Name); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new InsightResource(Client, InsightData.DeserializeInsightData(e)), _insightClientDiagnostics, Pipeline, "InsightCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// List Insight resources by workloadImpactName + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.Impact/workloadImpacts/{workloadImpactName}/insights + /// + /// + /// Operation Id + /// Insight_ListBySubscription + /// + /// + /// Default Api Version + /// 2024-05-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) => _insightRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _insightRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId, Id.Name); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new InsightResource(Client, InsightData.DeserializeInsightData(e)), _insightClientDiagnostics, Pipeline, "InsightCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.Impact/workloadImpacts/{workloadImpactName}/insights/{insightName} + /// + /// + /// Operation Id + /// Insight_Get + /// + /// + /// Default Api Version + /// 2024-05-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the insight. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> ExistsAsync(string insightName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(insightName, nameof(insightName)); + + using var scope = _insightClientDiagnostics.CreateScope("InsightCollection.Exists"); + scope.Start(); + try + { + var response = await _insightRestClient.GetAsync(Id.SubscriptionId, Id.Name, insightName, 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}/providers/Microsoft.Impact/workloadImpacts/{workloadImpactName}/insights/{insightName} + /// + /// + /// Operation Id + /// Insight_Get + /// + /// + /// Default Api Version + /// 2024-05-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the insight. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Exists(string insightName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(insightName, nameof(insightName)); + + using var scope = _insightClientDiagnostics.CreateScope("InsightCollection.Exists"); + scope.Start(); + try + { + var response = _insightRestClient.Get(Id.SubscriptionId, Id.Name, insightName, 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}/providers/Microsoft.Impact/workloadImpacts/{workloadImpactName}/insights/{insightName} + /// + /// + /// Operation Id + /// Insight_Get + /// + /// + /// Default Api Version + /// 2024-05-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the insight. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetIfExistsAsync(string insightName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(insightName, nameof(insightName)); + + using var scope = _insightClientDiagnostics.CreateScope("InsightCollection.GetIfExists"); + scope.Start(); + try + { + var response = await _insightRestClient.GetAsync(Id.SubscriptionId, Id.Name, insightName, cancellationToken: cancellationToken).ConfigureAwait(false); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new InsightResource(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}/providers/Microsoft.Impact/workloadImpacts/{workloadImpactName}/insights/{insightName} + /// + /// + /// Operation Id + /// Insight_Get + /// + /// + /// Default Api Version + /// 2024-05-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the insight. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual NullableResponse GetIfExists(string insightName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(insightName, nameof(insightName)); + + using var scope = _insightClientDiagnostics.CreateScope("InsightCollection.GetIfExists"); + scope.Start(); + try + { + var response = _insightRestClient.Get(Id.SubscriptionId, Id.Name, insightName, cancellationToken: cancellationToken); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new InsightResource(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/impactreporting/Azure.ResourceManager.ImpactReporting/src/Generated/InsightData.Serialization.cs b/sdk/impactreporting/Azure.ResourceManager.ImpactReporting/src/Generated/InsightData.Serialization.cs new file mode 100644 index 000000000000..62649f4e6be2 --- /dev/null +++ b/sdk/impactreporting/Azure.ResourceManager.ImpactReporting/src/Generated/InsightData.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.ImpactReporting.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.ImpactReporting +{ + public partial class InsightData : 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(InsightData)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (Optional.IsDefined(Properties)) + { + writer.WritePropertyName("properties"u8); + writer.WriteObjectValue(Properties, options); + } + } + + InsightData 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(InsightData)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeInsightData(document.RootElement, options); + } + + internal static InsightData DeserializeInsightData(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + InsightProperties 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 = InsightProperties.DeserializeInsightProperties(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 InsightData( + 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(InsightData)} does not support writing '{options.Format}' format."); + } + } + + InsightData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeInsightData(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(InsightData)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/impactreporting/Azure.ResourceManager.ImpactReporting/src/Generated/InsightData.cs b/sdk/impactreporting/Azure.ResourceManager.ImpactReporting/src/Generated/InsightData.cs new file mode 100644 index 000000000000..c5bb97ad25a8 --- /dev/null +++ b/sdk/impactreporting/Azure.ResourceManager.ImpactReporting/src/Generated/InsightData.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.ImpactReporting.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.ImpactReporting +{ + /// + /// A class representing the Insight data model. + /// Insight resource + /// + public partial class InsightData : 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 InsightData() + { + } + + /// 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 InsightData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, InsightProperties properties, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) + { + Properties = properties; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The resource-specific properties for this resource. + public InsightProperties Properties { get; set; } + } +} diff --git a/sdk/impactreporting/Azure.ResourceManager.ImpactReporting/src/Generated/InsightResource.Serialization.cs b/sdk/impactreporting/Azure.ResourceManager.ImpactReporting/src/Generated/InsightResource.Serialization.cs new file mode 100644 index 000000000000..c5a59366e0f5 --- /dev/null +++ b/sdk/impactreporting/Azure.ResourceManager.ImpactReporting/src/Generated/InsightResource.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.ImpactReporting +{ + public partial class InsightResource : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); + + InsightData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options); + + InsightData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options); + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); + } +} diff --git a/sdk/impactreporting/Azure.ResourceManager.ImpactReporting/src/Generated/InsightResource.cs b/sdk/impactreporting/Azure.ResourceManager.ImpactReporting/src/Generated/InsightResource.cs new file mode 100644 index 000000000000..c1945374eac6 --- /dev/null +++ b/sdk/impactreporting/Azure.ResourceManager.ImpactReporting/src/Generated/InsightResource.cs @@ -0,0 +1,354 @@ +// 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.ImpactReporting +{ + /// + /// A Class representing an Insight 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 GetInsightResource method. + /// Otherwise you can get one from its parent resource using the GetInsight method. + /// + public partial class InsightResource : ArmResource + { + /// Generate the resource identifier of a instance. + /// The subscriptionId. + /// The workloadImpactName. + /// The insightName. + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string workloadImpactName, string insightName) + { + var resourceId = $"/subscriptions/{subscriptionId}/providers/Microsoft.Impact/workloadImpacts/{workloadImpactName}/insights/{insightName}"; + return new ResourceIdentifier(resourceId); + } + + private readonly ClientDiagnostics _insightClientDiagnostics; + private readonly InsightsRestOperations _insightRestClient; + private readonly InsightData _data; + + /// Gets the resource type for the operations. + public static readonly ResourceType ResourceType = "Microsoft.Impact/workloadImpacts/insights"; + + /// Initializes a new instance of the class for mocking. + protected InsightResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal InsightResource(ArmClient client, InsightData 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 InsightResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _insightClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.ImpactReporting", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string insightApiVersion); + _insightRestClient = new InsightsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, insightApiVersion); +#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 InsightData 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 Insight resources by workloadImpactName and insightName + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.Impact/workloadImpacts/{workloadImpactName}/insights/{insightName} + /// + /// + /// Operation Id + /// Insight_Get + /// + /// + /// Default Api Version + /// 2024-05-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _insightClientDiagnostics.CreateScope("InsightResource.Get"); + scope.Start(); + try + { + var response = await _insightRestClient.GetAsync(Id.SubscriptionId, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new InsightResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get Insight resources by workloadImpactName and insightName + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.Impact/workloadImpacts/{workloadImpactName}/insights/{insightName} + /// + /// + /// Operation Id + /// Insight_Get + /// + /// + /// Default Api Version + /// 2024-05-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _insightClientDiagnostics.CreateScope("InsightResource.Get"); + scope.Start(); + try + { + var response = _insightRestClient.Get(Id.SubscriptionId, Id.Parent.Name, Id.Name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new InsightResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Delete Insight resource, This is Admin only operation + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.Impact/workloadImpacts/{workloadImpactName}/insights/{insightName} + /// + /// + /// Operation Id + /// Insight_Delete + /// + /// + /// Default Api Version + /// 2024-05-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 = _insightClientDiagnostics.CreateScope("InsightResource.Delete"); + scope.Start(); + try + { + var response = await _insightRestClient.DeleteAsync(Id.SubscriptionId, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + var uri = _insightRestClient.CreateDeleteRequestUri(Id.SubscriptionId, Id.Parent.Name, Id.Name); + var rehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(RequestMethod.Delete, uri.ToUri(), uri.ToString(), "None", null, OperationFinalStateVia.OriginalUri.ToString()); + var operation = new ImpactReportingArmOperation(response, rehydrationToken); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Delete Insight resource, This is Admin only operation + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.Impact/workloadImpacts/{workloadImpactName}/insights/{insightName} + /// + /// + /// Operation Id + /// Insight_Delete + /// + /// + /// Default Api Version + /// 2024-05-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 = _insightClientDiagnostics.CreateScope("InsightResource.Delete"); + scope.Start(); + try + { + var response = _insightRestClient.Delete(Id.SubscriptionId, Id.Parent.Name, Id.Name, cancellationToken); + var uri = _insightRestClient.CreateDeleteRequestUri(Id.SubscriptionId, Id.Parent.Name, Id.Name); + var rehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(RequestMethod.Delete, uri.ToUri(), uri.ToString(), "None", null, OperationFinalStateVia.OriginalUri.ToString()); + var operation = new ImpactReportingArmOperation(response, rehydrationToken); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletionResponse(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Create Insight resource, This is Admin only operation + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.Impact/workloadImpacts/{workloadImpactName}/insights/{insightName} + /// + /// + /// Operation Id + /// Insight_Create + /// + /// + /// Default Api Version + /// 2024-05-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, InsightData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _insightClientDiagnostics.CreateScope("InsightResource.Update"); + scope.Start(); + try + { + var response = await _insightRestClient.CreateAsync(Id.SubscriptionId, Id.Parent.Name, Id.Name, data, cancellationToken).ConfigureAwait(false); + var uri = _insightRestClient.CreateCreateRequestUri(Id.SubscriptionId, Id.Parent.Name, Id.Name, data); + var rehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(RequestMethod.Put, uri.ToUri(), uri.ToString(), "None", null, OperationFinalStateVia.OriginalUri.ToString()); + var operation = new ImpactReportingArmOperation(Response.FromValue(new InsightResource(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 Insight resource, This is Admin only operation + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.Impact/workloadImpacts/{workloadImpactName}/insights/{insightName} + /// + /// + /// Operation Id + /// Insight_Create + /// + /// + /// Default Api Version + /// 2024-05-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, InsightData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _insightClientDiagnostics.CreateScope("InsightResource.Update"); + scope.Start(); + try + { + var response = _insightRestClient.Create(Id.SubscriptionId, Id.Parent.Name, Id.Name, data, cancellationToken); + var uri = _insightRestClient.CreateCreateRequestUri(Id.SubscriptionId, Id.Parent.Name, Id.Name, data); + var rehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(RequestMethod.Put, uri.ToUri(), uri.ToString(), "None", null, OperationFinalStateVia.OriginalUri.ToString()); + var operation = new ImpactReportingArmOperation(Response.FromValue(new InsightResource(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/impactreporting/Azure.ResourceManager.ImpactReporting/src/Generated/Internal/Argument.cs b/sdk/impactreporting/Azure.ResourceManager.ImpactReporting/src/Generated/Internal/Argument.cs new file mode 100644 index 000000000000..8bcc5c0fc004 --- /dev/null +++ b/sdk/impactreporting/Azure.ResourceManager.ImpactReporting/src/Generated/Internal/Argument.cs @@ -0,0 +1,129 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ImpactReporting +{ + internal static class Argument + { + public static void AssertNotNull(T value, string name) + { + if (value is null) + { + throw new ArgumentNullException(name); + } + } + + public static void AssertNotNull(T? value, string name) + where T : struct + { + if (!value.HasValue) + { + throw new ArgumentNullException(name); + } + } + + public static void AssertNotNullOrEmpty(IEnumerable value, string name) + { + if (value is null) + { + throw new ArgumentNullException(name); + } + if (value is ICollection collectionOfT && collectionOfT.Count == 0) + { + throw new ArgumentException("Value cannot be an empty collection.", name); + } + if (value is ICollection collection && collection.Count == 0) + { + throw new ArgumentException("Value cannot be an empty collection.", name); + } + using IEnumerator e = value.GetEnumerator(); + if (!e.MoveNext()) + { + throw new ArgumentException("Value cannot be an empty collection.", name); + } + } + + public static void AssertNotNullOrEmpty(string value, string name) + { + if (value is null) + { + throw new ArgumentNullException(name); + } + if (value.Length == 0) + { + throw new ArgumentException("Value cannot be an empty string.", name); + } + } + + public static void AssertNotNullOrWhiteSpace(string value, string name) + { + if (value is null) + { + throw new ArgumentNullException(name); + } + if (string.IsNullOrWhiteSpace(value)) + { + throw new ArgumentException("Value cannot be empty or contain only white-space characters.", name); + } + } + + public static void AssertNotDefault(ref T value, string name) + where T : struct, IEquatable + { + if (value.Equals(default)) + { + throw new ArgumentException("Value cannot be empty.", name); + } + } + + public static void AssertInRange(T value, T minimum, T maximum, string name) + where T : notnull, IComparable + { + if (minimum.CompareTo(value) > 0) + { + throw new ArgumentOutOfRangeException(name, "Value is less than the minimum allowed."); + } + if (maximum.CompareTo(value) < 0) + { + throw new ArgumentOutOfRangeException(name, "Value is greater than the maximum allowed."); + } + } + + public static void AssertEnumDefined(Type enumType, object value, string name) + { + if (!Enum.IsDefined(enumType, value)) + { + throw new ArgumentException($"Value not defined for {enumType.FullName}.", name); + } + } + + public static T CheckNotNull(T value, string name) + where T : class + { + AssertNotNull(value, name); + return value; + } + + public static string CheckNotNullOrEmpty(string value, string name) + { + AssertNotNullOrEmpty(value, name); + return value; + } + + public static void AssertNull(T value, string name, string message = null) + { + if (value != null) + { + throw new ArgumentException(message ?? "Value must be null.", name); + } + } + } +} diff --git a/sdk/impactreporting/Azure.ResourceManager.ImpactReporting/src/Generated/Internal/ChangeTrackingDictionary.cs b/sdk/impactreporting/Azure.ResourceManager.ImpactReporting/src/Generated/Internal/ChangeTrackingDictionary.cs new file mode 100644 index 000000000000..beda10e4a2a1 --- /dev/null +++ b/sdk/impactreporting/Azure.ResourceManager.ImpactReporting/src/Generated/Internal/ChangeTrackingDictionary.cs @@ -0,0 +1,167 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ImpactReporting +{ + internal class ChangeTrackingDictionary : IDictionary, IReadOnlyDictionary where TKey : notnull + { + private IDictionary _innerDictionary; + + public ChangeTrackingDictionary() + { + } + + public ChangeTrackingDictionary(IDictionary dictionary) + { + if (dictionary == null) + { + return; + } + _innerDictionary = new Dictionary(dictionary); + } + + public ChangeTrackingDictionary(IReadOnlyDictionary dictionary) + { + if (dictionary == null) + { + return; + } + _innerDictionary = new Dictionary(); + foreach (var pair in dictionary) + { + _innerDictionary.Add(pair); + } + } + + public bool IsUndefined => _innerDictionary == null; + + public int Count => IsUndefined ? 0 : EnsureDictionary().Count; + + public bool IsReadOnly => IsUndefined ? false : EnsureDictionary().IsReadOnly; + + public ICollection Keys => IsUndefined ? Array.Empty() : EnsureDictionary().Keys; + + public ICollection Values => IsUndefined ? Array.Empty() : EnsureDictionary().Values; + + public TValue this[TKey key] + { + get + { + if (IsUndefined) + { + throw new KeyNotFoundException(nameof(key)); + } + return EnsureDictionary()[key]; + } + set + { + EnsureDictionary()[key] = value; + } + } + + IEnumerable IReadOnlyDictionary.Keys => Keys; + + IEnumerable IReadOnlyDictionary.Values => Values; + + public IEnumerator> GetEnumerator() + { + if (IsUndefined) + { + IEnumerator> enumerateEmpty() + { + yield break; + } + return enumerateEmpty(); + } + return EnsureDictionary().GetEnumerator(); + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetEnumerator(); + } + + public void Add(KeyValuePair item) + { + EnsureDictionary().Add(item); + } + + public void Clear() + { + EnsureDictionary().Clear(); + } + + public bool Contains(KeyValuePair item) + { + if (IsUndefined) + { + return false; + } + return EnsureDictionary().Contains(item); + } + + public void CopyTo(KeyValuePair[] array, int index) + { + if (IsUndefined) + { + return; + } + EnsureDictionary().CopyTo(array, index); + } + + public bool Remove(KeyValuePair item) + { + if (IsUndefined) + { + return false; + } + return EnsureDictionary().Remove(item); + } + + public void Add(TKey key, TValue value) + { + EnsureDictionary().Add(key, value); + } + + public bool ContainsKey(TKey key) + { + if (IsUndefined) + { + return false; + } + return EnsureDictionary().ContainsKey(key); + } + + public bool Remove(TKey key) + { + if (IsUndefined) + { + return false; + } + return EnsureDictionary().Remove(key); + } + + public bool TryGetValue(TKey key, out TValue value) + { + if (IsUndefined) + { + value = default; + return false; + } + return EnsureDictionary().TryGetValue(key, out value); + } + + public IDictionary EnsureDictionary() + { + return _innerDictionary ??= new Dictionary(); + } + } +} diff --git a/sdk/impactreporting/Azure.ResourceManager.ImpactReporting/src/Generated/Internal/ChangeTrackingList.cs b/sdk/impactreporting/Azure.ResourceManager.ImpactReporting/src/Generated/Internal/ChangeTrackingList.cs new file mode 100644 index 000000000000..a9c54ec968fb --- /dev/null +++ b/sdk/impactreporting/Azure.ResourceManager.ImpactReporting/src/Generated/Internal/ChangeTrackingList.cs @@ -0,0 +1,153 @@ +// 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.Linq; + +namespace Azure.ResourceManager.ImpactReporting +{ + internal class ChangeTrackingList : IList, IReadOnlyList + { + private IList _innerList; + + public ChangeTrackingList() + { + } + + public ChangeTrackingList(IList innerList) + { + if (innerList != null) + { + _innerList = innerList; + } + } + + public ChangeTrackingList(IReadOnlyList innerList) + { + if (innerList != null) + { + _innerList = innerList.ToList(); + } + } + + public bool IsUndefined => _innerList == null; + + public int Count => IsUndefined ? 0 : EnsureList().Count; + + public bool IsReadOnly => IsUndefined ? false : EnsureList().IsReadOnly; + + public T this[int index] + { + get + { + if (IsUndefined) + { + throw new ArgumentOutOfRangeException(nameof(index)); + } + return EnsureList()[index]; + } + set + { + if (IsUndefined) + { + throw new ArgumentOutOfRangeException(nameof(index)); + } + EnsureList()[index] = value; + } + } + + public void Reset() + { + _innerList = null; + } + + public IEnumerator GetEnumerator() + { + if (IsUndefined) + { + IEnumerator enumerateEmpty() + { + yield break; + } + return enumerateEmpty(); + } + return EnsureList().GetEnumerator(); + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetEnumerator(); + } + + public void Add(T item) + { + EnsureList().Add(item); + } + + public void Clear() + { + EnsureList().Clear(); + } + + public bool Contains(T item) + { + if (IsUndefined) + { + return false; + } + return EnsureList().Contains(item); + } + + public void CopyTo(T[] array, int arrayIndex) + { + if (IsUndefined) + { + return; + } + EnsureList().CopyTo(array, arrayIndex); + } + + public bool Remove(T item) + { + if (IsUndefined) + { + return false; + } + return EnsureList().Remove(item); + } + + public int IndexOf(T item) + { + if (IsUndefined) + { + return -1; + } + return EnsureList().IndexOf(item); + } + + public void Insert(int index, T item) + { + EnsureList().Insert(index, item); + } + + public void RemoveAt(int index) + { + if (IsUndefined) + { + throw new ArgumentOutOfRangeException(nameof(index)); + } + EnsureList().RemoveAt(index); + } + + public IList EnsureList() + { + return _innerList ??= new List(); + } + } +} diff --git a/sdk/impactreporting/Azure.ResourceManager.ImpactReporting/src/Generated/Internal/ModelSerializationExtensions.cs b/sdk/impactreporting/Azure.ResourceManager.ImpactReporting/src/Generated/Internal/ModelSerializationExtensions.cs new file mode 100644 index 000000000000..ecd60af6d374 --- /dev/null +++ b/sdk/impactreporting/Azure.ResourceManager.ImpactReporting/src/Generated/Internal/ModelSerializationExtensions.cs @@ -0,0 +1,398 @@ +// 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.Diagnostics; +using System.Globalization; +using System.Text.Json; +using System.Xml; +using Azure.Core; + +namespace Azure.ResourceManager.ImpactReporting +{ + internal static class ModelSerializationExtensions + { + internal static readonly ModelReaderWriterOptions WireOptions = new ModelReaderWriterOptions("W"); + + public static object GetObject(this JsonElement element) + { + switch (element.ValueKind) + { + case JsonValueKind.String: + return element.GetString(); + case JsonValueKind.Number: + if (element.TryGetInt32(out int intValue)) + { + return intValue; + } + if (element.TryGetInt64(out long longValue)) + { + return longValue; + } + return element.GetDouble(); + case JsonValueKind.True: + return true; + case JsonValueKind.False: + return false; + case JsonValueKind.Undefined: + case JsonValueKind.Null: + return null; + case JsonValueKind.Object: + var dictionary = new Dictionary(); + foreach (var jsonProperty in element.EnumerateObject()) + { + dictionary.Add(jsonProperty.Name, jsonProperty.Value.GetObject()); + } + return dictionary; + case JsonValueKind.Array: + var list = new List(); + foreach (var item in element.EnumerateArray()) + { + list.Add(item.GetObject()); + } + return list.ToArray(); + default: + throw new NotSupportedException($"Not supported value kind {element.ValueKind}"); + } + } + + public static byte[] GetBytesFromBase64(this JsonElement element, string format) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + + return format switch + { + "U" => TypeFormatters.FromBase64UrlString(element.GetRequiredString()), + "D" => element.GetBytesFromBase64(), + _ => throw new ArgumentException($"Format is not supported: '{format}'", nameof(format)) + }; + } + + public static DateTimeOffset GetDateTimeOffset(this JsonElement element, string format) => format switch + { + "U" when element.ValueKind == JsonValueKind.Number => DateTimeOffset.FromUnixTimeSeconds(element.GetInt64()), + _ => TypeFormatters.ParseDateTimeOffset(element.GetString(), format) + }; + + public static TimeSpan GetTimeSpan(this JsonElement element, string format) => TypeFormatters.ParseTimeSpan(element.GetString(), format); + + public static char GetChar(this JsonElement element) + { + if (element.ValueKind == JsonValueKind.String) + { + var text = element.GetString(); + if (text == null || text.Length != 1) + { + throw new NotSupportedException($"Cannot convert \"{text}\" to a char"); + } + return text[0]; + } + else + { + throw new NotSupportedException($"Cannot convert {element.ValueKind} to a char"); + } + } + + [Conditional("DEBUG")] + public static void ThrowNonNullablePropertyIsNull(this JsonProperty property) + { + throw new JsonException($"A property '{property.Name}' defined as non-nullable but received as null from the service. This exception only happens in DEBUG builds of the library and would be ignored in the release build"); + } + + public static string GetRequiredString(this JsonElement element) + { + var value = element.GetString(); + if (value == null) + { + throw new InvalidOperationException($"The requested operation requires an element of type 'String', but the target element has type '{element.ValueKind}'."); + } + return value; + } + + public static void WriteStringValue(this Utf8JsonWriter writer, DateTimeOffset value, string format) + { + writer.WriteStringValue(TypeFormatters.ToString(value, format)); + } + + public static void WriteStringValue(this Utf8JsonWriter writer, DateTime value, string format) + { + writer.WriteStringValue(TypeFormatters.ToString(value, format)); + } + + public static void WriteStringValue(this Utf8JsonWriter writer, TimeSpan value, string format) + { + writer.WriteStringValue(TypeFormatters.ToString(value, format)); + } + + public static void WriteStringValue(this Utf8JsonWriter writer, char value) + { + writer.WriteStringValue(value.ToString(CultureInfo.InvariantCulture)); + } + + public static void WriteBase64StringValue(this Utf8JsonWriter writer, byte[] value, string format) + { + if (value == null) + { + writer.WriteNullValue(); + return; + } + switch (format) + { + case "U": + writer.WriteStringValue(TypeFormatters.ToBase64UrlString(value)); + break; + case "D": + writer.WriteBase64StringValue(value); + break; + default: + throw new ArgumentException($"Format is not supported: '{format}'", nameof(format)); + } + } + + public static void WriteNumberValue(this Utf8JsonWriter writer, DateTimeOffset value, string format) + { + if (format != "U") + { + throw new ArgumentOutOfRangeException(nameof(format), "Only 'U' format is supported when writing a DateTimeOffset as a Number."); + } + writer.WriteNumberValue(value.ToUnixTimeSeconds()); + } + + public static void WriteObjectValue(this Utf8JsonWriter writer, T value, ModelReaderWriterOptions options = null) + { + switch (value) + { + case null: + writer.WriteNullValue(); + break; + case IJsonModel jsonModel: + jsonModel.Write(writer, options ?? WireOptions); + break; + case IUtf8JsonSerializable serializable: + serializable.Write(writer); + break; + case byte[] bytes: + writer.WriteBase64StringValue(bytes); + break; + case BinaryData bytes0: + writer.WriteBase64StringValue(bytes0); + break; + case JsonElement json: + json.WriteTo(writer); + break; + case int i: + writer.WriteNumberValue(i); + break; + case decimal d: + writer.WriteNumberValue(d); + break; + case double d0: + if (double.IsNaN(d0)) + { + writer.WriteStringValue("NaN"); + } + else + { + writer.WriteNumberValue(d0); + } + break; + case float f: + writer.WriteNumberValue(f); + break; + case long l: + writer.WriteNumberValue(l); + break; + case string s: + writer.WriteStringValue(s); + break; + case bool b: + writer.WriteBooleanValue(b); + break; + case Guid g: + writer.WriteStringValue(g); + break; + case DateTimeOffset dateTimeOffset: + writer.WriteStringValue(dateTimeOffset, "O"); + break; + case DateTime dateTime: + writer.WriteStringValue(dateTime, "O"); + break; + case IEnumerable> enumerable: + writer.WriteStartObject(); + foreach (var pair in enumerable) + { + writer.WritePropertyName(pair.Key); + writer.WriteObjectValue(pair.Value, options); + } + writer.WriteEndObject(); + break; + case IEnumerable objectEnumerable: + writer.WriteStartArray(); + foreach (var item in objectEnumerable) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + break; + case TimeSpan timeSpan: + writer.WriteStringValue(timeSpan, "P"); + break; + default: + throw new NotSupportedException($"Not supported type {value.GetType()}"); + } + } + + public static void WriteObjectValue(this Utf8JsonWriter writer, object value, ModelReaderWriterOptions options = null) + { + writer.WriteObjectValue(value, options); + } + + internal static class TypeFormatters + { + private const string RoundtripZFormat = "yyyy-MM-ddTHH:mm:ss.fffffffZ"; + public const string DefaultNumberFormat = "G"; + + public static string ToString(bool value) => value ? "true" : "false"; + + public static string ToString(DateTime value, string format) => value.Kind switch + { + DateTimeKind.Utc => ToString((DateTimeOffset)value, format), + _ => throw new NotSupportedException($"DateTime {value} has a Kind of {value.Kind}. Azure SDK requires it to be UTC. You can call DateTime.SpecifyKind to change Kind property value to DateTimeKind.Utc.") + }; + + public static string ToString(DateTimeOffset value, string format) => format switch + { + "D" => value.ToString("yyyy-MM-dd", CultureInfo.InvariantCulture), + "U" => value.ToUnixTimeSeconds().ToString(CultureInfo.InvariantCulture), + "O" => value.ToUniversalTime().ToString(RoundtripZFormat, CultureInfo.InvariantCulture), + "o" => value.ToUniversalTime().ToString(RoundtripZFormat, CultureInfo.InvariantCulture), + "R" => value.ToString("r", CultureInfo.InvariantCulture), + _ => value.ToString(format, CultureInfo.InvariantCulture) + }; + + public static string ToString(TimeSpan value, string format) => format switch + { + "P" => XmlConvert.ToString(value), + _ => value.ToString(format, CultureInfo.InvariantCulture) + }; + + public static string ToString(byte[] value, string format) => format switch + { + "U" => ToBase64UrlString(value), + "D" => Convert.ToBase64String(value), + _ => throw new ArgumentException($"Format is not supported: '{format}'", nameof(format)) + }; + + public static string ToBase64UrlString(byte[] value) + { + int numWholeOrPartialInputBlocks = checked(value.Length + 2) / 3; + int size = checked(numWholeOrPartialInputBlocks * 4); + char[] output = new char[size]; + + int numBase64Chars = Convert.ToBase64CharArray(value, 0, value.Length, output, 0); + + int i = 0; + for (; i < numBase64Chars; i++) + { + char ch = output[i]; + if (ch == '+') + { + output[i] = '-'; + } + else + { + if (ch == '/') + { + output[i] = '_'; + } + else + { + if (ch == '=') + { + break; + } + } + } + } + + return new string(output, 0, i); + } + + public static byte[] FromBase64UrlString(string value) + { + int paddingCharsToAdd = (value.Length % 4) switch + { + 0 => 0, + 2 => 2, + 3 => 1, + _ => throw new InvalidOperationException("Malformed input") + }; + char[] output = new char[(value.Length + paddingCharsToAdd)]; + int i = 0; + for (; i < value.Length; i++) + { + char ch = value[i]; + if (ch == '-') + { + output[i] = '+'; + } + else + { + if (ch == '_') + { + output[i] = '/'; + } + else + { + output[i] = ch; + } + } + } + + for (; i < output.Length; i++) + { + output[i] = '='; + } + + return Convert.FromBase64CharArray(output, 0, output.Length); + } + + public static DateTimeOffset ParseDateTimeOffset(string value, string format) => format switch + { + "U" => DateTimeOffset.FromUnixTimeSeconds(long.Parse(value, CultureInfo.InvariantCulture)), + _ => DateTimeOffset.Parse(value, CultureInfo.InvariantCulture, DateTimeStyles.AssumeUniversal) + }; + + public static TimeSpan ParseTimeSpan(string value, string format) => format switch + { + "P" => XmlConvert.ToTimeSpan(value), + _ => TimeSpan.ParseExact(value, format, CultureInfo.InvariantCulture) + }; + + public static string ConvertToString(object value, string format = null) => value switch + { + null => "null", + string s => s, + bool b => ToString(b), + int or float or double or long or decimal => ((IFormattable)value).ToString(DefaultNumberFormat, CultureInfo.InvariantCulture), + byte[] b0 when format != null => ToString(b0, format), + IEnumerable s0 => string.Join(",", s0), + DateTimeOffset dateTime when format != null => ToString(dateTime, format), + TimeSpan timeSpan when format != null => ToString(timeSpan, format), + TimeSpan timeSpan0 => XmlConvert.ToString(timeSpan0), + Guid guid => guid.ToString(), + BinaryData binaryData => ConvertToString(binaryData.ToArray(), format), + _ => value.ToString() + }; + } + } +} diff --git a/sdk/impactreporting/Azure.ResourceManager.ImpactReporting/src/Generated/Internal/Optional.cs b/sdk/impactreporting/Azure.ResourceManager.ImpactReporting/src/Generated/Internal/Optional.cs new file mode 100644 index 000000000000..d987d8b2a49d --- /dev/null +++ b/sdk/impactreporting/Azure.ResourceManager.ImpactReporting/src/Generated/Internal/Optional.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; + +namespace Azure.ResourceManager.ImpactReporting +{ + internal static class Optional + { + public static bool IsCollectionDefined(IEnumerable collection) + { + return !(collection is ChangeTrackingList changeTrackingList && changeTrackingList.IsUndefined); + } + + public static bool IsCollectionDefined(IDictionary collection) + { + return !(collection is ChangeTrackingDictionary changeTrackingDictionary && changeTrackingDictionary.IsUndefined); + } + + public static bool IsCollectionDefined(IReadOnlyDictionary collection) + { + return !(collection is ChangeTrackingDictionary changeTrackingDictionary && changeTrackingDictionary.IsUndefined); + } + + public static bool IsDefined(T? value) + where T : struct + { + return value.HasValue; + } + + public static bool IsDefined(object value) + { + return value != null; + } + + public static bool IsDefined(JsonElement value) + { + return value.ValueKind != JsonValueKind.Undefined; + } + + public static bool IsDefined(string value) + { + return value != null; + } + } +} diff --git a/sdk/impactreporting/Azure.ResourceManager.ImpactReporting/src/Generated/Internal/Utf8JsonRequestContent.cs b/sdk/impactreporting/Azure.ResourceManager.ImpactReporting/src/Generated/Internal/Utf8JsonRequestContent.cs new file mode 100644 index 000000000000..2838ccf740d2 --- /dev/null +++ b/sdk/impactreporting/Azure.ResourceManager.ImpactReporting/src/Generated/Internal/Utf8JsonRequestContent.cs @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.IO; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; + +namespace Azure.ResourceManager.ImpactReporting +{ + internal class Utf8JsonRequestContent : RequestContent + { + private readonly MemoryStream _stream; + private readonly RequestContent _content; + + public Utf8JsonRequestContent() + { + _stream = new MemoryStream(); + _content = Create(_stream); + JsonWriter = new Utf8JsonWriter(_stream); + } + + public Utf8JsonWriter JsonWriter { get; } + + public override async Task WriteToAsync(Stream stream, CancellationToken cancellationToken = default) + { + await JsonWriter.FlushAsync().ConfigureAwait(false); + await _content.WriteToAsync(stream, cancellationToken).ConfigureAwait(false); + } + + public override void WriteTo(Stream stream, CancellationToken cancellationToken = default) + { + JsonWriter.Flush(); + _content.WriteTo(stream, cancellationToken); + } + + public override bool TryComputeLength(out long length) + { + length = JsonWriter.BytesCommitted + JsonWriter.BytesPending; + return true; + } + + public override void Dispose() + { + JsonWriter.Dispose(); + _content.Dispose(); + _stream.Dispose(); + } + } +} diff --git a/sdk/impactreporting/Azure.ResourceManager.ImpactReporting/src/Generated/LongRunningOperation/ConnectorOperationSource.cs b/sdk/impactreporting/Azure.ResourceManager.ImpactReporting/src/Generated/LongRunningOperation/ConnectorOperationSource.cs new file mode 100644 index 000000000000..6da898e4b588 --- /dev/null +++ b/sdk/impactreporting/Azure.ResourceManager.ImpactReporting/src/Generated/LongRunningOperation/ConnectorOperationSource.cs @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; + +namespace Azure.ResourceManager.ImpactReporting +{ + internal class ConnectorOperationSource : IOperationSource + { + private readonly ArmClient _client; + + internal ConnectorOperationSource(ArmClient client) + { + _client = client; + } + + ConnectorResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) + { + using var document = JsonDocument.Parse(response.ContentStream); + var data = ConnectorData.DeserializeConnectorData(document.RootElement); + return new ConnectorResource(_client, data); + } + + async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) + { + using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false); + var data = ConnectorData.DeserializeConnectorData(document.RootElement); + return new ConnectorResource(_client, data); + } + } +} diff --git a/sdk/impactreporting/Azure.ResourceManager.ImpactReporting/src/Generated/LongRunningOperation/ImpactReportingArmOperation.cs b/sdk/impactreporting/Azure.ResourceManager.ImpactReporting/src/Generated/LongRunningOperation/ImpactReportingArmOperation.cs new file mode 100644 index 000000000000..a7933fad4913 --- /dev/null +++ b/sdk/impactreporting/Azure.ResourceManager.ImpactReporting/src/Generated/LongRunningOperation/ImpactReportingArmOperation.cs @@ -0,0 +1,94 @@ +// 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.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.ImpactReporting +{ +#pragma warning disable SA1649 // File name should match first type name + internal class ImpactReportingArmOperation : ArmOperation +#pragma warning restore SA1649 // File name should match first type name + { + private readonly OperationInternal _operation; + private readonly RehydrationToken? _completeRehydrationToken; + private readonly NextLinkOperationImplementation _nextLinkOperation; + private readonly string _operationId; + + /// Initializes a new instance of ImpactReportingArmOperation for mocking. + protected ImpactReportingArmOperation() + { + } + + internal ImpactReportingArmOperation(Response response, RehydrationToken? rehydrationToken = null) + { + _operation = OperationInternal.Succeeded(response); + _completeRehydrationToken = rehydrationToken; + _operationId = GetOperationId(rehydrationToken); + } + + internal ImpactReportingArmOperation(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, Request request, Response response, OperationFinalStateVia finalStateVia, bool skipApiVersionOverride = false, string apiVersionOverrideValue = null) + { + var nextLinkOperation = NextLinkOperationImplementation.Create(pipeline, request.Method, request.Uri.ToUri(), response, finalStateVia, skipApiVersionOverride, apiVersionOverrideValue); + if (nextLinkOperation is NextLinkOperationImplementation nextLinkOperationValue) + { + _nextLinkOperation = nextLinkOperationValue; + _operationId = _nextLinkOperation.OperationId; + } + else + { + _completeRehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(request.Method, request.Uri.ToUri(), response, finalStateVia); + _operationId = GetOperationId(_completeRehydrationToken); + } + _operation = new OperationInternal(nextLinkOperation, clientDiagnostics, response, "ImpactReportingArmOperation", fallbackStrategy: new SequentialDelayStrategy()); + } + + private string GetOperationId(RehydrationToken? rehydrationToken) + { + if (rehydrationToken is null) + { + return null; + } + var lroDetails = ModelReaderWriter.Write(rehydrationToken, ModelReaderWriterOptions.Json).ToObjectFromJson>(); + return lroDetails["id"]; + } + /// + public override string Id => _operationId ?? NextLinkOperationImplementation.NotSet; + + /// + public override RehydrationToken? GetRehydrationToken() => _nextLinkOperation?.GetRehydrationToken() ?? _completeRehydrationToken; + + /// + public override bool HasCompleted => _operation.HasCompleted; + + /// + public override Response GetRawResponse() => _operation.RawResponse; + + /// + public override Response UpdateStatus(CancellationToken cancellationToken = default) => _operation.UpdateStatus(cancellationToken); + + /// + public override ValueTask UpdateStatusAsync(CancellationToken cancellationToken = default) => _operation.UpdateStatusAsync(cancellationToken); + + /// + public override Response WaitForCompletionResponse(CancellationToken cancellationToken = default) => _operation.WaitForCompletionResponse(cancellationToken); + + /// + public override Response WaitForCompletionResponse(TimeSpan pollingInterval, CancellationToken cancellationToken = default) => _operation.WaitForCompletionResponse(pollingInterval, cancellationToken); + + /// + public override ValueTask WaitForCompletionResponseAsync(CancellationToken cancellationToken = default) => _operation.WaitForCompletionResponseAsync(cancellationToken); + + /// + public override ValueTask WaitForCompletionResponseAsync(TimeSpan pollingInterval, CancellationToken cancellationToken = default) => _operation.WaitForCompletionResponseAsync(pollingInterval, cancellationToken); + } +} diff --git a/sdk/impactreporting/Azure.ResourceManager.ImpactReporting/src/Generated/LongRunningOperation/ImpactReportingArmOperationOfT.cs b/sdk/impactreporting/Azure.ResourceManager.ImpactReporting/src/Generated/LongRunningOperation/ImpactReportingArmOperationOfT.cs new file mode 100644 index 000000000000..d8cff351e27f --- /dev/null +++ b/sdk/impactreporting/Azure.ResourceManager.ImpactReporting/src/Generated/LongRunningOperation/ImpactReportingArmOperationOfT.cs @@ -0,0 +1,100 @@ +// 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.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.ImpactReporting +{ +#pragma warning disable SA1649 // File name should match first type name + internal class ImpactReportingArmOperation : ArmOperation +#pragma warning restore SA1649 // File name should match first type name + { + private readonly OperationInternal _operation; + private readonly RehydrationToken? _completeRehydrationToken; + private readonly NextLinkOperationImplementation _nextLinkOperation; + private readonly string _operationId; + + /// Initializes a new instance of ImpactReportingArmOperation for mocking. + protected ImpactReportingArmOperation() + { + } + + internal ImpactReportingArmOperation(Response response, RehydrationToken? rehydrationToken = null) + { + _operation = OperationInternal.Succeeded(response.GetRawResponse(), response.Value); + _completeRehydrationToken = rehydrationToken; + _operationId = GetOperationId(rehydrationToken); + } + + internal ImpactReportingArmOperation(IOperationSource source, ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, Request request, Response response, OperationFinalStateVia finalStateVia, bool skipApiVersionOverride = false, string apiVersionOverrideValue = null) + { + var nextLinkOperation = NextLinkOperationImplementation.Create(pipeline, request.Method, request.Uri.ToUri(), response, finalStateVia, skipApiVersionOverride, apiVersionOverrideValue); + if (nextLinkOperation is NextLinkOperationImplementation nextLinkOperationValue) + { + _nextLinkOperation = nextLinkOperationValue; + _operationId = _nextLinkOperation.OperationId; + } + else + { + _completeRehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(request.Method, request.Uri.ToUri(), response, finalStateVia); + _operationId = GetOperationId(_completeRehydrationToken); + } + _operation = new OperationInternal(NextLinkOperationImplementation.Create(source, nextLinkOperation), clientDiagnostics, response, "ImpactReportingArmOperation", fallbackStrategy: new SequentialDelayStrategy()); + } + + private string GetOperationId(RehydrationToken? rehydrationToken) + { + if (rehydrationToken is null) + { + return null; + } + var lroDetails = ModelReaderWriter.Write(rehydrationToken, ModelReaderWriterOptions.Json).ToObjectFromJson>(); + return lroDetails["id"]; + } + /// + public override string Id => _operationId ?? NextLinkOperationImplementation.NotSet; + + /// + public override RehydrationToken? GetRehydrationToken() => _nextLinkOperation?.GetRehydrationToken() ?? _completeRehydrationToken; + + /// + public override T Value => _operation.Value; + + /// + public override bool HasValue => _operation.HasValue; + + /// + public override bool HasCompleted => _operation.HasCompleted; + + /// + public override Response GetRawResponse() => _operation.RawResponse; + + /// + public override Response UpdateStatus(CancellationToken cancellationToken = default) => _operation.UpdateStatus(cancellationToken); + + /// + public override ValueTask UpdateStatusAsync(CancellationToken cancellationToken = default) => _operation.UpdateStatusAsync(cancellationToken); + + /// + public override Response WaitForCompletion(CancellationToken cancellationToken = default) => _operation.WaitForCompletion(cancellationToken); + + /// + public override Response WaitForCompletion(TimeSpan pollingInterval, CancellationToken cancellationToken = default) => _operation.WaitForCompletion(pollingInterval, cancellationToken); + + /// + public override ValueTask> WaitForCompletionAsync(CancellationToken cancellationToken = default) => _operation.WaitForCompletionAsync(cancellationToken); + + /// + public override ValueTask> WaitForCompletionAsync(TimeSpan pollingInterval, CancellationToken cancellationToken = default) => _operation.WaitForCompletionAsync(pollingInterval, cancellationToken); + } +} diff --git a/sdk/impactreporting/Azure.ResourceManager.ImpactReporting/src/Generated/LongRunningOperation/WorkloadImpactOperationSource.cs b/sdk/impactreporting/Azure.ResourceManager.ImpactReporting/src/Generated/LongRunningOperation/WorkloadImpactOperationSource.cs new file mode 100644 index 000000000000..69a49d409d0c --- /dev/null +++ b/sdk/impactreporting/Azure.ResourceManager.ImpactReporting/src/Generated/LongRunningOperation/WorkloadImpactOperationSource.cs @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; + +namespace Azure.ResourceManager.ImpactReporting +{ + internal class WorkloadImpactOperationSource : IOperationSource + { + private readonly ArmClient _client; + + internal WorkloadImpactOperationSource(ArmClient client) + { + _client = client; + } + + WorkloadImpactResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) + { + using var document = JsonDocument.Parse(response.ContentStream); + var data = WorkloadImpactData.DeserializeWorkloadImpactData(document.RootElement); + return new WorkloadImpactResource(_client, data); + } + + async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) + { + using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false); + var data = WorkloadImpactData.DeserializeWorkloadImpactData(document.RootElement); + return new WorkloadImpactResource(_client, data); + } + } +} diff --git a/sdk/impactreporting/Azure.ResourceManager.ImpactReporting/src/Generated/Models/ClientIncidentDetails.Serialization.cs b/sdk/impactreporting/Azure.ResourceManager.ImpactReporting/src/Generated/Models/ClientIncidentDetails.Serialization.cs new file mode 100644 index 000000000000..8c173cd99ebe --- /dev/null +++ b/sdk/impactreporting/Azure.ResourceManager.ImpactReporting/src/Generated/Models/ClientIncidentDetails.Serialization.cs @@ -0,0 +1,144 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ImpactReporting.Models +{ + public partial class ClientIncidentDetails : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ClientIncidentDetails)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(ClientIncidentId)) + { + writer.WritePropertyName("clientIncidentId"u8); + writer.WriteStringValue(ClientIncidentId); + } + if (Optional.IsDefined(ClientIncidentSource)) + { + writer.WritePropertyName("clientIncidentSource"u8); + writer.WriteStringValue(ClientIncidentSource.Value.ToString()); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + ClientIncidentDetails 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(ClientIncidentDetails)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeClientIncidentDetails(document.RootElement, options); + } + + internal static ClientIncidentDetails DeserializeClientIncidentDetails(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string clientIncidentId = default; + IncidentSource? clientIncidentSource = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("clientIncidentId"u8)) + { + clientIncidentId = property.Value.GetString(); + continue; + } + if (property.NameEquals("clientIncidentSource"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + clientIncidentSource = new IncidentSource(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ClientIncidentDetails(clientIncidentId, clientIncidentSource, 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(ClientIncidentDetails)} does not support writing '{options.Format}' format."); + } + } + + ClientIncidentDetails IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeClientIncidentDetails(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ClientIncidentDetails)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/impactreporting/Azure.ResourceManager.ImpactReporting/src/Generated/Models/ClientIncidentDetails.cs b/sdk/impactreporting/Azure.ResourceManager.ImpactReporting/src/Generated/Models/ClientIncidentDetails.cs new file mode 100644 index 000000000000..b205106b1f81 --- /dev/null +++ b/sdk/impactreporting/Azure.ResourceManager.ImpactReporting/src/Generated/Models/ClientIncidentDetails.cs @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ImpactReporting.Models +{ + /// Client incident details ex: incidentId , incident source. + public partial class ClientIncidentDetails + { + /// + /// 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 ClientIncidentDetails() + { + } + + /// Initializes a new instance of . + /// Client incident id. ex : id of the incident created to investigate and address the impact if any. + /// Client incident source. ex : source system name where the incident is created. + /// Keeps track of any properties unknown to the library. + internal ClientIncidentDetails(string clientIncidentId, IncidentSource? clientIncidentSource, IDictionary serializedAdditionalRawData) + { + ClientIncidentId = clientIncidentId; + ClientIncidentSource = clientIncidentSource; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Client incident id. ex : id of the incident created to investigate and address the impact if any. + public string ClientIncidentId { get; set; } + /// Client incident source. ex : source system name where the incident is created. + public IncidentSource? ClientIncidentSource { get; set; } + } +} diff --git a/sdk/impactreporting/Azure.ResourceManager.ImpactReporting/src/Generated/Models/ConfidenceLevel.cs b/sdk/impactreporting/Azure.ResourceManager.ImpactReporting/src/Generated/Models/ConfidenceLevel.cs new file mode 100644 index 000000000000..fc05addd46a7 --- /dev/null +++ b/sdk/impactreporting/Azure.ResourceManager.ImpactReporting/src/Generated/Models/ConfidenceLevel.cs @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.ImpactReporting.Models +{ + /// Degree of confidence on the impact being a platform issue. + public readonly partial struct ConfidenceLevel : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public ConfidenceLevel(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string LowValue = "Low"; + private const string MediumValue = "Medium"; + private const string HighValue = "High"; + + /// Low confidence on azure being the source of impact. + public static ConfidenceLevel Low { get; } = new ConfidenceLevel(LowValue); + /// Medium confidence on azure being the source of impact. + public static ConfidenceLevel Medium { get; } = new ConfidenceLevel(MediumValue); + /// High confidence on azure being the source of impact. + public static ConfidenceLevel High { get; } = new ConfidenceLevel(HighValue); + /// Determines if two values are the same. + public static bool operator ==(ConfidenceLevel left, ConfidenceLevel right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(ConfidenceLevel left, ConfidenceLevel right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator ConfidenceLevel(string value) => new ConfidenceLevel(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is ConfidenceLevel other && Equals(other); + /// + public bool Equals(ConfidenceLevel other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/impactreporting/Azure.ResourceManager.ImpactReporting/src/Generated/Models/Connectivity.Serialization.cs b/sdk/impactreporting/Azure.ResourceManager.ImpactReporting/src/Generated/Models/Connectivity.Serialization.cs new file mode 100644 index 000000000000..215c101124d5 --- /dev/null +++ b/sdk/impactreporting/Azure.ResourceManager.ImpactReporting/src/Generated/Models/Connectivity.Serialization.cs @@ -0,0 +1,178 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ImpactReporting.Models +{ + public partial class Connectivity : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(Connectivity)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(Protocol)) + { + writer.WritePropertyName("protocol"u8); + writer.WriteStringValue(Protocol.Value.ToString()); + } + if (Optional.IsDefined(Port)) + { + writer.WritePropertyName("port"u8); + writer.WriteNumberValue(Port.Value); + } + if (Optional.IsDefined(Source)) + { + writer.WritePropertyName("source"u8); + writer.WriteObjectValue(Source, options); + } + if (Optional.IsDefined(Target)) + { + writer.WritePropertyName("target"u8); + writer.WriteObjectValue(Target, options); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + Connectivity 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(Connectivity)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeConnectivity(document.RootElement, options); + } + + internal static Connectivity DeserializeConnectivity(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Protocol? protocol = default; + int? port = default; + SourceOrTarget source = default; + SourceOrTarget target = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("protocol"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + protocol = new Protocol(property.Value.GetString()); + continue; + } + if (property.NameEquals("port"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + port = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("source"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + source = SourceOrTarget.DeserializeSourceOrTarget(property.Value, options); + continue; + } + if (property.NameEquals("target"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + target = SourceOrTarget.DeserializeSourceOrTarget(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new Connectivity(protocol, port, source, target, 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(Connectivity)} does not support writing '{options.Format}' format."); + } + } + + Connectivity IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeConnectivity(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(Connectivity)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/impactreporting/Azure.ResourceManager.ImpactReporting/src/Generated/Models/Connectivity.cs b/sdk/impactreporting/Azure.ResourceManager.ImpactReporting/src/Generated/Models/Connectivity.cs new file mode 100644 index 000000000000..84038e4d0ca0 --- /dev/null +++ b/sdk/impactreporting/Azure.ResourceManager.ImpactReporting/src/Generated/Models/Connectivity.cs @@ -0,0 +1,100 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ImpactReporting.Models +{ + /// Details about connectivity issue. Applicable when root resource causing the issue is not identified. For example, when a VM is impacted due to a network issue, the impacted resource could be VM or the network. In such cases, the connectivity field will have the details about both VM and network. + public partial class Connectivity + { + /// + /// 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 Connectivity() + { + } + + /// Initializes a new instance of . + /// Protocol used for the connection. + /// Port number for the connection. + /// Source from which the connection was attempted. + /// target which connection was attempted. + /// Keeps track of any properties unknown to the library. + internal Connectivity(Protocol? protocol, int? port, SourceOrTarget source, SourceOrTarget target, IDictionary serializedAdditionalRawData) + { + Protocol = protocol; + Port = port; + Source = source; + Target = target; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Protocol used for the connection. + public Protocol? Protocol { get; set; } + /// Port number for the connection. + public int? Port { get; set; } + /// Source from which the connection was attempted. + internal SourceOrTarget Source { get; set; } + /// Azure resource id, example /subscription/{subscription}/resourceGroup/{rg}/Microsoft.compute/virtualMachine/{vmName}. + public string SourceAzureResourceId + { + get => Source is null ? default : Source.AzureResourceId; + set + { + if (Source is null) + Source = new SourceOrTarget(); + Source.AzureResourceId = value; + } + } + + /// target which connection was attempted. + internal SourceOrTarget Target { get; set; } + /// Azure resource id, example /subscription/{subscription}/resourceGroup/{rg}/Microsoft.compute/virtualMachine/{vmName}. + public string TargetAzureResourceId + { + get => Target is null ? default : Target.AzureResourceId; + set + { + if (Target is null) + Target = new SourceOrTarget(); + Target.AzureResourceId = value; + } + } + } +} diff --git a/sdk/impactreporting/Azure.ResourceManager.ImpactReporting/src/Generated/Models/ConnectorListResult.Serialization.cs b/sdk/impactreporting/Azure.ResourceManager.ImpactReporting/src/Generated/Models/ConnectorListResult.Serialization.cs new file mode 100644 index 000000000000..f12b3c308064 --- /dev/null +++ b/sdk/impactreporting/Azure.ResourceManager.ImpactReporting/src/Generated/Models/ConnectorListResult.Serialization.cs @@ -0,0 +1,151 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ImpactReporting.Models +{ + internal partial class ConnectorListResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ConnectorListResult)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var item in Value) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + if (Optional.IsDefined(NextLink)) + { + writer.WritePropertyName("nextLink"u8); + writer.WriteStringValue(NextLink.AbsoluteUri); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + ConnectorListResult 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(ConnectorListResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeConnectorListResult(document.RootElement, options); + } + + internal static ConnectorListResult DeserializeConnectorListResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IReadOnlyList value = default; + Uri nextLink = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ConnectorData.DeserializeConnectorData(item, options)); + } + value = array; + continue; + } + if (property.NameEquals("nextLink"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + nextLink = new Uri(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ConnectorListResult(value, nextLink, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ConnectorListResult)} does not support writing '{options.Format}' format."); + } + } + + ConnectorListResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeConnectorListResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ConnectorListResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/impactreporting/Azure.ResourceManager.ImpactReporting/src/Generated/Models/ConnectorListResult.cs b/sdk/impactreporting/Azure.ResourceManager.ImpactReporting/src/Generated/Models/ConnectorListResult.cs new file mode 100644 index 000000000000..917b75ae474a --- /dev/null +++ b/sdk/impactreporting/Azure.ResourceManager.ImpactReporting/src/Generated/Models/ConnectorListResult.cs @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.ResourceManager.ImpactReporting.Models +{ + /// The response of a Connector list operation. + internal partial class ConnectorListResult + { + /// + /// 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 Connector items on this page. + /// is null. + internal ConnectorListResult(IEnumerable value) + { + Argument.AssertNotNull(value, nameof(value)); + + Value = value.ToList(); + } + + /// Initializes a new instance of . + /// The Connector items on this page. + /// The link to the next page of items. + /// Keeps track of any properties unknown to the library. + internal ConnectorListResult(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) + { + Value = value; + NextLink = nextLink; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal ConnectorListResult() + { + } + + /// The Connector items on this page. + public IReadOnlyList Value { get; } + /// The link to the next page of items. + public Uri NextLink { get; } + } +} diff --git a/sdk/impactreporting/Azure.ResourceManager.ImpactReporting/src/Generated/Models/ConnectorPatch.Serialization.cs b/sdk/impactreporting/Azure.ResourceManager.ImpactReporting/src/Generated/Models/ConnectorPatch.Serialization.cs new file mode 100644 index 000000000000..ab04a90f88cd --- /dev/null +++ b/sdk/impactreporting/Azure.ResourceManager.ImpactReporting/src/Generated/Models/ConnectorPatch.Serialization.cs @@ -0,0 +1,133 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ImpactReporting.Models +{ + public partial class ConnectorPatch : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ConnectorPatch)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(Properties)) + { + writer.WritePropertyName("properties"u8); + writer.WriteObjectValue(Properties, options); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + ConnectorPatch 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(ConnectorPatch)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeConnectorPatch(document.RootElement, options); + } + + internal static ConnectorPatch DeserializeConnectorPatch(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ConnectorUpdateProperties properties = 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 = ConnectorUpdateProperties.DeserializeConnectorUpdateProperties(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ConnectorPatch(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(ConnectorPatch)} does not support writing '{options.Format}' format."); + } + } + + ConnectorPatch IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeConnectorPatch(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ConnectorPatch)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/impactreporting/Azure.ResourceManager.ImpactReporting/src/Generated/Models/ConnectorPatch.cs b/sdk/impactreporting/Azure.ResourceManager.ImpactReporting/src/Generated/Models/ConnectorPatch.cs new file mode 100644 index 000000000000..2a13e3d48424 --- /dev/null +++ b/sdk/impactreporting/Azure.ResourceManager.ImpactReporting/src/Generated/Models/ConnectorPatch.cs @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ImpactReporting.Models +{ + /// The type used for update operations of the Connector. + public partial class ConnectorPatch + { + /// + /// 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 ConnectorPatch() + { + } + + /// Initializes a new instance of . + /// The resource-specific properties for this resource. + /// Keeps track of any properties unknown to the library. + internal ConnectorPatch(ConnectorUpdateProperties properties, IDictionary serializedAdditionalRawData) + { + Properties = properties; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The resource-specific properties for this resource. + internal ConnectorUpdateProperties Properties { get; set; } + /// connector type. + public Platform? ConnectorType + { + get => Properties is null ? default : Properties.ConnectorType; + set + { + if (Properties is null) + Properties = new ConnectorUpdateProperties(); + Properties.ConnectorType = value; + } + } + } +} diff --git a/sdk/impactreporting/Azure.ResourceManager.ImpactReporting/src/Generated/Models/ConnectorProperties.Serialization.cs b/sdk/impactreporting/Azure.ResourceManager.ImpactReporting/src/Generated/Models/ConnectorProperties.Serialization.cs new file mode 100644 index 000000000000..33c122adc526 --- /dev/null +++ b/sdk/impactreporting/Azure.ResourceManager.ImpactReporting/src/Generated/Models/ConnectorProperties.Serialization.cs @@ -0,0 +1,180 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ImpactReporting.Models +{ + public partial class ConnectorProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ConnectorProperties)} does not support writing '{format}' format."); + } + + if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) + { + writer.WritePropertyName("provisioningState"u8); + writer.WriteStringValue(ProvisioningState.Value.ToString()); + } + if (options.Format != "W") + { + writer.WritePropertyName("connectorId"u8); + writer.WriteStringValue(ConnectorId); + } + if (options.Format != "W") + { + writer.WritePropertyName("tenantId"u8); + writer.WriteStringValue(TenantId); + } + writer.WritePropertyName("connectorType"u8); + writer.WriteStringValue(ConnectorType.ToString()); + if (options.Format != "W") + { + writer.WritePropertyName("lastRunTimeStamp"u8); + writer.WriteStringValue(LastRunTimeStamp, "O"); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + ConnectorProperties 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(ConnectorProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeConnectorProperties(document.RootElement, options); + } + + internal static ConnectorProperties DeserializeConnectorProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ProvisioningState? provisioningState = default; + string connectorId = default; + string tenantId = default; + Platform connectorType = default; + DateTimeOffset lastRunTimeStamp = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("provisioningState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + provisioningState = new ProvisioningState(property.Value.GetString()); + continue; + } + if (property.NameEquals("connectorId"u8)) + { + connectorId = property.Value.GetString(); + continue; + } + if (property.NameEquals("tenantId"u8)) + { + tenantId = property.Value.GetString(); + continue; + } + if (property.NameEquals("connectorType"u8)) + { + connectorType = new Platform(property.Value.GetString()); + continue; + } + if (property.NameEquals("lastRunTimeStamp"u8)) + { + lastRunTimeStamp = property.Value.GetDateTimeOffset("O"); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ConnectorProperties( + provisioningState, + connectorId, + tenantId, + connectorType, + lastRunTimeStamp, + 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(ConnectorProperties)} does not support writing '{options.Format}' format."); + } + } + + ConnectorProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeConnectorProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ConnectorProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/impactreporting/Azure.ResourceManager.ImpactReporting/src/Generated/Models/ConnectorProperties.cs b/sdk/impactreporting/Azure.ResourceManager.ImpactReporting/src/Generated/Models/ConnectorProperties.cs new file mode 100644 index 000000000000..669e13c50b6a --- /dev/null +++ b/sdk/impactreporting/Azure.ResourceManager.ImpactReporting/src/Generated/Models/ConnectorProperties.cs @@ -0,0 +1,94 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ImpactReporting.Models +{ + /// Details of the Connector. + public partial class ConnectorProperties + { + /// + /// 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 . + /// unique id of the connector. + /// tenant id of this connector. + /// connector type. + /// last run time stamp of this connector in UTC time zone. + public ConnectorProperties(string connectorId, string tenantId, Platform connectorType, DateTimeOffset lastRunTimeStamp) + { + ConnectorId = connectorId; + TenantId = tenantId; + ConnectorType = connectorType; + LastRunTimeStamp = lastRunTimeStamp; + } + + /// Initializes a new instance of . + /// Resource provisioning state. + /// unique id of the connector. + /// tenant id of this connector. + /// connector type. + /// last run time stamp of this connector in UTC time zone. + /// Keeps track of any properties unknown to the library. + internal ConnectorProperties(ProvisioningState? provisioningState, string connectorId, string tenantId, Platform connectorType, DateTimeOffset lastRunTimeStamp, IDictionary serializedAdditionalRawData) + { + ProvisioningState = provisioningState; + ConnectorId = connectorId; + TenantId = tenantId; + ConnectorType = connectorType; + LastRunTimeStamp = lastRunTimeStamp; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal ConnectorProperties() + { + } + + /// Resource provisioning state. + public ProvisioningState? ProvisioningState { get; } + /// unique id of the connector. + public string ConnectorId { get; } + /// tenant id of this connector. + public string TenantId { get; } + /// connector type. + public Platform ConnectorType { get; set; } + /// last run time stamp of this connector in UTC time zone. + public DateTimeOffset LastRunTimeStamp { get; } + } +} diff --git a/sdk/impactreporting/Azure.ResourceManager.ImpactReporting/src/Generated/Models/ConnectorUpdateProperties.Serialization.cs b/sdk/impactreporting/Azure.ResourceManager.ImpactReporting/src/Generated/Models/ConnectorUpdateProperties.Serialization.cs new file mode 100644 index 000000000000..c07fce958fd7 --- /dev/null +++ b/sdk/impactreporting/Azure.ResourceManager.ImpactReporting/src/Generated/Models/ConnectorUpdateProperties.Serialization.cs @@ -0,0 +1,133 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ImpactReporting.Models +{ + internal partial class ConnectorUpdateProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ConnectorUpdateProperties)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(ConnectorType)) + { + writer.WritePropertyName("connectorType"u8); + writer.WriteStringValue(ConnectorType.Value.ToString()); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + ConnectorUpdateProperties 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(ConnectorUpdateProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeConnectorUpdateProperties(document.RootElement, options); + } + + internal static ConnectorUpdateProperties DeserializeConnectorUpdateProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Platform? connectorType = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("connectorType"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + connectorType = new Platform(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ConnectorUpdateProperties(connectorType, 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(ConnectorUpdateProperties)} does not support writing '{options.Format}' format."); + } + } + + ConnectorUpdateProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeConnectorUpdateProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ConnectorUpdateProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/impactreporting/Azure.ResourceManager.ImpactReporting/src/Generated/Models/ConnectorUpdateProperties.cs b/sdk/impactreporting/Azure.ResourceManager.ImpactReporting/src/Generated/Models/ConnectorUpdateProperties.cs new file mode 100644 index 000000000000..3521d7cb9e48 --- /dev/null +++ b/sdk/impactreporting/Azure.ResourceManager.ImpactReporting/src/Generated/Models/ConnectorUpdateProperties.cs @@ -0,0 +1,65 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ImpactReporting.Models +{ + /// The updatable properties of the Connector. + internal partial class ConnectorUpdateProperties + { + /// + /// 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 ConnectorUpdateProperties() + { + } + + /// Initializes a new instance of . + /// connector type. + /// Keeps track of any properties unknown to the library. + internal ConnectorUpdateProperties(Platform? connectorType, IDictionary serializedAdditionalRawData) + { + ConnectorType = connectorType; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// connector type. + public Platform? ConnectorType { get; set; } + } +} diff --git a/sdk/impactreporting/Azure.ResourceManager.ImpactReporting/src/Generated/Models/Content.Serialization.cs b/sdk/impactreporting/Azure.ResourceManager.ImpactReporting/src/Generated/Models/Content.Serialization.cs new file mode 100644 index 000000000000..842e20eb2605 --- /dev/null +++ b/sdk/impactreporting/Azure.ResourceManager.ImpactReporting/src/Generated/Models/Content.Serialization.cs @@ -0,0 +1,134 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ImpactReporting.Models +{ + public partial class Content : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(Content)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("title"u8); + writer.WriteStringValue(Title); + writer.WritePropertyName("description"u8); + writer.WriteStringValue(Description); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + Content 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(Content)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeContent(document.RootElement, options); + } + + internal static Content DeserializeContent(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string title = default; + string description = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("title"u8)) + { + title = property.Value.GetString(); + continue; + } + if (property.NameEquals("description"u8)) + { + description = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new Content(title, description, 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(Content)} does not support writing '{options.Format}' format."); + } + } + + Content IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeContent(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(Content)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/impactreporting/Azure.ResourceManager.ImpactReporting/src/Generated/Models/Content.cs b/sdk/impactreporting/Azure.ResourceManager.ImpactReporting/src/Generated/Models/Content.cs new file mode 100644 index 000000000000..e04c8545c8f8 --- /dev/null +++ b/sdk/impactreporting/Azure.ResourceManager.ImpactReporting/src/Generated/Models/Content.cs @@ -0,0 +1,82 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ImpactReporting.Models +{ + /// Article details of the insight like title, description etc. + public partial class Content + { + /// + /// 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 . + /// Title of the insight. + /// Description of the insight. + /// or is null. + public Content(string title, string description) + { + Argument.AssertNotNull(title, nameof(title)); + Argument.AssertNotNull(description, nameof(description)); + + Title = title; + Description = description; + } + + /// Initializes a new instance of . + /// Title of the insight. + /// Description of the insight. + /// Keeps track of any properties unknown to the library. + internal Content(string title, string description, IDictionary serializedAdditionalRawData) + { + Title = title; + Description = description; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal Content() + { + } + + /// Title of the insight. + public string Title { get; set; } + /// Description of the insight. + public string Description { get; set; } + } +} diff --git a/sdk/impactreporting/Azure.ResourceManager.ImpactReporting/src/Generated/Models/ErrorDetailProperties.Serialization.cs b/sdk/impactreporting/Azure.ResourceManager.ImpactReporting/src/Generated/Models/ErrorDetailProperties.Serialization.cs new file mode 100644 index 000000000000..04719b5c05b8 --- /dev/null +++ b/sdk/impactreporting/Azure.ResourceManager.ImpactReporting/src/Generated/Models/ErrorDetailProperties.Serialization.cs @@ -0,0 +1,140 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ImpactReporting.Models +{ + public partial class ErrorDetailProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ErrorDetailProperties)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(ErrorCode)) + { + writer.WritePropertyName("errorCode"u8); + writer.WriteStringValue(ErrorCode); + } + if (Optional.IsDefined(ErrorMessage)) + { + writer.WritePropertyName("errorMessage"u8); + writer.WriteStringValue(ErrorMessage); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + ErrorDetailProperties 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(ErrorDetailProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeErrorDetailProperties(document.RootElement, options); + } + + internal static ErrorDetailProperties DeserializeErrorDetailProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string errorCode = default; + string errorMessage = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("errorCode"u8)) + { + errorCode = property.Value.GetString(); + continue; + } + if (property.NameEquals("errorMessage"u8)) + { + errorMessage = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ErrorDetailProperties(errorCode, errorMessage, 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(ErrorDetailProperties)} does not support writing '{options.Format}' format."); + } + } + + ErrorDetailProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeErrorDetailProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ErrorDetailProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/impactreporting/Azure.ResourceManager.ImpactReporting/src/Generated/Models/ErrorDetailProperties.cs b/sdk/impactreporting/Azure.ResourceManager.ImpactReporting/src/Generated/Models/ErrorDetailProperties.cs new file mode 100644 index 000000000000..f6568d77a03e --- /dev/null +++ b/sdk/impactreporting/Azure.ResourceManager.ImpactReporting/src/Generated/Models/ErrorDetailProperties.cs @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ImpactReporting.Models +{ + /// ARM error code and error message associated with the impact. + public partial class ErrorDetailProperties + { + /// + /// 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 ErrorDetailProperties() + { + } + + /// Initializes a new instance of . + /// ARM Error code associated with the impact. + /// ARM Error Message associated with the impact. + /// Keeps track of any properties unknown to the library. + internal ErrorDetailProperties(string errorCode, string errorMessage, IDictionary serializedAdditionalRawData) + { + ErrorCode = errorCode; + ErrorMessage = errorMessage; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// ARM Error code associated with the impact. + public string ErrorCode { get; set; } + /// ARM Error Message associated with the impact. + public string ErrorMessage { get; set; } + } +} diff --git a/sdk/impactreporting/Azure.ResourceManager.ImpactReporting/src/Generated/Models/ExpectedValueRange.Serialization.cs b/sdk/impactreporting/Azure.ResourceManager.ImpactReporting/src/Generated/Models/ExpectedValueRange.Serialization.cs new file mode 100644 index 000000000000..b52a0c941621 --- /dev/null +++ b/sdk/impactreporting/Azure.ResourceManager.ImpactReporting/src/Generated/Models/ExpectedValueRange.Serialization.cs @@ -0,0 +1,134 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ImpactReporting.Models +{ + public partial class ExpectedValueRange : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ExpectedValueRange)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("min"u8); + writer.WriteNumberValue(Min); + writer.WritePropertyName("max"u8); + writer.WriteNumberValue(Max); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + ExpectedValueRange 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(ExpectedValueRange)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeExpectedValueRange(document.RootElement, options); + } + + internal static ExpectedValueRange DeserializeExpectedValueRange(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + double min = default; + double max = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("min"u8)) + { + min = property.Value.GetDouble(); + continue; + } + if (property.NameEquals("max"u8)) + { + max = property.Value.GetDouble(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ExpectedValueRange(min, max, 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(ExpectedValueRange)} does not support writing '{options.Format}' format."); + } + } + + ExpectedValueRange IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeExpectedValueRange(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ExpectedValueRange)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/impactreporting/Azure.ResourceManager.ImpactReporting/src/Generated/Models/ExpectedValueRange.cs b/sdk/impactreporting/Azure.ResourceManager.ImpactReporting/src/Generated/Models/ExpectedValueRange.cs new file mode 100644 index 000000000000..b6de2f1af960 --- /dev/null +++ b/sdk/impactreporting/Azure.ResourceManager.ImpactReporting/src/Generated/Models/ExpectedValueRange.cs @@ -0,0 +1,78 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ImpactReporting.Models +{ + /// Max and Min Threshold values for the metric. + public partial class ExpectedValueRange + { + /// + /// 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 . + /// Min threshold value for the metric. + /// Max threshold value for the metric. + public ExpectedValueRange(double min, double max) + { + Min = min; + Max = max; + } + + /// Initializes a new instance of . + /// Min threshold value for the metric. + /// Max threshold value for the metric. + /// Keeps track of any properties unknown to the library. + internal ExpectedValueRange(double min, double max, IDictionary serializedAdditionalRawData) + { + Min = min; + Max = max; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal ExpectedValueRange() + { + } + + /// Min threshold value for the metric. + public double Min { get; set; } + /// Max threshold value for the metric. + public double Max { get; set; } + } +} diff --git a/sdk/impactreporting/Azure.ResourceManager.ImpactReporting/src/Generated/Models/ImpactCategoryListResult.Serialization.cs b/sdk/impactreporting/Azure.ResourceManager.ImpactReporting/src/Generated/Models/ImpactCategoryListResult.Serialization.cs new file mode 100644 index 000000000000..85ce36e635a8 --- /dev/null +++ b/sdk/impactreporting/Azure.ResourceManager.ImpactReporting/src/Generated/Models/ImpactCategoryListResult.Serialization.cs @@ -0,0 +1,151 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ImpactReporting.Models +{ + internal partial class ImpactCategoryListResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ImpactCategoryListResult)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var item in Value) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + if (Optional.IsDefined(NextLink)) + { + writer.WritePropertyName("nextLink"u8); + writer.WriteStringValue(NextLink.AbsoluteUri); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + ImpactCategoryListResult 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(ImpactCategoryListResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeImpactCategoryListResult(document.RootElement, options); + } + + internal static ImpactCategoryListResult DeserializeImpactCategoryListResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IReadOnlyList value = default; + Uri nextLink = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ImpactCategoryData.DeserializeImpactCategoryData(item, options)); + } + value = array; + continue; + } + if (property.NameEquals("nextLink"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + nextLink = new Uri(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ImpactCategoryListResult(value, nextLink, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ImpactCategoryListResult)} does not support writing '{options.Format}' format."); + } + } + + ImpactCategoryListResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeImpactCategoryListResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ImpactCategoryListResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/impactreporting/Azure.ResourceManager.ImpactReporting/src/Generated/Models/ImpactCategoryListResult.cs b/sdk/impactreporting/Azure.ResourceManager.ImpactReporting/src/Generated/Models/ImpactCategoryListResult.cs new file mode 100644 index 000000000000..ba44039d1f6c --- /dev/null +++ b/sdk/impactreporting/Azure.ResourceManager.ImpactReporting/src/Generated/Models/ImpactCategoryListResult.cs @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.ResourceManager.ImpactReporting.Models +{ + /// The response of a ImpactCategory list operation. + internal partial class ImpactCategoryListResult + { + /// + /// 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 ImpactCategory items on this page. + /// is null. + internal ImpactCategoryListResult(IEnumerable value) + { + Argument.AssertNotNull(value, nameof(value)); + + Value = value.ToList(); + } + + /// Initializes a new instance of . + /// The ImpactCategory items on this page. + /// The link to the next page of items. + /// Keeps track of any properties unknown to the library. + internal ImpactCategoryListResult(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) + { + Value = value; + NextLink = nextLink; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal ImpactCategoryListResult() + { + } + + /// The ImpactCategory items on this page. + public IReadOnlyList Value { get; } + /// The link to the next page of items. + public Uri NextLink { get; } + } +} diff --git a/sdk/impactreporting/Azure.ResourceManager.ImpactReporting/src/Generated/Models/ImpactCategoryProperties.Serialization.cs b/sdk/impactreporting/Azure.ResourceManager.ImpactReporting/src/Generated/Models/ImpactCategoryProperties.Serialization.cs new file mode 100644 index 000000000000..d0768f4ef24a --- /dev/null +++ b/sdk/impactreporting/Azure.ResourceManager.ImpactReporting/src/Generated/Models/ImpactCategoryProperties.Serialization.cs @@ -0,0 +1,194 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ImpactReporting.Models +{ + public partial class ImpactCategoryProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ImpactCategoryProperties)} does not support writing '{format}' format."); + } + + if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) + { + writer.WritePropertyName("provisioningState"u8); + writer.WriteStringValue(ProvisioningState.Value.ToString()); + } + writer.WritePropertyName("categoryId"u8); + writer.WriteStringValue(CategoryId); + if (Optional.IsDefined(ParentCategoryId)) + { + writer.WritePropertyName("parentCategoryId"u8); + writer.WriteStringValue(ParentCategoryId); + } + if (Optional.IsDefined(Description)) + { + writer.WritePropertyName("description"u8); + writer.WriteStringValue(Description); + } + if (Optional.IsCollectionDefined(RequiredImpactProperties)) + { + writer.WritePropertyName("requiredImpactProperties"u8); + writer.WriteStartArray(); + foreach (var item in RequiredImpactProperties) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + ImpactCategoryProperties 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(ImpactCategoryProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeImpactCategoryProperties(document.RootElement, options); + } + + internal static ImpactCategoryProperties DeserializeImpactCategoryProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ProvisioningState? provisioningState = default; + string categoryId = default; + string parentCategoryId = default; + string description = default; + IReadOnlyList requiredImpactProperties = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("provisioningState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + provisioningState = new ProvisioningState(property.Value.GetString()); + continue; + } + if (property.NameEquals("categoryId"u8)) + { + categoryId = property.Value.GetString(); + continue; + } + if (property.NameEquals("parentCategoryId"u8)) + { + parentCategoryId = property.Value.GetString(); + continue; + } + if (property.NameEquals("description"u8)) + { + description = property.Value.GetString(); + continue; + } + if (property.NameEquals("requiredImpactProperties"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(Models.RequiredImpactProperties.DeserializeRequiredImpactProperties(item, options)); + } + requiredImpactProperties = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ImpactCategoryProperties( + provisioningState, + categoryId, + parentCategoryId, + description, + requiredImpactProperties ?? new ChangeTrackingList(), + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ImpactCategoryProperties)} does not support writing '{options.Format}' format."); + } + } + + ImpactCategoryProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeImpactCategoryProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ImpactCategoryProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/impactreporting/Azure.ResourceManager.ImpactReporting/src/Generated/Models/ImpactCategoryProperties.cs b/sdk/impactreporting/Azure.ResourceManager.ImpactReporting/src/Generated/Models/ImpactCategoryProperties.cs new file mode 100644 index 000000000000..af4c8b3aac08 --- /dev/null +++ b/sdk/impactreporting/Azure.ResourceManager.ImpactReporting/src/Generated/Models/ImpactCategoryProperties.cs @@ -0,0 +1,92 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ImpactReporting.Models +{ + /// Impact category properties. + public partial class ImpactCategoryProperties + { + /// + /// 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 . + /// Unique ID of the category. + /// is null. + internal ImpactCategoryProperties(string categoryId) + { + Argument.AssertNotNull(categoryId, nameof(categoryId)); + + CategoryId = categoryId; + RequiredImpactProperties = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// Resource provisioning state. + /// Unique ID of the category. + /// Unique ID of the parent category. + /// Description of the category. + /// The workloadImpact properties which are required when reporting with the impact category. + /// Keeps track of any properties unknown to the library. + internal ImpactCategoryProperties(ProvisioningState? provisioningState, string categoryId, string parentCategoryId, string description, IReadOnlyList requiredImpactProperties, IDictionary serializedAdditionalRawData) + { + ProvisioningState = provisioningState; + CategoryId = categoryId; + ParentCategoryId = parentCategoryId; + Description = description; + RequiredImpactProperties = requiredImpactProperties; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal ImpactCategoryProperties() + { + } + + /// Resource provisioning state. + public ProvisioningState? ProvisioningState { get; } + /// Unique ID of the category. + public string CategoryId { get; } + /// Unique ID of the parent category. + public string ParentCategoryId { get; } + /// Description of the category. + public string Description { get; } + /// The workloadImpact properties which are required when reporting with the impact category. + public IReadOnlyList RequiredImpactProperties { get; } + } +} diff --git a/sdk/impactreporting/Azure.ResourceManager.ImpactReporting/src/Generated/Models/ImpactDetails.Serialization.cs b/sdk/impactreporting/Azure.ResourceManager.ImpactReporting/src/Generated/Models/ImpactDetails.Serialization.cs new file mode 100644 index 000000000000..8ed8e267c7be --- /dev/null +++ b/sdk/impactreporting/Azure.ResourceManager.ImpactReporting/src/Generated/Models/ImpactDetails.Serialization.cs @@ -0,0 +1,157 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ImpactReporting.Models +{ + public partial class ImpactDetails : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ImpactDetails)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("impactedResourceId"u8); + writer.WriteStringValue(ImpactedResourceId); + writer.WritePropertyName("startTime"u8); + writer.WriteStringValue(StartOn, "O"); + if (Optional.IsDefined(EndOn)) + { + writer.WritePropertyName("endTime"u8); + writer.WriteStringValue(EndOn.Value, "O"); + } + writer.WritePropertyName("impactId"u8); + writer.WriteStringValue(ImpactId); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + ImpactDetails 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(ImpactDetails)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeImpactDetails(document.RootElement, options); + } + + internal static ImpactDetails DeserializeImpactDetails(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string impactedResourceId = default; + DateTimeOffset startTime = default; + DateTimeOffset? endTime = default; + string impactId = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("impactedResourceId"u8)) + { + impactedResourceId = property.Value.GetString(); + continue; + } + if (property.NameEquals("startTime"u8)) + { + startTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("endTime"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + endTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("impactId"u8)) + { + impactId = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ImpactDetails(impactedResourceId, startTime, endTime, impactId, 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(ImpactDetails)} does not support writing '{options.Format}' format."); + } + } + + ImpactDetails IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeImpactDetails(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ImpactDetails)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/impactreporting/Azure.ResourceManager.ImpactReporting/src/Generated/Models/ImpactDetails.cs b/sdk/impactreporting/Azure.ResourceManager.ImpactReporting/src/Generated/Models/ImpactDetails.cs new file mode 100644 index 000000000000..9c12f1480dc1 --- /dev/null +++ b/sdk/impactreporting/Azure.ResourceManager.ImpactReporting/src/Generated/Models/ImpactDetails.cs @@ -0,0 +1,92 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ImpactReporting.Models +{ + /// details of of the impact for which insight has been generated. + public partial class ImpactDetails + { + /// + /// 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 . + /// List of impacted Azure resources. + /// Time at which impact was started according to reported impact. + /// Azure Id of the impact. + /// or is null. + public ImpactDetails(string impactedResourceId, DateTimeOffset startOn, string impactId) + { + Argument.AssertNotNull(impactedResourceId, nameof(impactedResourceId)); + Argument.AssertNotNull(impactId, nameof(impactId)); + + ImpactedResourceId = impactedResourceId; + StartOn = startOn; + ImpactId = impactId; + } + + /// Initializes a new instance of . + /// List of impacted Azure resources. + /// Time at which impact was started according to reported impact. + /// Time at which impact was ended according to reported impact. + /// Azure Id of the impact. + /// Keeps track of any properties unknown to the library. + internal ImpactDetails(string impactedResourceId, DateTimeOffset startOn, DateTimeOffset? endOn, string impactId, IDictionary serializedAdditionalRawData) + { + ImpactedResourceId = impactedResourceId; + StartOn = startOn; + EndOn = endOn; + ImpactId = impactId; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal ImpactDetails() + { + } + + /// List of impacted Azure resources. + public string ImpactedResourceId { get; set; } + /// Time at which impact was started according to reported impact. + public DateTimeOffset StartOn { get; set; } + /// Time at which impact was ended according to reported impact. + public DateTimeOffset? EndOn { get; set; } + /// Azure Id of the impact. + public string ImpactId { get; set; } + } +} diff --git a/sdk/impactreporting/Azure.ResourceManager.ImpactReporting/src/Generated/Models/IncidentSource.cs b/sdk/impactreporting/Azure.ResourceManager.ImpactReporting/src/Generated/Models/IncidentSource.cs new file mode 100644 index 000000000000..b1a1a24ecc52 --- /dev/null +++ b/sdk/impactreporting/Azure.ResourceManager.ImpactReporting/src/Generated/Models/IncidentSource.cs @@ -0,0 +1,60 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.ImpactReporting.Models +{ + /// List of incident interfaces. + public readonly partial struct IncidentSource : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public IncidentSource(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string AzureDevopsValue = "AzureDevops"; + private const string ICMValue = "ICM"; + private const string JiraValue = "Jira"; + private const string ServiceNowValue = "ServiceNow"; + private const string OtherValue = "Other"; + + /// When source of Incident is AzureDevops. + public static IncidentSource AzureDevops { get; } = new IncidentSource(AzureDevopsValue); + /// When source of Incident is Microsoft ICM. + public static IncidentSource ICM { get; } = new IncidentSource(ICMValue); + /// When source of Incident is Jira. + public static IncidentSource Jira { get; } = new IncidentSource(JiraValue); + /// When source of Incident is ServiceNow. + public static IncidentSource ServiceNow { get; } = new IncidentSource(ServiceNowValue); + /// When source of Incident is Other. + public static IncidentSource Other { get; } = new IncidentSource(OtherValue); + /// Determines if two values are the same. + public static bool operator ==(IncidentSource left, IncidentSource right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(IncidentSource left, IncidentSource right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator IncidentSource(string value) => new IncidentSource(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is IncidentSource other && Equals(other); + /// + public bool Equals(IncidentSource other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/impactreporting/Azure.ResourceManager.ImpactReporting/src/Generated/Models/InsightListResult.Serialization.cs b/sdk/impactreporting/Azure.ResourceManager.ImpactReporting/src/Generated/Models/InsightListResult.Serialization.cs new file mode 100644 index 000000000000..cdb456ce6098 --- /dev/null +++ b/sdk/impactreporting/Azure.ResourceManager.ImpactReporting/src/Generated/Models/InsightListResult.Serialization.cs @@ -0,0 +1,151 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ImpactReporting.Models +{ + internal partial class InsightListResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(InsightListResult)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var item in Value) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + if (Optional.IsDefined(NextLink)) + { + writer.WritePropertyName("nextLink"u8); + writer.WriteStringValue(NextLink.AbsoluteUri); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + InsightListResult 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(InsightListResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeInsightListResult(document.RootElement, options); + } + + internal static InsightListResult DeserializeInsightListResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IReadOnlyList value = default; + Uri nextLink = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(InsightData.DeserializeInsightData(item, options)); + } + value = array; + continue; + } + if (property.NameEquals("nextLink"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + nextLink = new Uri(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new InsightListResult(value, nextLink, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(InsightListResult)} does not support writing '{options.Format}' format."); + } + } + + InsightListResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeInsightListResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(InsightListResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/impactreporting/Azure.ResourceManager.ImpactReporting/src/Generated/Models/InsightListResult.cs b/sdk/impactreporting/Azure.ResourceManager.ImpactReporting/src/Generated/Models/InsightListResult.cs new file mode 100644 index 000000000000..79f58ae35662 --- /dev/null +++ b/sdk/impactreporting/Azure.ResourceManager.ImpactReporting/src/Generated/Models/InsightListResult.cs @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.ResourceManager.ImpactReporting.Models +{ + /// The response of a Insight list operation. + internal partial class InsightListResult + { + /// + /// 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 Insight items on this page. + /// is null. + internal InsightListResult(IEnumerable value) + { + Argument.AssertNotNull(value, nameof(value)); + + Value = value.ToList(); + } + + /// Initializes a new instance of . + /// The Insight items on this page. + /// The link to the next page of items. + /// Keeps track of any properties unknown to the library. + internal InsightListResult(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) + { + Value = value; + NextLink = nextLink; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal InsightListResult() + { + } + + /// The Insight items on this page. + public IReadOnlyList Value { get; } + /// The link to the next page of items. + public Uri NextLink { get; } + } +} diff --git a/sdk/impactreporting/Azure.ResourceManager.ImpactReporting/src/Generated/Models/InsightProperties.Serialization.cs b/sdk/impactreporting/Azure.ResourceManager.ImpactReporting/src/Generated/Models/InsightProperties.Serialization.cs new file mode 100644 index 000000000000..f82688f4dfdf --- /dev/null +++ b/sdk/impactreporting/Azure.ResourceManager.ImpactReporting/src/Generated/Models/InsightProperties.Serialization.cs @@ -0,0 +1,239 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ImpactReporting.Models +{ + public partial class InsightProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(InsightProperties)} does not support writing '{format}' format."); + } + + if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) + { + writer.WritePropertyName("provisioningState"u8); + writer.WriteStringValue(ProvisioningState.Value.ToString()); + } + writer.WritePropertyName("category"u8); + writer.WriteStringValue(Category); + if (Optional.IsDefined(Status)) + { + writer.WritePropertyName("status"u8); + writer.WriteStringValue(Status); + } + if (Optional.IsDefined(EventId)) + { + writer.WritePropertyName("eventId"u8); + writer.WriteStringValue(EventId); + } + if (Optional.IsDefined(GroupId)) + { + writer.WritePropertyName("groupId"u8); + writer.WriteStringValue(GroupId); + } + writer.WritePropertyName("content"u8); + writer.WriteObjectValue(Content, options); + if (Optional.IsDefined(EventOn)) + { + writer.WritePropertyName("eventTime"u8); + writer.WriteStringValue(EventOn.Value, "O"); + } + writer.WritePropertyName("insightUniqueId"u8); + writer.WriteStringValue(InsightUniqueId); + writer.WritePropertyName("impact"u8); + writer.WriteObjectValue(Impact, options); + if (Optional.IsDefined(AdditionalDetails)) + { + writer.WritePropertyName("additionalDetails"u8); + writer.WriteObjectValue(AdditionalDetails, options); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + InsightProperties 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(InsightProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeInsightProperties(document.RootElement, options); + } + + internal static InsightProperties DeserializeInsightProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ProvisioningState? provisioningState = default; + string category = default; + string status = default; + string eventId = default; + string groupId = default; + Content content = default; + DateTimeOffset? eventTime = default; + string insightUniqueId = default; + ImpactDetails impact = default; + InsightPropertiesAdditionalDetails additionalDetails = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("provisioningState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + provisioningState = new ProvisioningState(property.Value.GetString()); + continue; + } + if (property.NameEquals("category"u8)) + { + category = property.Value.GetString(); + continue; + } + if (property.NameEquals("status"u8)) + { + status = property.Value.GetString(); + continue; + } + if (property.NameEquals("eventId"u8)) + { + eventId = property.Value.GetString(); + continue; + } + if (property.NameEquals("groupId"u8)) + { + groupId = property.Value.GetString(); + continue; + } + if (property.NameEquals("content"u8)) + { + content = Content.DeserializeContent(property.Value, options); + continue; + } + if (property.NameEquals("eventTime"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + eventTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("insightUniqueId"u8)) + { + insightUniqueId = property.Value.GetString(); + continue; + } + if (property.NameEquals("impact"u8)) + { + impact = ImpactDetails.DeserializeImpactDetails(property.Value, options); + continue; + } + if (property.NameEquals("additionalDetails"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + additionalDetails = InsightPropertiesAdditionalDetails.DeserializeInsightPropertiesAdditionalDetails(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new InsightProperties( + provisioningState, + category, + status, + eventId, + groupId, + content, + eventTime, + insightUniqueId, + impact, + additionalDetails, + 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(InsightProperties)} does not support writing '{options.Format}' format."); + } + } + + InsightProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeInsightProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(InsightProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/impactreporting/Azure.ResourceManager.ImpactReporting/src/Generated/Models/InsightProperties.cs b/sdk/impactreporting/Azure.ResourceManager.ImpactReporting/src/Generated/Models/InsightProperties.cs new file mode 100644 index 000000000000..e9b3a2c49686 --- /dev/null +++ b/sdk/impactreporting/Azure.ResourceManager.ImpactReporting/src/Generated/Models/InsightProperties.cs @@ -0,0 +1,120 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ImpactReporting.Models +{ + /// Impact category properties. + public partial class InsightProperties + { + /// + /// 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 . + /// category of the insight. + /// Contains title & description for the insight. + /// unique id of the insight. + /// details of of the impact for which insight has been generated. + /// , , or is null. + public InsightProperties(string category, Content content, string insightUniqueId, ImpactDetails impact) + { + Argument.AssertNotNull(category, nameof(category)); + Argument.AssertNotNull(content, nameof(content)); + Argument.AssertNotNull(insightUniqueId, nameof(insightUniqueId)); + Argument.AssertNotNull(impact, nameof(impact)); + + Category = category; + Content = content; + InsightUniqueId = insightUniqueId; + Impact = impact; + } + + /// Initializes a new instance of . + /// Resource provisioning state. + /// category of the insight. + /// status of the insight. example resolved, repaired, other. + /// Identifier of the event that has been correlated with this insight. This can be used to aggregate insights for the same event. + /// Identifier that can be used to group similar insights. + /// Contains title & description for the insight. + /// Time of the event, which has been correlated the impact. + /// unique id of the insight. + /// details of of the impact for which insight has been generated. + /// additional details of the insight. + /// Keeps track of any properties unknown to the library. + internal InsightProperties(ProvisioningState? provisioningState, string category, string status, string eventId, string groupId, Content content, DateTimeOffset? eventOn, string insightUniqueId, ImpactDetails impact, InsightPropertiesAdditionalDetails additionalDetails, IDictionary serializedAdditionalRawData) + { + ProvisioningState = provisioningState; + Category = category; + Status = status; + EventId = eventId; + GroupId = groupId; + Content = content; + EventOn = eventOn; + InsightUniqueId = insightUniqueId; + Impact = impact; + AdditionalDetails = additionalDetails; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal InsightProperties() + { + } + + /// Resource provisioning state. + public ProvisioningState? ProvisioningState { get; } + /// category of the insight. + public string Category { get; set; } + /// status of the insight. example resolved, repaired, other. + public string Status { get; set; } + /// Identifier of the event that has been correlated with this insight. This can be used to aggregate insights for the same event. + public string EventId { get; set; } + /// Identifier that can be used to group similar insights. + public string GroupId { get; set; } + /// Contains title & description for the insight. + public Content Content { get; set; } + /// Time of the event, which has been correlated the impact. + public DateTimeOffset? EventOn { get; set; } + /// unique id of the insight. + public string InsightUniqueId { get; set; } + /// details of of the impact for which insight has been generated. + public ImpactDetails Impact { get; set; } + /// additional details of the insight. + public InsightPropertiesAdditionalDetails AdditionalDetails { get; set; } + } +} diff --git a/sdk/impactreporting/Azure.ResourceManager.ImpactReporting/src/Generated/Models/InsightPropertiesAdditionalDetails.Serialization.cs b/sdk/impactreporting/Azure.ResourceManager.ImpactReporting/src/Generated/Models/InsightPropertiesAdditionalDetails.Serialization.cs new file mode 100644 index 000000000000..8284690d82b5 --- /dev/null +++ b/sdk/impactreporting/Azure.ResourceManager.ImpactReporting/src/Generated/Models/InsightPropertiesAdditionalDetails.Serialization.cs @@ -0,0 +1,118 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ImpactReporting.Models +{ + public partial class InsightPropertiesAdditionalDetails : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(InsightPropertiesAdditionalDetails)} does not support writing '{format}' format."); + } + + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + InsightPropertiesAdditionalDetails 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(InsightPropertiesAdditionalDetails)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeInsightPropertiesAdditionalDetails(document.RootElement, options); + } + + internal static InsightPropertiesAdditionalDetails DeserializeInsightPropertiesAdditionalDetails(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new InsightPropertiesAdditionalDetails(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(InsightPropertiesAdditionalDetails)} does not support writing '{options.Format}' format."); + } + } + + InsightPropertiesAdditionalDetails IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeInsightPropertiesAdditionalDetails(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(InsightPropertiesAdditionalDetails)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/impactreporting/Azure.ResourceManager.ImpactReporting/src/Generated/Models/InsightPropertiesAdditionalDetails.cs b/sdk/impactreporting/Azure.ResourceManager.ImpactReporting/src/Generated/Models/InsightPropertiesAdditionalDetails.cs new file mode 100644 index 000000000000..9c4878c129cf --- /dev/null +++ b/sdk/impactreporting/Azure.ResourceManager.ImpactReporting/src/Generated/Models/InsightPropertiesAdditionalDetails.cs @@ -0,0 +1,60 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ImpactReporting.Models +{ + /// The InsightPropertiesAdditionalDetails. + public partial class InsightPropertiesAdditionalDetails + { + /// + /// 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 InsightPropertiesAdditionalDetails() + { + } + + /// Initializes a new instance of . + /// Keeps track of any properties unknown to the library. + internal InsightPropertiesAdditionalDetails(IDictionary serializedAdditionalRawData) + { + _serializedAdditionalRawData = serializedAdditionalRawData; + } + } +} diff --git a/sdk/impactreporting/Azure.ResourceManager.ImpactReporting/src/Generated/Models/MetricUnit.cs b/sdk/impactreporting/Azure.ResourceManager.ImpactReporting/src/Generated/Models/MetricUnit.cs new file mode 100644 index 000000000000..0afe0b5c1194 --- /dev/null +++ b/sdk/impactreporting/Azure.ResourceManager.ImpactReporting/src/Generated/Models/MetricUnit.cs @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.ImpactReporting.Models +{ + /// List of unit of the metric. + public readonly partial struct MetricUnit : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public MetricUnit(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string ByteSecondsValue = "ByteSeconds"; + private const string BytesValue = "Bytes"; + private const string BytesPerSecondValue = "BytesPerSecond"; + private const string CoresValue = "Cores"; + private const string CountValue = "Count"; + private const string CountPerSecondValue = "CountPerSecond"; + private const string MilliCoresValue = "MilliCores"; + private const string MilliSecondsValue = "MilliSeconds"; + private const string NanoCoresValue = "NanoCores"; + private const string PercentValue = "Percent"; + private const string SecondsValue = "Seconds"; + private const string OtherValue = "Other"; + + /// When measurement is in ByteSeconds. + public static MetricUnit ByteSeconds { get; } = new MetricUnit(ByteSecondsValue); + /// When measurement is in Bytes. + public static MetricUnit Bytes { get; } = new MetricUnit(BytesValue); + /// When measurement is in BytesPerSecond. + public static MetricUnit BytesPerSecond { get; } = new MetricUnit(BytesPerSecondValue); + /// When measurement is in Cores. + public static MetricUnit Cores { get; } = new MetricUnit(CoresValue); + /// When measurement is in Count. + public static MetricUnit Count { get; } = new MetricUnit(CountValue); + /// When measurement is in CountPerSecond. + public static MetricUnit CountPerSecond { get; } = new MetricUnit(CountPerSecondValue); + /// When measurement is in MilliCores. + public static MetricUnit MilliCores { get; } = new MetricUnit(MilliCoresValue); + /// When measurement is in MilliSeconds. + public static MetricUnit MilliSeconds { get; } = new MetricUnit(MilliSecondsValue); + /// When measurement is in NanoCores. + public static MetricUnit NanoCores { get; } = new MetricUnit(NanoCoresValue); + /// When measurement is in Percent. + public static MetricUnit Percent { get; } = new MetricUnit(PercentValue); + /// When measurement is in Seconds. + public static MetricUnit Seconds { get; } = new MetricUnit(SecondsValue); + /// When measurement is in Other than listed. + public static MetricUnit Other { get; } = new MetricUnit(OtherValue); + /// Determines if two values are the same. + public static bool operator ==(MetricUnit left, MetricUnit right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(MetricUnit left, MetricUnit right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator MetricUnit(string value) => new MetricUnit(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is MetricUnit other && Equals(other); + /// + public bool Equals(MetricUnit other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/impactreporting/Azure.ResourceManager.ImpactReporting/src/Generated/Models/Performance.Serialization.cs b/sdk/impactreporting/Azure.ResourceManager.ImpactReporting/src/Generated/Models/Performance.Serialization.cs new file mode 100644 index 000000000000..082e4a6ddffd --- /dev/null +++ b/sdk/impactreporting/Azure.ResourceManager.ImpactReporting/src/Generated/Models/Performance.Serialization.cs @@ -0,0 +1,195 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ImpactReporting.Models +{ + public partial class Performance : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(Performance)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(MetricName)) + { + writer.WritePropertyName("metricName"u8); + writer.WriteStringValue(MetricName); + } + if (Optional.IsDefined(Expected)) + { + writer.WritePropertyName("expected"u8); + writer.WriteNumberValue(Expected.Value); + } + if (Optional.IsDefined(Actual)) + { + writer.WritePropertyName("actual"u8); + writer.WriteNumberValue(Actual.Value); + } + if (Optional.IsDefined(ExpectedValueRange)) + { + writer.WritePropertyName("expectedValueRange"u8); + writer.WriteObjectValue(ExpectedValueRange, options); + } + if (Optional.IsDefined(Unit)) + { + writer.WritePropertyName("unit"u8); + writer.WriteStringValue(Unit.Value.ToString()); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + Performance 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(Performance)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializePerformance(document.RootElement, options); + } + + internal static Performance DeserializePerformance(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string metricName = default; + double? expected = default; + double? actual = default; + ExpectedValueRange expectedValueRange = default; + MetricUnit? unit = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("metricName"u8)) + { + metricName = property.Value.GetString(); + continue; + } + if (property.NameEquals("expected"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + expected = property.Value.GetDouble(); + continue; + } + if (property.NameEquals("actual"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + actual = property.Value.GetDouble(); + continue; + } + if (property.NameEquals("expectedValueRange"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + expectedValueRange = ExpectedValueRange.DeserializeExpectedValueRange(property.Value, options); + continue; + } + if (property.NameEquals("unit"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + unit = new MetricUnit(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new Performance( + metricName, + expected, + actual, + expectedValueRange, + unit, + 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(Performance)} does not support writing '{options.Format}' format."); + } + } + + Performance IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializePerformance(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(Performance)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/impactreporting/Azure.ResourceManager.ImpactReporting/src/Generated/Models/Performance.cs b/sdk/impactreporting/Azure.ResourceManager.ImpactReporting/src/Generated/Models/Performance.cs new file mode 100644 index 000000000000..52de89fe19b3 --- /dev/null +++ b/sdk/impactreporting/Azure.ResourceManager.ImpactReporting/src/Generated/Models/Performance.cs @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ImpactReporting.Models +{ + /// Details about impacted performance metrics. Applicable for performance related impact. + public partial class Performance + { + /// + /// 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 Performance() + { + } + + /// Initializes a new instance of . + /// Name of the Metric examples: Disk, IOPs, CPU, GPU, Memory, details can be found from /impactCategories API. + /// Threshold value for the metric. + /// Observed value for the metric. + /// Max and Min Threshold values for the metric. + /// Unit of the metric ex: Bytes, Percentage, Count, Seconds, Milliseconds, Bytes/Second, Count/Second, etc.., Other. + /// Keeps track of any properties unknown to the library. + internal Performance(string metricName, double? expected, double? actual, ExpectedValueRange expectedValueRange, MetricUnit? unit, IDictionary serializedAdditionalRawData) + { + MetricName = metricName; + Expected = expected; + Actual = actual; + ExpectedValueRange = expectedValueRange; + Unit = unit; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Name of the Metric examples: Disk, IOPs, CPU, GPU, Memory, details can be found from /impactCategories API. + public string MetricName { get; set; } + /// Threshold value for the metric. + public double? Expected { get; set; } + /// Observed value for the metric. + public double? Actual { get; set; } + /// Max and Min Threshold values for the metric. + public ExpectedValueRange ExpectedValueRange { get; set; } + /// Unit of the metric ex: Bytes, Percentage, Count, Seconds, Milliseconds, Bytes/Second, Count/Second, etc.., Other. + public MetricUnit? Unit { get; set; } + } +} diff --git a/sdk/impactreporting/Azure.ResourceManager.ImpactReporting/src/Generated/Models/Platform.cs b/sdk/impactreporting/Azure.ResourceManager.ImpactReporting/src/Generated/Models/Platform.cs new file mode 100644 index 000000000000..978aaaa0e070 --- /dev/null +++ b/sdk/impactreporting/Azure.ResourceManager.ImpactReporting/src/Generated/Models/Platform.cs @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.ImpactReporting.Models +{ + /// Enum for connector types. + public readonly partial struct Platform : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public Platform(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string AzureMonitorValue = "AzureMonitor"; + + /// Type of Azure Monitor. + public static Platform AzureMonitor { get; } = new Platform(AzureMonitorValue); + /// Determines if two values are the same. + public static bool operator ==(Platform left, Platform right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(Platform left, Platform right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator Platform(string value) => new Platform(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is Platform other && Equals(other); + /// + public bool Equals(Platform other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/impactreporting/Azure.ResourceManager.ImpactReporting/src/Generated/Models/Protocol.cs b/sdk/impactreporting/Azure.ResourceManager.ImpactReporting/src/Generated/Models/Protocol.cs new file mode 100644 index 000000000000..dd3557f30bfb --- /dev/null +++ b/sdk/impactreporting/Azure.ResourceManager.ImpactReporting/src/Generated/Models/Protocol.cs @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.ImpactReporting.Models +{ + /// List of protocols. + public readonly partial struct Protocol : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public Protocol(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string TCPValue = "TCP"; + private const string UDPValue = "UDP"; + private const string HTTPValue = "HTTP"; + private const string HTTPSValue = "HTTPS"; + private const string RDPValue = "RDP"; + private const string FTPValue = "FTP"; + private const string SSHValue = "SSH"; + private const string OtherValue = "Other"; + + /// When communication protocol is TCP. + public static Protocol TCP { get; } = new Protocol(TCPValue); + /// When communication protocol is UDP. + public static Protocol UDP { get; } = new Protocol(UDPValue); + /// When communication protocol is HTTP. + public static Protocol HTTP { get; } = new Protocol(HTTPValue); + /// When communication protocol is HTTPS. + public static Protocol HTTPS { get; } = new Protocol(HTTPSValue); + /// When communication protocol is RDP. + public static Protocol RDP { get; } = new Protocol(RDPValue); + /// When communication protocol is FTP. + public static Protocol FTP { get; } = new Protocol(FTPValue); + /// When communication protocol is SSH. + public static Protocol SSH { get; } = new Protocol(SSHValue); + /// When communication protocol is Other. + public static Protocol Other { get; } = new Protocol(OtherValue); + /// Determines if two values are the same. + public static bool operator ==(Protocol left, Protocol right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(Protocol left, Protocol right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator Protocol(string value) => new Protocol(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is Protocol other && Equals(other); + /// + public bool Equals(Protocol other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/impactreporting/Azure.ResourceManager.ImpactReporting/src/Generated/Models/ProvisioningState.cs b/sdk/impactreporting/Azure.ResourceManager.ImpactReporting/src/Generated/Models/ProvisioningState.cs new file mode 100644 index 000000000000..7f8995037fb0 --- /dev/null +++ b/sdk/impactreporting/Azure.ResourceManager.ImpactReporting/src/Generated/Models/ProvisioningState.cs @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.ImpactReporting.Models +{ + /// Provisioning state of the resource. + public readonly partial struct ProvisioningState : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public ProvisioningState(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string SucceededValue = "Succeeded"; + private const string FailedValue = "Failed"; + private const string CanceledValue = "Canceled"; + + /// Provisioning Succeeded. + public static ProvisioningState Succeeded { get; } = new ProvisioningState(SucceededValue); + /// Provisioning Failed. + public static ProvisioningState Failed { get; } = new ProvisioningState(FailedValue); + /// Provisioning Canceled. + public static ProvisioningState Canceled { get; } = new ProvisioningState(CanceledValue); + /// Determines if two values are the same. + public static bool operator ==(ProvisioningState left, ProvisioningState right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(ProvisioningState left, ProvisioningState right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator ProvisioningState(string value) => new ProvisioningState(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is ProvisioningState other && Equals(other); + /// + public bool Equals(ProvisioningState other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/impactreporting/Azure.ResourceManager.ImpactReporting/src/Generated/Models/RequiredImpactProperties.Serialization.cs b/sdk/impactreporting/Azure.ResourceManager.ImpactReporting/src/Generated/Models/RequiredImpactProperties.Serialization.cs new file mode 100644 index 000000000000..2a44e8356530 --- /dev/null +++ b/sdk/impactreporting/Azure.ResourceManager.ImpactReporting/src/Generated/Models/RequiredImpactProperties.Serialization.cs @@ -0,0 +1,151 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ImpactReporting.Models +{ + public partial class RequiredImpactProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(RequiredImpactProperties)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name); + if (Optional.IsCollectionDefined(AllowedValues)) + { + writer.WritePropertyName("allowedValues"u8); + writer.WriteStartArray(); + foreach (var item in AllowedValues) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + RequiredImpactProperties 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(RequiredImpactProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeRequiredImpactProperties(document.RootElement, options); + } + + internal static RequiredImpactProperties DeserializeRequiredImpactProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string name = default; + IReadOnlyList allowedValues = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("allowedValues"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + allowedValues = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new RequiredImpactProperties(name, allowedValues ?? new ChangeTrackingList(), serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(RequiredImpactProperties)} does not support writing '{options.Format}' format."); + } + } + + RequiredImpactProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeRequiredImpactProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(RequiredImpactProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/impactreporting/Azure.ResourceManager.ImpactReporting/src/Generated/Models/RequiredImpactProperties.cs b/sdk/impactreporting/Azure.ResourceManager.ImpactReporting/src/Generated/Models/RequiredImpactProperties.cs new file mode 100644 index 000000000000..53ed7245ccf3 --- /dev/null +++ b/sdk/impactreporting/Azure.ResourceManager.ImpactReporting/src/Generated/Models/RequiredImpactProperties.cs @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ImpactReporting.Models +{ + /// Required impact properties. + public partial class RequiredImpactProperties + { + /// + /// 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 . + /// Name of the property. + /// is null. + internal RequiredImpactProperties(string name) + { + Argument.AssertNotNull(name, nameof(name)); + + Name = name; + AllowedValues = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// Name of the property. + /// Allowed values values for the property. + /// Keeps track of any properties unknown to the library. + internal RequiredImpactProperties(string name, IReadOnlyList allowedValues, IDictionary serializedAdditionalRawData) + { + Name = name; + AllowedValues = allowedValues; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal RequiredImpactProperties() + { + } + + /// Name of the property. + public string Name { get; } + /// Allowed values values for the property. + public IReadOnlyList AllowedValues { get; } + } +} diff --git a/sdk/impactreporting/Azure.ResourceManager.ImpactReporting/src/Generated/Models/SourceOrTarget.Serialization.cs b/sdk/impactreporting/Azure.ResourceManager.ImpactReporting/src/Generated/Models/SourceOrTarget.Serialization.cs new file mode 100644 index 000000000000..9aa15d592797 --- /dev/null +++ b/sdk/impactreporting/Azure.ResourceManager.ImpactReporting/src/Generated/Models/SourceOrTarget.Serialization.cs @@ -0,0 +1,129 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ImpactReporting.Models +{ + internal partial class SourceOrTarget : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SourceOrTarget)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(AzureResourceId)) + { + writer.WritePropertyName("azureResourceId"u8); + writer.WriteStringValue(AzureResourceId); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + SourceOrTarget 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(SourceOrTarget)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeSourceOrTarget(document.RootElement, options); + } + + internal static SourceOrTarget DeserializeSourceOrTarget(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string azureResourceId = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("azureResourceId"u8)) + { + azureResourceId = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new SourceOrTarget(azureResourceId, 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(SourceOrTarget)} does not support writing '{options.Format}' format."); + } + } + + SourceOrTarget IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeSourceOrTarget(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(SourceOrTarget)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/impactreporting/Azure.ResourceManager.ImpactReporting/src/Generated/Models/SourceOrTarget.cs b/sdk/impactreporting/Azure.ResourceManager.ImpactReporting/src/Generated/Models/SourceOrTarget.cs new file mode 100644 index 000000000000..f424234d0eee --- /dev/null +++ b/sdk/impactreporting/Azure.ResourceManager.ImpactReporting/src/Generated/Models/SourceOrTarget.cs @@ -0,0 +1,65 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ImpactReporting.Models +{ + /// Resource details. + internal partial class SourceOrTarget + { + /// + /// 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 SourceOrTarget() + { + } + + /// Initializes a new instance of . + /// Azure resource id, example /subscription/{subscription}/resourceGroup/{rg}/Microsoft.compute/virtualMachine/{vmName}. + /// Keeps track of any properties unknown to the library. + internal SourceOrTarget(string azureResourceId, IDictionary serializedAdditionalRawData) + { + AzureResourceId = azureResourceId; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Azure resource id, example /subscription/{subscription}/resourceGroup/{rg}/Microsoft.compute/virtualMachine/{vmName}. + public string AzureResourceId { get; set; } + } +} diff --git a/sdk/impactreporting/Azure.ResourceManager.ImpactReporting/src/Generated/Models/Toolset.cs b/sdk/impactreporting/Azure.ResourceManager.ImpactReporting/src/Generated/Models/Toolset.cs new file mode 100644 index 000000000000..18e2aa31bfd0 --- /dev/null +++ b/sdk/impactreporting/Azure.ResourceManager.ImpactReporting/src/Generated/Models/Toolset.cs @@ -0,0 +1,72 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.ImpactReporting.Models +{ + /// List of azure interfaces. + public readonly partial struct Toolset : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public Toolset(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string TerraformValue = "Terraform"; + private const string PuppetValue = "Puppet"; + private const string ChefValue = "Chef"; + private const string SDKValue = "SDK"; + private const string AnsibleValue = "Ansible"; + private const string ARMValue = "ARM"; + private const string PortalValue = "Portal"; + private const string ShellValue = "Shell"; + private const string OtherValue = "Other"; + + /// If communication toolset is Terraform. + public static Toolset Terraform { get; } = new Toolset(TerraformValue); + /// If communication toolset is Puppet. + public static Toolset Puppet { get; } = new Toolset(PuppetValue); + /// If communication toolset is Chef. + public static Toolset Chef { get; } = new Toolset(ChefValue); + /// If communication toolset is SDK. + public static Toolset SDK { get; } = new Toolset(SDKValue); + /// If communication toolset is Ansible. + public static Toolset Ansible { get; } = new Toolset(AnsibleValue); + /// If communication toolset is ARM. + public static Toolset ARM { get; } = new Toolset(ARMValue); + /// If communication toolset is Portal. + public static Toolset Portal { get; } = new Toolset(PortalValue); + /// If communication toolset is Shell. + public static Toolset Shell { get; } = new Toolset(ShellValue); + /// If communication toolset is Other. + public static Toolset Other { get; } = new Toolset(OtherValue); + /// Determines if two values are the same. + public static bool operator ==(Toolset left, Toolset right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(Toolset left, Toolset right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator Toolset(string value) => new Toolset(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is Toolset other && Equals(other); + /// + public bool Equals(Toolset other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/impactreporting/Azure.ResourceManager.ImpactReporting/src/Generated/Models/Workload.Serialization.cs b/sdk/impactreporting/Azure.ResourceManager.ImpactReporting/src/Generated/Models/Workload.Serialization.cs new file mode 100644 index 000000000000..6adc07789cb1 --- /dev/null +++ b/sdk/impactreporting/Azure.ResourceManager.ImpactReporting/src/Generated/Models/Workload.Serialization.cs @@ -0,0 +1,144 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ImpactReporting.Models +{ + public partial class Workload : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(Workload)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(Context)) + { + writer.WritePropertyName("context"u8); + writer.WriteStringValue(Context); + } + if (Optional.IsDefined(Toolset)) + { + writer.WritePropertyName("toolset"u8); + writer.WriteStringValue(Toolset.Value.ToString()); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + Workload 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(Workload)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeWorkload(document.RootElement, options); + } + + internal static Workload DeserializeWorkload(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string context = default; + Toolset? toolset = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("context"u8)) + { + context = property.Value.GetString(); + continue; + } + if (property.NameEquals("toolset"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + toolset = new Toolset(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new Workload(context, toolset, 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(Workload)} does not support writing '{options.Format}' format."); + } + } + + Workload IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeWorkload(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(Workload)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/impactreporting/Azure.ResourceManager.ImpactReporting/src/Generated/Models/Workload.cs b/sdk/impactreporting/Azure.ResourceManager.ImpactReporting/src/Generated/Models/Workload.cs new file mode 100644 index 000000000000..ca0edd5f8cdb --- /dev/null +++ b/sdk/impactreporting/Azure.ResourceManager.ImpactReporting/src/Generated/Models/Workload.cs @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ImpactReporting.Models +{ + /// Information about the impacted workload. + public partial class Workload + { + /// + /// 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 Workload() + { + } + + /// Initializes a new instance of . + /// the scenario for the workload. + /// Tool used to interact with Azure. SDK, AzPortal, etc.., Other. + /// Keeps track of any properties unknown to the library. + internal Workload(string context, Toolset? toolset, IDictionary serializedAdditionalRawData) + { + Context = context; + Toolset = toolset; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// the scenario for the workload. + public string Context { get; set; } + /// Tool used to interact with Azure. SDK, AzPortal, etc.., Other. + public Toolset? Toolset { get; set; } + } +} diff --git a/sdk/impactreporting/Azure.ResourceManager.ImpactReporting/src/Generated/Models/WorkloadImpactListResult.Serialization.cs b/sdk/impactreporting/Azure.ResourceManager.ImpactReporting/src/Generated/Models/WorkloadImpactListResult.Serialization.cs new file mode 100644 index 000000000000..c1edd070e188 --- /dev/null +++ b/sdk/impactreporting/Azure.ResourceManager.ImpactReporting/src/Generated/Models/WorkloadImpactListResult.Serialization.cs @@ -0,0 +1,151 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ImpactReporting.Models +{ + internal partial class WorkloadImpactListResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(WorkloadImpactListResult)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var item in Value) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + if (Optional.IsDefined(NextLink)) + { + writer.WritePropertyName("nextLink"u8); + writer.WriteStringValue(NextLink.AbsoluteUri); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + WorkloadImpactListResult 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(WorkloadImpactListResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeWorkloadImpactListResult(document.RootElement, options); + } + + internal static WorkloadImpactListResult DeserializeWorkloadImpactListResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IReadOnlyList value = default; + Uri nextLink = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(WorkloadImpactData.DeserializeWorkloadImpactData(item, options)); + } + value = array; + continue; + } + if (property.NameEquals("nextLink"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + nextLink = new Uri(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new WorkloadImpactListResult(value, nextLink, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(WorkloadImpactListResult)} does not support writing '{options.Format}' format."); + } + } + + WorkloadImpactListResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeWorkloadImpactListResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(WorkloadImpactListResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/impactreporting/Azure.ResourceManager.ImpactReporting/src/Generated/Models/WorkloadImpactListResult.cs b/sdk/impactreporting/Azure.ResourceManager.ImpactReporting/src/Generated/Models/WorkloadImpactListResult.cs new file mode 100644 index 000000000000..91a0bf749286 --- /dev/null +++ b/sdk/impactreporting/Azure.ResourceManager.ImpactReporting/src/Generated/Models/WorkloadImpactListResult.cs @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.ResourceManager.ImpactReporting.Models +{ + /// The response of a WorkloadImpact list operation. + internal partial class WorkloadImpactListResult + { + /// + /// 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 WorkloadImpact items on this page. + /// is null. + internal WorkloadImpactListResult(IEnumerable value) + { + Argument.AssertNotNull(value, nameof(value)); + + Value = value.ToList(); + } + + /// Initializes a new instance of . + /// The WorkloadImpact items on this page. + /// The link to the next page of items. + /// Keeps track of any properties unknown to the library. + internal WorkloadImpactListResult(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) + { + Value = value; + NextLink = nextLink; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal WorkloadImpactListResult() + { + } + + /// The WorkloadImpact items on this page. + public IReadOnlyList Value { get; } + /// The link to the next page of items. + public Uri NextLink { get; } + } +} diff --git a/sdk/impactreporting/Azure.ResourceManager.ImpactReporting/src/Generated/Models/WorkloadImpactProperties.Serialization.cs b/sdk/impactreporting/Azure.ResourceManager.ImpactReporting/src/Generated/Models/WorkloadImpactProperties.Serialization.cs new file mode 100644 index 000000000000..82b1c5235e8f --- /dev/null +++ b/sdk/impactreporting/Azure.ResourceManager.ImpactReporting/src/Generated/Models/WorkloadImpactProperties.Serialization.cs @@ -0,0 +1,378 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ImpactReporting.Models +{ + public partial class WorkloadImpactProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(WorkloadImpactProperties)} does not support writing '{format}' format."); + } + + if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) + { + writer.WritePropertyName("provisioningState"u8); + writer.WriteStringValue(ProvisioningState.Value.ToString()); + } + writer.WritePropertyName("startDateTime"u8); + writer.WriteStringValue(StartOn, "O"); + if (Optional.IsDefined(EndOn)) + { + writer.WritePropertyName("endDateTime"u8); + writer.WriteStringValue(EndOn.Value, "O"); + } + writer.WritePropertyName("impactedResourceId"u8); + writer.WriteStringValue(ImpactedResourceId); + if (options.Format != "W" && Optional.IsDefined(ImpactUniqueId)) + { + writer.WritePropertyName("impactUniqueId"u8); + writer.WriteStringValue(ImpactUniqueId); + } + if (options.Format != "W" && Optional.IsDefined(ReportedTimeUtc)) + { + writer.WritePropertyName("reportedTimeUtc"u8); + writer.WriteStringValue(ReportedTimeUtc.Value, "O"); + } + writer.WritePropertyName("impactCategory"u8); + writer.WriteStringValue(ImpactCategory); + if (Optional.IsDefined(ImpactDescription)) + { + writer.WritePropertyName("impactDescription"u8); + writer.WriteStringValue(ImpactDescription); + } + if (Optional.IsCollectionDefined(ArmCorrelationIds)) + { + writer.WritePropertyName("armCorrelationIds"u8); + writer.WriteStartArray(); + foreach (var item in ArmCorrelationIds) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(Performance)) + { + writer.WritePropertyName("performance"u8); + writer.WriteStartArray(); + foreach (var item in Performance) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(Connectivity)) + { + writer.WritePropertyName("connectivity"u8); + writer.WriteObjectValue(Connectivity, options); + } + if (Optional.IsDefined(AdditionalProperties)) + { + writer.WritePropertyName("additionalProperties"u8); + writer.WriteObjectValue(AdditionalProperties, options); + } + if (Optional.IsDefined(ErrorDetails)) + { + writer.WritePropertyName("errorDetails"u8); + writer.WriteObjectValue(ErrorDetails, options); + } + if (Optional.IsDefined(Workload)) + { + writer.WritePropertyName("workload"u8); + writer.WriteObjectValue(Workload, options); + } + if (Optional.IsDefined(ImpactGroupId)) + { + writer.WritePropertyName("impactGroupId"u8); + writer.WriteStringValue(ImpactGroupId); + } + if (Optional.IsDefined(ConfidenceLevel)) + { + writer.WritePropertyName("confidenceLevel"u8); + writer.WriteStringValue(ConfidenceLevel.Value.ToString()); + } + if (Optional.IsDefined(ClientIncidentDetails)) + { + writer.WritePropertyName("clientIncidentDetails"u8); + writer.WriteObjectValue(ClientIncidentDetails, options); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + WorkloadImpactProperties 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(WorkloadImpactProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeWorkloadImpactProperties(document.RootElement, options); + } + + internal static WorkloadImpactProperties DeserializeWorkloadImpactProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ProvisioningState? provisioningState = default; + DateTimeOffset startDateTime = default; + DateTimeOffset? endDateTime = default; + string impactedResourceId = default; + string impactUniqueId = default; + DateTimeOffset? reportedTimeUtc = default; + string impactCategory = default; + string impactDescription = default; + IList armCorrelationIds = default; + IList performance = default; + Connectivity connectivity = default; + WorkloadImpactPropertiesAdditionalProperties additionalProperties = default; + ErrorDetailProperties errorDetails = default; + Workload workload = default; + string impactGroupId = default; + ConfidenceLevel? confidenceLevel = default; + ClientIncidentDetails clientIncidentDetails = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("provisioningState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + provisioningState = new ProvisioningState(property.Value.GetString()); + continue; + } + if (property.NameEquals("startDateTime"u8)) + { + startDateTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("endDateTime"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + endDateTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("impactedResourceId"u8)) + { + impactedResourceId = property.Value.GetString(); + continue; + } + if (property.NameEquals("impactUniqueId"u8)) + { + impactUniqueId = property.Value.GetString(); + continue; + } + if (property.NameEquals("reportedTimeUtc"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + reportedTimeUtc = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("impactCategory"u8)) + { + impactCategory = property.Value.GetString(); + continue; + } + if (property.NameEquals("impactDescription"u8)) + { + impactDescription = property.Value.GetString(); + continue; + } + if (property.NameEquals("armCorrelationIds"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + armCorrelationIds = array; + continue; + } + if (property.NameEquals("performance"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(Models.Performance.DeserializePerformance(item, options)); + } + performance = array; + continue; + } + if (property.NameEquals("connectivity"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + connectivity = Connectivity.DeserializeConnectivity(property.Value, options); + continue; + } + if (property.NameEquals("additionalProperties"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + additionalProperties = WorkloadImpactPropertiesAdditionalProperties.DeserializeWorkloadImpactPropertiesAdditionalProperties(property.Value, options); + continue; + } + if (property.NameEquals("errorDetails"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + errorDetails = ErrorDetailProperties.DeserializeErrorDetailProperties(property.Value, options); + continue; + } + if (property.NameEquals("workload"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + workload = Workload.DeserializeWorkload(property.Value, options); + continue; + } + if (property.NameEquals("impactGroupId"u8)) + { + impactGroupId = property.Value.GetString(); + continue; + } + if (property.NameEquals("confidenceLevel"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + confidenceLevel = new ConfidenceLevel(property.Value.GetString()); + continue; + } + if (property.NameEquals("clientIncidentDetails"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + clientIncidentDetails = ClientIncidentDetails.DeserializeClientIncidentDetails(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new WorkloadImpactProperties( + provisioningState, + startDateTime, + endDateTime, + impactedResourceId, + impactUniqueId, + reportedTimeUtc, + impactCategory, + impactDescription, + armCorrelationIds ?? new ChangeTrackingList(), + performance ?? new ChangeTrackingList(), + connectivity, + additionalProperties, + errorDetails, + workload, + impactGroupId, + confidenceLevel, + clientIncidentDetails, + 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(WorkloadImpactProperties)} does not support writing '{options.Format}' format."); + } + } + + WorkloadImpactProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeWorkloadImpactProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(WorkloadImpactProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/impactreporting/Azure.ResourceManager.ImpactReporting/src/Generated/Models/WorkloadImpactProperties.cs b/sdk/impactreporting/Azure.ResourceManager.ImpactReporting/src/Generated/Models/WorkloadImpactProperties.cs new file mode 100644 index 000000000000..b4745430bff7 --- /dev/null +++ b/sdk/impactreporting/Azure.ResourceManager.ImpactReporting/src/Generated/Models/WorkloadImpactProperties.cs @@ -0,0 +1,146 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ImpactReporting.Models +{ + /// Workload impact properties. + public partial class WorkloadImpactProperties + { + /// + /// 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 . + /// Time at which impact was observed. + /// Azure resource id of the impacted resource. + /// Category of the impact, details can found from /impactCategories API. + /// or is null. + public WorkloadImpactProperties(DateTimeOffset startOn, string impactedResourceId, string impactCategory) + { + Argument.AssertNotNull(impactedResourceId, nameof(impactedResourceId)); + Argument.AssertNotNull(impactCategory, nameof(impactCategory)); + + StartOn = startOn; + ImpactedResourceId = impactedResourceId; + ImpactCategory = impactCategory; + ArmCorrelationIds = new ChangeTrackingList(); + Performance = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// Resource provisioning state. + /// Time at which impact was observed. + /// Time at which impact has ended. + /// Azure resource id of the impacted resource. + /// Unique ID of the impact (UUID). + /// Time at which impact is reported. + /// Category of the impact, details can found from /impactCategories API. + /// A detailed description of the impact. + /// The ARM correlation ids, this is important field for control plane related impacts. + /// Details about performance issue. Applicable for performance impacts. + /// Details about connectivity issue. Applicable when root resource causing the issue is not identified. For example, when a VM is impacted due to a network issue, the impacted resource is identified as the VM, but the root cause is the network. In such cases, the connectivity field will have the details about the network issue. + /// Additional fields related to impact, applicable fields per resource type are list under /impactCategories API. + /// ARM error code and error message associated with the impact. + /// Information about the impacted workload. + /// Use this field to group impacts. + /// Degree of confidence on the impact being a platform issue. + /// Client incident details ex: incidentId , incident source. + /// Keeps track of any properties unknown to the library. + internal WorkloadImpactProperties(ProvisioningState? provisioningState, DateTimeOffset startOn, DateTimeOffset? endOn, string impactedResourceId, string impactUniqueId, DateTimeOffset? reportedTimeUtc, string impactCategory, string impactDescription, IList armCorrelationIds, IList performance, Connectivity connectivity, WorkloadImpactPropertiesAdditionalProperties additionalProperties, ErrorDetailProperties errorDetails, Workload workload, string impactGroupId, ConfidenceLevel? confidenceLevel, ClientIncidentDetails clientIncidentDetails, IDictionary serializedAdditionalRawData) + { + ProvisioningState = provisioningState; + StartOn = startOn; + EndOn = endOn; + ImpactedResourceId = impactedResourceId; + ImpactUniqueId = impactUniqueId; + ReportedTimeUtc = reportedTimeUtc; + ImpactCategory = impactCategory; + ImpactDescription = impactDescription; + ArmCorrelationIds = armCorrelationIds; + Performance = performance; + Connectivity = connectivity; + AdditionalProperties = additionalProperties; + ErrorDetails = errorDetails; + Workload = workload; + ImpactGroupId = impactGroupId; + ConfidenceLevel = confidenceLevel; + ClientIncidentDetails = clientIncidentDetails; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal WorkloadImpactProperties() + { + } + + /// Resource provisioning state. + public ProvisioningState? ProvisioningState { get; } + /// Time at which impact was observed. + public DateTimeOffset StartOn { get; set; } + /// Time at which impact has ended. + public DateTimeOffset? EndOn { get; set; } + /// Azure resource id of the impacted resource. + public string ImpactedResourceId { get; set; } + /// Unique ID of the impact (UUID). + public string ImpactUniqueId { get; } + /// Time at which impact is reported. + public DateTimeOffset? ReportedTimeUtc { get; } + /// Category of the impact, details can found from /impactCategories API. + public string ImpactCategory { get; set; } + /// A detailed description of the impact. + public string ImpactDescription { get; set; } + /// The ARM correlation ids, this is important field for control plane related impacts. + public IList ArmCorrelationIds { get; } + /// Details about performance issue. Applicable for performance impacts. + public IList Performance { get; } + /// Details about connectivity issue. Applicable when root resource causing the issue is not identified. For example, when a VM is impacted due to a network issue, the impacted resource is identified as the VM, but the root cause is the network. In such cases, the connectivity field will have the details about the network issue. + public Connectivity Connectivity { get; set; } + /// Additional fields related to impact, applicable fields per resource type are list under /impactCategories API. + public WorkloadImpactPropertiesAdditionalProperties AdditionalProperties { get; set; } + /// ARM error code and error message associated with the impact. + public ErrorDetailProperties ErrorDetails { get; set; } + /// Information about the impacted workload. + public Workload Workload { get; set; } + /// Use this field to group impacts. + public string ImpactGroupId { get; set; } + /// Degree of confidence on the impact being a platform issue. + public ConfidenceLevel? ConfidenceLevel { get; set; } + /// Client incident details ex: incidentId , incident source. + public ClientIncidentDetails ClientIncidentDetails { get; set; } + } +} diff --git a/sdk/impactreporting/Azure.ResourceManager.ImpactReporting/src/Generated/Models/WorkloadImpactPropertiesAdditionalProperties.Serialization.cs b/sdk/impactreporting/Azure.ResourceManager.ImpactReporting/src/Generated/Models/WorkloadImpactPropertiesAdditionalProperties.Serialization.cs new file mode 100644 index 000000000000..9f73b1d92d2d --- /dev/null +++ b/sdk/impactreporting/Azure.ResourceManager.ImpactReporting/src/Generated/Models/WorkloadImpactPropertiesAdditionalProperties.Serialization.cs @@ -0,0 +1,118 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ImpactReporting.Models +{ + public partial class WorkloadImpactPropertiesAdditionalProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(WorkloadImpactPropertiesAdditionalProperties)} does not support writing '{format}' format."); + } + + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + WorkloadImpactPropertiesAdditionalProperties 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(WorkloadImpactPropertiesAdditionalProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeWorkloadImpactPropertiesAdditionalProperties(document.RootElement, options); + } + + internal static WorkloadImpactPropertiesAdditionalProperties DeserializeWorkloadImpactPropertiesAdditionalProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new WorkloadImpactPropertiesAdditionalProperties(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(WorkloadImpactPropertiesAdditionalProperties)} does not support writing '{options.Format}' format."); + } + } + + WorkloadImpactPropertiesAdditionalProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeWorkloadImpactPropertiesAdditionalProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(WorkloadImpactPropertiesAdditionalProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/impactreporting/Azure.ResourceManager.ImpactReporting/src/Generated/Models/WorkloadImpactPropertiesAdditionalProperties.cs b/sdk/impactreporting/Azure.ResourceManager.ImpactReporting/src/Generated/Models/WorkloadImpactPropertiesAdditionalProperties.cs new file mode 100644 index 000000000000..a46fed669515 --- /dev/null +++ b/sdk/impactreporting/Azure.ResourceManager.ImpactReporting/src/Generated/Models/WorkloadImpactPropertiesAdditionalProperties.cs @@ -0,0 +1,60 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ImpactReporting.Models +{ + /// The WorkloadImpactPropertiesAdditionalProperties. + public partial class WorkloadImpactPropertiesAdditionalProperties + { + /// + /// 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 WorkloadImpactPropertiesAdditionalProperties() + { + } + + /// Initializes a new instance of . + /// Keeps track of any properties unknown to the library. + internal WorkloadImpactPropertiesAdditionalProperties(IDictionary serializedAdditionalRawData) + { + _serializedAdditionalRawData = serializedAdditionalRawData; + } + } +} diff --git a/sdk/impactreporting/Azure.ResourceManager.ImpactReporting/src/Generated/ProviderConstants.cs b/sdk/impactreporting/Azure.ResourceManager.ImpactReporting/src/Generated/ProviderConstants.cs new file mode 100644 index 000000000000..71ee32aa17a0 --- /dev/null +++ b/sdk/impactreporting/Azure.ResourceManager.ImpactReporting/src/Generated/ProviderConstants.cs @@ -0,0 +1,16 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.ImpactReporting +{ + internal static class ProviderConstants + { + public static string DefaultProviderNamespace { get; } = ClientDiagnostics.GetResourceProviderNamespace(typeof(ProviderConstants).Assembly); + } +} diff --git a/sdk/impactreporting/Azure.ResourceManager.ImpactReporting/src/Generated/RestOperations/ConnectorsRestOperations.cs b/sdk/impactreporting/Azure.ResourceManager.ImpactReporting/src/Generated/RestOperations/ConnectorsRestOperations.cs new file mode 100644 index 000000000000..a2683b73e1c4 --- /dev/null +++ b/sdk/impactreporting/Azure.ResourceManager.ImpactReporting/src/Generated/RestOperations/ConnectorsRestOperations.cs @@ -0,0 +1,533 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.ImpactReporting.Models; + +namespace Azure.ResourceManager.ImpactReporting +{ + internal partial class ConnectorsRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of ConnectorsRestOperations. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// The application id to use for user agent. + /// Service host. + /// The API version to use for this operation. + /// or is null. + public ConnectorsRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + { + _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); + _endpoint = endpoint ?? new Uri("https://management.azure.com"); + _apiVersion = apiVersion ?? "2024-05-01-preview"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string connectorName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/providers/Microsoft.Impact/connectors/", false); + uri.AppendPath(connectorName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetRequest(string subscriptionId, string connectorName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/providers/Microsoft.Impact/connectors/", false); + uri.AppendPath(connectorName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Get a Connector. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the connector. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + public async Task> GetAsync(string subscriptionId, string connectorName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(connectorName, nameof(connectorName)); + + using var message = CreateGetRequest(subscriptionId, connectorName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + ConnectorData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = ConnectorData.DeserializeConnectorData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((ConnectorData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// Get a Connector. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the connector. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + public Response Get(string subscriptionId, string connectorName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(connectorName, nameof(connectorName)); + + using var message = CreateGetRequest(subscriptionId, connectorName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + ConnectorData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = ConnectorData.DeserializeConnectorData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((ConnectorData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateCreateOrUpdateRequestUri(string subscriptionId, string connectorName, ConnectorData data) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/providers/Microsoft.Impact/connectors/", false); + uri.AppendPath(connectorName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string connectorName, ConnectorData data) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Put; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/providers/Microsoft.Impact/connectors/", false); + uri.AppendPath(connectorName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(data, ModelSerializationExtensions.WireOptions); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Create a Connector. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the connector. + /// Resource create parameters. + /// The cancellation token to use. + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + public async Task CreateOrUpdateAsync(string subscriptionId, string connectorName, ConnectorData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(connectorName, nameof(connectorName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateOrUpdateRequest(subscriptionId, connectorName, data); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 201: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Create a Connector. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the connector. + /// Resource create parameters. + /// The cancellation token to use. + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + public Response CreateOrUpdate(string subscriptionId, string connectorName, ConnectorData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(connectorName, nameof(connectorName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateOrUpdateRequest(subscriptionId, connectorName, data); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 201: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateUpdateRequestUri(string subscriptionId, string connectorName, ConnectorPatch patch) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/providers/Microsoft.Impact/connectors/", false); + uri.AppendPath(connectorName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateUpdateRequest(string subscriptionId, string connectorName, ConnectorPatch patch) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Patch; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/providers/Microsoft.Impact/connectors/", false); + uri.AppendPath(connectorName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(patch, ModelSerializationExtensions.WireOptions); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Update a Connector. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the connector. + /// The resource properties to be updated. + /// The cancellation token to use. + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + public async Task> UpdateAsync(string subscriptionId, string connectorName, ConnectorPatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(connectorName, nameof(connectorName)); + Argument.AssertNotNull(patch, nameof(patch)); + + using var message = CreateUpdateRequest(subscriptionId, connectorName, patch); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + ConnectorData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = ConnectorData.DeserializeConnectorData(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Update a Connector. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the connector. + /// The resource properties to be updated. + /// The cancellation token to use. + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + public Response Update(string subscriptionId, string connectorName, ConnectorPatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(connectorName, nameof(connectorName)); + Argument.AssertNotNull(patch, nameof(patch)); + + using var message = CreateUpdateRequest(subscriptionId, connectorName, patch); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + ConnectorData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = ConnectorData.DeserializeConnectorData(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string connectorName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/providers/Microsoft.Impact/connectors/", false); + uri.AppendPath(connectorName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateDeleteRequest(string subscriptionId, string connectorName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Delete; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/providers/Microsoft.Impact/connectors/", false); + uri.AppendPath(connectorName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Delete a Connector. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the connector. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + public async Task DeleteAsync(string subscriptionId, string connectorName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(connectorName, nameof(connectorName)); + + using var message = CreateDeleteRequest(subscriptionId, connectorName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Delete a Connector. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the connector. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + public Response Delete(string subscriptionId, string connectorName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(connectorName, nameof(connectorName)); + + using var message = CreateDeleteRequest(subscriptionId, connectorName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListBySubscriptionRequestUri(string subscriptionId) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/providers/Microsoft.Impact/connectors", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateListBySubscriptionRequest(string subscriptionId) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/providers/Microsoft.Impact/connectors", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List Connector resources by subscription ID. + /// The ID of the target subscription. The value must be an UUID. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + public async Task> ListBySubscriptionAsync(string subscriptionId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + + using var message = CreateListBySubscriptionRequest(subscriptionId); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + ConnectorListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = ConnectorListResult.DeserializeConnectorListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List Connector resources by subscription ID. + /// The ID of the target subscription. The value must be an UUID. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + public Response ListBySubscription(string subscriptionId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + + using var message = CreateListBySubscriptionRequest(subscriptionId); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + ConnectorListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = ConnectorListResult.DeserializeConnectorListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListBySubscriptionNextPageRequestUri(string nextLink, string subscriptionId) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateListBySubscriptionNextPageRequest(string nextLink, string subscriptionId) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List Connector resources by subscription ID. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + public async Task> ListBySubscriptionNextPageAsync(string nextLink, string subscriptionId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + + using var message = CreateListBySubscriptionNextPageRequest(nextLink, subscriptionId); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + ConnectorListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = ConnectorListResult.DeserializeConnectorListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List Connector resources by subscription ID. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + public Response ListBySubscriptionNextPage(string nextLink, string subscriptionId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + + using var message = CreateListBySubscriptionNextPageRequest(nextLink, subscriptionId); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + ConnectorListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = ConnectorListResult.DeserializeConnectorListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/impactreporting/Azure.ResourceManager.ImpactReporting/src/Generated/RestOperations/ImpactCategoriesRestOperations.cs b/sdk/impactreporting/Azure.ResourceManager.ImpactReporting/src/Generated/RestOperations/ImpactCategoriesRestOperations.cs new file mode 100644 index 000000000000..e62fbbd62503 --- /dev/null +++ b/sdk/impactreporting/Azure.ResourceManager.ImpactReporting/src/Generated/RestOperations/ImpactCategoriesRestOperations.cs @@ -0,0 +1,303 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.ImpactReporting.Models; + +namespace Azure.ResourceManager.ImpactReporting +{ + internal partial class ImpactCategoriesRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of ImpactCategoriesRestOperations. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// The application id to use for user agent. + /// Service host. + /// The API version to use for this operation. + /// or is null. + public ImpactCategoriesRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + { + _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); + _endpoint = endpoint ?? new Uri("https://management.azure.com"); + _apiVersion = apiVersion ?? "2024-05-01-preview"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string impactCategoryName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/providers/Microsoft.Impact/impactCategories/", false); + uri.AppendPath(impactCategoryName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetRequest(string subscriptionId, string impactCategoryName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/providers/Microsoft.Impact/impactCategories/", false); + uri.AppendPath(impactCategoryName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Get a ImpactCategory. + /// The ID of the target subscription. The value must be an UUID. + /// Name of the impact category. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + public async Task> GetAsync(string subscriptionId, string impactCategoryName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(impactCategoryName, nameof(impactCategoryName)); + + using var message = CreateGetRequest(subscriptionId, impactCategoryName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + ImpactCategoryData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = ImpactCategoryData.DeserializeImpactCategoryData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((ImpactCategoryData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// Get a ImpactCategory. + /// The ID of the target subscription. The value must be an UUID. + /// Name of the impact category. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + public Response Get(string subscriptionId, string impactCategoryName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(impactCategoryName, nameof(impactCategoryName)); + + using var message = CreateGetRequest(subscriptionId, impactCategoryName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + ImpactCategoryData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = ImpactCategoryData.DeserializeImpactCategoryData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((ImpactCategoryData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListBySubscriptionRequestUri(string subscriptionId, string resourceType, string categoryName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/providers/Microsoft.Impact/impactCategories", false); + uri.AppendQuery("api-version", _apiVersion, true); + if (categoryName != null) + { + uri.AppendQuery("categoryName", categoryName, true); + } + uri.AppendQuery("resourceType", resourceType, true); + return uri; + } + + internal HttpMessage CreateListBySubscriptionRequest(string subscriptionId, string resourceType, string categoryName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/providers/Microsoft.Impact/impactCategories", false); + uri.AppendQuery("api-version", _apiVersion, true); + if (categoryName != null) + { + uri.AppendQuery("categoryName", categoryName, true); + } + uri.AppendQuery("resourceType", resourceType, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List ImpactCategory resources by subscription. + /// The ID of the target subscription. The value must be an UUID. + /// Filter by resource type. + /// Filter by category name. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + public async Task> ListBySubscriptionAsync(string subscriptionId, string resourceType, string categoryName = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNull(resourceType, nameof(resourceType)); + + using var message = CreateListBySubscriptionRequest(subscriptionId, resourceType, categoryName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + ImpactCategoryListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = ImpactCategoryListResult.DeserializeImpactCategoryListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List ImpactCategory resources by subscription. + /// The ID of the target subscription. The value must be an UUID. + /// Filter by resource type. + /// Filter by category name. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + public Response ListBySubscription(string subscriptionId, string resourceType, string categoryName = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNull(resourceType, nameof(resourceType)); + + using var message = CreateListBySubscriptionRequest(subscriptionId, resourceType, categoryName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + ImpactCategoryListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = ImpactCategoryListResult.DeserializeImpactCategoryListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListBySubscriptionNextPageRequestUri(string nextLink, string subscriptionId, string resourceType, string categoryName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateListBySubscriptionNextPageRequest(string nextLink, string subscriptionId, string resourceType, string categoryName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List ImpactCategory resources by subscription. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// Filter by resource type. + /// Filter by category name. + /// The cancellation token to use. + /// , or is null. + /// is an empty string, and was expected to be non-empty. + public async Task> ListBySubscriptionNextPageAsync(string nextLink, string subscriptionId, string resourceType, string categoryName = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNull(resourceType, nameof(resourceType)); + + using var message = CreateListBySubscriptionNextPageRequest(nextLink, subscriptionId, resourceType, categoryName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + ImpactCategoryListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = ImpactCategoryListResult.DeserializeImpactCategoryListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List ImpactCategory resources by subscription. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// Filter by resource type. + /// Filter by category name. + /// The cancellation token to use. + /// , or is null. + /// is an empty string, and was expected to be non-empty. + public Response ListBySubscriptionNextPage(string nextLink, string subscriptionId, string resourceType, string categoryName = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNull(resourceType, nameof(resourceType)); + + using var message = CreateListBySubscriptionNextPageRequest(nextLink, subscriptionId, resourceType, categoryName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + ImpactCategoryListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = ImpactCategoryListResult.DeserializeImpactCategoryListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/impactreporting/Azure.ResourceManager.ImpactReporting/src/Generated/RestOperations/InsightsRestOperations.cs b/sdk/impactreporting/Azure.ResourceManager.ImpactReporting/src/Generated/RestOperations/InsightsRestOperations.cs new file mode 100644 index 000000000000..00c9f56542d9 --- /dev/null +++ b/sdk/impactreporting/Azure.ResourceManager.ImpactReporting/src/Generated/RestOperations/InsightsRestOperations.cs @@ -0,0 +1,487 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.ImpactReporting.Models; + +namespace Azure.ResourceManager.ImpactReporting +{ + internal partial class InsightsRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of InsightsRestOperations. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// The application id to use for user agent. + /// Service host. + /// The API version to use for this operation. + /// or is null. + public InsightsRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + { + _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); + _endpoint = endpoint ?? new Uri("https://management.azure.com"); + _apiVersion = apiVersion ?? "2024-05-01-preview"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string workloadImpactName, string insightName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/providers/Microsoft.Impact/workloadImpacts/", false); + uri.AppendPath(workloadImpactName, true); + uri.AppendPath("/insights/", false); + uri.AppendPath(insightName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetRequest(string subscriptionId, string workloadImpactName, string insightName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/providers/Microsoft.Impact/workloadImpacts/", false); + uri.AppendPath(workloadImpactName, true); + uri.AppendPath("/insights/", false); + uri.AppendPath(insightName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Get Insight resources by workloadImpactName and insightName. + /// The ID of the target subscription. The value must be an UUID. + /// workloadImpact resource. + /// Name of the insight. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> GetAsync(string subscriptionId, string workloadImpactName, string insightName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(workloadImpactName, nameof(workloadImpactName)); + Argument.AssertNotNullOrEmpty(insightName, nameof(insightName)); + + using var message = CreateGetRequest(subscriptionId, workloadImpactName, insightName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + InsightData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = InsightData.DeserializeInsightData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((InsightData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// Get Insight resources by workloadImpactName and insightName. + /// The ID of the target subscription. The value must be an UUID. + /// workloadImpact resource. + /// Name of the insight. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response Get(string subscriptionId, string workloadImpactName, string insightName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(workloadImpactName, nameof(workloadImpactName)); + Argument.AssertNotNullOrEmpty(insightName, nameof(insightName)); + + using var message = CreateGetRequest(subscriptionId, workloadImpactName, insightName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + InsightData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = InsightData.DeserializeInsightData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((InsightData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListBySubscriptionRequestUri(string subscriptionId, string workloadImpactName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/providers/Microsoft.Impact/workloadImpacts/", false); + uri.AppendPath(workloadImpactName, true); + uri.AppendPath("/insights", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateListBySubscriptionRequest(string subscriptionId, string workloadImpactName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/providers/Microsoft.Impact/workloadImpacts/", false); + uri.AppendPath(workloadImpactName, true); + uri.AppendPath("/insights", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List Insight resources by workloadImpactName. + /// The ID of the target subscription. The value must be an UUID. + /// workloadImpact resource. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + public async Task> ListBySubscriptionAsync(string subscriptionId, string workloadImpactName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(workloadImpactName, nameof(workloadImpactName)); + + using var message = CreateListBySubscriptionRequest(subscriptionId, workloadImpactName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + InsightListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = InsightListResult.DeserializeInsightListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List Insight resources by workloadImpactName. + /// The ID of the target subscription. The value must be an UUID. + /// workloadImpact resource. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + public Response ListBySubscription(string subscriptionId, string workloadImpactName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(workloadImpactName, nameof(workloadImpactName)); + + using var message = CreateListBySubscriptionRequest(subscriptionId, workloadImpactName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + InsightListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = InsightListResult.DeserializeInsightListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateCreateRequestUri(string subscriptionId, string workloadImpactName, string insightName, InsightData data) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/providers/Microsoft.Impact/workloadImpacts/", false); + uri.AppendPath(workloadImpactName, true); + uri.AppendPath("/insights/", false); + uri.AppendPath(insightName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateCreateRequest(string subscriptionId, string workloadImpactName, string insightName, InsightData data) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Put; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/providers/Microsoft.Impact/workloadImpacts/", false); + uri.AppendPath(workloadImpactName, true); + uri.AppendPath("/insights/", false); + uri.AppendPath(insightName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(data, ModelSerializationExtensions.WireOptions); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Create Insight resource, This is Admin only operation. + /// The ID of the target subscription. The value must be an UUID. + /// workloadImpact resource. + /// Name of the insight. + /// Resource create parameters. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> CreateAsync(string subscriptionId, string workloadImpactName, string insightName, InsightData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(workloadImpactName, nameof(workloadImpactName)); + Argument.AssertNotNullOrEmpty(insightName, nameof(insightName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateRequest(subscriptionId, workloadImpactName, insightName, data); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 201: + { + InsightData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = InsightData.DeserializeInsightData(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Create Insight resource, This is Admin only operation. + /// The ID of the target subscription. The value must be an UUID. + /// workloadImpact resource. + /// Name of the insight. + /// Resource create parameters. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response Create(string subscriptionId, string workloadImpactName, string insightName, InsightData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(workloadImpactName, nameof(workloadImpactName)); + Argument.AssertNotNullOrEmpty(insightName, nameof(insightName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateRequest(subscriptionId, workloadImpactName, insightName, data); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 201: + { + InsightData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = InsightData.DeserializeInsightData(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string workloadImpactName, string insightName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/providers/Microsoft.Impact/workloadImpacts/", false); + uri.AppendPath(workloadImpactName, true); + uri.AppendPath("/insights/", false); + uri.AppendPath(insightName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateDeleteRequest(string subscriptionId, string workloadImpactName, string insightName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Delete; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/providers/Microsoft.Impact/workloadImpacts/", false); + uri.AppendPath(workloadImpactName, true); + uri.AppendPath("/insights/", false); + uri.AppendPath(insightName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Delete Insight resource, This is Admin only operation. + /// The ID of the target subscription. The value must be an UUID. + /// workloadImpact resource. + /// Name of the insight. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task DeleteAsync(string subscriptionId, string workloadImpactName, string insightName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(workloadImpactName, nameof(workloadImpactName)); + Argument.AssertNotNullOrEmpty(insightName, nameof(insightName)); + + using var message = CreateDeleteRequest(subscriptionId, workloadImpactName, insightName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Delete Insight resource, This is Admin only operation. + /// The ID of the target subscription. The value must be an UUID. + /// workloadImpact resource. + /// Name of the insight. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response Delete(string subscriptionId, string workloadImpactName, string insightName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(workloadImpactName, nameof(workloadImpactName)); + Argument.AssertNotNullOrEmpty(insightName, nameof(insightName)); + + using var message = CreateDeleteRequest(subscriptionId, workloadImpactName, insightName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListBySubscriptionNextPageRequestUri(string nextLink, string subscriptionId, string workloadImpactName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateListBySubscriptionNextPageRequest(string nextLink, string subscriptionId, string workloadImpactName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List Insight resources by workloadImpactName. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// workloadImpact resource. + /// The cancellation token to use. + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + public async Task> ListBySubscriptionNextPageAsync(string nextLink, string subscriptionId, string workloadImpactName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(workloadImpactName, nameof(workloadImpactName)); + + using var message = CreateListBySubscriptionNextPageRequest(nextLink, subscriptionId, workloadImpactName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + InsightListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = InsightListResult.DeserializeInsightListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List Insight resources by workloadImpactName. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// workloadImpact resource. + /// The cancellation token to use. + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + public Response ListBySubscriptionNextPage(string nextLink, string subscriptionId, string workloadImpactName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(workloadImpactName, nameof(workloadImpactName)); + + using var message = CreateListBySubscriptionNextPageRequest(nextLink, subscriptionId, workloadImpactName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + InsightListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = InsightListResult.DeserializeInsightListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/impactreporting/Azure.ResourceManager.ImpactReporting/src/Generated/RestOperations/WorkloadImpactsRestOperations.cs b/sdk/impactreporting/Azure.ResourceManager.ImpactReporting/src/Generated/RestOperations/WorkloadImpactsRestOperations.cs new file mode 100644 index 000000000000..2f1514c4e867 --- /dev/null +++ b/sdk/impactreporting/Azure.ResourceManager.ImpactReporting/src/Generated/RestOperations/WorkloadImpactsRestOperations.cs @@ -0,0 +1,441 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.ImpactReporting.Models; + +namespace Azure.ResourceManager.ImpactReporting +{ + internal partial class WorkloadImpactsRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of WorkloadImpactsRestOperations. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// The application id to use for user agent. + /// Service host. + /// The API version to use for this operation. + /// or is null. + public WorkloadImpactsRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + { + _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); + _endpoint = endpoint ?? new Uri("https://management.azure.com"); + _apiVersion = apiVersion ?? "2024-05-01-preview"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreateCreateRequestUri(string subscriptionId, string workloadImpactName, WorkloadImpactData data) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/providers/Microsoft.Impact/workloadImpacts/", false); + uri.AppendPath(workloadImpactName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateCreateRequest(string subscriptionId, string workloadImpactName, WorkloadImpactData data) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Put; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/providers/Microsoft.Impact/workloadImpacts/", false); + uri.AppendPath(workloadImpactName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(data, ModelSerializationExtensions.WireOptions); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Create a WorkloadImpact. + /// The ID of the target subscription. The value must be an UUID. + /// workloadImpact resource. + /// Resource create parameters. + /// The cancellation token to use. + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + public async Task CreateAsync(string subscriptionId, string workloadImpactName, WorkloadImpactData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(workloadImpactName, nameof(workloadImpactName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateRequest(subscriptionId, workloadImpactName, data); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 201: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Create a WorkloadImpact. + /// The ID of the target subscription. The value must be an UUID. + /// workloadImpact resource. + /// Resource create parameters. + /// The cancellation token to use. + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + public Response Create(string subscriptionId, string workloadImpactName, WorkloadImpactData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(workloadImpactName, nameof(workloadImpactName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateRequest(subscriptionId, workloadImpactName, data); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 201: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string workloadImpactName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/providers/Microsoft.Impact/workloadImpacts/", false); + uri.AppendPath(workloadImpactName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetRequest(string subscriptionId, string workloadImpactName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/providers/Microsoft.Impact/workloadImpacts/", false); + uri.AppendPath(workloadImpactName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Get a WorkloadImpact. + /// The ID of the target subscription. The value must be an UUID. + /// workloadImpact resource. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + public async Task> GetAsync(string subscriptionId, string workloadImpactName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(workloadImpactName, nameof(workloadImpactName)); + + using var message = CreateGetRequest(subscriptionId, workloadImpactName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + WorkloadImpactData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = WorkloadImpactData.DeserializeWorkloadImpactData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((WorkloadImpactData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// Get a WorkloadImpact. + /// The ID of the target subscription. The value must be an UUID. + /// workloadImpact resource. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + public Response Get(string subscriptionId, string workloadImpactName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(workloadImpactName, nameof(workloadImpactName)); + + using var message = CreateGetRequest(subscriptionId, workloadImpactName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + WorkloadImpactData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = WorkloadImpactData.DeserializeWorkloadImpactData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((WorkloadImpactData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string workloadImpactName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/providers/Microsoft.Impact/workloadImpacts/", false); + uri.AppendPath(workloadImpactName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateDeleteRequest(string subscriptionId, string workloadImpactName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Delete; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/providers/Microsoft.Impact/workloadImpacts/", false); + uri.AppendPath(workloadImpactName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Delete a WorkloadImpact. + /// The ID of the target subscription. The value must be an UUID. + /// workloadImpact resource. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + public async Task DeleteAsync(string subscriptionId, string workloadImpactName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(workloadImpactName, nameof(workloadImpactName)); + + using var message = CreateDeleteRequest(subscriptionId, workloadImpactName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Delete a WorkloadImpact. + /// The ID of the target subscription. The value must be an UUID. + /// workloadImpact resource. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + public Response Delete(string subscriptionId, string workloadImpactName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(workloadImpactName, nameof(workloadImpactName)); + + using var message = CreateDeleteRequest(subscriptionId, workloadImpactName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListBySubscriptionRequestUri(string subscriptionId) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/providers/Microsoft.Impact/workloadImpacts", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateListBySubscriptionRequest(string subscriptionId) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/providers/Microsoft.Impact/workloadImpacts", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List WorkloadImpact resources by subscription ID. + /// The ID of the target subscription. The value must be an UUID. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + public async Task> ListBySubscriptionAsync(string subscriptionId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + + using var message = CreateListBySubscriptionRequest(subscriptionId); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + WorkloadImpactListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = WorkloadImpactListResult.DeserializeWorkloadImpactListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List WorkloadImpact resources by subscription ID. + /// The ID of the target subscription. The value must be an UUID. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + public Response ListBySubscription(string subscriptionId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + + using var message = CreateListBySubscriptionRequest(subscriptionId); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + WorkloadImpactListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = WorkloadImpactListResult.DeserializeWorkloadImpactListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListBySubscriptionNextPageRequestUri(string nextLink, string subscriptionId) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateListBySubscriptionNextPageRequest(string nextLink, string subscriptionId) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List WorkloadImpact resources by subscription ID. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + public async Task> ListBySubscriptionNextPageAsync(string nextLink, string subscriptionId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + + using var message = CreateListBySubscriptionNextPageRequest(nextLink, subscriptionId); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + WorkloadImpactListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = WorkloadImpactListResult.DeserializeWorkloadImpactListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List WorkloadImpact resources by subscription ID. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + public Response ListBySubscriptionNextPage(string nextLink, string subscriptionId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + + using var message = CreateListBySubscriptionNextPageRequest(nextLink, subscriptionId); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + WorkloadImpactListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = WorkloadImpactListResult.DeserializeWorkloadImpactListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/impactreporting/Azure.ResourceManager.ImpactReporting/src/Generated/WorkloadImpactCollection.cs b/sdk/impactreporting/Azure.ResourceManager.ImpactReporting/src/Generated/WorkloadImpactCollection.cs new file mode 100644 index 000000000000..a3990e046fb9 --- /dev/null +++ b/sdk/impactreporting/Azure.ResourceManager.ImpactReporting/src/Generated/WorkloadImpactCollection.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.ImpactReporting +{ + /// + /// 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 GetWorkloadImpacts method from an instance of . + /// + public partial class WorkloadImpactCollection : ArmCollection, IEnumerable, IAsyncEnumerable + { + private readonly ClientDiagnostics _workloadImpactClientDiagnostics; + private readonly WorkloadImpactsRestOperations _workloadImpactRestClient; + + /// Initializes a new instance of the class for mocking. + protected WorkloadImpactCollection() + { + } + + /// 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 WorkloadImpactCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _workloadImpactClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.ImpactReporting", WorkloadImpactResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(WorkloadImpactResource.ResourceType, out string workloadImpactApiVersion); + _workloadImpactRestClient = new WorkloadImpactsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, workloadImpactApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != SubscriptionResource.ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, SubscriptionResource.ResourceType), nameof(id)); + } + + /// + /// Create a WorkloadImpact + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.Impact/workloadImpacts/{workloadImpactName} + /// + /// + /// Operation Id + /// WorkloadImpact_Create + /// + /// + /// Default Api Version + /// 2024-05-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. + /// workloadImpact 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 workloadImpactName, WorkloadImpactData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(workloadImpactName, nameof(workloadImpactName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _workloadImpactClientDiagnostics.CreateScope("WorkloadImpactCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = await _workloadImpactRestClient.CreateAsync(Id.SubscriptionId, workloadImpactName, data, cancellationToken).ConfigureAwait(false); + var operation = new ImpactReportingArmOperation(new WorkloadImpactOperationSource(Client), _workloadImpactClientDiagnostics, Pipeline, _workloadImpactRestClient.CreateCreateRequest(Id.SubscriptionId, workloadImpactName, 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 WorkloadImpact + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.Impact/workloadImpacts/{workloadImpactName} + /// + /// + /// Operation Id + /// WorkloadImpact_Create + /// + /// + /// Default Api Version + /// 2024-05-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. + /// workloadImpact 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 workloadImpactName, WorkloadImpactData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(workloadImpactName, nameof(workloadImpactName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _workloadImpactClientDiagnostics.CreateScope("WorkloadImpactCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = _workloadImpactRestClient.Create(Id.SubscriptionId, workloadImpactName, data, cancellationToken); + var operation = new ImpactReportingArmOperation(new WorkloadImpactOperationSource(Client), _workloadImpactClientDiagnostics, Pipeline, _workloadImpactRestClient.CreateCreateRequest(Id.SubscriptionId, workloadImpactName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a WorkloadImpact + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.Impact/workloadImpacts/{workloadImpactName} + /// + /// + /// Operation Id + /// WorkloadImpact_Get + /// + /// + /// Default Api Version + /// 2024-05-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// workloadImpact 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 workloadImpactName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(workloadImpactName, nameof(workloadImpactName)); + + using var scope = _workloadImpactClientDiagnostics.CreateScope("WorkloadImpactCollection.Get"); + scope.Start(); + try + { + var response = await _workloadImpactRestClient.GetAsync(Id.SubscriptionId, workloadImpactName, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new WorkloadImpactResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a WorkloadImpact + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.Impact/workloadImpacts/{workloadImpactName} + /// + /// + /// Operation Id + /// WorkloadImpact_Get + /// + /// + /// Default Api Version + /// 2024-05-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// workloadImpact resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Get(string workloadImpactName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(workloadImpactName, nameof(workloadImpactName)); + + using var scope = _workloadImpactClientDiagnostics.CreateScope("WorkloadImpactCollection.Get"); + scope.Start(); + try + { + var response = _workloadImpactRestClient.Get(Id.SubscriptionId, workloadImpactName, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new WorkloadImpactResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// List WorkloadImpact resources by subscription ID + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.Impact/workloadImpacts + /// + /// + /// Operation Id + /// WorkloadImpact_ListBySubscription + /// + /// + /// Default Api Version + /// 2024-05-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) => _workloadImpactRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _workloadImpactRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new WorkloadImpactResource(Client, WorkloadImpactData.DeserializeWorkloadImpactData(e)), _workloadImpactClientDiagnostics, Pipeline, "WorkloadImpactCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// List WorkloadImpact resources by subscription ID + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.Impact/workloadImpacts + /// + /// + /// Operation Id + /// WorkloadImpact_ListBySubscription + /// + /// + /// Default Api Version + /// 2024-05-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) => _workloadImpactRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _workloadImpactRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new WorkloadImpactResource(Client, WorkloadImpactData.DeserializeWorkloadImpactData(e)), _workloadImpactClientDiagnostics, Pipeline, "WorkloadImpactCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.Impact/workloadImpacts/{workloadImpactName} + /// + /// + /// Operation Id + /// WorkloadImpact_Get + /// + /// + /// Default Api Version + /// 2024-05-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// workloadImpact 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 workloadImpactName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(workloadImpactName, nameof(workloadImpactName)); + + using var scope = _workloadImpactClientDiagnostics.CreateScope("WorkloadImpactCollection.Exists"); + scope.Start(); + try + { + var response = await _workloadImpactRestClient.GetAsync(Id.SubscriptionId, workloadImpactName, 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}/providers/Microsoft.Impact/workloadImpacts/{workloadImpactName} + /// + /// + /// Operation Id + /// WorkloadImpact_Get + /// + /// + /// Default Api Version + /// 2024-05-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// workloadImpact resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Exists(string workloadImpactName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(workloadImpactName, nameof(workloadImpactName)); + + using var scope = _workloadImpactClientDiagnostics.CreateScope("WorkloadImpactCollection.Exists"); + scope.Start(); + try + { + var response = _workloadImpactRestClient.Get(Id.SubscriptionId, workloadImpactName, 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}/providers/Microsoft.Impact/workloadImpacts/{workloadImpactName} + /// + /// + /// Operation Id + /// WorkloadImpact_Get + /// + /// + /// Default Api Version + /// 2024-05-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// workloadImpact 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 workloadImpactName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(workloadImpactName, nameof(workloadImpactName)); + + using var scope = _workloadImpactClientDiagnostics.CreateScope("WorkloadImpactCollection.GetIfExists"); + scope.Start(); + try + { + var response = await _workloadImpactRestClient.GetAsync(Id.SubscriptionId, workloadImpactName, cancellationToken: cancellationToken).ConfigureAwait(false); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new WorkloadImpactResource(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}/providers/Microsoft.Impact/workloadImpacts/{workloadImpactName} + /// + /// + /// Operation Id + /// WorkloadImpact_Get + /// + /// + /// Default Api Version + /// 2024-05-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// workloadImpact resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual NullableResponse GetIfExists(string workloadImpactName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(workloadImpactName, nameof(workloadImpactName)); + + using var scope = _workloadImpactClientDiagnostics.CreateScope("WorkloadImpactCollection.GetIfExists"); + scope.Start(); + try + { + var response = _workloadImpactRestClient.Get(Id.SubscriptionId, workloadImpactName, cancellationToken: cancellationToken); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new WorkloadImpactResource(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/impactreporting/Azure.ResourceManager.ImpactReporting/src/Generated/WorkloadImpactData.Serialization.cs b/sdk/impactreporting/Azure.ResourceManager.ImpactReporting/src/Generated/WorkloadImpactData.Serialization.cs new file mode 100644 index 000000000000..c8d6cb75b77d --- /dev/null +++ b/sdk/impactreporting/Azure.ResourceManager.ImpactReporting/src/Generated/WorkloadImpactData.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.ImpactReporting.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.ImpactReporting +{ + public partial class WorkloadImpactData : 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(WorkloadImpactData)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (Optional.IsDefined(Properties)) + { + writer.WritePropertyName("properties"u8); + writer.WriteObjectValue(Properties, options); + } + } + + WorkloadImpactData 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(WorkloadImpactData)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeWorkloadImpactData(document.RootElement, options); + } + + internal static WorkloadImpactData DeserializeWorkloadImpactData(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + WorkloadImpactProperties 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 = WorkloadImpactProperties.DeserializeWorkloadImpactProperties(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 WorkloadImpactData( + 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(WorkloadImpactData)} does not support writing '{options.Format}' format."); + } + } + + WorkloadImpactData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeWorkloadImpactData(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(WorkloadImpactData)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/impactreporting/Azure.ResourceManager.ImpactReporting/src/Generated/WorkloadImpactData.cs b/sdk/impactreporting/Azure.ResourceManager.ImpactReporting/src/Generated/WorkloadImpactData.cs new file mode 100644 index 000000000000..88aee464ed2d --- /dev/null +++ b/sdk/impactreporting/Azure.ResourceManager.ImpactReporting/src/Generated/WorkloadImpactData.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.ImpactReporting.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.ImpactReporting +{ + /// + /// A class representing the WorkloadImpact data model. + /// Workload Impact properties + /// + public partial class WorkloadImpactData : 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 WorkloadImpactData() + { + } + + /// 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 WorkloadImpactData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, WorkloadImpactProperties properties, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) + { + Properties = properties; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The resource-specific properties for this resource. + public WorkloadImpactProperties Properties { get; set; } + } +} diff --git a/sdk/impactreporting/Azure.ResourceManager.ImpactReporting/src/Generated/WorkloadImpactResource.Serialization.cs b/sdk/impactreporting/Azure.ResourceManager.ImpactReporting/src/Generated/WorkloadImpactResource.Serialization.cs new file mode 100644 index 000000000000..0fede991d873 --- /dev/null +++ b/sdk/impactreporting/Azure.ResourceManager.ImpactReporting/src/Generated/WorkloadImpactResource.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.ImpactReporting +{ + public partial class WorkloadImpactResource : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); + + WorkloadImpactData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options); + + WorkloadImpactData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options); + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); + } +} diff --git a/sdk/impactreporting/Azure.ResourceManager.ImpactReporting/src/Generated/WorkloadImpactResource.cs b/sdk/impactreporting/Azure.ResourceManager.ImpactReporting/src/Generated/WorkloadImpactResource.cs new file mode 100644 index 000000000000..ed77e2ebe516 --- /dev/null +++ b/sdk/impactreporting/Azure.ResourceManager.ImpactReporting/src/Generated/WorkloadImpactResource.cs @@ -0,0 +1,419 @@ +// 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; +using Azure.ResourceManager.Resources; + +namespace Azure.ResourceManager.ImpactReporting +{ + /// + /// A Class representing a WorkloadImpact 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 GetWorkloadImpactResource method. + /// Otherwise you can get one from its parent resource using the GetWorkloadImpact method. + /// + public partial class WorkloadImpactResource : ArmResource + { + /// Generate the resource identifier of a instance. + /// The subscriptionId. + /// The workloadImpactName. + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string workloadImpactName) + { + var resourceId = $"/subscriptions/{subscriptionId}/providers/Microsoft.Impact/workloadImpacts/{workloadImpactName}"; + return new ResourceIdentifier(resourceId); + } + + private readonly ClientDiagnostics _workloadImpactClientDiagnostics; + private readonly WorkloadImpactsRestOperations _workloadImpactRestClient; + private readonly WorkloadImpactData _data; + + /// Gets the resource type for the operations. + public static readonly ResourceType ResourceType = "Microsoft.Impact/workloadImpacts"; + + /// Initializes a new instance of the class for mocking. + protected WorkloadImpactResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal WorkloadImpactResource(ArmClient client, WorkloadImpactData 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 WorkloadImpactResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _workloadImpactClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.ImpactReporting", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string workloadImpactApiVersion); + _workloadImpactRestClient = new WorkloadImpactsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, workloadImpactApiVersion); +#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 WorkloadImpactData 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)); + } + + /// Gets a collection of InsightResources in the WorkloadImpact. + /// An object representing collection of InsightResources and their operations over a InsightResource. + public virtual InsightCollection GetInsights() + { + return GetCachedClient(client => new InsightCollection(client, Id)); + } + + /// + /// Get Insight resources by workloadImpactName and insightName + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.Impact/workloadImpacts/{workloadImpactName}/insights/{insightName} + /// + /// + /// Operation Id + /// Insight_Get + /// + /// + /// Default Api Version + /// 2024-05-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the insight. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetInsightAsync(string insightName, CancellationToken cancellationToken = default) + { + return await GetInsights().GetAsync(insightName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get Insight resources by workloadImpactName and insightName + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.Impact/workloadImpacts/{workloadImpactName}/insights/{insightName} + /// + /// + /// Operation Id + /// Insight_Get + /// + /// + /// Default Api Version + /// 2024-05-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the insight. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetInsight(string insightName, CancellationToken cancellationToken = default) + { + return GetInsights().Get(insightName, cancellationToken); + } + + /// + /// Get a WorkloadImpact + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.Impact/workloadImpacts/{workloadImpactName} + /// + /// + /// Operation Id + /// WorkloadImpact_Get + /// + /// + /// Default Api Version + /// 2024-05-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _workloadImpactClientDiagnostics.CreateScope("WorkloadImpactResource.Get"); + scope.Start(); + try + { + var response = await _workloadImpactRestClient.GetAsync(Id.SubscriptionId, Id.Name, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new WorkloadImpactResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a WorkloadImpact + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.Impact/workloadImpacts/{workloadImpactName} + /// + /// + /// Operation Id + /// WorkloadImpact_Get + /// + /// + /// Default Api Version + /// 2024-05-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _workloadImpactClientDiagnostics.CreateScope("WorkloadImpactResource.Get"); + scope.Start(); + try + { + var response = _workloadImpactRestClient.Get(Id.SubscriptionId, Id.Name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new WorkloadImpactResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Delete a WorkloadImpact + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.Impact/workloadImpacts/{workloadImpactName} + /// + /// + /// Operation Id + /// WorkloadImpact_Delete + /// + /// + /// Default Api Version + /// 2024-05-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 = _workloadImpactClientDiagnostics.CreateScope("WorkloadImpactResource.Delete"); + scope.Start(); + try + { + var response = await _workloadImpactRestClient.DeleteAsync(Id.SubscriptionId, Id.Name, cancellationToken).ConfigureAwait(false); + var uri = _workloadImpactRestClient.CreateDeleteRequestUri(Id.SubscriptionId, Id.Name); + var rehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(RequestMethod.Delete, uri.ToUri(), uri.ToString(), "None", null, OperationFinalStateVia.OriginalUri.ToString()); + var operation = new ImpactReportingArmOperation(response, rehydrationToken); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Delete a WorkloadImpact + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.Impact/workloadImpacts/{workloadImpactName} + /// + /// + /// Operation Id + /// WorkloadImpact_Delete + /// + /// + /// Default Api Version + /// 2024-05-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 = _workloadImpactClientDiagnostics.CreateScope("WorkloadImpactResource.Delete"); + scope.Start(); + try + { + var response = _workloadImpactRestClient.Delete(Id.SubscriptionId, Id.Name, cancellationToken); + var uri = _workloadImpactRestClient.CreateDeleteRequestUri(Id.SubscriptionId, Id.Name); + var rehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(RequestMethod.Delete, uri.ToUri(), uri.ToString(), "None", null, OperationFinalStateVia.OriginalUri.ToString()); + var operation = new ImpactReportingArmOperation(response, rehydrationToken); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletionResponse(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Create a WorkloadImpact + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.Impact/workloadImpacts/{workloadImpactName} + /// + /// + /// Operation Id + /// WorkloadImpact_Create + /// + /// + /// Default Api Version + /// 2024-05-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, WorkloadImpactData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _workloadImpactClientDiagnostics.CreateScope("WorkloadImpactResource.Update"); + scope.Start(); + try + { + var response = await _workloadImpactRestClient.CreateAsync(Id.SubscriptionId, Id.Name, data, cancellationToken).ConfigureAwait(false); + var operation = new ImpactReportingArmOperation(new WorkloadImpactOperationSource(Client), _workloadImpactClientDiagnostics, Pipeline, _workloadImpactRestClient.CreateCreateRequest(Id.SubscriptionId, Id.Name, 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 WorkloadImpact + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.Impact/workloadImpacts/{workloadImpactName} + /// + /// + /// Operation Id + /// WorkloadImpact_Create + /// + /// + /// Default Api Version + /// 2024-05-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, WorkloadImpactData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _workloadImpactClientDiagnostics.CreateScope("WorkloadImpactResource.Update"); + scope.Start(); + try + { + var response = _workloadImpactRestClient.Create(Id.SubscriptionId, Id.Name, data, cancellationToken); + var operation = new ImpactReportingArmOperation(new WorkloadImpactOperationSource(Client), _workloadImpactClientDiagnostics, Pipeline, _workloadImpactRestClient.CreateCreateRequest(Id.SubscriptionId, Id.Name, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/impactreporting/Azure.ResourceManager.ImpactReporting/src/Properties/AssemblyInfo.cs b/sdk/impactreporting/Azure.ResourceManager.ImpactReporting/src/Properties/AssemblyInfo.cs new file mode 100644 index 000000000000..e5dd7e731e1b --- /dev/null +++ b/sdk/impactreporting/Azure.ResourceManager.ImpactReporting/src/Properties/AssemblyInfo.cs @@ -0,0 +1,11 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System.Runtime.CompilerServices; + +[assembly: InternalsVisibleTo("Azure.ResourceManager.ImpactReporting.Tests, PublicKey = 0024000004800000940000000602000000240000525341310004000001000100d15ddcb29688295338af4b7686603fe614abd555e09efba8fb88ee09e1f7b1ccaeed2e8f823fa9eef3fdd60217fc012ea67d2479751a0b8c087a4185541b851bd8b16f8d91b840e51b1cb0ba6fe647997e57429265e85ef62d565db50a69ae1647d54d7bd855e4db3d8a91510e5bcbd0edfbbecaa20a7bd9ae74593daa7b11b4")] + +// Replace Microsoft.Test with the correct resource provider namepace for your service and uncomment. +// See https://docs.microsoft.com/en-us/azure/azure-resource-manager/management/azure-services-resource-providers +// for the list of possible values. +[assembly: Azure.Core.AzureResourceProviderNamespace("ImpactReporting")] diff --git a/sdk/impactreporting/Azure.ResourceManager.ImpactReporting/tests/Azure.ResourceManager.ImpactReporting.Tests.csproj b/sdk/impactreporting/Azure.ResourceManager.ImpactReporting/tests/Azure.ResourceManager.ImpactReporting.Tests.csproj new file mode 100644 index 000000000000..bb52a13a69e6 --- /dev/null +++ b/sdk/impactreporting/Azure.ResourceManager.ImpactReporting/tests/Azure.ResourceManager.ImpactReporting.Tests.csproj @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/sdk/impactreporting/Azure.ResourceManager.ImpactReporting/tests/ImpactReportingManagementTestBase.cs b/sdk/impactreporting/Azure.ResourceManager.ImpactReporting/tests/ImpactReportingManagementTestBase.cs new file mode 100644 index 000000000000..5c2bc05c5d1a --- /dev/null +++ b/sdk/impactreporting/Azure.ResourceManager.ImpactReporting/tests/ImpactReportingManagementTestBase.cs @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using Azure; +using Azure.Core; +using Azure.Core.TestFramework; +using Azure.ResourceManager; +using Azure.ResourceManager.Resources; +using Azure.ResourceManager.TestFramework; +using NUnit.Framework; +using System.Threading.Tasks; + +namespace Azure.ResourceManager.ImpactReporting.Tests +{ + public class ImpactReportingManagementTestBase : ManagementRecordedTestBase + { + protected ArmClient Client { get; private set; } + protected SubscriptionResource DefaultSubscription { get; private set; } + + protected ImpactReportingManagementTestBase(bool isAsync, RecordedTestMode mode) + : base(isAsync, mode) + { + } + + protected ImpactReportingManagementTestBase(bool isAsync) + : base(isAsync) + { + } + + [SetUp] + public async Task CreateCommonClient() + { + Client = GetArmClient(); + DefaultSubscription = await Client.GetDefaultSubscriptionAsync().ConfigureAwait(false); + } + + protected async Task CreateResourceGroup(SubscriptionResource subscription, string rgNamePrefix, AzureLocation location) + { + string rgName = Recording.GenerateAssetName(rgNamePrefix); + ResourceGroupData input = new ResourceGroupData(location); + var lro = await subscription.GetResourceGroups().CreateOrUpdateAsync(WaitUntil.Completed, rgName, input); + return lro.Value; + } + } +} diff --git a/sdk/impactreporting/Azure.ResourceManager.ImpactReporting/tests/ImpactReportingManagementTestEnvironment.cs b/sdk/impactreporting/Azure.ResourceManager.ImpactReporting/tests/ImpactReportingManagementTestEnvironment.cs new file mode 100644 index 000000000000..ac5b6e7c9f9b --- /dev/null +++ b/sdk/impactreporting/Azure.ResourceManager.ImpactReporting/tests/ImpactReportingManagementTestEnvironment.cs @@ -0,0 +1,11 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using Azure.Core.TestFramework; + +namespace Azure.ResourceManager.ImpactReporting.Tests +{ + public class ImpactReportingManagementTestEnvironment : TestEnvironment + { + } +} diff --git a/sdk/impactreporting/Azure.ResourceManager.ImpactReporting/tsp-location.yaml b/sdk/impactreporting/Azure.ResourceManager.ImpactReporting/tsp-location.yaml new file mode 100644 index 000000000000..29788c4c8779 --- /dev/null +++ b/sdk/impactreporting/Azure.ResourceManager.ImpactReporting/tsp-location.yaml @@ -0,0 +1,4 @@ +directory: specification/impact/Impact.Management +commit: 676334a284e5136f0a0721d6ae844bb04332f579 +repo: Azure/azure-rest-api-specs +additionalDirectories: diff --git a/sdk/impactreporting/ci.mgmt.yml b/sdk/impactreporting/ci.mgmt.yml new file mode 100644 index 000000000000..f476798de69a --- /dev/null +++ b/sdk/impactreporting/ci.mgmt.yml @@ -0,0 +1,26 @@ +# NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. + +trigger: none + +pr: + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/impactreporting /ci.mgmt.yml + - sdk/impactreporting /Azure.ResourceManager.ImpactReporting / + + +extends: + template: /eng/pipelines/templates/stages/archetype-sdk-client.yml + parameters: + ServiceDirectory: impactreporting + ArtifactName: packages + LimitForPullRequest: true + Artifacts: + - name: Azure.ResourceManager.ImpactReporting + safeName: AzureResourceManagerImpactReporting diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/Configuration.json b/sdk/iotoperations/Azure.ResourceManager.IotOperations/Configuration.json new file mode 100644 index 000000000000..c0e9288ec7c4 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/Configuration.json @@ -0,0 +1,12 @@ +{ + "output-folder": ".", + "namespace": "Azure.ResourceManager.IotOperations", + "library-name": "Azure.ResourceManager.IotOperations", + "flavor": "azure", + "use-model-reader-writer": true, + "shared-source-folders": [ + "../../TempTypeSpecFiles/node_modules/@autorest/csharp/Generator.Shared", + "../../TempTypeSpecFiles/node_modules/@autorest/csharp/Azure.Core.Shared" + ], + "azure-arm": true +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/tsp-location.yaml b/sdk/iotoperations/Azure.ResourceManager.IotOperations/tsp-location.yaml index b4d6fcce59d8..f0575a7820d6 100644 --- a/sdk/iotoperations/Azure.ResourceManager.IotOperations/tsp-location.yaml +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/tsp-location.yaml @@ -1,3 +1,4 @@ directory: specification/iotoperations/IoTOperations.Management -commit: a570eb7b5643099a4c210b2e7b7d2fd3038f8c74 +commit: 676334a284e5136f0a0721d6ae844bb04332f579 repo: Azure/azure-rest-api-specs +additionalDirectories: diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/tspCodeModel.json b/sdk/iotoperations/Azure.ResourceManager.IotOperations/tspCodeModel.json new file mode 100644 index 000000000000..dd74f901de7c --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/tspCodeModel.json @@ -0,0 +1,68707 @@ +{ + "$id": "1", + "Name": "Microsoft.IoTOperations", + "ApiVersions": [ + "2024-11-01" + ], + "Enums": [ + { + "$id": "2", + "kind": "enum", + "name": "DataflowEndpointType", + "crossLanguageDefinitionId": "Microsoft.IoTOperations.EndpointType", + "valueType": { + "$id": "3", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "4", + "kind": "enumvalue", + "name": "DataExplorer", + "value": "DataExplorer", + "valueType": { + "$id": "5", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "2" + }, + "doc": "Azure Data Explorer Type", + "decorators": [] + }, + { + "$id": "6", + "kind": "enumvalue", + "name": "DataLakeStorage", + "value": "DataLakeStorage", + "valueType": { + "$id": "7", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "2" + }, + "doc": "Azure Data Lake Type", + "decorators": [] + }, + { + "$id": "8", + "kind": "enumvalue", + "name": "FabricOneLake", + "value": "FabricOneLake", + "valueType": { + "$id": "9", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "2" + }, + "doc": "Microsoft Fabric Type", + "decorators": [] + }, + { + "$id": "10", + "kind": "enumvalue", + "name": "Kafka", + "value": "Kafka", + "valueType": { + "$id": "11", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "2" + }, + "doc": "Kafka Type", + "decorators": [] + }, + { + "$id": "12", + "kind": "enumvalue", + "name": "LocalStorage", + "value": "LocalStorage", + "valueType": { + "$id": "13", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "2" + }, + "doc": "Local Storage Type", + "decorators": [] + }, + { + "$id": "14", + "kind": "enumvalue", + "name": "Mqtt", + "value": "Mqtt", + "valueType": { + "$id": "15", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "2" + }, + "doc": "Broker Type", + "decorators": [] + } + ], + "clientNamespace": "Microsoft.IoTOperations", + "doc": "DataflowEndpoint Type properties", + "isFixed": false, + "isFlags": false, + "usage": "Input,Output,Json,LroInitial,LroFinalEnvelope", + "decorators": [] + }, + { + "$id": "16", + "kind": "enum", + "name": "DataExplorerAuthMethod", + "crossLanguageDefinitionId": "Microsoft.IoTOperations.DataExplorerAuthMethod", + "valueType": { + "$id": "17", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "18", + "kind": "enumvalue", + "name": "SystemAssignedManagedIdentity", + "value": "SystemAssignedManagedIdentity", + "valueType": { + "$id": "19", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "16" + }, + "doc": "SystemAssignedManagedIdentity type", + "decorators": [] + }, + { + "$id": "20", + "kind": "enumvalue", + "name": "UserAssignedManagedIdentity", + "value": "UserAssignedManagedIdentity", + "valueType": { + "$id": "21", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "16" + }, + "doc": "UserAssignedManagedIdentity type", + "decorators": [] + } + ], + "clientNamespace": "Microsoft.IoTOperations", + "doc": "DataflowEndpoint Data Explorer Authentication Method properties", + "isFixed": false, + "isFlags": false, + "usage": "Input,Output,Json,LroInitial,LroFinalEnvelope", + "decorators": [] + }, + { + "$id": "22", + "kind": "enum", + "name": "DataLakeStorageAuthMethod", + "crossLanguageDefinitionId": "Microsoft.IoTOperations.DataLakeStorageAuthMethod", + "valueType": { + "$id": "23", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "24", + "kind": "enumvalue", + "name": "SystemAssignedManagedIdentity", + "value": "SystemAssignedManagedIdentity", + "valueType": { + "$id": "25", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "22" + }, + "doc": "SystemAssignedManagedIdentity type", + "decorators": [] + }, + { + "$id": "26", + "kind": "enumvalue", + "name": "UserAssignedManagedIdentity", + "value": "UserAssignedManagedIdentity", + "valueType": { + "$id": "27", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "22" + }, + "doc": "UserAssignedManagedIdentity type", + "decorators": [] + }, + { + "$id": "28", + "kind": "enumvalue", + "name": "AccessToken", + "value": "AccessToken", + "valueType": { + "$id": "29", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "22" + }, + "doc": "AccessToken Option", + "decorators": [] + } + ], + "clientNamespace": "Microsoft.IoTOperations", + "doc": "DataflowEndpoint Data Lake Storage Authentication Method properties", + "isFixed": false, + "isFlags": false, + "usage": "Input,Output,Json,LroInitial,LroFinalEnvelope", + "decorators": [] + }, + { + "$id": "30", + "kind": "enum", + "name": "FabricOneLakeAuthMethod", + "crossLanguageDefinitionId": "Microsoft.IoTOperations.FabricOneLakeAuthMethod", + "valueType": { + "$id": "31", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "32", + "kind": "enumvalue", + "name": "SystemAssignedManagedIdentity", + "value": "SystemAssignedManagedIdentity", + "valueType": { + "$id": "33", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "30" + }, + "doc": "SystemAssignedManagedIdentity type", + "decorators": [] + }, + { + "$id": "34", + "kind": "enumvalue", + "name": "UserAssignedManagedIdentity", + "value": "UserAssignedManagedIdentity", + "valueType": { + "$id": "35", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "30" + }, + "doc": "UserAssignedManagedIdentity type", + "decorators": [] + } + ], + "clientNamespace": "Microsoft.IoTOperations", + "doc": "DataflowEndpoint Fabric One Lake Authentication Method properties", + "isFixed": false, + "isFlags": false, + "usage": "Input,Output,Json,LroInitial,LroFinalEnvelope", + "decorators": [] + }, + { + "$id": "36", + "kind": "enum", + "name": "DataflowEndpointFabricPathType", + "crossLanguageDefinitionId": "Microsoft.IoTOperations.DataflowEndpointFabricPathType", + "valueType": { + "$id": "37", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "38", + "kind": "enumvalue", + "name": "Files", + "value": "Files", + "valueType": { + "$id": "39", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "36" + }, + "doc": "FILES Type", + "decorators": [] + }, + { + "$id": "40", + "kind": "enumvalue", + "name": "Tables", + "value": "Tables", + "valueType": { + "$id": "41", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "36" + }, + "doc": "TABLES Type", + "decorators": [] + } + ], + "clientNamespace": "Microsoft.IoTOperations", + "doc": "DataflowEndpoint Fabric Path Type properties", + "isFixed": false, + "isFlags": false, + "usage": "Input,Output,Json,LroInitial,LroFinalEnvelope", + "decorators": [] + }, + { + "$id": "42", + "kind": "enum", + "name": "KafkaAuthMethod", + "crossLanguageDefinitionId": "Microsoft.IoTOperations.KafkaAuthMethod", + "valueType": { + "$id": "43", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "44", + "kind": "enumvalue", + "name": "SystemAssignedManagedIdentity", + "value": "SystemAssignedManagedIdentity", + "valueType": { + "$id": "45", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "42" + }, + "doc": "SystemAssignedManagedIdentity type", + "decorators": [] + }, + { + "$id": "46", + "kind": "enumvalue", + "name": "UserAssignedManagedIdentity", + "value": "UserAssignedManagedIdentity", + "valueType": { + "$id": "47", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "42" + }, + "doc": "UserAssignedManagedIdentity type", + "decorators": [] + }, + { + "$id": "48", + "kind": "enumvalue", + "name": "Sasl", + "value": "Sasl", + "valueType": { + "$id": "49", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "42" + }, + "doc": "Sasl Option", + "decorators": [] + }, + { + "$id": "50", + "kind": "enumvalue", + "name": "X509Certificate", + "value": "X509Certificate", + "valueType": { + "$id": "51", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "42" + }, + "doc": "x509Certificate Option", + "decorators": [] + }, + { + "$id": "52", + "kind": "enumvalue", + "name": "Anonymous", + "value": "Anonymous", + "valueType": { + "$id": "53", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "42" + }, + "doc": "Anonymous Option", + "decorators": [] + } + ], + "clientNamespace": "Microsoft.IoTOperations", + "doc": "DataflowEndpoint Kafka Authentication Method properties", + "isFixed": false, + "isFlags": false, + "usage": "Input,Output,Json,LroInitial,LroFinalEnvelope", + "decorators": [] + }, + { + "$id": "54", + "kind": "enum", + "name": "DataflowEndpointAuthenticationSaslType", + "crossLanguageDefinitionId": "Microsoft.IoTOperations.DataflowEndpointAuthenticationSaslType", + "valueType": { + "$id": "55", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "56", + "kind": "enumvalue", + "name": "Plain", + "value": "Plain", + "valueType": { + "$id": "57", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "54" + }, + "doc": "PLAIN Type", + "decorators": [] + }, + { + "$id": "58", + "kind": "enumvalue", + "name": "ScramSha256", + "value": "ScramSha256", + "valueType": { + "$id": "59", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "54" + }, + "doc": "SCRAM_SHA_256 Type", + "decorators": [] + }, + { + "$id": "60", + "kind": "enumvalue", + "name": "ScramSha512", + "value": "ScramSha512", + "valueType": { + "$id": "61", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "54" + }, + "doc": "SCRAM_SHA_512 Type", + "decorators": [] + } + ], + "clientNamespace": "Microsoft.IoTOperations", + "doc": "DataflowEndpoint Authentication Sasl Type properties", + "isFixed": false, + "isFlags": false, + "usage": "Input,Output,Json,LroInitial,LroFinalEnvelope", + "decorators": [] + }, + { + "$id": "62", + "kind": "enum", + "name": "IotOperationsOperationalMode", + "crossLanguageDefinitionId": "Microsoft.IoTOperations.OperationalMode", + "valueType": { + "$id": "63", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "64", + "kind": "enumvalue", + "name": "Enabled", + "value": "Enabled", + "valueType": { + "$id": "65", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "62" + }, + "doc": "Enabled is equivalent to True", + "decorators": [] + }, + { + "$id": "66", + "kind": "enumvalue", + "name": "Disabled", + "value": "Disabled", + "valueType": { + "$id": "67", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "62" + }, + "doc": "Disabled is equivalent to False.", + "decorators": [] + } + ], + "clientNamespace": "Microsoft.IoTOperations", + "doc": "Mode properties", + "isFixed": false, + "isFlags": false, + "usage": "Input,Output,Json,LroInitial,LroFinalEnvelope", + "decorators": [] + }, + { + "$id": "68", + "kind": "enum", + "name": "DataflowEndpointKafkaCompression", + "crossLanguageDefinitionId": "Microsoft.IoTOperations.DataflowEndpointKafkaCompression", + "valueType": { + "$id": "69", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "70", + "kind": "enumvalue", + "name": "None", + "value": "None", + "valueType": { + "$id": "71", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "68" + }, + "doc": "NONE Option", + "decorators": [] + }, + { + "$id": "72", + "kind": "enumvalue", + "name": "Gzip", + "value": "Gzip", + "valueType": { + "$id": "73", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "68" + }, + "doc": "Gzip Option", + "decorators": [] + }, + { + "$id": "74", + "kind": "enumvalue", + "name": "Snappy", + "value": "Snappy", + "valueType": { + "$id": "75", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "68" + }, + "doc": "SNAPPY Option", + "decorators": [] + }, + { + "$id": "76", + "kind": "enumvalue", + "name": "Lz4", + "value": "Lz4", + "valueType": { + "$id": "77", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "68" + }, + "doc": "LZ4 Option", + "decorators": [] + } + ], + "clientNamespace": "Microsoft.IoTOperations", + "doc": "Kafka endpoint Compression properties", + "isFixed": false, + "isFlags": false, + "usage": "Input,Output,Json,LroInitial,LroFinalEnvelope", + "decorators": [] + }, + { + "$id": "78", + "kind": "enum", + "name": "DataflowEndpointKafkaAcks", + "crossLanguageDefinitionId": "Microsoft.IoTOperations.DataflowEndpointKafkaAcks", + "valueType": { + "$id": "79", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "80", + "kind": "enumvalue", + "name": "Zero", + "value": "Zero", + "valueType": { + "$id": "81", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "78" + }, + "doc": "ZERO Option", + "decorators": [] + }, + { + "$id": "82", + "kind": "enumvalue", + "name": "One", + "value": "One", + "valueType": { + "$id": "83", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "78" + }, + "doc": "ONE Option", + "decorators": [] + }, + { + "$id": "84", + "kind": "enumvalue", + "name": "All", + "value": "All", + "valueType": { + "$id": "85", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "78" + }, + "doc": "ALL Option", + "decorators": [] + } + ], + "clientNamespace": "Microsoft.IoTOperations", + "doc": "DataflowEndpoint Kafka Acks properties", + "isFixed": false, + "isFlags": false, + "usage": "Input,Output,Json,LroInitial,LroFinalEnvelope", + "decorators": [] + }, + { + "$id": "86", + "kind": "enum", + "name": "DataflowEndpointKafkaPartitionStrategy", + "crossLanguageDefinitionId": "Microsoft.IoTOperations.DataflowEndpointKafkaPartitionStrategy", + "valueType": { + "$id": "87", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "88", + "kind": "enumvalue", + "name": "Default", + "value": "Default", + "valueType": { + "$id": "89", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "86" + }, + "doc": "Default: Assigns messages to random partitions, using a round-robin algorithm.", + "decorators": [] + }, + { + "$id": "90", + "kind": "enumvalue", + "name": "Static", + "value": "Static", + "valueType": { + "$id": "91", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "86" + }, + "doc": "Static: Assigns messages to a fixed partition number that's derived from the instance ID of the dataflow.", + "decorators": [] + }, + { + "$id": "92", + "kind": "enumvalue", + "name": "Topic", + "value": "Topic", + "valueType": { + "$id": "93", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "86" + }, + "doc": "TOPIC Option", + "decorators": [] + }, + { + "$id": "94", + "kind": "enumvalue", + "name": "Property", + "value": "Property", + "valueType": { + "$id": "95", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "86" + }, + "doc": "PROPERTY Option", + "decorators": [] + } + ], + "clientNamespace": "Microsoft.IoTOperations", + "doc": "DataflowEndpoint Kafka Partition Strategy properties", + "isFixed": false, + "isFlags": false, + "usage": "Input,Output,Json,LroInitial,LroFinalEnvelope", + "decorators": [] + }, + { + "$id": "96", + "kind": "enum", + "name": "CloudEventAttributeType", + "crossLanguageDefinitionId": "Microsoft.IoTOperations.CloudEventAttributeType", + "valueType": { + "$id": "97", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "98", + "kind": "enumvalue", + "name": "Propagate", + "value": "Propagate", + "valueType": { + "$id": "99", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "96" + }, + "doc": "Propagate type", + "decorators": [] + }, + { + "$id": "100", + "kind": "enumvalue", + "name": "CreateOrRemap", + "value": "CreateOrRemap", + "valueType": { + "$id": "101", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "96" + }, + "doc": "CreateOrRemap type", + "decorators": [] + } + ], + "clientNamespace": "Microsoft.IoTOperations", + "doc": "How to map events to the cloud.", + "isFixed": false, + "isFlags": false, + "usage": "Input,Output,Json,LroInitial,LroFinalEnvelope", + "decorators": [] + }, + { + "$id": "102", + "kind": "enum", + "name": "MqttAuthMethod", + "crossLanguageDefinitionId": "Microsoft.IoTOperations.MqttAuthMethod", + "valueType": { + "$id": "103", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "104", + "kind": "enumvalue", + "name": "SystemAssignedManagedIdentity", + "value": "SystemAssignedManagedIdentity", + "valueType": { + "$id": "105", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "102" + }, + "doc": "SystemAssignedManagedIdentity type", + "decorators": [] + }, + { + "$id": "106", + "kind": "enumvalue", + "name": "UserAssignedManagedIdentity", + "value": "UserAssignedManagedIdentity", + "valueType": { + "$id": "107", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "102" + }, + "doc": "UserAssignedManagedIdentity type", + "decorators": [] + }, + { + "$id": "108", + "kind": "enumvalue", + "name": "ServiceAccountToken", + "value": "ServiceAccountToken", + "valueType": { + "$id": "109", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "102" + }, + "doc": "ServiceAccountToken Option", + "decorators": [] + }, + { + "$id": "110", + "kind": "enumvalue", + "name": "X509Certificate", + "value": "X509Certificate", + "valueType": { + "$id": "111", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "102" + }, + "doc": "x509Certificate Option", + "decorators": [] + }, + { + "$id": "112", + "kind": "enumvalue", + "name": "Anonymous", + "value": "Anonymous", + "valueType": { + "$id": "113", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "102" + }, + "doc": "Anonymous Option", + "decorators": [] + } + ], + "clientNamespace": "Microsoft.IoTOperations", + "doc": "DataflowEndpoint Mqtt Authentication Method properties", + "isFixed": false, + "isFlags": false, + "usage": "Input,Output,Json,LroInitial,LroFinalEnvelope", + "decorators": [] + }, + { + "$id": "114", + "kind": "enum", + "name": "BrokerProtocolType", + "crossLanguageDefinitionId": "Microsoft.IoTOperations.BrokerProtocolType", + "valueType": { + "$id": "115", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "116", + "kind": "enumvalue", + "name": "Mqtt", + "value": "Mqtt", + "valueType": { + "$id": "117", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "114" + }, + "doc": "protocol broker", + "decorators": [] + }, + { + "$id": "118", + "kind": "enumvalue", + "name": "WebSockets", + "value": "WebSockets", + "valueType": { + "$id": "119", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "114" + }, + "doc": "protocol websocket", + "decorators": [] + } + ], + "clientNamespace": "Microsoft.IoTOperations", + "doc": "Broker Protocol types", + "isFixed": false, + "isFlags": false, + "usage": "Input,Output,Json,LroInitial,LroFinalEnvelope", + "decorators": [] + }, + { + "$id": "120", + "kind": "enum", + "name": "MqttRetainType", + "crossLanguageDefinitionId": "Microsoft.IoTOperations.MqttRetainType", + "valueType": { + "$id": "121", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "122", + "kind": "enumvalue", + "name": "Keep", + "value": "Keep", + "valueType": { + "$id": "123", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "120" + }, + "doc": "Retain the messages.", + "decorators": [] + }, + { + "$id": "124", + "kind": "enumvalue", + "name": "Never", + "value": "Never", + "valueType": { + "$id": "125", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "120" + }, + "doc": "Never retain messages.", + "decorators": [] + } + ], + "clientNamespace": "Microsoft.IoTOperations", + "doc": "Broker Retain types", + "isFixed": false, + "isFlags": false, + "usage": "Input,Output,Json,LroInitial,LroFinalEnvelope", + "decorators": [] + }, + { + "$id": "126", + "kind": "enum", + "name": "IotOperationsProvisioningState", + "crossLanguageDefinitionId": "Microsoft.IoTOperations.ProvisioningState", + "valueType": { + "$id": "127", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "128", + "kind": "enumvalue", + "name": "Succeeded", + "value": "Succeeded", + "valueType": { + "$id": "129", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "126" + }, + "doc": "Resource has been created.", + "decorators": [] + }, + { + "$id": "130", + "kind": "enumvalue", + "name": "Failed", + "value": "Failed", + "valueType": { + "$id": "131", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "126" + }, + "doc": "Resource creation failed.", + "decorators": [] + }, + { + "$id": "132", + "kind": "enumvalue", + "name": "Canceled", + "value": "Canceled", + "valueType": { + "$id": "133", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "126" + }, + "doc": "Resource creation was canceled.", + "decorators": [] + }, + { + "$id": "134", + "kind": "enumvalue", + "name": "Provisioning", + "value": "Provisioning", + "valueType": { + "$id": "135", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "126" + }, + "doc": "Resource is getting provisioned.", + "decorators": [] + }, + { + "$id": "136", + "kind": "enumvalue", + "name": "Updating", + "value": "Updating", + "valueType": { + "$id": "137", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "126" + }, + "doc": "Resource is Updating.", + "decorators": [] + }, + { + "$id": "138", + "kind": "enumvalue", + "name": "Deleting", + "value": "Deleting", + "valueType": { + "$id": "139", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "126" + }, + "doc": "Resource is Deleting.", + "decorators": [] + }, + { + "$id": "140", + "kind": "enumvalue", + "name": "Accepted", + "value": "Accepted", + "valueType": { + "$id": "141", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "126" + }, + "doc": "Resource has been Accepted.", + "decorators": [] + } + ], + "clientNamespace": "Microsoft.IoTOperations", + "doc": "The enum defining status of resource.", + "isFixed": false, + "isFlags": false, + "usage": "Output,Json,LroInitial,LroFinalEnvelope", + "decorators": [] + }, + { + "$id": "142", + "kind": "enum", + "name": "IotOperationsExtendedLocationType", + "crossLanguageDefinitionId": "Microsoft.IoTOperations.ExtendedLocationType", + "valueType": { + "$id": "143", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "144", + "kind": "enumvalue", + "name": "CustomLocation", + "value": "CustomLocation", + "valueType": { + "$id": "145", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "142" + }, + "doc": "CustomLocation type", + "decorators": [] + } + ], + "clientNamespace": "Microsoft.IoTOperations", + "doc": "The enum defining type of ExtendedLocation accepted.", + "isFixed": false, + "isFlags": false, + "usage": "Input,Output,Json,LroInitial,LroFinalEnvelope", + "decorators": [] + }, + { + "$id": "146", + "kind": "enum", + "name": "createdByType", + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.createdByType", + "valueType": { + "$id": "147", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "148", + "kind": "enumvalue", + "name": "User", + "value": "User", + "valueType": { + "$id": "149", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "146" + }, + "doc": "The entity was created by a user.", + "decorators": [] + }, + { + "$id": "150", + "kind": "enumvalue", + "name": "Application", + "value": "Application", + "valueType": { + "$id": "151", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "146" + }, + "doc": "The entity was created by an application.", + "decorators": [] + }, + { + "$id": "152", + "kind": "enumvalue", + "name": "ManagedIdentity", + "value": "ManagedIdentity", + "valueType": { + "$id": "153", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "146" + }, + "doc": "The entity was created by a managed identity.", + "decorators": [] + }, + { + "$id": "154", + "kind": "enumvalue", + "name": "Key", + "value": "Key", + "valueType": { + "$id": "155", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "146" + }, + "doc": "The entity was created by a key.", + "decorators": [] + } + ], + "clientNamespace": "Azure.ResourceManager.CommonTypes", + "doc": "The kind of entity that created the resource.", + "isFixed": false, + "isFlags": false, + "usage": "Output,Json,LroInitial,LroFinalEnvelope", + "decorators": [] + }, + { + "$id": "156", + "kind": "enum", + "name": "ResourceProvisioningState", + "crossLanguageDefinitionId": "Azure.ResourceManager.ResourceProvisioningState", + "valueType": { + "$id": "157", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "158", + "kind": "enumvalue", + "name": "Succeeded", + "value": "Succeeded", + "valueType": { + "$id": "159", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "156" + }, + "doc": "Resource has been created.", + "decorators": [] + }, + { + "$id": "160", + "kind": "enumvalue", + "name": "Failed", + "value": "Failed", + "valueType": { + "$id": "161", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "156" + }, + "doc": "Resource creation failed.", + "decorators": [] + }, + { + "$id": "162", + "kind": "enumvalue", + "name": "Canceled", + "value": "Canceled", + "valueType": { + "$id": "163", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "156" + }, + "doc": "Resource creation was canceled.", + "decorators": [] + } + ], + "clientNamespace": "Azure.ResourceManager", + "doc": "The provisioning state of a resource type.", + "isFixed": false, + "isFlags": false, + "usage": "LroPolling", + "decorators": [] + }, + { + "$id": "164", + "kind": "enum", + "name": "DataflowOperationType", + "crossLanguageDefinitionId": "Microsoft.IoTOperations.OperationType", + "valueType": { + "$id": "165", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "166", + "kind": "enumvalue", + "name": "Source", + "value": "Source", + "valueType": { + "$id": "167", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "164" + }, + "doc": "Dataflow Source Operation", + "decorators": [] + }, + { + "$id": "168", + "kind": "enumvalue", + "name": "Destination", + "value": "Destination", + "valueType": { + "$id": "169", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "164" + }, + "doc": "Dataflow Destination Operation", + "decorators": [] + }, + { + "$id": "170", + "kind": "enumvalue", + "name": "BuiltInTransformation", + "value": "BuiltInTransformation", + "valueType": { + "$id": "171", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "164" + }, + "doc": "Dataflow BuiltIn Transformation Operation", + "decorators": [] + } + ], + "clientNamespace": "Microsoft.IoTOperations", + "doc": "Dataflow Operation Type properties", + "isFixed": false, + "isFlags": false, + "usage": "Input,Output,Json,LroInitial,LroFinalEnvelope", + "decorators": [] + }, + { + "$id": "172", + "kind": "enum", + "name": "DataflowSourceSerializationFormat", + "crossLanguageDefinitionId": "Microsoft.IoTOperations.SourceSerializationFormat", + "valueType": { + "$id": "173", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "174", + "kind": "enumvalue", + "name": "Json", + "value": "Json", + "valueType": { + "$id": "175", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "172" + }, + "doc": "JSON Format", + "decorators": [] + } + ], + "clientNamespace": "Microsoft.IoTOperations", + "doc": "Serialization Format properties", + "isFixed": false, + "isFlags": false, + "usage": "Input,Output,Json,LroInitial,LroFinalEnvelope", + "decorators": [] + }, + { + "$id": "176", + "kind": "enum", + "name": "TransformationSerializationFormat", + "crossLanguageDefinitionId": "Microsoft.IoTOperations.TransformationSerializationFormat", + "valueType": { + "$id": "177", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "178", + "kind": "enumvalue", + "name": "Delta", + "value": "Delta", + "valueType": { + "$id": "179", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "176" + }, + "doc": "Delta Format", + "decorators": [] + }, + { + "$id": "180", + "kind": "enumvalue", + "name": "Json", + "value": "Json", + "valueType": { + "$id": "181", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "176" + }, + "doc": "JSON Format", + "decorators": [] + }, + { + "$id": "182", + "kind": "enumvalue", + "name": "Parquet", + "value": "Parquet", + "valueType": { + "$id": "183", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "176" + }, + "doc": "Parquet Format", + "decorators": [] + } + ], + "clientNamespace": "Microsoft.IoTOperations", + "doc": "Transformation Format properties", + "isFixed": false, + "isFlags": false, + "usage": "Input,Output,Json,LroInitial,LroFinalEnvelope", + "decorators": [] + }, + { + "$id": "184", + "kind": "enum", + "name": "DataflowFilterType", + "crossLanguageDefinitionId": "Microsoft.IoTOperations.FilterType", + "valueType": { + "$id": "185", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "186", + "kind": "enumvalue", + "name": "Filter", + "value": "Filter", + "valueType": { + "$id": "187", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "184" + }, + "doc": "Filter type", + "decorators": [] + } + ], + "clientNamespace": "Microsoft.IoTOperations", + "doc": "Filter Type properties", + "isFixed": false, + "isFlags": false, + "usage": "Input,Output,Json,LroInitial,LroFinalEnvelope", + "decorators": [] + }, + { + "$id": "188", + "kind": "enum", + "name": "DataflowMappingType", + "crossLanguageDefinitionId": "Microsoft.IoTOperations.DataflowMappingType", + "valueType": { + "$id": "189", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "190", + "kind": "enumvalue", + "name": "NewProperties", + "value": "NewProperties", + "valueType": { + "$id": "191", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "188" + }, + "doc": "New Properties type", + "decorators": [] + }, + { + "$id": "192", + "kind": "enumvalue", + "name": "Rename", + "value": "Rename", + "valueType": { + "$id": "193", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "188" + }, + "doc": "Rename type", + "decorators": [] + }, + { + "$id": "194", + "kind": "enumvalue", + "name": "Compute", + "value": "Compute", + "valueType": { + "$id": "195", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "188" + }, + "doc": "Compute type", + "decorators": [] + }, + { + "$id": "196", + "kind": "enumvalue", + "name": "PassThrough", + "value": "PassThrough", + "valueType": { + "$id": "197", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "188" + }, + "doc": "Pass-through type", + "decorators": [] + }, + { + "$id": "198", + "kind": "enumvalue", + "name": "BuiltInFunction", + "value": "BuiltInFunction", + "valueType": { + "$id": "199", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "188" + }, + "doc": "Built in function type", + "decorators": [] + } + ], + "clientNamespace": "Microsoft.IoTOperations", + "doc": "Dataflow type mapping properties", + "isFixed": false, + "isFlags": false, + "usage": "Input,Output,Json,LroInitial,LroFinalEnvelope", + "decorators": [] + }, + { + "$id": "200", + "kind": "enum", + "name": "BrokerResourceDefinitionMethods", + "crossLanguageDefinitionId": "Microsoft.IoTOperations.BrokerResourceDefinitionMethods", + "valueType": { + "$id": "201", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "202", + "kind": "enumvalue", + "name": "Connect", + "value": "Connect", + "valueType": { + "$id": "203", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "200" + }, + "doc": "Allowed Connecting to Broker", + "decorators": [] + }, + { + "$id": "204", + "kind": "enumvalue", + "name": "Publish", + "value": "Publish", + "valueType": { + "$id": "205", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "200" + }, + "doc": "Allowed Publishing to Broker", + "decorators": [] + }, + { + "$id": "206", + "kind": "enumvalue", + "name": "Subscribe", + "value": "Subscribe", + "valueType": { + "$id": "207", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "200" + }, + "doc": "Allowed Subscribing to Broker", + "decorators": [] + } + ], + "clientNamespace": "Microsoft.IoTOperations", + "doc": "BrokerResourceDefinitionMethods methods allowed", + "isFixed": false, + "isFlags": false, + "usage": "Input,Output,Json,LroInitial,LroFinalEnvelope", + "decorators": [] + }, + { + "$id": "208", + "kind": "enum", + "name": "StateStoreResourceKeyTypes", + "crossLanguageDefinitionId": "Microsoft.IoTOperations.StateStoreResourceKeyTypes", + "valueType": { + "$id": "209", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "210", + "kind": "enumvalue", + "name": "Pattern", + "value": "Pattern", + "valueType": { + "$id": "211", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "208" + }, + "doc": "Key type - pattern", + "decorators": [] + }, + { + "$id": "212", + "kind": "enumvalue", + "name": "String", + "value": "String", + "valueType": { + "$id": "213", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "208" + }, + "doc": "Key type - string", + "decorators": [] + }, + { + "$id": "214", + "kind": "enumvalue", + "name": "Binary", + "value": "Binary", + "valueType": { + "$id": "215", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "208" + }, + "doc": "Key type - binary", + "decorators": [] + } + ], + "clientNamespace": "Microsoft.IoTOperations", + "doc": "StateStoreResourceKeyTypes properties", + "isFixed": false, + "isFlags": false, + "usage": "Input,Output,Json,LroInitial,LroFinalEnvelope", + "decorators": [] + }, + { + "$id": "216", + "kind": "enum", + "name": "StateStoreResourceDefinitionMethods", + "crossLanguageDefinitionId": "Microsoft.IoTOperations.StateStoreResourceDefinitionMethods", + "valueType": { + "$id": "217", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "218", + "kind": "enumvalue", + "name": "Read", + "value": "Read", + "valueType": { + "$id": "219", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "216" + }, + "doc": "Get/KeyNotify from Store", + "decorators": [] + }, + { + "$id": "220", + "kind": "enumvalue", + "name": "Write", + "value": "Write", + "valueType": { + "$id": "221", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "216" + }, + "doc": "Set/Delete in Store", + "decorators": [] + }, + { + "$id": "222", + "kind": "enumvalue", + "name": "ReadWrite", + "value": "ReadWrite", + "valueType": { + "$id": "223", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "216" + }, + "doc": "Allowed all operations on Store - Get/KeyNotify/Set/Delete", + "decorators": [] + } + ], + "clientNamespace": "Microsoft.IoTOperations", + "doc": "StateStoreResourceDefinitionMethods methods allowed", + "isFixed": false, + "isFlags": false, + "usage": "Input,Output,Json,LroInitial,LroFinalEnvelope", + "decorators": [] + }, + { + "$id": "224", + "kind": "enum", + "name": "BrokerAuthenticationMethod", + "crossLanguageDefinitionId": "Microsoft.IoTOperations.BrokerAuthenticationMethod", + "valueType": { + "$id": "225", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "226", + "kind": "enumvalue", + "name": "Custom", + "value": "Custom", + "valueType": { + "$id": "227", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "224" + }, + "doc": "Custom authentication configuration.", + "decorators": [] + }, + { + "$id": "228", + "kind": "enumvalue", + "name": "ServiceAccountToken", + "value": "ServiceAccountToken", + "valueType": { + "$id": "229", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "224" + }, + "doc": "ServiceAccountToken authentication configuration.", + "decorators": [] + }, + { + "$id": "230", + "kind": "enumvalue", + "name": "X509", + "value": "X509", + "valueType": { + "$id": "231", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "224" + }, + "doc": "X.509 authentication configuration.", + "decorators": [] + } + ], + "clientNamespace": "Microsoft.IoTOperations", + "doc": "Broker Authentication Mode", + "isFixed": false, + "isFlags": false, + "usage": "Input,Output,Json,LroInitial,LroFinalEnvelope", + "decorators": [] + }, + { + "$id": "232", + "kind": "enum", + "name": "TlsCertMethodMode", + "crossLanguageDefinitionId": "Microsoft.IoTOperations.TlsCertMethodMode", + "valueType": { + "$id": "233", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "234", + "kind": "enumvalue", + "name": "Automatic", + "value": "Automatic", + "valueType": { + "$id": "235", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "232" + }, + "doc": "Automatic TLS server certificate configuration.", + "decorators": [] + }, + { + "$id": "236", + "kind": "enumvalue", + "name": "Manual", + "value": "Manual", + "valueType": { + "$id": "237", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "232" + }, + "doc": "Manual TLS server certificate configuration.", + "decorators": [] + } + ], + "clientNamespace": "Microsoft.IoTOperations", + "doc": "Broker Authentication Mode", + "isFixed": false, + "isFlags": false, + "usage": "Input,Output,Json,LroInitial,LroFinalEnvelope", + "decorators": [] + }, + { + "$id": "238", + "kind": "enum", + "name": "CertManagerIssuerKind", + "crossLanguageDefinitionId": "Microsoft.IoTOperations.CertManagerIssuerKind", + "valueType": { + "$id": "239", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "240", + "kind": "enumvalue", + "name": "Issuer", + "value": "Issuer", + "valueType": { + "$id": "241", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "238" + }, + "doc": "Issuer kind.", + "decorators": [] + }, + { + "$id": "242", + "kind": "enumvalue", + "name": "ClusterIssuer", + "value": "ClusterIssuer", + "valueType": { + "$id": "243", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "238" + }, + "doc": "ClusterIssuer kind.", + "decorators": [] + } + ], + "clientNamespace": "Microsoft.IoTOperations", + "doc": "CertManagerIssuerKind properties", + "isFixed": false, + "isFlags": false, + "usage": "Input,Output,Json,LroInitial,LroFinalEnvelope", + "decorators": [] + }, + { + "$id": "244", + "kind": "enum", + "name": "PrivateKeyAlgorithm", + "crossLanguageDefinitionId": "Microsoft.IoTOperations.PrivateKeyAlgorithm", + "valueType": { + "$id": "245", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "246", + "kind": "enumvalue", + "name": "Ec256", + "value": "Ec256", + "valueType": { + "$id": "247", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "244" + }, + "doc": "Algorithm - ec256.", + "decorators": [] + }, + { + "$id": "248", + "kind": "enumvalue", + "name": "Ec384", + "value": "Ec384", + "valueType": { + "$id": "249", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "244" + }, + "doc": "Algorithm - ec384.", + "decorators": [] + }, + { + "$id": "250", + "kind": "enumvalue", + "name": "Ec521", + "value": "Ec521", + "valueType": { + "$id": "251", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "244" + }, + "doc": "Algorithm - ec521.", + "decorators": [] + }, + { + "$id": "252", + "kind": "enumvalue", + "name": "Ed25519", + "value": "Ed25519", + "valueType": { + "$id": "253", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "244" + }, + "doc": "Algorithm - ed25519.", + "decorators": [] + }, + { + "$id": "254", + "kind": "enumvalue", + "name": "Rsa2048", + "value": "Rsa2048", + "valueType": { + "$id": "255", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "244" + }, + "doc": "Algorithm - rsa2048.", + "decorators": [] + }, + { + "$id": "256", + "kind": "enumvalue", + "name": "Rsa4096", + "value": "Rsa4096", + "valueType": { + "$id": "257", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "244" + }, + "doc": "Algorithm - rsa4096.", + "decorators": [] + }, + { + "$id": "258", + "kind": "enumvalue", + "name": "Rsa8192", + "value": "Rsa8192", + "valueType": { + "$id": "259", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "244" + }, + "doc": "Algorithm - rsa8192.", + "decorators": [] + } + ], + "clientNamespace": "Microsoft.IoTOperations", + "doc": "Private key algorithm types.", + "isFixed": false, + "isFlags": false, + "usage": "Input,Output,Json,LroInitial,LroFinalEnvelope", + "decorators": [] + }, + { + "$id": "260", + "kind": "enum", + "name": "PrivateKeyRotationPolicy", + "crossLanguageDefinitionId": "Microsoft.IoTOperations.PrivateKeyRotationPolicy", + "valueType": { + "$id": "261", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "262", + "kind": "enumvalue", + "name": "Always", + "value": "Always", + "valueType": { + "$id": "263", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "260" + }, + "doc": "Rotation Policy - Always.", + "decorators": [] + }, + { + "$id": "264", + "kind": "enumvalue", + "name": "Never", + "value": "Never", + "valueType": { + "$id": "265", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "260" + }, + "doc": "Rotation Policy - Never.", + "decorators": [] + } + ], + "clientNamespace": "Microsoft.IoTOperations", + "doc": "Private key rotation policy.", + "isFixed": false, + "isFlags": false, + "usage": "Input,Output,Json,LroInitial,LroFinalEnvelope", + "decorators": [] + }, + { + "$id": "266", + "kind": "enum", + "name": "BlockerListenerServiceType", + "crossLanguageDefinitionId": "Microsoft.IoTOperations.ServiceType", + "valueType": { + "$id": "267", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "268", + "kind": "enumvalue", + "name": "ClusterIp", + "value": "ClusterIp", + "valueType": { + "$id": "269", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "266" + }, + "doc": "Cluster IP Service.", + "decorators": [] + }, + { + "$id": "270", + "kind": "enumvalue", + "name": "LoadBalancer", + "value": "LoadBalancer", + "valueType": { + "$id": "271", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "266" + }, + "doc": "Load Balancer Service.", + "decorators": [] + }, + { + "$id": "272", + "kind": "enumvalue", + "name": "NodePort", + "value": "NodePort", + "valueType": { + "$id": "273", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "266" + }, + "doc": "Node Port Service.", + "decorators": [] + } + ], + "clientNamespace": "Microsoft.IoTOperations", + "doc": "Kubernetes Service Types supported by Listener", + "isFixed": false, + "isFlags": false, + "usage": "Input,Output,Json,LroInitial,LroFinalEnvelope", + "decorators": [] + }, + { + "$id": "274", + "kind": "enum", + "name": "SubscriberMessageDropStrategy", + "crossLanguageDefinitionId": "Microsoft.IoTOperations.SubscriberMessageDropStrategy", + "valueType": { + "$id": "275", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "276", + "kind": "enumvalue", + "name": "None", + "value": "None", + "valueType": { + "$id": "277", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "274" + }, + "doc": "Messages are never dropped.", + "decorators": [] + }, + { + "$id": "278", + "kind": "enumvalue", + "name": "DropOldest", + "value": "DropOldest", + "valueType": { + "$id": "279", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "274" + }, + "doc": "The oldest message is dropped.", + "decorators": [] + } + ], + "clientNamespace": "Microsoft.IoTOperations", + "doc": "The enum defining strategies for dropping messages from the subscriber queue.", + "isFixed": false, + "isFlags": false, + "usage": "Input,Output,Json,LroInitial,LroFinalEnvelope", + "decorators": [] + }, + { + "$id": "280", + "kind": "enum", + "name": "BrokerOperatorValues", + "crossLanguageDefinitionId": "Microsoft.IoTOperations.OperatorValues", + "valueType": { + "$id": "281", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "282", + "kind": "enumvalue", + "name": "In", + "value": "In", + "valueType": { + "$id": "283", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "280" + }, + "doc": "In operator.", + "decorators": [] + }, + { + "$id": "284", + "kind": "enumvalue", + "name": "NotIn", + "value": "NotIn", + "valueType": { + "$id": "285", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "280" + }, + "doc": "NotIn operator.", + "decorators": [] + }, + { + "$id": "286", + "kind": "enumvalue", + "name": "Exists", + "value": "Exists", + "valueType": { + "$id": "287", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "280" + }, + "doc": "Exists operator.", + "decorators": [] + }, + { + "$id": "288", + "kind": "enumvalue", + "name": "DoesNotExist", + "value": "DoesNotExist", + "valueType": { + "$id": "289", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "280" + }, + "doc": "DoesNotExist operator.", + "decorators": [] + } + ], + "clientNamespace": "Microsoft.IoTOperations", + "doc": "Valid operators are In, NotIn, Exists and DoesNotExist.", + "isFixed": false, + "isFlags": false, + "usage": "Input,Output,Json,LroInitial,LroFinalEnvelope", + "decorators": [] + }, + { + "$id": "290", + "kind": "enum", + "name": "BrokerMemoryProfile", + "crossLanguageDefinitionId": "Microsoft.IoTOperations.BrokerMemoryProfile", + "valueType": { + "$id": "291", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "292", + "kind": "enumvalue", + "name": "Tiny", + "value": "Tiny", + "valueType": { + "$id": "293", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "290" + }, + "doc": "Tiny memory profile.", + "decorators": [] + }, + { + "$id": "294", + "kind": "enumvalue", + "name": "Low", + "value": "Low", + "valueType": { + "$id": "295", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "290" + }, + "doc": "Low memory profile.", + "decorators": [] + }, + { + "$id": "296", + "kind": "enumvalue", + "name": "Medium", + "value": "Medium", + "valueType": { + "$id": "297", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "290" + }, + "doc": "Medium memory profile.", + "decorators": [] + }, + { + "$id": "298", + "kind": "enumvalue", + "name": "High", + "value": "High", + "valueType": { + "$id": "299", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "290" + }, + "doc": "High memory profile.", + "decorators": [] + } + ], + "clientNamespace": "Microsoft.IoTOperations", + "doc": "The memory profile settings of the Broker", + "isFixed": false, + "isFlags": false, + "usage": "Input,Output,Json,LroInitial,LroFinalEnvelope", + "decorators": [] + }, + { + "$id": "300", + "kind": "enum", + "name": "ManagedServiceIdentityType", + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.ManagedServiceIdentityType", + "valueType": { + "$id": "301", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "302", + "kind": "enumvalue", + "name": "None", + "value": "None", + "valueType": { + "$id": "303", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "300" + }, + "doc": "No managed identity.", + "decorators": [] + }, + { + "$id": "304", + "kind": "enumvalue", + "name": "SystemAssigned", + "value": "SystemAssigned", + "valueType": { + "$id": "305", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "300" + }, + "doc": "System assigned managed identity.", + "decorators": [] + }, + { + "$id": "306", + "kind": "enumvalue", + "name": "UserAssigned", + "value": "UserAssigned", + "valueType": { + "$id": "307", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "300" + }, + "doc": "User assigned managed identity.", + "decorators": [] + }, + { + "$id": "308", + "kind": "enumvalue", + "name": "SystemAssigned,UserAssigned", + "value": "SystemAssigned,UserAssigned", + "valueType": { + "$id": "309", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "300" + }, + "doc": "System and user assigned managed identity.", + "decorators": [] + } + ], + "clientNamespace": "Azure.ResourceManager.CommonTypes", + "doc": "Type of managed service identity (where both SystemAssigned and UserAssigned types are allowed).", + "isFixed": false, + "isFlags": false, + "usage": "Input,Output,Json,LroInitial,LroFinalEnvelope", + "decorators": [] + }, + { + "$id": "310", + "kind": "enum", + "name": "Origin", + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.Origin", + "valueType": { + "$id": "311", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "312", + "kind": "enumvalue", + "name": "user", + "value": "user", + "valueType": { + "$id": "313", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "310" + }, + "doc": "Indicates the operation is initiated by a user.", + "decorators": [] + }, + { + "$id": "314", + "kind": "enumvalue", + "name": "system", + "value": "system", + "valueType": { + "$id": "315", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "310" + }, + "doc": "Indicates the operation is initiated by a system.", + "decorators": [] + }, + { + "$id": "316", + "kind": "enumvalue", + "name": "user,system", + "value": "user,system", + "valueType": { + "$id": "317", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "310" + }, + "doc": "Indicates the operation is initiated by a user or system.", + "decorators": [] + } + ], + "clientNamespace": "Azure.ResourceManager.CommonTypes", + "doc": "The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default value is \"user,system\"", + "isFixed": false, + "isFlags": false, + "usage": "Output,Json", + "decorators": [] + }, + { + "$id": "318", + "kind": "enum", + "name": "ActionType", + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.ActionType", + "valueType": { + "$id": "319", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "320", + "kind": "enumvalue", + "name": "Internal", + "value": "Internal", + "valueType": { + "$id": "321", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "318" + }, + "doc": "Actions are for internal-only APIs.", + "decorators": [] + } + ], + "clientNamespace": "Azure.ResourceManager.CommonTypes", + "doc": "Extensible enum. Indicates the action type. \"Internal\" refers to actions that are for internal only APIs.", + "isFixed": false, + "isFlags": false, + "usage": "Output,Json", + "decorators": [] + }, + { + "$id": "322", + "kind": "enum", + "name": "Versions", + "crossLanguageDefinitionId": "Microsoft.IoTOperations.Versions", + "valueType": { + "$id": "323", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "324", + "kind": "enumvalue", + "name": "2024-11-01", + "value": "2024-11-01", + "valueType": { + "$id": "325", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "322" + }, + "doc": "2024-11-01 version", + "decorators": [] + } + ], + "clientNamespace": "Microsoft.IoTOperations", + "doc": "Api versions", + "isFixed": true, + "isFlags": false, + "usage": "ApiVersionEnum", + "decorators": [] + } + ], + "Models": [ + { + "$id": "326", + "kind": "model", + "name": "IotOperationsDataflowEndpoint", + "clientNamespace": "Microsoft.IoTOperations", + "crossLanguageDefinitionId": "Microsoft.IoTOperations.DataflowEndpointResource", + "usage": "Input,Output,Json,LroInitial,LroFinalEnvelope", + "doc": "Instance dataflowEndpoint resource", + "decorators": [], + "baseModel": { + "$id": "327", + "kind": "model", + "name": "ProxyResource", + "clientNamespace": "Azure.ResourceManager.CommonTypes", + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.ProxyResource", + "usage": "Input,Output,Json,LroInitial,LroFinalEnvelope", + "doc": "The resource model definition for a Azure Resource Manager proxy resource. It will not have tags and a location", + "decorators": [], + "baseModel": { + "$id": "328", + "kind": "model", + "name": "Resource", + "clientNamespace": "Azure.ResourceManager.CommonTypes", + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.Resource", + "usage": "Input,Output,Json,LroInitial,LroFinalEnvelope", + "doc": "Common fields that are returned in the response for all Azure Resource Manager resources", + "decorators": [], + "properties": [ + { + "$id": "329", + "kind": "property", + "name": "id", + "serializedName": "id", + "doc": "Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}", + "type": { + "$id": "330", + "kind": "string", + "name": "armResourceIdentifier", + "crossLanguageDefinitionId": "Azure.Core.armResourceIdentifier", + "baseType": { + "$id": "331", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.Resource.id", + "serializationOptions": { + "$id": "332", + "json": { + "$id": "333", + "name": "id" + } + } + }, + { + "$id": "334", + "kind": "property", + "name": "name", + "serializedName": "name", + "doc": "The name of the resource", + "type": { + "$id": "335", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.Resource.name", + "serializationOptions": { + "$id": "336", + "json": { + "$id": "337", + "name": "name" + } + } + }, + { + "$id": "338", + "kind": "property", + "name": "type", + "serializedName": "type", + "doc": "The type of the resource. E.g. \"Microsoft.Compute/virtualMachines\" or \"Microsoft.Storage/storageAccounts\"", + "type": { + "$id": "339", + "kind": "string", + "name": "armResourceType", + "crossLanguageDefinitionId": "Azure.Core.armResourceType", + "baseType": { + "$id": "340", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.Resource.type", + "serializationOptions": { + "$id": "341", + "json": { + "$id": "342", + "name": "type" + } + } + }, + { + "$id": "343", + "kind": "property", + "name": "systemData", + "serializedName": "systemData", + "doc": "Azure Resource Manager metadata containing createdBy and modifiedBy information.", + "type": { + "$id": "344", + "kind": "model", + "name": "SystemData", + "clientNamespace": "Azure.ResourceManager.CommonTypes", + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.SystemData", + "usage": "Output,Json,LroInitial,LroFinalEnvelope", + "doc": "Metadata pertaining to creation and last modification of the resource.", + "decorators": [], + "properties": [ + { + "$id": "345", + "kind": "property", + "name": "createdBy", + "serializedName": "createdBy", + "doc": "The identity that created the resource.", + "type": { + "$id": "346", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.SystemData.createdBy", + "serializationOptions": { + "$id": "347", + "json": { + "$id": "348", + "name": "createdBy" + } + } + }, + { + "$id": "349", + "kind": "property", + "name": "createdByType", + "serializedName": "createdByType", + "doc": "The type of identity that created the resource.", + "type": { + "$ref": "146" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.SystemData.createdByType", + "serializationOptions": { + "$id": "350", + "json": { + "$id": "351", + "name": "createdByType" + } + } + }, + { + "$id": "352", + "kind": "property", + "name": "createdAt", + "serializedName": "createdAt", + "doc": "The timestamp of resource creation (UTC).", + "type": { + "$id": "353", + "kind": "utcDateTime", + "name": "utcDateTime", + "encode": "rfc3339", + "wireType": { + "$id": "354", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.utcDateTime", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.SystemData.createdAt", + "serializationOptions": { + "$id": "355", + "json": { + "$id": "356", + "name": "createdAt" + } + } + }, + { + "$id": "357", + "kind": "property", + "name": "lastModifiedBy", + "serializedName": "lastModifiedBy", + "doc": "The identity that last modified the resource.", + "type": { + "$id": "358", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.SystemData.lastModifiedBy", + "serializationOptions": { + "$id": "359", + "json": { + "$id": "360", + "name": "lastModifiedBy" + } + } + }, + { + "$id": "361", + "kind": "property", + "name": "lastModifiedByType", + "serializedName": "lastModifiedByType", + "doc": "The type of identity that last modified the resource.", + "type": { + "$ref": "146" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.SystemData.lastModifiedByType", + "serializationOptions": { + "$id": "362", + "json": { + "$id": "363", + "name": "lastModifiedByType" + } + } + }, + { + "$id": "364", + "kind": "property", + "name": "lastModifiedAt", + "serializedName": "lastModifiedAt", + "doc": "The timestamp of resource last modification (UTC)", + "type": { + "$id": "365", + "kind": "utcDateTime", + "name": "utcDateTime", + "encode": "rfc3339", + "wireType": { + "$id": "366", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.utcDateTime", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.SystemData.lastModifiedAt", + "serializationOptions": { + "$id": "367", + "json": { + "$id": "368", + "name": "lastModifiedAt" + } + } + } + ] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.Resource.systemData", + "serializationOptions": { + "$id": "369", + "json": { + "$id": "370", + "name": "systemData" + } + } + } + ] + }, + "properties": [] + }, + "properties": [ + { + "$id": "371", + "kind": "property", + "name": "properties", + "serializedName": "properties", + "doc": "The resource-specific properties for this resource.", + "type": { + "$id": "372", + "kind": "model", + "name": "IotOperationsDataflowEndpointProperties", + "clientNamespace": "Microsoft.IoTOperations", + "crossLanguageDefinitionId": "Microsoft.IoTOperations.DataflowEndpointProperties", + "usage": "Input,Output,Json,LroInitial,LroFinalEnvelope", + "doc": "DataflowEndpoint Resource properties. NOTE - Only one type of endpoint is supported for one Resource", + "decorators": [], + "properties": [ + { + "$id": "373", + "kind": "property", + "name": "endpointType", + "serializedName": "endpointType", + "doc": "Endpoint Type.", + "type": { + "$ref": "2" + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.IoTOperations.DataflowEndpointProperties.endpointType", + "serializationOptions": { + "$id": "374", + "json": { + "$id": "375", + "name": "endpointType" + } + } + }, + { + "$id": "376", + "kind": "property", + "name": "dataExplorerSettings", + "serializedName": "dataExplorerSettings", + "doc": "Azure Data Explorer endpoint.", + "type": { + "$id": "377", + "kind": "model", + "name": "DataflowEndpointDataExplorer", + "clientNamespace": "Microsoft.IoTOperations", + "crossLanguageDefinitionId": "Microsoft.IoTOperations.DataflowEndpointDataExplorer", + "usage": "Input,Output,Json,LroInitial,LroFinalEnvelope", + "doc": "Azure Data Explorer endpoint properties", + "decorators": [], + "properties": [ + { + "$id": "378", + "kind": "property", + "name": "authentication", + "serializedName": "authentication", + "doc": "Authentication configuration. NOTE - only authentication property is allowed per entry.", + "type": { + "$id": "379", + "kind": "model", + "name": "DataflowEndpointDataExplorerAuthentication", + "clientNamespace": "Microsoft.IoTOperations", + "crossLanguageDefinitionId": "Microsoft.IoTOperations.DataflowEndpointDataExplorerAuthentication", + "usage": "Input,Output,Json,LroInitial,LroFinalEnvelope", + "doc": "Azure Data Explorer Authentication properties. NOTE - only authentication property is allowed per entry.", + "decorators": [], + "properties": [ + { + "$id": "380", + "kind": "property", + "name": "method", + "serializedName": "method", + "doc": "Mode of Authentication.", + "type": { + "$ref": "16" + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.IoTOperations.DataflowEndpointDataExplorerAuthentication.method", + "serializationOptions": { + "$id": "381", + "json": { + "$id": "382", + "name": "method" + } + } + }, + { + "$id": "383", + "kind": "property", + "name": "systemAssignedManagedIdentitySettings", + "serializedName": "systemAssignedManagedIdentitySettings", + "doc": "System-assigned managed identity authentication.", + "type": { + "$id": "384", + "kind": "model", + "name": "DataflowEndpointAuthenticationSystemAssignedManagedIdentity", + "clientNamespace": "Microsoft.IoTOperations", + "crossLanguageDefinitionId": "Microsoft.IoTOperations.DataflowEndpointAuthenticationSystemAssignedManagedIdentity", + "usage": "Input,Output,Json,LroInitial,LroFinalEnvelope", + "doc": "DataflowEndpoint Authentication SystemAssignedManagedIdentity properties", + "decorators": [], + "properties": [ + { + "$id": "385", + "kind": "property", + "name": "audience", + "serializedName": "audience", + "doc": "Audience of the service to authenticate against. Optional; defaults to the audience for Service host configuration.", + "type": { + "$id": "386", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.IoTOperations.DataflowEndpointAuthenticationSystemAssignedManagedIdentity.audience", + "serializationOptions": { + "$id": "387", + "json": { + "$id": "388", + "name": "audience" + } + } + } + ] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.IoTOperations.DataflowEndpointDataExplorerAuthentication.systemAssignedManagedIdentitySettings", + "serializationOptions": { + "$id": "389", + "json": { + "$id": "390", + "name": "systemAssignedManagedIdentitySettings" + } + } + }, + { + "$id": "391", + "kind": "property", + "name": "userAssignedManagedIdentitySettings", + "serializedName": "userAssignedManagedIdentitySettings", + "doc": "User-assigned managed identity authentication.", + "type": { + "$id": "392", + "kind": "model", + "name": "DataflowEndpointAuthenticationUserAssignedManagedIdentity", + "clientNamespace": "Microsoft.IoTOperations", + "crossLanguageDefinitionId": "Microsoft.IoTOperations.DataflowEndpointAuthenticationUserAssignedManagedIdentity", + "usage": "Input,Output,Json,LroInitial,LroFinalEnvelope", + "doc": "DataflowEndpoint Authentication UserAssignedManagedIdentity properties", + "decorators": [], + "properties": [ + { + "$id": "393", + "kind": "property", + "name": "clientId", + "serializedName": "clientId", + "doc": "Client ID for the user-assigned managed identity.", + "type": { + "$id": "394", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.IoTOperations.DataflowEndpointAuthenticationUserAssignedManagedIdentity.clientId", + "serializationOptions": { + "$id": "395", + "json": { + "$id": "396", + "name": "clientId" + } + } + }, + { + "$id": "397", + "kind": "property", + "name": "scope", + "serializedName": "scope", + "doc": "Resource identifier (application ID URI) of the resource, affixed with the .default suffix.", + "type": { + "$id": "398", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.IoTOperations.DataflowEndpointAuthenticationUserAssignedManagedIdentity.scope", + "serializationOptions": { + "$id": "399", + "json": { + "$id": "400", + "name": "scope" + } + } + }, + { + "$id": "401", + "kind": "property", + "name": "tenantId", + "serializedName": "tenantId", + "doc": "Tenant ID.", + "type": { + "$id": "402", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.IoTOperations.DataflowEndpointAuthenticationUserAssignedManagedIdentity.tenantId", + "serializationOptions": { + "$id": "403", + "json": { + "$id": "404", + "name": "tenantId" + } + } + } + ] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.IoTOperations.DataflowEndpointDataExplorerAuthentication.userAssignedManagedIdentitySettings", + "serializationOptions": { + "$id": "405", + "json": { + "$id": "406", + "name": "userAssignedManagedIdentitySettings" + } + } + } + ] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.IoTOperations.DataflowEndpointDataExplorer.authentication", + "serializationOptions": { + "$id": "407", + "json": { + "$id": "408", + "name": "authentication" + } + } + }, + { + "$id": "409", + "kind": "property", + "name": "database", + "serializedName": "database", + "doc": "Database name.", + "type": { + "$id": "410", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.IoTOperations.DataflowEndpointDataExplorer.database", + "serializationOptions": { + "$id": "411", + "json": { + "$id": "412", + "name": "database" + } + } + }, + { + "$id": "413", + "kind": "property", + "name": "host", + "serializedName": "host", + "doc": "Host of the Azure Data Explorer in the form of ..kusto.windows.net .", + "type": { + "$id": "414", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.IoTOperations.DataflowEndpointDataExplorer.host", + "serializationOptions": { + "$id": "415", + "json": { + "$id": "416", + "name": "host" + } + } + }, + { + "$id": "417", + "kind": "property", + "name": "batching", + "serializedName": "batching", + "doc": "Azure Data Explorer endpoint batching configuration.", + "type": { + "$id": "418", + "kind": "model", + "name": "IotOperationsBatchingConfig", + "clientNamespace": "Microsoft.IoTOperations", + "crossLanguageDefinitionId": "Microsoft.IoTOperations.BatchingConfiguration", + "usage": "Input,Output,Json,LroInitial,LroFinalEnvelope", + "doc": "Batching configuration", + "decorators": [], + "properties": [ + { + "$id": "419", + "kind": "property", + "name": "latencySeconds", + "serializedName": "latencySeconds", + "doc": "Batching latency in seconds.", + "type": { + "$id": "420", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.IoTOperations.BatchingConfiguration.latencySeconds", + "serializationOptions": { + "$id": "421", + "json": { + "$id": "422", + "name": "latencySeconds" + } + } + }, + { + "$id": "423", + "kind": "property", + "name": "maxMessages", + "serializedName": "maxMessages", + "doc": "Maximum number of messages in a batch.", + "type": { + "$id": "424", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.IoTOperations.BatchingConfiguration.maxMessages", + "serializationOptions": { + "$id": "425", + "json": { + "$id": "426", + "name": "maxMessages" + } + } + } + ] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.IoTOperations.DataflowEndpointDataExplorer.batching", + "serializationOptions": { + "$id": "427", + "json": { + "$id": "428", + "name": "batching" + } + } + } + ] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.IoTOperations.DataflowEndpointProperties.dataExplorerSettings", + "serializationOptions": { + "$id": "429", + "json": { + "$id": "430", + "name": "dataExplorerSettings" + } + } + }, + { + "$id": "431", + "kind": "property", + "name": "dataLakeStorageSettings", + "serializedName": "dataLakeStorageSettings", + "doc": "Azure Data Lake endpoint.", + "type": { + "$id": "432", + "kind": "model", + "name": "DataflowEndpointDataLakeStorage", + "clientNamespace": "Microsoft.IoTOperations", + "crossLanguageDefinitionId": "Microsoft.IoTOperations.DataflowEndpointDataLakeStorage", + "usage": "Input,Output,Json,LroInitial,LroFinalEnvelope", + "doc": "Azure Data Lake endpoint properties", + "decorators": [], + "properties": [ + { + "$id": "433", + "kind": "property", + "name": "authentication", + "serializedName": "authentication", + "doc": "Authentication configuration. NOTE - only authentication property is allowed per entry.", + "type": { + "$id": "434", + "kind": "model", + "name": "DataflowEndpointDataLakeStorageAuthentication", + "clientNamespace": "Microsoft.IoTOperations", + "crossLanguageDefinitionId": "Microsoft.IoTOperations.DataflowEndpointDataLakeStorageAuthentication", + "usage": "Input,Output,Json,LroInitial,LroFinalEnvelope", + "doc": "Azure Data Lake endpoint Authentication properties. NOTE Enum - Only one method is supported for one entry", + "decorators": [], + "properties": [ + { + "$id": "435", + "kind": "property", + "name": "method", + "serializedName": "method", + "doc": "Mode of Authentication.", + "type": { + "$ref": "22" + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.IoTOperations.DataflowEndpointDataLakeStorageAuthentication.method", + "serializationOptions": { + "$id": "436", + "json": { + "$id": "437", + "name": "method" + } + } + }, + { + "$id": "438", + "kind": "property", + "name": "accessTokenSettings", + "serializedName": "accessTokenSettings", + "doc": "SAS token authentication.", + "type": { + "$id": "439", + "kind": "model", + "name": "DataflowEndpointAuthenticationAccessToken", + "clientNamespace": "Microsoft.IoTOperations", + "crossLanguageDefinitionId": "Microsoft.IoTOperations.DataflowEndpointAuthenticationAccessToken", + "usage": "Input,Output,Json,LroInitial,LroFinalEnvelope", + "doc": "DataflowEndpoint Authentication Access Token properties", + "decorators": [], + "properties": [ + { + "$id": "440", + "kind": "property", + "name": "secretRef", + "serializedName": "secretRef", + "doc": "Token secret name.", + "type": { + "$id": "441", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.IoTOperations.DataflowEndpointAuthenticationAccessToken.secretRef", + "serializationOptions": { + "$id": "442", + "json": { + "$id": "443", + "name": "secretRef" + } + } + } + ] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.IoTOperations.DataflowEndpointDataLakeStorageAuthentication.accessTokenSettings", + "serializationOptions": { + "$id": "444", + "json": { + "$id": "445", + "name": "accessTokenSettings" + } + } + }, + { + "$id": "446", + "kind": "property", + "name": "systemAssignedManagedIdentitySettings", + "serializedName": "systemAssignedManagedIdentitySettings", + "doc": "System-assigned managed identity authentication.", + "type": { + "$ref": "384" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.IoTOperations.DataflowEndpointDataLakeStorageAuthentication.systemAssignedManagedIdentitySettings", + "serializationOptions": { + "$id": "447", + "json": { + "$id": "448", + "name": "systemAssignedManagedIdentitySettings" + } + } + }, + { + "$id": "449", + "kind": "property", + "name": "userAssignedManagedIdentitySettings", + "serializedName": "userAssignedManagedIdentitySettings", + "doc": "User-assigned managed identity authentication.", + "type": { + "$ref": "392" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.IoTOperations.DataflowEndpointDataLakeStorageAuthentication.userAssignedManagedIdentitySettings", + "serializationOptions": { + "$id": "450", + "json": { + "$id": "451", + "name": "userAssignedManagedIdentitySettings" + } + } + } + ] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.IoTOperations.DataflowEndpointDataLakeStorage.authentication", + "serializationOptions": { + "$id": "452", + "json": { + "$id": "453", + "name": "authentication" + } + } + }, + { + "$id": "454", + "kind": "property", + "name": "host", + "serializedName": "host", + "doc": "Host of the Azure Data Lake in the form of .blob.core.windows.net .", + "type": { + "$id": "455", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.IoTOperations.DataflowEndpointDataLakeStorage.host", + "serializationOptions": { + "$id": "456", + "json": { + "$id": "457", + "name": "host" + } + } + }, + { + "$id": "458", + "kind": "property", + "name": "batching", + "serializedName": "batching", + "doc": "Azure Data Lake endpoint batching configuration.", + "type": { + "$ref": "418" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.IoTOperations.DataflowEndpointDataLakeStorage.batching", + "serializationOptions": { + "$id": "459", + "json": { + "$id": "460", + "name": "batching" + } + } + } + ] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.IoTOperations.DataflowEndpointProperties.dataLakeStorageSettings", + "serializationOptions": { + "$id": "461", + "json": { + "$id": "462", + "name": "dataLakeStorageSettings" + } + } + }, + { + "$id": "463", + "kind": "property", + "name": "fabricOneLakeSettings", + "serializedName": "fabricOneLakeSettings", + "doc": "Microsoft Fabric endpoint.", + "type": { + "$id": "464", + "kind": "model", + "name": "DataflowEndpointFabricOneLake", + "clientNamespace": "Microsoft.IoTOperations", + "crossLanguageDefinitionId": "Microsoft.IoTOperations.DataflowEndpointFabricOneLake", + "usage": "Input,Output,Json,LroInitial,LroFinalEnvelope", + "doc": "Microsoft Fabric endpoint properties", + "decorators": [], + "properties": [ + { + "$id": "465", + "kind": "property", + "name": "authentication", + "serializedName": "authentication", + "doc": "Authentication configuration. NOTE - only one authentication property is allowed per entry.", + "type": { + "$id": "466", + "kind": "model", + "name": "DataflowEndpointFabricOneLakeAuthentication", + "clientNamespace": "Microsoft.IoTOperations", + "crossLanguageDefinitionId": "Microsoft.IoTOperations.DataflowEndpointFabricOneLakeAuthentication", + "usage": "Input,Output,Json,LroInitial,LroFinalEnvelope", + "doc": "Microsoft Fabric endpoint. Authentication properties. NOTE - Only one method is supported for one entry", + "decorators": [], + "properties": [ + { + "$id": "467", + "kind": "property", + "name": "method", + "serializedName": "method", + "doc": "Mode of Authentication.", + "type": { + "$ref": "30" + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.IoTOperations.DataflowEndpointFabricOneLakeAuthentication.method", + "serializationOptions": { + "$id": "468", + "json": { + "$id": "469", + "name": "method" + } + } + }, + { + "$id": "470", + "kind": "property", + "name": "systemAssignedManagedIdentitySettings", + "serializedName": "systemAssignedManagedIdentitySettings", + "doc": "System-assigned managed identity authentication.", + "type": { + "$ref": "384" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.IoTOperations.DataflowEndpointFabricOneLakeAuthentication.systemAssignedManagedIdentitySettings", + "serializationOptions": { + "$id": "471", + "json": { + "$id": "472", + "name": "systemAssignedManagedIdentitySettings" + } + } + }, + { + "$id": "473", + "kind": "property", + "name": "userAssignedManagedIdentitySettings", + "serializedName": "userAssignedManagedIdentitySettings", + "doc": "User-assigned managed identity authentication.", + "type": { + "$ref": "392" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.IoTOperations.DataflowEndpointFabricOneLakeAuthentication.userAssignedManagedIdentitySettings", + "serializationOptions": { + "$id": "474", + "json": { + "$id": "475", + "name": "userAssignedManagedIdentitySettings" + } + } + } + ] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.IoTOperations.DataflowEndpointFabricOneLake.authentication", + "serializationOptions": { + "$id": "476", + "json": { + "$id": "477", + "name": "authentication" + } + } + }, + { + "$id": "478", + "kind": "property", + "name": "names", + "serializedName": "names", + "doc": "Names of the workspace and lakehouse.", + "type": { + "$id": "479", + "kind": "model", + "name": "DataflowEndpointFabricOneLakeNames", + "clientNamespace": "Microsoft.IoTOperations", + "crossLanguageDefinitionId": "Microsoft.IoTOperations.DataflowEndpointFabricOneLakeNames", + "usage": "Input,Output,Json,LroInitial,LroFinalEnvelope", + "doc": "Microsoft Fabric endpoint Names properties", + "decorators": [], + "properties": [ + { + "$id": "480", + "kind": "property", + "name": "lakehouseName", + "serializedName": "lakehouseName", + "doc": "Lakehouse name.", + "type": { + "$id": "481", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.IoTOperations.DataflowEndpointFabricOneLakeNames.lakehouseName", + "serializationOptions": { + "$id": "482", + "json": { + "$id": "483", + "name": "lakehouseName" + } + } + }, + { + "$id": "484", + "kind": "property", + "name": "workspaceName", + "serializedName": "workspaceName", + "doc": "Workspace name.", + "type": { + "$id": "485", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.IoTOperations.DataflowEndpointFabricOneLakeNames.workspaceName", + "serializationOptions": { + "$id": "486", + "json": { + "$id": "487", + "name": "workspaceName" + } + } + } + ] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.IoTOperations.DataflowEndpointFabricOneLake.names", + "serializationOptions": { + "$id": "488", + "json": { + "$id": "489", + "name": "names" + } + } + }, + { + "$id": "490", + "kind": "property", + "name": "oneLakePathType", + "serializedName": "oneLakePathType", + "doc": "Type of location of the data in the workspace. Can be either tables or files.", + "type": { + "$ref": "36" + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.IoTOperations.DataflowEndpointFabricOneLake.oneLakePathType", + "serializationOptions": { + "$id": "491", + "json": { + "$id": "492", + "name": "oneLakePathType" + } + } + }, + { + "$id": "493", + "kind": "property", + "name": "host", + "serializedName": "host", + "doc": "Host of the Microsoft Fabric in the form of https://.fabric.microsoft.com.", + "type": { + "$id": "494", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.IoTOperations.DataflowEndpointFabricOneLake.host", + "serializationOptions": { + "$id": "495", + "json": { + "$id": "496", + "name": "host" + } + } + }, + { + "$id": "497", + "kind": "property", + "name": "batching", + "serializedName": "batching", + "doc": "Batching configuration.", + "type": { + "$ref": "418" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.IoTOperations.DataflowEndpointFabricOneLake.batching", + "serializationOptions": { + "$id": "498", + "json": { + "$id": "499", + "name": "batching" + } + } + } + ] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.IoTOperations.DataflowEndpointProperties.fabricOneLakeSettings", + "serializationOptions": { + "$id": "500", + "json": { + "$id": "501", + "name": "fabricOneLakeSettings" + } + } + }, + { + "$id": "502", + "kind": "property", + "name": "kafkaSettings", + "serializedName": "kafkaSettings", + "doc": "Kafka endpoint.", + "type": { + "$id": "503", + "kind": "model", + "name": "DataflowEndpointKafka", + "clientNamespace": "Microsoft.IoTOperations", + "crossLanguageDefinitionId": "Microsoft.IoTOperations.DataflowEndpointKafka", + "usage": "Input,Output,Json,LroInitial,LroFinalEnvelope", + "doc": "Kafka endpoint properties", + "decorators": [], + "properties": [ + { + "$id": "504", + "kind": "property", + "name": "authentication", + "serializedName": "authentication", + "doc": "Authentication configuration. NOTE - only authentication property is allowed per entry.", + "type": { + "$id": "505", + "kind": "model", + "name": "DataflowEndpointKafkaAuthentication", + "clientNamespace": "Microsoft.IoTOperations", + "crossLanguageDefinitionId": "Microsoft.IoTOperations.DataflowEndpointKafkaAuthentication", + "usage": "Input,Output,Json,LroInitial,LroFinalEnvelope", + "doc": "Kafka endpoint Authentication properties. NOTE - only authentication property is allowed per entry", + "decorators": [], + "properties": [ + { + "$id": "506", + "kind": "property", + "name": "method", + "serializedName": "method", + "doc": "Mode of Authentication.", + "type": { + "$ref": "42" + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.IoTOperations.DataflowEndpointKafkaAuthentication.method", + "serializationOptions": { + "$id": "507", + "json": { + "$id": "508", + "name": "method" + } + } + }, + { + "$id": "509", + "kind": "property", + "name": "systemAssignedManagedIdentitySettings", + "serializedName": "systemAssignedManagedIdentitySettings", + "doc": "System-assigned managed identity authentication.", + "type": { + "$ref": "384" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.IoTOperations.DataflowEndpointKafkaAuthentication.systemAssignedManagedIdentitySettings", + "serializationOptions": { + "$id": "510", + "json": { + "$id": "511", + "name": "systemAssignedManagedIdentitySettings" + } + } + }, + { + "$id": "512", + "kind": "property", + "name": "userAssignedManagedIdentitySettings", + "serializedName": "userAssignedManagedIdentitySettings", + "doc": "User-assigned managed identity authentication.", + "type": { + "$ref": "392" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.IoTOperations.DataflowEndpointKafkaAuthentication.userAssignedManagedIdentitySettings", + "serializationOptions": { + "$id": "513", + "json": { + "$id": "514", + "name": "userAssignedManagedIdentitySettings" + } + } + }, + { + "$id": "515", + "kind": "property", + "name": "saslSettings", + "serializedName": "saslSettings", + "doc": "SASL authentication.", + "type": { + "$id": "516", + "kind": "model", + "name": "DataflowEndpointAuthenticationSasl", + "clientNamespace": "Microsoft.IoTOperations", + "crossLanguageDefinitionId": "Microsoft.IoTOperations.DataflowEndpointAuthenticationSasl", + "usage": "Input,Output,Json,LroInitial,LroFinalEnvelope", + "doc": "DataflowEndpoint Authentication Sasl properties", + "decorators": [], + "properties": [ + { + "$id": "517", + "kind": "property", + "name": "saslType", + "serializedName": "saslType", + "doc": "Type of SASL authentication. Can be PLAIN, SCRAM-SHA-256, or SCRAM-SHA-512.", + "type": { + "$ref": "54" + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.IoTOperations.DataflowEndpointAuthenticationSasl.saslType", + "serializationOptions": { + "$id": "518", + "json": { + "$id": "519", + "name": "saslType" + } + } + }, + { + "$id": "520", + "kind": "property", + "name": "secretRef", + "serializedName": "secretRef", + "doc": "Token secret name.", + "type": { + "$id": "521", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.IoTOperations.DataflowEndpointAuthenticationSasl.secretRef", + "serializationOptions": { + "$id": "522", + "json": { + "$id": "523", + "name": "secretRef" + } + } + } + ] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.IoTOperations.DataflowEndpointKafkaAuthentication.saslSettings", + "serializationOptions": { + "$id": "524", + "json": { + "$id": "525", + "name": "saslSettings" + } + } + }, + { + "$id": "526", + "kind": "property", + "name": "x509CertificateSettings", + "serializedName": "x509CertificateSettings", + "doc": "X.509 certificate authentication.", + "type": { + "$id": "527", + "kind": "model", + "name": "DataflowEndpointAuthenticationX509", + "clientNamespace": "Microsoft.IoTOperations", + "crossLanguageDefinitionId": "Microsoft.IoTOperations.DataflowEndpointAuthenticationX509", + "usage": "Input,Output,Json,LroInitial,LroFinalEnvelope", + "doc": "DataflowEndpoint Authentication X509 properties", + "decorators": [], + "properties": [ + { + "$id": "528", + "kind": "property", + "name": "secretRef", + "serializedName": "secretRef", + "doc": "Secret reference of the X.509 certificate.", + "type": { + "$id": "529", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.IoTOperations.DataflowEndpointAuthenticationX509.secretRef", + "serializationOptions": { + "$id": "530", + "json": { + "$id": "531", + "name": "secretRef" + } + } + } + ] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.IoTOperations.DataflowEndpointKafkaAuthentication.x509CertificateSettings", + "serializationOptions": { + "$id": "532", + "json": { + "$id": "533", + "name": "x509CertificateSettings" + } + } + } + ] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.IoTOperations.DataflowEndpointKafka.authentication", + "serializationOptions": { + "$id": "534", + "json": { + "$id": "535", + "name": "authentication" + } + } + }, + { + "$id": "536", + "kind": "property", + "name": "consumerGroupId", + "serializedName": "consumerGroupId", + "doc": "Consumer group ID.", + "type": { + "$id": "537", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.IoTOperations.DataflowEndpointKafka.consumerGroupId", + "serializationOptions": { + "$id": "538", + "json": { + "$id": "539", + "name": "consumerGroupId" + } + } + }, + { + "$id": "540", + "kind": "property", + "name": "host", + "serializedName": "host", + "doc": "Kafka endpoint host.", + "type": { + "$id": "541", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.IoTOperations.DataflowEndpointKafka.host", + "serializationOptions": { + "$id": "542", + "json": { + "$id": "543", + "name": "host" + } + } + }, + { + "$id": "544", + "kind": "property", + "name": "batching", + "serializedName": "batching", + "doc": "Batching configuration.", + "type": { + "$id": "545", + "kind": "model", + "name": "DataflowEndpointKafkaBatching", + "clientNamespace": "Microsoft.IoTOperations", + "crossLanguageDefinitionId": "Microsoft.IoTOperations.DataflowEndpointKafkaBatching", + "usage": "Input,Output,Json,LroInitial,LroFinalEnvelope", + "doc": "Kafka endpoint Batching properties", + "decorators": [], + "properties": [ + { + "$id": "546", + "kind": "property", + "name": "mode", + "serializedName": "mode", + "doc": "Mode for batching.", + "type": { + "$ref": "62" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.IoTOperations.DataflowEndpointKafkaBatching.mode", + "serializationOptions": { + "$id": "547", + "json": { + "$id": "548", + "name": "mode" + } + } + }, + { + "$id": "549", + "kind": "property", + "name": "latencyMs", + "serializedName": "latencyMs", + "doc": "Batching latency in milliseconds.", + "type": { + "$id": "550", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.IoTOperations.DataflowEndpointKafkaBatching.latencyMs", + "serializationOptions": { + "$id": "551", + "json": { + "$id": "552", + "name": "latencyMs" + } + } + }, + { + "$id": "553", + "kind": "property", + "name": "maxBytes", + "serializedName": "maxBytes", + "doc": "Maximum number of bytes in a batch.", + "type": { + "$id": "554", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.IoTOperations.DataflowEndpointKafkaBatching.maxBytes", + "serializationOptions": { + "$id": "555", + "json": { + "$id": "556", + "name": "maxBytes" + } + } + }, + { + "$id": "557", + "kind": "property", + "name": "maxMessages", + "serializedName": "maxMessages", + "doc": "Maximum number of messages in a batch.", + "type": { + "$id": "558", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.IoTOperations.DataflowEndpointKafkaBatching.maxMessages", + "serializationOptions": { + "$id": "559", + "json": { + "$id": "560", + "name": "maxMessages" + } + } + } + ] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.IoTOperations.DataflowEndpointKafka.batching", + "serializationOptions": { + "$id": "561", + "json": { + "$id": "562", + "name": "batching" + } + } + }, + { + "$id": "563", + "kind": "property", + "name": "copyMqttProperties", + "serializedName": "copyMqttProperties", + "doc": "Copy Broker properties. No effect if the endpoint is used as a source or if the dataflow doesn't have an Broker source.", + "type": { + "$ref": "62" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.IoTOperations.DataflowEndpointKafka.copyMqttProperties", + "serializationOptions": { + "$id": "564", + "json": { + "$id": "565", + "name": "copyMqttProperties" + } + } + }, + { + "$id": "566", + "kind": "property", + "name": "compression", + "serializedName": "compression", + "doc": "Compression. Can be none, gzip, lz4, or snappy. No effect if the endpoint is used as a source.", + "type": { + "$ref": "68" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.IoTOperations.DataflowEndpointKafka.compression", + "serializationOptions": { + "$id": "567", + "json": { + "$id": "568", + "name": "compression" + } + } + }, + { + "$id": "569", + "kind": "property", + "name": "kafkaAcks", + "serializedName": "kafkaAcks", + "doc": "Kafka acks. Can be all, one, or zero. No effect if the endpoint is used as a source.", + "type": { + "$ref": "78" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.IoTOperations.DataflowEndpointKafka.kafkaAcks", + "serializationOptions": { + "$id": "570", + "json": { + "$id": "571", + "name": "kafkaAcks" + } + } + }, + { + "$id": "572", + "kind": "property", + "name": "partitionStrategy", + "serializedName": "partitionStrategy", + "doc": "Partition handling strategy. Can be default or static. No effect if the endpoint is used as a source.", + "type": { + "$ref": "86" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.IoTOperations.DataflowEndpointKafka.partitionStrategy", + "serializationOptions": { + "$id": "573", + "json": { + "$id": "574", + "name": "partitionStrategy" + } + } + }, + { + "$id": "575", + "kind": "property", + "name": "tls", + "serializedName": "tls", + "doc": "TLS configuration.", + "type": { + "$id": "576", + "kind": "model", + "name": "IotOperationsTlsProperties", + "clientNamespace": "Microsoft.IoTOperations", + "crossLanguageDefinitionId": "Microsoft.IoTOperations.TlsProperties", + "usage": "Input,Output,Json,LroInitial,LroFinalEnvelope", + "doc": "Tls properties", + "decorators": [], + "properties": [ + { + "$id": "577", + "kind": "property", + "name": "mode", + "serializedName": "mode", + "doc": "Mode for TLS.", + "type": { + "$ref": "62" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.IoTOperations.TlsProperties.mode", + "serializationOptions": { + "$id": "578", + "json": { + "$id": "579", + "name": "mode" + } + } + }, + { + "$id": "580", + "kind": "property", + "name": "trustedCaCertificateConfigMapRef", + "serializedName": "trustedCaCertificateConfigMapRef", + "doc": "Trusted CA certificate config map.", + "type": { + "$id": "581", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.IoTOperations.TlsProperties.trustedCaCertificateConfigMapRef", + "serializationOptions": { + "$id": "582", + "json": { + "$id": "583", + "name": "trustedCaCertificateConfigMapRef" + } + } + } + ] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.IoTOperations.DataflowEndpointKafka.tls", + "serializationOptions": { + "$id": "584", + "json": { + "$id": "585", + "name": "tls" + } + } + }, + { + "$id": "586", + "kind": "property", + "name": "cloudEventAttributes", + "serializedName": "cloudEventAttributes", + "doc": "Cloud event mapping config.", + "type": { + "$ref": "96" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.IoTOperations.DataflowEndpointKafka.cloudEventAttributes", + "serializationOptions": { + "$id": "587", + "json": { + "$id": "588", + "name": "cloudEventAttributes" + } + } + } + ] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.IoTOperations.DataflowEndpointProperties.kafkaSettings", + "serializationOptions": { + "$id": "589", + "json": { + "$id": "590", + "name": "kafkaSettings" + } + } + }, + { + "$id": "591", + "kind": "property", + "name": "localStorageSettings", + "serializedName": "localStorageSettings", + "doc": "Local persistent volume endpoint.", + "type": { + "$id": "592", + "kind": "model", + "name": "DataflowEndpointLocalStorage", + "clientNamespace": "Microsoft.IoTOperations", + "crossLanguageDefinitionId": "Microsoft.IoTOperations.DataflowEndpointLocalStorage", + "usage": "Input,Output,Json,LroInitial,LroFinalEnvelope", + "doc": "Local persistent volume endpoint properties", + "decorators": [], + "properties": [ + { + "$id": "593", + "kind": "property", + "name": "persistentVolumeClaimRef", + "serializedName": "persistentVolumeClaimRef", + "doc": "Persistent volume claim name.", + "type": { + "$id": "594", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.IoTOperations.DataflowEndpointLocalStorage.persistentVolumeClaimRef", + "serializationOptions": { + "$id": "595", + "json": { + "$id": "596", + "name": "persistentVolumeClaimRef" + } + } + } + ] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.IoTOperations.DataflowEndpointProperties.localStorageSettings", + "serializationOptions": { + "$id": "597", + "json": { + "$id": "598", + "name": "localStorageSettings" + } + } + }, + { + "$id": "599", + "kind": "property", + "name": "mqttSettings", + "serializedName": "mqttSettings", + "doc": "Broker endpoint.", + "type": { + "$id": "600", + "kind": "model", + "name": "DataflowEndpointMqtt", + "clientNamespace": "Microsoft.IoTOperations", + "crossLanguageDefinitionId": "Microsoft.IoTOperations.DataflowEndpointMqtt", + "usage": "Input,Output,Json,LroInitial,LroFinalEnvelope", + "doc": "Broker endpoint properties", + "decorators": [], + "properties": [ + { + "$id": "601", + "kind": "property", + "name": "authentication", + "serializedName": "authentication", + "doc": "authentication properties. DEFAULT: kubernetes.audience=aio-internal. NOTE - Enum field only property is allowed", + "type": { + "$id": "602", + "kind": "model", + "name": "DataflowEndpointMqttAuthentication", + "clientNamespace": "Microsoft.IoTOperations", + "crossLanguageDefinitionId": "Microsoft.IoTOperations.DataflowEndpointMqttAuthentication", + "usage": "Input,Output,Json,LroInitial,LroFinalEnvelope", + "doc": "Mqtt endpoint Authentication properties. NOTE - only authentication property is allowed per entry.", + "decorators": [], + "properties": [ + { + "$id": "603", + "kind": "property", + "name": "method", + "serializedName": "method", + "doc": "Mode of Authentication.", + "type": { + "$ref": "102" + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.IoTOperations.DataflowEndpointMqttAuthentication.method", + "serializationOptions": { + "$id": "604", + "json": { + "$id": "605", + "name": "method" + } + } + }, + { + "$id": "606", + "kind": "property", + "name": "systemAssignedManagedIdentitySettings", + "serializedName": "systemAssignedManagedIdentitySettings", + "doc": "System-assigned managed identity authentication.", + "type": { + "$ref": "384" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.IoTOperations.DataflowEndpointMqttAuthentication.systemAssignedManagedIdentitySettings", + "serializationOptions": { + "$id": "607", + "json": { + "$id": "608", + "name": "systemAssignedManagedIdentitySettings" + } + } + }, + { + "$id": "609", + "kind": "property", + "name": "userAssignedManagedIdentitySettings", + "serializedName": "userAssignedManagedIdentitySettings", + "doc": "User-assigned managed identity authentication.", + "type": { + "$ref": "392" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.IoTOperations.DataflowEndpointMqttAuthentication.userAssignedManagedIdentitySettings", + "serializationOptions": { + "$id": "610", + "json": { + "$id": "611", + "name": "userAssignedManagedIdentitySettings" + } + } + }, + { + "$id": "612", + "kind": "property", + "name": "serviceAccountTokenSettings", + "serializedName": "serviceAccountTokenSettings", + "doc": "Kubernetes service account token authentication. Default audience if not set is aio-internal", + "type": { + "$id": "613", + "kind": "model", + "name": "DataflowEndpointAuthenticationServiceAccountToken", + "clientNamespace": "Microsoft.IoTOperations", + "crossLanguageDefinitionId": "Microsoft.IoTOperations.DataflowEndpointAuthenticationServiceAccountToken", + "usage": "Input,Output,Json,LroInitial,LroFinalEnvelope", + "doc": "Service Account Token for BrokerAuthentication", + "decorators": [], + "properties": [ + { + "$id": "614", + "kind": "property", + "name": "audience", + "serializedName": "audience", + "doc": "Audience of the service account. Optional, defaults to the broker internal service account audience.", + "type": { + "$id": "615", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.IoTOperations.DataflowEndpointAuthenticationServiceAccountToken.audience", + "serializationOptions": { + "$id": "616", + "json": { + "$id": "617", + "name": "audience" + } + } + } + ] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.IoTOperations.DataflowEndpointMqttAuthentication.serviceAccountTokenSettings", + "serializationOptions": { + "$id": "618", + "json": { + "$id": "619", + "name": "serviceAccountTokenSettings" + } + } + }, + { + "$id": "620", + "kind": "property", + "name": "x509CertificateSettings", + "serializedName": "x509CertificateSettings", + "doc": "X.509 certificate authentication.", + "type": { + "$ref": "527" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.IoTOperations.DataflowEndpointMqttAuthentication.x509CertificateSettings", + "serializationOptions": { + "$id": "621", + "json": { + "$id": "622", + "name": "x509CertificateSettings" + } + } + } + ] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.IoTOperations.DataflowEndpointMqtt.authentication", + "serializationOptions": { + "$id": "623", + "json": { + "$id": "624", + "name": "authentication" + } + } + }, + { + "$id": "625", + "kind": "property", + "name": "clientIdPrefix", + "serializedName": "clientIdPrefix", + "doc": "Client ID prefix. Client ID generated by the dataflow is -TBD. Optional; no prefix if omitted.", + "type": { + "$id": "626", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.IoTOperations.DataflowEndpointMqtt.clientIdPrefix", + "serializationOptions": { + "$id": "627", + "json": { + "$id": "628", + "name": "clientIdPrefix" + } + } + }, + { + "$id": "629", + "kind": "property", + "name": "host", + "serializedName": "host", + "doc": "Host of the Broker in the form of :. Optional; connects to Broker if omitted.", + "type": { + "$id": "630", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.IoTOperations.DataflowEndpointMqtt.host", + "serializationOptions": { + "$id": "631", + "json": { + "$id": "632", + "name": "host" + } + } + }, + { + "$id": "633", + "kind": "property", + "name": "protocol", + "serializedName": "protocol", + "doc": "Enable or disable websockets.", + "type": { + "$ref": "114" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.IoTOperations.DataflowEndpointMqtt.protocol", + "serializationOptions": { + "$id": "634", + "json": { + "$id": "635", + "name": "protocol" + } + } + }, + { + "$id": "636", + "kind": "property", + "name": "keepAliveSeconds", + "serializedName": "keepAliveSeconds", + "doc": "Broker KeepAlive for connection in seconds.", + "type": { + "$id": "637", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.IoTOperations.DataflowEndpointMqtt.keepAliveSeconds", + "serializationOptions": { + "$id": "638", + "json": { + "$id": "639", + "name": "keepAliveSeconds" + } + } + }, + { + "$id": "640", + "kind": "property", + "name": "retain", + "serializedName": "retain", + "doc": "Whether or not to keep the retain setting.", + "type": { + "$ref": "120" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.IoTOperations.DataflowEndpointMqtt.retain", + "serializationOptions": { + "$id": "641", + "json": { + "$id": "642", + "name": "retain" + } + } + }, + { + "$id": "643", + "kind": "property", + "name": "maxInflightMessages", + "serializedName": "maxInflightMessages", + "doc": "The max number of messages to keep in flight. For subscribe, this is the receive maximum. For publish, this is the maximum number of messages to send before waiting for an ack.", + "type": { + "$id": "644", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.IoTOperations.DataflowEndpointMqtt.maxInflightMessages", + "serializationOptions": { + "$id": "645", + "json": { + "$id": "646", + "name": "maxInflightMessages" + } + } + }, + { + "$id": "647", + "kind": "property", + "name": "qos", + "serializedName": "qos", + "doc": "Qos for Broker connection.", + "type": { + "$id": "648", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.IoTOperations.DataflowEndpointMqtt.qos", + "serializationOptions": { + "$id": "649", + "json": { + "$id": "650", + "name": "qos" + } + } + }, + { + "$id": "651", + "kind": "property", + "name": "sessionExpirySeconds", + "serializedName": "sessionExpirySeconds", + "doc": "Session expiry in seconds.", + "type": { + "$id": "652", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.IoTOperations.DataflowEndpointMqtt.sessionExpirySeconds", + "serializationOptions": { + "$id": "653", + "json": { + "$id": "654", + "name": "sessionExpirySeconds" + } + } + }, + { + "$id": "655", + "kind": "property", + "name": "tls", + "serializedName": "tls", + "doc": "TLS configuration.", + "type": { + "$ref": "576" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.IoTOperations.DataflowEndpointMqtt.tls", + "serializationOptions": { + "$id": "656", + "json": { + "$id": "657", + "name": "tls" + } + } + }, + { + "$id": "658", + "kind": "property", + "name": "cloudEventAttributes", + "serializedName": "cloudEventAttributes", + "doc": "Cloud event mapping config.", + "type": { + "$ref": "96" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.IoTOperations.DataflowEndpointMqtt.cloudEventAttributes", + "serializationOptions": { + "$id": "659", + "json": { + "$id": "660", + "name": "cloudEventAttributes" + } + } + } + ] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.IoTOperations.DataflowEndpointProperties.mqttSettings", + "serializationOptions": { + "$id": "661", + "json": { + "$id": "662", + "name": "mqttSettings" + } + } + }, + { + "$id": "663", + "kind": "property", + "name": "provisioningState", + "serializedName": "provisioningState", + "doc": "The status of the last operation.", + "type": { + "$ref": "126" + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.IoTOperations.DataflowEndpointProperties.provisioningState", + "serializationOptions": { + "$id": "664", + "json": { + "$id": "665", + "name": "provisioningState" + } + } + } + ] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.IoTOperations.DataflowEndpointResource.properties", + "serializationOptions": { + "$id": "666", + "json": { + "$id": "667", + "name": "properties" + } + } + }, + { + "$id": "668", + "kind": "property", + "name": "extendedLocation", + "serializedName": "extendedLocation", + "doc": "Edge location of the resource.", + "type": { + "$id": "669", + "kind": "model", + "name": "IotOperationsExtendedLocation", + "clientNamespace": "Microsoft.IoTOperations", + "crossLanguageDefinitionId": "Microsoft.IoTOperations.ExtendedLocation", + "usage": "Input,Output,Json,LroInitial,LroFinalEnvelope", + "doc": "Extended location is an extension of Azure locations. They provide a way to use their Azure ARC enabled Kubernetes clusters as target locations for deploying Azure services instances.", + "decorators": [], + "properties": [ + { + "$id": "670", + "kind": "property", + "name": "name", + "serializedName": "name", + "doc": "The name of the extended location.", + "type": { + "$id": "671", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.IoTOperations.ExtendedLocation.name", + "serializationOptions": { + "$id": "672", + "json": { + "$id": "673", + "name": "name" + } + } + }, + { + "$id": "674", + "kind": "property", + "name": "type", + "serializedName": "type", + "doc": "Type of ExtendedLocation.", + "type": { + "$ref": "142" + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.IoTOperations.ExtendedLocation.type", + "serializationOptions": { + "$id": "675", + "json": { + "$id": "676", + "name": "type" + } + } + } + ] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.IoTOperations.DataflowEndpointResource.extendedLocation", + "serializationOptions": { + "$id": "677", + "json": { + "$id": "678", + "name": "extendedLocation" + } + } + } + ] + }, + { + "$ref": "372" + }, + { + "$ref": "377" + }, + { + "$ref": "379" + }, + { + "$ref": "384" + }, + { + "$ref": "392" + }, + { + "$ref": "418" + }, + { + "$ref": "432" + }, + { + "$ref": "434" + }, + { + "$ref": "439" + }, + { + "$ref": "464" + }, + { + "$ref": "466" + }, + { + "$ref": "479" + }, + { + "$ref": "503" + }, + { + "$ref": "505" + }, + { + "$ref": "516" + }, + { + "$ref": "527" + }, + { + "$ref": "545" + }, + { + "$ref": "576" + }, + { + "$ref": "592" + }, + { + "$ref": "600" + }, + { + "$ref": "602" + }, + { + "$ref": "613" + }, + { + "$ref": "669" + }, + { + "$ref": "327" + }, + { + "$ref": "328" + }, + { + "$ref": "344" + }, + { + "$id": "679", + "kind": "model", + "name": "ErrorResponse", + "clientNamespace": "Azure.ResourceManager.CommonTypes", + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.ErrorResponse", + "usage": "Error,Json,Exception", + "doc": "Common error response for all Azure Resource Manager APIs to return error details for failed operations.", + "decorators": [], + "properties": [ + { + "$id": "680", + "kind": "property", + "name": "error", + "serializedName": "error", + "doc": "The error object.", + "type": { + "$id": "681", + "kind": "model", + "name": "ErrorDetail", + "clientNamespace": "Azure.ResourceManager.CommonTypes", + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.ErrorDetail", + "usage": "Json,Exception,LroPolling", + "doc": "The error detail.", + "decorators": [], + "properties": [ + { + "$id": "682", + "kind": "property", + "name": "code", + "serializedName": "code", + "doc": "The error code.", + "type": { + "$id": "683", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.ErrorDetail.code", + "serializationOptions": { + "$id": "684", + "json": { + "$id": "685", + "name": "code" + } + } + }, + { + "$id": "686", + "kind": "property", + "name": "message", + "serializedName": "message", + "doc": "The error message.", + "type": { + "$id": "687", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.ErrorDetail.message", + "serializationOptions": { + "$id": "688", + "json": { + "$id": "689", + "name": "message" + } + } + }, + { + "$id": "690", + "kind": "property", + "name": "target", + "serializedName": "target", + "doc": "The error target.", + "type": { + "$id": "691", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.ErrorDetail.target", + "serializationOptions": { + "$id": "692", + "json": { + "$id": "693", + "name": "target" + } + } + }, + { + "$id": "694", + "kind": "property", + "name": "details", + "serializedName": "details", + "doc": "The error details.", + "type": { + "$id": "695", + "kind": "array", + "name": "ArrayErrorDetail", + "valueType": { + "$ref": "681" + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.ErrorDetail.details", + "serializationOptions": { + "$id": "696", + "json": { + "$id": "697", + "name": "details" + } + } + }, + { + "$id": "698", + "kind": "property", + "name": "additionalInfo", + "serializedName": "additionalInfo", + "doc": "The error additional info.", + "type": { + "$id": "699", + "kind": "array", + "name": "ArrayErrorAdditionalInfo", + "valueType": { + "$id": "700", + "kind": "model", + "name": "ErrorAdditionalInfo", + "clientNamespace": "Azure.ResourceManager.CommonTypes", + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.ErrorAdditionalInfo", + "usage": "Json,Exception,LroPolling", + "doc": "The resource management error additional info.", + "decorators": [], + "properties": [ + { + "$id": "701", + "kind": "property", + "name": "type", + "serializedName": "type", + "doc": "The additional info type.", + "type": { + "$id": "702", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.ErrorAdditionalInfo.type", + "serializationOptions": { + "$id": "703", + "json": { + "$id": "704", + "name": "type" + } + } + }, + { + "$id": "705", + "kind": "property", + "name": "info", + "serializedName": "info", + "doc": "The additional info.", + "type": { + "$id": "706", + "kind": "model", + "name": "ErrorAdditionalInfoInfo", + "clientNamespace": "Azure.ResourceManager.CommonTypes", + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.ErrorAdditionalInfo.info.anonymous", + "usage": "Json,Exception,LroPolling", + "decorators": [], + "properties": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.ErrorAdditionalInfo.info", + "serializationOptions": { + "$id": "707", + "json": { + "$id": "708", + "name": "info" + } + } + } + ] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.ErrorDetail.additionalInfo", + "serializationOptions": { + "$id": "709", + "json": { + "$id": "710", + "name": "additionalInfo" + } + } + } + ] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.ErrorResponse.error", + "serializationOptions": { + "$id": "711", + "json": { + "$id": "712", + "name": "error" + } + } + } + ] + }, + { + "$ref": "681" + }, + { + "$ref": "700" + }, + { + "$ref": "706" + }, + { + "$id": "713", + "kind": "model", + "name": "ArmOperationStatusResourceProvisioningState", + "clientNamespace": "Azure.ResourceManager", + "crossLanguageDefinitionId": "Azure.ResourceManager.ArmOperationStatus", + "usage": "LroPolling", + "doc": "Standard Azure Resource Manager operation status response", + "decorators": [], + "properties": [ + { + "$id": "714", + "kind": "property", + "name": "status", + "serializedName": "status", + "doc": "The operation status", + "type": { + "$ref": "156" + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.ArmOperationStatus.status", + "serializationOptions": { + "$id": "715", + "json": { + "$id": "716", + "name": "status" + } + } + }, + { + "$id": "717", + "kind": "property", + "name": "name", + "serializedName": "name", + "doc": "The name of the operationStatus resource", + "type": { + "$id": "718", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.ArmOperationStatus.name", + "serializationOptions": { + "$id": "719", + "json": { + "$id": "720", + "name": "name" + } + } + }, + { + "$id": "721", + "kind": "property", + "name": "startTime", + "serializedName": "startTime", + "doc": "Operation start time", + "type": { + "$id": "722", + "kind": "utcDateTime", + "name": "utcDateTime", + "encode": "rfc3339", + "wireType": { + "$id": "723", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.utcDateTime", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.ArmOperationStatus.startTime", + "serializationOptions": { + "$id": "724", + "json": { + "$id": "725", + "name": "startTime" + } + } + }, + { + "$id": "726", + "kind": "property", + "name": "endTime", + "serializedName": "endTime", + "doc": "Operation complete time", + "type": { + "$id": "727", + "kind": "utcDateTime", + "name": "utcDateTime", + "encode": "rfc3339", + "wireType": { + "$id": "728", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.utcDateTime", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.ArmOperationStatus.endTime", + "serializationOptions": { + "$id": "729", + "json": { + "$id": "730", + "name": "endTime" + } + } + }, + { + "$id": "731", + "kind": "property", + "name": "percentComplete", + "serializedName": "percentComplete", + "doc": "The progress made toward completing the operation", + "type": { + "$id": "732", + "kind": "float64", + "name": "float64", + "crossLanguageDefinitionId": "TypeSpec.float64", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.ArmOperationStatus.percentComplete", + "serializationOptions": { + "$id": "733", + "json": { + "$id": "734", + "name": "percentComplete" + } + } + }, + { + "$id": "735", + "kind": "property", + "name": "error", + "serializedName": "error", + "doc": "Errors that occurred if the operation ended with Canceled or Failed status", + "type": { + "$ref": "681" + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.ArmOperationStatus.error", + "serializationOptions": { + "$id": "736", + "json": { + "$id": "737", + "name": "error" + } + } + } + ] + }, + { + "$id": "738", + "kind": "model", + "name": "DataflowEndpointResourceListResult", + "clientNamespace": "Azure.ResourceManager", + "crossLanguageDefinitionId": "Azure.ResourceManager.ResourceListResult", + "usage": "Output,Json", + "doc": "The response of a DataflowEndpointResource list operation.", + "decorators": [], + "properties": [ + { + "$id": "739", + "kind": "property", + "name": "value", + "serializedName": "value", + "doc": "The DataflowEndpointResource items on this page", + "type": { + "$id": "740", + "kind": "array", + "name": "ArrayDataflowEndpointResource", + "valueType": { + "$ref": "326" + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.ResourceListResult.value", + "serializationOptions": { + "$id": "741", + "json": { + "$id": "742", + "name": "value" + } + } + }, + { + "$id": "743", + "kind": "property", + "name": "nextLink", + "serializedName": "nextLink", + "doc": "The link to the next page of items", + "type": { + "$id": "744", + "kind": "url", + "name": "ResourceLocation", + "crossLanguageDefinitionId": "TypeSpec.Rest.ResourceLocation", + "baseType": { + "$id": "745", + "kind": "url", + "name": "url", + "crossLanguageDefinitionId": "TypeSpec.url", + "decorators": [] + }, + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.ResourceListResult.nextLink", + "serializationOptions": { + "$id": "746", + "json": { + "$id": "747", + "name": "nextLink" + } + } + } + ] + }, + { + "$id": "748", + "kind": "model", + "name": "IotOperationsDataflow", + "clientNamespace": "Microsoft.IoTOperations", + "crossLanguageDefinitionId": "Microsoft.IoTOperations.DataflowResource", + "usage": "Input,Output,Json,LroInitial,LroFinalEnvelope", + "doc": "Instance dataflowProfile dataflow resource", + "decorators": [], + "baseModel": { + "$ref": "327" + }, + "properties": [ + { + "$id": "749", + "kind": "property", + "name": "properties", + "serializedName": "properties", + "doc": "The resource-specific properties for this resource.", + "type": { + "$id": "750", + "kind": "model", + "name": "IotOperationsDataflowProperties", + "clientNamespace": "Microsoft.IoTOperations", + "crossLanguageDefinitionId": "Microsoft.IoTOperations.DataflowProperties", + "usage": "Input,Output,Json,LroInitial,LroFinalEnvelope", + "doc": "Dataflow Resource properties", + "decorators": [], + "properties": [ + { + "$id": "751", + "kind": "property", + "name": "mode", + "serializedName": "mode", + "doc": "Mode for Dataflow. Optional; defaults to Enabled.", + "type": { + "$ref": "62" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.IoTOperations.DataflowProperties.mode", + "serializationOptions": { + "$id": "752", + "json": { + "$id": "753", + "name": "mode" + } + } + }, + { + "$id": "754", + "kind": "property", + "name": "operations", + "serializedName": "operations", + "doc": "List of operations including source and destination references as well as transformation.", + "type": { + "$id": "755", + "kind": "array", + "name": "ArrayDataflowOperation", + "valueType": { + "$id": "756", + "kind": "model", + "name": "DataflowOperationProperties", + "clientNamespace": "Microsoft.IoTOperations", + "crossLanguageDefinitionId": "Microsoft.IoTOperations.DataflowOperation", + "usage": "Input,Output,Json,LroInitial,LroFinalEnvelope", + "doc": "Dataflow Operation properties. NOTE - One only method is allowed to be used for one entry.", + "decorators": [], + "properties": [ + { + "$id": "757", + "kind": "property", + "name": "operationType", + "serializedName": "operationType", + "doc": "Type of operation.", + "type": { + "$ref": "164" + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.IoTOperations.DataflowOperation.operationType", + "serializationOptions": { + "$id": "758", + "json": { + "$id": "759", + "name": "operationType" + } + } + }, + { + "$id": "760", + "kind": "property", + "name": "name", + "serializedName": "name", + "doc": "Optional user provided name of the transformation.", + "type": { + "$id": "761", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.IoTOperations.DataflowOperation.name", + "serializationOptions": { + "$id": "762", + "json": { + "$id": "763", + "name": "name" + } + } + }, + { + "$id": "764", + "kind": "property", + "name": "sourceSettings", + "serializedName": "sourceSettings", + "doc": "Source configuration.", + "type": { + "$id": "765", + "kind": "model", + "name": "DataflowSourceOperationSettings", + "clientNamespace": "Microsoft.IoTOperations", + "crossLanguageDefinitionId": "Microsoft.IoTOperations.DataflowSourceOperationSettings", + "usage": "Input,Output,Json,LroInitial,LroFinalEnvelope", + "doc": "Dataflow Source Operation properties", + "decorators": [], + "properties": [ + { + "$id": "766", + "kind": "property", + "name": "endpointRef", + "serializedName": "endpointRef", + "doc": "Reference to the Dataflow Endpoint resource. Can only be of Broker and Kafka type.", + "type": { + "$id": "767", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.IoTOperations.DataflowSourceOperationSettings.endpointRef", + "serializationOptions": { + "$id": "768", + "json": { + "$id": "769", + "name": "endpointRef" + } + } + }, + { + "$id": "770", + "kind": "property", + "name": "assetRef", + "serializedName": "assetRef", + "doc": "Reference to the resource in Azure Device Registry where the data in the endpoint originates from.", + "type": { + "$id": "771", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.IoTOperations.DataflowSourceOperationSettings.assetRef", + "serializationOptions": { + "$id": "772", + "json": { + "$id": "773", + "name": "assetRef" + } + } + }, + { + "$id": "774", + "kind": "property", + "name": "serializationFormat", + "serializedName": "serializationFormat", + "doc": "Content is a JSON Schema. Allowed: JSON Schema/draft-7.", + "type": { + "$ref": "172" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.IoTOperations.DataflowSourceOperationSettings.serializationFormat", + "serializationOptions": { + "$id": "775", + "json": { + "$id": "776", + "name": "serializationFormat" + } + } + }, + { + "$id": "777", + "kind": "property", + "name": "schemaRef", + "serializedName": "schemaRef", + "doc": "Schema CR reference. Data will be deserialized according to the schema, and dropped if it doesn't match.", + "type": { + "$id": "778", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.IoTOperations.DataflowSourceOperationSettings.schemaRef", + "serializationOptions": { + "$id": "779", + "json": { + "$id": "780", + "name": "schemaRef" + } + } + }, + { + "$id": "781", + "kind": "property", + "name": "dataSources", + "serializedName": "dataSources", + "doc": "List of source locations. Can be Broker or Kafka topics. Supports wildcards # and +.", + "type": { + "$id": "782", + "kind": "array", + "name": "Array", + "valueType": { + "$id": "783", + "kind": "string", + "name": "NonEmptyString", + "crossLanguageDefinitionId": "Microsoft.IoTOperations.NonEmptyString", + "baseType": { + "$id": "784", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.IoTOperations.DataflowSourceOperationSettings.dataSources", + "serializationOptions": { + "$id": "785", + "json": { + "$id": "786", + "name": "dataSources" + } + } + } + ] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.IoTOperations.DataflowOperation.sourceSettings", + "serializationOptions": { + "$id": "787", + "json": { + "$id": "788", + "name": "sourceSettings" + } + } + }, + { + "$id": "789", + "kind": "property", + "name": "builtInTransformationSettings", + "serializedName": "builtInTransformationSettings", + "doc": "Built In Transformation configuration.", + "type": { + "$id": "790", + "kind": "model", + "name": "DataflowBuiltInTransformationSettings", + "clientNamespace": "Microsoft.IoTOperations", + "crossLanguageDefinitionId": "Microsoft.IoTOperations.DataflowBuiltInTransformationSettings", + "usage": "Input,Output,Json,LroInitial,LroFinalEnvelope", + "doc": "Dataflow BuiltIn Transformation properties", + "decorators": [], + "properties": [ + { + "$id": "791", + "kind": "property", + "name": "serializationFormat", + "serializedName": "serializationFormat", + "doc": "Serialization format. Optional; defaults to JSON. Allowed value JSON Schema/draft-7, Parquet. Default: Json", + "type": { + "$ref": "176" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.IoTOperations.DataflowBuiltInTransformationSettings.serializationFormat", + "serializationOptions": { + "$id": "792", + "json": { + "$id": "793", + "name": "serializationFormat" + } + } + }, + { + "$id": "794", + "kind": "property", + "name": "schemaRef", + "serializedName": "schemaRef", + "doc": "Reference to the schema that describes the output of the transformation.", + "type": { + "$id": "795", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.IoTOperations.DataflowBuiltInTransformationSettings.schemaRef", + "serializationOptions": { + "$id": "796", + "json": { + "$id": "797", + "name": "schemaRef" + } + } + }, + { + "$id": "798", + "kind": "property", + "name": "datasets", + "serializedName": "datasets", + "doc": "Enrich data from Broker State Store. Dataset references a key in Broker State Store.", + "type": { + "$id": "799", + "kind": "array", + "name": "ArrayDataflowBuiltInTransformationDataset", + "valueType": { + "$id": "800", + "kind": "model", + "name": "DataflowBuiltInTransformationDataset", + "clientNamespace": "Microsoft.IoTOperations", + "crossLanguageDefinitionId": "Microsoft.IoTOperations.DataflowBuiltInTransformationDataset", + "usage": "Input,Output,Json,LroInitial,LroFinalEnvelope", + "doc": "Dataflow BuiltIn Transformation dataset properties", + "decorators": [], + "properties": [ + { + "$id": "801", + "kind": "property", + "name": "key", + "serializedName": "key", + "doc": "The key of the dataset.", + "type": { + "$id": "802", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.IoTOperations.DataflowBuiltInTransformationDataset.key", + "serializationOptions": { + "$id": "803", + "json": { + "$id": "804", + "name": "key" + } + } + }, + { + "$id": "805", + "kind": "property", + "name": "description", + "serializedName": "description", + "doc": "A user provided optional description of the dataset.", + "type": { + "$id": "806", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.IoTOperations.DataflowBuiltInTransformationDataset.description", + "serializationOptions": { + "$id": "807", + "json": { + "$id": "808", + "name": "description" + } + } + }, + { + "$id": "809", + "kind": "property", + "name": "schemaRef", + "serializedName": "schemaRef", + "doc": "The reference to the schema that describes the dataset. Allowed: JSON Schema/draft-7.", + "type": { + "$id": "810", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.IoTOperations.DataflowBuiltInTransformationDataset.schemaRef", + "serializationOptions": { + "$id": "811", + "json": { + "$id": "812", + "name": "schemaRef" + } + } + }, + { + "$id": "813", + "kind": "property", + "name": "inputs", + "serializedName": "inputs", + "doc": "List of fields for enriching from the Broker State Store.", + "type": { + "$id": "814", + "kind": "array", + "name": "Array", + "valueType": { + "$id": "815", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.IoTOperations.DataflowBuiltInTransformationDataset.inputs", + "serializationOptions": { + "$id": "816", + "json": { + "$id": "817", + "name": "inputs" + } + } + }, + { + "$id": "818", + "kind": "property", + "name": "expression", + "serializedName": "expression", + "doc": "Condition to enrich data from Broker State Store. Example: $1 < 0 || $1 > $2 (Assuming inputs section $1 and $2 are provided)", + "type": { + "$id": "819", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.IoTOperations.DataflowBuiltInTransformationDataset.expression", + "serializationOptions": { + "$id": "820", + "json": { + "$id": "821", + "name": "expression" + } + } + } + ] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.IoTOperations.DataflowBuiltInTransformationSettings.datasets", + "serializationOptions": { + "$id": "822", + "json": { + "$id": "823", + "name": "datasets" + } + } + }, + { + "$id": "824", + "kind": "property", + "name": "filter", + "serializedName": "filter", + "doc": "Filters input record or datapoints based on condition.", + "type": { + "$id": "825", + "kind": "array", + "name": "ArrayDataflowBuiltInTransformationFilter", + "valueType": { + "$id": "826", + "kind": "model", + "name": "DataflowBuiltInTransformationFilter", + "clientNamespace": "Microsoft.IoTOperations", + "crossLanguageDefinitionId": "Microsoft.IoTOperations.DataflowBuiltInTransformationFilter", + "usage": "Input,Output,Json,LroInitial,LroFinalEnvelope", + "doc": "Dataflow BuiltIn Transformation filter properties", + "decorators": [], + "properties": [ + { + "$id": "827", + "kind": "property", + "name": "type", + "serializedName": "type", + "doc": "The type of dataflow operation.", + "type": { + "$ref": "184" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.IoTOperations.DataflowBuiltInTransformationFilter.type", + "serializationOptions": { + "$id": "828", + "json": { + "$id": "829", + "name": "type" + } + } + }, + { + "$id": "830", + "kind": "property", + "name": "description", + "serializedName": "description", + "doc": "A user provided optional description of the filter.", + "type": { + "$id": "831", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.IoTOperations.DataflowBuiltInTransformationFilter.description", + "serializationOptions": { + "$id": "832", + "json": { + "$id": "833", + "name": "description" + } + } + }, + { + "$id": "834", + "kind": "property", + "name": "inputs", + "serializedName": "inputs", + "doc": "List of fields for filtering in JSON path expression.", + "type": { + "$id": "835", + "kind": "array", + "name": "Array", + "valueType": { + "$id": "836", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.IoTOperations.DataflowBuiltInTransformationFilter.inputs", + "serializationOptions": { + "$id": "837", + "json": { + "$id": "838", + "name": "inputs" + } + } + }, + { + "$id": "839", + "kind": "property", + "name": "expression", + "serializedName": "expression", + "doc": "Condition to filter data. Can reference input fields with {n} where n is the index of the input field starting from 1. Example: $1 < 0 || $1 > $2 (Assuming inputs section $1 and $2 are provided)", + "type": { + "$id": "840", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.IoTOperations.DataflowBuiltInTransformationFilter.expression", + "serializationOptions": { + "$id": "841", + "json": { + "$id": "842", + "name": "expression" + } + } + } + ] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.IoTOperations.DataflowBuiltInTransformationSettings.filter", + "serializationOptions": { + "$id": "843", + "json": { + "$id": "844", + "name": "filter" + } + } + }, + { + "$id": "845", + "kind": "property", + "name": "map", + "serializedName": "map", + "doc": "Maps input to output message.", + "type": { + "$id": "846", + "kind": "array", + "name": "ArrayDataflowBuiltInTransformationMap", + "valueType": { + "$id": "847", + "kind": "model", + "name": "DataflowBuiltInTransformationMap", + "clientNamespace": "Microsoft.IoTOperations", + "crossLanguageDefinitionId": "Microsoft.IoTOperations.DataflowBuiltInTransformationMap", + "usage": "Input,Output,Json,LroInitial,LroFinalEnvelope", + "doc": "Dataflow BuiltIn Transformation map properties", + "decorators": [], + "properties": [ + { + "$id": "848", + "kind": "property", + "name": "type", + "serializedName": "type", + "doc": "Type of transformation.", + "type": { + "$ref": "188" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.IoTOperations.DataflowBuiltInTransformationMap.type", + "serializationOptions": { + "$id": "849", + "json": { + "$id": "850", + "name": "type" + } + } + }, + { + "$id": "851", + "kind": "property", + "name": "description", + "serializedName": "description", + "doc": "A user provided optional description of the mapping function.", + "type": { + "$id": "852", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.IoTOperations.DataflowBuiltInTransformationMap.description", + "serializationOptions": { + "$id": "853", + "json": { + "$id": "854", + "name": "description" + } + } + }, + { + "$id": "855", + "kind": "property", + "name": "inputs", + "serializedName": "inputs", + "doc": "List of fields for mapping in JSON path expression.", + "type": { + "$id": "856", + "kind": "array", + "name": "Array", + "valueType": { + "$id": "857", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.IoTOperations.DataflowBuiltInTransformationMap.inputs", + "serializationOptions": { + "$id": "858", + "json": { + "$id": "859", + "name": "inputs" + } + } + }, + { + "$id": "860", + "kind": "property", + "name": "expression", + "serializedName": "expression", + "doc": "Modify the inputs field(s) to the final output field. Example: $1 * 2.2 (Assuming inputs section $1 is provided)", + "type": { + "$id": "861", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.IoTOperations.DataflowBuiltInTransformationMap.expression", + "serializationOptions": { + "$id": "862", + "json": { + "$id": "863", + "name": "expression" + } + } + }, + { + "$id": "864", + "kind": "property", + "name": "output", + "serializedName": "output", + "doc": "Where and how the input fields to be organized in the output record.", + "type": { + "$id": "865", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.IoTOperations.DataflowBuiltInTransformationMap.output", + "serializationOptions": { + "$id": "866", + "json": { + "$id": "867", + "name": "output" + } + } + } + ] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.IoTOperations.DataflowBuiltInTransformationSettings.map", + "serializationOptions": { + "$id": "868", + "json": { + "$id": "869", + "name": "map" + } + } + } + ] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.IoTOperations.DataflowOperation.builtInTransformationSettings", + "serializationOptions": { + "$id": "870", + "json": { + "$id": "871", + "name": "builtInTransformationSettings" + } + } + }, + { + "$id": "872", + "kind": "property", + "name": "destinationSettings", + "serializedName": "destinationSettings", + "doc": "Destination configuration.", + "type": { + "$id": "873", + "kind": "model", + "name": "DataflowDestinationOperationSettings", + "clientNamespace": "Microsoft.IoTOperations", + "crossLanguageDefinitionId": "Microsoft.IoTOperations.DataflowDestinationOperationSettings", + "usage": "Input,Output,Json,LroInitial,LroFinalEnvelope", + "doc": "Dataflow Destination Operation properties", + "decorators": [], + "properties": [ + { + "$id": "874", + "kind": "property", + "name": "endpointRef", + "serializedName": "endpointRef", + "doc": "Reference to the Endpoint CR. Can be of Broker, Kafka, Fabric, ADLS, ADX type.", + "type": { + "$id": "875", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.IoTOperations.DataflowDestinationOperationSettings.endpointRef", + "serializationOptions": { + "$id": "876", + "json": { + "$id": "877", + "name": "endpointRef" + } + } + }, + { + "$id": "878", + "kind": "property", + "name": "dataDestination", + "serializedName": "dataDestination", + "doc": "Destination location, can be a topic or table name. Supports dynamic values with $topic, $systemProperties, $userProperties, $payload, $context, and $subscription.", + "type": { + "$id": "879", + "kind": "string", + "name": "NonEmptyString", + "crossLanguageDefinitionId": "Microsoft.IoTOperations.NonEmptyString", + "baseType": { + "$id": "880", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.IoTOperations.DataflowDestinationOperationSettings.dataDestination", + "serializationOptions": { + "$id": "881", + "json": { + "$id": "882", + "name": "dataDestination" + } + } + } + ] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.IoTOperations.DataflowOperation.destinationSettings", + "serializationOptions": { + "$id": "883", + "json": { + "$id": "884", + "name": "destinationSettings" + } + } + } + ] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.IoTOperations.DataflowProperties.operations", + "serializationOptions": { + "$id": "885", + "json": { + "$id": "886", + "name": "operations" + } + } + }, + { + "$id": "887", + "kind": "property", + "name": "provisioningState", + "serializedName": "provisioningState", + "doc": "The status of the last operation.", + "type": { + "$ref": "126" + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.IoTOperations.DataflowProperties.provisioningState", + "serializationOptions": { + "$id": "888", + "json": { + "$id": "889", + "name": "provisioningState" + } + } + } + ] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.IoTOperations.DataflowResource.properties", + "serializationOptions": { + "$id": "890", + "json": { + "$id": "891", + "name": "properties" + } + } + }, + { + "$id": "892", + "kind": "property", + "name": "extendedLocation", + "serializedName": "extendedLocation", + "doc": "Edge location of the resource.", + "type": { + "$ref": "669" + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.IoTOperations.DataflowResource.extendedLocation", + "serializationOptions": { + "$id": "893", + "json": { + "$id": "894", + "name": "extendedLocation" + } + } + } + ] + }, + { + "$ref": "750" + }, + { + "$ref": "756" + }, + { + "$ref": "765" + }, + { + "$ref": "790" + }, + { + "$ref": "800" + }, + { + "$ref": "826" + }, + { + "$ref": "847" + }, + { + "$ref": "873" + }, + { + "$id": "895", + "kind": "model", + "name": "DataflowResourceListResult", + "clientNamespace": "Azure.ResourceManager", + "crossLanguageDefinitionId": "Azure.ResourceManager.ResourceListResult", + "usage": "Output,Json", + "doc": "The response of a DataflowResource list operation.", + "decorators": [], + "properties": [ + { + "$id": "896", + "kind": "property", + "name": "value", + "serializedName": "value", + "doc": "The DataflowResource items on this page", + "type": { + "$id": "897", + "kind": "array", + "name": "ArrayDataflowResource", + "valueType": { + "$ref": "748" + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.ResourceListResult.value", + "serializationOptions": { + "$id": "898", + "json": { + "$id": "899", + "name": "value" + } + } + }, + { + "$id": "900", + "kind": "property", + "name": "nextLink", + "serializedName": "nextLink", + "doc": "The link to the next page of items", + "type": { + "$id": "901", + "kind": "url", + "name": "ResourceLocation", + "crossLanguageDefinitionId": "TypeSpec.Rest.ResourceLocation", + "baseType": { + "$id": "902", + "kind": "url", + "name": "url", + "crossLanguageDefinitionId": "TypeSpec.url", + "decorators": [] + }, + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.ResourceListResult.nextLink", + "serializationOptions": { + "$id": "903", + "json": { + "$id": "904", + "name": "nextLink" + } + } + } + ] + }, + { + "$id": "905", + "kind": "model", + "name": "IotOperationsDataflowProfile", + "clientNamespace": "Microsoft.IoTOperations", + "crossLanguageDefinitionId": "Microsoft.IoTOperations.DataflowProfileResource", + "usage": "Input,Output,Json,LroInitial,LroFinalEnvelope", + "doc": "Instance dataflowProfile resource", + "decorators": [], + "baseModel": { + "$ref": "327" + }, + "properties": [ + { + "$id": "906", + "kind": "property", + "name": "properties", + "serializedName": "properties", + "doc": "The resource-specific properties for this resource.", + "type": { + "$id": "907", + "kind": "model", + "name": "IotOperationsDataflowProfileProperties", + "clientNamespace": "Microsoft.IoTOperations", + "crossLanguageDefinitionId": "Microsoft.IoTOperations.DataflowProfileProperties", + "usage": "Input,Output,Json,LroInitial,LroFinalEnvelope", + "doc": "DataflowProfile Resource properties", + "decorators": [], + "properties": [ + { + "$id": "908", + "kind": "property", + "name": "diagnostics", + "serializedName": "diagnostics", + "doc": "Spec defines the desired identities of NBC diagnostics settings.", + "type": { + "$id": "909", + "kind": "model", + "name": "DataflowProfileDiagnostics", + "clientNamespace": "Microsoft.IoTOperations", + "crossLanguageDefinitionId": "Microsoft.IoTOperations.ProfileDiagnostics", + "usage": "Input,Output,Json,LroInitial,LroFinalEnvelope", + "doc": "DataflowProfile Diagnostics properties", + "decorators": [], + "properties": [ + { + "$id": "910", + "kind": "property", + "name": "logs", + "serializedName": "logs", + "doc": "Diagnostic log settings for the resource.", + "type": { + "$id": "911", + "kind": "model", + "name": "DiagnosticsLogs", + "clientNamespace": "Microsoft.IoTOperations", + "crossLanguageDefinitionId": "Microsoft.IoTOperations.DiagnosticsLogs", + "usage": "Input,Output,Json,LroInitial,LroFinalEnvelope", + "doc": "Diagnostic Log properties", + "decorators": [], + "properties": [ + { + "$id": "912", + "kind": "property", + "name": "level", + "serializedName": "level", + "doc": "The log level. Examples - 'debug', 'info', 'warn', 'error', 'trace'.", + "type": { + "$id": "913", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.IoTOperations.DiagnosticsLogs.level", + "serializationOptions": { + "$id": "914", + "json": { + "$id": "915", + "name": "level" + } + } + } + ] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.IoTOperations.ProfileDiagnostics.logs", + "serializationOptions": { + "$id": "916", + "json": { + "$id": "917", + "name": "logs" + } + } + }, + { + "$id": "918", + "kind": "property", + "name": "metrics", + "serializedName": "metrics", + "doc": "The metrics settings for the resource.", + "type": { + "$id": "919", + "kind": "model", + "name": "IotOperationsMetrics", + "clientNamespace": "Microsoft.IoTOperations", + "crossLanguageDefinitionId": "Microsoft.IoTOperations.Metrics", + "usage": "Input,Output,Json,LroInitial,LroFinalEnvelope", + "doc": "Diagnostic Metrics properties", + "decorators": [], + "properties": [ + { + "$id": "920", + "kind": "property", + "name": "prometheusPort", + "serializedName": "prometheusPort", + "doc": "The prometheus port to expose the metrics.", + "type": { + "$id": "921", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.IoTOperations.Metrics.prometheusPort", + "serializationOptions": { + "$id": "922", + "json": { + "$id": "923", + "name": "prometheusPort" + } + } + } + ] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.IoTOperations.ProfileDiagnostics.metrics", + "serializationOptions": { + "$id": "924", + "json": { + "$id": "925", + "name": "metrics" + } + } + } + ] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.IoTOperations.DataflowProfileProperties.diagnostics", + "serializationOptions": { + "$id": "926", + "json": { + "$id": "927", + "name": "diagnostics" + } + } + }, + { + "$id": "928", + "kind": "property", + "name": "instanceCount", + "serializedName": "instanceCount", + "doc": "To manually scale the dataflow profile, specify the maximum number of instances you want to run.", + "type": { + "$id": "929", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.IoTOperations.DataflowProfileProperties.instanceCount", + "serializationOptions": { + "$id": "930", + "json": { + "$id": "931", + "name": "instanceCount" + } + } + }, + { + "$id": "932", + "kind": "property", + "name": "provisioningState", + "serializedName": "provisioningState", + "doc": "The status of the last operation.", + "type": { + "$ref": "126" + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.IoTOperations.DataflowProfileProperties.provisioningState", + "serializationOptions": { + "$id": "933", + "json": { + "$id": "934", + "name": "provisioningState" + } + } + } + ] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.IoTOperations.DataflowProfileResource.properties", + "serializationOptions": { + "$id": "935", + "json": { + "$id": "936", + "name": "properties" + } + } + }, + { + "$id": "937", + "kind": "property", + "name": "extendedLocation", + "serializedName": "extendedLocation", + "doc": "Edge location of the resource.", + "type": { + "$ref": "669" + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.IoTOperations.DataflowProfileResource.extendedLocation", + "serializationOptions": { + "$id": "938", + "json": { + "$id": "939", + "name": "extendedLocation" + } + } + } + ] + }, + { + "$ref": "907" + }, + { + "$ref": "909" + }, + { + "$ref": "911" + }, + { + "$ref": "919" + }, + { + "$id": "940", + "kind": "model", + "name": "DataflowProfileResourceListResult", + "clientNamespace": "Azure.ResourceManager", + "crossLanguageDefinitionId": "Azure.ResourceManager.ResourceListResult", + "usage": "Output,Json", + "doc": "The response of a DataflowProfileResource list operation.", + "decorators": [], + "properties": [ + { + "$id": "941", + "kind": "property", + "name": "value", + "serializedName": "value", + "doc": "The DataflowProfileResource items on this page", + "type": { + "$id": "942", + "kind": "array", + "name": "ArrayDataflowProfileResource", + "valueType": { + "$ref": "905" + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.ResourceListResult.value", + "serializationOptions": { + "$id": "943", + "json": { + "$id": "944", + "name": "value" + } + } + }, + { + "$id": "945", + "kind": "property", + "name": "nextLink", + "serializedName": "nextLink", + "doc": "The link to the next page of items", + "type": { + "$id": "946", + "kind": "url", + "name": "ResourceLocation", + "crossLanguageDefinitionId": "TypeSpec.Rest.ResourceLocation", + "baseType": { + "$id": "947", + "kind": "url", + "name": "url", + "crossLanguageDefinitionId": "TypeSpec.url", + "decorators": [] + }, + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.ResourceListResult.nextLink", + "serializationOptions": { + "$id": "948", + "json": { + "$id": "949", + "name": "nextLink" + } + } + } + ] + }, + { + "$id": "950", + "kind": "model", + "name": "IotOperationsBrokerAuthorization", + "clientNamespace": "Microsoft.IoTOperations", + "crossLanguageDefinitionId": "Microsoft.IoTOperations.BrokerAuthorizationResource", + "usage": "Input,Output,Json,LroInitial,LroFinalEnvelope", + "doc": "Instance broker authorizations resource", + "decorators": [], + "baseModel": { + "$ref": "327" + }, + "properties": [ + { + "$id": "951", + "kind": "property", + "name": "properties", + "serializedName": "properties", + "doc": "The resource-specific properties for this resource.", + "type": { + "$id": "952", + "kind": "model", + "name": "IotOperationsBrokerAuthorizationProperties", + "clientNamespace": "Microsoft.IoTOperations", + "crossLanguageDefinitionId": "Microsoft.IoTOperations.BrokerAuthorizationProperties", + "usage": "Input,Output,Json,LroInitial,LroFinalEnvelope", + "doc": "BrokerAuthorization Resource properties", + "decorators": [], + "properties": [ + { + "$id": "953", + "kind": "property", + "name": "authorizationPolicies", + "serializedName": "authorizationPolicies", + "doc": "The list of authorization policies supported by the Authorization Resource.", + "type": { + "$id": "954", + "kind": "model", + "name": "BrokerAuthorizationConfig", + "clientNamespace": "Microsoft.IoTOperations", + "crossLanguageDefinitionId": "Microsoft.IoTOperations.AuthorizationConfig", + "usage": "Input,Output,Json,LroInitial,LroFinalEnvelope", + "doc": "Broker AuthorizationConfig properties", + "decorators": [], + "properties": [ + { + "$id": "955", + "kind": "property", + "name": "cache", + "serializedName": "cache", + "doc": "Enable caching of the authorization rules.", + "type": { + "$ref": "62" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.IoTOperations.AuthorizationConfig.cache", + "serializationOptions": { + "$id": "956", + "json": { + "$id": "957", + "name": "cache" + } + } + }, + { + "$id": "958", + "kind": "property", + "name": "rules", + "serializedName": "rules", + "doc": "The authorization rules to follow. If no rule is set, but Authorization Resource is used that would mean DenyAll.", + "type": { + "$id": "959", + "kind": "array", + "name": "ArrayAuthorizationRule", + "valueType": { + "$id": "960", + "kind": "model", + "name": "BrokerAuthorizationRule", + "clientNamespace": "Microsoft.IoTOperations", + "crossLanguageDefinitionId": "Microsoft.IoTOperations.AuthorizationRule", + "usage": "Input,Output,Json,LroInitial,LroFinalEnvelope", + "doc": "AuthorizationConfig Rule Properties", + "decorators": [], + "properties": [ + { + "$id": "961", + "kind": "property", + "name": "brokerResources", + "serializedName": "brokerResources", + "doc": "Give access to Broker methods and topics.", + "type": { + "$id": "962", + "kind": "array", + "name": "ArrayBrokerResourceRule", + "valueType": { + "$id": "963", + "kind": "model", + "name": "BrokerResourceRule", + "clientNamespace": "Microsoft.IoTOperations", + "crossLanguageDefinitionId": "Microsoft.IoTOperations.BrokerResourceRule", + "usage": "Input,Output,Json,LroInitial,LroFinalEnvelope", + "doc": "Broker Resource Rule properties. This defines the objects that represent the actions or topics, such as - method.Connect, method.Publish, etc.", + "decorators": [], + "properties": [ + { + "$id": "964", + "kind": "property", + "name": "method", + "serializedName": "method", + "doc": "Give access for a Broker method (i.e., Connect, Subscribe, or Publish).", + "type": { + "$ref": "200" + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.IoTOperations.BrokerResourceRule.method", + "serializationOptions": { + "$id": "965", + "json": { + "$id": "966", + "name": "method" + } + } + }, + { + "$id": "967", + "kind": "property", + "name": "clientIds", + "serializedName": "clientIds", + "doc": "A list of client IDs that match the clients. The client IDs are case-sensitive and must match the client IDs provided by the clients during connection. This subfield may be set if the method is Connect.", + "type": { + "$id": "968", + "kind": "array", + "name": "Array", + "valueType": { + "$id": "969", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.IoTOperations.BrokerResourceRule.clientIds", + "serializationOptions": { + "$id": "970", + "json": { + "$id": "971", + "name": "clientIds" + } + } + }, + { + "$id": "972", + "kind": "property", + "name": "topics", + "serializedName": "topics", + "doc": "A list of topics or topic patterns that match the topics that the clients can publish or subscribe to. This subfield is required if the method is Publish or Subscribe.", + "type": { + "$id": "973", + "kind": "array", + "name": "Array", + "valueType": { + "$id": "974", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.IoTOperations.BrokerResourceRule.topics", + "serializationOptions": { + "$id": "975", + "json": { + "$id": "976", + "name": "topics" + } + } + } + ] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.IoTOperations.AuthorizationRule.brokerResources", + "serializationOptions": { + "$id": "977", + "json": { + "$id": "978", + "name": "brokerResources" + } + } + }, + { + "$id": "979", + "kind": "property", + "name": "principals", + "serializedName": "principals", + "doc": "Give access to clients based on the following properties.", + "type": { + "$id": "980", + "kind": "model", + "name": "PrincipalConfig", + "clientNamespace": "Microsoft.IoTOperations", + "crossLanguageDefinitionId": "Microsoft.IoTOperations.PrincipalDefinition", + "usage": "Input,Output,Json,LroInitial,LroFinalEnvelope", + "doc": "PrincipalDefinition properties of Rule", + "decorators": [], + "properties": [ + { + "$id": "981", + "kind": "property", + "name": "attributes", + "serializedName": "attributes", + "doc": "A list of key-value pairs that match the attributes of the clients. The attributes are case-sensitive and must match the attributes provided by the clients during authentication.", + "type": { + "$id": "982", + "kind": "array", + "name": "ArrayRecord", + "valueType": { + "$id": "983", + "kind": "dict", + "keyType": { + "$id": "984", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "valueType": { + "$id": "985", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.IoTOperations.PrincipalDefinition.attributes", + "serializationOptions": { + "$id": "986", + "json": { + "$id": "987", + "name": "attributes" + } + } + }, + { + "$id": "988", + "kind": "property", + "name": "clientIds", + "serializedName": "clientIds", + "doc": "A list of client IDs that match the clients. The client IDs are case-sensitive and must match the client IDs provided by the clients during connection.", + "type": { + "$id": "989", + "kind": "array", + "name": "Array", + "valueType": { + "$id": "990", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.IoTOperations.PrincipalDefinition.clientIds", + "serializationOptions": { + "$id": "991", + "json": { + "$id": "992", + "name": "clientIds" + } + } + }, + { + "$id": "993", + "kind": "property", + "name": "usernames", + "serializedName": "usernames", + "doc": "A list of usernames that match the clients. The usernames are case-sensitive and must match the usernames provided by the clients during authentication.", + "type": { + "$id": "994", + "kind": "array", + "name": "Array", + "valueType": { + "$id": "995", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.IoTOperations.PrincipalDefinition.usernames", + "serializationOptions": { + "$id": "996", + "json": { + "$id": "997", + "name": "usernames" + } + } + } + ] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.IoTOperations.AuthorizationRule.principals", + "serializationOptions": { + "$id": "998", + "json": { + "$id": "999", + "name": "principals" + } + } + }, + { + "$id": "1000", + "kind": "property", + "name": "stateStoreResources", + "serializedName": "stateStoreResources", + "doc": "Give access to state store resources.", + "type": { + "$id": "1001", + "kind": "array", + "name": "ArrayStateStoreResourceRule", + "valueType": { + "$id": "1002", + "kind": "model", + "name": "StateStoreResourceRule", + "clientNamespace": "Microsoft.IoTOperations", + "crossLanguageDefinitionId": "Microsoft.IoTOperations.StateStoreResourceRule", + "usage": "Input,Output,Json,LroInitial,LroFinalEnvelope", + "doc": "State Store Resource Rule properties.", + "decorators": [], + "properties": [ + { + "$id": "1003", + "kind": "property", + "name": "keyType", + "serializedName": "keyType", + "doc": "Allowed keyTypes pattern, string, binary. The key type used for matching, for example pattern tries to match the key to a glob-style pattern and string checks key is equal to value provided in keys.", + "type": { + "$ref": "208" + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.IoTOperations.StateStoreResourceRule.keyType", + "serializationOptions": { + "$id": "1004", + "json": { + "$id": "1005", + "name": "keyType" + } + } + }, + { + "$id": "1006", + "kind": "property", + "name": "keys", + "serializedName": "keys", + "doc": "Give access to state store keys for the corresponding principals defined. When key type is pattern set glob-style pattern (e.g., '*', 'clients/*').", + "type": { + "$id": "1007", + "kind": "array", + "name": "Array", + "valueType": { + "$id": "1008", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.IoTOperations.StateStoreResourceRule.keys", + "serializationOptions": { + "$id": "1009", + "json": { + "$id": "1010", + "name": "keys" + } + } + }, + { + "$id": "1011", + "kind": "property", + "name": "method", + "serializedName": "method", + "doc": "Give access for `Read`, `Write` and `ReadWrite` access level.", + "type": { + "$ref": "216" + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.IoTOperations.StateStoreResourceRule.method", + "serializationOptions": { + "$id": "1012", + "json": { + "$id": "1013", + "name": "method" + } + } + } + ] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.IoTOperations.AuthorizationRule.stateStoreResources", + "serializationOptions": { + "$id": "1014", + "json": { + "$id": "1015", + "name": "stateStoreResources" + } + } + } + ] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.IoTOperations.AuthorizationConfig.rules", + "serializationOptions": { + "$id": "1016", + "json": { + "$id": "1017", + "name": "rules" + } + } + } + ] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.IoTOperations.BrokerAuthorizationProperties.authorizationPolicies", + "serializationOptions": { + "$id": "1018", + "json": { + "$id": "1019", + "name": "authorizationPolicies" + } + } + }, + { + "$id": "1020", + "kind": "property", + "name": "provisioningState", + "serializedName": "provisioningState", + "doc": "The status of the last operation.", + "type": { + "$ref": "126" + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.IoTOperations.BrokerAuthorizationProperties.provisioningState", + "serializationOptions": { + "$id": "1021", + "json": { + "$id": "1022", + "name": "provisioningState" + } + } + } + ] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.IoTOperations.BrokerAuthorizationResource.properties", + "serializationOptions": { + "$id": "1023", + "json": { + "$id": "1024", + "name": "properties" + } + } + }, + { + "$id": "1025", + "kind": "property", + "name": "extendedLocation", + "serializedName": "extendedLocation", + "doc": "Edge location of the resource.", + "type": { + "$ref": "669" + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.IoTOperations.BrokerAuthorizationResource.extendedLocation", + "serializationOptions": { + "$id": "1026", + "json": { + "$id": "1027", + "name": "extendedLocation" + } + } + } + ] + }, + { + "$ref": "952" + }, + { + "$ref": "954" + }, + { + "$ref": "960" + }, + { + "$ref": "963" + }, + { + "$ref": "980" + }, + { + "$ref": "1002" + }, + { + "$id": "1028", + "kind": "model", + "name": "BrokerAuthorizationResourceListResult", + "clientNamespace": "Azure.ResourceManager", + "crossLanguageDefinitionId": "Azure.ResourceManager.ResourceListResult", + "usage": "Output,Json", + "doc": "The response of a BrokerAuthorizationResource list operation.", + "decorators": [], + "properties": [ + { + "$id": "1029", + "kind": "property", + "name": "value", + "serializedName": "value", + "doc": "The BrokerAuthorizationResource items on this page", + "type": { + "$id": "1030", + "kind": "array", + "name": "ArrayBrokerAuthorizationResource", + "valueType": { + "$ref": "950" + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.ResourceListResult.value", + "serializationOptions": { + "$id": "1031", + "json": { + "$id": "1032", + "name": "value" + } + } + }, + { + "$id": "1033", + "kind": "property", + "name": "nextLink", + "serializedName": "nextLink", + "doc": "The link to the next page of items", + "type": { + "$id": "1034", + "kind": "url", + "name": "ResourceLocation", + "crossLanguageDefinitionId": "TypeSpec.Rest.ResourceLocation", + "baseType": { + "$id": "1035", + "kind": "url", + "name": "url", + "crossLanguageDefinitionId": "TypeSpec.url", + "decorators": [] + }, + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.ResourceListResult.nextLink", + "serializationOptions": { + "$id": "1036", + "json": { + "$id": "1037", + "name": "nextLink" + } + } + } + ] + }, + { + "$id": "1038", + "kind": "model", + "name": "IotOperationsBrokerAuthentication", + "clientNamespace": "Microsoft.IoTOperations", + "crossLanguageDefinitionId": "Microsoft.IoTOperations.BrokerAuthenticationResource", + "usage": "Input,Output,Json,LroInitial,LroFinalEnvelope", + "doc": "Instance broker authentication resource", + "decorators": [], + "baseModel": { + "$ref": "327" + }, + "properties": [ + { + "$id": "1039", + "kind": "property", + "name": "properties", + "serializedName": "properties", + "doc": "The resource-specific properties for this resource.", + "type": { + "$id": "1040", + "kind": "model", + "name": "IotOperationsBrokerAuthenticationProperties", + "clientNamespace": "Microsoft.IoTOperations", + "crossLanguageDefinitionId": "Microsoft.IoTOperations.BrokerAuthenticationProperties", + "usage": "Input,Output,Json,LroInitial,LroFinalEnvelope", + "doc": "BrokerAuthentication Resource properties", + "decorators": [], + "properties": [ + { + "$id": "1041", + "kind": "property", + "name": "authenticationMethods", + "serializedName": "authenticationMethods", + "doc": "Defines a set of Broker authentication methods to be used on `BrokerListeners`. For each array element one authenticator type supported.", + "type": { + "$id": "1042", + "kind": "array", + "name": "ArrayBrokerAuthenticatorMethods", + "valueType": { + "$id": "1043", + "kind": "model", + "name": "BrokerAuthenticatorMethods", + "clientNamespace": "Microsoft.IoTOperations", + "crossLanguageDefinitionId": "Microsoft.IoTOperations.BrokerAuthenticatorMethods", + "usage": "Input,Output,Json,LroInitial,LroFinalEnvelope", + "doc": "Set of broker authentication policies. Only one method is supported for each entry.", + "decorators": [], + "properties": [ + { + "$id": "1044", + "kind": "property", + "name": "method", + "serializedName": "method", + "doc": "Custom authentication configuration.", + "type": { + "$ref": "224" + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.IoTOperations.BrokerAuthenticatorMethods.method", + "serializationOptions": { + "$id": "1045", + "json": { + "$id": "1046", + "name": "method" + } + } + }, + { + "$id": "1047", + "kind": "property", + "name": "customSettings", + "serializedName": "customSettings", + "doc": "Custom authentication configuration.", + "type": { + "$id": "1048", + "kind": "model", + "name": "BrokerAuthenticatorMethodCustom", + "clientNamespace": "Microsoft.IoTOperations", + "crossLanguageDefinitionId": "Microsoft.IoTOperations.BrokerAuthenticatorMethodCustom", + "usage": "Input,Output,Json,LroInitial,LroFinalEnvelope", + "doc": "Custom method for BrokerAuthentication", + "decorators": [], + "properties": [ + { + "$id": "1049", + "kind": "property", + "name": "auth", + "serializedName": "auth", + "doc": "Optional authentication needed for authenticating with the custom authentication server.", + "type": { + "$id": "1050", + "kind": "model", + "name": "BrokerAuthenticatorCustomAuth", + "clientNamespace": "Microsoft.IoTOperations", + "crossLanguageDefinitionId": "Microsoft.IoTOperations.BrokerAuthenticatorCustomAuth", + "usage": "Input,Output,Json,LroInitial,LroFinalEnvelope", + "doc": "Custom Authentication properties", + "decorators": [], + "properties": [ + { + "$id": "1051", + "kind": "property", + "name": "x509", + "serializedName": "x509", + "doc": "X509 Custom Auth type details.", + "type": { + "$id": "1052", + "kind": "model", + "name": "X509ManualCertificate", + "clientNamespace": "Microsoft.IoTOperations", + "crossLanguageDefinitionId": "Microsoft.IoTOperations.X509ManualCertificate", + "usage": "Input,Output,Json,LroInitial,LroFinalEnvelope", + "doc": "X509 Certificate Authentication properties.", + "decorators": [], + "properties": [ + { + "$id": "1053", + "kind": "property", + "name": "secretRef", + "serializedName": "secretRef", + "doc": "Kubernetes secret containing an X.509 client certificate. This is a reference to the secret through an identifying name, not the secret itself.", + "type": { + "$id": "1054", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.IoTOperations.X509ManualCertificate.secretRef", + "serializationOptions": { + "$id": "1055", + "json": { + "$id": "1056", + "name": "secretRef" + } + } + } + ] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.IoTOperations.BrokerAuthenticatorCustomAuth.x509", + "serializationOptions": { + "$id": "1057", + "json": { + "$id": "1058", + "name": "x509" + } + } + } + ] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.IoTOperations.BrokerAuthenticatorMethodCustom.auth", + "serializationOptions": { + "$id": "1059", + "json": { + "$id": "1060", + "name": "auth" + } + } + }, + { + "$id": "1061", + "kind": "property", + "name": "caCertConfigMap", + "serializedName": "caCertConfigMap", + "doc": "Optional CA certificate for validating the custom authentication server's certificate.", + "type": { + "$id": "1062", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.IoTOperations.BrokerAuthenticatorMethodCustom.caCertConfigMap", + "serializationOptions": { + "$id": "1063", + "json": { + "$id": "1064", + "name": "caCertConfigMap" + } + } + }, + { + "$id": "1065", + "kind": "property", + "name": "endpoint", + "serializedName": "endpoint", + "doc": "Endpoint of the custom authentication server. Must be an HTTPS endpoint.", + "type": { + "$id": "1066", + "kind": "url", + "name": "url", + "crossLanguageDefinitionId": "TypeSpec.url", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.IoTOperations.BrokerAuthenticatorMethodCustom.endpoint", + "serializationOptions": { + "$id": "1067", + "json": { + "$id": "1068", + "name": "endpoint" + } + } + }, + { + "$id": "1069", + "kind": "property", + "name": "headers", + "serializedName": "headers", + "doc": "Additional HTTP headers to pass to the custom authentication server.", + "type": { + "$id": "1070", + "kind": "dict", + "keyType": { + "$id": "1071", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "valueType": { + "$id": "1072", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.IoTOperations.BrokerAuthenticatorMethodCustom.headers", + "serializationOptions": { + "$id": "1073", + "json": { + "$id": "1074", + "name": "headers" + } + } + } + ] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.IoTOperations.BrokerAuthenticatorMethods.customSettings", + "serializationOptions": { + "$id": "1075", + "json": { + "$id": "1076", + "name": "customSettings" + } + } + }, + { + "$id": "1077", + "kind": "property", + "name": "serviceAccountTokenSettings", + "serializedName": "serviceAccountTokenSettings", + "doc": "ServiceAccountToken authentication configuration.", + "type": { + "$id": "1078", + "kind": "model", + "name": "BrokerAuthenticatorMethodSat", + "clientNamespace": "Microsoft.IoTOperations", + "crossLanguageDefinitionId": "Microsoft.IoTOperations.BrokerAuthenticatorMethodSat", + "usage": "Input,Output,Json,LroInitial,LroFinalEnvelope", + "doc": "Service Account Token for BrokerAuthentication", + "decorators": [], + "properties": [ + { + "$id": "1079", + "kind": "property", + "name": "audiences", + "serializedName": "audiences", + "doc": "List of allowed audience.", + "type": { + "$id": "1080", + "kind": "array", + "name": "Array", + "valueType": { + "$id": "1081", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.IoTOperations.BrokerAuthenticatorMethodSat.audiences", + "serializationOptions": { + "$id": "1082", + "json": { + "$id": "1083", + "name": "audiences" + } + } + } + ] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.IoTOperations.BrokerAuthenticatorMethods.serviceAccountTokenSettings", + "serializationOptions": { + "$id": "1084", + "json": { + "$id": "1085", + "name": "serviceAccountTokenSettings" + } + } + }, + { + "$id": "1086", + "kind": "property", + "name": "x509Settings", + "serializedName": "x509Settings", + "doc": "X.509 authentication configuration.", + "type": { + "$id": "1087", + "kind": "model", + "name": "BrokerAuthenticatorMethodX509", + "clientNamespace": "Microsoft.IoTOperations", + "crossLanguageDefinitionId": "Microsoft.IoTOperations.BrokerAuthenticatorMethodX509", + "usage": "Input,Output,Json,LroInitial,LroFinalEnvelope", + "doc": "X509 for BrokerAuthentication.", + "decorators": [], + "properties": [ + { + "$id": "1088", + "kind": "property", + "name": "authorizationAttributes", + "serializedName": "authorizationAttributes", + "doc": "X509 authorization attributes properties.", + "type": { + "$id": "1089", + "kind": "dict", + "keyType": { + "$id": "1090", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "valueType": { + "$id": "1091", + "kind": "model", + "name": "BrokerAuthenticatorMethodX509Attributes", + "clientNamespace": "Microsoft.IoTOperations", + "crossLanguageDefinitionId": "Microsoft.IoTOperations.BrokerAuthenticatorMethodX509Attributes", + "usage": "Input,Output,Json,LroInitial,LroFinalEnvelope", + "doc": "BrokerAuthenticatorMethodX509Attributes properties.", + "decorators": [], + "properties": [ + { + "$id": "1092", + "kind": "property", + "name": "attributes", + "serializedName": "attributes", + "doc": "Attributes object.", + "type": { + "$id": "1093", + "kind": "dict", + "keyType": { + "$id": "1094", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "valueType": { + "$id": "1095", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.IoTOperations.BrokerAuthenticatorMethodX509Attributes.attributes", + "serializationOptions": { + "$id": "1096", + "json": { + "$id": "1097", + "name": "attributes" + } + } + }, + { + "$id": "1098", + "kind": "property", + "name": "subject", + "serializedName": "subject", + "doc": "Subject of the X509 attribute.", + "type": { + "$id": "1099", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.IoTOperations.BrokerAuthenticatorMethodX509Attributes.subject", + "serializationOptions": { + "$id": "1100", + "json": { + "$id": "1101", + "name": "subject" + } + } + } + ] + }, + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.IoTOperations.BrokerAuthenticatorMethodX509.authorizationAttributes", + "serializationOptions": { + "$id": "1102", + "json": { + "$id": "1103", + "name": "authorizationAttributes" + } + } + }, + { + "$id": "1104", + "kind": "property", + "name": "trustedClientCaCert", + "serializedName": "trustedClientCaCert", + "doc": "Name of the trusted client ca cert resource.", + "type": { + "$id": "1105", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.IoTOperations.BrokerAuthenticatorMethodX509.trustedClientCaCert", + "serializationOptions": { + "$id": "1106", + "json": { + "$id": "1107", + "name": "trustedClientCaCert" + } + } + } + ] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.IoTOperations.BrokerAuthenticatorMethods.x509Settings", + "serializationOptions": { + "$id": "1108", + "json": { + "$id": "1109", + "name": "x509Settings" + } + } + } + ] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.IoTOperations.BrokerAuthenticationProperties.authenticationMethods", + "serializationOptions": { + "$id": "1110", + "json": { + "$id": "1111", + "name": "authenticationMethods" + } + } + }, + { + "$id": "1112", + "kind": "property", + "name": "provisioningState", + "serializedName": "provisioningState", + "doc": "The status of the last operation.", + "type": { + "$ref": "126" + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.IoTOperations.BrokerAuthenticationProperties.provisioningState", + "serializationOptions": { + "$id": "1113", + "json": { + "$id": "1114", + "name": "provisioningState" + } + } + } + ] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.IoTOperations.BrokerAuthenticationResource.properties", + "serializationOptions": { + "$id": "1115", + "json": { + "$id": "1116", + "name": "properties" + } + } + }, + { + "$id": "1117", + "kind": "property", + "name": "extendedLocation", + "serializedName": "extendedLocation", + "doc": "Edge location of the resource.", + "type": { + "$ref": "669" + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.IoTOperations.BrokerAuthenticationResource.extendedLocation", + "serializationOptions": { + "$id": "1118", + "json": { + "$id": "1119", + "name": "extendedLocation" + } + } + } + ] + }, + { + "$ref": "1040" + }, + { + "$ref": "1043" + }, + { + "$ref": "1048" + }, + { + "$ref": "1050" + }, + { + "$ref": "1052" + }, + { + "$ref": "1078" + }, + { + "$ref": "1087" + }, + { + "$ref": "1091" + }, + { + "$id": "1120", + "kind": "model", + "name": "BrokerAuthenticationResourceListResult", + "clientNamespace": "Azure.ResourceManager", + "crossLanguageDefinitionId": "Azure.ResourceManager.ResourceListResult", + "usage": "Output,Json", + "doc": "The response of a BrokerAuthenticationResource list operation.", + "decorators": [], + "properties": [ + { + "$id": "1121", + "kind": "property", + "name": "value", + "serializedName": "value", + "doc": "The BrokerAuthenticationResource items on this page", + "type": { + "$id": "1122", + "kind": "array", + "name": "ArrayBrokerAuthenticationResource", + "valueType": { + "$ref": "1038" + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.ResourceListResult.value", + "serializationOptions": { + "$id": "1123", + "json": { + "$id": "1124", + "name": "value" + } + } + }, + { + "$id": "1125", + "kind": "property", + "name": "nextLink", + "serializedName": "nextLink", + "doc": "The link to the next page of items", + "type": { + "$id": "1126", + "kind": "url", + "name": "ResourceLocation", + "crossLanguageDefinitionId": "TypeSpec.Rest.ResourceLocation", + "baseType": { + "$id": "1127", + "kind": "url", + "name": "url", + "crossLanguageDefinitionId": "TypeSpec.url", + "decorators": [] + }, + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.ResourceListResult.nextLink", + "serializationOptions": { + "$id": "1128", + "json": { + "$id": "1129", + "name": "nextLink" + } + } + } + ] + }, + { + "$id": "1130", + "kind": "model", + "name": "IotOperationsBrokerListener", + "clientNamespace": "Microsoft.IoTOperations", + "crossLanguageDefinitionId": "Microsoft.IoTOperations.BrokerListenerResource", + "usage": "Input,Output,Json,LroInitial,LroFinalEnvelope", + "doc": "Instance broker resource", + "decorators": [], + "baseModel": { + "$ref": "327" + }, + "properties": [ + { + "$id": "1131", + "kind": "property", + "name": "properties", + "serializedName": "properties", + "doc": "The resource-specific properties for this resource.", + "type": { + "$id": "1132", + "kind": "model", + "name": "IotOperationsBrokerListenerProperties", + "clientNamespace": "Microsoft.IoTOperations", + "crossLanguageDefinitionId": "Microsoft.IoTOperations.BrokerListenerProperties", + "usage": "Input,Output,Json,LroInitial,LroFinalEnvelope", + "doc": "Defines a Broker listener. A listener is a collection of ports on which the broker accepts connections from clients.", + "decorators": [], + "properties": [ + { + "$id": "1133", + "kind": "property", + "name": "serviceName", + "serializedName": "serviceName", + "doc": "Kubernetes Service name of this listener.", + "type": { + "$id": "1134", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.IoTOperations.BrokerListenerProperties.serviceName", + "serializationOptions": { + "$id": "1135", + "json": { + "$id": "1136", + "name": "serviceName" + } + } + }, + { + "$id": "1137", + "kind": "property", + "name": "ports", + "serializedName": "ports", + "doc": "Ports on which this listener accepts client connections.", + "type": { + "$id": "1138", + "kind": "array", + "name": "ArrayListenerPort", + "valueType": { + "$id": "1139", + "kind": "model", + "name": "BrokerListenerPort", + "clientNamespace": "Microsoft.IoTOperations", + "crossLanguageDefinitionId": "Microsoft.IoTOperations.ListenerPort", + "usage": "Input,Output,Json,LroInitial,LroFinalEnvelope", + "doc": "Defines a TCP port on which a `BrokerListener` listens.", + "decorators": [], + "properties": [ + { + "$id": "1140", + "kind": "property", + "name": "authenticationRef", + "serializedName": "authenticationRef", + "doc": "Reference to client authentication settings. Omit to disable authentication.", + "type": { + "$id": "1141", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.IoTOperations.ListenerPort.authenticationRef", + "serializationOptions": { + "$id": "1142", + "json": { + "$id": "1143", + "name": "authenticationRef" + } + } + }, + { + "$id": "1144", + "kind": "property", + "name": "authorizationRef", + "serializedName": "authorizationRef", + "doc": "Reference to client authorization settings. Omit to disable authorization.", + "type": { + "$id": "1145", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.IoTOperations.ListenerPort.authorizationRef", + "serializationOptions": { + "$id": "1146", + "json": { + "$id": "1147", + "name": "authorizationRef" + } + } + }, + { + "$id": "1148", + "kind": "property", + "name": "nodePort", + "serializedName": "nodePort", + "doc": "Kubernetes node port. Only relevant when this port is associated with a `NodePort` listener.", + "type": { + "$id": "1149", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.IoTOperations.ListenerPort.nodePort", + "serializationOptions": { + "$id": "1150", + "json": { + "$id": "1151", + "name": "nodePort" + } + } + }, + { + "$id": "1152", + "kind": "property", + "name": "port", + "serializedName": "port", + "doc": "TCP port for accepting client connections.", + "type": { + "$id": "1153", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.IoTOperations.ListenerPort.port", + "serializationOptions": { + "$id": "1154", + "json": { + "$id": "1155", + "name": "port" + } + } + }, + { + "$id": "1156", + "kind": "property", + "name": "protocol", + "serializedName": "protocol", + "doc": "Protocol to use for client connections.", + "type": { + "$ref": "114" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.IoTOperations.ListenerPort.protocol", + "serializationOptions": { + "$id": "1157", + "json": { + "$id": "1158", + "name": "protocol" + } + } + }, + { + "$id": "1159", + "kind": "property", + "name": "tls", + "serializedName": "tls", + "doc": "TLS server certificate settings for this port. Omit to disable TLS.", + "type": { + "$id": "1160", + "kind": "model", + "name": "ListenerPortTlsCertMethod", + "clientNamespace": "Microsoft.IoTOperations", + "crossLanguageDefinitionId": "Microsoft.IoTOperations.TlsCertMethod", + "usage": "Input,Output,Json,LroInitial,LroFinalEnvelope", + "doc": "Collection of different TLS types, NOTE- Enum at a time only one of them needs to be supported", + "decorators": [], + "properties": [ + { + "$id": "1161", + "kind": "property", + "name": "mode", + "serializedName": "mode", + "doc": "Mode of TLS server certificate management.", + "type": { + "$ref": "232" + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.IoTOperations.TlsCertMethod.mode", + "serializationOptions": { + "$id": "1162", + "json": { + "$id": "1163", + "name": "mode" + } + } + }, + { + "$id": "1164", + "kind": "property", + "name": "certManagerCertificateSpec", + "serializedName": "certManagerCertificateSpec", + "doc": "Option 1 - Automatic TLS server certificate management with cert-manager.", + "type": { + "$id": "1165", + "kind": "model", + "name": "CertManagerCertificateSpec", + "clientNamespace": "Microsoft.IoTOperations", + "crossLanguageDefinitionId": "Microsoft.IoTOperations.CertManagerCertificateSpec", + "usage": "Input,Output,Json,LroInitial,LroFinalEnvelope", + "doc": "Automatic TLS server certificate management with cert-manager", + "decorators": [], + "properties": [ + { + "$id": "1166", + "kind": "property", + "name": "duration", + "serializedName": "duration", + "doc": "Lifetime of certificate. Must be specified using a Go time.Duration format (h|m|s). E.g. 240h for 240 hours and 45m for 45 minutes.", + "type": { + "$id": "1167", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.IoTOperations.CertManagerCertificateSpec.duration", + "serializationOptions": { + "$id": "1168", + "json": { + "$id": "1169", + "name": "duration" + } + } + }, + { + "$id": "1170", + "kind": "property", + "name": "secretName", + "serializedName": "secretName", + "doc": "Secret for storing server certificate. Any existing data will be overwritten. This is a reference to the secret through an identifying name, not the secret itself.", + "type": { + "$id": "1171", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.IoTOperations.CertManagerCertificateSpec.secretName", + "serializationOptions": { + "$id": "1172", + "json": { + "$id": "1173", + "name": "secretName" + } + } + }, + { + "$id": "1174", + "kind": "property", + "name": "renewBefore", + "serializedName": "renewBefore", + "doc": "When to begin renewing certificate. Must be specified using a Go time.Duration format (h|m|s). E.g. 240h for 240 hours and 45m for 45 minutes.", + "type": { + "$id": "1175", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.IoTOperations.CertManagerCertificateSpec.renewBefore", + "serializationOptions": { + "$id": "1176", + "json": { + "$id": "1177", + "name": "renewBefore" + } + } + }, + { + "$id": "1178", + "kind": "property", + "name": "issuerRef", + "serializedName": "issuerRef", + "doc": "cert-manager issuerRef.", + "type": { + "$id": "1179", + "kind": "model", + "name": "CertManagerIssuerRef", + "clientNamespace": "Microsoft.IoTOperations", + "crossLanguageDefinitionId": "Microsoft.IoTOperations.CertManagerIssuerRef", + "usage": "Input,Output,Json,LroInitial,LroFinalEnvelope", + "doc": "Cert-Manager issuerRef properties", + "decorators": [], + "properties": [ + { + "$id": "1180", + "kind": "property", + "name": "group", + "serializedName": "group", + "doc": "group of issuer.", + "type": { + "$id": "1181", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.IoTOperations.CertManagerIssuerRef.group", + "serializationOptions": { + "$id": "1182", + "json": { + "$id": "1183", + "name": "group" + } + } + }, + { + "$id": "1184", + "kind": "property", + "name": "kind", + "serializedName": "kind", + "doc": "kind of issuer (Issuer or ClusterIssuer).", + "type": { + "$ref": "238" + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.IoTOperations.CertManagerIssuerRef.kind", + "serializationOptions": { + "$id": "1185", + "json": { + "$id": "1186", + "name": "kind" + } + } + }, + { + "$id": "1187", + "kind": "property", + "name": "name", + "serializedName": "name", + "doc": "name of issuer.", + "type": { + "$id": "1188", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.IoTOperations.CertManagerIssuerRef.name", + "serializationOptions": { + "$id": "1189", + "json": { + "$id": "1190", + "name": "name" + } + } + } + ] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.IoTOperations.CertManagerCertificateSpec.issuerRef", + "serializationOptions": { + "$id": "1191", + "json": { + "$id": "1192", + "name": "issuerRef" + } + } + }, + { + "$id": "1193", + "kind": "property", + "name": "privateKey", + "serializedName": "privateKey", + "doc": "Type of certificate private key.", + "type": { + "$id": "1194", + "kind": "model", + "name": "CertManagerPrivateKey", + "clientNamespace": "Microsoft.IoTOperations", + "crossLanguageDefinitionId": "Microsoft.IoTOperations.CertManagerPrivateKey", + "usage": "Input,Output,Json,LroInitial,LroFinalEnvelope", + "doc": "Cert Manager private key properties", + "decorators": [], + "properties": [ + { + "$id": "1195", + "kind": "property", + "name": "algorithm", + "serializedName": "algorithm", + "doc": "algorithm for private key.", + "type": { + "$ref": "244" + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.IoTOperations.CertManagerPrivateKey.algorithm", + "serializationOptions": { + "$id": "1196", + "json": { + "$id": "1197", + "name": "algorithm" + } + } + }, + { + "$id": "1198", + "kind": "property", + "name": "rotationPolicy", + "serializedName": "rotationPolicy", + "doc": "cert-manager private key rotationPolicy.", + "type": { + "$ref": "260" + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.IoTOperations.CertManagerPrivateKey.rotationPolicy", + "serializationOptions": { + "$id": "1199", + "json": { + "$id": "1200", + "name": "rotationPolicy" + } + } + } + ] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.IoTOperations.CertManagerCertificateSpec.privateKey", + "serializationOptions": { + "$id": "1201", + "json": { + "$id": "1202", + "name": "privateKey" + } + } + }, + { + "$id": "1203", + "kind": "property", + "name": "san", + "serializedName": "san", + "doc": "Additional Subject Alternative Names (SANs) to include in the certificate.", + "type": { + "$id": "1204", + "kind": "model", + "name": "SanForCert", + "clientNamespace": "Microsoft.IoTOperations", + "crossLanguageDefinitionId": "Microsoft.IoTOperations.SanForCert", + "usage": "Input,Output,Json,LroInitial,LroFinalEnvelope", + "doc": "Subject Alternative Names (SANs) for certificate.", + "decorators": [], + "properties": [ + { + "$id": "1205", + "kind": "property", + "name": "dns", + "serializedName": "dns", + "doc": "DNS SANs.", + "type": { + "$id": "1206", + "kind": "array", + "name": "Array", + "valueType": { + "$id": "1207", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.IoTOperations.SanForCert.dns", + "serializationOptions": { + "$id": "1208", + "json": { + "$id": "1209", + "name": "dns" + } + } + }, + { + "$id": "1210", + "kind": "property", + "name": "ip", + "serializedName": "ip", + "doc": "IP address SANs.", + "type": { + "$id": "1211", + "kind": "array", + "name": "Array", + "valueType": { + "$id": "1212", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.IoTOperations.SanForCert.ip", + "serializationOptions": { + "$id": "1213", + "json": { + "$id": "1214", + "name": "ip" + } + } + } + ] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.IoTOperations.CertManagerCertificateSpec.san", + "serializationOptions": { + "$id": "1215", + "json": { + "$id": "1216", + "name": "san" + } + } + } + ] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.IoTOperations.TlsCertMethod.certManagerCertificateSpec", + "serializationOptions": { + "$id": "1217", + "json": { + "$id": "1218", + "name": "certManagerCertificateSpec" + } + } + }, + { + "$id": "1219", + "kind": "property", + "name": "manual", + "serializedName": "manual", + "doc": "Option 2 - Manual TLS server certificate management through a defined secret.", + "type": { + "$ref": "1052" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.IoTOperations.TlsCertMethod.manual", + "serializationOptions": { + "$id": "1220", + "json": { + "$id": "1221", + "name": "manual" + } + } + } + ] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.IoTOperations.ListenerPort.tls", + "serializationOptions": { + "$id": "1222", + "json": { + "$id": "1223", + "name": "tls" + } + } + } + ] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.IoTOperations.BrokerListenerProperties.ports", + "serializationOptions": { + "$id": "1224", + "json": { + "$id": "1225", + "name": "ports" + } + } + }, + { + "$id": "1226", + "kind": "property", + "name": "serviceType", + "serializedName": "serviceType", + "doc": "Kubernetes Service type of this listener.", + "type": { + "$ref": "266" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.IoTOperations.BrokerListenerProperties.serviceType", + "serializationOptions": { + "$id": "1227", + "json": { + "$id": "1228", + "name": "serviceType" + } + } + }, + { + "$id": "1229", + "kind": "property", + "name": "provisioningState", + "serializedName": "provisioningState", + "doc": "The status of the last operation.", + "type": { + "$ref": "126" + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.IoTOperations.BrokerListenerProperties.provisioningState", + "serializationOptions": { + "$id": "1230", + "json": { + "$id": "1231", + "name": "provisioningState" + } + } + } + ] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.IoTOperations.BrokerListenerResource.properties", + "serializationOptions": { + "$id": "1232", + "json": { + "$id": "1233", + "name": "properties" + } + } + }, + { + "$id": "1234", + "kind": "property", + "name": "extendedLocation", + "serializedName": "extendedLocation", + "doc": "Edge location of the resource.", + "type": { + "$ref": "669" + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.IoTOperations.BrokerListenerResource.extendedLocation", + "serializationOptions": { + "$id": "1235", + "json": { + "$id": "1236", + "name": "extendedLocation" + } + } + } + ] + }, + { + "$ref": "1132" + }, + { + "$ref": "1139" + }, + { + "$ref": "1160" + }, + { + "$ref": "1165" + }, + { + "$ref": "1179" + }, + { + "$ref": "1194" + }, + { + "$ref": "1204" + }, + { + "$id": "1237", + "kind": "model", + "name": "BrokerListenerResourceListResult", + "clientNamespace": "Azure.ResourceManager", + "crossLanguageDefinitionId": "Azure.ResourceManager.ResourceListResult", + "usage": "Output,Json", + "doc": "The response of a BrokerListenerResource list operation.", + "decorators": [], + "properties": [ + { + "$id": "1238", + "kind": "property", + "name": "value", + "serializedName": "value", + "doc": "The BrokerListenerResource items on this page", + "type": { + "$id": "1239", + "kind": "array", + "name": "ArrayBrokerListenerResource", + "valueType": { + "$ref": "1130" + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.ResourceListResult.value", + "serializationOptions": { + "$id": "1240", + "json": { + "$id": "1241", + "name": "value" + } + } + }, + { + "$id": "1242", + "kind": "property", + "name": "nextLink", + "serializedName": "nextLink", + "doc": "The link to the next page of items", + "type": { + "$id": "1243", + "kind": "url", + "name": "ResourceLocation", + "crossLanguageDefinitionId": "TypeSpec.Rest.ResourceLocation", + "baseType": { + "$id": "1244", + "kind": "url", + "name": "url", + "crossLanguageDefinitionId": "TypeSpec.url", + "decorators": [] + }, + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.ResourceListResult.nextLink", + "serializationOptions": { + "$id": "1245", + "json": { + "$id": "1246", + "name": "nextLink" + } + } + } + ] + }, + { + "$id": "1247", + "kind": "model", + "name": "IotOperationsBroker", + "clientNamespace": "Microsoft.IoTOperations", + "crossLanguageDefinitionId": "Microsoft.IoTOperations.BrokerResource", + "usage": "Input,Output,Json,LroInitial,LroFinalEnvelope", + "doc": "Instance broker resource", + "decorators": [], + "baseModel": { + "$ref": "327" + }, + "properties": [ + { + "$id": "1248", + "kind": "property", + "name": "properties", + "serializedName": "properties", + "doc": "The resource-specific properties for this resource.", + "type": { + "$id": "1249", + "kind": "model", + "name": "IotOperationsBrokerProperties", + "clientNamespace": "Microsoft.IoTOperations", + "crossLanguageDefinitionId": "Microsoft.IoTOperations.BrokerProperties", + "usage": "Input,Output,Json,LroInitial,LroFinalEnvelope", + "doc": "Broker Resource properties", + "decorators": [], + "properties": [ + { + "$id": "1250", + "kind": "property", + "name": "advanced", + "serializedName": "advanced", + "doc": "Advanced settings of Broker.", + "type": { + "$id": "1251", + "kind": "model", + "name": "BrokerAdvancedSettings", + "clientNamespace": "Microsoft.IoTOperations", + "crossLanguageDefinitionId": "Microsoft.IoTOperations.AdvancedSettings", + "usage": "Input,Output,Json,LroInitial,LroFinalEnvelope", + "doc": "Broker Advanced Settings", + "decorators": [], + "properties": [ + { + "$id": "1252", + "kind": "property", + "name": "clients", + "serializedName": "clients", + "doc": "Configurations related to All Clients.", + "type": { + "$id": "1253", + "kind": "model", + "name": "BrokerClientConfig", + "clientNamespace": "Microsoft.IoTOperations", + "crossLanguageDefinitionId": "Microsoft.IoTOperations.ClientConfig", + "usage": "Input,Output,Json,LroInitial,LroFinalEnvelope", + "doc": "The settings of Client Config.", + "decorators": [], + "properties": [ + { + "$id": "1254", + "kind": "property", + "name": "maxSessionExpirySeconds", + "serializedName": "maxSessionExpirySeconds", + "doc": "Upper bound of Session Expiry Interval, in seconds.", + "type": { + "$id": "1255", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.IoTOperations.ClientConfig.maxSessionExpirySeconds", + "serializationOptions": { + "$id": "1256", + "json": { + "$id": "1257", + "name": "maxSessionExpirySeconds" + } + } + }, + { + "$id": "1258", + "kind": "property", + "name": "maxMessageExpirySeconds", + "serializedName": "maxMessageExpirySeconds", + "doc": "Upper bound of Message Expiry Interval, in seconds.", + "type": { + "$id": "1259", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.IoTOperations.ClientConfig.maxMessageExpirySeconds", + "serializationOptions": { + "$id": "1260", + "json": { + "$id": "1261", + "name": "maxMessageExpirySeconds" + } + } + }, + { + "$id": "1262", + "kind": "property", + "name": "maxPacketSizeBytes", + "serializedName": "maxPacketSizeBytes", + "doc": "Max message size for a packet in Bytes.", + "type": { + "$id": "1263", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.IoTOperations.ClientConfig.maxPacketSizeBytes", + "serializationOptions": { + "$id": "1264", + "json": { + "$id": "1265", + "name": "maxPacketSizeBytes" + } + } + }, + { + "$id": "1266", + "kind": "property", + "name": "subscriberQueueLimit", + "serializedName": "subscriberQueueLimit", + "doc": "The limit on the number of queued messages for a subscriber.", + "type": { + "$id": "1267", + "kind": "model", + "name": "SubscriberQueueLimit", + "clientNamespace": "Microsoft.IoTOperations", + "crossLanguageDefinitionId": "Microsoft.IoTOperations.SubscriberQueueLimit", + "usage": "Input,Output,Json,LroInitial,LroFinalEnvelope", + "doc": "The settings of Subscriber Queue Limit.", + "decorators": [], + "properties": [ + { + "$id": "1268", + "kind": "property", + "name": "length", + "serializedName": "length", + "doc": "The maximum length of the queue before messages start getting dropped.", + "type": { + "$id": "1269", + "kind": "int64", + "name": "int64", + "crossLanguageDefinitionId": "TypeSpec.int64", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.IoTOperations.SubscriberQueueLimit.length", + "serializationOptions": { + "$id": "1270", + "json": { + "$id": "1271", + "name": "length" + } + } + }, + { + "$id": "1272", + "kind": "property", + "name": "strategy", + "serializedName": "strategy", + "doc": "The strategy to use for dropping messages from the queue.", + "type": { + "$ref": "274" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.IoTOperations.SubscriberQueueLimit.strategy", + "serializationOptions": { + "$id": "1273", + "json": { + "$id": "1274", + "name": "strategy" + } + } + } + ] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.IoTOperations.ClientConfig.subscriberQueueLimit", + "serializationOptions": { + "$id": "1275", + "json": { + "$id": "1276", + "name": "subscriberQueueLimit" + } + } + }, + { + "$id": "1277", + "kind": "property", + "name": "maxReceiveMaximum", + "serializedName": "maxReceiveMaximum", + "doc": "Upper bound of Receive Maximum that a client can request in the CONNECT packet.", + "type": { + "$id": "1278", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.IoTOperations.ClientConfig.maxReceiveMaximum", + "serializationOptions": { + "$id": "1279", + "json": { + "$id": "1280", + "name": "maxReceiveMaximum" + } + } + }, + { + "$id": "1281", + "kind": "property", + "name": "maxKeepAliveSeconds", + "serializedName": "maxKeepAliveSeconds", + "doc": "Upper bound of a client's Keep Alive, in seconds.", + "type": { + "$id": "1282", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.IoTOperations.ClientConfig.maxKeepAliveSeconds", + "serializationOptions": { + "$id": "1283", + "json": { + "$id": "1284", + "name": "maxKeepAliveSeconds" + } + } + } + ] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.IoTOperations.AdvancedSettings.clients", + "serializationOptions": { + "$id": "1285", + "json": { + "$id": "1286", + "name": "clients" + } + } + }, + { + "$id": "1287", + "kind": "property", + "name": "encryptInternalTraffic", + "serializedName": "encryptInternalTraffic", + "doc": "The setting to enable or disable encryption of internal Traffic.", + "type": { + "$ref": "62" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.IoTOperations.AdvancedSettings.encryptInternalTraffic", + "serializationOptions": { + "$id": "1288", + "json": { + "$id": "1289", + "name": "encryptInternalTraffic" + } + } + }, + { + "$id": "1290", + "kind": "property", + "name": "internalCerts", + "serializedName": "internalCerts", + "doc": "Certificate rotation and private key configuration.", + "type": { + "$id": "1291", + "kind": "model", + "name": "CertManagerCertConfig", + "clientNamespace": "Microsoft.IoTOperations", + "crossLanguageDefinitionId": "Microsoft.IoTOperations.CertManagerCertOptions", + "usage": "Input,Output,Json,LroInitial,LroFinalEnvelope", + "doc": "Cert Manager Cert properties", + "decorators": [], + "properties": [ + { + "$id": "1292", + "kind": "property", + "name": "duration", + "serializedName": "duration", + "doc": "Lifetime of certificate. Must be specified using a Go time.Duration format (h|m|s). E.g. 240h for 240 hours and 45m for 45 minutes.", + "type": { + "$id": "1293", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.IoTOperations.CertManagerCertOptions.duration", + "serializationOptions": { + "$id": "1294", + "json": { + "$id": "1295", + "name": "duration" + } + } + }, + { + "$id": "1296", + "kind": "property", + "name": "renewBefore", + "serializedName": "renewBefore", + "doc": "When to begin renewing certificate. Must be specified using a Go time.Duration format (h|m|s). E.g. 240h for 240 hours and 45m for 45 minutes.", + "type": { + "$id": "1297", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.IoTOperations.CertManagerCertOptions.renewBefore", + "serializationOptions": { + "$id": "1298", + "json": { + "$id": "1299", + "name": "renewBefore" + } + } + }, + { + "$id": "1300", + "kind": "property", + "name": "privateKey", + "serializedName": "privateKey", + "doc": "Configuration of certificate private key.", + "type": { + "$ref": "1194" + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.IoTOperations.CertManagerCertOptions.privateKey", + "serializationOptions": { + "$id": "1301", + "json": { + "$id": "1302", + "name": "privateKey" + } + } + } + ] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.IoTOperations.AdvancedSettings.internalCerts", + "serializationOptions": { + "$id": "1303", + "json": { + "$id": "1304", + "name": "internalCerts" + } + } + } + ] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.IoTOperations.BrokerProperties.advanced", + "serializationOptions": { + "$id": "1305", + "json": { + "$id": "1306", + "name": "advanced" + } + } + }, + { + "$id": "1307", + "kind": "property", + "name": "cardinality", + "serializedName": "cardinality", + "doc": "The cardinality details of the broker.", + "type": { + "$id": "1308", + "kind": "model", + "name": "BrokerCardinality", + "clientNamespace": "Microsoft.IoTOperations", + "crossLanguageDefinitionId": "Microsoft.IoTOperations.Cardinality", + "usage": "Input,Output,Json,LroInitial,LroFinalEnvelope", + "doc": "Cardinality properties", + "decorators": [], + "properties": [ + { + "$id": "1309", + "kind": "property", + "name": "backendChain", + "serializedName": "backendChain", + "doc": "The backend broker desired properties", + "type": { + "$id": "1310", + "kind": "model", + "name": "BrokerBackendChain", + "clientNamespace": "Microsoft.IoTOperations", + "crossLanguageDefinitionId": "Microsoft.IoTOperations.BackendChain", + "usage": "Input,Output,Json,LroInitial,LroFinalEnvelope", + "doc": "Desired properties of the backend instances of the broker", + "decorators": [], + "properties": [ + { + "$id": "1311", + "kind": "property", + "name": "partitions", + "serializedName": "partitions", + "doc": "The desired number of physical backend partitions.", + "type": { + "$id": "1312", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.IoTOperations.BackendChain.partitions", + "serializationOptions": { + "$id": "1313", + "json": { + "$id": "1314", + "name": "partitions" + } + } + }, + { + "$id": "1315", + "kind": "property", + "name": "redundancyFactor", + "serializedName": "redundancyFactor", + "doc": "The desired numbers of backend replicas (pods) in a physical partition.", + "type": { + "$id": "1316", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.IoTOperations.BackendChain.redundancyFactor", + "serializationOptions": { + "$id": "1317", + "json": { + "$id": "1318", + "name": "redundancyFactor" + } + } + }, + { + "$id": "1319", + "kind": "property", + "name": "workers", + "serializedName": "workers", + "doc": "Number of logical backend workers per replica (pod).", + "type": { + "$id": "1320", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.IoTOperations.BackendChain.workers", + "serializationOptions": { + "$id": "1321", + "json": { + "$id": "1322", + "name": "workers" + } + } + } + ] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.IoTOperations.Cardinality.backendChain", + "serializationOptions": { + "$id": "1323", + "json": { + "$id": "1324", + "name": "backendChain" + } + } + }, + { + "$id": "1325", + "kind": "property", + "name": "frontend", + "serializedName": "frontend", + "doc": "The frontend desired properties", + "type": { + "$id": "1326", + "kind": "model", + "name": "BrokerFrontend", + "clientNamespace": "Microsoft.IoTOperations", + "crossLanguageDefinitionId": "Microsoft.IoTOperations.Frontend", + "usage": "Input,Output,Json,LroInitial,LroFinalEnvelope", + "doc": "The desired properties of the frontend instances of the Broker", + "decorators": [], + "properties": [ + { + "$id": "1327", + "kind": "property", + "name": "replicas", + "serializedName": "replicas", + "doc": "The desired number of frontend instances (pods).", + "type": { + "$id": "1328", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.IoTOperations.Frontend.replicas", + "serializationOptions": { + "$id": "1329", + "json": { + "$id": "1330", + "name": "replicas" + } + } + }, + { + "$id": "1331", + "kind": "property", + "name": "workers", + "serializedName": "workers", + "doc": "Number of logical frontend workers per instance (pod).", + "type": { + "$id": "1332", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.IoTOperations.Frontend.workers", + "serializationOptions": { + "$id": "1333", + "json": { + "$id": "1334", + "name": "workers" + } + } + } + ] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.IoTOperations.Cardinality.frontend", + "serializationOptions": { + "$id": "1335", + "json": { + "$id": "1336", + "name": "frontend" + } + } + } + ] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.IoTOperations.BrokerProperties.cardinality", + "serializationOptions": { + "$id": "1337", + "json": { + "$id": "1338", + "name": "cardinality" + } + } + }, + { + "$id": "1339", + "kind": "property", + "name": "diagnostics", + "serializedName": "diagnostics", + "doc": "Spec defines the desired identities of Broker diagnostics settings.", + "type": { + "$id": "1340", + "kind": "model", + "name": "BrokerDiagnostics", + "clientNamespace": "Microsoft.IoTOperations", + "crossLanguageDefinitionId": "Microsoft.IoTOperations.BrokerDiagnostics", + "usage": "Input,Output,Json,LroInitial,LroFinalEnvelope", + "doc": "Broker Diagnostic Setting properties", + "decorators": [], + "properties": [ + { + "$id": "1341", + "kind": "property", + "name": "logs", + "serializedName": "logs", + "doc": "Diagnostic log settings for the resource.", + "type": { + "$ref": "911" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.IoTOperations.BrokerDiagnostics.logs", + "serializationOptions": { + "$id": "1342", + "json": { + "$id": "1343", + "name": "logs" + } + } + }, + { + "$id": "1344", + "kind": "property", + "name": "metrics", + "serializedName": "metrics", + "doc": "The metrics settings for the resource.", + "type": { + "$ref": "919" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.IoTOperations.BrokerDiagnostics.metrics", + "serializationOptions": { + "$id": "1345", + "json": { + "$id": "1346", + "name": "metrics" + } + } + }, + { + "$id": "1347", + "kind": "property", + "name": "selfCheck", + "serializedName": "selfCheck", + "doc": "The self check properties.", + "type": { + "$id": "1348", + "kind": "model", + "name": "BrokerDiagnosticSelfCheck", + "clientNamespace": "Microsoft.IoTOperations", + "crossLanguageDefinitionId": "Microsoft.IoTOperations.SelfCheck", + "usage": "Input,Output,Json,LroInitial,LroFinalEnvelope", + "doc": "Broker Diagnostic Self check properties", + "decorators": [], + "properties": [ + { + "$id": "1349", + "kind": "property", + "name": "mode", + "serializedName": "mode", + "doc": "The toggle to enable/disable self check.", + "type": { + "$ref": "62" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.IoTOperations.SelfCheck.mode", + "serializationOptions": { + "$id": "1350", + "json": { + "$id": "1351", + "name": "mode" + } + } + }, + { + "$id": "1352", + "kind": "property", + "name": "intervalSeconds", + "serializedName": "intervalSeconds", + "doc": "The self check interval.", + "type": { + "$id": "1353", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.IoTOperations.SelfCheck.intervalSeconds", + "serializationOptions": { + "$id": "1354", + "json": { + "$id": "1355", + "name": "intervalSeconds" + } + } + }, + { + "$id": "1356", + "kind": "property", + "name": "timeoutSeconds", + "serializedName": "timeoutSeconds", + "doc": "The timeout for self check.", + "type": { + "$id": "1357", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.IoTOperations.SelfCheck.timeoutSeconds", + "serializationOptions": { + "$id": "1358", + "json": { + "$id": "1359", + "name": "timeoutSeconds" + } + } + } + ] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.IoTOperations.BrokerDiagnostics.selfCheck", + "serializationOptions": { + "$id": "1360", + "json": { + "$id": "1361", + "name": "selfCheck" + } + } + }, + { + "$id": "1362", + "kind": "property", + "name": "traces", + "serializedName": "traces", + "doc": "The trace properties.", + "type": { + "$id": "1363", + "kind": "model", + "name": "BrokerDiagnosticTraces", + "clientNamespace": "Microsoft.IoTOperations", + "crossLanguageDefinitionId": "Microsoft.IoTOperations.Traces", + "usage": "Input,Output,Json,LroInitial,LroFinalEnvelope", + "doc": "Broker Diagnostic Trace properties", + "decorators": [], + "properties": [ + { + "$id": "1364", + "kind": "property", + "name": "mode", + "serializedName": "mode", + "doc": "The toggle to enable/disable traces.", + "type": { + "$ref": "62" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.IoTOperations.Traces.mode", + "serializationOptions": { + "$id": "1365", + "json": { + "$id": "1366", + "name": "mode" + } + } + }, + { + "$id": "1367", + "kind": "property", + "name": "cacheSizeMegabytes", + "serializedName": "cacheSizeMegabytes", + "doc": "The cache size in megabytes.", + "type": { + "$id": "1368", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.IoTOperations.Traces.cacheSizeMegabytes", + "serializationOptions": { + "$id": "1369", + "json": { + "$id": "1370", + "name": "cacheSizeMegabytes" + } + } + }, + { + "$id": "1371", + "kind": "property", + "name": "selfTracing", + "serializedName": "selfTracing", + "doc": "The self tracing properties.", + "type": { + "$id": "1372", + "kind": "model", + "name": "DiagnosticSelfTracing", + "clientNamespace": "Microsoft.IoTOperations", + "crossLanguageDefinitionId": "Microsoft.IoTOperations.SelfTracing", + "usage": "Input,Output,Json,LroInitial,LroFinalEnvelope", + "doc": "Diagnostic Self tracing properties", + "decorators": [], + "properties": [ + { + "$id": "1373", + "kind": "property", + "name": "mode", + "serializedName": "mode", + "doc": "The toggle to enable/disable self tracing.", + "type": { + "$ref": "62" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.IoTOperations.SelfTracing.mode", + "serializationOptions": { + "$id": "1374", + "json": { + "$id": "1375", + "name": "mode" + } + } + }, + { + "$id": "1376", + "kind": "property", + "name": "intervalSeconds", + "serializedName": "intervalSeconds", + "doc": "The self tracing interval.", + "type": { + "$id": "1377", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.IoTOperations.SelfTracing.intervalSeconds", + "serializationOptions": { + "$id": "1378", + "json": { + "$id": "1379", + "name": "intervalSeconds" + } + } + } + ] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.IoTOperations.Traces.selfTracing", + "serializationOptions": { + "$id": "1380", + "json": { + "$id": "1381", + "name": "selfTracing" + } + } + }, + { + "$id": "1382", + "kind": "property", + "name": "spanChannelCapacity", + "serializedName": "spanChannelCapacity", + "doc": "The span channel capacity.", + "type": { + "$id": "1383", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.IoTOperations.Traces.spanChannelCapacity", + "serializationOptions": { + "$id": "1384", + "json": { + "$id": "1385", + "name": "spanChannelCapacity" + } + } + } + ] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.IoTOperations.BrokerDiagnostics.traces", + "serializationOptions": { + "$id": "1386", + "json": { + "$id": "1387", + "name": "traces" + } + } + } + ] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.IoTOperations.BrokerProperties.diagnostics", + "serializationOptions": { + "$id": "1388", + "json": { + "$id": "1389", + "name": "diagnostics" + } + } + }, + { + "$id": "1390", + "kind": "property", + "name": "diskBackedMessageBuffer", + "serializedName": "diskBackedMessageBuffer", + "doc": "Settings of Disk Backed Message Buffer.", + "type": { + "$id": "1391", + "kind": "model", + "name": "DiskBackedMessageBuffer", + "clientNamespace": "Microsoft.IoTOperations", + "crossLanguageDefinitionId": "Microsoft.IoTOperations.DiskBackedMessageBuffer", + "usage": "Input,Output,Json,LroInitial,LroFinalEnvelope", + "doc": "DiskBackedMessageBuffer properties", + "decorators": [], + "properties": [ + { + "$id": "1392", + "kind": "property", + "name": "maxSize", + "serializedName": "maxSize", + "doc": "The max size of the message buffer on disk. If a PVC template is specified using one of ephemeralVolumeClaimSpec or persistentVolumeClaimSpec, then this size is used as the request and limit sizes of that template. If neither ephemeralVolumeClaimSpec nor persistentVolumeClaimSpec are specified, then an emptyDir volume is mounted with this size as its limit. See for details.", + "type": { + "$id": "1393", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.IoTOperations.DiskBackedMessageBuffer.maxSize", + "serializationOptions": { + "$id": "1394", + "json": { + "$id": "1395", + "name": "maxSize" + } + } + }, + { + "$id": "1396", + "kind": "property", + "name": "ephemeralVolumeClaimSpec", + "serializedName": "ephemeralVolumeClaimSpec", + "doc": "Use the specified persistent volume claim template to mount a \"generic ephemeral volume\" for the message buffer. See for details.", + "type": { + "$id": "1397", + "kind": "model", + "name": "VolumeClaimSpec", + "clientNamespace": "Microsoft.IoTOperations", + "crossLanguageDefinitionId": "Microsoft.IoTOperations.VolumeClaimSpec", + "usage": "Input,Output,Json,LroInitial,LroFinalEnvelope", + "doc": "VolumeClaimSpec properties", + "decorators": [], + "properties": [ + { + "$id": "1398", + "kind": "property", + "name": "volumeName", + "serializedName": "volumeName", + "doc": "VolumeName is the binding reference to the PersistentVolume backing this claim.", + "type": { + "$id": "1399", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.IoTOperations.VolumeClaimSpec.volumeName", + "serializationOptions": { + "$id": "1400", + "json": { + "$id": "1401", + "name": "volumeName" + } + } + }, + { + "$id": "1402", + "kind": "property", + "name": "volumeMode", + "serializedName": "volumeMode", + "doc": "volumeMode defines what type of volume is required by the claim. Value of Filesystem is implied when not included in claim spec. This is a beta feature.", + "type": { + "$id": "1403", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.IoTOperations.VolumeClaimSpec.volumeMode", + "serializationOptions": { + "$id": "1404", + "json": { + "$id": "1405", + "name": "volumeMode" + } + } + }, + { + "$id": "1406", + "kind": "property", + "name": "storageClassName", + "serializedName": "storageClassName", + "doc": "Name of the StorageClass required by the claim. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#class-1", + "type": { + "$id": "1407", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.IoTOperations.VolumeClaimSpec.storageClassName", + "serializationOptions": { + "$id": "1408", + "json": { + "$id": "1409", + "name": "storageClassName" + } + } + }, + { + "$id": "1410", + "kind": "property", + "name": "accessModes", + "serializedName": "accessModes", + "doc": "AccessModes contains the desired access modes the volume should have. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#access-modes-1", + "type": { + "$id": "1411", + "kind": "array", + "name": "Array", + "valueType": { + "$id": "1412", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.IoTOperations.VolumeClaimSpec.accessModes", + "serializationOptions": { + "$id": "1413", + "json": { + "$id": "1414", + "name": "accessModes" + } + } + }, + { + "$id": "1415", + "kind": "property", + "name": "dataSource", + "serializedName": "dataSource", + "doc": "This field can be used to specify either: * An existing VolumeSnapshot object (snapshot.storage.k8s.io/VolumeSnapshot) * An existing PVC (PersistentVolumeClaim) If the provisioner or an external controller can support the specified data source, it will create a new volume based on the contents of the specified data source. If the AnyVolumeDataSource feature gate is enabled, this field will always have the same contents as the DataSourceRef field.", + "type": { + "$id": "1416", + "kind": "model", + "name": "LocalKubernetesReference", + "clientNamespace": "Microsoft.IoTOperations", + "crossLanguageDefinitionId": "Microsoft.IoTOperations.LocalKubernetesReference", + "usage": "Input,Output,Json,LroInitial,LroFinalEnvelope", + "doc": "Kubernetes reference", + "decorators": [], + "properties": [ + { + "$id": "1417", + "kind": "property", + "name": "apiGroup", + "serializedName": "apiGroup", + "doc": "APIGroup is the group for the resource being referenced. If APIGroup is not specified, the specified Kind must be in the core API group. For any other third-party types, APIGroup is required.", + "type": { + "$id": "1418", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.IoTOperations.LocalKubernetesReference.apiGroup", + "serializationOptions": { + "$id": "1419", + "json": { + "$id": "1420", + "name": "apiGroup" + } + } + }, + { + "$id": "1421", + "kind": "property", + "name": "kind", + "serializedName": "kind", + "doc": "Kind is the type of resource being referenced", + "type": { + "$id": "1422", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.IoTOperations.LocalKubernetesReference.kind", + "serializationOptions": { + "$id": "1423", + "json": { + "$id": "1424", + "name": "kind" + } + } + }, + { + "$id": "1425", + "kind": "property", + "name": "name", + "serializedName": "name", + "doc": "Name is the name of resource being referenced", + "type": { + "$id": "1426", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.IoTOperations.LocalKubernetesReference.name", + "serializationOptions": { + "$id": "1427", + "json": { + "$id": "1428", + "name": "name" + } + } + } + ] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.IoTOperations.VolumeClaimSpec.dataSource", + "serializationOptions": { + "$id": "1429", + "json": { + "$id": "1430", + "name": "dataSource" + } + } + }, + { + "$id": "1431", + "kind": "property", + "name": "dataSourceRef", + "serializedName": "dataSourceRef", + "doc": "Specifies the object from which to populate the volume with data, if a non-empty volume is desired. This may be any local object from a non-empty API group (non core object) or a PersistentVolumeClaim object. When this field is specified, volume binding will only succeed if the type of the specified object matches some installed volume populator or dynamic provisioner. This field will replace the functionality of the DataSource field and as such if both fields are non-empty, they must have the same value. For backwards compatibility, both fields (DataSource and DataSourceRef) will be set to the same value automatically if one of them is empty and the other is non-empty. There are two important differences between DataSource and DataSourceRef: * While DataSource only allows two specific types of objects, DataSourceRef allows any non-core object, as well as PersistentVolumeClaim objects. * While DataSource ignores disallowed values (dropping them), DataSourceRef preserves all values, and generates an error if a disallowed value is specified. (Beta) Using this field requires the AnyVolumeDataSource feature gate to be enabled.", + "type": { + "$id": "1432", + "kind": "model", + "name": "KubernetesReference", + "clientNamespace": "Microsoft.IoTOperations", + "crossLanguageDefinitionId": "Microsoft.IoTOperations.KubernetesReference", + "usage": "Input,Output,Json,LroInitial,LroFinalEnvelope", + "doc": "Kubernetes reference", + "decorators": [], + "properties": [ + { + "$id": "1433", + "kind": "property", + "name": "apiGroup", + "serializedName": "apiGroup", + "doc": "APIGroup is the group for the resource being referenced. If APIGroup is not specified, the specified Kind must be in the core API group. For any other third-party types, APIGroup is required.", + "type": { + "$id": "1434", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.IoTOperations.KubernetesReference.apiGroup", + "serializationOptions": { + "$id": "1435", + "json": { + "$id": "1436", + "name": "apiGroup" + } + } + }, + { + "$id": "1437", + "kind": "property", + "name": "kind", + "serializedName": "kind", + "doc": "Kind is the type of resource being referenced", + "type": { + "$id": "1438", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.IoTOperations.KubernetesReference.kind", + "serializationOptions": { + "$id": "1439", + "json": { + "$id": "1440", + "name": "kind" + } + } + }, + { + "$id": "1441", + "kind": "property", + "name": "name", + "serializedName": "name", + "doc": "Name is the name of resource being referenced", + "type": { + "$id": "1442", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.IoTOperations.KubernetesReference.name", + "serializationOptions": { + "$id": "1443", + "json": { + "$id": "1444", + "name": "name" + } + } + }, + { + "$id": "1445", + "kind": "property", + "name": "namespace", + "serializedName": "namespace", + "doc": "Namespace is the namespace of the resource being referenced. This field is required when the resource has a namespace.", + "type": { + "$id": "1446", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.IoTOperations.KubernetesReference.namespace", + "serializationOptions": { + "$id": "1447", + "json": { + "$id": "1448", + "name": "namespace" + } + } + } + ] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.IoTOperations.VolumeClaimSpec.dataSourceRef", + "serializationOptions": { + "$id": "1449", + "json": { + "$id": "1450", + "name": "dataSourceRef" + } + } + }, + { + "$id": "1451", + "kind": "property", + "name": "resources", + "serializedName": "resources", + "doc": "Resources represents the minimum resources the volume should have. If RecoverVolumeExpansionFailure feature is enabled users are allowed to specify resource requirements that are lower than previous value but must still be higher than capacity recorded in the status field of the claim. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#resources", + "type": { + "$id": "1452", + "kind": "model", + "name": "VolumeClaimResourceRequirements", + "clientNamespace": "Microsoft.IoTOperations", + "crossLanguageDefinitionId": "Microsoft.IoTOperations.VolumeClaimResourceRequirements", + "usage": "Input,Output,Json,LroInitial,LroFinalEnvelope", + "doc": "VolumeClaimResourceRequirements properties", + "decorators": [], + "properties": [ + { + "$id": "1453", + "kind": "property", + "name": "limits", + "serializedName": "limits", + "doc": "Limits describes the maximum amount of compute resources allowed. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/", + "type": { + "$id": "1454", + "kind": "dict", + "keyType": { + "$id": "1455", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "valueType": { + "$id": "1456", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.IoTOperations.VolumeClaimResourceRequirements.limits", + "serializationOptions": { + "$id": "1457", + "json": { + "$id": "1458", + "name": "limits" + } + } + }, + { + "$id": "1459", + "kind": "property", + "name": "requests", + "serializedName": "requests", + "doc": "Requests describes the minimum amount of compute resources required. If Requests is omitted for a container, it defaults to Limits if that is explicitly specified, otherwise to an implementation-defined value. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/", + "type": { + "$id": "1460", + "kind": "dict", + "keyType": { + "$id": "1461", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "valueType": { + "$id": "1462", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.IoTOperations.VolumeClaimResourceRequirements.requests", + "serializationOptions": { + "$id": "1463", + "json": { + "$id": "1464", + "name": "requests" + } + } + } + ] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.IoTOperations.VolumeClaimSpec.resources", + "serializationOptions": { + "$id": "1465", + "json": { + "$id": "1466", + "name": "resources" + } + } + }, + { + "$id": "1467", + "kind": "property", + "name": "selector", + "serializedName": "selector", + "doc": "A label query over volumes to consider for binding.", + "type": { + "$id": "1468", + "kind": "model", + "name": "VolumeClaimSpecSelector", + "clientNamespace": "Microsoft.IoTOperations", + "crossLanguageDefinitionId": "Microsoft.IoTOperations.VolumeClaimSpecSelector", + "usage": "Input,Output,Json,LroInitial,LroFinalEnvelope", + "doc": "VolumeClaimSpecSelector properties", + "decorators": [], + "properties": [ + { + "$id": "1469", + "kind": "property", + "name": "matchExpressions", + "serializedName": "matchExpressions", + "doc": "MatchExpressions is a list of label selector requirements. The requirements are ANDed.", + "type": { + "$id": "1470", + "kind": "array", + "name": "ArrayVolumeClaimSpecSelectorMatchExpressions", + "valueType": { + "$id": "1471", + "kind": "model", + "name": "VolumeClaimSpecSelectorMatchExpressions", + "clientNamespace": "Microsoft.IoTOperations", + "crossLanguageDefinitionId": "Microsoft.IoTOperations.VolumeClaimSpecSelectorMatchExpressions", + "usage": "Input,Output,Json,LroInitial,LroFinalEnvelope", + "doc": "VolumeClaimSpecSelectorMatchExpressions properties", + "decorators": [], + "properties": [ + { + "$id": "1472", + "kind": "property", + "name": "key", + "serializedName": "key", + "doc": "key is the label key that the selector applies to.", + "type": { + "$id": "1473", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.IoTOperations.VolumeClaimSpecSelectorMatchExpressions.key", + "serializationOptions": { + "$id": "1474", + "json": { + "$id": "1475", + "name": "key" + } + } + }, + { + "$id": "1476", + "kind": "property", + "name": "operator", + "serializedName": "operator", + "doc": "operator represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists and DoesNotExist.", + "type": { + "$ref": "280" + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.IoTOperations.VolumeClaimSpecSelectorMatchExpressions.operator", + "serializationOptions": { + "$id": "1477", + "json": { + "$id": "1478", + "name": "operator" + } + } + }, + { + "$id": "1479", + "kind": "property", + "name": "values", + "serializedName": "values", + "doc": "values is an array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. This array is replaced during a strategic merge patch.", + "type": { + "$id": "1480", + "kind": "array", + "name": "Array", + "valueType": { + "$id": "1481", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.IoTOperations.VolumeClaimSpecSelectorMatchExpressions.values", + "serializationOptions": { + "$id": "1482", + "json": { + "$id": "1483", + "name": "values" + } + } + } + ] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.IoTOperations.VolumeClaimSpecSelector.matchExpressions", + "serializationOptions": { + "$id": "1484", + "json": { + "$id": "1485", + "name": "matchExpressions" + } + } + }, + { + "$id": "1486", + "kind": "property", + "name": "matchLabels", + "serializedName": "matchLabels", + "doc": "MatchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is \"key\", the operator is \"In\", and the values array contains only \"value\". The requirements are ANDed.", + "type": { + "$id": "1487", + "kind": "dict", + "keyType": { + "$id": "1488", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "valueType": { + "$id": "1489", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.IoTOperations.VolumeClaimSpecSelector.matchLabels", + "serializationOptions": { + "$id": "1490", + "json": { + "$id": "1491", + "name": "matchLabels" + } + } + } + ] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.IoTOperations.VolumeClaimSpec.selector", + "serializationOptions": { + "$id": "1492", + "json": { + "$id": "1493", + "name": "selector" + } + } + } + ] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.IoTOperations.DiskBackedMessageBuffer.ephemeralVolumeClaimSpec", + "serializationOptions": { + "$id": "1494", + "json": { + "$id": "1495", + "name": "ephemeralVolumeClaimSpec" + } + } + }, + { + "$id": "1496", + "kind": "property", + "name": "persistentVolumeClaimSpec", + "serializedName": "persistentVolumeClaimSpec", + "doc": "Use the specified persistent volume claim template to mount a persistent volume for the message buffer.", + "type": { + "$ref": "1397" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.IoTOperations.DiskBackedMessageBuffer.persistentVolumeClaimSpec", + "serializationOptions": { + "$id": "1497", + "json": { + "$id": "1498", + "name": "persistentVolumeClaimSpec" + } + } + } + ] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.IoTOperations.BrokerProperties.diskBackedMessageBuffer", + "serializationOptions": { + "$id": "1499", + "json": { + "$id": "1500", + "name": "diskBackedMessageBuffer" + } + } + }, + { + "$id": "1501", + "kind": "property", + "name": "generateResourceLimits", + "serializedName": "generateResourceLimits", + "doc": "This setting controls whether Kubernetes CPU resource limits are requested. Increasing the number of replicas or workers proportionally increases the amount of CPU resources requested. If this setting is enabled and there are insufficient CPU resources, an error will be emitted.", + "type": { + "$id": "1502", + "kind": "model", + "name": "GenerateResourceLimits", + "clientNamespace": "Microsoft.IoTOperations", + "crossLanguageDefinitionId": "Microsoft.IoTOperations.GenerateResourceLimits", + "usage": "Input,Output,Json,LroInitial,LroFinalEnvelope", + "doc": "GenerateResourceLimits properties", + "decorators": [], + "properties": [ + { + "$id": "1503", + "kind": "property", + "name": "cpu", + "serializedName": "cpu", + "doc": "The toggle to enable/disable cpu resource limits.", + "type": { + "$ref": "62" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.IoTOperations.GenerateResourceLimits.cpu", + "serializationOptions": { + "$id": "1504", + "json": { + "$id": "1505", + "name": "cpu" + } + } + } + ] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.IoTOperations.BrokerProperties.generateResourceLimits", + "serializationOptions": { + "$id": "1506", + "json": { + "$id": "1507", + "name": "generateResourceLimits" + } + } + }, + { + "$id": "1508", + "kind": "property", + "name": "memoryProfile", + "serializedName": "memoryProfile", + "doc": "Memory profile of Broker.", + "type": { + "$ref": "290" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.IoTOperations.BrokerProperties.memoryProfile", + "serializationOptions": { + "$id": "1509", + "json": { + "$id": "1510", + "name": "memoryProfile" + } + } + }, + { + "$id": "1511", + "kind": "property", + "name": "provisioningState", + "serializedName": "provisioningState", + "doc": "The status of the last operation.", + "type": { + "$ref": "126" + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.IoTOperations.BrokerProperties.provisioningState", + "serializationOptions": { + "$id": "1512", + "json": { + "$id": "1513", + "name": "provisioningState" + } + } + } + ] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.IoTOperations.BrokerResource.properties", + "serializationOptions": { + "$id": "1514", + "json": { + "$id": "1515", + "name": "properties" + } + } + }, + { + "$id": "1516", + "kind": "property", + "name": "extendedLocation", + "serializedName": "extendedLocation", + "doc": "Edge location of the resource.", + "type": { + "$ref": "669" + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.IoTOperations.BrokerResource.extendedLocation", + "serializationOptions": { + "$id": "1517", + "json": { + "$id": "1518", + "name": "extendedLocation" + } + } + } + ] + }, + { + "$ref": "1249" + }, + { + "$ref": "1251" + }, + { + "$ref": "1253" + }, + { + "$ref": "1267" + }, + { + "$ref": "1291" + }, + { + "$ref": "1308" + }, + { + "$ref": "1310" + }, + { + "$ref": "1326" + }, + { + "$ref": "1340" + }, + { + "$ref": "1348" + }, + { + "$ref": "1363" + }, + { + "$ref": "1372" + }, + { + "$ref": "1391" + }, + { + "$ref": "1397" + }, + { + "$ref": "1416" + }, + { + "$ref": "1432" + }, + { + "$ref": "1452" + }, + { + "$ref": "1468" + }, + { + "$ref": "1471" + }, + { + "$ref": "1502" + }, + { + "$id": "1519", + "kind": "model", + "name": "BrokerResourceListResult", + "clientNamespace": "Azure.ResourceManager", + "crossLanguageDefinitionId": "Azure.ResourceManager.ResourceListResult", + "usage": "Output,Json", + "doc": "The response of a BrokerResource list operation.", + "decorators": [], + "properties": [ + { + "$id": "1520", + "kind": "property", + "name": "value", + "serializedName": "value", + "doc": "The BrokerResource items on this page", + "type": { + "$id": "1521", + "kind": "array", + "name": "ArrayBrokerResource", + "valueType": { + "$ref": "1247" + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.ResourceListResult.value", + "serializationOptions": { + "$id": "1522", + "json": { + "$id": "1523", + "name": "value" + } + } + }, + { + "$id": "1524", + "kind": "property", + "name": "nextLink", + "serializedName": "nextLink", + "doc": "The link to the next page of items", + "type": { + "$id": "1525", + "kind": "url", + "name": "ResourceLocation", + "crossLanguageDefinitionId": "TypeSpec.Rest.ResourceLocation", + "baseType": { + "$id": "1526", + "kind": "url", + "name": "url", + "crossLanguageDefinitionId": "TypeSpec.url", + "decorators": [] + }, + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.ResourceListResult.nextLink", + "serializationOptions": { + "$id": "1527", + "json": { + "$id": "1528", + "name": "nextLink" + } + } + } + ] + }, + { + "$id": "1529", + "kind": "model", + "name": "IotOperationsInstance", + "clientNamespace": "Microsoft.IoTOperations", + "crossLanguageDefinitionId": "Microsoft.IoTOperations.InstanceResource", + "usage": "Input,Output,Json,LroInitial,LroFinalEnvelope", + "doc": "A Instance resource is a logical container for a set of child resources.", + "decorators": [], + "baseModel": { + "$id": "1530", + "kind": "model", + "name": "TrackedResource", + "clientNamespace": "Azure.ResourceManager.CommonTypes", + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.TrackedResource", + "usage": "Input,Output,Json,LroInitial,LroFinalEnvelope", + "doc": "The resource model definition for an Azure Resource Manager tracked top level resource which has 'tags' and a 'location'", + "decorators": [], + "baseModel": { + "$ref": "328" + }, + "properties": [ + { + "$id": "1531", + "kind": "property", + "name": "tags", + "serializedName": "tags", + "doc": "Resource tags.", + "type": { + "$id": "1532", + "kind": "dict", + "keyType": { + "$id": "1533", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "valueType": { + "$id": "1534", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.TrackedResource.tags", + "serializationOptions": { + "$id": "1535", + "json": { + "$id": "1536", + "name": "tags" + } + } + }, + { + "$id": "1537", + "kind": "property", + "name": "location", + "serializedName": "location", + "doc": "The geo-location where the resource lives", + "type": { + "$id": "1538", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.TrackedResource.location", + "serializationOptions": { + "$id": "1539", + "json": { + "$id": "1540", + "name": "location" + } + } + } + ] + }, + "properties": [ + { + "$id": "1541", + "kind": "property", + "name": "properties", + "serializedName": "properties", + "doc": "The resource-specific properties for this resource.", + "type": { + "$id": "1542", + "kind": "model", + "name": "IotOperationsInstanceProperties", + "clientNamespace": "Microsoft.IoTOperations", + "crossLanguageDefinitionId": "Microsoft.IoTOperations.InstanceProperties", + "usage": "Input,Output,Json,LroInitial,LroFinalEnvelope", + "doc": "The properties of the Instance resource.", + "decorators": [], + "properties": [ + { + "$id": "1543", + "kind": "property", + "name": "description", + "serializedName": "description", + "doc": "Detailed description of the Instance.", + "type": { + "$id": "1544", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.IoTOperations.InstanceProperties.description", + "serializationOptions": { + "$id": "1545", + "json": { + "$id": "1546", + "name": "description" + } + } + }, + { + "$id": "1547", + "kind": "property", + "name": "provisioningState", + "serializedName": "provisioningState", + "doc": "The status of the last operation.", + "type": { + "$ref": "126" + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.IoTOperations.InstanceProperties.provisioningState", + "serializationOptions": { + "$id": "1548", + "json": { + "$id": "1549", + "name": "provisioningState" + } + } + }, + { + "$id": "1550", + "kind": "property", + "name": "version", + "serializedName": "version", + "doc": "The Azure IoT Operations version.", + "type": { + "$id": "1551", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.IoTOperations.InstanceProperties.version", + "serializationOptions": { + "$id": "1552", + "json": { + "$id": "1553", + "name": "version" + } + } + }, + { + "$id": "1554", + "kind": "property", + "name": "schemaRegistryRef", + "serializedName": "schemaRegistryRef", + "doc": "The reference to the Schema Registry for this AIO Instance.", + "type": { + "$id": "1555", + "kind": "model", + "name": "SchemaRegistryRef", + "clientNamespace": "Microsoft.IoTOperations", + "crossLanguageDefinitionId": "Microsoft.IoTOperations.SchemaRegistryRef", + "usage": "Input,Output,Json,LroInitial,LroFinalEnvelope", + "doc": "The reference to the Schema Registry for this AIO Instance.", + "decorators": [], + "properties": [ + { + "$id": "1556", + "kind": "property", + "name": "resourceId", + "serializedName": "resourceId", + "doc": "The resource ID of the Schema Registry.", + "type": { + "$id": "1557", + "kind": "string", + "name": "SchemaRegistryID", + "crossLanguageDefinitionId": "Microsoft.IoTOperations.SchemaRegistryID", + "baseType": { + "$id": "1558", + "kind": "string", + "name": "armResourceIdentifier", + "crossLanguageDefinitionId": "Azure.Core.armResourceIdentifier", + "baseType": { + "$id": "1559", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.IoTOperations.SchemaRegistryRef.resourceId", + "serializationOptions": { + "$id": "1560", + "json": { + "$id": "1561", + "name": "resourceId" + } + } + } + ] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.IoTOperations.InstanceProperties.schemaRegistryRef", + "serializationOptions": { + "$id": "1562", + "json": { + "$id": "1563", + "name": "schemaRegistryRef" + } + } + } + ] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.IoTOperations.InstanceResource.properties", + "serializationOptions": { + "$id": "1564", + "json": { + "$id": "1565", + "name": "properties" + } + } + }, + { + "$id": "1566", + "kind": "property", + "name": "extendedLocation", + "serializedName": "extendedLocation", + "doc": "Edge location of the resource.", + "type": { + "$ref": "669" + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.IoTOperations.InstanceResource.extendedLocation", + "serializationOptions": { + "$id": "1567", + "json": { + "$id": "1568", + "name": "extendedLocation" + } + } + }, + { + "$id": "1569", + "kind": "property", + "name": "identity", + "serializedName": "identity", + "doc": "The managed service identities assigned to this resource.", + "type": { + "$id": "1570", + "kind": "model", + "name": "ManagedServiceIdentity", + "clientNamespace": "Azure.ResourceManager.CommonTypes", + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.ManagedServiceIdentity", + "usage": "Input,Output,Json,LroInitial,LroFinalEnvelope", + "doc": "Managed service identity (system assigned and/or user assigned identities)", + "decorators": [], + "properties": [ + { + "$id": "1571", + "kind": "property", + "name": "principalId", + "serializedName": "principalId", + "doc": "The service principal ID of the system assigned identity. This property will only be provided for a system assigned identity.", + "type": { + "$id": "1572", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "1573", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.ManagedServiceIdentity.principalId", + "serializationOptions": { + "$id": "1574", + "json": { + "$id": "1575", + "name": "principalId" + } + } + }, + { + "$id": "1576", + "kind": "property", + "name": "tenantId", + "serializedName": "tenantId", + "doc": "The tenant ID of the system assigned identity. This property will only be provided for a system assigned identity.", + "type": { + "$id": "1577", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "1578", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.ManagedServiceIdentity.tenantId", + "serializationOptions": { + "$id": "1579", + "json": { + "$id": "1580", + "name": "tenantId" + } + } + }, + { + "$id": "1581", + "kind": "property", + "name": "type", + "serializedName": "type", + "doc": "The type of managed identity assigned to this resource.", + "type": { + "$ref": "300" + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.ManagedServiceIdentity.type", + "serializationOptions": { + "$id": "1582", + "json": { + "$id": "1583", + "name": "type" + } + } + }, + { + "$id": "1584", + "kind": "property", + "name": "userAssignedIdentities", + "serializedName": "userAssignedIdentities", + "doc": "The identities assigned to this resource by the user.", + "type": { + "$id": "1585", + "kind": "dict", + "keyType": { + "$id": "1586", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "valueType": { + "$id": "1587", + "kind": "nullable", + "type": { + "$id": "1588", + "kind": "model", + "name": "UserAssignedIdentity", + "clientNamespace": "Azure.ResourceManager.CommonTypes", + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.UserAssignedIdentity", + "usage": "Input,Output,Json,LroInitial,LroFinalEnvelope", + "doc": "User assigned identity properties", + "decorators": [], + "properties": [ + { + "$id": "1589", + "kind": "property", + "name": "clientId", + "serializedName": "clientId", + "doc": "The client ID of the assigned identity.", + "type": { + "$id": "1590", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "1591", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.UserAssignedIdentity.clientId", + "serializationOptions": { + "$id": "1592", + "json": { + "$id": "1593", + "name": "clientId" + } + } + }, + { + "$id": "1594", + "kind": "property", + "name": "principalId", + "serializedName": "principalId", + "doc": "The principal ID of the assigned identity.", + "type": { + "$id": "1595", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "1596", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.UserAssignedIdentity.principalId", + "serializationOptions": { + "$id": "1597", + "json": { + "$id": "1598", + "name": "principalId" + } + } + } + ] + }, + "clientNamespace": "" + }, + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.ManagedServiceIdentity.userAssignedIdentities", + "serializationOptions": { + "$id": "1599", + "json": { + "$id": "1600", + "name": "userAssignedIdentities" + } + } + } + ] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.IoTOperations.InstanceResource.identity", + "serializationOptions": { + "$id": "1601", + "json": { + "$id": "1602", + "name": "identity" + } + } + } + ] + }, + { + "$ref": "1542" + }, + { + "$ref": "1555" + }, + { + "$ref": "1570" + }, + { + "$ref": "1588" + }, + { + "$ref": "1530" + }, + { + "$id": "1603", + "kind": "model", + "name": "InstancePatchModel", + "clientNamespace": "Microsoft.IoTOperations", + "crossLanguageDefinitionId": "Microsoft.IoTOperations.InstancePatchModel", + "usage": "Input,Json", + "doc": "The Instance update model.", + "decorators": [], + "properties": [ + { + "$id": "1604", + "kind": "property", + "name": "tags", + "serializedName": "tags", + "doc": "Resource tags.", + "type": { + "$id": "1605", + "kind": "dict", + "keyType": { + "$id": "1606", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "valueType": { + "$id": "1607", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.IoTOperations.InstancePatchModel.tags", + "serializationOptions": { + "$id": "1608", + "json": { + "$id": "1609", + "name": "tags" + } + } + }, + { + "$id": "1610", + "kind": "property", + "name": "identity", + "serializedName": "identity", + "doc": "The managed service identities assigned to this resource.", + "type": { + "$ref": "1570" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.IoTOperations.InstancePatchModel.identity", + "serializationOptions": { + "$id": "1611", + "json": { + "$id": "1612", + "name": "identity" + } + } + } + ] + }, + { + "$id": "1613", + "kind": "model", + "name": "InstanceResourceListResult", + "clientNamespace": "Azure.ResourceManager", + "crossLanguageDefinitionId": "Azure.ResourceManager.ResourceListResult", + "usage": "Output,Json", + "doc": "The response of a InstanceResource list operation.", + "decorators": [], + "properties": [ + { + "$id": "1614", + "kind": "property", + "name": "value", + "serializedName": "value", + "doc": "The InstanceResource items on this page", + "type": { + "$id": "1615", + "kind": "array", + "name": "ArrayInstanceResource", + "valueType": { + "$ref": "1529" + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.ResourceListResult.value", + "serializationOptions": { + "$id": "1616", + "json": { + "$id": "1617", + "name": "value" + } + } + }, + { + "$id": "1618", + "kind": "property", + "name": "nextLink", + "serializedName": "nextLink", + "doc": "The link to the next page of items", + "type": { + "$id": "1619", + "kind": "url", + "name": "ResourceLocation", + "crossLanguageDefinitionId": "TypeSpec.Rest.ResourceLocation", + "baseType": { + "$id": "1620", + "kind": "url", + "name": "url", + "crossLanguageDefinitionId": "TypeSpec.url", + "decorators": [] + }, + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.ResourceListResult.nextLink", + "serializationOptions": { + "$id": "1621", + "json": { + "$id": "1622", + "name": "nextLink" + } + } + } + ] + }, + { + "$id": "1623", + "kind": "model", + "name": "OperationListResult", + "clientNamespace": "Azure.ResourceManager.CommonTypes", + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.OperationListResult", + "usage": "Output,Json", + "doc": "A list of REST API operations supported by an Azure Resource Provider. It contains an URL link to get the next set of results.", + "decorators": [], + "properties": [ + { + "$id": "1624", + "kind": "property", + "name": "value", + "serializedName": "value", + "doc": "The Operation items on this page", + "type": { + "$id": "1625", + "kind": "array", + "name": "ArrayOperation", + "valueType": { + "$id": "1626", + "kind": "model", + "name": "Operation", + "clientNamespace": "Azure.ResourceManager.CommonTypes", + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.Operation", + "usage": "Output,Json", + "doc": "Details of a REST API operation, returned from the Resource Provider Operations API", + "decorators": [], + "properties": [ + { + "$id": "1627", + "kind": "property", + "name": "name", + "serializedName": "name", + "doc": "The name of the operation, as per Resource-Based Access Control (RBAC). Examples: \"Microsoft.Compute/virtualMachines/write\", \"Microsoft.Compute/virtualMachines/capture/action\"", + "type": { + "$id": "1628", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.Operation.name", + "serializationOptions": { + "$id": "1629", + "json": { + "$id": "1630", + "name": "name" + } + } + }, + { + "$id": "1631", + "kind": "property", + "name": "isDataAction", + "serializedName": "isDataAction", + "doc": "Whether the operation applies to data-plane. This is \"true\" for data-plane operations and \"false\" for Azure Resource Manager/control-plane operations.", + "type": { + "$id": "1632", + "kind": "boolean", + "name": "boolean", + "crossLanguageDefinitionId": "TypeSpec.boolean", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.Operation.isDataAction", + "serializationOptions": { + "$id": "1633", + "json": { + "$id": "1634", + "name": "isDataAction" + } + } + }, + { + "$id": "1635", + "kind": "property", + "name": "display", + "serializedName": "display", + "doc": "Localized display information for this particular operation.", + "type": { + "$id": "1636", + "kind": "model", + "name": "OperationDisplay", + "clientNamespace": "Azure.ResourceManager.CommonTypes", + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.OperationDisplay", + "usage": "Output,Json", + "doc": "Localized display information for and operation.", + "decorators": [], + "properties": [ + { + "$id": "1637", + "kind": "property", + "name": "provider", + "serializedName": "provider", + "doc": "The localized friendly form of the resource provider name, e.g. \"Microsoft Monitoring Insights\" or \"Microsoft Compute\".", + "type": { + "$id": "1638", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.OperationDisplay.provider", + "serializationOptions": { + "$id": "1639", + "json": { + "$id": "1640", + "name": "provider" + } + } + }, + { + "$id": "1641", + "kind": "property", + "name": "resource", + "serializedName": "resource", + "doc": "The localized friendly name of the resource type related to this operation. E.g. \"Virtual Machines\" or \"Job Schedule Collections\".", + "type": { + "$id": "1642", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.OperationDisplay.resource", + "serializationOptions": { + "$id": "1643", + "json": { + "$id": "1644", + "name": "resource" + } + } + }, + { + "$id": "1645", + "kind": "property", + "name": "operation", + "serializedName": "operation", + "doc": "The concise, localized friendly name for the operation; suitable for dropdowns. E.g. \"Create or Update Virtual Machine\", \"Restart Virtual Machine\".", + "type": { + "$id": "1646", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.OperationDisplay.operation", + "serializationOptions": { + "$id": "1647", + "json": { + "$id": "1648", + "name": "operation" + } + } + }, + { + "$id": "1649", + "kind": "property", + "name": "description", + "serializedName": "description", + "doc": "The short, localized friendly description of the operation; suitable for tool tips and detailed views.", + "type": { + "$id": "1650", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.OperationDisplay.description", + "serializationOptions": { + "$id": "1651", + "json": { + "$id": "1652", + "name": "description" + } + } + } + ] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.Operation.display", + "serializationOptions": { + "$id": "1653", + "json": { + "$id": "1654", + "name": "display" + } + } + }, + { + "$id": "1655", + "kind": "property", + "name": "origin", + "serializedName": "origin", + "doc": "The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default value is \"user,system\"", + "type": { + "$ref": "310" + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.Operation.origin", + "serializationOptions": { + "$id": "1656", + "json": { + "$id": "1657", + "name": "origin" + } + } + }, + { + "$id": "1658", + "kind": "property", + "name": "actionType", + "serializedName": "actionType", + "doc": "Extensible enum. Indicates the action type. \"Internal\" refers to actions that are for internal only APIs.", + "type": { + "$ref": "318" + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.Operation.actionType", + "serializationOptions": { + "$id": "1659", + "json": { + "$id": "1660", + "name": "actionType" + } + } + } + ] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.OperationListResult.value", + "serializationOptions": { + "$id": "1661", + "json": { + "$id": "1662", + "name": "value" + } + } + }, + { + "$id": "1663", + "kind": "property", + "name": "nextLink", + "serializedName": "nextLink", + "doc": "The link to the next page of items", + "type": { + "$id": "1664", + "kind": "url", + "name": "ResourceLocation", + "crossLanguageDefinitionId": "TypeSpec.Rest.ResourceLocation", + "baseType": { + "$id": "1665", + "kind": "url", + "name": "url", + "crossLanguageDefinitionId": "TypeSpec.url", + "decorators": [] + }, + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.OperationListResult.nextLink", + "serializationOptions": { + "$id": "1666", + "json": { + "$id": "1667", + "name": "nextLink" + } + } + } + ] + }, + { + "$ref": "1626" + }, + { + "$ref": "1636" + } + ], + "Clients": [ + { + "$id": "1668", + "Name": "IoTOperationsClient", + "ClientNamespace": "Microsoft.IoTOperations", + "Doc": "Microsoft.IoTOperations Resource Provider management API.", + "Operations": [], + "Protocol": { + "$id": "1669" + }, + "Parameters": [ + { + "$id": "1670", + "Name": "endpoint", + "NameInRequest": "endpoint", + "Doc": "Service host", + "Type": { + "$id": "1671", + "kind": "url", + "name": "url", + "crossLanguageDefinitionId": "TypeSpec.url" + }, + "Location": "Uri", + "IsApiVersion": false, + "IsResourceParameter": false, + "IsContentType": false, + "IsRequired": true, + "IsEndpoint": true, + "SkipUrlEncoding": false, + "Explode": false, + "Kind": "Client", + "DefaultValue": { + "$id": "1672", + "Type": { + "$id": "1673", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "https://management.azure.com" + } + } + ], + "Decorators": [] + }, + { + "$id": "1674", + "Name": "Operations", + "ClientNamespace": "Microsoft.IoTOperations", + "Operations": [ + { + "$id": "1675", + "Name": "list", + "ResourceName": "Operations", + "Doc": "List the operations for the provider", + "Accessibility": "public", + "Parameters": [ + { + "$id": "1676", + "Name": "apiVersion", + "NameInRequest": "api-version", + "Doc": "The API version to use for this operation.", + "Type": { + "$id": "1677", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": true, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "DefaultValue": { + "$id": "1678", + "Type": { + "$id": "1679", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "2024-11-01" + }, + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1680", + "Name": "accept", + "NameInRequest": "Accept", + "Type": { + "$id": "1681", + "kind": "constant", + "valueType": { + "$id": "1682", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "1683", + "StatusCodes": [ + 200 + ], + "BodyType": { + "$ref": "1623" + }, + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false, + "ContentTypes": [ + "application/json" + ] + } + ], + "HttpMethod": "GET", + "RequestBodyMediaType": "None", + "Uri": "{endpoint}", + "Path": "/providers/Microsoft.IoTOperations/operations", + "BufferResponse": true, + "Paging": { + "$id": "1684", + "ItemName": "value", + "NextLinkName": "nextLink" + }, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Azure.ResourceManager.Operations.list", + "Decorators": [], + "Examples": [ + { + "$id": "1685", + "kind": "http", + "name": "Operations_List", + "description": "Operations_List", + "filePath": "2024-11-01/Operations_List_MaximumSet_Gen.json", + "parameters": [ + { + "$id": "1686", + "parameter": { + "$ref": "1676" + }, + "value": { + "$id": "1687", + "kind": "string", + "type": { + "$ref": "1677" + }, + "value": "2024-11-01" + } + } + ], + "responses": [ + { + "$id": "1688", + "response": { + "$ref": "1683" + }, + "statusCode": 200, + "bodyValue": { + "$id": "1689", + "kind": "model", + "type": { + "$ref": "1623" + }, + "value": { + "$id": "1690", + "value": { + "$id": "1691", + "kind": "array", + "type": { + "$ref": "1625" + }, + "value": [ + { + "$id": "1692", + "kind": "model", + "type": { + "$ref": "1626" + }, + "value": { + "$id": "1693", + "name": { + "$id": "1694", + "kind": "string", + "type": { + "$ref": "1628" + }, + "value": "xzxqfusky" + }, + "isDataAction": { + "$id": "1695", + "kind": "boolean", + "type": { + "$ref": "1632" + }, + "value": true + }, + "display": { + "$id": "1696", + "kind": "model", + "type": { + "$ref": "1636" + }, + "value": { + "$id": "1697", + "provider": { + "$id": "1698", + "kind": "string", + "type": { + "$ref": "1638" + }, + "value": "lrveskajtuwf" + }, + "resource": { + "$id": "1699", + "kind": "string", + "type": { + "$ref": "1642" + }, + "value": "d" + }, + "operation": { + "$id": "1700", + "kind": "string", + "type": { + "$ref": "1646" + }, + "value": "icuckgobartrrgmirax" + }, + "description": { + "$id": "1701", + "kind": "string", + "type": { + "$ref": "1650" + }, + "value": "dsbfnxzvnoqdm" + } + } + }, + "origin": { + "$id": "1702", + "kind": "string", + "type": { + "$ref": "310" + }, + "value": "user" + }, + "actionType": { + "$id": "1703", + "kind": "string", + "type": { + "$ref": "318" + }, + "value": "Internal" + } + } + } + ] + }, + "nextLink": { + "$id": "1704", + "kind": "string", + "type": { + "$ref": "1664" + }, + "value": "https://microsoft.com/a" + } + } + } + } + ] + } + ] + } + ], + "Protocol": { + "$id": "1705" + }, + "Parent": "IoTOperationsClient", + "Parameters": [ + { + "$id": "1706", + "Name": "endpoint", + "NameInRequest": "endpoint", + "Doc": "Service host", + "Type": { + "$id": "1707", + "kind": "url", + "name": "url", + "crossLanguageDefinitionId": "TypeSpec.url" + }, + "Location": "Uri", + "IsApiVersion": false, + "IsResourceParameter": false, + "IsContentType": false, + "IsRequired": true, + "IsEndpoint": true, + "SkipUrlEncoding": false, + "Explode": false, + "Kind": "Client", + "DefaultValue": { + "$id": "1708", + "Type": { + "$id": "1709", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "https://management.azure.com" + } + } + ], + "Decorators": [] + }, + { + "$id": "1710", + "Name": "Instance", + "ClientNamespace": "Microsoft.IoTOperations", + "Operations": [ + { + "$id": "1711", + "Name": "get", + "ResourceName": "InstanceResource", + "Doc": "Get a InstanceResource", + "Accessibility": "public", + "Parameters": [ + { + "$id": "1712", + "Name": "apiVersion", + "NameInRequest": "api-version", + "Doc": "The API version to use for this operation.", + "Type": { + "$id": "1713", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": true, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "DefaultValue": { + "$id": "1714", + "Type": { + "$id": "1715", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "2024-11-01" + }, + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1716", + "Name": "subscriptionId", + "NameInRequest": "subscriptionId", + "Doc": "The ID of the target subscription. The value must be an UUID.", + "Type": { + "$id": "1717", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "1718", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1719", + "Name": "resourceGroupName", + "NameInRequest": "resourceGroupName", + "Doc": "The name of the resource group. The name is case insensitive.", + "Type": { + "$id": "1720", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1721", + "Name": "instanceName", + "NameInRequest": "instanceName", + "Doc": "Name of instance.", + "Type": { + "$id": "1722", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1723", + "Name": "accept", + "NameInRequest": "Accept", + "Type": { + "$id": "1724", + "kind": "constant", + "valueType": { + "$id": "1725", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "1726", + "StatusCodes": [ + 200 + ], + "BodyType": { + "$ref": "1529" + }, + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false, + "ContentTypes": [ + "application/json" + ] + } + ], + "HttpMethod": "GET", + "RequestBodyMediaType": "None", + "Uri": "{endpoint}", + "Path": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}", + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Microsoft.IoTOperations.Instance.get", + "Decorators": [], + "Examples": [ + { + "$id": "1727", + "kind": "http", + "name": "Instance_Get", + "description": "Instance_Get", + "filePath": "2024-11-01/Instance_Get_MaximumSet_Gen.json", + "parameters": [ + { + "$id": "1728", + "parameter": { + "$ref": "1712" + }, + "value": { + "$id": "1729", + "kind": "string", + "type": { + "$ref": "1713" + }, + "value": "2024-11-01" + } + }, + { + "$id": "1730", + "parameter": { + "$ref": "1716" + }, + "value": { + "$id": "1731", + "kind": "string", + "type": { + "$ref": "1717" + }, + "value": "F8C729F9-DF9C-4743-848F-96EE433D8E53" + } + }, + { + "$id": "1732", + "parameter": { + "$ref": "1719" + }, + "value": { + "$id": "1733", + "kind": "string", + "type": { + "$ref": "1720" + }, + "value": "rgiotoperations" + } + }, + { + "$id": "1734", + "parameter": { + "$ref": "1721" + }, + "value": { + "$id": "1735", + "kind": "string", + "type": { + "$ref": "1722" + }, + "value": "aio-instance" + } + } + ], + "responses": [ + { + "$id": "1736", + "response": { + "$ref": "1726" + }, + "statusCode": 200, + "bodyValue": { + "$id": "1737", + "kind": "model", + "type": { + "$ref": "1529" + }, + "value": { + "$id": "1738", + "properties": { + "$id": "1739", + "kind": "model", + "type": { + "$ref": "1542" + }, + "value": { + "$id": "1740", + "schemaRegistryRef": { + "$id": "1741", + "kind": "model", + "type": { + "$ref": "1555" + }, + "value": { + "$id": "1742", + "resourceId": { + "$id": "1743", + "kind": "string", + "type": { + "$ref": "1557" + }, + "value": "/subscriptions/0000000-0000-0000-0000-000000000000/resourceGroups/resourceGroup123/providers/Microsoft.DeviceRegistry/schemaRegistries/resource-name123" + } + } + }, + "description": { + "$id": "1744", + "kind": "string", + "type": { + "$ref": "1544" + }, + "value": "rlfvvnnhcypp" + }, + "provisioningState": { + "$id": "1745", + "kind": "string", + "type": { + "$ref": "126" + }, + "value": "Succeeded" + }, + "version": { + "$id": "1746", + "kind": "string", + "type": { + "$ref": "1551" + }, + "value": "vjjbmunthiphfmekvxgxcxkzdwjti" + } + } + }, + "extendedLocation": { + "$id": "1747", + "kind": "model", + "type": { + "$ref": "669" + }, + "value": { + "$id": "1748", + "name": { + "$id": "1749", + "kind": "string", + "type": { + "$ref": "671" + }, + "value": "qmbrfwcpwwhggszhrdjv" + }, + "type": { + "$id": "1750", + "kind": "string", + "type": { + "$ref": "142" + }, + "value": "CustomLocation" + } + } + }, + "identity": { + "$id": "1751", + "kind": "model", + "type": { + "$ref": "1570" + }, + "value": { + "$id": "1752", + "type": { + "$id": "1753", + "kind": "string", + "type": { + "$ref": "300" + }, + "value": "None" + }, + "userAssignedIdentities": { + "$id": "1754", + "kind": "dict", + "type": { + "$ref": "1585" + }, + "value": { + "$id": "1755" + } + }, + "principalId": { + "$id": "1756", + "kind": "string", + "type": { + "$ref": "1572" + }, + "value": "4a6e4195-75b8-4685-aa0c-0b5704779327" + }, + "tenantId": { + "$id": "1757", + "kind": "string", + "type": { + "$ref": "1577" + }, + "value": "ed060aa2-71ff-4d3f-99c4-a9138356fdec" + } + } + }, + "tags": { + "$id": "1758", + "kind": "dict", + "type": { + "$ref": "1532" + }, + "value": { + "$id": "1759" + } + }, + "location": { + "$id": "1760", + "kind": "string", + "type": { + "$ref": "1538" + }, + "value": "xvewadyhycrjpu" + }, + "id": { + "$id": "1761", + "kind": "string", + "type": { + "$ref": "330" + }, + "value": "/subscriptions/0000000-0000-0000-0000-000000000000/resourceGroups/resourceGroup123/providers/Microsoft.IoTOperations/instances/resource-name123" + }, + "name": { + "$id": "1762", + "kind": "string", + "type": { + "$ref": "335" + }, + "value": "llptmlifnqqwairx" + }, + "type": { + "$id": "1763", + "kind": "string", + "type": { + "$ref": "339" + }, + "value": "qwrfzxjfxvismlqvigot" + }, + "systemData": { + "$id": "1764", + "kind": "model", + "type": { + "$ref": "344" + }, + "value": { + "$id": "1765", + "createdBy": { + "$id": "1766", + "kind": "string", + "type": { + "$ref": "346" + }, + "value": "ssvaslsmudloholronopqyxjcu" + }, + "createdByType": { + "$id": "1767", + "kind": "string", + "type": { + "$ref": "146" + }, + "value": "User" + }, + "createdAt": { + "$id": "1768", + "kind": "string", + "type": { + "$ref": "353" + }, + "value": "2024-08-09T18:13:29.389Z" + }, + "lastModifiedBy": { + "$id": "1769", + "kind": "string", + "type": { + "$ref": "358" + }, + "value": "gnicpuszwd" + }, + "lastModifiedByType": { + "$id": "1770", + "kind": "string", + "type": { + "$ref": "146" + }, + "value": "User" + }, + "lastModifiedAt": { + "$id": "1771", + "kind": "string", + "type": { + "$ref": "365" + }, + "value": "2024-08-09T18:13:29.389Z" + } + } + } + } + } + } + ] + } + ] + }, + { + "$id": "1772", + "Name": "createOrUpdate", + "ResourceName": "InstanceResource", + "Doc": "Create a InstanceResource", + "Accessibility": "public", + "Parameters": [ + { + "$id": "1773", + "Name": "apiVersion", + "NameInRequest": "api-version", + "Doc": "The API version to use for this operation.", + "Type": { + "$id": "1774", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": true, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "DefaultValue": { + "$id": "1775", + "Type": { + "$id": "1776", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "2024-11-01" + }, + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1777", + "Name": "subscriptionId", + "NameInRequest": "subscriptionId", + "Doc": "The ID of the target subscription. The value must be an UUID.", + "Type": { + "$id": "1778", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "1779", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1780", + "Name": "resourceGroupName", + "NameInRequest": "resourceGroupName", + "Doc": "The name of the resource group. The name is case insensitive.", + "Type": { + "$id": "1781", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1782", + "Name": "instanceName", + "NameInRequest": "instanceName", + "Doc": "Name of instance.", + "Type": { + "$id": "1783", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1784", + "Name": "contentType", + "NameInRequest": "Content-Type", + "Doc": "Body parameter's content type. Known values are application/json", + "Type": { + "$id": "1785", + "kind": "constant", + "valueType": { + "$id": "1786", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": true, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1787", + "Name": "accept", + "NameInRequest": "Accept", + "Type": { + "$id": "1788", + "kind": "constant", + "valueType": { + "$id": "1789", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1790", + "Name": "resource", + "NameInRequest": "resource", + "Doc": "Resource create parameters.", + "Type": { + "$ref": "1529" + }, + "Location": "Body", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "1791", + "StatusCodes": [ + 200 + ], + "BodyType": { + "$ref": "1529" + }, + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false, + "ContentTypes": [ + "application/json" + ] + }, + { + "$id": "1792", + "StatusCodes": [ + 201 + ], + "BodyType": { + "$ref": "1529" + }, + "BodyMediaType": "Json", + "Headers": [ + { + "$id": "1793", + "Name": "azureAsyncOperation", + "NameInResponse": "Azure-AsyncOperation", + "Doc": "A link to the status monitor", + "Type": { + "$id": "1794", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + } + }, + { + "$id": "1795", + "Name": "retryAfter", + "NameInResponse": "Retry-After", + "Doc": "The Retry-After header can indicate how long the client should wait before polling the operation status.", + "Type": { + "$id": "1796", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + } + } + ], + "IsErrorResponse": false, + "ContentTypes": [ + "application/json" + ] + } + ], + "HttpMethod": "PUT", + "RequestBodyMediaType": "Json", + "Uri": "{endpoint}", + "Path": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}", + "RequestMediaTypes": [ + "application/json" + ], + "BufferResponse": true, + "LongRunning": { + "$id": "1797", + "FinalStateVia": 0, + "FinalResponse": { + "$id": "1798", + "StatusCodes": [ + 200 + ], + "BodyType": { + "$ref": "1529" + }, + "BodyMediaType": "Json" + } + }, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Microsoft.IoTOperations.Instance.createOrUpdate", + "Decorators": [], + "Examples": [ + { + "$id": "1799", + "kind": "http", + "name": "Instance_CreateOrUpdate", + "description": "Instance_CreateOrUpdate", + "filePath": "2024-11-01/Instance_CreateOrUpdate_MaximumSet_Gen.json", + "parameters": [ + { + "$id": "1800", + "parameter": { + "$ref": "1773" + }, + "value": { + "$id": "1801", + "kind": "string", + "type": { + "$ref": "1774" + }, + "value": "2024-11-01" + } + }, + { + "$id": "1802", + "parameter": { + "$ref": "1777" + }, + "value": { + "$id": "1803", + "kind": "string", + "type": { + "$ref": "1778" + }, + "value": "F8C729F9-DF9C-4743-848F-96EE433D8E53" + } + }, + { + "$id": "1804", + "parameter": { + "$ref": "1780" + }, + "value": { + "$id": "1805", + "kind": "string", + "type": { + "$ref": "1781" + }, + "value": "rgiotoperations" + } + }, + { + "$id": "1806", + "parameter": { + "$ref": "1782" + }, + "value": { + "$id": "1807", + "kind": "string", + "type": { + "$ref": "1783" + }, + "value": "aio-instance" + } + }, + { + "$id": "1808", + "parameter": { + "$ref": "1790" + }, + "value": { + "$id": "1809", + "kind": "model", + "type": { + "$ref": "1529" + }, + "value": { + "$id": "1810", + "properties": { + "$id": "1811", + "kind": "model", + "type": { + "$ref": "1542" + }, + "value": { + "$id": "1812", + "schemaRegistryRef": { + "$id": "1813", + "kind": "model", + "type": { + "$ref": "1555" + }, + "value": { + "$id": "1814", + "resourceId": { + "$id": "1815", + "kind": "string", + "type": { + "$ref": "1557" + }, + "value": "/subscriptions/0000000-0000-0000-0000-000000000000/resourceGroups/resourceGroup123/providers/Microsoft.DeviceRegistry/schemaRegistries/resource-name123" + } + } + }, + "description": { + "$id": "1816", + "kind": "string", + "type": { + "$ref": "1544" + }, + "value": "kpqtgocs" + } + } + }, + "extendedLocation": { + "$id": "1817", + "kind": "model", + "type": { + "$ref": "669" + }, + "value": { + "$id": "1818", + "name": { + "$id": "1819", + "kind": "string", + "type": { + "$ref": "671" + }, + "value": "qmbrfwcpwwhggszhrdjv" + }, + "type": { + "$id": "1820", + "kind": "string", + "type": { + "$ref": "142" + }, + "value": "CustomLocation" + } + } + }, + "identity": { + "$id": "1821", + "kind": "model", + "type": { + "$ref": "1570" + }, + "value": { + "$id": "1822", + "type": { + "$id": "1823", + "kind": "string", + "type": { + "$ref": "300" + }, + "value": "None" + }, + "userAssignedIdentities": { + "$id": "1824", + "kind": "dict", + "type": { + "$ref": "1585" + }, + "value": { + "$id": "1825" + } + } + } + }, + "tags": { + "$id": "1826", + "kind": "dict", + "type": { + "$ref": "1532" + }, + "value": { + "$id": "1827" + } + }, + "location": { + "$id": "1828", + "kind": "string", + "type": { + "$ref": "1538" + }, + "value": "xvewadyhycrjpu" + } + } + } + } + ], + "responses": [ + { + "$id": "1829", + "response": { + "$ref": "1791" + }, + "statusCode": 200, + "bodyValue": { + "$id": "1830", + "kind": "model", + "type": { + "$ref": "1529" + }, + "value": { + "$id": "1831", + "properties": { + "$id": "1832", + "kind": "model", + "type": { + "$ref": "1542" + }, + "value": { + "$id": "1833", + "schemaRegistryRef": { + "$id": "1834", + "kind": "model", + "type": { + "$ref": "1555" + }, + "value": { + "$id": "1835", + "resourceId": { + "$id": "1836", + "kind": "string", + "type": { + "$ref": "1557" + }, + "value": "/subscriptions/0000000-0000-0000-0000-000000000000/resourceGroups/resourceGroup123/providers/Microsoft.DeviceRegistry/schemaRegistries/resource-name123" + } + } + }, + "description": { + "$id": "1837", + "kind": "string", + "type": { + "$ref": "1544" + }, + "value": "kpqtgocs" + }, + "provisioningState": { + "$id": "1838", + "kind": "string", + "type": { + "$ref": "126" + }, + "value": "Succeeded" + }, + "version": { + "$id": "1839", + "kind": "string", + "type": { + "$ref": "1551" + }, + "value": "vjjbmunthiphfmekvxgxcxkzdwjti" + } + } + }, + "extendedLocation": { + "$id": "1840", + "kind": "model", + "type": { + "$ref": "669" + }, + "value": { + "$id": "1841", + "name": { + "$id": "1842", + "kind": "string", + "type": { + "$ref": "671" + }, + "value": "qmbrfwcpwwhggszhrdjv" + }, + "type": { + "$id": "1843", + "kind": "string", + "type": { + "$ref": "142" + }, + "value": "CustomLocation" + } + } + }, + "identity": { + "$id": "1844", + "kind": "model", + "type": { + "$ref": "1570" + }, + "value": { + "$id": "1845", + "type": { + "$id": "1846", + "kind": "string", + "type": { + "$ref": "300" + }, + "value": "None" + }, + "userAssignedIdentities": { + "$id": "1847", + "kind": "dict", + "type": { + "$ref": "1585" + }, + "value": { + "$id": "1848" + } + }, + "principalId": { + "$id": "1849", + "kind": "string", + "type": { + "$ref": "1572" + }, + "value": "4a6e4195-75b8-4685-aa0c-0b5704779327" + }, + "tenantId": { + "$id": "1850", + "kind": "string", + "type": { + "$ref": "1577" + }, + "value": "ed060aa2-71ff-4d3f-99c4-a9138356fdec" + } + } + }, + "tags": { + "$id": "1851", + "kind": "dict", + "type": { + "$ref": "1532" + }, + "value": { + "$id": "1852" + } + }, + "location": { + "$id": "1853", + "kind": "string", + "type": { + "$ref": "1538" + }, + "value": "xvewadyhycrjpu" + }, + "id": { + "$id": "1854", + "kind": "string", + "type": { + "$ref": "330" + }, + "value": "/subscriptions/0000000-0000-0000-0000-000000000000/resourceGroups/resourceGroup123/providers/Microsoft.IoTOperations/instances/resource-name123" + }, + "name": { + "$id": "1855", + "kind": "string", + "type": { + "$ref": "335" + }, + "value": "llptmlifnqqwairx" + }, + "type": { + "$id": "1856", + "kind": "string", + "type": { + "$ref": "339" + }, + "value": "qwrfzxjfxvismlqvigot" + }, + "systemData": { + "$id": "1857", + "kind": "model", + "type": { + "$ref": "344" + }, + "value": { + "$id": "1858", + "createdBy": { + "$id": "1859", + "kind": "string", + "type": { + "$ref": "346" + }, + "value": "ssvaslsmudloholronopqyxjcu" + }, + "createdByType": { + "$id": "1860", + "kind": "string", + "type": { + "$ref": "146" + }, + "value": "User" + }, + "createdAt": { + "$id": "1861", + "kind": "string", + "type": { + "$ref": "353" + }, + "value": "2024-08-09T18:13:29.389Z" + }, + "lastModifiedBy": { + "$id": "1862", + "kind": "string", + "type": { + "$ref": "358" + }, + "value": "gnicpuszwd" + }, + "lastModifiedByType": { + "$id": "1863", + "kind": "string", + "type": { + "$ref": "146" + }, + "value": "User" + }, + "lastModifiedAt": { + "$id": "1864", + "kind": "string", + "type": { + "$ref": "365" + }, + "value": "2024-08-09T18:13:29.389Z" + } + } + } + } + } + }, + { + "$id": "1865", + "response": { + "$ref": "1792" + }, + "statusCode": 201, + "bodyValue": { + "$id": "1866", + "kind": "model", + "type": { + "$ref": "1529" + }, + "value": { + "$id": "1867", + "properties": { + "$id": "1868", + "kind": "model", + "type": { + "$ref": "1542" + }, + "value": { + "$id": "1869", + "schemaRegistryRef": { + "$id": "1870", + "kind": "model", + "type": { + "$ref": "1555" + }, + "value": { + "$id": "1871", + "resourceId": { + "$id": "1872", + "kind": "string", + "type": { + "$ref": "1557" + }, + "value": "/subscriptions/0000000-0000-0000-0000-000000000000/resourceGroups/resourceGroup123/providers/Microsoft.DeviceRegistry/schemaRegistries/resource-name123" + } + } + }, + "description": { + "$id": "1873", + "kind": "string", + "type": { + "$ref": "1544" + }, + "value": "kpqtgocs" + }, + "provisioningState": { + "$id": "1874", + "kind": "string", + "type": { + "$ref": "126" + }, + "value": "Succeeded" + }, + "version": { + "$id": "1875", + "kind": "string", + "type": { + "$ref": "1551" + }, + "value": "vjjbmunthiphfmekvxgxcxkzdwjti" + } + } + }, + "extendedLocation": { + "$id": "1876", + "kind": "model", + "type": { + "$ref": "669" + }, + "value": { + "$id": "1877", + "name": { + "$id": "1878", + "kind": "string", + "type": { + "$ref": "671" + }, + "value": "qmbrfwcpwwhggszhrdjv" + }, + "type": { + "$id": "1879", + "kind": "string", + "type": { + "$ref": "142" + }, + "value": "CustomLocation" + } + } + }, + "identity": { + "$id": "1880", + "kind": "model", + "type": { + "$ref": "1570" + }, + "value": { + "$id": "1881", + "type": { + "$id": "1882", + "kind": "string", + "type": { + "$ref": "300" + }, + "value": "None" + }, + "userAssignedIdentities": { + "$id": "1883", + "kind": "dict", + "type": { + "$ref": "1585" + }, + "value": { + "$id": "1884" + } + }, + "principalId": { + "$id": "1885", + "kind": "string", + "type": { + "$ref": "1572" + }, + "value": "4a6e4195-75b8-4685-aa0c-0b5704779327" + }, + "tenantId": { + "$id": "1886", + "kind": "string", + "type": { + "$ref": "1577" + }, + "value": "ed060aa2-71ff-4d3f-99c4-a9138356fdec" + } + } + }, + "tags": { + "$id": "1887", + "kind": "dict", + "type": { + "$ref": "1532" + }, + "value": { + "$id": "1888" + } + }, + "location": { + "$id": "1889", + "kind": "string", + "type": { + "$ref": "1538" + }, + "value": "xvewadyhycrjpu" + }, + "id": { + "$id": "1890", + "kind": "string", + "type": { + "$ref": "330" + }, + "value": "/subscriptions/0000000-0000-0000-0000-000000000000/resourceGroups/resourceGroup123/providers/Microsoft.IoTOperations/instances/resource-name123" + }, + "name": { + "$id": "1891", + "kind": "string", + "type": { + "$ref": "335" + }, + "value": "llptmlifnqqwairx" + }, + "type": { + "$id": "1892", + "kind": "string", + "type": { + "$ref": "339" + }, + "value": "qwrfzxjfxvismlqvigot" + }, + "systemData": { + "$id": "1893", + "kind": "model", + "type": { + "$ref": "344" + }, + "value": { + "$id": "1894", + "createdBy": { + "$id": "1895", + "kind": "string", + "type": { + "$ref": "346" + }, + "value": "ssvaslsmudloholronopqyxjcu" + }, + "createdByType": { + "$id": "1896", + "kind": "string", + "type": { + "$ref": "146" + }, + "value": "User" + }, + "createdAt": { + "$id": "1897", + "kind": "string", + "type": { + "$ref": "353" + }, + "value": "2024-08-09T18:13:29.389Z" + }, + "lastModifiedBy": { + "$id": "1898", + "kind": "string", + "type": { + "$ref": "358" + }, + "value": "gnicpuszwd" + }, + "lastModifiedByType": { + "$id": "1899", + "kind": "string", + "type": { + "$ref": "146" + }, + "value": "User" + }, + "lastModifiedAt": { + "$id": "1900", + "kind": "string", + "type": { + "$ref": "365" + }, + "value": "2024-08-09T18:13:29.389Z" + } + } + } + } + } + } + ] + } + ] + }, + { + "$id": "1901", + "Name": "update", + "ResourceName": "InstanceResource", + "Doc": "Update a InstanceResource", + "Accessibility": "public", + "Parameters": [ + { + "$id": "1902", + "Name": "apiVersion", + "NameInRequest": "api-version", + "Doc": "The API version to use for this operation.", + "Type": { + "$id": "1903", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": true, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "DefaultValue": { + "$id": "1904", + "Type": { + "$id": "1905", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "2024-11-01" + }, + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1906", + "Name": "subscriptionId", + "NameInRequest": "subscriptionId", + "Doc": "The ID of the target subscription. The value must be an UUID.", + "Type": { + "$id": "1907", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "1908", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1909", + "Name": "resourceGroupName", + "NameInRequest": "resourceGroupName", + "Doc": "The name of the resource group. The name is case insensitive.", + "Type": { + "$id": "1910", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1911", + "Name": "instanceName", + "NameInRequest": "instanceName", + "Doc": "Name of instance.", + "Type": { + "$id": "1912", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1913", + "Name": "contentType", + "NameInRequest": "Content-Type", + "Doc": "Body parameter's content type. Known values are application/json", + "Type": { + "$id": "1914", + "kind": "constant", + "valueType": { + "$id": "1915", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": true, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1916", + "Name": "accept", + "NameInRequest": "Accept", + "Type": { + "$id": "1917", + "kind": "constant", + "valueType": { + "$id": "1918", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1919", + "Name": "properties", + "NameInRequest": "properties", + "Doc": "The resource properties to be updated.", + "Type": { + "$ref": "1603" + }, + "Location": "Body", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "1920", + "StatusCodes": [ + 200 + ], + "BodyType": { + "$ref": "1529" + }, + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false, + "ContentTypes": [ + "application/json" + ] + } + ], + "HttpMethod": "PATCH", + "RequestBodyMediaType": "Json", + "Uri": "{endpoint}", + "Path": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}", + "RequestMediaTypes": [ + "application/json" + ], + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": false, + "CrossLanguageDefinitionId": "Microsoft.IoTOperations.Instance.update", + "Decorators": [], + "Examples": [ + { + "$id": "1921", + "kind": "http", + "name": "Instance_Update", + "description": "Instance_Update", + "filePath": "2024-11-01/Instance_Update_MaximumSet_Gen.json", + "parameters": [ + { + "$id": "1922", + "parameter": { + "$ref": "1902" + }, + "value": { + "$id": "1923", + "kind": "string", + "type": { + "$ref": "1903" + }, + "value": "2024-11-01" + } + }, + { + "$id": "1924", + "parameter": { + "$ref": "1906" + }, + "value": { + "$id": "1925", + "kind": "string", + "type": { + "$ref": "1907" + }, + "value": "F8C729F9-DF9C-4743-848F-96EE433D8E53" + } + }, + { + "$id": "1926", + "parameter": { + "$ref": "1909" + }, + "value": { + "$id": "1927", + "kind": "string", + "type": { + "$ref": "1910" + }, + "value": "rgiotoperations" + } + }, + { + "$id": "1928", + "parameter": { + "$ref": "1911" + }, + "value": { + "$id": "1929", + "kind": "string", + "type": { + "$ref": "1912" + }, + "value": "aio-instance" + } + }, + { + "$id": "1930", + "parameter": { + "$ref": "1919" + }, + "value": { + "$id": "1931", + "kind": "model", + "type": { + "$ref": "1603" + }, + "value": { + "$id": "1932", + "tags": { + "$id": "1933", + "kind": "dict", + "type": { + "$ref": "1605" + }, + "value": { + "$id": "1934" + } + }, + "identity": { + "$id": "1935", + "kind": "model", + "type": { + "$ref": "1570" + }, + "value": { + "$id": "1936", + "type": { + "$id": "1937", + "kind": "string", + "type": { + "$ref": "300" + }, + "value": "None" + }, + "userAssignedIdentities": { + "$id": "1938", + "kind": "dict", + "type": { + "$ref": "1585" + }, + "value": { + "$id": "1939" + } + } + } + } + } + } + } + ], + "responses": [ + { + "$id": "1940", + "response": { + "$ref": "1920" + }, + "statusCode": 200, + "bodyValue": { + "$id": "1941", + "kind": "model", + "type": { + "$ref": "1529" + }, + "value": { + "$id": "1942", + "properties": { + "$id": "1943", + "kind": "model", + "type": { + "$ref": "1542" + }, + "value": { + "$id": "1944", + "schemaRegistryRef": { + "$id": "1945", + "kind": "model", + "type": { + "$ref": "1555" + }, + "value": { + "$id": "1946", + "resourceId": { + "$id": "1947", + "kind": "string", + "type": { + "$ref": "1557" + }, + "value": "/subscriptions/0000000-0000-0000-0000-000000000000/resourceGroups/resourceGroup123/providers/Microsoft.DeviceRegistry/schemaRegistries/resource-name123" + } + } + }, + "description": { + "$id": "1948", + "kind": "string", + "type": { + "$ref": "1544" + }, + "value": "wwihkapmgjbyrtyaj" + }, + "provisioningState": { + "$id": "1949", + "kind": "string", + "type": { + "$ref": "126" + }, + "value": "Succeeded" + }, + "version": { + "$id": "1950", + "kind": "string", + "type": { + "$ref": "1551" + }, + "value": "vjjbmunthiphfmekvxgxcxkzdwjti" + } + } + }, + "extendedLocation": { + "$id": "1951", + "kind": "model", + "type": { + "$ref": "669" + }, + "value": { + "$id": "1952", + "name": { + "$id": "1953", + "kind": "string", + "type": { + "$ref": "671" + }, + "value": "qmbrfwcpwwhggszhrdjv" + }, + "type": { + "$id": "1954", + "kind": "string", + "type": { + "$ref": "142" + }, + "value": "CustomLocation" + } + } + }, + "identity": { + "$id": "1955", + "kind": "model", + "type": { + "$ref": "1570" + }, + "value": { + "$id": "1956", + "type": { + "$id": "1957", + "kind": "string", + "type": { + "$ref": "300" + }, + "value": "None" + }, + "userAssignedIdentities": { + "$id": "1958", + "kind": "dict", + "type": { + "$ref": "1585" + }, + "value": { + "$id": "1959" + } + }, + "principalId": { + "$id": "1960", + "kind": "string", + "type": { + "$ref": "1572" + }, + "value": "4a6e4195-75b8-4685-aa0c-0b5704779327" + }, + "tenantId": { + "$id": "1961", + "kind": "string", + "type": { + "$ref": "1577" + }, + "value": "ed060aa2-71ff-4d3f-99c4-a9138356fdec" + } + } + }, + "tags": { + "$id": "1962", + "kind": "dict", + "type": { + "$ref": "1532" + }, + "value": { + "$id": "1963" + } + }, + "location": { + "$id": "1964", + "kind": "string", + "type": { + "$ref": "1538" + }, + "value": "xvewadyhycrjpu" + }, + "id": { + "$id": "1965", + "kind": "string", + "type": { + "$ref": "330" + }, + "value": "/subscriptions/0000000-0000-0000-0000-000000000000/resourceGroups/resourceGroup123/providers/Microsoft.IoTOperations/instances/resource-name123" + }, + "name": { + "$id": "1966", + "kind": "string", + "type": { + "$ref": "335" + }, + "value": "llptmlifnqqwairx" + }, + "type": { + "$id": "1967", + "kind": "string", + "type": { + "$ref": "339" + }, + "value": "qwrfzxjfxvismlqvigot" + }, + "systemData": { + "$id": "1968", + "kind": "model", + "type": { + "$ref": "344" + }, + "value": { + "$id": "1969", + "createdBy": { + "$id": "1970", + "kind": "string", + "type": { + "$ref": "346" + }, + "value": "ssvaslsmudloholronopqyxjcu" + }, + "createdByType": { + "$id": "1971", + "kind": "string", + "type": { + "$ref": "146" + }, + "value": "User" + }, + "createdAt": { + "$id": "1972", + "kind": "string", + "type": { + "$ref": "353" + }, + "value": "2024-08-09T18:13:29.389Z" + }, + "lastModifiedBy": { + "$id": "1973", + "kind": "string", + "type": { + "$ref": "358" + }, + "value": "gnicpuszwd" + }, + "lastModifiedByType": { + "$id": "1974", + "kind": "string", + "type": { + "$ref": "146" + }, + "value": "User" + }, + "lastModifiedAt": { + "$id": "1975", + "kind": "string", + "type": { + "$ref": "365" + }, + "value": "2024-08-09T18:13:29.389Z" + } + } + } + } + } + } + ] + } + ] + }, + { + "$id": "1976", + "Name": "delete", + "ResourceName": "InstanceResource", + "Doc": "Delete a InstanceResource", + "Accessibility": "public", + "Parameters": [ + { + "$id": "1977", + "Name": "apiVersion", + "NameInRequest": "api-version", + "Doc": "The API version to use for this operation.", + "Type": { + "$id": "1978", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": true, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "DefaultValue": { + "$id": "1979", + "Type": { + "$id": "1980", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "2024-11-01" + }, + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1981", + "Name": "subscriptionId", + "NameInRequest": "subscriptionId", + "Doc": "The ID of the target subscription. The value must be an UUID.", + "Type": { + "$id": "1982", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "1983", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1984", + "Name": "resourceGroupName", + "NameInRequest": "resourceGroupName", + "Doc": "The name of the resource group. The name is case insensitive.", + "Type": { + "$id": "1985", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1986", + "Name": "instanceName", + "NameInRequest": "instanceName", + "Doc": "Name of instance.", + "Type": { + "$id": "1987", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1988", + "Name": "accept", + "NameInRequest": "Accept", + "Type": { + "$id": "1989", + "kind": "constant", + "valueType": { + "$id": "1990", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "1991", + "StatusCodes": [ + 202 + ], + "BodyMediaType": "Json", + "Headers": [ + { + "$id": "1992", + "Name": "location", + "NameInResponse": "Location", + "Doc": "The Location header contains the URL where the status of the long running operation can be checked.", + "Type": { + "$id": "1993", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + } + }, + { + "$id": "1994", + "Name": "retryAfter", + "NameInResponse": "Retry-After", + "Doc": "The Retry-After header can indicate how long the client should wait before polling the operation status.", + "Type": { + "$id": "1995", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + } + } + ], + "IsErrorResponse": false + }, + { + "$id": "1996", + "StatusCodes": [ + 204 + ], + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false + } + ], + "HttpMethod": "DELETE", + "RequestBodyMediaType": "None", + "Uri": "{endpoint}", + "Path": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}", + "BufferResponse": true, + "LongRunning": { + "$id": "1997", + "FinalStateVia": 1, + "FinalResponse": { + "$id": "1998", + "StatusCodes": [ + 204 + ], + "BodyMediaType": "Json" + } + }, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Microsoft.IoTOperations.Instance.delete", + "Decorators": [], + "Examples": [ + { + "$id": "1999", + "kind": "http", + "name": "Instance_Delete", + "description": "Instance_Delete", + "filePath": "2024-11-01/Instance_Delete_MaximumSet_Gen.json", + "parameters": [ + { + "$id": "2000", + "parameter": { + "$ref": "1977" + }, + "value": { + "$id": "2001", + "kind": "string", + "type": { + "$ref": "1978" + }, + "value": "2024-11-01" + } + }, + { + "$id": "2002", + "parameter": { + "$ref": "1981" + }, + "value": { + "$id": "2003", + "kind": "string", + "type": { + "$ref": "1982" + }, + "value": "F8C729F9-DF9C-4743-848F-96EE433D8E53" + } + }, + { + "$id": "2004", + "parameter": { + "$ref": "1984" + }, + "value": { + "$id": "2005", + "kind": "string", + "type": { + "$ref": "1985" + }, + "value": "rgiotoperations" + } + }, + { + "$id": "2006", + "parameter": { + "$ref": "1986" + }, + "value": { + "$id": "2007", + "kind": "string", + "type": { + "$ref": "1987" + }, + "value": "aio-instance" + } + } + ], + "responses": [ + { + "$id": "2008", + "response": { + "$ref": "1991" + }, + "statusCode": 202 + }, + { + "$id": "2009", + "response": { + "$ref": "1996" + }, + "statusCode": 204 + } + ] + } + ] + }, + { + "$id": "2010", + "Name": "listByResourceGroup", + "ResourceName": "InstanceResource", + "Doc": "List InstanceResource resources by resource group", + "Accessibility": "public", + "Parameters": [ + { + "$id": "2011", + "Name": "apiVersion", + "NameInRequest": "api-version", + "Doc": "The API version to use for this operation.", + "Type": { + "$id": "2012", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": true, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "DefaultValue": { + "$id": "2013", + "Type": { + "$id": "2014", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "2024-11-01" + }, + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "2015", + "Name": "subscriptionId", + "NameInRequest": "subscriptionId", + "Doc": "The ID of the target subscription. The value must be an UUID.", + "Type": { + "$id": "2016", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "2017", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "2018", + "Name": "resourceGroupName", + "NameInRequest": "resourceGroupName", + "Doc": "The name of the resource group. The name is case insensitive.", + "Type": { + "$id": "2019", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "2020", + "Name": "accept", + "NameInRequest": "Accept", + "Type": { + "$id": "2021", + "kind": "constant", + "valueType": { + "$id": "2022", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "2023", + "StatusCodes": [ + 200 + ], + "BodyType": { + "$ref": "1613" + }, + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false, + "ContentTypes": [ + "application/json" + ] + } + ], + "HttpMethod": "GET", + "RequestBodyMediaType": "None", + "Uri": "{endpoint}", + "Path": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances", + "BufferResponse": true, + "Paging": { + "$id": "2024", + "ItemName": "value", + "NextLinkName": "nextLink" + }, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Microsoft.IoTOperations.Instance.listByResourceGroup", + "Decorators": [], + "Examples": [ + { + "$id": "2025", + "kind": "http", + "name": "Instance_ListByResourceGroup", + "description": "Instance_ListByResourceGroup", + "filePath": "2024-11-01/Instance_ListByResourceGroup_MaximumSet_Gen.json", + "parameters": [ + { + "$id": "2026", + "parameter": { + "$ref": "2011" + }, + "value": { + "$id": "2027", + "kind": "string", + "type": { + "$ref": "2012" + }, + "value": "2024-11-01" + } + }, + { + "$id": "2028", + "parameter": { + "$ref": "2015" + }, + "value": { + "$id": "2029", + "kind": "string", + "type": { + "$ref": "2016" + }, + "value": "F8C729F9-DF9C-4743-848F-96EE433D8E53" + } + }, + { + "$id": "2030", + "parameter": { + "$ref": "2018" + }, + "value": { + "$id": "2031", + "kind": "string", + "type": { + "$ref": "2019" + }, + "value": "rgiotoperations" + } + } + ], + "responses": [ + { + "$id": "2032", + "response": { + "$ref": "2023" + }, + "statusCode": 200, + "bodyValue": { + "$id": "2033", + "kind": "model", + "type": { + "$ref": "1613" + }, + "value": { + "$id": "2034", + "value": { + "$id": "2035", + "kind": "array", + "type": { + "$ref": "1615" + }, + "value": [ + { + "$id": "2036", + "kind": "model", + "type": { + "$ref": "1529" + }, + "value": { + "$id": "2037", + "properties": { + "$id": "2038", + "kind": "model", + "type": { + "$ref": "1542" + }, + "value": { + "$id": "2039", + "provisioningState": { + "$id": "2040", + "kind": "string", + "type": { + "$ref": "126" + }, + "value": "Succeeded" + }, + "version": { + "$id": "2041", + "kind": "string", + "type": { + "$ref": "1551" + }, + "value": "vjjbmunthiphfmekvxgxcxkzdwjti" + }, + "schemaRegistryRef": { + "$id": "2042", + "kind": "model", + "type": { + "$ref": "1555" + }, + "value": { + "$id": "2043", + "resourceId": { + "$id": "2044", + "kind": "string", + "type": { + "$ref": "1557" + }, + "value": "/subscriptions/0000000-0000-0000-0000-000000000000/resourceGroups/resourceGroup123/providers/Microsoft.DeviceRegistry/schemaRegistries/resource-name123" + } + } + }, + "description": { + "$id": "2045", + "kind": "string", + "type": { + "$ref": "1544" + }, + "value": "vmujggxdvxk" + } + } + }, + "extendedLocation": { + "$id": "2046", + "kind": "model", + "type": { + "$ref": "669" + }, + "value": { + "$id": "2047", + "name": { + "$id": "2048", + "kind": "string", + "type": { + "$ref": "671" + }, + "value": "qmbrfwcpwwhggszhrdjv" + }, + "type": { + "$id": "2049", + "kind": "string", + "type": { + "$ref": "142" + }, + "value": "CustomLocation" + } + } + }, + "identity": { + "$id": "2050", + "kind": "model", + "type": { + "$ref": "1570" + }, + "value": { + "$id": "2051", + "principalId": { + "$id": "2052", + "kind": "string", + "type": { + "$ref": "1572" + }, + "value": "4a6e4195-75b8-4685-aa0c-0b5704779327" + }, + "tenantId": { + "$id": "2053", + "kind": "string", + "type": { + "$ref": "1577" + }, + "value": "ed060aa2-71ff-4d3f-99c4-a9138356fdec" + }, + "type": { + "$id": "2054", + "kind": "string", + "type": { + "$ref": "300" + }, + "value": "None" + }, + "userAssignedIdentities": { + "$id": "2055", + "kind": "dict", + "type": { + "$ref": "1585" + }, + "value": { + "$id": "2056" + } + } + } + }, + "tags": { + "$id": "2057", + "kind": "dict", + "type": { + "$ref": "1532" + }, + "value": { + "$id": "2058" + } + }, + "location": { + "$id": "2059", + "kind": "string", + "type": { + "$ref": "1538" + }, + "value": "xvewadyhycrjpu" + }, + "id": { + "$id": "2060", + "kind": "string", + "type": { + "$ref": "330" + }, + "value": "/subscriptions/0000000-0000-0000-0000-000000000000/resourceGroups/resourceGroup123/providers/Microsoft.IoTOperations/instances/resource-name123" + }, + "name": { + "$id": "2061", + "kind": "string", + "type": { + "$ref": "335" + }, + "value": "llptmlifnqqwairx" + }, + "type": { + "$id": "2062", + "kind": "string", + "type": { + "$ref": "339" + }, + "value": "qwrfzxjfxvismlqvigot" + }, + "systemData": { + "$id": "2063", + "kind": "model", + "type": { + "$ref": "344" + }, + "value": { + "$id": "2064", + "createdBy": { + "$id": "2065", + "kind": "string", + "type": { + "$ref": "346" + }, + "value": "ssvaslsmudloholronopqyxjcu" + }, + "createdByType": { + "$id": "2066", + "kind": "string", + "type": { + "$ref": "146" + }, + "value": "User" + }, + "createdAt": { + "$id": "2067", + "kind": "string", + "type": { + "$ref": "353" + }, + "value": "2024-08-09T18:13:29.389Z" + }, + "lastModifiedBy": { + "$id": "2068", + "kind": "string", + "type": { + "$ref": "358" + }, + "value": "gnicpuszwd" + }, + "lastModifiedByType": { + "$id": "2069", + "kind": "string", + "type": { + "$ref": "146" + }, + "value": "User" + }, + "lastModifiedAt": { + "$id": "2070", + "kind": "string", + "type": { + "$ref": "365" + }, + "value": "2024-08-09T18:13:29.389Z" + } + } + } + } + } + ] + }, + "nextLink": { + "$id": "2071", + "kind": "string", + "type": { + "$ref": "1619" + }, + "value": "https://microsoft.com/a" + } + } + } + } + ] + } + ] + }, + { + "$id": "2072", + "Name": "listBySubscription", + "ResourceName": "InstanceResource", + "Doc": "List InstanceResource resources by subscription ID", + "Accessibility": "public", + "Parameters": [ + { + "$id": "2073", + "Name": "apiVersion", + "NameInRequest": "api-version", + "Doc": "The API version to use for this operation.", + "Type": { + "$id": "2074", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": true, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "DefaultValue": { + "$id": "2075", + "Type": { + "$id": "2076", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "2024-11-01" + }, + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "2077", + "Name": "subscriptionId", + "NameInRequest": "subscriptionId", + "Doc": "The ID of the target subscription. The value must be an UUID.", + "Type": { + "$id": "2078", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "2079", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "2080", + "Name": "accept", + "NameInRequest": "Accept", + "Type": { + "$id": "2081", + "kind": "constant", + "valueType": { + "$id": "2082", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "2083", + "StatusCodes": [ + 200 + ], + "BodyType": { + "$ref": "1613" + }, + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false, + "ContentTypes": [ + "application/json" + ] + } + ], + "HttpMethod": "GET", + "RequestBodyMediaType": "None", + "Uri": "{endpoint}", + "Path": "/subscriptions/{subscriptionId}/providers/Microsoft.IoTOperations/instances", + "BufferResponse": true, + "Paging": { + "$id": "2084", + "ItemName": "value", + "NextLinkName": "nextLink" + }, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Microsoft.IoTOperations.Instance.listBySubscription", + "Decorators": [], + "Examples": [ + { + "$id": "2085", + "kind": "http", + "name": "Instance_ListBySubscription", + "description": "Instance_ListBySubscription", + "filePath": "2024-11-01/Instance_ListBySubscription_MaximumSet_Gen.json", + "parameters": [ + { + "$id": "2086", + "parameter": { + "$ref": "2073" + }, + "value": { + "$id": "2087", + "kind": "string", + "type": { + "$ref": "2074" + }, + "value": "2024-11-01" + } + }, + { + "$id": "2088", + "parameter": { + "$ref": "2077" + }, + "value": { + "$id": "2089", + "kind": "string", + "type": { + "$ref": "2078" + }, + "value": "F8C729F9-DF9C-4743-848F-96EE433D8E53" + } + } + ], + "responses": [ + { + "$id": "2090", + "response": { + "$ref": "2083" + }, + "statusCode": 200, + "bodyValue": { + "$id": "2091", + "kind": "model", + "type": { + "$ref": "1613" + }, + "value": { + "$id": "2092", + "value": { + "$id": "2093", + "kind": "array", + "type": { + "$ref": "1615" + }, + "value": [ + { + "$id": "2094", + "kind": "model", + "type": { + "$ref": "1529" + }, + "value": { + "$id": "2095", + "properties": { + "$id": "2096", + "kind": "model", + "type": { + "$ref": "1542" + }, + "value": { + "$id": "2097", + "provisioningState": { + "$id": "2098", + "kind": "string", + "type": { + "$ref": "126" + }, + "value": "Succeeded" + }, + "version": { + "$id": "2099", + "kind": "string", + "type": { + "$ref": "1551" + }, + "value": "vjjbmunthiphfmekvxgxcxkzdwjti" + }, + "schemaRegistryRef": { + "$id": "2100", + "kind": "model", + "type": { + "$ref": "1555" + }, + "value": { + "$id": "2101", + "resourceId": { + "$id": "2102", + "kind": "string", + "type": { + "$ref": "1557" + }, + "value": "/subscriptions/0000000-0000-0000-0000-000000000000/resourceGroups/resourceGroup123/providers/Microsoft.DeviceRegistry/schemaRegistries/resource-name123" + } + } + }, + "description": { + "$id": "2103", + "kind": "string", + "type": { + "$ref": "1544" + }, + "value": "empgqmbhvklcqlyahmdsjemlep" + } + } + }, + "extendedLocation": { + "$id": "2104", + "kind": "model", + "type": { + "$ref": "669" + }, + "value": { + "$id": "2105", + "name": { + "$id": "2106", + "kind": "string", + "type": { + "$ref": "671" + }, + "value": "qmbrfwcpwwhggszhrdjv" + }, + "type": { + "$id": "2107", + "kind": "string", + "type": { + "$ref": "142" + }, + "value": "CustomLocation" + } + } + }, + "identity": { + "$id": "2108", + "kind": "model", + "type": { + "$ref": "1570" + }, + "value": { + "$id": "2109", + "principalId": { + "$id": "2110", + "kind": "string", + "type": { + "$ref": "1572" + }, + "value": "4a6e4195-75b8-4685-aa0c-0b5704779327" + }, + "tenantId": { + "$id": "2111", + "kind": "string", + "type": { + "$ref": "1577" + }, + "value": "ed060aa2-71ff-4d3f-99c4-a9138356fdec" + }, + "type": { + "$id": "2112", + "kind": "string", + "type": { + "$ref": "300" + }, + "value": "None" + }, + "userAssignedIdentities": { + "$id": "2113", + "kind": "dict", + "type": { + "$ref": "1585" + }, + "value": { + "$id": "2114" + } + } + } + }, + "tags": { + "$id": "2115", + "kind": "dict", + "type": { + "$ref": "1532" + }, + "value": { + "$id": "2116" + } + }, + "location": { + "$id": "2117", + "kind": "string", + "type": { + "$ref": "1538" + }, + "value": "xvewadyhycrjpu" + }, + "id": { + "$id": "2118", + "kind": "string", + "type": { + "$ref": "330" + }, + "value": "/subscriptions/0000000-0000-0000-0000-000000000000/resourceGroups/resourceGroup123/providers/Microsoft.IoTOperations/instances/resource-name123" + }, + "name": { + "$id": "2119", + "kind": "string", + "type": { + "$ref": "335" + }, + "value": "llptmlifnqqwairx" + }, + "type": { + "$id": "2120", + "kind": "string", + "type": { + "$ref": "339" + }, + "value": "qwrfzxjfxvismlqvigot" + }, + "systemData": { + "$id": "2121", + "kind": "model", + "type": { + "$ref": "344" + }, + "value": { + "$id": "2122", + "createdBy": { + "$id": "2123", + "kind": "string", + "type": { + "$ref": "346" + }, + "value": "ssvaslsmudloholronopqyxjcu" + }, + "createdByType": { + "$id": "2124", + "kind": "string", + "type": { + "$ref": "146" + }, + "value": "User" + }, + "createdAt": { + "$id": "2125", + "kind": "string", + "type": { + "$ref": "353" + }, + "value": "2024-08-09T18:13:29.389Z" + }, + "lastModifiedBy": { + "$id": "2126", + "kind": "string", + "type": { + "$ref": "358" + }, + "value": "gnicpuszwd" + }, + "lastModifiedByType": { + "$id": "2127", + "kind": "string", + "type": { + "$ref": "146" + }, + "value": "User" + }, + "lastModifiedAt": { + "$id": "2128", + "kind": "string", + "type": { + "$ref": "365" + }, + "value": "2024-08-09T18:13:29.389Z" + } + } + } + } + } + ] + }, + "nextLink": { + "$id": "2129", + "kind": "string", + "type": { + "$ref": "1619" + }, + "value": "https://microsoft.com/a" + } + } + } + } + ] + } + ] + } + ], + "Protocol": { + "$id": "2130" + }, + "Parent": "IoTOperationsClient", + "Parameters": [ + { + "$id": "2131", + "Name": "endpoint", + "NameInRequest": "endpoint", + "Doc": "Service host", + "Type": { + "$id": "2132", + "kind": "url", + "name": "url", + "crossLanguageDefinitionId": "TypeSpec.url" + }, + "Location": "Uri", + "IsApiVersion": false, + "IsResourceParameter": false, + "IsContentType": false, + "IsRequired": true, + "IsEndpoint": true, + "SkipUrlEncoding": false, + "Explode": false, + "Kind": "Client", + "DefaultValue": { + "$id": "2133", + "Type": { + "$id": "2134", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "https://management.azure.com" + } + } + ], + "Decorators": [] + }, + { + "$id": "2135", + "Name": "Broker", + "ClientNamespace": "Microsoft.IoTOperations", + "Operations": [ + { + "$id": "2136", + "Name": "get", + "ResourceName": "BrokerResource", + "Doc": "Get a BrokerResource", + "Accessibility": "public", + "Parameters": [ + { + "$id": "2137", + "Name": "apiVersion", + "NameInRequest": "api-version", + "Doc": "The API version to use for this operation.", + "Type": { + "$id": "2138", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": true, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "DefaultValue": { + "$id": "2139", + "Type": { + "$id": "2140", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "2024-11-01" + }, + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "2141", + "Name": "subscriptionId", + "NameInRequest": "subscriptionId", + "Doc": "The ID of the target subscription. The value must be an UUID.", + "Type": { + "$id": "2142", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "2143", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "2144", + "Name": "resourceGroupName", + "NameInRequest": "resourceGroupName", + "Doc": "The name of the resource group. The name is case insensitive.", + "Type": { + "$id": "2145", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "2146", + "Name": "instanceName", + "NameInRequest": "instanceName", + "Doc": "Name of instance.", + "Type": { + "$id": "2147", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "2148", + "Name": "brokerName", + "NameInRequest": "brokerName", + "Doc": "Name of broker.", + "Type": { + "$id": "2149", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "2150", + "Name": "accept", + "NameInRequest": "Accept", + "Type": { + "$id": "2151", + "kind": "constant", + "valueType": { + "$id": "2152", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "2153", + "StatusCodes": [ + 200 + ], + "BodyType": { + "$ref": "1247" + }, + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false, + "ContentTypes": [ + "application/json" + ] + } + ], + "HttpMethod": "GET", + "RequestBodyMediaType": "None", + "Uri": "{endpoint}", + "Path": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/brokers/{brokerName}", + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Microsoft.IoTOperations.Broker.get", + "Decorators": [], + "Examples": [ + { + "$id": "2154", + "kind": "http", + "name": "Broker_Get", + "description": "Broker_Get", + "filePath": "2024-11-01/Broker_Get_MaximumSet_Gen.json", + "parameters": [ + { + "$id": "2155", + "parameter": { + "$ref": "2137" + }, + "value": { + "$id": "2156", + "kind": "string", + "type": { + "$ref": "2138" + }, + "value": "2024-11-01" + } + }, + { + "$id": "2157", + "parameter": { + "$ref": "2141" + }, + "value": { + "$id": "2158", + "kind": "string", + "type": { + "$ref": "2142" + }, + "value": "F8C729F9-DF9C-4743-848F-96EE433D8E53" + } + }, + { + "$id": "2159", + "parameter": { + "$ref": "2144" + }, + "value": { + "$id": "2160", + "kind": "string", + "type": { + "$ref": "2145" + }, + "value": "rgiotoperations" + } + }, + { + "$id": "2161", + "parameter": { + "$ref": "2146" + }, + "value": { + "$id": "2162", + "kind": "string", + "type": { + "$ref": "2147" + }, + "value": "resource-name123" + } + }, + { + "$id": "2163", + "parameter": { + "$ref": "2148" + }, + "value": { + "$id": "2164", + "kind": "string", + "type": { + "$ref": "2149" + }, + "value": "resource-name123" + } + } + ], + "responses": [ + { + "$id": "2165", + "response": { + "$ref": "2153" + }, + "statusCode": 200, + "bodyValue": { + "$id": "2166", + "kind": "model", + "type": { + "$ref": "1247" + }, + "value": { + "$id": "2167", + "properties": { + "$id": "2168", + "kind": "model", + "type": { + "$ref": "1249" + }, + "value": { + "$id": "2169", + "advanced": { + "$id": "2170", + "kind": "model", + "type": { + "$ref": "1251" + }, + "value": { + "$id": "2171", + "clients": { + "$id": "2172", + "kind": "model", + "type": { + "$ref": "1253" + }, + "value": { + "$id": "2173", + "maxSessionExpirySeconds": { + "$id": "2174", + "kind": "number", + "type": { + "$ref": "1255" + }, + "value": 3859 + }, + "maxMessageExpirySeconds": { + "$id": "2175", + "kind": "number", + "type": { + "$ref": "1259" + }, + "value": 3263 + }, + "maxPacketSizeBytes": { + "$id": "2176", + "kind": "number", + "type": { + "$ref": "1263" + }, + "value": 3029 + }, + "subscriberQueueLimit": { + "$id": "2177", + "kind": "model", + "type": { + "$ref": "1267" + }, + "value": { + "$id": "2178", + "length": { + "$id": "2179", + "kind": "number", + "type": { + "$ref": "1269" + }, + "value": 6 + }, + "strategy": { + "$id": "2180", + "kind": "string", + "type": { + "$ref": "274" + }, + "value": "None" + } + } + }, + "maxReceiveMaximum": { + "$id": "2181", + "kind": "number", + "type": { + "$ref": "1278" + }, + "value": 2365 + }, + "maxKeepAliveSeconds": { + "$id": "2182", + "kind": "number", + "type": { + "$ref": "1282" + }, + "value": 3744 + } + } + }, + "encryptInternalTraffic": { + "$id": "2183", + "kind": "string", + "type": { + "$ref": "62" + }, + "value": "Enabled" + }, + "internalCerts": { + "$id": "2184", + "kind": "model", + "type": { + "$ref": "1291" + }, + "value": { + "$id": "2185", + "duration": { + "$id": "2186", + "kind": "string", + "type": { + "$ref": "1293" + }, + "value": "bchrc" + }, + "renewBefore": { + "$id": "2187", + "kind": "string", + "type": { + "$ref": "1297" + }, + "value": "xkafmpgjfifkwwrhkswtopdnne" + }, + "privateKey": { + "$id": "2188", + "kind": "model", + "type": { + "$ref": "1194" + }, + "value": { + "$id": "2189", + "algorithm": { + "$id": "2190", + "kind": "string", + "type": { + "$ref": "244" + }, + "value": "Ec256" + }, + "rotationPolicy": { + "$id": "2191", + "kind": "string", + "type": { + "$ref": "260" + }, + "value": "Always" + } + } + } + } + } + } + }, + "cardinality": { + "$id": "2192", + "kind": "model", + "type": { + "$ref": "1308" + }, + "value": { + "$id": "2193", + "backendChain": { + "$id": "2194", + "kind": "model", + "type": { + "$ref": "1310" + }, + "value": { + "$id": "2195", + "partitions": { + "$id": "2196", + "kind": "number", + "type": { + "$ref": "1312" + }, + "value": 11 + }, + "redundancyFactor": { + "$id": "2197", + "kind": "number", + "type": { + "$ref": "1316" + }, + "value": 5 + }, + "workers": { + "$id": "2198", + "kind": "number", + "type": { + "$ref": "1320" + }, + "value": 15 + } + } + }, + "frontend": { + "$id": "2199", + "kind": "model", + "type": { + "$ref": "1326" + }, + "value": { + "$id": "2200", + "replicas": { + "$id": "2201", + "kind": "number", + "type": { + "$ref": "1328" + }, + "value": 2 + }, + "workers": { + "$id": "2202", + "kind": "number", + "type": { + "$ref": "1332" + }, + "value": 6 + } + } + } + } + }, + "diagnostics": { + "$id": "2203", + "kind": "model", + "type": { + "$ref": "1340" + }, + "value": { + "$id": "2204", + "logs": { + "$id": "2205", + "kind": "model", + "type": { + "$ref": "911" + }, + "value": { + "$id": "2206", + "level": { + "$id": "2207", + "kind": "string", + "type": { + "$ref": "913" + }, + "value": "rnmwokumdmebpmfxxxzvvjfdywotav" + } + } + }, + "metrics": { + "$id": "2208", + "kind": "model", + "type": { + "$ref": "919" + }, + "value": { + "$id": "2209", + "prometheusPort": { + "$id": "2210", + "kind": "number", + "type": { + "$ref": "921" + }, + "value": 7581 + } + } + }, + "selfCheck": { + "$id": "2211", + "kind": "model", + "type": { + "$ref": "1348" + }, + "value": { + "$id": "2212", + "mode": { + "$id": "2213", + "kind": "string", + "type": { + "$ref": "62" + }, + "value": "Enabled" + }, + "intervalSeconds": { + "$id": "2214", + "kind": "number", + "type": { + "$ref": "1353" + }, + "value": 158 + }, + "timeoutSeconds": { + "$id": "2215", + "kind": "number", + "type": { + "$ref": "1357" + }, + "value": 14 + } + } + }, + "traces": { + "$id": "2216", + "kind": "model", + "type": { + "$ref": "1363" + }, + "value": { + "$id": "2217", + "mode": { + "$id": "2218", + "kind": "string", + "type": { + "$ref": "62" + }, + "value": "Enabled" + }, + "cacheSizeMegabytes": { + "$id": "2219", + "kind": "number", + "type": { + "$ref": "1368" + }, + "value": 28 + }, + "selfTracing": { + "$id": "2220", + "kind": "model", + "type": { + "$ref": "1372" + }, + "value": { + "$id": "2221", + "mode": { + "$id": "2222", + "kind": "string", + "type": { + "$ref": "62" + }, + "value": "Enabled" + }, + "intervalSeconds": { + "$id": "2223", + "kind": "number", + "type": { + "$ref": "1377" + }, + "value": 22 + } + } + }, + "spanChannelCapacity": { + "$id": "2224", + "kind": "number", + "type": { + "$ref": "1383" + }, + "value": 1000 + } + } + } + } + }, + "diskBackedMessageBuffer": { + "$id": "2225", + "kind": "model", + "type": { + "$ref": "1391" + }, + "value": { + "$id": "2226", + "maxSize": { + "$id": "2227", + "kind": "string", + "type": { + "$ref": "1393" + }, + "value": "500M" + }, + "ephemeralVolumeClaimSpec": { + "$id": "2228", + "kind": "model", + "type": { + "$ref": "1397" + }, + "value": { + "$id": "2229", + "volumeName": { + "$id": "2230", + "kind": "string", + "type": { + "$ref": "1399" + }, + "value": "c" + }, + "volumeMode": { + "$id": "2231", + "kind": "string", + "type": { + "$ref": "1403" + }, + "value": "rxvpksjuuugqnqzeiprocknbn" + }, + "storageClassName": { + "$id": "2232", + "kind": "string", + "type": { + "$ref": "1407" + }, + "value": "sseyhrjptkhrqvpdpjmornkqvon" + }, + "accessModes": { + "$id": "2233", + "kind": "array", + "type": { + "$ref": "1411" + }, + "value": [ + { + "$id": "2234", + "kind": "string", + "type": { + "$ref": "1412" + }, + "value": "nuluhigrbb" + } + ] + }, + "dataSource": { + "$id": "2235", + "kind": "model", + "type": { + "$ref": "1416" + }, + "value": { + "$id": "2236", + "apiGroup": { + "$id": "2237", + "kind": "string", + "type": { + "$ref": "1418" + }, + "value": "npqapyksvvpkohujx" + }, + "kind": { + "$id": "2238", + "kind": "string", + "type": { + "$ref": "1422" + }, + "value": "wazgyb" + }, + "name": { + "$id": "2239", + "kind": "string", + "type": { + "$ref": "1426" + }, + "value": "cwhsgxxcxsyppoefm" + } + } + }, + "dataSourceRef": { + "$id": "2240", + "kind": "model", + "type": { + "$ref": "1432" + }, + "value": { + "$id": "2241", + "apiGroup": { + "$id": "2242", + "kind": "string", + "type": { + "$ref": "1434" + }, + "value": "mnfnykznjjsoqpfsgdqioupt" + }, + "kind": { + "$id": "2243", + "kind": "string", + "type": { + "$ref": "1438" + }, + "value": "odynqzekfzsnawrctaxg" + }, + "name": { + "$id": "2244", + "kind": "string", + "type": { + "$ref": "1442" + }, + "value": "envszivbbmixbyddzg" + }, + "namespace": { + "$id": "2245", + "kind": "string", + "type": { + "$ref": "1446" + }, + "value": "etcfzvxqd" + } + } + }, + "resources": { + "$id": "2246", + "kind": "model", + "type": { + "$ref": "1452" + }, + "value": { + "$id": "2247", + "limits": { + "$id": "2248", + "kind": "dict", + "type": { + "$ref": "1454" + }, + "value": { + "$id": "2249", + "key2719": { + "$id": "2250", + "kind": "string", + "type": { + "$ref": "1456" + }, + "value": "hmphcrgctu" + } + } + }, + "requests": { + "$id": "2251", + "kind": "dict", + "type": { + "$ref": "1460" + }, + "value": { + "$id": "2252", + "key2909": { + "$id": "2253", + "kind": "string", + "type": { + "$ref": "1462" + }, + "value": "txocprnyrsgvhfrg" + } + } + } + } + }, + "selector": { + "$id": "2254", + "kind": "model", + "type": { + "$ref": "1468" + }, + "value": { + "$id": "2255", + "matchExpressions": { + "$id": "2256", + "kind": "array", + "type": { + "$ref": "1470" + }, + "value": [ + { + "$id": "2257", + "kind": "model", + "type": { + "$ref": "1471" + }, + "value": { + "$id": "2258", + "key": { + "$id": "2259", + "kind": "string", + "type": { + "$ref": "1473" + }, + "value": "e" + }, + "operator": { + "$id": "2260", + "kind": "string", + "type": { + "$ref": "280" + }, + "value": "In" + }, + "values": { + "$id": "2261", + "kind": "array", + "type": { + "$ref": "1480" + }, + "value": [ + { + "$id": "2262", + "kind": "string", + "type": { + "$ref": "1481" + }, + "value": "slmpajlywqvuyknipgztsonqyybt" + } + ] + } + } + } + ] + }, + "matchLabels": { + "$id": "2263", + "kind": "dict", + "type": { + "$ref": "1487" + }, + "value": { + "$id": "2264", + "key6673": { + "$id": "2265", + "kind": "string", + "type": { + "$ref": "1489" + }, + "value": "wlngfalznwxnurzpgxomcxhbqefpr" + } + } + } + } + } + } + }, + "persistentVolumeClaimSpec": { + "$id": "2266", + "kind": "model", + "type": { + "$ref": "1397" + }, + "value": { + "$id": "2267", + "volumeName": { + "$id": "2268", + "kind": "string", + "type": { + "$ref": "1399" + }, + "value": "c" + }, + "volumeMode": { + "$id": "2269", + "kind": "string", + "type": { + "$ref": "1403" + }, + "value": "rxvpksjuuugqnqzeiprocknbn" + }, + "storageClassName": { + "$id": "2270", + "kind": "string", + "type": { + "$ref": "1407" + }, + "value": "sseyhrjptkhrqvpdpjmornkqvon" + }, + "accessModes": { + "$id": "2271", + "kind": "array", + "type": { + "$ref": "1411" + }, + "value": [ + { + "$id": "2272", + "kind": "string", + "type": { + "$ref": "1412" + }, + "value": "nuluhigrbb" + } + ] + }, + "dataSource": { + "$id": "2273", + "kind": "model", + "type": { + "$ref": "1416" + }, + "value": { + "$id": "2274", + "apiGroup": { + "$id": "2275", + "kind": "string", + "type": { + "$ref": "1418" + }, + "value": "npqapyksvvpkohujx" + }, + "kind": { + "$id": "2276", + "kind": "string", + "type": { + "$ref": "1422" + }, + "value": "wazgyb" + }, + "name": { + "$id": "2277", + "kind": "string", + "type": { + "$ref": "1426" + }, + "value": "cwhsgxxcxsyppoefm" + } + } + }, + "dataSourceRef": { + "$id": "2278", + "kind": "model", + "type": { + "$ref": "1432" + }, + "value": { + "$id": "2279", + "apiGroup": { + "$id": "2280", + "kind": "string", + "type": { + "$ref": "1434" + }, + "value": "mnfnykznjjsoqpfsgdqioupt" + }, + "kind": { + "$id": "2281", + "kind": "string", + "type": { + "$ref": "1438" + }, + "value": "odynqzekfzsnawrctaxg" + }, + "name": { + "$id": "2282", + "kind": "string", + "type": { + "$ref": "1442" + }, + "value": "envszivbbmixbyddzg" + }, + "namespace": { + "$id": "2283", + "kind": "string", + "type": { + "$ref": "1446" + }, + "value": "etcfzvxqd" + } + } + }, + "resources": { + "$id": "2284", + "kind": "model", + "type": { + "$ref": "1452" + }, + "value": { + "$id": "2285", + "limits": { + "$id": "2286", + "kind": "dict", + "type": { + "$ref": "1454" + }, + "value": { + "$id": "2287", + "key2719": { + "$id": "2288", + "kind": "string", + "type": { + "$ref": "1456" + }, + "value": "hmphcrgctu" + } + } + }, + "requests": { + "$id": "2289", + "kind": "dict", + "type": { + "$ref": "1460" + }, + "value": { + "$id": "2290", + "key2909": { + "$id": "2291", + "kind": "string", + "type": { + "$ref": "1462" + }, + "value": "txocprnyrsgvhfrg" + } + } + } + } + }, + "selector": { + "$id": "2292", + "kind": "model", + "type": { + "$ref": "1468" + }, + "value": { + "$id": "2293", + "matchExpressions": { + "$id": "2294", + "kind": "array", + "type": { + "$ref": "1470" + }, + "value": [ + { + "$id": "2295", + "kind": "model", + "type": { + "$ref": "1471" + }, + "value": { + "$id": "2296", + "key": { + "$id": "2297", + "kind": "string", + "type": { + "$ref": "1473" + }, + "value": "e" + }, + "operator": { + "$id": "2298", + "kind": "string", + "type": { + "$ref": "280" + }, + "value": "In" + }, + "values": { + "$id": "2299", + "kind": "array", + "type": { + "$ref": "1480" + }, + "value": [ + { + "$id": "2300", + "kind": "string", + "type": { + "$ref": "1481" + }, + "value": "slmpajlywqvuyknipgztsonqyybt" + } + ] + } + } + } + ] + }, + "matchLabels": { + "$id": "2301", + "kind": "dict", + "type": { + "$ref": "1487" + }, + "value": { + "$id": "2302", + "key6673": { + "$id": "2303", + "kind": "string", + "type": { + "$ref": "1489" + }, + "value": "wlngfalznwxnurzpgxomcxhbqefpr" + } + } + } + } + } + } + } + } + }, + "generateResourceLimits": { + "$id": "2304", + "kind": "model", + "type": { + "$ref": "1502" + }, + "value": { + "$id": "2305", + "cpu": { + "$id": "2306", + "kind": "string", + "type": { + "$ref": "62" + }, + "value": "Enabled" + } + } + }, + "memoryProfile": { + "$id": "2307", + "kind": "string", + "type": { + "$ref": "290" + }, + "value": "Tiny" + }, + "provisioningState": { + "$id": "2308", + "kind": "string", + "type": { + "$ref": "126" + }, + "value": "Succeeded" + } + } + }, + "extendedLocation": { + "$id": "2309", + "kind": "model", + "type": { + "$ref": "669" + }, + "value": { + "$id": "2310", + "name": { + "$id": "2311", + "kind": "string", + "type": { + "$ref": "671" + }, + "value": "qmbrfwcpwwhggszhrdjv" + }, + "type": { + "$id": "2312", + "kind": "string", + "type": { + "$ref": "142" + }, + "value": "CustomLocation" + } + } + }, + "id": { + "$id": "2313", + "kind": "string", + "type": { + "$ref": "330" + }, + "value": "/subscriptions/0000000-0000-0000-0000-000000000000/resourceGroups/resourceGroup123/providers/Microsoft.IoTOperations/instances/resource-name123/brokers/resource-name123" + }, + "name": { + "$id": "2314", + "kind": "string", + "type": { + "$ref": "335" + }, + "value": "dowrkel" + }, + "type": { + "$id": "2315", + "kind": "string", + "type": { + "$ref": "339" + }, + "value": "xshjnsdgadygb" + }, + "systemData": { + "$id": "2316", + "kind": "model", + "type": { + "$ref": "344" + }, + "value": { + "$id": "2317", + "createdBy": { + "$id": "2318", + "kind": "string", + "type": { + "$ref": "346" + }, + "value": "ssvaslsmudloholronopqyxjcu" + }, + "createdByType": { + "$id": "2319", + "kind": "string", + "type": { + "$ref": "146" + }, + "value": "User" + }, + "createdAt": { + "$id": "2320", + "kind": "string", + "type": { + "$ref": "353" + }, + "value": "2024-08-09T18:13:29.389Z" + }, + "lastModifiedBy": { + "$id": "2321", + "kind": "string", + "type": { + "$ref": "358" + }, + "value": "gnicpuszwd" + }, + "lastModifiedByType": { + "$id": "2322", + "kind": "string", + "type": { + "$ref": "146" + }, + "value": "User" + }, + "lastModifiedAt": { + "$id": "2323", + "kind": "string", + "type": { + "$ref": "365" + }, + "value": "2024-08-09T18:13:29.389Z" + } + } + } + } + } + } + ] + } + ] + }, + { + "$id": "2324", + "Name": "createOrUpdate", + "ResourceName": "BrokerResource", + "Doc": "Create a BrokerResource", + "Accessibility": "public", + "Parameters": [ + { + "$id": "2325", + "Name": "apiVersion", + "NameInRequest": "api-version", + "Doc": "The API version to use for this operation.", + "Type": { + "$id": "2326", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": true, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "DefaultValue": { + "$id": "2327", + "Type": { + "$id": "2328", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "2024-11-01" + }, + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "2329", + "Name": "subscriptionId", + "NameInRequest": "subscriptionId", + "Doc": "The ID of the target subscription. The value must be an UUID.", + "Type": { + "$id": "2330", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "2331", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "2332", + "Name": "resourceGroupName", + "NameInRequest": "resourceGroupName", + "Doc": "The name of the resource group. The name is case insensitive.", + "Type": { + "$id": "2333", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "2334", + "Name": "instanceName", + "NameInRequest": "instanceName", + "Doc": "Name of instance.", + "Type": { + "$id": "2335", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "2336", + "Name": "brokerName", + "NameInRequest": "brokerName", + "Doc": "Name of broker.", + "Type": { + "$id": "2337", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "2338", + "Name": "contentType", + "NameInRequest": "Content-Type", + "Doc": "Body parameter's content type. Known values are application/json", + "Type": { + "$id": "2339", + "kind": "constant", + "valueType": { + "$id": "2340", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": true, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "2341", + "Name": "accept", + "NameInRequest": "Accept", + "Type": { + "$id": "2342", + "kind": "constant", + "valueType": { + "$id": "2343", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "2344", + "Name": "resource", + "NameInRequest": "resource", + "Doc": "Resource create parameters.", + "Type": { + "$ref": "1247" + }, + "Location": "Body", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "2345", + "StatusCodes": [ + 200 + ], + "BodyType": { + "$ref": "1247" + }, + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false, + "ContentTypes": [ + "application/json" + ] + }, + { + "$id": "2346", + "StatusCodes": [ + 201 + ], + "BodyType": { + "$ref": "1247" + }, + "BodyMediaType": "Json", + "Headers": [ + { + "$id": "2347", + "Name": "azureAsyncOperation", + "NameInResponse": "Azure-AsyncOperation", + "Doc": "A link to the status monitor", + "Type": { + "$id": "2348", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + } + }, + { + "$id": "2349", + "Name": "retryAfter", + "NameInResponse": "Retry-After", + "Doc": "The Retry-After header can indicate how long the client should wait before polling the operation status.", + "Type": { + "$id": "2350", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + } + } + ], + "IsErrorResponse": false, + "ContentTypes": [ + "application/json" + ] + } + ], + "HttpMethod": "PUT", + "RequestBodyMediaType": "Json", + "Uri": "{endpoint}", + "Path": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/brokers/{brokerName}", + "RequestMediaTypes": [ + "application/json" + ], + "BufferResponse": true, + "LongRunning": { + "$id": "2351", + "FinalStateVia": 0, + "FinalResponse": { + "$id": "2352", + "StatusCodes": [ + 200 + ], + "BodyType": { + "$ref": "1247" + }, + "BodyMediaType": "Json" + } + }, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Microsoft.IoTOperations.Broker.createOrUpdate", + "Decorators": [], + "Examples": [ + { + "$id": "2353", + "kind": "http", + "name": "Broker_CreateOrUpdate_Complex", + "description": "Broker_CreateOrUpdate_Complex", + "filePath": "2024-11-01/Broker_CreateOrUpdate_Complex.json", + "parameters": [ + { + "$id": "2354", + "parameter": { + "$ref": "2325" + }, + "value": { + "$id": "2355", + "kind": "string", + "type": { + "$ref": "2326" + }, + "value": "2024-11-01" + } + }, + { + "$id": "2356", + "parameter": { + "$ref": "2329" + }, + "value": { + "$id": "2357", + "kind": "string", + "type": { + "$ref": "2330" + }, + "value": "F8C729F9-DF9C-4743-848F-96EE433D8E53" + } + }, + { + "$id": "2358", + "parameter": { + "$ref": "2332" + }, + "value": { + "$id": "2359", + "kind": "string", + "type": { + "$ref": "2333" + }, + "value": "rgiotoperations" + } + }, + { + "$id": "2360", + "parameter": { + "$ref": "2334" + }, + "value": { + "$id": "2361", + "kind": "string", + "type": { + "$ref": "2335" + }, + "value": "resource-name123" + } + }, + { + "$id": "2362", + "parameter": { + "$ref": "2336" + }, + "value": { + "$id": "2363", + "kind": "string", + "type": { + "$ref": "2337" + }, + "value": "resource-name123" + } + }, + { + "$id": "2364", + "parameter": { + "$ref": "2344" + }, + "value": { + "$id": "2365", + "kind": "model", + "type": { + "$ref": "1247" + }, + "value": { + "$id": "2366", + "properties": { + "$id": "2367", + "kind": "model", + "type": { + "$ref": "1249" + }, + "value": { + "$id": "2368", + "cardinality": { + "$id": "2369", + "kind": "model", + "type": { + "$ref": "1308" + }, + "value": { + "$id": "2370", + "backendChain": { + "$id": "2371", + "kind": "model", + "type": { + "$ref": "1310" + }, + "value": { + "$id": "2372", + "partitions": { + "$id": "2373", + "kind": "number", + "type": { + "$ref": "1312" + }, + "value": 2 + }, + "redundancyFactor": { + "$id": "2374", + "kind": "number", + "type": { + "$ref": "1316" + }, + "value": 2 + }, + "workers": { + "$id": "2375", + "kind": "number", + "type": { + "$ref": "1320" + }, + "value": 2 + } + } + }, + "frontend": { + "$id": "2376", + "kind": "model", + "type": { + "$ref": "1326" + }, + "value": { + "$id": "2377", + "replicas": { + "$id": "2378", + "kind": "number", + "type": { + "$ref": "1328" + }, + "value": 2 + }, + "workers": { + "$id": "2379", + "kind": "number", + "type": { + "$ref": "1332" + }, + "value": 2 + } + } + } + } + }, + "diskBackedMessageBuffer": { + "$id": "2380", + "kind": "model", + "type": { + "$ref": "1391" + }, + "value": { + "$id": "2381", + "maxSize": { + "$id": "2382", + "kind": "string", + "type": { + "$ref": "1393" + }, + "value": "50M" + } + } + }, + "generateResourceLimits": { + "$id": "2383", + "kind": "model", + "type": { + "$ref": "1502" + }, + "value": { + "$id": "2384", + "cpu": { + "$id": "2385", + "kind": "string", + "type": { + "$ref": "62" + }, + "value": "Enabled" + } + } + }, + "memoryProfile": { + "$id": "2386", + "kind": "string", + "type": { + "$ref": "290" + }, + "value": "Medium" + } + } + }, + "extendedLocation": { + "$id": "2387", + "kind": "model", + "type": { + "$ref": "669" + }, + "value": { + "$id": "2388", + "name": { + "$id": "2389", + "kind": "string", + "type": { + "$ref": "671" + }, + "value": "qmbrfwcpwwhggszhrdjv" + }, + "type": { + "$id": "2390", + "kind": "string", + "type": { + "$ref": "142" + }, + "value": "CustomLocation" + } + } + } + } + } + } + ], + "responses": [ + { + "$id": "2391", + "response": { + "$ref": "2345" + }, + "statusCode": 200, + "bodyValue": { + "$id": "2392", + "kind": "model", + "type": { + "$ref": "1247" + }, + "value": { + "$id": "2393", + "properties": { + "$id": "2394", + "kind": "model", + "type": { + "$ref": "1249" + }, + "value": { + "$id": "2395", + "cardinality": { + "$id": "2396", + "kind": "model", + "type": { + "$ref": "1308" + }, + "value": { + "$id": "2397", + "backendChain": { + "$id": "2398", + "kind": "model", + "type": { + "$ref": "1310" + }, + "value": { + "$id": "2399", + "partitions": { + "$id": "2400", + "kind": "number", + "type": { + "$ref": "1312" + }, + "value": 2 + }, + "redundancyFactor": { + "$id": "2401", + "kind": "number", + "type": { + "$ref": "1316" + }, + "value": 2 + }, + "workers": { + "$id": "2402", + "kind": "number", + "type": { + "$ref": "1320" + }, + "value": 2 + } + } + }, + "frontend": { + "$id": "2403", + "kind": "model", + "type": { + "$ref": "1326" + }, + "value": { + "$id": "2404", + "replicas": { + "$id": "2405", + "kind": "number", + "type": { + "$ref": "1328" + }, + "value": 2 + }, + "workers": { + "$id": "2406", + "kind": "number", + "type": { + "$ref": "1332" + }, + "value": 2 + } + } + } + } + }, + "diskBackedMessageBuffer": { + "$id": "2407", + "kind": "model", + "type": { + "$ref": "1391" + }, + "value": { + "$id": "2408", + "maxSize": { + "$id": "2409", + "kind": "string", + "type": { + "$ref": "1393" + }, + "value": "50M" + } + } + }, + "generateResourceLimits": { + "$id": "2410", + "kind": "model", + "type": { + "$ref": "1502" + }, + "value": { + "$id": "2411", + "cpu": { + "$id": "2412", + "kind": "string", + "type": { + "$ref": "62" + }, + "value": "Enabled" + } + } + }, + "memoryProfile": { + "$id": "2413", + "kind": "string", + "type": { + "$ref": "290" + }, + "value": "Medium" + }, + "provisioningState": { + "$id": "2414", + "kind": "string", + "type": { + "$ref": "126" + }, + "value": "Succeeded" + } + } + }, + "extendedLocation": { + "$id": "2415", + "kind": "model", + "type": { + "$ref": "669" + }, + "value": { + "$id": "2416", + "name": { + "$id": "2417", + "kind": "string", + "type": { + "$ref": "671" + }, + "value": "qmbrfwcpwwhggszhrdjv" + }, + "type": { + "$id": "2418", + "kind": "string", + "type": { + "$ref": "142" + }, + "value": "CustomLocation" + } + } + }, + "id": { + "$id": "2419", + "kind": "string", + "type": { + "$ref": "330" + }, + "value": "/subscriptions/0000000-0000-0000-0000-000000000000/resourceGroups/resourceGroup123/providers/Microsoft.IoTOperations/instances/resource-name123/brokers/resource-name123" + }, + "name": { + "$id": "2420", + "kind": "string", + "type": { + "$ref": "335" + }, + "value": "llptmlifnqqwairx" + }, + "type": { + "$id": "2421", + "kind": "string", + "type": { + "$ref": "339" + }, + "value": "qwrfzxjfxvismlqvigot" + }, + "systemData": { + "$id": "2422", + "kind": "model", + "type": { + "$ref": "344" + }, + "value": { + "$id": "2423", + "createdBy": { + "$id": "2424", + "kind": "string", + "type": { + "$ref": "346" + }, + "value": "ssvaslsmudloholronopqyxjcu" + }, + "createdByType": { + "$id": "2425", + "kind": "string", + "type": { + "$ref": "146" + }, + "value": "User" + }, + "createdAt": { + "$id": "2426", + "kind": "string", + "type": { + "$ref": "353" + }, + "value": "2024-08-09T18:13:29.389Z" + }, + "lastModifiedBy": { + "$id": "2427", + "kind": "string", + "type": { + "$ref": "358" + }, + "value": "gnicpuszwd" + }, + "lastModifiedByType": { + "$id": "2428", + "kind": "string", + "type": { + "$ref": "146" + }, + "value": "User" + }, + "lastModifiedAt": { + "$id": "2429", + "kind": "string", + "type": { + "$ref": "365" + }, + "value": "2024-08-09T18:13:29.389Z" + } + } + } + } + } + }, + { + "$id": "2430", + "response": { + "$ref": "2346" + }, + "statusCode": 201, + "bodyValue": { + "$id": "2431", + "kind": "model", + "type": { + "$ref": "1247" + }, + "value": { + "$id": "2432", + "properties": { + "$id": "2433", + "kind": "model", + "type": { + "$ref": "1249" + }, + "value": { + "$id": "2434", + "cardinality": { + "$id": "2435", + "kind": "model", + "type": { + "$ref": "1308" + }, + "value": { + "$id": "2436", + "backendChain": { + "$id": "2437", + "kind": "model", + "type": { + "$ref": "1310" + }, + "value": { + "$id": "2438", + "partitions": { + "$id": "2439", + "kind": "number", + "type": { + "$ref": "1312" + }, + "value": 2 + }, + "redundancyFactor": { + "$id": "2440", + "kind": "number", + "type": { + "$ref": "1316" + }, + "value": 2 + }, + "workers": { + "$id": "2441", + "kind": "number", + "type": { + "$ref": "1320" + }, + "value": 2 + } + } + }, + "frontend": { + "$id": "2442", + "kind": "model", + "type": { + "$ref": "1326" + }, + "value": { + "$id": "2443", + "replicas": { + "$id": "2444", + "kind": "number", + "type": { + "$ref": "1328" + }, + "value": 2 + }, + "workers": { + "$id": "2445", + "kind": "number", + "type": { + "$ref": "1332" + }, + "value": 2 + } + } + } + } + }, + "diskBackedMessageBuffer": { + "$id": "2446", + "kind": "model", + "type": { + "$ref": "1391" + }, + "value": { + "$id": "2447", + "maxSize": { + "$id": "2448", + "kind": "string", + "type": { + "$ref": "1393" + }, + "value": "50M" + } + } + }, + "generateResourceLimits": { + "$id": "2449", + "kind": "model", + "type": { + "$ref": "1502" + }, + "value": { + "$id": "2450", + "cpu": { + "$id": "2451", + "kind": "string", + "type": { + "$ref": "62" + }, + "value": "Enabled" + } + } + }, + "memoryProfile": { + "$id": "2452", + "kind": "string", + "type": { + "$ref": "290" + }, + "value": "Medium" + }, + "provisioningState": { + "$id": "2453", + "kind": "string", + "type": { + "$ref": "126" + }, + "value": "Accepted" + } + } + }, + "extendedLocation": { + "$id": "2454", + "kind": "model", + "type": { + "$ref": "669" + }, + "value": { + "$id": "2455", + "name": { + "$id": "2456", + "kind": "string", + "type": { + "$ref": "671" + }, + "value": "qmbrfwcpwwhggszhrdjv" + }, + "type": { + "$id": "2457", + "kind": "string", + "type": { + "$ref": "142" + }, + "value": "CustomLocation" + } + } + }, + "id": { + "$id": "2458", + "kind": "string", + "type": { + "$ref": "330" + }, + "value": "/subscriptions/0000000-0000-0000-0000-000000000000/resourceGroups/resourceGroup123/providers/Microsoft.IoTOperations/instances/resource-name123/brokers/resource-name123" + }, + "name": { + "$id": "2459", + "kind": "string", + "type": { + "$ref": "335" + }, + "value": "llptmlifnqqwairx" + }, + "type": { + "$id": "2460", + "kind": "string", + "type": { + "$ref": "339" + }, + "value": "qwrfzxjfxvismlqvigot" + }, + "systemData": { + "$id": "2461", + "kind": "model", + "type": { + "$ref": "344" + }, + "value": { + "$id": "2462", + "createdBy": { + "$id": "2463", + "kind": "string", + "type": { + "$ref": "346" + }, + "value": "ssvaslsmudloholronopqyxjcu" + }, + "createdByType": { + "$id": "2464", + "kind": "string", + "type": { + "$ref": "146" + }, + "value": "User" + }, + "createdAt": { + "$id": "2465", + "kind": "string", + "type": { + "$ref": "353" + }, + "value": "2024-08-09T18:13:29.389Z" + }, + "lastModifiedBy": { + "$id": "2466", + "kind": "string", + "type": { + "$ref": "358" + }, + "value": "gnicpuszwd" + }, + "lastModifiedByType": { + "$id": "2467", + "kind": "string", + "type": { + "$ref": "146" + }, + "value": "User" + }, + "lastModifiedAt": { + "$id": "2468", + "kind": "string", + "type": { + "$ref": "365" + }, + "value": "2024-08-09T18:13:29.389Z" + } + } + } + } + } + } + ] + }, + { + "$id": "2469", + "kind": "http", + "name": "Broker_CreateOrUpdate", + "description": "Broker_CreateOrUpdate", + "filePath": "2024-11-01/Broker_CreateOrUpdate_MaximumSet_Gen.json", + "parameters": [ + { + "$id": "2470", + "parameter": { + "$ref": "2325" + }, + "value": { + "$id": "2471", + "kind": "string", + "type": { + "$ref": "2326" + }, + "value": "2024-11-01" + } + }, + { + "$id": "2472", + "parameter": { + "$ref": "2329" + }, + "value": { + "$id": "2473", + "kind": "string", + "type": { + "$ref": "2330" + }, + "value": "F8C729F9-DF9C-4743-848F-96EE433D8E53" + } + }, + { + "$id": "2474", + "parameter": { + "$ref": "2332" + }, + "value": { + "$id": "2475", + "kind": "string", + "type": { + "$ref": "2333" + }, + "value": "rgiotoperations" + } + }, + { + "$id": "2476", + "parameter": { + "$ref": "2334" + }, + "value": { + "$id": "2477", + "kind": "string", + "type": { + "$ref": "2335" + }, + "value": "resource-name123" + } + }, + { + "$id": "2478", + "parameter": { + "$ref": "2336" + }, + "value": { + "$id": "2479", + "kind": "string", + "type": { + "$ref": "2337" + }, + "value": "resource-name123" + } + }, + { + "$id": "2480", + "parameter": { + "$ref": "2344" + }, + "value": { + "$id": "2481", + "kind": "model", + "type": { + "$ref": "1247" + }, + "value": { + "$id": "2482", + "properties": { + "$id": "2483", + "kind": "model", + "type": { + "$ref": "1249" + }, + "value": { + "$id": "2484", + "advanced": { + "$id": "2485", + "kind": "model", + "type": { + "$ref": "1251" + }, + "value": { + "$id": "2486", + "clients": { + "$id": "2487", + "kind": "model", + "type": { + "$ref": "1253" + }, + "value": { + "$id": "2488", + "maxSessionExpirySeconds": { + "$id": "2489", + "kind": "number", + "type": { + "$ref": "1255" + }, + "value": 3859 + }, + "maxMessageExpirySeconds": { + "$id": "2490", + "kind": "number", + "type": { + "$ref": "1259" + }, + "value": 3263 + }, + "maxPacketSizeBytes": { + "$id": "2491", + "kind": "number", + "type": { + "$ref": "1263" + }, + "value": 3029 + }, + "subscriberQueueLimit": { + "$id": "2492", + "kind": "model", + "type": { + "$ref": "1267" + }, + "value": { + "$id": "2493", + "length": { + "$id": "2494", + "kind": "number", + "type": { + "$ref": "1269" + }, + "value": 6 + }, + "strategy": { + "$id": "2495", + "kind": "string", + "type": { + "$ref": "274" + }, + "value": "None" + } + } + }, + "maxReceiveMaximum": { + "$id": "2496", + "kind": "number", + "type": { + "$ref": "1278" + }, + "value": 2365 + }, + "maxKeepAliveSeconds": { + "$id": "2497", + "kind": "number", + "type": { + "$ref": "1282" + }, + "value": 3744 + } + } + }, + "encryptInternalTraffic": { + "$id": "2498", + "kind": "string", + "type": { + "$ref": "62" + }, + "value": "Enabled" + }, + "internalCerts": { + "$id": "2499", + "kind": "model", + "type": { + "$ref": "1291" + }, + "value": { + "$id": "2500", + "duration": { + "$id": "2501", + "kind": "string", + "type": { + "$ref": "1293" + }, + "value": "bchrc" + }, + "renewBefore": { + "$id": "2502", + "kind": "string", + "type": { + "$ref": "1297" + }, + "value": "xkafmpgjfifkwwrhkswtopdnne" + }, + "privateKey": { + "$id": "2503", + "kind": "model", + "type": { + "$ref": "1194" + }, + "value": { + "$id": "2504", + "algorithm": { + "$id": "2505", + "kind": "string", + "type": { + "$ref": "244" + }, + "value": "Ec256" + }, + "rotationPolicy": { + "$id": "2506", + "kind": "string", + "type": { + "$ref": "260" + }, + "value": "Always" + } + } + } + } + } + } + }, + "cardinality": { + "$id": "2507", + "kind": "model", + "type": { + "$ref": "1308" + }, + "value": { + "$id": "2508", + "backendChain": { + "$id": "2509", + "kind": "model", + "type": { + "$ref": "1310" + }, + "value": { + "$id": "2510", + "partitions": { + "$id": "2511", + "kind": "number", + "type": { + "$ref": "1312" + }, + "value": 11 + }, + "redundancyFactor": { + "$id": "2512", + "kind": "number", + "type": { + "$ref": "1316" + }, + "value": 5 + }, + "workers": { + "$id": "2513", + "kind": "number", + "type": { + "$ref": "1320" + }, + "value": 15 + } + } + }, + "frontend": { + "$id": "2514", + "kind": "model", + "type": { + "$ref": "1326" + }, + "value": { + "$id": "2515", + "replicas": { + "$id": "2516", + "kind": "number", + "type": { + "$ref": "1328" + }, + "value": 2 + }, + "workers": { + "$id": "2517", + "kind": "number", + "type": { + "$ref": "1332" + }, + "value": 6 + } + } + } + } + }, + "diagnostics": { + "$id": "2518", + "kind": "model", + "type": { + "$ref": "1340" + }, + "value": { + "$id": "2519", + "logs": { + "$id": "2520", + "kind": "model", + "type": { + "$ref": "911" + }, + "value": { + "$id": "2521", + "level": { + "$id": "2522", + "kind": "string", + "type": { + "$ref": "913" + }, + "value": "rnmwokumdmebpmfxxxzvvjfdywotav" + } + } + }, + "metrics": { + "$id": "2523", + "kind": "model", + "type": { + "$ref": "919" + }, + "value": { + "$id": "2524", + "prometheusPort": { + "$id": "2525", + "kind": "number", + "type": { + "$ref": "921" + }, + "value": 7581 + } + } + }, + "selfCheck": { + "$id": "2526", + "kind": "model", + "type": { + "$ref": "1348" + }, + "value": { + "$id": "2527", + "mode": { + "$id": "2528", + "kind": "string", + "type": { + "$ref": "62" + }, + "value": "Enabled" + }, + "intervalSeconds": { + "$id": "2529", + "kind": "number", + "type": { + "$ref": "1353" + }, + "value": 158 + }, + "timeoutSeconds": { + "$id": "2530", + "kind": "number", + "type": { + "$ref": "1357" + }, + "value": 14 + } + } + }, + "traces": { + "$id": "2531", + "kind": "model", + "type": { + "$ref": "1363" + }, + "value": { + "$id": "2532", + "mode": { + "$id": "2533", + "kind": "string", + "type": { + "$ref": "62" + }, + "value": "Enabled" + }, + "cacheSizeMegabytes": { + "$id": "2534", + "kind": "number", + "type": { + "$ref": "1368" + }, + "value": 28 + }, + "selfTracing": { + "$id": "2535", + "kind": "model", + "type": { + "$ref": "1372" + }, + "value": { + "$id": "2536", + "mode": { + "$id": "2537", + "kind": "string", + "type": { + "$ref": "62" + }, + "value": "Enabled" + }, + "intervalSeconds": { + "$id": "2538", + "kind": "number", + "type": { + "$ref": "1377" + }, + "value": 22 + } + } + }, + "spanChannelCapacity": { + "$id": "2539", + "kind": "number", + "type": { + "$ref": "1383" + }, + "value": 1000 + } + } + } + } + }, + "diskBackedMessageBuffer": { + "$id": "2540", + "kind": "model", + "type": { + "$ref": "1391" + }, + "value": { + "$id": "2541", + "maxSize": { + "$id": "2542", + "kind": "string", + "type": { + "$ref": "1393" + }, + "value": "500M" + }, + "ephemeralVolumeClaimSpec": { + "$id": "2543", + "kind": "model", + "type": { + "$ref": "1397" + }, + "value": { + "$id": "2544", + "volumeName": { + "$id": "2545", + "kind": "string", + "type": { + "$ref": "1399" + }, + "value": "c" + }, + "volumeMode": { + "$id": "2546", + "kind": "string", + "type": { + "$ref": "1403" + }, + "value": "rxvpksjuuugqnqzeiprocknbn" + }, + "storageClassName": { + "$id": "2547", + "kind": "string", + "type": { + "$ref": "1407" + }, + "value": "sseyhrjptkhrqvpdpjmornkqvon" + }, + "accessModes": { + "$id": "2548", + "kind": "array", + "type": { + "$ref": "1411" + }, + "value": [ + { + "$id": "2549", + "kind": "string", + "type": { + "$ref": "1412" + }, + "value": "nuluhigrbb" + } + ] + }, + "dataSource": { + "$id": "2550", + "kind": "model", + "type": { + "$ref": "1416" + }, + "value": { + "$id": "2551", + "apiGroup": { + "$id": "2552", + "kind": "string", + "type": { + "$ref": "1418" + }, + "value": "npqapyksvvpkohujx" + }, + "kind": { + "$id": "2553", + "kind": "string", + "type": { + "$ref": "1422" + }, + "value": "wazgyb" + }, + "name": { + "$id": "2554", + "kind": "string", + "type": { + "$ref": "1426" + }, + "value": "cwhsgxxcxsyppoefm" + } + } + }, + "dataSourceRef": { + "$id": "2555", + "kind": "model", + "type": { + "$ref": "1432" + }, + "value": { + "$id": "2556", + "apiGroup": { + "$id": "2557", + "kind": "string", + "type": { + "$ref": "1434" + }, + "value": "mnfnykznjjsoqpfsgdqioupt" + }, + "kind": { + "$id": "2558", + "kind": "string", + "type": { + "$ref": "1438" + }, + "value": "odynqzekfzsnawrctaxg" + }, + "name": { + "$id": "2559", + "kind": "string", + "type": { + "$ref": "1442" + }, + "value": "envszivbbmixbyddzg" + }, + "namespace": { + "$id": "2560", + "kind": "string", + "type": { + "$ref": "1446" + }, + "value": "etcfzvxqd" + } + } + }, + "resources": { + "$id": "2561", + "kind": "model", + "type": { + "$ref": "1452" + }, + "value": { + "$id": "2562", + "limits": { + "$id": "2563", + "kind": "dict", + "type": { + "$ref": "1454" + }, + "value": { + "$id": "2564", + "key2719": { + "$id": "2565", + "kind": "string", + "type": { + "$ref": "1456" + }, + "value": "hmphcrgctu" + } + } + }, + "requests": { + "$id": "2566", + "kind": "dict", + "type": { + "$ref": "1460" + }, + "value": { + "$id": "2567", + "key2909": { + "$id": "2568", + "kind": "string", + "type": { + "$ref": "1462" + }, + "value": "txocprnyrsgvhfrg" + } + } + } + } + }, + "selector": { + "$id": "2569", + "kind": "model", + "type": { + "$ref": "1468" + }, + "value": { + "$id": "2570", + "matchExpressions": { + "$id": "2571", + "kind": "array", + "type": { + "$ref": "1470" + }, + "value": [ + { + "$id": "2572", + "kind": "model", + "type": { + "$ref": "1471" + }, + "value": { + "$id": "2573", + "key": { + "$id": "2574", + "kind": "string", + "type": { + "$ref": "1473" + }, + "value": "e" + }, + "operator": { + "$id": "2575", + "kind": "string", + "type": { + "$ref": "280" + }, + "value": "In" + }, + "values": { + "$id": "2576", + "kind": "array", + "type": { + "$ref": "1480" + }, + "value": [ + { + "$id": "2577", + "kind": "string", + "type": { + "$ref": "1481" + }, + "value": "slmpajlywqvuyknipgztsonqyybt" + } + ] + } + } + } + ] + }, + "matchLabels": { + "$id": "2578", + "kind": "dict", + "type": { + "$ref": "1487" + }, + "value": { + "$id": "2579", + "key6673": { + "$id": "2580", + "kind": "string", + "type": { + "$ref": "1489" + }, + "value": "wlngfalznwxnurzpgxomcxhbqefpr" + } + } + } + } + } + } + }, + "persistentVolumeClaimSpec": { + "$id": "2581", + "kind": "model", + "type": { + "$ref": "1397" + }, + "value": { + "$id": "2582", + "volumeName": { + "$id": "2583", + "kind": "string", + "type": { + "$ref": "1399" + }, + "value": "c" + }, + "volumeMode": { + "$id": "2584", + "kind": "string", + "type": { + "$ref": "1403" + }, + "value": "rxvpksjuuugqnqzeiprocknbn" + }, + "storageClassName": { + "$id": "2585", + "kind": "string", + "type": { + "$ref": "1407" + }, + "value": "sseyhrjptkhrqvpdpjmornkqvon" + }, + "accessModes": { + "$id": "2586", + "kind": "array", + "type": { + "$ref": "1411" + }, + "value": [ + { + "$id": "2587", + "kind": "string", + "type": { + "$ref": "1412" + }, + "value": "nuluhigrbb" + } + ] + }, + "dataSource": { + "$id": "2588", + "kind": "model", + "type": { + "$ref": "1416" + }, + "value": { + "$id": "2589", + "apiGroup": { + "$id": "2590", + "kind": "string", + "type": { + "$ref": "1418" + }, + "value": "npqapyksvvpkohujx" + }, + "kind": { + "$id": "2591", + "kind": "string", + "type": { + "$ref": "1422" + }, + "value": "wazgyb" + }, + "name": { + "$id": "2592", + "kind": "string", + "type": { + "$ref": "1426" + }, + "value": "cwhsgxxcxsyppoefm" + } + } + }, + "dataSourceRef": { + "$id": "2593", + "kind": "model", + "type": { + "$ref": "1432" + }, + "value": { + "$id": "2594", + "apiGroup": { + "$id": "2595", + "kind": "string", + "type": { + "$ref": "1434" + }, + "value": "mnfnykznjjsoqpfsgdqioupt" + }, + "kind": { + "$id": "2596", + "kind": "string", + "type": { + "$ref": "1438" + }, + "value": "odynqzekfzsnawrctaxg" + }, + "name": { + "$id": "2597", + "kind": "string", + "type": { + "$ref": "1442" + }, + "value": "envszivbbmixbyddzg" + }, + "namespace": { + "$id": "2598", + "kind": "string", + "type": { + "$ref": "1446" + }, + "value": "etcfzvxqd" + } + } + }, + "resources": { + "$id": "2599", + "kind": "model", + "type": { + "$ref": "1452" + }, + "value": { + "$id": "2600", + "limits": { + "$id": "2601", + "kind": "dict", + "type": { + "$ref": "1454" + }, + "value": { + "$id": "2602", + "key2719": { + "$id": "2603", + "kind": "string", + "type": { + "$ref": "1456" + }, + "value": "hmphcrgctu" + } + } + }, + "requests": { + "$id": "2604", + "kind": "dict", + "type": { + "$ref": "1460" + }, + "value": { + "$id": "2605", + "key2909": { + "$id": "2606", + "kind": "string", + "type": { + "$ref": "1462" + }, + "value": "txocprnyrsgvhfrg" + } + } + } + } + }, + "selector": { + "$id": "2607", + "kind": "model", + "type": { + "$ref": "1468" + }, + "value": { + "$id": "2608", + "matchExpressions": { + "$id": "2609", + "kind": "array", + "type": { + "$ref": "1470" + }, + "value": [ + { + "$id": "2610", + "kind": "model", + "type": { + "$ref": "1471" + }, + "value": { + "$id": "2611", + "key": { + "$id": "2612", + "kind": "string", + "type": { + "$ref": "1473" + }, + "value": "e" + }, + "operator": { + "$id": "2613", + "kind": "string", + "type": { + "$ref": "280" + }, + "value": "In" + }, + "values": { + "$id": "2614", + "kind": "array", + "type": { + "$ref": "1480" + }, + "value": [ + { + "$id": "2615", + "kind": "string", + "type": { + "$ref": "1481" + }, + "value": "slmpajlywqvuyknipgztsonqyybt" + } + ] + } + } + } + ] + }, + "matchLabels": { + "$id": "2616", + "kind": "dict", + "type": { + "$ref": "1487" + }, + "value": { + "$id": "2617", + "key6673": { + "$id": "2618", + "kind": "string", + "type": { + "$ref": "1489" + }, + "value": "wlngfalznwxnurzpgxomcxhbqefpr" + } + } + } + } + } + } + } + } + }, + "generateResourceLimits": { + "$id": "2619", + "kind": "model", + "type": { + "$ref": "1502" + }, + "value": { + "$id": "2620", + "cpu": { + "$id": "2621", + "kind": "string", + "type": { + "$ref": "62" + }, + "value": "Enabled" + } + } + }, + "memoryProfile": { + "$id": "2622", + "kind": "string", + "type": { + "$ref": "290" + }, + "value": "Tiny" + } + } + }, + "extendedLocation": { + "$id": "2623", + "kind": "model", + "type": { + "$ref": "669" + }, + "value": { + "$id": "2624", + "name": { + "$id": "2625", + "kind": "string", + "type": { + "$ref": "671" + }, + "value": "qmbrfwcpwwhggszhrdjv" + }, + "type": { + "$id": "2626", + "kind": "string", + "type": { + "$ref": "142" + }, + "value": "CustomLocation" + } + } + } + } + } + } + ], + "responses": [ + { + "$id": "2627", + "response": { + "$ref": "2345" + }, + "statusCode": 200, + "bodyValue": { + "$id": "2628", + "kind": "model", + "type": { + "$ref": "1247" + }, + "value": { + "$id": "2629", + "properties": { + "$id": "2630", + "kind": "model", + "type": { + "$ref": "1249" + }, + "value": { + "$id": "2631", + "advanced": { + "$id": "2632", + "kind": "model", + "type": { + "$ref": "1251" + }, + "value": { + "$id": "2633", + "clients": { + "$id": "2634", + "kind": "model", + "type": { + "$ref": "1253" + }, + "value": { + "$id": "2635", + "maxSessionExpirySeconds": { + "$id": "2636", + "kind": "number", + "type": { + "$ref": "1255" + }, + "value": 3859 + }, + "maxMessageExpirySeconds": { + "$id": "2637", + "kind": "number", + "type": { + "$ref": "1259" + }, + "value": 3263 + }, + "maxPacketSizeBytes": { + "$id": "2638", + "kind": "number", + "type": { + "$ref": "1263" + }, + "value": 3029 + }, + "subscriberQueueLimit": { + "$id": "2639", + "kind": "model", + "type": { + "$ref": "1267" + }, + "value": { + "$id": "2640", + "length": { + "$id": "2641", + "kind": "number", + "type": { + "$ref": "1269" + }, + "value": 6 + }, + "strategy": { + "$id": "2642", + "kind": "string", + "type": { + "$ref": "274" + }, + "value": "None" + } + } + }, + "maxReceiveMaximum": { + "$id": "2643", + "kind": "number", + "type": { + "$ref": "1278" + }, + "value": 2365 + }, + "maxKeepAliveSeconds": { + "$id": "2644", + "kind": "number", + "type": { + "$ref": "1282" + }, + "value": 3744 + } + } + }, + "encryptInternalTraffic": { + "$id": "2645", + "kind": "string", + "type": { + "$ref": "62" + }, + "value": "Enabled" + }, + "internalCerts": { + "$id": "2646", + "kind": "model", + "type": { + "$ref": "1291" + }, + "value": { + "$id": "2647", + "duration": { + "$id": "2648", + "kind": "string", + "type": { + "$ref": "1293" + }, + "value": "bchrc" + }, + "renewBefore": { + "$id": "2649", + "kind": "string", + "type": { + "$ref": "1297" + }, + "value": "xkafmpgjfifkwwrhkswtopdnne" + }, + "privateKey": { + "$id": "2650", + "kind": "model", + "type": { + "$ref": "1194" + }, + "value": { + "$id": "2651", + "algorithm": { + "$id": "2652", + "kind": "string", + "type": { + "$ref": "244" + }, + "value": "Ec256" + }, + "rotationPolicy": { + "$id": "2653", + "kind": "string", + "type": { + "$ref": "260" + }, + "value": "Always" + } + } + } + } + } + } + }, + "cardinality": { + "$id": "2654", + "kind": "model", + "type": { + "$ref": "1308" + }, + "value": { + "$id": "2655", + "backendChain": { + "$id": "2656", + "kind": "model", + "type": { + "$ref": "1310" + }, + "value": { + "$id": "2657", + "partitions": { + "$id": "2658", + "kind": "number", + "type": { + "$ref": "1312" + }, + "value": 11 + }, + "redundancyFactor": { + "$id": "2659", + "kind": "number", + "type": { + "$ref": "1316" + }, + "value": 5 + }, + "workers": { + "$id": "2660", + "kind": "number", + "type": { + "$ref": "1320" + }, + "value": 15 + } + } + }, + "frontend": { + "$id": "2661", + "kind": "model", + "type": { + "$ref": "1326" + }, + "value": { + "$id": "2662", + "replicas": { + "$id": "2663", + "kind": "number", + "type": { + "$ref": "1328" + }, + "value": 2 + }, + "workers": { + "$id": "2664", + "kind": "number", + "type": { + "$ref": "1332" + }, + "value": 6 + } + } + } + } + }, + "diagnostics": { + "$id": "2665", + "kind": "model", + "type": { + "$ref": "1340" + }, + "value": { + "$id": "2666", + "logs": { + "$id": "2667", + "kind": "model", + "type": { + "$ref": "911" + }, + "value": { + "$id": "2668", + "level": { + "$id": "2669", + "kind": "string", + "type": { + "$ref": "913" + }, + "value": "rnmwokumdmebpmfxxxzvvjfdywotav" + } + } + }, + "metrics": { + "$id": "2670", + "kind": "model", + "type": { + "$ref": "919" + }, + "value": { + "$id": "2671", + "prometheusPort": { + "$id": "2672", + "kind": "number", + "type": { + "$ref": "921" + }, + "value": 7581 + } + } + }, + "selfCheck": { + "$id": "2673", + "kind": "model", + "type": { + "$ref": "1348" + }, + "value": { + "$id": "2674", + "mode": { + "$id": "2675", + "kind": "string", + "type": { + "$ref": "62" + }, + "value": "Enabled" + }, + "intervalSeconds": { + "$id": "2676", + "kind": "number", + "type": { + "$ref": "1353" + }, + "value": 158 + }, + "timeoutSeconds": { + "$id": "2677", + "kind": "number", + "type": { + "$ref": "1357" + }, + "value": 14 + } + } + }, + "traces": { + "$id": "2678", + "kind": "model", + "type": { + "$ref": "1363" + }, + "value": { + "$id": "2679", + "mode": { + "$id": "2680", + "kind": "string", + "type": { + "$ref": "62" + }, + "value": "Enabled" + }, + "cacheSizeMegabytes": { + "$id": "2681", + "kind": "number", + "type": { + "$ref": "1368" + }, + "value": 28 + }, + "selfTracing": { + "$id": "2682", + "kind": "model", + "type": { + "$ref": "1372" + }, + "value": { + "$id": "2683", + "mode": { + "$id": "2684", + "kind": "string", + "type": { + "$ref": "62" + }, + "value": "Enabled" + }, + "intervalSeconds": { + "$id": "2685", + "kind": "number", + "type": { + "$ref": "1377" + }, + "value": 22 + } + } + }, + "spanChannelCapacity": { + "$id": "2686", + "kind": "number", + "type": { + "$ref": "1383" + }, + "value": 1000 + } + } + } + } + }, + "diskBackedMessageBuffer": { + "$id": "2687", + "kind": "model", + "type": { + "$ref": "1391" + }, + "value": { + "$id": "2688", + "maxSize": { + "$id": "2689", + "kind": "string", + "type": { + "$ref": "1393" + }, + "value": "500M" + }, + "ephemeralVolumeClaimSpec": { + "$id": "2690", + "kind": "model", + "type": { + "$ref": "1397" + }, + "value": { + "$id": "2691", + "volumeName": { + "$id": "2692", + "kind": "string", + "type": { + "$ref": "1399" + }, + "value": "c" + }, + "volumeMode": { + "$id": "2693", + "kind": "string", + "type": { + "$ref": "1403" + }, + "value": "rxvpksjuuugqnqzeiprocknbn" + }, + "storageClassName": { + "$id": "2694", + "kind": "string", + "type": { + "$ref": "1407" + }, + "value": "sseyhrjptkhrqvpdpjmornkqvon" + }, + "accessModes": { + "$id": "2695", + "kind": "array", + "type": { + "$ref": "1411" + }, + "value": [ + { + "$id": "2696", + "kind": "string", + "type": { + "$ref": "1412" + }, + "value": "nuluhigrbb" + } + ] + }, + "dataSource": { + "$id": "2697", + "kind": "model", + "type": { + "$ref": "1416" + }, + "value": { + "$id": "2698", + "apiGroup": { + "$id": "2699", + "kind": "string", + "type": { + "$ref": "1418" + }, + "value": "npqapyksvvpkohujx" + }, + "kind": { + "$id": "2700", + "kind": "string", + "type": { + "$ref": "1422" + }, + "value": "wazgyb" + }, + "name": { + "$id": "2701", + "kind": "string", + "type": { + "$ref": "1426" + }, + "value": "cwhsgxxcxsyppoefm" + } + } + }, + "dataSourceRef": { + "$id": "2702", + "kind": "model", + "type": { + "$ref": "1432" + }, + "value": { + "$id": "2703", + "apiGroup": { + "$id": "2704", + "kind": "string", + "type": { + "$ref": "1434" + }, + "value": "mnfnykznjjsoqpfsgdqioupt" + }, + "kind": { + "$id": "2705", + "kind": "string", + "type": { + "$ref": "1438" + }, + "value": "odynqzekfzsnawrctaxg" + }, + "name": { + "$id": "2706", + "kind": "string", + "type": { + "$ref": "1442" + }, + "value": "envszivbbmixbyddzg" + }, + "namespace": { + "$id": "2707", + "kind": "string", + "type": { + "$ref": "1446" + }, + "value": "etcfzvxqd" + } + } + }, + "resources": { + "$id": "2708", + "kind": "model", + "type": { + "$ref": "1452" + }, + "value": { + "$id": "2709", + "limits": { + "$id": "2710", + "kind": "dict", + "type": { + "$ref": "1454" + }, + "value": { + "$id": "2711", + "key2719": { + "$id": "2712", + "kind": "string", + "type": { + "$ref": "1456" + }, + "value": "hmphcrgctu" + } + } + }, + "requests": { + "$id": "2713", + "kind": "dict", + "type": { + "$ref": "1460" + }, + "value": { + "$id": "2714", + "key2909": { + "$id": "2715", + "kind": "string", + "type": { + "$ref": "1462" + }, + "value": "txocprnyrsgvhfrg" + } + } + } + } + }, + "selector": { + "$id": "2716", + "kind": "model", + "type": { + "$ref": "1468" + }, + "value": { + "$id": "2717", + "matchExpressions": { + "$id": "2718", + "kind": "array", + "type": { + "$ref": "1470" + }, + "value": [ + { + "$id": "2719", + "kind": "model", + "type": { + "$ref": "1471" + }, + "value": { + "$id": "2720", + "key": { + "$id": "2721", + "kind": "string", + "type": { + "$ref": "1473" + }, + "value": "e" + }, + "operator": { + "$id": "2722", + "kind": "string", + "type": { + "$ref": "280" + }, + "value": "In" + }, + "values": { + "$id": "2723", + "kind": "array", + "type": { + "$ref": "1480" + }, + "value": [ + { + "$id": "2724", + "kind": "string", + "type": { + "$ref": "1481" + }, + "value": "slmpajlywqvuyknipgztsonqyybt" + } + ] + } + } + } + ] + }, + "matchLabels": { + "$id": "2725", + "kind": "dict", + "type": { + "$ref": "1487" + }, + "value": { + "$id": "2726", + "key6673": { + "$id": "2727", + "kind": "string", + "type": { + "$ref": "1489" + }, + "value": "wlngfalznwxnurzpgxomcxhbqefpr" + } + } + } + } + } + } + }, + "persistentVolumeClaimSpec": { + "$id": "2728", + "kind": "model", + "type": { + "$ref": "1397" + }, + "value": { + "$id": "2729", + "volumeName": { + "$id": "2730", + "kind": "string", + "type": { + "$ref": "1399" + }, + "value": "c" + }, + "volumeMode": { + "$id": "2731", + "kind": "string", + "type": { + "$ref": "1403" + }, + "value": "rxvpksjuuugqnqzeiprocknbn" + }, + "storageClassName": { + "$id": "2732", + "kind": "string", + "type": { + "$ref": "1407" + }, + "value": "sseyhrjptkhrqvpdpjmornkqvon" + }, + "accessModes": { + "$id": "2733", + "kind": "array", + "type": { + "$ref": "1411" + }, + "value": [ + { + "$id": "2734", + "kind": "string", + "type": { + "$ref": "1412" + }, + "value": "nuluhigrbb" + } + ] + }, + "dataSource": { + "$id": "2735", + "kind": "model", + "type": { + "$ref": "1416" + }, + "value": { + "$id": "2736", + "apiGroup": { + "$id": "2737", + "kind": "string", + "type": { + "$ref": "1418" + }, + "value": "npqapyksvvpkohujx" + }, + "kind": { + "$id": "2738", + "kind": "string", + "type": { + "$ref": "1422" + }, + "value": "wazgyb" + }, + "name": { + "$id": "2739", + "kind": "string", + "type": { + "$ref": "1426" + }, + "value": "cwhsgxxcxsyppoefm" + } + } + }, + "dataSourceRef": { + "$id": "2740", + "kind": "model", + "type": { + "$ref": "1432" + }, + "value": { + "$id": "2741", + "apiGroup": { + "$id": "2742", + "kind": "string", + "type": { + "$ref": "1434" + }, + "value": "mnfnykznjjsoqpfsgdqioupt" + }, + "kind": { + "$id": "2743", + "kind": "string", + "type": { + "$ref": "1438" + }, + "value": "odynqzekfzsnawrctaxg" + }, + "name": { + "$id": "2744", + "kind": "string", + "type": { + "$ref": "1442" + }, + "value": "envszivbbmixbyddzg" + }, + "namespace": { + "$id": "2745", + "kind": "string", + "type": { + "$ref": "1446" + }, + "value": "etcfzvxqd" + } + } + }, + "resources": { + "$id": "2746", + "kind": "model", + "type": { + "$ref": "1452" + }, + "value": { + "$id": "2747", + "limits": { + "$id": "2748", + "kind": "dict", + "type": { + "$ref": "1454" + }, + "value": { + "$id": "2749", + "key2719": { + "$id": "2750", + "kind": "string", + "type": { + "$ref": "1456" + }, + "value": "hmphcrgctu" + } + } + }, + "requests": { + "$id": "2751", + "kind": "dict", + "type": { + "$ref": "1460" + }, + "value": { + "$id": "2752", + "key2909": { + "$id": "2753", + "kind": "string", + "type": { + "$ref": "1462" + }, + "value": "txocprnyrsgvhfrg" + } + } + } + } + }, + "selector": { + "$id": "2754", + "kind": "model", + "type": { + "$ref": "1468" + }, + "value": { + "$id": "2755", + "matchExpressions": { + "$id": "2756", + "kind": "array", + "type": { + "$ref": "1470" + }, + "value": [ + { + "$id": "2757", + "kind": "model", + "type": { + "$ref": "1471" + }, + "value": { + "$id": "2758", + "key": { + "$id": "2759", + "kind": "string", + "type": { + "$ref": "1473" + }, + "value": "e" + }, + "operator": { + "$id": "2760", + "kind": "string", + "type": { + "$ref": "280" + }, + "value": "In" + }, + "values": { + "$id": "2761", + "kind": "array", + "type": { + "$ref": "1480" + }, + "value": [ + { + "$id": "2762", + "kind": "string", + "type": { + "$ref": "1481" + }, + "value": "slmpajlywqvuyknipgztsonqyybt" + } + ] + } + } + } + ] + }, + "matchLabels": { + "$id": "2763", + "kind": "dict", + "type": { + "$ref": "1487" + }, + "value": { + "$id": "2764", + "key6673": { + "$id": "2765", + "kind": "string", + "type": { + "$ref": "1489" + }, + "value": "wlngfalznwxnurzpgxomcxhbqefpr" + } + } + } + } + } + } + } + } + }, + "generateResourceLimits": { + "$id": "2766", + "kind": "model", + "type": { + "$ref": "1502" + }, + "value": { + "$id": "2767", + "cpu": { + "$id": "2768", + "kind": "string", + "type": { + "$ref": "62" + }, + "value": "Enabled" + } + } + }, + "memoryProfile": { + "$id": "2769", + "kind": "string", + "type": { + "$ref": "290" + }, + "value": "Tiny" + }, + "provisioningState": { + "$id": "2770", + "kind": "string", + "type": { + "$ref": "126" + }, + "value": "Succeeded" + } + } + }, + "extendedLocation": { + "$id": "2771", + "kind": "model", + "type": { + "$ref": "669" + }, + "value": { + "$id": "2772", + "name": { + "$id": "2773", + "kind": "string", + "type": { + "$ref": "671" + }, + "value": "qmbrfwcpwwhggszhrdjv" + }, + "type": { + "$id": "2774", + "kind": "string", + "type": { + "$ref": "142" + }, + "value": "CustomLocation" + } + } + }, + "id": { + "$id": "2775", + "kind": "string", + "type": { + "$ref": "330" + }, + "value": "/subscriptions/0000000-0000-0000-0000-000000000000/resourceGroups/resourceGroup123/providers/Microsoft.IoTOperations/instances/resource-name123/brokers/resource-name123" + }, + "name": { + "$id": "2776", + "kind": "string", + "type": { + "$ref": "335" + }, + "value": "dowrkel" + }, + "type": { + "$id": "2777", + "kind": "string", + "type": { + "$ref": "339" + }, + "value": "xshjnsdgadygb" + }, + "systemData": { + "$id": "2778", + "kind": "model", + "type": { + "$ref": "344" + }, + "value": { + "$id": "2779", + "createdBy": { + "$id": "2780", + "kind": "string", + "type": { + "$ref": "346" + }, + "value": "ssvaslsmudloholronopqyxjcu" + }, + "createdByType": { + "$id": "2781", + "kind": "string", + "type": { + "$ref": "146" + }, + "value": "User" + }, + "createdAt": { + "$id": "2782", + "kind": "string", + "type": { + "$ref": "353" + }, + "value": "2024-08-09T18:13:29.389Z" + }, + "lastModifiedBy": { + "$id": "2783", + "kind": "string", + "type": { + "$ref": "358" + }, + "value": "gnicpuszwd" + }, + "lastModifiedByType": { + "$id": "2784", + "kind": "string", + "type": { + "$ref": "146" + }, + "value": "User" + }, + "lastModifiedAt": { + "$id": "2785", + "kind": "string", + "type": { + "$ref": "365" + }, + "value": "2024-08-09T18:13:29.389Z" + } + } + } + } + } + }, + { + "$id": "2786", + "response": { + "$ref": "2346" + }, + "statusCode": 201, + "bodyValue": { + "$id": "2787", + "kind": "model", + "type": { + "$ref": "1247" + }, + "value": { + "$id": "2788", + "properties": { + "$id": "2789", + "kind": "model", + "type": { + "$ref": "1249" + }, + "value": { + "$id": "2790", + "advanced": { + "$id": "2791", + "kind": "model", + "type": { + "$ref": "1251" + }, + "value": { + "$id": "2792", + "clients": { + "$id": "2793", + "kind": "model", + "type": { + "$ref": "1253" + }, + "value": { + "$id": "2794", + "maxSessionExpirySeconds": { + "$id": "2795", + "kind": "number", + "type": { + "$ref": "1255" + }, + "value": 3859 + }, + "maxMessageExpirySeconds": { + "$id": "2796", + "kind": "number", + "type": { + "$ref": "1259" + }, + "value": 3263 + }, + "maxPacketSizeBytes": { + "$id": "2797", + "kind": "number", + "type": { + "$ref": "1263" + }, + "value": 3029 + }, + "subscriberQueueLimit": { + "$id": "2798", + "kind": "model", + "type": { + "$ref": "1267" + }, + "value": { + "$id": "2799", + "length": { + "$id": "2800", + "kind": "number", + "type": { + "$ref": "1269" + }, + "value": 6 + }, + "strategy": { + "$id": "2801", + "kind": "string", + "type": { + "$ref": "274" + }, + "value": "None" + } + } + }, + "maxReceiveMaximum": { + "$id": "2802", + "kind": "number", + "type": { + "$ref": "1278" + }, + "value": 2365 + }, + "maxKeepAliveSeconds": { + "$id": "2803", + "kind": "number", + "type": { + "$ref": "1282" + }, + "value": 3744 + } + } + }, + "encryptInternalTraffic": { + "$id": "2804", + "kind": "string", + "type": { + "$ref": "62" + }, + "value": "Enabled" + }, + "internalCerts": { + "$id": "2805", + "kind": "model", + "type": { + "$ref": "1291" + }, + "value": { + "$id": "2806", + "duration": { + "$id": "2807", + "kind": "string", + "type": { + "$ref": "1293" + }, + "value": "bchrc" + }, + "renewBefore": { + "$id": "2808", + "kind": "string", + "type": { + "$ref": "1297" + }, + "value": "xkafmpgjfifkwwrhkswtopdnne" + }, + "privateKey": { + "$id": "2809", + "kind": "model", + "type": { + "$ref": "1194" + }, + "value": { + "$id": "2810", + "algorithm": { + "$id": "2811", + "kind": "string", + "type": { + "$ref": "244" + }, + "value": "Ec256" + }, + "rotationPolicy": { + "$id": "2812", + "kind": "string", + "type": { + "$ref": "260" + }, + "value": "Always" + } + } + } + } + } + } + }, + "cardinality": { + "$id": "2813", + "kind": "model", + "type": { + "$ref": "1308" + }, + "value": { + "$id": "2814", + "backendChain": { + "$id": "2815", + "kind": "model", + "type": { + "$ref": "1310" + }, + "value": { + "$id": "2816", + "partitions": { + "$id": "2817", + "kind": "number", + "type": { + "$ref": "1312" + }, + "value": 11 + }, + "redundancyFactor": { + "$id": "2818", + "kind": "number", + "type": { + "$ref": "1316" + }, + "value": 5 + }, + "workers": { + "$id": "2819", + "kind": "number", + "type": { + "$ref": "1320" + }, + "value": 15 + } + } + }, + "frontend": { + "$id": "2820", + "kind": "model", + "type": { + "$ref": "1326" + }, + "value": { + "$id": "2821", + "replicas": { + "$id": "2822", + "kind": "number", + "type": { + "$ref": "1328" + }, + "value": 2 + }, + "workers": { + "$id": "2823", + "kind": "number", + "type": { + "$ref": "1332" + }, + "value": 6 + } + } + } + } + }, + "diagnostics": { + "$id": "2824", + "kind": "model", + "type": { + "$ref": "1340" + }, + "value": { + "$id": "2825", + "logs": { + "$id": "2826", + "kind": "model", + "type": { + "$ref": "911" + }, + "value": { + "$id": "2827", + "level": { + "$id": "2828", + "kind": "string", + "type": { + "$ref": "913" + }, + "value": "rnmwokumdmebpmfxxxzvvjfdywotav" + } + } + }, + "metrics": { + "$id": "2829", + "kind": "model", + "type": { + "$ref": "919" + }, + "value": { + "$id": "2830", + "prometheusPort": { + "$id": "2831", + "kind": "number", + "type": { + "$ref": "921" + }, + "value": 7581 + } + } + }, + "selfCheck": { + "$id": "2832", + "kind": "model", + "type": { + "$ref": "1348" + }, + "value": { + "$id": "2833", + "mode": { + "$id": "2834", + "kind": "string", + "type": { + "$ref": "62" + }, + "value": "Enabled" + }, + "intervalSeconds": { + "$id": "2835", + "kind": "number", + "type": { + "$ref": "1353" + }, + "value": 158 + }, + "timeoutSeconds": { + "$id": "2836", + "kind": "number", + "type": { + "$ref": "1357" + }, + "value": 14 + } + } + }, + "traces": { + "$id": "2837", + "kind": "model", + "type": { + "$ref": "1363" + }, + "value": { + "$id": "2838", + "mode": { + "$id": "2839", + "kind": "string", + "type": { + "$ref": "62" + }, + "value": "Enabled" + }, + "cacheSizeMegabytes": { + "$id": "2840", + "kind": "number", + "type": { + "$ref": "1368" + }, + "value": 28 + }, + "selfTracing": { + "$id": "2841", + "kind": "model", + "type": { + "$ref": "1372" + }, + "value": { + "$id": "2842", + "mode": { + "$id": "2843", + "kind": "string", + "type": { + "$ref": "62" + }, + "value": "Enabled" + }, + "intervalSeconds": { + "$id": "2844", + "kind": "number", + "type": { + "$ref": "1377" + }, + "value": 22 + } + } + }, + "spanChannelCapacity": { + "$id": "2845", + "kind": "number", + "type": { + "$ref": "1383" + }, + "value": 1000 + } + } + } + } + }, + "diskBackedMessageBuffer": { + "$id": "2846", + "kind": "model", + "type": { + "$ref": "1391" + }, + "value": { + "$id": "2847", + "maxSize": { + "$id": "2848", + "kind": "string", + "type": { + "$ref": "1393" + }, + "value": "500M" + }, + "ephemeralVolumeClaimSpec": { + "$id": "2849", + "kind": "model", + "type": { + "$ref": "1397" + }, + "value": { + "$id": "2850", + "volumeName": { + "$id": "2851", + "kind": "string", + "type": { + "$ref": "1399" + }, + "value": "c" + }, + "volumeMode": { + "$id": "2852", + "kind": "string", + "type": { + "$ref": "1403" + }, + "value": "rxvpksjuuugqnqzeiprocknbn" + }, + "storageClassName": { + "$id": "2853", + "kind": "string", + "type": { + "$ref": "1407" + }, + "value": "sseyhrjptkhrqvpdpjmornkqvon" + }, + "accessModes": { + "$id": "2854", + "kind": "array", + "type": { + "$ref": "1411" + }, + "value": [ + { + "$id": "2855", + "kind": "string", + "type": { + "$ref": "1412" + }, + "value": "nuluhigrbb" + } + ] + }, + "dataSource": { + "$id": "2856", + "kind": "model", + "type": { + "$ref": "1416" + }, + "value": { + "$id": "2857", + "apiGroup": { + "$id": "2858", + "kind": "string", + "type": { + "$ref": "1418" + }, + "value": "npqapyksvvpkohujx" + }, + "kind": { + "$id": "2859", + "kind": "string", + "type": { + "$ref": "1422" + }, + "value": "wazgyb" + }, + "name": { + "$id": "2860", + "kind": "string", + "type": { + "$ref": "1426" + }, + "value": "cwhsgxxcxsyppoefm" + } + } + }, + "dataSourceRef": { + "$id": "2861", + "kind": "model", + "type": { + "$ref": "1432" + }, + "value": { + "$id": "2862", + "apiGroup": { + "$id": "2863", + "kind": "string", + "type": { + "$ref": "1434" + }, + "value": "mnfnykznjjsoqpfsgdqioupt" + }, + "kind": { + "$id": "2864", + "kind": "string", + "type": { + "$ref": "1438" + }, + "value": "odynqzekfzsnawrctaxg" + }, + "name": { + "$id": "2865", + "kind": "string", + "type": { + "$ref": "1442" + }, + "value": "envszivbbmixbyddzg" + }, + "namespace": { + "$id": "2866", + "kind": "string", + "type": { + "$ref": "1446" + }, + "value": "etcfzvxqd" + } + } + }, + "resources": { + "$id": "2867", + "kind": "model", + "type": { + "$ref": "1452" + }, + "value": { + "$id": "2868", + "limits": { + "$id": "2869", + "kind": "dict", + "type": { + "$ref": "1454" + }, + "value": { + "$id": "2870", + "key2719": { + "$id": "2871", + "kind": "string", + "type": { + "$ref": "1456" + }, + "value": "hmphcrgctu" + } + } + }, + "requests": { + "$id": "2872", + "kind": "dict", + "type": { + "$ref": "1460" + }, + "value": { + "$id": "2873", + "key2909": { + "$id": "2874", + "kind": "string", + "type": { + "$ref": "1462" + }, + "value": "txocprnyrsgvhfrg" + } + } + } + } + }, + "selector": { + "$id": "2875", + "kind": "model", + "type": { + "$ref": "1468" + }, + "value": { + "$id": "2876", + "matchExpressions": { + "$id": "2877", + "kind": "array", + "type": { + "$ref": "1470" + }, + "value": [ + { + "$id": "2878", + "kind": "model", + "type": { + "$ref": "1471" + }, + "value": { + "$id": "2879", + "key": { + "$id": "2880", + "kind": "string", + "type": { + "$ref": "1473" + }, + "value": "e" + }, + "operator": { + "$id": "2881", + "kind": "string", + "type": { + "$ref": "280" + }, + "value": "In" + }, + "values": { + "$id": "2882", + "kind": "array", + "type": { + "$ref": "1480" + }, + "value": [ + { + "$id": "2883", + "kind": "string", + "type": { + "$ref": "1481" + }, + "value": "slmpajlywqvuyknipgztsonqyybt" + } + ] + } + } + } + ] + }, + "matchLabels": { + "$id": "2884", + "kind": "dict", + "type": { + "$ref": "1487" + }, + "value": { + "$id": "2885", + "key6673": { + "$id": "2886", + "kind": "string", + "type": { + "$ref": "1489" + }, + "value": "wlngfalznwxnurzpgxomcxhbqefpr" + } + } + } + } + } + } + }, + "persistentVolumeClaimSpec": { + "$id": "2887", + "kind": "model", + "type": { + "$ref": "1397" + }, + "value": { + "$id": "2888", + "volumeName": { + "$id": "2889", + "kind": "string", + "type": { + "$ref": "1399" + }, + "value": "c" + }, + "volumeMode": { + "$id": "2890", + "kind": "string", + "type": { + "$ref": "1403" + }, + "value": "rxvpksjuuugqnqzeiprocknbn" + }, + "storageClassName": { + "$id": "2891", + "kind": "string", + "type": { + "$ref": "1407" + }, + "value": "sseyhrjptkhrqvpdpjmornkqvon" + }, + "accessModes": { + "$id": "2892", + "kind": "array", + "type": { + "$ref": "1411" + }, + "value": [ + { + "$id": "2893", + "kind": "string", + "type": { + "$ref": "1412" + }, + "value": "nuluhigrbb" + } + ] + }, + "dataSource": { + "$id": "2894", + "kind": "model", + "type": { + "$ref": "1416" + }, + "value": { + "$id": "2895", + "apiGroup": { + "$id": "2896", + "kind": "string", + "type": { + "$ref": "1418" + }, + "value": "npqapyksvvpkohujx" + }, + "kind": { + "$id": "2897", + "kind": "string", + "type": { + "$ref": "1422" + }, + "value": "wazgyb" + }, + "name": { + "$id": "2898", + "kind": "string", + "type": { + "$ref": "1426" + }, + "value": "cwhsgxxcxsyppoefm" + } + } + }, + "dataSourceRef": { + "$id": "2899", + "kind": "model", + "type": { + "$ref": "1432" + }, + "value": { + "$id": "2900", + "apiGroup": { + "$id": "2901", + "kind": "string", + "type": { + "$ref": "1434" + }, + "value": "mnfnykznjjsoqpfsgdqioupt" + }, + "kind": { + "$id": "2902", + "kind": "string", + "type": { + "$ref": "1438" + }, + "value": "odynqzekfzsnawrctaxg" + }, + "name": { + "$id": "2903", + "kind": "string", + "type": { + "$ref": "1442" + }, + "value": "envszivbbmixbyddzg" + }, + "namespace": { + "$id": "2904", + "kind": "string", + "type": { + "$ref": "1446" + }, + "value": "etcfzvxqd" + } + } + }, + "resources": { + "$id": "2905", + "kind": "model", + "type": { + "$ref": "1452" + }, + "value": { + "$id": "2906", + "limits": { + "$id": "2907", + "kind": "dict", + "type": { + "$ref": "1454" + }, + "value": { + "$id": "2908", + "key2719": { + "$id": "2909", + "kind": "string", + "type": { + "$ref": "1456" + }, + "value": "hmphcrgctu" + } + } + }, + "requests": { + "$id": "2910", + "kind": "dict", + "type": { + "$ref": "1460" + }, + "value": { + "$id": "2911", + "key2909": { + "$id": "2912", + "kind": "string", + "type": { + "$ref": "1462" + }, + "value": "txocprnyrsgvhfrg" + } + } + } + } + }, + "selector": { + "$id": "2913", + "kind": "model", + "type": { + "$ref": "1468" + }, + "value": { + "$id": "2914", + "matchExpressions": { + "$id": "2915", + "kind": "array", + "type": { + "$ref": "1470" + }, + "value": [ + { + "$id": "2916", + "kind": "model", + "type": { + "$ref": "1471" + }, + "value": { + "$id": "2917", + "key": { + "$id": "2918", + "kind": "string", + "type": { + "$ref": "1473" + }, + "value": "e" + }, + "operator": { + "$id": "2919", + "kind": "string", + "type": { + "$ref": "280" + }, + "value": "In" + }, + "values": { + "$id": "2920", + "kind": "array", + "type": { + "$ref": "1480" + }, + "value": [ + { + "$id": "2921", + "kind": "string", + "type": { + "$ref": "1481" + }, + "value": "slmpajlywqvuyknipgztsonqyybt" + } + ] + } + } + } + ] + }, + "matchLabels": { + "$id": "2922", + "kind": "dict", + "type": { + "$ref": "1487" + }, + "value": { + "$id": "2923", + "key6673": { + "$id": "2924", + "kind": "string", + "type": { + "$ref": "1489" + }, + "value": "wlngfalznwxnurzpgxomcxhbqefpr" + } + } + } + } + } + } + } + } + }, + "generateResourceLimits": { + "$id": "2925", + "kind": "model", + "type": { + "$ref": "1502" + }, + "value": { + "$id": "2926", + "cpu": { + "$id": "2927", + "kind": "string", + "type": { + "$ref": "62" + }, + "value": "Enabled" + } + } + }, + "memoryProfile": { + "$id": "2928", + "kind": "string", + "type": { + "$ref": "290" + }, + "value": "Tiny" + }, + "provisioningState": { + "$id": "2929", + "kind": "string", + "type": { + "$ref": "126" + }, + "value": "Succeeded" + } + } + }, + "extendedLocation": { + "$id": "2930", + "kind": "model", + "type": { + "$ref": "669" + }, + "value": { + "$id": "2931", + "name": { + "$id": "2932", + "kind": "string", + "type": { + "$ref": "671" + }, + "value": "qmbrfwcpwwhggszhrdjv" + }, + "type": { + "$id": "2933", + "kind": "string", + "type": { + "$ref": "142" + }, + "value": "CustomLocation" + } + } + }, + "id": { + "$id": "2934", + "kind": "string", + "type": { + "$ref": "330" + }, + "value": "/subscriptions/0000000-0000-0000-0000-000000000000/resourceGroups/resourceGroup123/providers/Microsoft.IoTOperations/instances/resource-name123/brokers/resource-name123" + }, + "name": { + "$id": "2935", + "kind": "string", + "type": { + "$ref": "335" + }, + "value": "dowrkel" + }, + "type": { + "$id": "2936", + "kind": "string", + "type": { + "$ref": "339" + }, + "value": "xshjnsdgadygb" + }, + "systemData": { + "$id": "2937", + "kind": "model", + "type": { + "$ref": "344" + }, + "value": { + "$id": "2938", + "createdBy": { + "$id": "2939", + "kind": "string", + "type": { + "$ref": "346" + }, + "value": "ssvaslsmudloholronopqyxjcu" + }, + "createdByType": { + "$id": "2940", + "kind": "string", + "type": { + "$ref": "146" + }, + "value": "User" + }, + "createdAt": { + "$id": "2941", + "kind": "string", + "type": { + "$ref": "353" + }, + "value": "2024-08-09T18:13:29.389Z" + }, + "lastModifiedBy": { + "$id": "2942", + "kind": "string", + "type": { + "$ref": "358" + }, + "value": "gnicpuszwd" + }, + "lastModifiedByType": { + "$id": "2943", + "kind": "string", + "type": { + "$ref": "146" + }, + "value": "User" + }, + "lastModifiedAt": { + "$id": "2944", + "kind": "string", + "type": { + "$ref": "365" + }, + "value": "2024-08-09T18:13:29.389Z" + } + } + } + } + } + } + ] + }, + { + "$id": "2945", + "kind": "http", + "name": "Broker_CreateOrUpdate_Minimal", + "description": "Broker_CreateOrUpdate_Minimal", + "filePath": "2024-11-01/Broker_CreateOrUpdate_Minimal.json", + "parameters": [ + { + "$id": "2946", + "parameter": { + "$ref": "2325" + }, + "value": { + "$id": "2947", + "kind": "string", + "type": { + "$ref": "2326" + }, + "value": "2024-11-01" + } + }, + { + "$id": "2948", + "parameter": { + "$ref": "2329" + }, + "value": { + "$id": "2949", + "kind": "string", + "type": { + "$ref": "2330" + }, + "value": "F8C729F9-DF9C-4743-848F-96EE433D8E53" + } + }, + { + "$id": "2950", + "parameter": { + "$ref": "2332" + }, + "value": { + "$id": "2951", + "kind": "string", + "type": { + "$ref": "2333" + }, + "value": "rgiotoperations" + } + }, + { + "$id": "2952", + "parameter": { + "$ref": "2334" + }, + "value": { + "$id": "2953", + "kind": "string", + "type": { + "$ref": "2335" + }, + "value": "resource-name123" + } + }, + { + "$id": "2954", + "parameter": { + "$ref": "2336" + }, + "value": { + "$id": "2955", + "kind": "string", + "type": { + "$ref": "2337" + }, + "value": "resource-name123" + } + }, + { + "$id": "2956", + "parameter": { + "$ref": "2344" + }, + "value": { + "$id": "2957", + "kind": "model", + "type": { + "$ref": "1247" + }, + "value": { + "$id": "2958", + "properties": { + "$id": "2959", + "kind": "model", + "type": { + "$ref": "1249" + }, + "value": { + "$id": "2960", + "memoryProfile": { + "$id": "2961", + "kind": "string", + "type": { + "$ref": "290" + }, + "value": "Tiny" + } + } + }, + "extendedLocation": { + "$id": "2962", + "kind": "model", + "type": { + "$ref": "669" + }, + "value": { + "$id": "2963", + "name": { + "$id": "2964", + "kind": "string", + "type": { + "$ref": "671" + }, + "value": "qmbrfwcpwwhggszhrdjv" + }, + "type": { + "$id": "2965", + "kind": "string", + "type": { + "$ref": "142" + }, + "value": "CustomLocation" + } + } + } + } + } + } + ], + "responses": [ + { + "$id": "2966", + "response": { + "$ref": "2345" + }, + "statusCode": 200, + "bodyValue": { + "$id": "2967", + "kind": "model", + "type": { + "$ref": "1247" + }, + "value": { + "$id": "2968", + "properties": { + "$id": "2969", + "kind": "model", + "type": { + "$ref": "1249" + }, + "value": { + "$id": "2970", + "advanced": { + "$id": "2971", + "kind": "model", + "type": { + "$ref": "1251" + }, + "value": { + "$id": "2972", + "clients": { + "$id": "2973", + "kind": "model", + "type": { + "$ref": "1253" + }, + "value": { + "$id": "2974", + "maxSessionExpirySeconds": { + "$id": "2975", + "kind": "number", + "type": { + "$ref": "1255" + }, + "value": 3859 + }, + "maxMessageExpirySeconds": { + "$id": "2976", + "kind": "number", + "type": { + "$ref": "1259" + }, + "value": 3263 + }, + "maxPacketSizeBytes": { + "$id": "2977", + "kind": "number", + "type": { + "$ref": "1263" + }, + "value": 3029 + }, + "subscriberQueueLimit": { + "$id": "2978", + "kind": "model", + "type": { + "$ref": "1267" + }, + "value": { + "$id": "2979", + "length": { + "$id": "2980", + "kind": "number", + "type": { + "$ref": "1269" + }, + "value": 6 + }, + "strategy": { + "$id": "2981", + "kind": "string", + "type": { + "$ref": "274" + }, + "value": "None" + } + } + }, + "maxReceiveMaximum": { + "$id": "2982", + "kind": "number", + "type": { + "$ref": "1278" + }, + "value": 2365 + }, + "maxKeepAliveSeconds": { + "$id": "2983", + "kind": "number", + "type": { + "$ref": "1282" + }, + "value": 3744 + } + } + }, + "encryptInternalTraffic": { + "$id": "2984", + "kind": "string", + "type": { + "$ref": "62" + }, + "value": "Enabled" + }, + "internalCerts": { + "$id": "2985", + "kind": "model", + "type": { + "$ref": "1291" + }, + "value": { + "$id": "2986", + "duration": { + "$id": "2987", + "kind": "string", + "type": { + "$ref": "1293" + }, + "value": "bchrc" + }, + "renewBefore": { + "$id": "2988", + "kind": "string", + "type": { + "$ref": "1297" + }, + "value": "xkafmpgjfifkwwrhkswtopdnne" + }, + "privateKey": { + "$id": "2989", + "kind": "model", + "type": { + "$ref": "1194" + }, + "value": { + "$id": "2990", + "algorithm": { + "$id": "2991", + "kind": "string", + "type": { + "$ref": "244" + }, + "value": "Ec256" + }, + "rotationPolicy": { + "$id": "2992", + "kind": "string", + "type": { + "$ref": "260" + }, + "value": "Always" + } + } + } + } + } + } + }, + "cardinality": { + "$id": "2993", + "kind": "model", + "type": { + "$ref": "1308" + }, + "value": { + "$id": "2994", + "backendChain": { + "$id": "2995", + "kind": "model", + "type": { + "$ref": "1310" + }, + "value": { + "$id": "2996", + "partitions": { + "$id": "2997", + "kind": "number", + "type": { + "$ref": "1312" + }, + "value": 11 + }, + "redundancyFactor": { + "$id": "2998", + "kind": "number", + "type": { + "$ref": "1316" + }, + "value": 5 + }, + "workers": { + "$id": "2999", + "kind": "number", + "type": { + "$ref": "1320" + }, + "value": 15 + } + } + }, + "frontend": { + "$id": "3000", + "kind": "model", + "type": { + "$ref": "1326" + }, + "value": { + "$id": "3001", + "replicas": { + "$id": "3002", + "kind": "number", + "type": { + "$ref": "1328" + }, + "value": 2 + }, + "workers": { + "$id": "3003", + "kind": "number", + "type": { + "$ref": "1332" + }, + "value": 6 + } + } + } + } + }, + "diagnostics": { + "$id": "3004", + "kind": "model", + "type": { + "$ref": "1340" + }, + "value": { + "$id": "3005", + "logs": { + "$id": "3006", + "kind": "model", + "type": { + "$ref": "911" + }, + "value": { + "$id": "3007", + "level": { + "$id": "3008", + "kind": "string", + "type": { + "$ref": "913" + }, + "value": "rnmwokumdmebpmfxxxzvvjfdywotav" + } + } + }, + "metrics": { + "$id": "3009", + "kind": "model", + "type": { + "$ref": "919" + }, + "value": { + "$id": "3010", + "prometheusPort": { + "$id": "3011", + "kind": "number", + "type": { + "$ref": "921" + }, + "value": 7581 + } + } + }, + "selfCheck": { + "$id": "3012", + "kind": "model", + "type": { + "$ref": "1348" + }, + "value": { + "$id": "3013", + "mode": { + "$id": "3014", + "kind": "string", + "type": { + "$ref": "62" + }, + "value": "Enabled" + }, + "intervalSeconds": { + "$id": "3015", + "kind": "number", + "type": { + "$ref": "1353" + }, + "value": 158 + }, + "timeoutSeconds": { + "$id": "3016", + "kind": "number", + "type": { + "$ref": "1357" + }, + "value": 14 + } + } + }, + "traces": { + "$id": "3017", + "kind": "model", + "type": { + "$ref": "1363" + }, + "value": { + "$id": "3018", + "mode": { + "$id": "3019", + "kind": "string", + "type": { + "$ref": "62" + }, + "value": "Enabled" + }, + "cacheSizeMegabytes": { + "$id": "3020", + "kind": "number", + "type": { + "$ref": "1368" + }, + "value": 28 + }, + "selfTracing": { + "$id": "3021", + "kind": "model", + "type": { + "$ref": "1372" + }, + "value": { + "$id": "3022", + "mode": { + "$id": "3023", + "kind": "string", + "type": { + "$ref": "62" + }, + "value": "Enabled" + }, + "intervalSeconds": { + "$id": "3024", + "kind": "number", + "type": { + "$ref": "1377" + }, + "value": 22 + } + } + }, + "spanChannelCapacity": { + "$id": "3025", + "kind": "number", + "type": { + "$ref": "1383" + }, + "value": 1000 + } + } + } + } + }, + "diskBackedMessageBuffer": { + "$id": "3026", + "kind": "model", + "type": { + "$ref": "1391" + }, + "value": { + "$id": "3027", + "maxSize": { + "$id": "3028", + "kind": "string", + "type": { + "$ref": "1393" + }, + "value": "500M" + }, + "ephemeralVolumeClaimSpec": { + "$id": "3029", + "kind": "model", + "type": { + "$ref": "1397" + }, + "value": { + "$id": "3030", + "volumeName": { + "$id": "3031", + "kind": "string", + "type": { + "$ref": "1399" + }, + "value": "c" + }, + "volumeMode": { + "$id": "3032", + "kind": "string", + "type": { + "$ref": "1403" + }, + "value": "rxvpksjuuugqnqzeiprocknbn" + }, + "storageClassName": { + "$id": "3033", + "kind": "string", + "type": { + "$ref": "1407" + }, + "value": "sseyhrjptkhrqvpdpjmornkqvon" + }, + "accessModes": { + "$id": "3034", + "kind": "array", + "type": { + "$ref": "1411" + }, + "value": [ + { + "$id": "3035", + "kind": "string", + "type": { + "$ref": "1412" + }, + "value": "nuluhigrbb" + } + ] + }, + "dataSource": { + "$id": "3036", + "kind": "model", + "type": { + "$ref": "1416" + }, + "value": { + "$id": "3037", + "apiGroup": { + "$id": "3038", + "kind": "string", + "type": { + "$ref": "1418" + }, + "value": "npqapyksvvpkohujx" + }, + "kind": { + "$id": "3039", + "kind": "string", + "type": { + "$ref": "1422" + }, + "value": "wazgyb" + }, + "name": { + "$id": "3040", + "kind": "string", + "type": { + "$ref": "1426" + }, + "value": "cwhsgxxcxsyppoefm" + } + } + }, + "dataSourceRef": { + "$id": "3041", + "kind": "model", + "type": { + "$ref": "1432" + }, + "value": { + "$id": "3042", + "apiGroup": { + "$id": "3043", + "kind": "string", + "type": { + "$ref": "1434" + }, + "value": "mnfnykznjjsoqpfsgdqioupt" + }, + "kind": { + "$id": "3044", + "kind": "string", + "type": { + "$ref": "1438" + }, + "value": "odynqzekfzsnawrctaxg" + }, + "name": { + "$id": "3045", + "kind": "string", + "type": { + "$ref": "1442" + }, + "value": "envszivbbmixbyddzg" + }, + "namespace": { + "$id": "3046", + "kind": "string", + "type": { + "$ref": "1446" + }, + "value": "etcfzvxqd" + } + } + }, + "resources": { + "$id": "3047", + "kind": "model", + "type": { + "$ref": "1452" + }, + "value": { + "$id": "3048", + "limits": { + "$id": "3049", + "kind": "dict", + "type": { + "$ref": "1454" + }, + "value": { + "$id": "3050", + "key2719": { + "$id": "3051", + "kind": "string", + "type": { + "$ref": "1456" + }, + "value": "hmphcrgctu" + } + } + }, + "requests": { + "$id": "3052", + "kind": "dict", + "type": { + "$ref": "1460" + }, + "value": { + "$id": "3053", + "key2909": { + "$id": "3054", + "kind": "string", + "type": { + "$ref": "1462" + }, + "value": "txocprnyrsgvhfrg" + } + } + } + } + }, + "selector": { + "$id": "3055", + "kind": "model", + "type": { + "$ref": "1468" + }, + "value": { + "$id": "3056", + "matchExpressions": { + "$id": "3057", + "kind": "array", + "type": { + "$ref": "1470" + }, + "value": [ + { + "$id": "3058", + "kind": "model", + "type": { + "$ref": "1471" + }, + "value": { + "$id": "3059", + "key": { + "$id": "3060", + "kind": "string", + "type": { + "$ref": "1473" + }, + "value": "e" + }, + "operator": { + "$id": "3061", + "kind": "string", + "type": { + "$ref": "280" + }, + "value": "In" + }, + "values": { + "$id": "3062", + "kind": "array", + "type": { + "$ref": "1480" + }, + "value": [ + { + "$id": "3063", + "kind": "string", + "type": { + "$ref": "1481" + }, + "value": "slmpajlywqvuyknipgztsonqyybt" + } + ] + } + } + } + ] + }, + "matchLabels": { + "$id": "3064", + "kind": "dict", + "type": { + "$ref": "1487" + }, + "value": { + "$id": "3065", + "key6673": { + "$id": "3066", + "kind": "string", + "type": { + "$ref": "1489" + }, + "value": "wlngfalznwxnurzpgxomcxhbqefpr" + } + } + } + } + } + } + }, + "persistentVolumeClaimSpec": { + "$id": "3067", + "kind": "model", + "type": { + "$ref": "1397" + }, + "value": { + "$id": "3068", + "volumeName": { + "$id": "3069", + "kind": "string", + "type": { + "$ref": "1399" + }, + "value": "c" + }, + "volumeMode": { + "$id": "3070", + "kind": "string", + "type": { + "$ref": "1403" + }, + "value": "rxvpksjuuugqnqzeiprocknbn" + }, + "storageClassName": { + "$id": "3071", + "kind": "string", + "type": { + "$ref": "1407" + }, + "value": "sseyhrjptkhrqvpdpjmornkqvon" + }, + "accessModes": { + "$id": "3072", + "kind": "array", + "type": { + "$ref": "1411" + }, + "value": [ + { + "$id": "3073", + "kind": "string", + "type": { + "$ref": "1412" + }, + "value": "nuluhigrbb" + } + ] + }, + "dataSource": { + "$id": "3074", + "kind": "model", + "type": { + "$ref": "1416" + }, + "value": { + "$id": "3075", + "apiGroup": { + "$id": "3076", + "kind": "string", + "type": { + "$ref": "1418" + }, + "value": "npqapyksvvpkohujx" + }, + "kind": { + "$id": "3077", + "kind": "string", + "type": { + "$ref": "1422" + }, + "value": "wazgyb" + }, + "name": { + "$id": "3078", + "kind": "string", + "type": { + "$ref": "1426" + }, + "value": "cwhsgxxcxsyppoefm" + } + } + }, + "dataSourceRef": { + "$id": "3079", + "kind": "model", + "type": { + "$ref": "1432" + }, + "value": { + "$id": "3080", + "apiGroup": { + "$id": "3081", + "kind": "string", + "type": { + "$ref": "1434" + }, + "value": "mnfnykznjjsoqpfsgdqioupt" + }, + "kind": { + "$id": "3082", + "kind": "string", + "type": { + "$ref": "1438" + }, + "value": "odynqzekfzsnawrctaxg" + }, + "name": { + "$id": "3083", + "kind": "string", + "type": { + "$ref": "1442" + }, + "value": "envszivbbmixbyddzg" + }, + "namespace": { + "$id": "3084", + "kind": "string", + "type": { + "$ref": "1446" + }, + "value": "etcfzvxqd" + } + } + }, + "resources": { + "$id": "3085", + "kind": "model", + "type": { + "$ref": "1452" + }, + "value": { + "$id": "3086", + "limits": { + "$id": "3087", + "kind": "dict", + "type": { + "$ref": "1454" + }, + "value": { + "$id": "3088", + "key2719": { + "$id": "3089", + "kind": "string", + "type": { + "$ref": "1456" + }, + "value": "hmphcrgctu" + } + } + }, + "requests": { + "$id": "3090", + "kind": "dict", + "type": { + "$ref": "1460" + }, + "value": { + "$id": "3091", + "key2909": { + "$id": "3092", + "kind": "string", + "type": { + "$ref": "1462" + }, + "value": "txocprnyrsgvhfrg" + } + } + } + } + }, + "selector": { + "$id": "3093", + "kind": "model", + "type": { + "$ref": "1468" + }, + "value": { + "$id": "3094", + "matchExpressions": { + "$id": "3095", + "kind": "array", + "type": { + "$ref": "1470" + }, + "value": [ + { + "$id": "3096", + "kind": "model", + "type": { + "$ref": "1471" + }, + "value": { + "$id": "3097", + "key": { + "$id": "3098", + "kind": "string", + "type": { + "$ref": "1473" + }, + "value": "e" + }, + "operator": { + "$id": "3099", + "kind": "string", + "type": { + "$ref": "280" + }, + "value": "In" + }, + "values": { + "$id": "3100", + "kind": "array", + "type": { + "$ref": "1480" + }, + "value": [ + { + "$id": "3101", + "kind": "string", + "type": { + "$ref": "1481" + }, + "value": "slmpajlywqvuyknipgztsonqyybt" + } + ] + } + } + } + ] + }, + "matchLabels": { + "$id": "3102", + "kind": "dict", + "type": { + "$ref": "1487" + }, + "value": { + "$id": "3103", + "key6673": { + "$id": "3104", + "kind": "string", + "type": { + "$ref": "1489" + }, + "value": "wlngfalznwxnurzpgxomcxhbqefpr" + } + } + } + } + } + } + } + } + }, + "generateResourceLimits": { + "$id": "3105", + "kind": "model", + "type": { + "$ref": "1502" + }, + "value": { + "$id": "3106", + "cpu": { + "$id": "3107", + "kind": "string", + "type": { + "$ref": "62" + }, + "value": "Enabled" + } + } + }, + "memoryProfile": { + "$id": "3108", + "kind": "string", + "type": { + "$ref": "290" + }, + "value": "Tiny" + }, + "provisioningState": { + "$id": "3109", + "kind": "string", + "type": { + "$ref": "126" + }, + "value": "Succeeded" + } + } + }, + "extendedLocation": { + "$id": "3110", + "kind": "model", + "type": { + "$ref": "669" + }, + "value": { + "$id": "3111", + "name": { + "$id": "3112", + "kind": "string", + "type": { + "$ref": "671" + }, + "value": "qmbrfwcpwwhggszhrdjv" + }, + "type": { + "$id": "3113", + "kind": "string", + "type": { + "$ref": "142" + }, + "value": "CustomLocation" + } + } + }, + "id": { + "$id": "3114", + "kind": "string", + "type": { + "$ref": "330" + }, + "value": "/subscriptions/0000000-0000-0000-0000-000000000000/resourceGroups/resourceGroup123/providers/Microsoft.IoTOperations/instances/resource-name123/brokers/resource-name123" + }, + "name": { + "$id": "3115", + "kind": "string", + "type": { + "$ref": "335" + }, + "value": "dowrkel" + }, + "type": { + "$id": "3116", + "kind": "string", + "type": { + "$ref": "339" + }, + "value": "xshjnsdgadygb" + }, + "systemData": { + "$id": "3117", + "kind": "model", + "type": { + "$ref": "344" + }, + "value": { + "$id": "3118", + "createdBy": { + "$id": "3119", + "kind": "string", + "type": { + "$ref": "346" + }, + "value": "ssvaslsmudloholronopqyxjcu" + }, + "createdByType": { + "$id": "3120", + "kind": "string", + "type": { + "$ref": "146" + }, + "value": "User" + }, + "createdAt": { + "$id": "3121", + "kind": "string", + "type": { + "$ref": "353" + }, + "value": "2024-08-09T18:13:29.389Z" + }, + "lastModifiedBy": { + "$id": "3122", + "kind": "string", + "type": { + "$ref": "358" + }, + "value": "gnicpuszwd" + }, + "lastModifiedByType": { + "$id": "3123", + "kind": "string", + "type": { + "$ref": "146" + }, + "value": "User" + }, + "lastModifiedAt": { + "$id": "3124", + "kind": "string", + "type": { + "$ref": "365" + }, + "value": "2024-08-09T18:13:29.389Z" + } + } + } + } + } + }, + { + "$id": "3125", + "response": { + "$ref": "2346" + }, + "statusCode": 201, + "bodyValue": { + "$id": "3126", + "kind": "model", + "type": { + "$ref": "1247" + }, + "value": { + "$id": "3127", + "properties": { + "$id": "3128", + "kind": "model", + "type": { + "$ref": "1249" + }, + "value": { + "$id": "3129", + "advanced": { + "$id": "3130", + "kind": "model", + "type": { + "$ref": "1251" + }, + "value": { + "$id": "3131", + "clients": { + "$id": "3132", + "kind": "model", + "type": { + "$ref": "1253" + }, + "value": { + "$id": "3133", + "maxSessionExpirySeconds": { + "$id": "3134", + "kind": "number", + "type": { + "$ref": "1255" + }, + "value": 3859 + }, + "maxMessageExpirySeconds": { + "$id": "3135", + "kind": "number", + "type": { + "$ref": "1259" + }, + "value": 3263 + }, + "maxPacketSizeBytes": { + "$id": "3136", + "kind": "number", + "type": { + "$ref": "1263" + }, + "value": 3029 + }, + "subscriberQueueLimit": { + "$id": "3137", + "kind": "model", + "type": { + "$ref": "1267" + }, + "value": { + "$id": "3138", + "length": { + "$id": "3139", + "kind": "number", + "type": { + "$ref": "1269" + }, + "value": 6 + }, + "strategy": { + "$id": "3140", + "kind": "string", + "type": { + "$ref": "274" + }, + "value": "None" + } + } + }, + "maxReceiveMaximum": { + "$id": "3141", + "kind": "number", + "type": { + "$ref": "1278" + }, + "value": 2365 + }, + "maxKeepAliveSeconds": { + "$id": "3142", + "kind": "number", + "type": { + "$ref": "1282" + }, + "value": 3744 + } + } + }, + "encryptInternalTraffic": { + "$id": "3143", + "kind": "string", + "type": { + "$ref": "62" + }, + "value": "Enabled" + }, + "internalCerts": { + "$id": "3144", + "kind": "model", + "type": { + "$ref": "1291" + }, + "value": { + "$id": "3145", + "duration": { + "$id": "3146", + "kind": "string", + "type": { + "$ref": "1293" + }, + "value": "bchrc" + }, + "renewBefore": { + "$id": "3147", + "kind": "string", + "type": { + "$ref": "1297" + }, + "value": "xkafmpgjfifkwwrhkswtopdnne" + }, + "privateKey": { + "$id": "3148", + "kind": "model", + "type": { + "$ref": "1194" + }, + "value": { + "$id": "3149", + "algorithm": { + "$id": "3150", + "kind": "string", + "type": { + "$ref": "244" + }, + "value": "Ec256" + }, + "rotationPolicy": { + "$id": "3151", + "kind": "string", + "type": { + "$ref": "260" + }, + "value": "Always" + } + } + } + } + } + } + }, + "cardinality": { + "$id": "3152", + "kind": "model", + "type": { + "$ref": "1308" + }, + "value": { + "$id": "3153", + "backendChain": { + "$id": "3154", + "kind": "model", + "type": { + "$ref": "1310" + }, + "value": { + "$id": "3155", + "partitions": { + "$id": "3156", + "kind": "number", + "type": { + "$ref": "1312" + }, + "value": 11 + }, + "redundancyFactor": { + "$id": "3157", + "kind": "number", + "type": { + "$ref": "1316" + }, + "value": 5 + }, + "workers": { + "$id": "3158", + "kind": "number", + "type": { + "$ref": "1320" + }, + "value": 15 + } + } + }, + "frontend": { + "$id": "3159", + "kind": "model", + "type": { + "$ref": "1326" + }, + "value": { + "$id": "3160", + "replicas": { + "$id": "3161", + "kind": "number", + "type": { + "$ref": "1328" + }, + "value": 2 + }, + "workers": { + "$id": "3162", + "kind": "number", + "type": { + "$ref": "1332" + }, + "value": 6 + } + } + } + } + }, + "diagnostics": { + "$id": "3163", + "kind": "model", + "type": { + "$ref": "1340" + }, + "value": { + "$id": "3164", + "logs": { + "$id": "3165", + "kind": "model", + "type": { + "$ref": "911" + }, + "value": { + "$id": "3166", + "level": { + "$id": "3167", + "kind": "string", + "type": { + "$ref": "913" + }, + "value": "rnmwokumdmebpmfxxxzvvjfdywotav" + } + } + }, + "metrics": { + "$id": "3168", + "kind": "model", + "type": { + "$ref": "919" + }, + "value": { + "$id": "3169", + "prometheusPort": { + "$id": "3170", + "kind": "number", + "type": { + "$ref": "921" + }, + "value": 7581 + } + } + }, + "selfCheck": { + "$id": "3171", + "kind": "model", + "type": { + "$ref": "1348" + }, + "value": { + "$id": "3172", + "mode": { + "$id": "3173", + "kind": "string", + "type": { + "$ref": "62" + }, + "value": "Enabled" + }, + "intervalSeconds": { + "$id": "3174", + "kind": "number", + "type": { + "$ref": "1353" + }, + "value": 158 + }, + "timeoutSeconds": { + "$id": "3175", + "kind": "number", + "type": { + "$ref": "1357" + }, + "value": 14 + } + } + }, + "traces": { + "$id": "3176", + "kind": "model", + "type": { + "$ref": "1363" + }, + "value": { + "$id": "3177", + "mode": { + "$id": "3178", + "kind": "string", + "type": { + "$ref": "62" + }, + "value": "Enabled" + }, + "cacheSizeMegabytes": { + "$id": "3179", + "kind": "number", + "type": { + "$ref": "1368" + }, + "value": 28 + }, + "selfTracing": { + "$id": "3180", + "kind": "model", + "type": { + "$ref": "1372" + }, + "value": { + "$id": "3181", + "mode": { + "$id": "3182", + "kind": "string", + "type": { + "$ref": "62" + }, + "value": "Enabled" + }, + "intervalSeconds": { + "$id": "3183", + "kind": "number", + "type": { + "$ref": "1377" + }, + "value": 22 + } + } + }, + "spanChannelCapacity": { + "$id": "3184", + "kind": "number", + "type": { + "$ref": "1383" + }, + "value": 1000 + } + } + } + } + }, + "diskBackedMessageBuffer": { + "$id": "3185", + "kind": "model", + "type": { + "$ref": "1391" + }, + "value": { + "$id": "3186", + "maxSize": { + "$id": "3187", + "kind": "string", + "type": { + "$ref": "1393" + }, + "value": "500M" + }, + "ephemeralVolumeClaimSpec": { + "$id": "3188", + "kind": "model", + "type": { + "$ref": "1397" + }, + "value": { + "$id": "3189", + "volumeName": { + "$id": "3190", + "kind": "string", + "type": { + "$ref": "1399" + }, + "value": "c" + }, + "volumeMode": { + "$id": "3191", + "kind": "string", + "type": { + "$ref": "1403" + }, + "value": "rxvpksjuuugqnqzeiprocknbn" + }, + "storageClassName": { + "$id": "3192", + "kind": "string", + "type": { + "$ref": "1407" + }, + "value": "sseyhrjptkhrqvpdpjmornkqvon" + }, + "accessModes": { + "$id": "3193", + "kind": "array", + "type": { + "$ref": "1411" + }, + "value": [ + { + "$id": "3194", + "kind": "string", + "type": { + "$ref": "1412" + }, + "value": "nuluhigrbb" + } + ] + }, + "dataSource": { + "$id": "3195", + "kind": "model", + "type": { + "$ref": "1416" + }, + "value": { + "$id": "3196", + "apiGroup": { + "$id": "3197", + "kind": "string", + "type": { + "$ref": "1418" + }, + "value": "npqapyksvvpkohujx" + }, + "kind": { + "$id": "3198", + "kind": "string", + "type": { + "$ref": "1422" + }, + "value": "wazgyb" + }, + "name": { + "$id": "3199", + "kind": "string", + "type": { + "$ref": "1426" + }, + "value": "cwhsgxxcxsyppoefm" + } + } + }, + "dataSourceRef": { + "$id": "3200", + "kind": "model", + "type": { + "$ref": "1432" + }, + "value": { + "$id": "3201", + "apiGroup": { + "$id": "3202", + "kind": "string", + "type": { + "$ref": "1434" + }, + "value": "mnfnykznjjsoqpfsgdqioupt" + }, + "kind": { + "$id": "3203", + "kind": "string", + "type": { + "$ref": "1438" + }, + "value": "odynqzekfzsnawrctaxg" + }, + "name": { + "$id": "3204", + "kind": "string", + "type": { + "$ref": "1442" + }, + "value": "envszivbbmixbyddzg" + }, + "namespace": { + "$id": "3205", + "kind": "string", + "type": { + "$ref": "1446" + }, + "value": "etcfzvxqd" + } + } + }, + "resources": { + "$id": "3206", + "kind": "model", + "type": { + "$ref": "1452" + }, + "value": { + "$id": "3207", + "limits": { + "$id": "3208", + "kind": "dict", + "type": { + "$ref": "1454" + }, + "value": { + "$id": "3209", + "key2719": { + "$id": "3210", + "kind": "string", + "type": { + "$ref": "1456" + }, + "value": "hmphcrgctu" + } + } + }, + "requests": { + "$id": "3211", + "kind": "dict", + "type": { + "$ref": "1460" + }, + "value": { + "$id": "3212", + "key2909": { + "$id": "3213", + "kind": "string", + "type": { + "$ref": "1462" + }, + "value": "txocprnyrsgvhfrg" + } + } + } + } + }, + "selector": { + "$id": "3214", + "kind": "model", + "type": { + "$ref": "1468" + }, + "value": { + "$id": "3215", + "matchExpressions": { + "$id": "3216", + "kind": "array", + "type": { + "$ref": "1470" + }, + "value": [ + { + "$id": "3217", + "kind": "model", + "type": { + "$ref": "1471" + }, + "value": { + "$id": "3218", + "key": { + "$id": "3219", + "kind": "string", + "type": { + "$ref": "1473" + }, + "value": "e" + }, + "operator": { + "$id": "3220", + "kind": "string", + "type": { + "$ref": "280" + }, + "value": "In" + }, + "values": { + "$id": "3221", + "kind": "array", + "type": { + "$ref": "1480" + }, + "value": [ + { + "$id": "3222", + "kind": "string", + "type": { + "$ref": "1481" + }, + "value": "slmpajlywqvuyknipgztsonqyybt" + } + ] + } + } + } + ] + }, + "matchLabels": { + "$id": "3223", + "kind": "dict", + "type": { + "$ref": "1487" + }, + "value": { + "$id": "3224", + "key6673": { + "$id": "3225", + "kind": "string", + "type": { + "$ref": "1489" + }, + "value": "wlngfalznwxnurzpgxomcxhbqefpr" + } + } + } + } + } + } + }, + "persistentVolumeClaimSpec": { + "$id": "3226", + "kind": "model", + "type": { + "$ref": "1397" + }, + "value": { + "$id": "3227", + "volumeName": { + "$id": "3228", + "kind": "string", + "type": { + "$ref": "1399" + }, + "value": "c" + }, + "volumeMode": { + "$id": "3229", + "kind": "string", + "type": { + "$ref": "1403" + }, + "value": "rxvpksjuuugqnqzeiprocknbn" + }, + "storageClassName": { + "$id": "3230", + "kind": "string", + "type": { + "$ref": "1407" + }, + "value": "sseyhrjptkhrqvpdpjmornkqvon" + }, + "accessModes": { + "$id": "3231", + "kind": "array", + "type": { + "$ref": "1411" + }, + "value": [ + { + "$id": "3232", + "kind": "string", + "type": { + "$ref": "1412" + }, + "value": "nuluhigrbb" + } + ] + }, + "dataSource": { + "$id": "3233", + "kind": "model", + "type": { + "$ref": "1416" + }, + "value": { + "$id": "3234", + "apiGroup": { + "$id": "3235", + "kind": "string", + "type": { + "$ref": "1418" + }, + "value": "npqapyksvvpkohujx" + }, + "kind": { + "$id": "3236", + "kind": "string", + "type": { + "$ref": "1422" + }, + "value": "wazgyb" + }, + "name": { + "$id": "3237", + "kind": "string", + "type": { + "$ref": "1426" + }, + "value": "cwhsgxxcxsyppoefm" + } + } + }, + "dataSourceRef": { + "$id": "3238", + "kind": "model", + "type": { + "$ref": "1432" + }, + "value": { + "$id": "3239", + "apiGroup": { + "$id": "3240", + "kind": "string", + "type": { + "$ref": "1434" + }, + "value": "mnfnykznjjsoqpfsgdqioupt" + }, + "kind": { + "$id": "3241", + "kind": "string", + "type": { + "$ref": "1438" + }, + "value": "odynqzekfzsnawrctaxg" + }, + "name": { + "$id": "3242", + "kind": "string", + "type": { + "$ref": "1442" + }, + "value": "envszivbbmixbyddzg" + }, + "namespace": { + "$id": "3243", + "kind": "string", + "type": { + "$ref": "1446" + }, + "value": "etcfzvxqd" + } + } + }, + "resources": { + "$id": "3244", + "kind": "model", + "type": { + "$ref": "1452" + }, + "value": { + "$id": "3245", + "limits": { + "$id": "3246", + "kind": "dict", + "type": { + "$ref": "1454" + }, + "value": { + "$id": "3247", + "key2719": { + "$id": "3248", + "kind": "string", + "type": { + "$ref": "1456" + }, + "value": "hmphcrgctu" + } + } + }, + "requests": { + "$id": "3249", + "kind": "dict", + "type": { + "$ref": "1460" + }, + "value": { + "$id": "3250", + "key2909": { + "$id": "3251", + "kind": "string", + "type": { + "$ref": "1462" + }, + "value": "txocprnyrsgvhfrg" + } + } + } + } + }, + "selector": { + "$id": "3252", + "kind": "model", + "type": { + "$ref": "1468" + }, + "value": { + "$id": "3253", + "matchExpressions": { + "$id": "3254", + "kind": "array", + "type": { + "$ref": "1470" + }, + "value": [ + { + "$id": "3255", + "kind": "model", + "type": { + "$ref": "1471" + }, + "value": { + "$id": "3256", + "key": { + "$id": "3257", + "kind": "string", + "type": { + "$ref": "1473" + }, + "value": "e" + }, + "operator": { + "$id": "3258", + "kind": "string", + "type": { + "$ref": "280" + }, + "value": "In" + }, + "values": { + "$id": "3259", + "kind": "array", + "type": { + "$ref": "1480" + }, + "value": [ + { + "$id": "3260", + "kind": "string", + "type": { + "$ref": "1481" + }, + "value": "slmpajlywqvuyknipgztsonqyybt" + } + ] + } + } + } + ] + }, + "matchLabels": { + "$id": "3261", + "kind": "dict", + "type": { + "$ref": "1487" + }, + "value": { + "$id": "3262", + "key6673": { + "$id": "3263", + "kind": "string", + "type": { + "$ref": "1489" + }, + "value": "wlngfalznwxnurzpgxomcxhbqefpr" + } + } + } + } + } + } + } + } + }, + "generateResourceLimits": { + "$id": "3264", + "kind": "model", + "type": { + "$ref": "1502" + }, + "value": { + "$id": "3265", + "cpu": { + "$id": "3266", + "kind": "string", + "type": { + "$ref": "62" + }, + "value": "Enabled" + } + } + }, + "memoryProfile": { + "$id": "3267", + "kind": "string", + "type": { + "$ref": "290" + }, + "value": "Tiny" + }, + "provisioningState": { + "$id": "3268", + "kind": "string", + "type": { + "$ref": "126" + }, + "value": "Succeeded" + } + } + }, + "extendedLocation": { + "$id": "3269", + "kind": "model", + "type": { + "$ref": "669" + }, + "value": { + "$id": "3270", + "name": { + "$id": "3271", + "kind": "string", + "type": { + "$ref": "671" + }, + "value": "qmbrfwcpwwhggszhrdjv" + }, + "type": { + "$id": "3272", + "kind": "string", + "type": { + "$ref": "142" + }, + "value": "CustomLocation" + } + } + }, + "id": { + "$id": "3273", + "kind": "string", + "type": { + "$ref": "330" + }, + "value": "/subscriptions/0000000-0000-0000-0000-000000000000/resourceGroups/resourceGroup123/providers/Microsoft.IoTOperations/instances/resource-name123/brokers/resource-name123" + }, + "name": { + "$id": "3274", + "kind": "string", + "type": { + "$ref": "335" + }, + "value": "dowrkel" + }, + "type": { + "$id": "3275", + "kind": "string", + "type": { + "$ref": "339" + }, + "value": "xshjnsdgadygb" + }, + "systemData": { + "$id": "3276", + "kind": "model", + "type": { + "$ref": "344" + }, + "value": { + "$id": "3277", + "createdBy": { + "$id": "3278", + "kind": "string", + "type": { + "$ref": "346" + }, + "value": "ssvaslsmudloholronopqyxjcu" + }, + "createdByType": { + "$id": "3279", + "kind": "string", + "type": { + "$ref": "146" + }, + "value": "User" + }, + "createdAt": { + "$id": "3280", + "kind": "string", + "type": { + "$ref": "353" + }, + "value": "2024-08-09T18:13:29.389Z" + }, + "lastModifiedBy": { + "$id": "3281", + "kind": "string", + "type": { + "$ref": "358" + }, + "value": "gnicpuszwd" + }, + "lastModifiedByType": { + "$id": "3282", + "kind": "string", + "type": { + "$ref": "146" + }, + "value": "User" + }, + "lastModifiedAt": { + "$id": "3283", + "kind": "string", + "type": { + "$ref": "365" + }, + "value": "2024-08-09T18:13:29.389Z" + } + } + } + } + } + } + ] + }, + { + "$id": "3284", + "kind": "http", + "name": "Broker_CreateOrUpdate_Simple", + "description": "Broker_CreateOrUpdate_Simple", + "filePath": "2024-11-01/Broker_CreateOrUpdate_Simple.json", + "parameters": [ + { + "$id": "3285", + "parameter": { + "$ref": "2325" + }, + "value": { + "$id": "3286", + "kind": "string", + "type": { + "$ref": "2326" + }, + "value": "2024-11-01" + } + }, + { + "$id": "3287", + "parameter": { + "$ref": "2329" + }, + "value": { + "$id": "3288", + "kind": "string", + "type": { + "$ref": "2330" + }, + "value": "F8C729F9-DF9C-4743-848F-96EE433D8E53" + } + }, + { + "$id": "3289", + "parameter": { + "$ref": "2332" + }, + "value": { + "$id": "3290", + "kind": "string", + "type": { + "$ref": "2333" + }, + "value": "rgiotoperations" + } + }, + { + "$id": "3291", + "parameter": { + "$ref": "2334" + }, + "value": { + "$id": "3292", + "kind": "string", + "type": { + "$ref": "2335" + }, + "value": "resource-name123" + } + }, + { + "$id": "3293", + "parameter": { + "$ref": "2336" + }, + "value": { + "$id": "3294", + "kind": "string", + "type": { + "$ref": "2337" + }, + "value": "resource-name123" + } + }, + { + "$id": "3295", + "parameter": { + "$ref": "2344" + }, + "value": { + "$id": "3296", + "kind": "model", + "type": { + "$ref": "1247" + }, + "value": { + "$id": "3297", + "properties": { + "$id": "3298", + "kind": "model", + "type": { + "$ref": "1249" + }, + "value": { + "$id": "3299", + "cardinality": { + "$id": "3300", + "kind": "model", + "type": { + "$ref": "1308" + }, + "value": { + "$id": "3301", + "backendChain": { + "$id": "3302", + "kind": "model", + "type": { + "$ref": "1310" + }, + "value": { + "$id": "3303", + "partitions": { + "$id": "3304", + "kind": "number", + "type": { + "$ref": "1312" + }, + "value": 2 + }, + "redundancyFactor": { + "$id": "3305", + "kind": "number", + "type": { + "$ref": "1316" + }, + "value": 2 + }, + "workers": { + "$id": "3306", + "kind": "number", + "type": { + "$ref": "1320" + }, + "value": 2 + } + } + }, + "frontend": { + "$id": "3307", + "kind": "model", + "type": { + "$ref": "1326" + }, + "value": { + "$id": "3308", + "replicas": { + "$id": "3309", + "kind": "number", + "type": { + "$ref": "1328" + }, + "value": 2 + }, + "workers": { + "$id": "3310", + "kind": "number", + "type": { + "$ref": "1332" + }, + "value": 2 + } + } + } + } + }, + "generateResourceLimits": { + "$id": "3311", + "kind": "model", + "type": { + "$ref": "1502" + }, + "value": { + "$id": "3312", + "cpu": { + "$id": "3313", + "kind": "string", + "type": { + "$ref": "62" + }, + "value": "Enabled" + } + } + }, + "memoryProfile": { + "$id": "3314", + "kind": "string", + "type": { + "$ref": "290" + }, + "value": "Low" + } + } + }, + "extendedLocation": { + "$id": "3315", + "kind": "model", + "type": { + "$ref": "669" + }, + "value": { + "$id": "3316", + "name": { + "$id": "3317", + "kind": "string", + "type": { + "$ref": "671" + }, + "value": "qmbrfwcpwwhggszhrdjv" + }, + "type": { + "$id": "3318", + "kind": "string", + "type": { + "$ref": "142" + }, + "value": "CustomLocation" + } + } + } + } + } + } + ], + "responses": [ + { + "$id": "3319", + "response": { + "$ref": "2345" + }, + "statusCode": 200, + "bodyValue": { + "$id": "3320", + "kind": "model", + "type": { + "$ref": "1247" + }, + "value": { + "$id": "3321", + "properties": { + "$id": "3322", + "kind": "model", + "type": { + "$ref": "1249" + }, + "value": { + "$id": "3323", + "advanced": { + "$id": "3324", + "kind": "model", + "type": { + "$ref": "1251" + }, + "value": { + "$id": "3325", + "clients": { + "$id": "3326", + "kind": "model", + "type": { + "$ref": "1253" + }, + "value": { + "$id": "3327", + "maxSessionExpirySeconds": { + "$id": "3328", + "kind": "number", + "type": { + "$ref": "1255" + }, + "value": 3859 + }, + "maxMessageExpirySeconds": { + "$id": "3329", + "kind": "number", + "type": { + "$ref": "1259" + }, + "value": 3263 + }, + "maxPacketSizeBytes": { + "$id": "3330", + "kind": "number", + "type": { + "$ref": "1263" + }, + "value": 3029 + }, + "subscriberQueueLimit": { + "$id": "3331", + "kind": "model", + "type": { + "$ref": "1267" + }, + "value": { + "$id": "3332", + "length": { + "$id": "3333", + "kind": "number", + "type": { + "$ref": "1269" + }, + "value": 6 + }, + "strategy": { + "$id": "3334", + "kind": "string", + "type": { + "$ref": "274" + }, + "value": "None" + } + } + }, + "maxReceiveMaximum": { + "$id": "3335", + "kind": "number", + "type": { + "$ref": "1278" + }, + "value": 2365 + }, + "maxKeepAliveSeconds": { + "$id": "3336", + "kind": "number", + "type": { + "$ref": "1282" + }, + "value": 3744 + } + } + }, + "encryptInternalTraffic": { + "$id": "3337", + "kind": "string", + "type": { + "$ref": "62" + }, + "value": "Enabled" + }, + "internalCerts": { + "$id": "3338", + "kind": "model", + "type": { + "$ref": "1291" + }, + "value": { + "$id": "3339", + "duration": { + "$id": "3340", + "kind": "string", + "type": { + "$ref": "1293" + }, + "value": "bchrc" + }, + "renewBefore": { + "$id": "3341", + "kind": "string", + "type": { + "$ref": "1297" + }, + "value": "xkafmpgjfifkwwrhkswtopdnne" + }, + "privateKey": { + "$id": "3342", + "kind": "model", + "type": { + "$ref": "1194" + }, + "value": { + "$id": "3343", + "algorithm": { + "$id": "3344", + "kind": "string", + "type": { + "$ref": "244" + }, + "value": "Ec256" + }, + "rotationPolicy": { + "$id": "3345", + "kind": "string", + "type": { + "$ref": "260" + }, + "value": "Always" + } + } + } + } + } + } + }, + "cardinality": { + "$id": "3346", + "kind": "model", + "type": { + "$ref": "1308" + }, + "value": { + "$id": "3347", + "backendChain": { + "$id": "3348", + "kind": "model", + "type": { + "$ref": "1310" + }, + "value": { + "$id": "3349", + "partitions": { + "$id": "3350", + "kind": "number", + "type": { + "$ref": "1312" + }, + "value": 11 + }, + "redundancyFactor": { + "$id": "3351", + "kind": "number", + "type": { + "$ref": "1316" + }, + "value": 5 + }, + "workers": { + "$id": "3352", + "kind": "number", + "type": { + "$ref": "1320" + }, + "value": 15 + } + } + }, + "frontend": { + "$id": "3353", + "kind": "model", + "type": { + "$ref": "1326" + }, + "value": { + "$id": "3354", + "replicas": { + "$id": "3355", + "kind": "number", + "type": { + "$ref": "1328" + }, + "value": 2 + }, + "workers": { + "$id": "3356", + "kind": "number", + "type": { + "$ref": "1332" + }, + "value": 6 + } + } + } + } + }, + "diagnostics": { + "$id": "3357", + "kind": "model", + "type": { + "$ref": "1340" + }, + "value": { + "$id": "3358", + "logs": { + "$id": "3359", + "kind": "model", + "type": { + "$ref": "911" + }, + "value": { + "$id": "3360", + "level": { + "$id": "3361", + "kind": "string", + "type": { + "$ref": "913" + }, + "value": "rnmwokumdmebpmfxxxzvvjfdywotav" + } + } + }, + "metrics": { + "$id": "3362", + "kind": "model", + "type": { + "$ref": "919" + }, + "value": { + "$id": "3363", + "prometheusPort": { + "$id": "3364", + "kind": "number", + "type": { + "$ref": "921" + }, + "value": 7581 + } + } + }, + "selfCheck": { + "$id": "3365", + "kind": "model", + "type": { + "$ref": "1348" + }, + "value": { + "$id": "3366", + "mode": { + "$id": "3367", + "kind": "string", + "type": { + "$ref": "62" + }, + "value": "Enabled" + }, + "intervalSeconds": { + "$id": "3368", + "kind": "number", + "type": { + "$ref": "1353" + }, + "value": 158 + }, + "timeoutSeconds": { + "$id": "3369", + "kind": "number", + "type": { + "$ref": "1357" + }, + "value": 14 + } + } + }, + "traces": { + "$id": "3370", + "kind": "model", + "type": { + "$ref": "1363" + }, + "value": { + "$id": "3371", + "mode": { + "$id": "3372", + "kind": "string", + "type": { + "$ref": "62" + }, + "value": "Enabled" + }, + "cacheSizeMegabytes": { + "$id": "3373", + "kind": "number", + "type": { + "$ref": "1368" + }, + "value": 28 + }, + "selfTracing": { + "$id": "3374", + "kind": "model", + "type": { + "$ref": "1372" + }, + "value": { + "$id": "3375", + "mode": { + "$id": "3376", + "kind": "string", + "type": { + "$ref": "62" + }, + "value": "Enabled" + }, + "intervalSeconds": { + "$id": "3377", + "kind": "number", + "type": { + "$ref": "1377" + }, + "value": 22 + } + } + }, + "spanChannelCapacity": { + "$id": "3378", + "kind": "number", + "type": { + "$ref": "1383" + }, + "value": 1000 + } + } + } + } + }, + "diskBackedMessageBuffer": { + "$id": "3379", + "kind": "model", + "type": { + "$ref": "1391" + }, + "value": { + "$id": "3380", + "maxSize": { + "$id": "3381", + "kind": "string", + "type": { + "$ref": "1393" + }, + "value": "500M" + }, + "ephemeralVolumeClaimSpec": { + "$id": "3382", + "kind": "model", + "type": { + "$ref": "1397" + }, + "value": { + "$id": "3383", + "volumeName": { + "$id": "3384", + "kind": "string", + "type": { + "$ref": "1399" + }, + "value": "c" + }, + "volumeMode": { + "$id": "3385", + "kind": "string", + "type": { + "$ref": "1403" + }, + "value": "rxvpksjuuugqnqzeiprocknbn" + }, + "storageClassName": { + "$id": "3386", + "kind": "string", + "type": { + "$ref": "1407" + }, + "value": "sseyhrjptkhrqvpdpjmornkqvon" + }, + "accessModes": { + "$id": "3387", + "kind": "array", + "type": { + "$ref": "1411" + }, + "value": [ + { + "$id": "3388", + "kind": "string", + "type": { + "$ref": "1412" + }, + "value": "nuluhigrbb" + } + ] + }, + "dataSource": { + "$id": "3389", + "kind": "model", + "type": { + "$ref": "1416" + }, + "value": { + "$id": "3390", + "apiGroup": { + "$id": "3391", + "kind": "string", + "type": { + "$ref": "1418" + }, + "value": "npqapyksvvpkohujx" + }, + "kind": { + "$id": "3392", + "kind": "string", + "type": { + "$ref": "1422" + }, + "value": "wazgyb" + }, + "name": { + "$id": "3393", + "kind": "string", + "type": { + "$ref": "1426" + }, + "value": "cwhsgxxcxsyppoefm" + } + } + }, + "dataSourceRef": { + "$id": "3394", + "kind": "model", + "type": { + "$ref": "1432" + }, + "value": { + "$id": "3395", + "apiGroup": { + "$id": "3396", + "kind": "string", + "type": { + "$ref": "1434" + }, + "value": "mnfnykznjjsoqpfsgdqioupt" + }, + "kind": { + "$id": "3397", + "kind": "string", + "type": { + "$ref": "1438" + }, + "value": "odynqzekfzsnawrctaxg" + }, + "name": { + "$id": "3398", + "kind": "string", + "type": { + "$ref": "1442" + }, + "value": "envszivbbmixbyddzg" + }, + "namespace": { + "$id": "3399", + "kind": "string", + "type": { + "$ref": "1446" + }, + "value": "etcfzvxqd" + } + } + }, + "resources": { + "$id": "3400", + "kind": "model", + "type": { + "$ref": "1452" + }, + "value": { + "$id": "3401", + "limits": { + "$id": "3402", + "kind": "dict", + "type": { + "$ref": "1454" + }, + "value": { + "$id": "3403", + "key2719": { + "$id": "3404", + "kind": "string", + "type": { + "$ref": "1456" + }, + "value": "hmphcrgctu" + } + } + }, + "requests": { + "$id": "3405", + "kind": "dict", + "type": { + "$ref": "1460" + }, + "value": { + "$id": "3406", + "key2909": { + "$id": "3407", + "kind": "string", + "type": { + "$ref": "1462" + }, + "value": "txocprnyrsgvhfrg" + } + } + } + } + }, + "selector": { + "$id": "3408", + "kind": "model", + "type": { + "$ref": "1468" + }, + "value": { + "$id": "3409", + "matchExpressions": { + "$id": "3410", + "kind": "array", + "type": { + "$ref": "1470" + }, + "value": [ + { + "$id": "3411", + "kind": "model", + "type": { + "$ref": "1471" + }, + "value": { + "$id": "3412", + "key": { + "$id": "3413", + "kind": "string", + "type": { + "$ref": "1473" + }, + "value": "e" + }, + "operator": { + "$id": "3414", + "kind": "string", + "type": { + "$ref": "280" + }, + "value": "In" + }, + "values": { + "$id": "3415", + "kind": "array", + "type": { + "$ref": "1480" + }, + "value": [ + { + "$id": "3416", + "kind": "string", + "type": { + "$ref": "1481" + }, + "value": "slmpajlywqvuyknipgztsonqyybt" + } + ] + } + } + } + ] + }, + "matchLabels": { + "$id": "3417", + "kind": "dict", + "type": { + "$ref": "1487" + }, + "value": { + "$id": "3418", + "key6673": { + "$id": "3419", + "kind": "string", + "type": { + "$ref": "1489" + }, + "value": "wlngfalznwxnurzpgxomcxhbqefpr" + } + } + } + } + } + } + }, + "persistentVolumeClaimSpec": { + "$id": "3420", + "kind": "model", + "type": { + "$ref": "1397" + }, + "value": { + "$id": "3421", + "volumeName": { + "$id": "3422", + "kind": "string", + "type": { + "$ref": "1399" + }, + "value": "c" + }, + "volumeMode": { + "$id": "3423", + "kind": "string", + "type": { + "$ref": "1403" + }, + "value": "rxvpksjuuugqnqzeiprocknbn" + }, + "storageClassName": { + "$id": "3424", + "kind": "string", + "type": { + "$ref": "1407" + }, + "value": "sseyhrjptkhrqvpdpjmornkqvon" + }, + "accessModes": { + "$id": "3425", + "kind": "array", + "type": { + "$ref": "1411" + }, + "value": [ + { + "$id": "3426", + "kind": "string", + "type": { + "$ref": "1412" + }, + "value": "nuluhigrbb" + } + ] + }, + "dataSource": { + "$id": "3427", + "kind": "model", + "type": { + "$ref": "1416" + }, + "value": { + "$id": "3428", + "apiGroup": { + "$id": "3429", + "kind": "string", + "type": { + "$ref": "1418" + }, + "value": "npqapyksvvpkohujx" + }, + "kind": { + "$id": "3430", + "kind": "string", + "type": { + "$ref": "1422" + }, + "value": "wazgyb" + }, + "name": { + "$id": "3431", + "kind": "string", + "type": { + "$ref": "1426" + }, + "value": "cwhsgxxcxsyppoefm" + } + } + }, + "dataSourceRef": { + "$id": "3432", + "kind": "model", + "type": { + "$ref": "1432" + }, + "value": { + "$id": "3433", + "apiGroup": { + "$id": "3434", + "kind": "string", + "type": { + "$ref": "1434" + }, + "value": "mnfnykznjjsoqpfsgdqioupt" + }, + "kind": { + "$id": "3435", + "kind": "string", + "type": { + "$ref": "1438" + }, + "value": "odynqzekfzsnawrctaxg" + }, + "name": { + "$id": "3436", + "kind": "string", + "type": { + "$ref": "1442" + }, + "value": "envszivbbmixbyddzg" + }, + "namespace": { + "$id": "3437", + "kind": "string", + "type": { + "$ref": "1446" + }, + "value": "etcfzvxqd" + } + } + }, + "resources": { + "$id": "3438", + "kind": "model", + "type": { + "$ref": "1452" + }, + "value": { + "$id": "3439", + "limits": { + "$id": "3440", + "kind": "dict", + "type": { + "$ref": "1454" + }, + "value": { + "$id": "3441", + "key2719": { + "$id": "3442", + "kind": "string", + "type": { + "$ref": "1456" + }, + "value": "hmphcrgctu" + } + } + }, + "requests": { + "$id": "3443", + "kind": "dict", + "type": { + "$ref": "1460" + }, + "value": { + "$id": "3444", + "key2909": { + "$id": "3445", + "kind": "string", + "type": { + "$ref": "1462" + }, + "value": "txocprnyrsgvhfrg" + } + } + } + } + }, + "selector": { + "$id": "3446", + "kind": "model", + "type": { + "$ref": "1468" + }, + "value": { + "$id": "3447", + "matchExpressions": { + "$id": "3448", + "kind": "array", + "type": { + "$ref": "1470" + }, + "value": [ + { + "$id": "3449", + "kind": "model", + "type": { + "$ref": "1471" + }, + "value": { + "$id": "3450", + "key": { + "$id": "3451", + "kind": "string", + "type": { + "$ref": "1473" + }, + "value": "e" + }, + "operator": { + "$id": "3452", + "kind": "string", + "type": { + "$ref": "280" + }, + "value": "In" + }, + "values": { + "$id": "3453", + "kind": "array", + "type": { + "$ref": "1480" + }, + "value": [ + { + "$id": "3454", + "kind": "string", + "type": { + "$ref": "1481" + }, + "value": "slmpajlywqvuyknipgztsonqyybt" + } + ] + } + } + } + ] + }, + "matchLabels": { + "$id": "3455", + "kind": "dict", + "type": { + "$ref": "1487" + }, + "value": { + "$id": "3456", + "key6673": { + "$id": "3457", + "kind": "string", + "type": { + "$ref": "1489" + }, + "value": "wlngfalznwxnurzpgxomcxhbqefpr" + } + } + } + } + } + } + } + } + }, + "generateResourceLimits": { + "$id": "3458", + "kind": "model", + "type": { + "$ref": "1502" + }, + "value": { + "$id": "3459", + "cpu": { + "$id": "3460", + "kind": "string", + "type": { + "$ref": "62" + }, + "value": "Enabled" + } + } + }, + "memoryProfile": { + "$id": "3461", + "kind": "string", + "type": { + "$ref": "290" + }, + "value": "Tiny" + }, + "provisioningState": { + "$id": "3462", + "kind": "string", + "type": { + "$ref": "126" + }, + "value": "Succeeded" + } + } + }, + "extendedLocation": { + "$id": "3463", + "kind": "model", + "type": { + "$ref": "669" + }, + "value": { + "$id": "3464", + "name": { + "$id": "3465", + "kind": "string", + "type": { + "$ref": "671" + }, + "value": "qmbrfwcpwwhggszhrdjv" + }, + "type": { + "$id": "3466", + "kind": "string", + "type": { + "$ref": "142" + }, + "value": "CustomLocation" + } + } + }, + "id": { + "$id": "3467", + "kind": "string", + "type": { + "$ref": "330" + }, + "value": "/subscriptions/0000000-0000-0000-0000-000000000000/resourceGroups/resourceGroup123/providers/Microsoft.IoTOperations/instances/resource-name123/brokers/resource-name123" + }, + "name": { + "$id": "3468", + "kind": "string", + "type": { + "$ref": "335" + }, + "value": "dowrkel" + }, + "type": { + "$id": "3469", + "kind": "string", + "type": { + "$ref": "339" + }, + "value": "xshjnsdgadygb" + }, + "systemData": { + "$id": "3470", + "kind": "model", + "type": { + "$ref": "344" + }, + "value": { + "$id": "3471", + "createdBy": { + "$id": "3472", + "kind": "string", + "type": { + "$ref": "346" + }, + "value": "ssvaslsmudloholronopqyxjcu" + }, + "createdByType": { + "$id": "3473", + "kind": "string", + "type": { + "$ref": "146" + }, + "value": "User" + }, + "createdAt": { + "$id": "3474", + "kind": "string", + "type": { + "$ref": "353" + }, + "value": "2024-08-09T18:13:29.389Z" + }, + "lastModifiedBy": { + "$id": "3475", + "kind": "string", + "type": { + "$ref": "358" + }, + "value": "gnicpuszwd" + }, + "lastModifiedByType": { + "$id": "3476", + "kind": "string", + "type": { + "$ref": "146" + }, + "value": "User" + }, + "lastModifiedAt": { + "$id": "3477", + "kind": "string", + "type": { + "$ref": "365" + }, + "value": "2024-08-09T18:13:29.389Z" + } + } + } + } + } + }, + { + "$id": "3478", + "response": { + "$ref": "2346" + }, + "statusCode": 201, + "bodyValue": { + "$id": "3479", + "kind": "model", + "type": { + "$ref": "1247" + }, + "value": { + "$id": "3480", + "properties": { + "$id": "3481", + "kind": "model", + "type": { + "$ref": "1249" + }, + "value": { + "$id": "3482", + "advanced": { + "$id": "3483", + "kind": "model", + "type": { + "$ref": "1251" + }, + "value": { + "$id": "3484", + "clients": { + "$id": "3485", + "kind": "model", + "type": { + "$ref": "1253" + }, + "value": { + "$id": "3486", + "maxSessionExpirySeconds": { + "$id": "3487", + "kind": "number", + "type": { + "$ref": "1255" + }, + "value": 3859 + }, + "maxMessageExpirySeconds": { + "$id": "3488", + "kind": "number", + "type": { + "$ref": "1259" + }, + "value": 3263 + }, + "maxPacketSizeBytes": { + "$id": "3489", + "kind": "number", + "type": { + "$ref": "1263" + }, + "value": 3029 + }, + "subscriberQueueLimit": { + "$id": "3490", + "kind": "model", + "type": { + "$ref": "1267" + }, + "value": { + "$id": "3491", + "length": { + "$id": "3492", + "kind": "number", + "type": { + "$ref": "1269" + }, + "value": 6 + }, + "strategy": { + "$id": "3493", + "kind": "string", + "type": { + "$ref": "274" + }, + "value": "None" + } + } + }, + "maxReceiveMaximum": { + "$id": "3494", + "kind": "number", + "type": { + "$ref": "1278" + }, + "value": 2365 + }, + "maxKeepAliveSeconds": { + "$id": "3495", + "kind": "number", + "type": { + "$ref": "1282" + }, + "value": 3744 + } + } + }, + "encryptInternalTraffic": { + "$id": "3496", + "kind": "string", + "type": { + "$ref": "62" + }, + "value": "Enabled" + }, + "internalCerts": { + "$id": "3497", + "kind": "model", + "type": { + "$ref": "1291" + }, + "value": { + "$id": "3498", + "duration": { + "$id": "3499", + "kind": "string", + "type": { + "$ref": "1293" + }, + "value": "bchrc" + }, + "renewBefore": { + "$id": "3500", + "kind": "string", + "type": { + "$ref": "1297" + }, + "value": "xkafmpgjfifkwwrhkswtopdnne" + }, + "privateKey": { + "$id": "3501", + "kind": "model", + "type": { + "$ref": "1194" + }, + "value": { + "$id": "3502", + "algorithm": { + "$id": "3503", + "kind": "string", + "type": { + "$ref": "244" + }, + "value": "Ec256" + }, + "rotationPolicy": { + "$id": "3504", + "kind": "string", + "type": { + "$ref": "260" + }, + "value": "Always" + } + } + } + } + } + } + }, + "cardinality": { + "$id": "3505", + "kind": "model", + "type": { + "$ref": "1308" + }, + "value": { + "$id": "3506", + "backendChain": { + "$id": "3507", + "kind": "model", + "type": { + "$ref": "1310" + }, + "value": { + "$id": "3508", + "partitions": { + "$id": "3509", + "kind": "number", + "type": { + "$ref": "1312" + }, + "value": 11 + }, + "redundancyFactor": { + "$id": "3510", + "kind": "number", + "type": { + "$ref": "1316" + }, + "value": 5 + }, + "workers": { + "$id": "3511", + "kind": "number", + "type": { + "$ref": "1320" + }, + "value": 15 + } + } + }, + "frontend": { + "$id": "3512", + "kind": "model", + "type": { + "$ref": "1326" + }, + "value": { + "$id": "3513", + "replicas": { + "$id": "3514", + "kind": "number", + "type": { + "$ref": "1328" + }, + "value": 2 + }, + "workers": { + "$id": "3515", + "kind": "number", + "type": { + "$ref": "1332" + }, + "value": 6 + } + } + } + } + }, + "diagnostics": { + "$id": "3516", + "kind": "model", + "type": { + "$ref": "1340" + }, + "value": { + "$id": "3517", + "logs": { + "$id": "3518", + "kind": "model", + "type": { + "$ref": "911" + }, + "value": { + "$id": "3519", + "level": { + "$id": "3520", + "kind": "string", + "type": { + "$ref": "913" + }, + "value": "rnmwokumdmebpmfxxxzvvjfdywotav" + } + } + }, + "metrics": { + "$id": "3521", + "kind": "model", + "type": { + "$ref": "919" + }, + "value": { + "$id": "3522", + "prometheusPort": { + "$id": "3523", + "kind": "number", + "type": { + "$ref": "921" + }, + "value": 7581 + } + } + }, + "selfCheck": { + "$id": "3524", + "kind": "model", + "type": { + "$ref": "1348" + }, + "value": { + "$id": "3525", + "mode": { + "$id": "3526", + "kind": "string", + "type": { + "$ref": "62" + }, + "value": "Enabled" + }, + "intervalSeconds": { + "$id": "3527", + "kind": "number", + "type": { + "$ref": "1353" + }, + "value": 158 + }, + "timeoutSeconds": { + "$id": "3528", + "kind": "number", + "type": { + "$ref": "1357" + }, + "value": 14 + } + } + }, + "traces": { + "$id": "3529", + "kind": "model", + "type": { + "$ref": "1363" + }, + "value": { + "$id": "3530", + "mode": { + "$id": "3531", + "kind": "string", + "type": { + "$ref": "62" + }, + "value": "Enabled" + }, + "cacheSizeMegabytes": { + "$id": "3532", + "kind": "number", + "type": { + "$ref": "1368" + }, + "value": 28 + }, + "selfTracing": { + "$id": "3533", + "kind": "model", + "type": { + "$ref": "1372" + }, + "value": { + "$id": "3534", + "mode": { + "$id": "3535", + "kind": "string", + "type": { + "$ref": "62" + }, + "value": "Enabled" + }, + "intervalSeconds": { + "$id": "3536", + "kind": "number", + "type": { + "$ref": "1377" + }, + "value": 22 + } + } + }, + "spanChannelCapacity": { + "$id": "3537", + "kind": "number", + "type": { + "$ref": "1383" + }, + "value": 1000 + } + } + } + } + }, + "diskBackedMessageBuffer": { + "$id": "3538", + "kind": "model", + "type": { + "$ref": "1391" + }, + "value": { + "$id": "3539", + "maxSize": { + "$id": "3540", + "kind": "string", + "type": { + "$ref": "1393" + }, + "value": "500M" + }, + "ephemeralVolumeClaimSpec": { + "$id": "3541", + "kind": "model", + "type": { + "$ref": "1397" + }, + "value": { + "$id": "3542", + "volumeName": { + "$id": "3543", + "kind": "string", + "type": { + "$ref": "1399" + }, + "value": "c" + }, + "volumeMode": { + "$id": "3544", + "kind": "string", + "type": { + "$ref": "1403" + }, + "value": "rxvpksjuuugqnqzeiprocknbn" + }, + "storageClassName": { + "$id": "3545", + "kind": "string", + "type": { + "$ref": "1407" + }, + "value": "sseyhrjptkhrqvpdpjmornkqvon" + }, + "accessModes": { + "$id": "3546", + "kind": "array", + "type": { + "$ref": "1411" + }, + "value": [ + { + "$id": "3547", + "kind": "string", + "type": { + "$ref": "1412" + }, + "value": "nuluhigrbb" + } + ] + }, + "dataSource": { + "$id": "3548", + "kind": "model", + "type": { + "$ref": "1416" + }, + "value": { + "$id": "3549", + "apiGroup": { + "$id": "3550", + "kind": "string", + "type": { + "$ref": "1418" + }, + "value": "npqapyksvvpkohujx" + }, + "kind": { + "$id": "3551", + "kind": "string", + "type": { + "$ref": "1422" + }, + "value": "wazgyb" + }, + "name": { + "$id": "3552", + "kind": "string", + "type": { + "$ref": "1426" + }, + "value": "cwhsgxxcxsyppoefm" + } + } + }, + "dataSourceRef": { + "$id": "3553", + "kind": "model", + "type": { + "$ref": "1432" + }, + "value": { + "$id": "3554", + "apiGroup": { + "$id": "3555", + "kind": "string", + "type": { + "$ref": "1434" + }, + "value": "mnfnykznjjsoqpfsgdqioupt" + }, + "kind": { + "$id": "3556", + "kind": "string", + "type": { + "$ref": "1438" + }, + "value": "odynqzekfzsnawrctaxg" + }, + "name": { + "$id": "3557", + "kind": "string", + "type": { + "$ref": "1442" + }, + "value": "envszivbbmixbyddzg" + }, + "namespace": { + "$id": "3558", + "kind": "string", + "type": { + "$ref": "1446" + }, + "value": "etcfzvxqd" + } + } + }, + "resources": { + "$id": "3559", + "kind": "model", + "type": { + "$ref": "1452" + }, + "value": { + "$id": "3560", + "limits": { + "$id": "3561", + "kind": "dict", + "type": { + "$ref": "1454" + }, + "value": { + "$id": "3562", + "key2719": { + "$id": "3563", + "kind": "string", + "type": { + "$ref": "1456" + }, + "value": "hmphcrgctu" + } + } + }, + "requests": { + "$id": "3564", + "kind": "dict", + "type": { + "$ref": "1460" + }, + "value": { + "$id": "3565", + "key2909": { + "$id": "3566", + "kind": "string", + "type": { + "$ref": "1462" + }, + "value": "txocprnyrsgvhfrg" + } + } + } + } + }, + "selector": { + "$id": "3567", + "kind": "model", + "type": { + "$ref": "1468" + }, + "value": { + "$id": "3568", + "matchExpressions": { + "$id": "3569", + "kind": "array", + "type": { + "$ref": "1470" + }, + "value": [ + { + "$id": "3570", + "kind": "model", + "type": { + "$ref": "1471" + }, + "value": { + "$id": "3571", + "key": { + "$id": "3572", + "kind": "string", + "type": { + "$ref": "1473" + }, + "value": "e" + }, + "operator": { + "$id": "3573", + "kind": "string", + "type": { + "$ref": "280" + }, + "value": "In" + }, + "values": { + "$id": "3574", + "kind": "array", + "type": { + "$ref": "1480" + }, + "value": [ + { + "$id": "3575", + "kind": "string", + "type": { + "$ref": "1481" + }, + "value": "slmpajlywqvuyknipgztsonqyybt" + } + ] + } + } + } + ] + }, + "matchLabels": { + "$id": "3576", + "kind": "dict", + "type": { + "$ref": "1487" + }, + "value": { + "$id": "3577", + "key6673": { + "$id": "3578", + "kind": "string", + "type": { + "$ref": "1489" + }, + "value": "wlngfalznwxnurzpgxomcxhbqefpr" + } + } + } + } + } + } + }, + "persistentVolumeClaimSpec": { + "$id": "3579", + "kind": "model", + "type": { + "$ref": "1397" + }, + "value": { + "$id": "3580", + "volumeName": { + "$id": "3581", + "kind": "string", + "type": { + "$ref": "1399" + }, + "value": "c" + }, + "volumeMode": { + "$id": "3582", + "kind": "string", + "type": { + "$ref": "1403" + }, + "value": "rxvpksjuuugqnqzeiprocknbn" + }, + "storageClassName": { + "$id": "3583", + "kind": "string", + "type": { + "$ref": "1407" + }, + "value": "sseyhrjptkhrqvpdpjmornkqvon" + }, + "accessModes": { + "$id": "3584", + "kind": "array", + "type": { + "$ref": "1411" + }, + "value": [ + { + "$id": "3585", + "kind": "string", + "type": { + "$ref": "1412" + }, + "value": "nuluhigrbb" + } + ] + }, + "dataSource": { + "$id": "3586", + "kind": "model", + "type": { + "$ref": "1416" + }, + "value": { + "$id": "3587", + "apiGroup": { + "$id": "3588", + "kind": "string", + "type": { + "$ref": "1418" + }, + "value": "npqapyksvvpkohujx" + }, + "kind": { + "$id": "3589", + "kind": "string", + "type": { + "$ref": "1422" + }, + "value": "wazgyb" + }, + "name": { + "$id": "3590", + "kind": "string", + "type": { + "$ref": "1426" + }, + "value": "cwhsgxxcxsyppoefm" + } + } + }, + "dataSourceRef": { + "$id": "3591", + "kind": "model", + "type": { + "$ref": "1432" + }, + "value": { + "$id": "3592", + "apiGroup": { + "$id": "3593", + "kind": "string", + "type": { + "$ref": "1434" + }, + "value": "mnfnykznjjsoqpfsgdqioupt" + }, + "kind": { + "$id": "3594", + "kind": "string", + "type": { + "$ref": "1438" + }, + "value": "odynqzekfzsnawrctaxg" + }, + "name": { + "$id": "3595", + "kind": "string", + "type": { + "$ref": "1442" + }, + "value": "envszivbbmixbyddzg" + }, + "namespace": { + "$id": "3596", + "kind": "string", + "type": { + "$ref": "1446" + }, + "value": "etcfzvxqd" + } + } + }, + "resources": { + "$id": "3597", + "kind": "model", + "type": { + "$ref": "1452" + }, + "value": { + "$id": "3598", + "limits": { + "$id": "3599", + "kind": "dict", + "type": { + "$ref": "1454" + }, + "value": { + "$id": "3600", + "key2719": { + "$id": "3601", + "kind": "string", + "type": { + "$ref": "1456" + }, + "value": "hmphcrgctu" + } + } + }, + "requests": { + "$id": "3602", + "kind": "dict", + "type": { + "$ref": "1460" + }, + "value": { + "$id": "3603", + "key2909": { + "$id": "3604", + "kind": "string", + "type": { + "$ref": "1462" + }, + "value": "txocprnyrsgvhfrg" + } + } + } + } + }, + "selector": { + "$id": "3605", + "kind": "model", + "type": { + "$ref": "1468" + }, + "value": { + "$id": "3606", + "matchExpressions": { + "$id": "3607", + "kind": "array", + "type": { + "$ref": "1470" + }, + "value": [ + { + "$id": "3608", + "kind": "model", + "type": { + "$ref": "1471" + }, + "value": { + "$id": "3609", + "key": { + "$id": "3610", + "kind": "string", + "type": { + "$ref": "1473" + }, + "value": "e" + }, + "operator": { + "$id": "3611", + "kind": "string", + "type": { + "$ref": "280" + }, + "value": "In" + }, + "values": { + "$id": "3612", + "kind": "array", + "type": { + "$ref": "1480" + }, + "value": [ + { + "$id": "3613", + "kind": "string", + "type": { + "$ref": "1481" + }, + "value": "slmpajlywqvuyknipgztsonqyybt" + } + ] + } + } + } + ] + }, + "matchLabels": { + "$id": "3614", + "kind": "dict", + "type": { + "$ref": "1487" + }, + "value": { + "$id": "3615", + "key6673": { + "$id": "3616", + "kind": "string", + "type": { + "$ref": "1489" + }, + "value": "wlngfalznwxnurzpgxomcxhbqefpr" + } + } + } + } + } + } + } + } + }, + "generateResourceLimits": { + "$id": "3617", + "kind": "model", + "type": { + "$ref": "1502" + }, + "value": { + "$id": "3618", + "cpu": { + "$id": "3619", + "kind": "string", + "type": { + "$ref": "62" + }, + "value": "Enabled" + } + } + }, + "memoryProfile": { + "$id": "3620", + "kind": "string", + "type": { + "$ref": "290" + }, + "value": "Tiny" + }, + "provisioningState": { + "$id": "3621", + "kind": "string", + "type": { + "$ref": "126" + }, + "value": "Succeeded" + } + } + }, + "extendedLocation": { + "$id": "3622", + "kind": "model", + "type": { + "$ref": "669" + }, + "value": { + "$id": "3623", + "name": { + "$id": "3624", + "kind": "string", + "type": { + "$ref": "671" + }, + "value": "qmbrfwcpwwhggszhrdjv" + }, + "type": { + "$id": "3625", + "kind": "string", + "type": { + "$ref": "142" + }, + "value": "CustomLocation" + } + } + }, + "id": { + "$id": "3626", + "kind": "string", + "type": { + "$ref": "330" + }, + "value": "/subscriptions/0000000-0000-0000-0000-000000000000/resourceGroups/resourceGroup123/providers/Microsoft.IoTOperations/instances/resource-name123/brokers/resource-name123" + }, + "name": { + "$id": "3627", + "kind": "string", + "type": { + "$ref": "335" + }, + "value": "dowrkel" + }, + "type": { + "$id": "3628", + "kind": "string", + "type": { + "$ref": "339" + }, + "value": "xshjnsdgadygb" + }, + "systemData": { + "$id": "3629", + "kind": "model", + "type": { + "$ref": "344" + }, + "value": { + "$id": "3630", + "createdBy": { + "$id": "3631", + "kind": "string", + "type": { + "$ref": "346" + }, + "value": "ssvaslsmudloholronopqyxjcu" + }, + "createdByType": { + "$id": "3632", + "kind": "string", + "type": { + "$ref": "146" + }, + "value": "User" + }, + "createdAt": { + "$id": "3633", + "kind": "string", + "type": { + "$ref": "353" + }, + "value": "2024-08-09T18:13:29.389Z" + }, + "lastModifiedBy": { + "$id": "3634", + "kind": "string", + "type": { + "$ref": "358" + }, + "value": "gnicpuszwd" + }, + "lastModifiedByType": { + "$id": "3635", + "kind": "string", + "type": { + "$ref": "146" + }, + "value": "User" + }, + "lastModifiedAt": { + "$id": "3636", + "kind": "string", + "type": { + "$ref": "365" + }, + "value": "2024-08-09T18:13:29.389Z" + } + } + } + } + } + } + ] + } + ] + }, + { + "$id": "3637", + "Name": "delete", + "ResourceName": "BrokerResource", + "Doc": "Delete a BrokerResource", + "Accessibility": "public", + "Parameters": [ + { + "$id": "3638", + "Name": "apiVersion", + "NameInRequest": "api-version", + "Doc": "The API version to use for this operation.", + "Type": { + "$id": "3639", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": true, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "DefaultValue": { + "$id": "3640", + "Type": { + "$id": "3641", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "2024-11-01" + }, + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "3642", + "Name": "subscriptionId", + "NameInRequest": "subscriptionId", + "Doc": "The ID of the target subscription. The value must be an UUID.", + "Type": { + "$id": "3643", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "3644", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "3645", + "Name": "resourceGroupName", + "NameInRequest": "resourceGroupName", + "Doc": "The name of the resource group. The name is case insensitive.", + "Type": { + "$id": "3646", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "3647", + "Name": "instanceName", + "NameInRequest": "instanceName", + "Doc": "Name of instance.", + "Type": { + "$id": "3648", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "3649", + "Name": "brokerName", + "NameInRequest": "brokerName", + "Doc": "Name of broker.", + "Type": { + "$id": "3650", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "3651", + "Name": "accept", + "NameInRequest": "Accept", + "Type": { + "$id": "3652", + "kind": "constant", + "valueType": { + "$id": "3653", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "3654", + "StatusCodes": [ + 202 + ], + "BodyMediaType": "Json", + "Headers": [ + { + "$id": "3655", + "Name": "location", + "NameInResponse": "Location", + "Doc": "The Location header contains the URL where the status of the long running operation can be checked.", + "Type": { + "$id": "3656", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + } + }, + { + "$id": "3657", + "Name": "retryAfter", + "NameInResponse": "Retry-After", + "Doc": "The Retry-After header can indicate how long the client should wait before polling the operation status.", + "Type": { + "$id": "3658", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + } + } + ], + "IsErrorResponse": false + }, + { + "$id": "3659", + "StatusCodes": [ + 204 + ], + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false + } + ], + "HttpMethod": "DELETE", + "RequestBodyMediaType": "None", + "Uri": "{endpoint}", + "Path": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/brokers/{brokerName}", + "BufferResponse": true, + "LongRunning": { + "$id": "3660", + "FinalStateVia": 1, + "FinalResponse": { + "$id": "3661", + "StatusCodes": [ + 204 + ], + "BodyMediaType": "Json" + } + }, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Microsoft.IoTOperations.Broker.delete", + "Decorators": [], + "Examples": [ + { + "$id": "3662", + "kind": "http", + "name": "Broker_Delete", + "description": "Broker_Delete", + "filePath": "2024-11-01/Broker_Delete_MaximumSet_Gen.json", + "parameters": [ + { + "$id": "3663", + "parameter": { + "$ref": "3638" + }, + "value": { + "$id": "3664", + "kind": "string", + "type": { + "$ref": "3639" + }, + "value": "2024-11-01" + } + }, + { + "$id": "3665", + "parameter": { + "$ref": "3642" + }, + "value": { + "$id": "3666", + "kind": "string", + "type": { + "$ref": "3643" + }, + "value": "F8C729F9-DF9C-4743-848F-96EE433D8E53" + } + }, + { + "$id": "3667", + "parameter": { + "$ref": "3645" + }, + "value": { + "$id": "3668", + "kind": "string", + "type": { + "$ref": "3646" + }, + "value": "rgiotoperations" + } + }, + { + "$id": "3669", + "parameter": { + "$ref": "3647" + }, + "value": { + "$id": "3670", + "kind": "string", + "type": { + "$ref": "3648" + }, + "value": "resource-name123" + } + }, + { + "$id": "3671", + "parameter": { + "$ref": "3649" + }, + "value": { + "$id": "3672", + "kind": "string", + "type": { + "$ref": "3650" + }, + "value": "resource-name123" + } + } + ], + "responses": [ + { + "$id": "3673", + "response": { + "$ref": "3654" + }, + "statusCode": 202 + }, + { + "$id": "3674", + "response": { + "$ref": "3659" + }, + "statusCode": 204 + } + ] + } + ] + }, + { + "$id": "3675", + "Name": "listByResourceGroup", + "ResourceName": "BrokerResource", + "Doc": "List BrokerResource resources by InstanceResource", + "Accessibility": "public", + "Parameters": [ + { + "$id": "3676", + "Name": "apiVersion", + "NameInRequest": "api-version", + "Doc": "The API version to use for this operation.", + "Type": { + "$id": "3677", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": true, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "DefaultValue": { + "$id": "3678", + "Type": { + "$id": "3679", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "2024-11-01" + }, + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "3680", + "Name": "subscriptionId", + "NameInRequest": "subscriptionId", + "Doc": "The ID of the target subscription. The value must be an UUID.", + "Type": { + "$id": "3681", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "3682", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "3683", + "Name": "resourceGroupName", + "NameInRequest": "resourceGroupName", + "Doc": "The name of the resource group. The name is case insensitive.", + "Type": { + "$id": "3684", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "3685", + "Name": "instanceName", + "NameInRequest": "instanceName", + "Doc": "Name of instance.", + "Type": { + "$id": "3686", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "3687", + "Name": "accept", + "NameInRequest": "Accept", + "Type": { + "$id": "3688", + "kind": "constant", + "valueType": { + "$id": "3689", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "3690", + "StatusCodes": [ + 200 + ], + "BodyType": { + "$ref": "1519" + }, + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false, + "ContentTypes": [ + "application/json" + ] + } + ], + "HttpMethod": "GET", + "RequestBodyMediaType": "None", + "Uri": "{endpoint}", + "Path": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/brokers", + "BufferResponse": true, + "Paging": { + "$id": "3691", + "ItemName": "value", + "NextLinkName": "nextLink" + }, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Microsoft.IoTOperations.Broker.listByResourceGroup", + "Decorators": [], + "Examples": [ + { + "$id": "3692", + "kind": "http", + "name": "Broker_ListByResourceGroup", + "description": "Broker_ListByResourceGroup", + "filePath": "2024-11-01/Broker_ListByResourceGroup_MaximumSet_Gen.json", + "parameters": [ + { + "$id": "3693", + "parameter": { + "$ref": "3676" + }, + "value": { + "$id": "3694", + "kind": "string", + "type": { + "$ref": "3677" + }, + "value": "2024-11-01" + } + }, + { + "$id": "3695", + "parameter": { + "$ref": "3680" + }, + "value": { + "$id": "3696", + "kind": "string", + "type": { + "$ref": "3681" + }, + "value": "F8C729F9-DF9C-4743-848F-96EE433D8E53" + } + }, + { + "$id": "3697", + "parameter": { + "$ref": "3683" + }, + "value": { + "$id": "3698", + "kind": "string", + "type": { + "$ref": "3684" + }, + "value": "rgiotoperations" + } + }, + { + "$id": "3699", + "parameter": { + "$ref": "3685" + }, + "value": { + "$id": "3700", + "kind": "string", + "type": { + "$ref": "3686" + }, + "value": "resource-name123" + } + } + ], + "responses": [ + { + "$id": "3701", + "response": { + "$ref": "3690" + }, + "statusCode": 200, + "bodyValue": { + "$id": "3702", + "kind": "model", + "type": { + "$ref": "1519" + }, + "value": { + "$id": "3703", + "value": { + "$id": "3704", + "kind": "array", + "type": { + "$ref": "1521" + }, + "value": [ + { + "$id": "3705", + "kind": "model", + "type": { + "$ref": "1247" + }, + "value": { + "$id": "3706", + "properties": { + "$id": "3707", + "kind": "model", + "type": { + "$ref": "1249" + }, + "value": { + "$id": "3708", + "advanced": { + "$id": "3709", + "kind": "model", + "type": { + "$ref": "1251" + }, + "value": { + "$id": "3710", + "clients": { + "$id": "3711", + "kind": "model", + "type": { + "$ref": "1253" + }, + "value": { + "$id": "3712", + "maxSessionExpirySeconds": { + "$id": "3713", + "kind": "number", + "type": { + "$ref": "1255" + }, + "value": 3859 + }, + "maxMessageExpirySeconds": { + "$id": "3714", + "kind": "number", + "type": { + "$ref": "1259" + }, + "value": 3263 + }, + "maxPacketSizeBytes": { + "$id": "3715", + "kind": "number", + "type": { + "$ref": "1263" + }, + "value": 3029 + }, + "subscriberQueueLimit": { + "$id": "3716", + "kind": "model", + "type": { + "$ref": "1267" + }, + "value": { + "$id": "3717", + "length": { + "$id": "3718", + "kind": "number", + "type": { + "$ref": "1269" + }, + "value": 6 + }, + "strategy": { + "$id": "3719", + "kind": "string", + "type": { + "$ref": "274" + }, + "value": "None" + } + } + }, + "maxReceiveMaximum": { + "$id": "3720", + "kind": "number", + "type": { + "$ref": "1278" + }, + "value": 2365 + }, + "maxKeepAliveSeconds": { + "$id": "3721", + "kind": "number", + "type": { + "$ref": "1282" + }, + "value": 3744 + } + } + }, + "encryptInternalTraffic": { + "$id": "3722", + "kind": "string", + "type": { + "$ref": "62" + }, + "value": "Enabled" + }, + "internalCerts": { + "$id": "3723", + "kind": "model", + "type": { + "$ref": "1291" + }, + "value": { + "$id": "3724", + "duration": { + "$id": "3725", + "kind": "string", + "type": { + "$ref": "1293" + }, + "value": "bchrc" + }, + "renewBefore": { + "$id": "3726", + "kind": "string", + "type": { + "$ref": "1297" + }, + "value": "xkafmpgjfifkwwrhkswtopdnne" + }, + "privateKey": { + "$id": "3727", + "kind": "model", + "type": { + "$ref": "1194" + }, + "value": { + "$id": "3728", + "algorithm": { + "$id": "3729", + "kind": "string", + "type": { + "$ref": "244" + }, + "value": "Ec256" + }, + "rotationPolicy": { + "$id": "3730", + "kind": "string", + "type": { + "$ref": "260" + }, + "value": "Always" + } + } + } + } + } + } + }, + "cardinality": { + "$id": "3731", + "kind": "model", + "type": { + "$ref": "1308" + }, + "value": { + "$id": "3732", + "backendChain": { + "$id": "3733", + "kind": "model", + "type": { + "$ref": "1310" + }, + "value": { + "$id": "3734", + "partitions": { + "$id": "3735", + "kind": "number", + "type": { + "$ref": "1312" + }, + "value": 11 + }, + "redundancyFactor": { + "$id": "3736", + "kind": "number", + "type": { + "$ref": "1316" + }, + "value": 5 + }, + "workers": { + "$id": "3737", + "kind": "number", + "type": { + "$ref": "1320" + }, + "value": 15 + } + } + }, + "frontend": { + "$id": "3738", + "kind": "model", + "type": { + "$ref": "1326" + }, + "value": { + "$id": "3739", + "replicas": { + "$id": "3740", + "kind": "number", + "type": { + "$ref": "1328" + }, + "value": 2 + }, + "workers": { + "$id": "3741", + "kind": "number", + "type": { + "$ref": "1332" + }, + "value": 6 + } + } + } + } + }, + "diagnostics": { + "$id": "3742", + "kind": "model", + "type": { + "$ref": "1340" + }, + "value": { + "$id": "3743", + "logs": { + "$id": "3744", + "kind": "model", + "type": { + "$ref": "911" + }, + "value": { + "$id": "3745", + "level": { + "$id": "3746", + "kind": "string", + "type": { + "$ref": "913" + }, + "value": "rnmwokumdmebpmfxxxzvvjfdywotav" + } + } + }, + "metrics": { + "$id": "3747", + "kind": "model", + "type": { + "$ref": "919" + }, + "value": { + "$id": "3748", + "prometheusPort": { + "$id": "3749", + "kind": "number", + "type": { + "$ref": "921" + }, + "value": 7581 + } + } + }, + "selfCheck": { + "$id": "3750", + "kind": "model", + "type": { + "$ref": "1348" + }, + "value": { + "$id": "3751", + "mode": { + "$id": "3752", + "kind": "string", + "type": { + "$ref": "62" + }, + "value": "Enabled" + }, + "intervalSeconds": { + "$id": "3753", + "kind": "number", + "type": { + "$ref": "1353" + }, + "value": 158 + }, + "timeoutSeconds": { + "$id": "3754", + "kind": "number", + "type": { + "$ref": "1357" + }, + "value": 14 + } + } + }, + "traces": { + "$id": "3755", + "kind": "model", + "type": { + "$ref": "1363" + }, + "value": { + "$id": "3756", + "mode": { + "$id": "3757", + "kind": "string", + "type": { + "$ref": "62" + }, + "value": "Enabled" + }, + "cacheSizeMegabytes": { + "$id": "3758", + "kind": "number", + "type": { + "$ref": "1368" + }, + "value": 28 + }, + "selfTracing": { + "$id": "3759", + "kind": "model", + "type": { + "$ref": "1372" + }, + "value": { + "$id": "3760", + "mode": { + "$id": "3761", + "kind": "string", + "type": { + "$ref": "62" + }, + "value": "Enabled" + }, + "intervalSeconds": { + "$id": "3762", + "kind": "number", + "type": { + "$ref": "1377" + }, + "value": 22 + } + } + }, + "spanChannelCapacity": { + "$id": "3763", + "kind": "number", + "type": { + "$ref": "1383" + }, + "value": 1000 + } + } + } + } + }, + "diskBackedMessageBuffer": { + "$id": "3764", + "kind": "model", + "type": { + "$ref": "1391" + }, + "value": { + "$id": "3765", + "maxSize": { + "$id": "3766", + "kind": "string", + "type": { + "$ref": "1393" + }, + "value": "500M" + }, + "ephemeralVolumeClaimSpec": { + "$id": "3767", + "kind": "model", + "type": { + "$ref": "1397" + }, + "value": { + "$id": "3768", + "volumeName": { + "$id": "3769", + "kind": "string", + "type": { + "$ref": "1399" + }, + "value": "c" + }, + "volumeMode": { + "$id": "3770", + "kind": "string", + "type": { + "$ref": "1403" + }, + "value": "rxvpksjuuugqnqzeiprocknbn" + }, + "storageClassName": { + "$id": "3771", + "kind": "string", + "type": { + "$ref": "1407" + }, + "value": "sseyhrjptkhrqvpdpjmornkqvon" + }, + "accessModes": { + "$id": "3772", + "kind": "array", + "type": { + "$ref": "1411" + }, + "value": [ + { + "$id": "3773", + "kind": "string", + "type": { + "$ref": "1412" + }, + "value": "nuluhigrbb" + } + ] + }, + "dataSource": { + "$id": "3774", + "kind": "model", + "type": { + "$ref": "1416" + }, + "value": { + "$id": "3775", + "apiGroup": { + "$id": "3776", + "kind": "string", + "type": { + "$ref": "1418" + }, + "value": "npqapyksvvpkohujx" + }, + "kind": { + "$id": "3777", + "kind": "string", + "type": { + "$ref": "1422" + }, + "value": "wazgyb" + }, + "name": { + "$id": "3778", + "kind": "string", + "type": { + "$ref": "1426" + }, + "value": "cwhsgxxcxsyppoefm" + } + } + }, + "dataSourceRef": { + "$id": "3779", + "kind": "model", + "type": { + "$ref": "1432" + }, + "value": { + "$id": "3780", + "apiGroup": { + "$id": "3781", + "kind": "string", + "type": { + "$ref": "1434" + }, + "value": "mnfnykznjjsoqpfsgdqioupt" + }, + "kind": { + "$id": "3782", + "kind": "string", + "type": { + "$ref": "1438" + }, + "value": "odynqzekfzsnawrctaxg" + }, + "name": { + "$id": "3783", + "kind": "string", + "type": { + "$ref": "1442" + }, + "value": "envszivbbmixbyddzg" + }, + "namespace": { + "$id": "3784", + "kind": "string", + "type": { + "$ref": "1446" + }, + "value": "etcfzvxqd" + } + } + }, + "resources": { + "$id": "3785", + "kind": "model", + "type": { + "$ref": "1452" + }, + "value": { + "$id": "3786", + "limits": { + "$id": "3787", + "kind": "dict", + "type": { + "$ref": "1454" + }, + "value": { + "$id": "3788", + "key2719": { + "$id": "3789", + "kind": "string", + "type": { + "$ref": "1456" + }, + "value": "hmphcrgctu" + } + } + }, + "requests": { + "$id": "3790", + "kind": "dict", + "type": { + "$ref": "1460" + }, + "value": { + "$id": "3791", + "key2909": { + "$id": "3792", + "kind": "string", + "type": { + "$ref": "1462" + }, + "value": "txocprnyrsgvhfrg" + } + } + } + } + }, + "selector": { + "$id": "3793", + "kind": "model", + "type": { + "$ref": "1468" + }, + "value": { + "$id": "3794", + "matchExpressions": { + "$id": "3795", + "kind": "array", + "type": { + "$ref": "1470" + }, + "value": [ + { + "$id": "3796", + "kind": "model", + "type": { + "$ref": "1471" + }, + "value": { + "$id": "3797", + "key": { + "$id": "3798", + "kind": "string", + "type": { + "$ref": "1473" + }, + "value": "e" + }, + "operator": { + "$id": "3799", + "kind": "string", + "type": { + "$ref": "280" + }, + "value": "In" + }, + "values": { + "$id": "3800", + "kind": "array", + "type": { + "$ref": "1480" + }, + "value": [ + { + "$id": "3801", + "kind": "string", + "type": { + "$ref": "1481" + }, + "value": "slmpajlywqvuyknipgztsonqyybt" + } + ] + } + } + } + ] + }, + "matchLabels": { + "$id": "3802", + "kind": "dict", + "type": { + "$ref": "1487" + }, + "value": { + "$id": "3803", + "key6673": { + "$id": "3804", + "kind": "string", + "type": { + "$ref": "1489" + }, + "value": "wlngfalznwxnurzpgxomcxhbqefpr" + } + } + } + } + } + } + }, + "persistentVolumeClaimSpec": { + "$id": "3805", + "kind": "model", + "type": { + "$ref": "1397" + }, + "value": { + "$id": "3806", + "volumeName": { + "$id": "3807", + "kind": "string", + "type": { + "$ref": "1399" + }, + "value": "c" + }, + "volumeMode": { + "$id": "3808", + "kind": "string", + "type": { + "$ref": "1403" + }, + "value": "rxvpksjuuugqnqzeiprocknbn" + }, + "storageClassName": { + "$id": "3809", + "kind": "string", + "type": { + "$ref": "1407" + }, + "value": "sseyhrjptkhrqvpdpjmornkqvon" + }, + "accessModes": { + "$id": "3810", + "kind": "array", + "type": { + "$ref": "1411" + }, + "value": [ + { + "$id": "3811", + "kind": "string", + "type": { + "$ref": "1412" + }, + "value": "nuluhigrbb" + } + ] + }, + "dataSource": { + "$id": "3812", + "kind": "model", + "type": { + "$ref": "1416" + }, + "value": { + "$id": "3813", + "apiGroup": { + "$id": "3814", + "kind": "string", + "type": { + "$ref": "1418" + }, + "value": "npqapyksvvpkohujx" + }, + "kind": { + "$id": "3815", + "kind": "string", + "type": { + "$ref": "1422" + }, + "value": "wazgyb" + }, + "name": { + "$id": "3816", + "kind": "string", + "type": { + "$ref": "1426" + }, + "value": "cwhsgxxcxsyppoefm" + } + } + }, + "dataSourceRef": { + "$id": "3817", + "kind": "model", + "type": { + "$ref": "1432" + }, + "value": { + "$id": "3818", + "apiGroup": { + "$id": "3819", + "kind": "string", + "type": { + "$ref": "1434" + }, + "value": "mnfnykznjjsoqpfsgdqioupt" + }, + "kind": { + "$id": "3820", + "kind": "string", + "type": { + "$ref": "1438" + }, + "value": "odynqzekfzsnawrctaxg" + }, + "name": { + "$id": "3821", + "kind": "string", + "type": { + "$ref": "1442" + }, + "value": "envszivbbmixbyddzg" + }, + "namespace": { + "$id": "3822", + "kind": "string", + "type": { + "$ref": "1446" + }, + "value": "etcfzvxqd" + } + } + }, + "resources": { + "$id": "3823", + "kind": "model", + "type": { + "$ref": "1452" + }, + "value": { + "$id": "3824", + "limits": { + "$id": "3825", + "kind": "dict", + "type": { + "$ref": "1454" + }, + "value": { + "$id": "3826", + "key2719": { + "$id": "3827", + "kind": "string", + "type": { + "$ref": "1456" + }, + "value": "hmphcrgctu" + } + } + }, + "requests": { + "$id": "3828", + "kind": "dict", + "type": { + "$ref": "1460" + }, + "value": { + "$id": "3829", + "key2909": { + "$id": "3830", + "kind": "string", + "type": { + "$ref": "1462" + }, + "value": "txocprnyrsgvhfrg" + } + } + } + } + }, + "selector": { + "$id": "3831", + "kind": "model", + "type": { + "$ref": "1468" + }, + "value": { + "$id": "3832", + "matchExpressions": { + "$id": "3833", + "kind": "array", + "type": { + "$ref": "1470" + }, + "value": [ + { + "$id": "3834", + "kind": "model", + "type": { + "$ref": "1471" + }, + "value": { + "$id": "3835", + "key": { + "$id": "3836", + "kind": "string", + "type": { + "$ref": "1473" + }, + "value": "e" + }, + "operator": { + "$id": "3837", + "kind": "string", + "type": { + "$ref": "280" + }, + "value": "In" + }, + "values": { + "$id": "3838", + "kind": "array", + "type": { + "$ref": "1480" + }, + "value": [ + { + "$id": "3839", + "kind": "string", + "type": { + "$ref": "1481" + }, + "value": "slmpajlywqvuyknipgztsonqyybt" + } + ] + } + } + } + ] + }, + "matchLabels": { + "$id": "3840", + "kind": "dict", + "type": { + "$ref": "1487" + }, + "value": { + "$id": "3841", + "key6673": { + "$id": "3842", + "kind": "string", + "type": { + "$ref": "1489" + }, + "value": "wlngfalznwxnurzpgxomcxhbqefpr" + } + } + } + } + } + } + } + } + }, + "generateResourceLimits": { + "$id": "3843", + "kind": "model", + "type": { + "$ref": "1502" + }, + "value": { + "$id": "3844", + "cpu": { + "$id": "3845", + "kind": "string", + "type": { + "$ref": "62" + }, + "value": "Enabled" + } + } + }, + "memoryProfile": { + "$id": "3846", + "kind": "string", + "type": { + "$ref": "290" + }, + "value": "Tiny" + }, + "provisioningState": { + "$id": "3847", + "kind": "string", + "type": { + "$ref": "126" + }, + "value": "Succeeded" + } + } + }, + "extendedLocation": { + "$id": "3848", + "kind": "model", + "type": { + "$ref": "669" + }, + "value": { + "$id": "3849", + "name": { + "$id": "3850", + "kind": "string", + "type": { + "$ref": "671" + }, + "value": "qmbrfwcpwwhggszhrdjv" + }, + "type": { + "$id": "3851", + "kind": "string", + "type": { + "$ref": "142" + }, + "value": "CustomLocation" + } + } + }, + "id": { + "$id": "3852", + "kind": "string", + "type": { + "$ref": "330" + }, + "value": "/subscriptions/0000000-0000-0000-0000-000000000000/resourceGroups/resourceGroup123/providers/Microsoft.IoTOperations/instances/resource-name123/brokers/resource-name123" + }, + "name": { + "$id": "3853", + "kind": "string", + "type": { + "$ref": "335" + }, + "value": "dowrkel" + }, + "type": { + "$id": "3854", + "kind": "string", + "type": { + "$ref": "339" + }, + "value": "xshjnsdgadygb" + }, + "systemData": { + "$id": "3855", + "kind": "model", + "type": { + "$ref": "344" + }, + "value": { + "$id": "3856", + "createdBy": { + "$id": "3857", + "kind": "string", + "type": { + "$ref": "346" + }, + "value": "ssvaslsmudloholronopqyxjcu" + }, + "createdByType": { + "$id": "3858", + "kind": "string", + "type": { + "$ref": "146" + }, + "value": "User" + }, + "createdAt": { + "$id": "3859", + "kind": "string", + "type": { + "$ref": "353" + }, + "value": "2024-08-09T18:13:29.389Z" + }, + "lastModifiedBy": { + "$id": "3860", + "kind": "string", + "type": { + "$ref": "358" + }, + "value": "gnicpuszwd" + }, + "lastModifiedByType": { + "$id": "3861", + "kind": "string", + "type": { + "$ref": "146" + }, + "value": "User" + }, + "lastModifiedAt": { + "$id": "3862", + "kind": "string", + "type": { + "$ref": "365" + }, + "value": "2024-08-09T18:13:29.389Z" + } + } + } + } + } + ] + }, + "nextLink": { + "$id": "3863", + "kind": "string", + "type": { + "$ref": "1525" + }, + "value": "https://microsoft.com/a" + } + } + } + } + ] + } + ] + } + ], + "Protocol": { + "$id": "3864" + }, + "Parent": "IoTOperationsClient", + "Parameters": [ + { + "$id": "3865", + "Name": "endpoint", + "NameInRequest": "endpoint", + "Doc": "Service host", + "Type": { + "$id": "3866", + "kind": "url", + "name": "url", + "crossLanguageDefinitionId": "TypeSpec.url" + }, + "Location": "Uri", + "IsApiVersion": false, + "IsResourceParameter": false, + "IsContentType": false, + "IsRequired": true, + "IsEndpoint": true, + "SkipUrlEncoding": false, + "Explode": false, + "Kind": "Client", + "DefaultValue": { + "$id": "3867", + "Type": { + "$id": "3868", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "https://management.azure.com" + } + } + ], + "Decorators": [] + }, + { + "$id": "3869", + "Name": "BrokerListener", + "ClientNamespace": "Microsoft.IoTOperations", + "Operations": [ + { + "$id": "3870", + "Name": "get", + "ResourceName": "BrokerListenerResource", + "Doc": "Get a BrokerListenerResource", + "Accessibility": "public", + "Parameters": [ + { + "$id": "3871", + "Name": "apiVersion", + "NameInRequest": "api-version", + "Doc": "The API version to use for this operation.", + "Type": { + "$id": "3872", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": true, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "DefaultValue": { + "$id": "3873", + "Type": { + "$id": "3874", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "2024-11-01" + }, + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "3875", + "Name": "subscriptionId", + "NameInRequest": "subscriptionId", + "Doc": "The ID of the target subscription. The value must be an UUID.", + "Type": { + "$id": "3876", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "3877", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "3878", + "Name": "resourceGroupName", + "NameInRequest": "resourceGroupName", + "Doc": "The name of the resource group. The name is case insensitive.", + "Type": { + "$id": "3879", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "3880", + "Name": "instanceName", + "NameInRequest": "instanceName", + "Doc": "Name of instance.", + "Type": { + "$id": "3881", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "3882", + "Name": "brokerName", + "NameInRequest": "brokerName", + "Doc": "Name of broker.", + "Type": { + "$id": "3883", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "3884", + "Name": "listenerName", + "NameInRequest": "listenerName", + "Doc": "Name of Instance broker listener resource", + "Type": { + "$id": "3885", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "3886", + "Name": "accept", + "NameInRequest": "Accept", + "Type": { + "$id": "3887", + "kind": "constant", + "valueType": { + "$id": "3888", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "3889", + "StatusCodes": [ + 200 + ], + "BodyType": { + "$ref": "1130" + }, + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false, + "ContentTypes": [ + "application/json" + ] + } + ], + "HttpMethod": "GET", + "RequestBodyMediaType": "None", + "Uri": "{endpoint}", + "Path": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/brokers/{brokerName}/listeners/{listenerName}", + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Microsoft.IoTOperations.BrokerListener.get", + "Decorators": [], + "Examples": [ + { + "$id": "3890", + "kind": "http", + "name": "BrokerListener_Get", + "description": "BrokerListener_Get", + "filePath": "2024-11-01/BrokerListener_Get_MaximumSet_Gen.json", + "parameters": [ + { + "$id": "3891", + "parameter": { + "$ref": "3871" + }, + "value": { + "$id": "3892", + "kind": "string", + "type": { + "$ref": "3872" + }, + "value": "2024-11-01" + } + }, + { + "$id": "3893", + "parameter": { + "$ref": "3875" + }, + "value": { + "$id": "3894", + "kind": "string", + "type": { + "$ref": "3876" + }, + "value": "F8C729F9-DF9C-4743-848F-96EE433D8E53" + } + }, + { + "$id": "3895", + "parameter": { + "$ref": "3878" + }, + "value": { + "$id": "3896", + "kind": "string", + "type": { + "$ref": "3879" + }, + "value": "rgiotoperations" + } + }, + { + "$id": "3897", + "parameter": { + "$ref": "3880" + }, + "value": { + "$id": "3898", + "kind": "string", + "type": { + "$ref": "3881" + }, + "value": "resource-name123" + } + }, + { + "$id": "3899", + "parameter": { + "$ref": "3882" + }, + "value": { + "$id": "3900", + "kind": "string", + "type": { + "$ref": "3883" + }, + "value": "resource-name123" + } + }, + { + "$id": "3901", + "parameter": { + "$ref": "3884" + }, + "value": { + "$id": "3902", + "kind": "string", + "type": { + "$ref": "3885" + }, + "value": "resource-name123" + } + } + ], + "responses": [ + { + "$id": "3903", + "response": { + "$ref": "3889" + }, + "statusCode": 200, + "bodyValue": { + "$id": "3904", + "kind": "model", + "type": { + "$ref": "1130" + }, + "value": { + "$id": "3905", + "properties": { + "$id": "3906", + "kind": "model", + "type": { + "$ref": "1132" + }, + "value": { + "$id": "3907", + "serviceName": { + "$id": "3908", + "kind": "string", + "type": { + "$ref": "1134" + }, + "value": "tpfiszlapdpxktx" + }, + "ports": { + "$id": "3909", + "kind": "array", + "type": { + "$ref": "1138" + }, + "value": [ + { + "$id": "3910", + "kind": "model", + "type": { + "$ref": "1139" + }, + "value": { + "$id": "3911", + "authenticationRef": { + "$id": "3912", + "kind": "string", + "type": { + "$ref": "1141" + }, + "value": "tjvdroaqqy" + }, + "authorizationRef": { + "$id": "3913", + "kind": "string", + "type": { + "$ref": "1145" + }, + "value": "inxhvxnwswyrvt" + }, + "nodePort": { + "$id": "3914", + "kind": "number", + "type": { + "$ref": "1149" + }, + "value": 7281 + }, + "port": { + "$id": "3915", + "kind": "number", + "type": { + "$ref": "1153" + }, + "value": 1268 + }, + "protocol": { + "$id": "3916", + "kind": "string", + "type": { + "$ref": "114" + }, + "value": "Mqtt" + }, + "tls": { + "$id": "3917", + "kind": "model", + "type": { + "$ref": "1160" + }, + "value": { + "$id": "3918", + "mode": { + "$id": "3919", + "kind": "string", + "type": { + "$ref": "232" + }, + "value": "Automatic" + }, + "certManagerCertificateSpec": { + "$id": "3920", + "kind": "model", + "type": { + "$ref": "1165" + }, + "value": { + "$id": "3921", + "duration": { + "$id": "3922", + "kind": "string", + "type": { + "$ref": "1167" + }, + "value": "qmpeffoksron" + }, + "secretName": { + "$id": "3923", + "kind": "string", + "type": { + "$ref": "1171" + }, + "value": "oagi" + }, + "renewBefore": { + "$id": "3924", + "kind": "string", + "type": { + "$ref": "1175" + }, + "value": "hutno" + }, + "issuerRef": { + "$id": "3925", + "kind": "model", + "type": { + "$ref": "1179" + }, + "value": { + "$id": "3926", + "group": { + "$id": "3927", + "kind": "string", + "type": { + "$ref": "1181" + }, + "value": "jtmuladdkpasfpoyvewekmiy" + }, + "kind": { + "$id": "3928", + "kind": "string", + "type": { + "$ref": "238" + }, + "value": "Issuer" + }, + "name": { + "$id": "3929", + "kind": "string", + "type": { + "$ref": "1188" + }, + "value": "ocwoqpgucvjrsuudtjhb" + } + } + }, + "privateKey": { + "$id": "3930", + "kind": "model", + "type": { + "$ref": "1194" + }, + "value": { + "$id": "3931", + "algorithm": { + "$id": "3932", + "kind": "string", + "type": { + "$ref": "244" + }, + "value": "Ec256" + }, + "rotationPolicy": { + "$id": "3933", + "kind": "string", + "type": { + "$ref": "260" + }, + "value": "Always" + } + } + }, + "san": { + "$id": "3934", + "kind": "model", + "type": { + "$ref": "1204" + }, + "value": { + "$id": "3935", + "dns": { + "$id": "3936", + "kind": "array", + "type": { + "$ref": "1206" + }, + "value": [ + { + "$id": "3937", + "kind": "string", + "type": { + "$ref": "1207" + }, + "value": "xhvmhrrhgfsapocjeebqtnzarlj" + } + ] + }, + "ip": { + "$id": "3938", + "kind": "array", + "type": { + "$ref": "1211" + }, + "value": [ + { + "$id": "3939", + "kind": "string", + "type": { + "$ref": "1212" + }, + "value": "zbgugfzcgsmegevzktsnibyuyp" + } + ] + } + } + } + } + }, + "manual": { + "$id": "3940", + "kind": "model", + "type": { + "$ref": "1052" + }, + "value": { + "$id": "3941", + "secretRef": { + "$id": "3942", + "kind": "string", + "type": { + "$ref": "1054" + }, + "value": "secret-name" + } + } + } + } + } + } + } + ] + }, + "serviceType": { + "$id": "3943", + "kind": "string", + "type": { + "$ref": "266" + }, + "value": "ClusterIp" + }, + "provisioningState": { + "$id": "3944", + "kind": "string", + "type": { + "$ref": "126" + }, + "value": "Succeeded" + } + } + }, + "extendedLocation": { + "$id": "3945", + "kind": "model", + "type": { + "$ref": "669" + }, + "value": { + "$id": "3946", + "name": { + "$id": "3947", + "kind": "string", + "type": { + "$ref": "671" + }, + "value": "qmbrfwcpwwhggszhrdjv" + }, + "type": { + "$id": "3948", + "kind": "string", + "type": { + "$ref": "142" + }, + "value": "CustomLocation" + } + } + }, + "id": { + "$id": "3949", + "kind": "string", + "type": { + "$ref": "330" + }, + "value": "/subscriptions/0000000-0000-0000-0000-000000000000/resourceGroups/resourceGroup123/providers/Microsoft.IoTOperations/instances/resource-name123/brokers/resource-name123/listeners/resource-name123" + }, + "name": { + "$id": "3950", + "kind": "string", + "type": { + "$ref": "335" + }, + "value": "hoqjaachratt" + }, + "type": { + "$id": "3951", + "kind": "string", + "type": { + "$ref": "339" + }, + "value": "hizbknwegcdaeh" + }, + "systemData": { + "$id": "3952", + "kind": "model", + "type": { + "$ref": "344" + }, + "value": { + "$id": "3953", + "createdBy": { + "$id": "3954", + "kind": "string", + "type": { + "$ref": "346" + }, + "value": "ssvaslsmudloholronopqyxjcu" + }, + "createdByType": { + "$id": "3955", + "kind": "string", + "type": { + "$ref": "146" + }, + "value": "User" + }, + "createdAt": { + "$id": "3956", + "kind": "string", + "type": { + "$ref": "353" + }, + "value": "2024-08-09T18:13:29.389Z" + }, + "lastModifiedBy": { + "$id": "3957", + "kind": "string", + "type": { + "$ref": "358" + }, + "value": "gnicpuszwd" + }, + "lastModifiedByType": { + "$id": "3958", + "kind": "string", + "type": { + "$ref": "146" + }, + "value": "User" + }, + "lastModifiedAt": { + "$id": "3959", + "kind": "string", + "type": { + "$ref": "365" + }, + "value": "2024-08-09T18:13:29.389Z" + } + } + } + } + } + } + ] + } + ] + }, + { + "$id": "3960", + "Name": "createOrUpdate", + "ResourceName": "BrokerListenerResource", + "Doc": "Create a BrokerListenerResource", + "Accessibility": "public", + "Parameters": [ + { + "$id": "3961", + "Name": "apiVersion", + "NameInRequest": "api-version", + "Doc": "The API version to use for this operation.", + "Type": { + "$id": "3962", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": true, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "DefaultValue": { + "$id": "3963", + "Type": { + "$id": "3964", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "2024-11-01" + }, + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "3965", + "Name": "subscriptionId", + "NameInRequest": "subscriptionId", + "Doc": "The ID of the target subscription. The value must be an UUID.", + "Type": { + "$id": "3966", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "3967", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "3968", + "Name": "resourceGroupName", + "NameInRequest": "resourceGroupName", + "Doc": "The name of the resource group. The name is case insensitive.", + "Type": { + "$id": "3969", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "3970", + "Name": "instanceName", + "NameInRequest": "instanceName", + "Doc": "Name of instance.", + "Type": { + "$id": "3971", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "3972", + "Name": "brokerName", + "NameInRequest": "brokerName", + "Doc": "Name of broker.", + "Type": { + "$id": "3973", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "3974", + "Name": "listenerName", + "NameInRequest": "listenerName", + "Doc": "Name of Instance broker listener resource", + "Type": { + "$id": "3975", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "3976", + "Name": "contentType", + "NameInRequest": "Content-Type", + "Doc": "Body parameter's content type. Known values are application/json", + "Type": { + "$id": "3977", + "kind": "constant", + "valueType": { + "$id": "3978", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": true, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "3979", + "Name": "accept", + "NameInRequest": "Accept", + "Type": { + "$id": "3980", + "kind": "constant", + "valueType": { + "$id": "3981", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "3982", + "Name": "resource", + "NameInRequest": "resource", + "Doc": "Resource create parameters.", + "Type": { + "$ref": "1130" + }, + "Location": "Body", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "3983", + "StatusCodes": [ + 200 + ], + "BodyType": { + "$ref": "1130" + }, + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false, + "ContentTypes": [ + "application/json" + ] + }, + { + "$id": "3984", + "StatusCodes": [ + 201 + ], + "BodyType": { + "$ref": "1130" + }, + "BodyMediaType": "Json", + "Headers": [ + { + "$id": "3985", + "Name": "azureAsyncOperation", + "NameInResponse": "Azure-AsyncOperation", + "Doc": "A link to the status monitor", + "Type": { + "$id": "3986", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + } + }, + { + "$id": "3987", + "Name": "retryAfter", + "NameInResponse": "Retry-After", + "Doc": "The Retry-After header can indicate how long the client should wait before polling the operation status.", + "Type": { + "$id": "3988", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + } + } + ], + "IsErrorResponse": false, + "ContentTypes": [ + "application/json" + ] + } + ], + "HttpMethod": "PUT", + "RequestBodyMediaType": "Json", + "Uri": "{endpoint}", + "Path": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/brokers/{brokerName}/listeners/{listenerName}", + "RequestMediaTypes": [ + "application/json" + ], + "BufferResponse": true, + "LongRunning": { + "$id": "3989", + "FinalStateVia": 0, + "FinalResponse": { + "$id": "3990", + "StatusCodes": [ + 200 + ], + "BodyType": { + "$ref": "1130" + }, + "BodyMediaType": "Json" + } + }, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Microsoft.IoTOperations.BrokerListener.createOrUpdate", + "Decorators": [], + "Examples": [ + { + "$id": "3991", + "kind": "http", + "name": "BrokerListener_CreateOrUpdate_Complex", + "description": "BrokerListener_CreateOrUpdate_Complex", + "filePath": "2024-11-01/BrokerListener_CreateOrUpdate_Complex.json", + "parameters": [ + { + "$id": "3992", + "parameter": { + "$ref": "3961" + }, + "value": { + "$id": "3993", + "kind": "string", + "type": { + "$ref": "3962" + }, + "value": "2024-11-01" + } + }, + { + "$id": "3994", + "parameter": { + "$ref": "3965" + }, + "value": { + "$id": "3995", + "kind": "string", + "type": { + "$ref": "3966" + }, + "value": "F8C729F9-DF9C-4743-848F-96EE433D8E53" + } + }, + { + "$id": "3996", + "parameter": { + "$ref": "3968" + }, + "value": { + "$id": "3997", + "kind": "string", + "type": { + "$ref": "3969" + }, + "value": "rgiotoperations" + } + }, + { + "$id": "3998", + "parameter": { + "$ref": "3970" + }, + "value": { + "$id": "3999", + "kind": "string", + "type": { + "$ref": "3971" + }, + "value": "resource-name123" + } + }, + { + "$id": "4000", + "parameter": { + "$ref": "3972" + }, + "value": { + "$id": "4001", + "kind": "string", + "type": { + "$ref": "3973" + }, + "value": "resource-name123" + } + }, + { + "$id": "4002", + "parameter": { + "$ref": "3974" + }, + "value": { + "$id": "4003", + "kind": "string", + "type": { + "$ref": "3975" + }, + "value": "resource-name123" + } + }, + { + "$id": "4004", + "parameter": { + "$ref": "3982" + }, + "value": { + "$id": "4005", + "kind": "model", + "type": { + "$ref": "1130" + }, + "value": { + "$id": "4006", + "properties": { + "$id": "4007", + "kind": "model", + "type": { + "$ref": "1132" + }, + "value": { + "$id": "4008", + "serviceType": { + "$id": "4009", + "kind": "string", + "type": { + "$ref": "266" + }, + "value": "LoadBalancer" + }, + "ports": { + "$id": "4010", + "kind": "array", + "type": { + "$ref": "1138" + }, + "value": [ + { + "$id": "4011", + "kind": "model", + "type": { + "$ref": "1139" + }, + "value": { + "$id": "4012", + "port": { + "$id": "4013", + "kind": "number", + "type": { + "$ref": "1153" + }, + "value": 8080 + }, + "authenticationRef": { + "$id": "4014", + "kind": "string", + "type": { + "$ref": "1141" + }, + "value": "example-authentication" + }, + "protocol": { + "$id": "4015", + "kind": "string", + "type": { + "$ref": "114" + }, + "value": "WebSockets" + } + } + }, + { + "$id": "4016", + "kind": "model", + "type": { + "$ref": "1139" + }, + "value": { + "$id": "4017", + "port": { + "$id": "4018", + "kind": "number", + "type": { + "$ref": "1153" + }, + "value": 8443 + }, + "authenticationRef": { + "$id": "4019", + "kind": "string", + "type": { + "$ref": "1141" + }, + "value": "example-authentication" + }, + "protocol": { + "$id": "4020", + "kind": "string", + "type": { + "$ref": "114" + }, + "value": "WebSockets" + }, + "tls": { + "$id": "4021", + "kind": "model", + "type": { + "$ref": "1160" + }, + "value": { + "$id": "4022", + "mode": { + "$id": "4023", + "kind": "string", + "type": { + "$ref": "232" + }, + "value": "Automatic" + }, + "certManagerCertificateSpec": { + "$id": "4024", + "kind": "model", + "type": { + "$ref": "1165" + }, + "value": { + "$id": "4025", + "issuerRef": { + "$id": "4026", + "kind": "model", + "type": { + "$ref": "1179" + }, + "value": { + "$id": "4027", + "group": { + "$id": "4028", + "kind": "string", + "type": { + "$ref": "1181" + }, + "value": "jtmuladdkpasfpoyvewekmiy" + }, + "name": { + "$id": "4029", + "kind": "string", + "type": { + "$ref": "1188" + }, + "value": "example-issuer" + }, + "kind": { + "$id": "4030", + "kind": "string", + "type": { + "$ref": "238" + }, + "value": "Issuer" + } + } + } + } + } + } + } + } + }, + { + "$id": "4031", + "kind": "model", + "type": { + "$ref": "1139" + }, + "value": { + "$id": "4032", + "port": { + "$id": "4033", + "kind": "number", + "type": { + "$ref": "1153" + }, + "value": 1883 + }, + "authenticationRef": { + "$id": "4034", + "kind": "string", + "type": { + "$ref": "1141" + }, + "value": "example-authentication" + } + } + }, + { + "$id": "4035", + "kind": "model", + "type": { + "$ref": "1139" + }, + "value": { + "$id": "4036", + "port": { + "$id": "4037", + "kind": "number", + "type": { + "$ref": "1153" + }, + "value": 8883 + }, + "authenticationRef": { + "$id": "4038", + "kind": "string", + "type": { + "$ref": "1141" + }, + "value": "example-authentication" + }, + "tls": { + "$id": "4039", + "kind": "model", + "type": { + "$ref": "1160" + }, + "value": { + "$id": "4040", + "mode": { + "$id": "4041", + "kind": "string", + "type": { + "$ref": "232" + }, + "value": "Manual" + }, + "manual": { + "$id": "4042", + "kind": "model", + "type": { + "$ref": "1052" + }, + "value": { + "$id": "4043", + "secretRef": { + "$id": "4044", + "kind": "string", + "type": { + "$ref": "1054" + }, + "value": "example-secret" + } + } + } + } + } + } + } + ] + } + } + }, + "extendedLocation": { + "$id": "4045", + "kind": "model", + "type": { + "$ref": "669" + }, + "value": { + "$id": "4046", + "name": { + "$id": "4047", + "kind": "string", + "type": { + "$ref": "671" + }, + "value": "qmbrfwcpwwhggszhrdjv" + }, + "type": { + "$id": "4048", + "kind": "string", + "type": { + "$ref": "142" + }, + "value": "CustomLocation" + } + } + } + } + } + } + ], + "responses": [ + { + "$id": "4049", + "response": { + "$ref": "3983" + }, + "statusCode": 200, + "bodyValue": { + "$id": "4050", + "kind": "model", + "type": { + "$ref": "1130" + }, + "value": { + "$id": "4051", + "properties": { + "$id": "4052", + "kind": "model", + "type": { + "$ref": "1132" + }, + "value": { + "$id": "4053", + "serviceName": { + "$id": "4054", + "kind": "string", + "type": { + "$ref": "1134" + }, + "value": "tpfiszlapdpxktx" + }, + "serviceType": { + "$id": "4055", + "kind": "string", + "type": { + "$ref": "266" + }, + "value": "LoadBalancer" + }, + "ports": { + "$id": "4056", + "kind": "array", + "type": { + "$ref": "1138" + }, + "value": [ + { + "$id": "4057", + "kind": "model", + "type": { + "$ref": "1139" + }, + "value": { + "$id": "4058", + "port": { + "$id": "4059", + "kind": "number", + "type": { + "$ref": "1153" + }, + "value": 8080 + }, + "authenticationRef": { + "$id": "4060", + "kind": "string", + "type": { + "$ref": "1141" + }, + "value": "example-authentication" + }, + "protocol": { + "$id": "4061", + "kind": "string", + "type": { + "$ref": "114" + }, + "value": "WebSockets" + } + } + }, + { + "$id": "4062", + "kind": "model", + "type": { + "$ref": "1139" + }, + "value": { + "$id": "4063", + "port": { + "$id": "4064", + "kind": "number", + "type": { + "$ref": "1153" + }, + "value": 8443 + }, + "authenticationRef": { + "$id": "4065", + "kind": "string", + "type": { + "$ref": "1141" + }, + "value": "example-authentication" + }, + "protocol": { + "$id": "4066", + "kind": "string", + "type": { + "$ref": "114" + }, + "value": "WebSockets" + }, + "tls": { + "$id": "4067", + "kind": "model", + "type": { + "$ref": "1160" + }, + "value": { + "$id": "4068", + "mode": { + "$id": "4069", + "kind": "string", + "type": { + "$ref": "232" + }, + "value": "Automatic" + }, + "certManagerCertificateSpec": { + "$id": "4070", + "kind": "model", + "type": { + "$ref": "1165" + }, + "value": { + "$id": "4071", + "issuerRef": { + "$id": "4072", + "kind": "model", + "type": { + "$ref": "1179" + }, + "value": { + "$id": "4073", + "group": { + "$id": "4074", + "kind": "string", + "type": { + "$ref": "1181" + }, + "value": "jtmuladdkpasfpoyvewekmiy" + }, + "name": { + "$id": "4075", + "kind": "string", + "type": { + "$ref": "1188" + }, + "value": "example-issuer" + }, + "kind": { + "$id": "4076", + "kind": "string", + "type": { + "$ref": "238" + }, + "value": "Issuer" + } + } + } + } + } + } + } + } + }, + { + "$id": "4077", + "kind": "model", + "type": { + "$ref": "1139" + }, + "value": { + "$id": "4078", + "port": { + "$id": "4079", + "kind": "number", + "type": { + "$ref": "1153" + }, + "value": 1883 + }, + "authenticationRef": { + "$id": "4080", + "kind": "string", + "type": { + "$ref": "1141" + }, + "value": "example-authentication" + } + } + }, + { + "$id": "4081", + "kind": "model", + "type": { + "$ref": "1139" + }, + "value": { + "$id": "4082", + "port": { + "$id": "4083", + "kind": "number", + "type": { + "$ref": "1153" + }, + "value": 8883 + }, + "authenticationRef": { + "$id": "4084", + "kind": "string", + "type": { + "$ref": "1141" + }, + "value": "example-authentication" + }, + "tls": { + "$id": "4085", + "kind": "model", + "type": { + "$ref": "1160" + }, + "value": { + "$id": "4086", + "mode": { + "$id": "4087", + "kind": "string", + "type": { + "$ref": "232" + }, + "value": "Manual" + }, + "manual": { + "$id": "4088", + "kind": "model", + "type": { + "$ref": "1052" + }, + "value": { + "$id": "4089", + "secretRef": { + "$id": "4090", + "kind": "string", + "type": { + "$ref": "1054" + }, + "value": "example-secret" + } + } + } + } + } + } + } + ] + }, + "provisioningState": { + "$id": "4091", + "kind": "string", + "type": { + "$ref": "126" + }, + "value": "Succeeded" + } + } + }, + "extendedLocation": { + "$id": "4092", + "kind": "model", + "type": { + "$ref": "669" + }, + "value": { + "$id": "4093", + "name": { + "$id": "4094", + "kind": "string", + "type": { + "$ref": "671" + }, + "value": "qmbrfwcpwwhggszhrdjv" + }, + "type": { + "$id": "4095", + "kind": "string", + "type": { + "$ref": "142" + }, + "value": "CustomLocation" + } + } + }, + "id": { + "$id": "4096", + "kind": "string", + "type": { + "$ref": "330" + }, + "value": "/subscriptions/0000000-0000-0000-0000-000000000000/resourceGroups/resourceGroup123/providers/Microsoft.IoTOperations/instances/resource-name123/brokers/resource-name123/listeners/resource-name123" + }, + "name": { + "$id": "4097", + "kind": "string", + "type": { + "$ref": "335" + }, + "value": "hoqjaachratt" + }, + "type": { + "$id": "4098", + "kind": "string", + "type": { + "$ref": "339" + }, + "value": "hizbknwegcdaeh" + }, + "systemData": { + "$id": "4099", + "kind": "model", + "type": { + "$ref": "344" + }, + "value": { + "$id": "4100", + "createdBy": { + "$id": "4101", + "kind": "string", + "type": { + "$ref": "346" + }, + "value": "ssvaslsmudloholronopqyxjcu" + }, + "createdByType": { + "$id": "4102", + "kind": "string", + "type": { + "$ref": "146" + }, + "value": "User" + }, + "createdAt": { + "$id": "4103", + "kind": "string", + "type": { + "$ref": "353" + }, + "value": "2024-08-09T18:13:29.389Z" + }, + "lastModifiedBy": { + "$id": "4104", + "kind": "string", + "type": { + "$ref": "358" + }, + "value": "gnicpuszwd" + }, + "lastModifiedByType": { + "$id": "4105", + "kind": "string", + "type": { + "$ref": "146" + }, + "value": "User" + }, + "lastModifiedAt": { + "$id": "4106", + "kind": "string", + "type": { + "$ref": "365" + }, + "value": "2024-08-09T18:13:29.389Z" + } + } + } + } + } + }, + { + "$id": "4107", + "response": { + "$ref": "3984" + }, + "statusCode": 201, + "bodyValue": { + "$id": "4108", + "kind": "model", + "type": { + "$ref": "1130" + }, + "value": { + "$id": "4109", + "properties": { + "$id": "4110", + "kind": "model", + "type": { + "$ref": "1132" + }, + "value": { + "$id": "4111", + "serviceName": { + "$id": "4112", + "kind": "string", + "type": { + "$ref": "1134" + }, + "value": "tpfiszlapdpxktx" + }, + "serviceType": { + "$id": "4113", + "kind": "string", + "type": { + "$ref": "266" + }, + "value": "LoadBalancer" + }, + "ports": { + "$id": "4114", + "kind": "array", + "type": { + "$ref": "1138" + }, + "value": [ + { + "$id": "4115", + "kind": "model", + "type": { + "$ref": "1139" + }, + "value": { + "$id": "4116", + "port": { + "$id": "4117", + "kind": "number", + "type": { + "$ref": "1153" + }, + "value": 8080 + }, + "authenticationRef": { + "$id": "4118", + "kind": "string", + "type": { + "$ref": "1141" + }, + "value": "example-authentication" + }, + "protocol": { + "$id": "4119", + "kind": "string", + "type": { + "$ref": "114" + }, + "value": "WebSockets" + } + } + }, + { + "$id": "4120", + "kind": "model", + "type": { + "$ref": "1139" + }, + "value": { + "$id": "4121", + "port": { + "$id": "4122", + "kind": "number", + "type": { + "$ref": "1153" + }, + "value": 8443 + }, + "authenticationRef": { + "$id": "4123", + "kind": "string", + "type": { + "$ref": "1141" + }, + "value": "example-authentication" + }, + "protocol": { + "$id": "4124", + "kind": "string", + "type": { + "$ref": "114" + }, + "value": "WebSockets" + }, + "tls": { + "$id": "4125", + "kind": "model", + "type": { + "$ref": "1160" + }, + "value": { + "$id": "4126", + "mode": { + "$id": "4127", + "kind": "string", + "type": { + "$ref": "232" + }, + "value": "Automatic" + }, + "certManagerCertificateSpec": { + "$id": "4128", + "kind": "model", + "type": { + "$ref": "1165" + }, + "value": { + "$id": "4129", + "issuerRef": { + "$id": "4130", + "kind": "model", + "type": { + "$ref": "1179" + }, + "value": { + "$id": "4131", + "group": { + "$id": "4132", + "kind": "string", + "type": { + "$ref": "1181" + }, + "value": "jtmuladdkpasfpoyvewekmiy" + }, + "name": { + "$id": "4133", + "kind": "string", + "type": { + "$ref": "1188" + }, + "value": "example-issuer" + }, + "kind": { + "$id": "4134", + "kind": "string", + "type": { + "$ref": "238" + }, + "value": "Issuer" + } + } + } + } + } + } + } + } + }, + { + "$id": "4135", + "kind": "model", + "type": { + "$ref": "1139" + }, + "value": { + "$id": "4136", + "port": { + "$id": "4137", + "kind": "number", + "type": { + "$ref": "1153" + }, + "value": 1883 + }, + "authenticationRef": { + "$id": "4138", + "kind": "string", + "type": { + "$ref": "1141" + }, + "value": "example-authentication" + } + } + }, + { + "$id": "4139", + "kind": "model", + "type": { + "$ref": "1139" + }, + "value": { + "$id": "4140", + "port": { + "$id": "4141", + "kind": "number", + "type": { + "$ref": "1153" + }, + "value": 8883 + }, + "authenticationRef": { + "$id": "4142", + "kind": "string", + "type": { + "$ref": "1141" + }, + "value": "example-authentication" + }, + "tls": { + "$id": "4143", + "kind": "model", + "type": { + "$ref": "1160" + }, + "value": { + "$id": "4144", + "mode": { + "$id": "4145", + "kind": "string", + "type": { + "$ref": "232" + }, + "value": "Manual" + }, + "manual": { + "$id": "4146", + "kind": "model", + "type": { + "$ref": "1052" + }, + "value": { + "$id": "4147", + "secretRef": { + "$id": "4148", + "kind": "string", + "type": { + "$ref": "1054" + }, + "value": "example-secret" + } + } + } + } + } + } + } + ] + }, + "provisioningState": { + "$id": "4149", + "kind": "string", + "type": { + "$ref": "126" + }, + "value": "Succeeded" + } + } + }, + "extendedLocation": { + "$id": "4150", + "kind": "model", + "type": { + "$ref": "669" + }, + "value": { + "$id": "4151", + "name": { + "$id": "4152", + "kind": "string", + "type": { + "$ref": "671" + }, + "value": "qmbrfwcpwwhggszhrdjv" + }, + "type": { + "$id": "4153", + "kind": "string", + "type": { + "$ref": "142" + }, + "value": "CustomLocation" + } + } + }, + "id": { + "$id": "4154", + "kind": "string", + "type": { + "$ref": "330" + }, + "value": "/subscriptions/0000000-0000-0000-0000-000000000000/resourceGroups/resourceGroup123/providers/Microsoft.IoTOperations/instances/resource-name123/brokers/resource-name123/listeners/resource-name123" + }, + "name": { + "$id": "4155", + "kind": "string", + "type": { + "$ref": "335" + }, + "value": "hoqjaachratt" + }, + "type": { + "$id": "4156", + "kind": "string", + "type": { + "$ref": "339" + }, + "value": "hizbknwegcdaeh" + }, + "systemData": { + "$id": "4157", + "kind": "model", + "type": { + "$ref": "344" + }, + "value": { + "$id": "4158", + "createdBy": { + "$id": "4159", + "kind": "string", + "type": { + "$ref": "346" + }, + "value": "ssvaslsmudloholronopqyxjcu" + }, + "createdByType": { + "$id": "4160", + "kind": "string", + "type": { + "$ref": "146" + }, + "value": "User" + }, + "createdAt": { + "$id": "4161", + "kind": "string", + "type": { + "$ref": "353" + }, + "value": "2024-08-09T18:13:29.389Z" + }, + "lastModifiedBy": { + "$id": "4162", + "kind": "string", + "type": { + "$ref": "358" + }, + "value": "gnicpuszwd" + }, + "lastModifiedByType": { + "$id": "4163", + "kind": "string", + "type": { + "$ref": "146" + }, + "value": "User" + }, + "lastModifiedAt": { + "$id": "4164", + "kind": "string", + "type": { + "$ref": "365" + }, + "value": "2024-08-09T18:13:29.389Z" + } + } + } + } + } + } + ] + }, + { + "$id": "4165", + "kind": "http", + "name": "BrokerListener_CreateOrUpdate", + "description": "BrokerListener_CreateOrUpdate", + "filePath": "2024-11-01/BrokerListener_CreateOrUpdate_MaximumSet_Gen.json", + "parameters": [ + { + "$id": "4166", + "parameter": { + "$ref": "3961" + }, + "value": { + "$id": "4167", + "kind": "string", + "type": { + "$ref": "3962" + }, + "value": "2024-11-01" + } + }, + { + "$id": "4168", + "parameter": { + "$ref": "3965" + }, + "value": { + "$id": "4169", + "kind": "string", + "type": { + "$ref": "3966" + }, + "value": "F8C729F9-DF9C-4743-848F-96EE433D8E53" + } + }, + { + "$id": "4170", + "parameter": { + "$ref": "3968" + }, + "value": { + "$id": "4171", + "kind": "string", + "type": { + "$ref": "3969" + }, + "value": "rgiotoperations" + } + }, + { + "$id": "4172", + "parameter": { + "$ref": "3970" + }, + "value": { + "$id": "4173", + "kind": "string", + "type": { + "$ref": "3971" + }, + "value": "resource-name123" + } + }, + { + "$id": "4174", + "parameter": { + "$ref": "3972" + }, + "value": { + "$id": "4175", + "kind": "string", + "type": { + "$ref": "3973" + }, + "value": "resource-name123" + } + }, + { + "$id": "4176", + "parameter": { + "$ref": "3974" + }, + "value": { + "$id": "4177", + "kind": "string", + "type": { + "$ref": "3975" + }, + "value": "resource-name123" + } + }, + { + "$id": "4178", + "parameter": { + "$ref": "3982" + }, + "value": { + "$id": "4179", + "kind": "model", + "type": { + "$ref": "1130" + }, + "value": { + "$id": "4180", + "properties": { + "$id": "4181", + "kind": "model", + "type": { + "$ref": "1132" + }, + "value": { + "$id": "4182", + "serviceName": { + "$id": "4183", + "kind": "string", + "type": { + "$ref": "1134" + }, + "value": "tpfiszlapdpxktx" + }, + "ports": { + "$id": "4184", + "kind": "array", + "type": { + "$ref": "1138" + }, + "value": [ + { + "$id": "4185", + "kind": "model", + "type": { + "$ref": "1139" + }, + "value": { + "$id": "4186", + "authenticationRef": { + "$id": "4187", + "kind": "string", + "type": { + "$ref": "1141" + }, + "value": "tjvdroaqqy" + }, + "authorizationRef": { + "$id": "4188", + "kind": "string", + "type": { + "$ref": "1145" + }, + "value": "inxhvxnwswyrvt" + }, + "nodePort": { + "$id": "4189", + "kind": "number", + "type": { + "$ref": "1149" + }, + "value": 7281 + }, + "port": { + "$id": "4190", + "kind": "number", + "type": { + "$ref": "1153" + }, + "value": 1268 + }, + "protocol": { + "$id": "4191", + "kind": "string", + "type": { + "$ref": "114" + }, + "value": "Mqtt" + }, + "tls": { + "$id": "4192", + "kind": "model", + "type": { + "$ref": "1160" + }, + "value": { + "$id": "4193", + "mode": { + "$id": "4194", + "kind": "string", + "type": { + "$ref": "232" + }, + "value": "Automatic" + }, + "certManagerCertificateSpec": { + "$id": "4195", + "kind": "model", + "type": { + "$ref": "1165" + }, + "value": { + "$id": "4196", + "duration": { + "$id": "4197", + "kind": "string", + "type": { + "$ref": "1167" + }, + "value": "qmpeffoksron" + }, + "secretName": { + "$id": "4198", + "kind": "string", + "type": { + "$ref": "1171" + }, + "value": "oagi" + }, + "renewBefore": { + "$id": "4199", + "kind": "string", + "type": { + "$ref": "1175" + }, + "value": "hutno" + }, + "issuerRef": { + "$id": "4200", + "kind": "model", + "type": { + "$ref": "1179" + }, + "value": { + "$id": "4201", + "group": { + "$id": "4202", + "kind": "string", + "type": { + "$ref": "1181" + }, + "value": "jtmuladdkpasfpoyvewekmiy" + }, + "kind": { + "$id": "4203", + "kind": "string", + "type": { + "$ref": "238" + }, + "value": "Issuer" + }, + "name": { + "$id": "4204", + "kind": "string", + "type": { + "$ref": "1188" + }, + "value": "ocwoqpgucvjrsuudtjhb" + } + } + }, + "privateKey": { + "$id": "4205", + "kind": "model", + "type": { + "$ref": "1194" + }, + "value": { + "$id": "4206", + "algorithm": { + "$id": "4207", + "kind": "string", + "type": { + "$ref": "244" + }, + "value": "Ec256" + }, + "rotationPolicy": { + "$id": "4208", + "kind": "string", + "type": { + "$ref": "260" + }, + "value": "Always" + } + } + }, + "san": { + "$id": "4209", + "kind": "model", + "type": { + "$ref": "1204" + }, + "value": { + "$id": "4210", + "dns": { + "$id": "4211", + "kind": "array", + "type": { + "$ref": "1206" + }, + "value": [ + { + "$id": "4212", + "kind": "string", + "type": { + "$ref": "1207" + }, + "value": "xhvmhrrhgfsapocjeebqtnzarlj" + } + ] + }, + "ip": { + "$id": "4213", + "kind": "array", + "type": { + "$ref": "1211" + }, + "value": [ + { + "$id": "4214", + "kind": "string", + "type": { + "$ref": "1212" + }, + "value": "zbgugfzcgsmegevzktsnibyuyp" + } + ] + } + } + } + } + }, + "manual": { + "$id": "4215", + "kind": "model", + "type": { + "$ref": "1052" + }, + "value": { + "$id": "4216", + "secretRef": { + "$id": "4217", + "kind": "string", + "type": { + "$ref": "1054" + }, + "value": "secret-name" + } + } + } + } + } + } + } + ] + }, + "serviceType": { + "$id": "4218", + "kind": "string", + "type": { + "$ref": "266" + }, + "value": "ClusterIp" + } + } + }, + "extendedLocation": { + "$id": "4219", + "kind": "model", + "type": { + "$ref": "669" + }, + "value": { + "$id": "4220", + "name": { + "$id": "4221", + "kind": "string", + "type": { + "$ref": "671" + }, + "value": "qmbrfwcpwwhggszhrdjv" + }, + "type": { + "$id": "4222", + "kind": "string", + "type": { + "$ref": "142" + }, + "value": "CustomLocation" + } + } + } + } + } + } + ], + "responses": [ + { + "$id": "4223", + "response": { + "$ref": "3983" + }, + "statusCode": 200, + "bodyValue": { + "$id": "4224", + "kind": "model", + "type": { + "$ref": "1130" + }, + "value": { + "$id": "4225", + "properties": { + "$id": "4226", + "kind": "model", + "type": { + "$ref": "1132" + }, + "value": { + "$id": "4227", + "serviceName": { + "$id": "4228", + "kind": "string", + "type": { + "$ref": "1134" + }, + "value": "tpfiszlapdpxktx" + }, + "ports": { + "$id": "4229", + "kind": "array", + "type": { + "$ref": "1138" + }, + "value": [ + { + "$id": "4230", + "kind": "model", + "type": { + "$ref": "1139" + }, + "value": { + "$id": "4231", + "authenticationRef": { + "$id": "4232", + "kind": "string", + "type": { + "$ref": "1141" + }, + "value": "tjvdroaqqy" + }, + "authorizationRef": { + "$id": "4233", + "kind": "string", + "type": { + "$ref": "1145" + }, + "value": "inxhvxnwswyrvt" + }, + "nodePort": { + "$id": "4234", + "kind": "number", + "type": { + "$ref": "1149" + }, + "value": 7281 + }, + "port": { + "$id": "4235", + "kind": "number", + "type": { + "$ref": "1153" + }, + "value": 1268 + }, + "protocol": { + "$id": "4236", + "kind": "string", + "type": { + "$ref": "114" + }, + "value": "Mqtt" + }, + "tls": { + "$id": "4237", + "kind": "model", + "type": { + "$ref": "1160" + }, + "value": { + "$id": "4238", + "mode": { + "$id": "4239", + "kind": "string", + "type": { + "$ref": "232" + }, + "value": "Automatic" + }, + "certManagerCertificateSpec": { + "$id": "4240", + "kind": "model", + "type": { + "$ref": "1165" + }, + "value": { + "$id": "4241", + "duration": { + "$id": "4242", + "kind": "string", + "type": { + "$ref": "1167" + }, + "value": "qmpeffoksron" + }, + "secretName": { + "$id": "4243", + "kind": "string", + "type": { + "$ref": "1171" + }, + "value": "oagi" + }, + "renewBefore": { + "$id": "4244", + "kind": "string", + "type": { + "$ref": "1175" + }, + "value": "hutno" + }, + "issuerRef": { + "$id": "4245", + "kind": "model", + "type": { + "$ref": "1179" + }, + "value": { + "$id": "4246", + "group": { + "$id": "4247", + "kind": "string", + "type": { + "$ref": "1181" + }, + "value": "jtmuladdkpasfpoyvewekmiy" + }, + "kind": { + "$id": "4248", + "kind": "string", + "type": { + "$ref": "238" + }, + "value": "Issuer" + }, + "name": { + "$id": "4249", + "kind": "string", + "type": { + "$ref": "1188" + }, + "value": "ocwoqpgucvjrsuudtjhb" + } + } + }, + "privateKey": { + "$id": "4250", + "kind": "model", + "type": { + "$ref": "1194" + }, + "value": { + "$id": "4251", + "algorithm": { + "$id": "4252", + "kind": "string", + "type": { + "$ref": "244" + }, + "value": "Ec256" + }, + "rotationPolicy": { + "$id": "4253", + "kind": "string", + "type": { + "$ref": "260" + }, + "value": "Always" + } + } + }, + "san": { + "$id": "4254", + "kind": "model", + "type": { + "$ref": "1204" + }, + "value": { + "$id": "4255", + "dns": { + "$id": "4256", + "kind": "array", + "type": { + "$ref": "1206" + }, + "value": [ + { + "$id": "4257", + "kind": "string", + "type": { + "$ref": "1207" + }, + "value": "xhvmhrrhgfsapocjeebqtnzarlj" + } + ] + }, + "ip": { + "$id": "4258", + "kind": "array", + "type": { + "$ref": "1211" + }, + "value": [ + { + "$id": "4259", + "kind": "string", + "type": { + "$ref": "1212" + }, + "value": "zbgugfzcgsmegevzktsnibyuyp" + } + ] + } + } + } + } + }, + "manual": { + "$id": "4260", + "kind": "model", + "type": { + "$ref": "1052" + }, + "value": { + "$id": "4261", + "secretRef": { + "$id": "4262", + "kind": "string", + "type": { + "$ref": "1054" + }, + "value": "secret-name" + } + } + } + } + } + } + } + ] + }, + "serviceType": { + "$id": "4263", + "kind": "string", + "type": { + "$ref": "266" + }, + "value": "ClusterIp" + }, + "provisioningState": { + "$id": "4264", + "kind": "string", + "type": { + "$ref": "126" + }, + "value": "Succeeded" + } + } + }, + "extendedLocation": { + "$id": "4265", + "kind": "model", + "type": { + "$ref": "669" + }, + "value": { + "$id": "4266", + "name": { + "$id": "4267", + "kind": "string", + "type": { + "$ref": "671" + }, + "value": "qmbrfwcpwwhggszhrdjv" + }, + "type": { + "$id": "4268", + "kind": "string", + "type": { + "$ref": "142" + }, + "value": "CustomLocation" + } + } + }, + "id": { + "$id": "4269", + "kind": "string", + "type": { + "$ref": "330" + }, + "value": "/subscriptions/0000000-0000-0000-0000-000000000000/resourceGroups/resourceGroup123/providers/Microsoft.IoTOperations/instances/resource-name123/brokers/resource-name123/listeners/resource-name123" + }, + "name": { + "$id": "4270", + "kind": "string", + "type": { + "$ref": "335" + }, + "value": "hoqjaachratt" + }, + "type": { + "$id": "4271", + "kind": "string", + "type": { + "$ref": "339" + }, + "value": "hizbknwegcdaeh" + }, + "systemData": { + "$id": "4272", + "kind": "model", + "type": { + "$ref": "344" + }, + "value": { + "$id": "4273", + "createdBy": { + "$id": "4274", + "kind": "string", + "type": { + "$ref": "346" + }, + "value": "ssvaslsmudloholronopqyxjcu" + }, + "createdByType": { + "$id": "4275", + "kind": "string", + "type": { + "$ref": "146" + }, + "value": "User" + }, + "createdAt": { + "$id": "4276", + "kind": "string", + "type": { + "$ref": "353" + }, + "value": "2024-08-09T18:13:29.389Z" + }, + "lastModifiedBy": { + "$id": "4277", + "kind": "string", + "type": { + "$ref": "358" + }, + "value": "gnicpuszwd" + }, + "lastModifiedByType": { + "$id": "4278", + "kind": "string", + "type": { + "$ref": "146" + }, + "value": "User" + }, + "lastModifiedAt": { + "$id": "4279", + "kind": "string", + "type": { + "$ref": "365" + }, + "value": "2024-08-09T18:13:29.389Z" + } + } + } + } + } + }, + { + "$id": "4280", + "response": { + "$ref": "3984" + }, + "statusCode": 201, + "bodyValue": { + "$id": "4281", + "kind": "model", + "type": { + "$ref": "1130" + }, + "value": { + "$id": "4282", + "properties": { + "$id": "4283", + "kind": "model", + "type": { + "$ref": "1132" + }, + "value": { + "$id": "4284", + "serviceName": { + "$id": "4285", + "kind": "string", + "type": { + "$ref": "1134" + }, + "value": "tpfiszlapdpxktx" + }, + "ports": { + "$id": "4286", + "kind": "array", + "type": { + "$ref": "1138" + }, + "value": [ + { + "$id": "4287", + "kind": "model", + "type": { + "$ref": "1139" + }, + "value": { + "$id": "4288", + "authenticationRef": { + "$id": "4289", + "kind": "string", + "type": { + "$ref": "1141" + }, + "value": "tjvdroaqqy" + }, + "authorizationRef": { + "$id": "4290", + "kind": "string", + "type": { + "$ref": "1145" + }, + "value": "inxhvxnwswyrvt" + }, + "nodePort": { + "$id": "4291", + "kind": "number", + "type": { + "$ref": "1149" + }, + "value": 7281 + }, + "port": { + "$id": "4292", + "kind": "number", + "type": { + "$ref": "1153" + }, + "value": 1268 + }, + "protocol": { + "$id": "4293", + "kind": "string", + "type": { + "$ref": "114" + }, + "value": "Mqtt" + }, + "tls": { + "$id": "4294", + "kind": "model", + "type": { + "$ref": "1160" + }, + "value": { + "$id": "4295", + "mode": { + "$id": "4296", + "kind": "string", + "type": { + "$ref": "232" + }, + "value": "Automatic" + }, + "certManagerCertificateSpec": { + "$id": "4297", + "kind": "model", + "type": { + "$ref": "1165" + }, + "value": { + "$id": "4298", + "duration": { + "$id": "4299", + "kind": "string", + "type": { + "$ref": "1167" + }, + "value": "qmpeffoksron" + }, + "secretName": { + "$id": "4300", + "kind": "string", + "type": { + "$ref": "1171" + }, + "value": "oagi" + }, + "renewBefore": { + "$id": "4301", + "kind": "string", + "type": { + "$ref": "1175" + }, + "value": "hutno" + }, + "issuerRef": { + "$id": "4302", + "kind": "model", + "type": { + "$ref": "1179" + }, + "value": { + "$id": "4303", + "group": { + "$id": "4304", + "kind": "string", + "type": { + "$ref": "1181" + }, + "value": "jtmuladdkpasfpoyvewekmiy" + }, + "kind": { + "$id": "4305", + "kind": "string", + "type": { + "$ref": "238" + }, + "value": "Issuer" + }, + "name": { + "$id": "4306", + "kind": "string", + "type": { + "$ref": "1188" + }, + "value": "ocwoqpgucvjrsuudtjhb" + } + } + }, + "privateKey": { + "$id": "4307", + "kind": "model", + "type": { + "$ref": "1194" + }, + "value": { + "$id": "4308", + "algorithm": { + "$id": "4309", + "kind": "string", + "type": { + "$ref": "244" + }, + "value": "Ec256" + }, + "rotationPolicy": { + "$id": "4310", + "kind": "string", + "type": { + "$ref": "260" + }, + "value": "Always" + } + } + }, + "san": { + "$id": "4311", + "kind": "model", + "type": { + "$ref": "1204" + }, + "value": { + "$id": "4312", + "dns": { + "$id": "4313", + "kind": "array", + "type": { + "$ref": "1206" + }, + "value": [ + { + "$id": "4314", + "kind": "string", + "type": { + "$ref": "1207" + }, + "value": "xhvmhrrhgfsapocjeebqtnzarlj" + } + ] + }, + "ip": { + "$id": "4315", + "kind": "array", + "type": { + "$ref": "1211" + }, + "value": [ + { + "$id": "4316", + "kind": "string", + "type": { + "$ref": "1212" + }, + "value": "zbgugfzcgsmegevzktsnibyuyp" + } + ] + } + } + } + } + }, + "manual": { + "$id": "4317", + "kind": "model", + "type": { + "$ref": "1052" + }, + "value": { + "$id": "4318", + "secretRef": { + "$id": "4319", + "kind": "string", + "type": { + "$ref": "1054" + }, + "value": "secret-name" + } + } + } + } + } + } + } + ] + }, + "serviceType": { + "$id": "4320", + "kind": "string", + "type": { + "$ref": "266" + }, + "value": "ClusterIp" + }, + "provisioningState": { + "$id": "4321", + "kind": "string", + "type": { + "$ref": "126" + }, + "value": "Succeeded" + } + } + }, + "extendedLocation": { + "$id": "4322", + "kind": "model", + "type": { + "$ref": "669" + }, + "value": { + "$id": "4323", + "name": { + "$id": "4324", + "kind": "string", + "type": { + "$ref": "671" + }, + "value": "qmbrfwcpwwhggszhrdjv" + }, + "type": { + "$id": "4325", + "kind": "string", + "type": { + "$ref": "142" + }, + "value": "CustomLocation" + } + } + }, + "id": { + "$id": "4326", + "kind": "string", + "type": { + "$ref": "330" + }, + "value": "/subscriptions/0000000-0000-0000-0000-000000000000/resourceGroups/resourceGroup123/providers/Microsoft.IoTOperations/instances/resource-name123/brokers/resource-name123/listeners/resource-name123" + }, + "name": { + "$id": "4327", + "kind": "string", + "type": { + "$ref": "335" + }, + "value": "hoqjaachratt" + }, + "type": { + "$id": "4328", + "kind": "string", + "type": { + "$ref": "339" + }, + "value": "hizbknwegcdaeh" + }, + "systemData": { + "$id": "4329", + "kind": "model", + "type": { + "$ref": "344" + }, + "value": { + "$id": "4330", + "createdBy": { + "$id": "4331", + "kind": "string", + "type": { + "$ref": "346" + }, + "value": "ssvaslsmudloholronopqyxjcu" + }, + "createdByType": { + "$id": "4332", + "kind": "string", + "type": { + "$ref": "146" + }, + "value": "User" + }, + "createdAt": { + "$id": "4333", + "kind": "string", + "type": { + "$ref": "353" + }, + "value": "2024-08-09T18:13:29.389Z" + }, + "lastModifiedBy": { + "$id": "4334", + "kind": "string", + "type": { + "$ref": "358" + }, + "value": "gnicpuszwd" + }, + "lastModifiedByType": { + "$id": "4335", + "kind": "string", + "type": { + "$ref": "146" + }, + "value": "User" + }, + "lastModifiedAt": { + "$id": "4336", + "kind": "string", + "type": { + "$ref": "365" + }, + "value": "2024-08-09T18:13:29.389Z" + } + } + } + } + } + } + ] + }, + { + "$id": "4337", + "kind": "http", + "name": "BrokerListener_CreateOrUpdate_Simple", + "description": "BrokerListener_CreateOrUpdate_Simple", + "filePath": "2024-11-01/BrokerListener_CreateOrUpdate_Simple.json", + "parameters": [ + { + "$id": "4338", + "parameter": { + "$ref": "3961" + }, + "value": { + "$id": "4339", + "kind": "string", + "type": { + "$ref": "3962" + }, + "value": "2024-11-01" + } + }, + { + "$id": "4340", + "parameter": { + "$ref": "3965" + }, + "value": { + "$id": "4341", + "kind": "string", + "type": { + "$ref": "3966" + }, + "value": "F8C729F9-DF9C-4743-848F-96EE433D8E53" + } + }, + { + "$id": "4342", + "parameter": { + "$ref": "3968" + }, + "value": { + "$id": "4343", + "kind": "string", + "type": { + "$ref": "3969" + }, + "value": "rgiotoperations" + } + }, + { + "$id": "4344", + "parameter": { + "$ref": "3970" + }, + "value": { + "$id": "4345", + "kind": "string", + "type": { + "$ref": "3971" + }, + "value": "resource-name123" + } + }, + { + "$id": "4346", + "parameter": { + "$ref": "3972" + }, + "value": { + "$id": "4347", + "kind": "string", + "type": { + "$ref": "3973" + }, + "value": "resource-name123" + } + }, + { + "$id": "4348", + "parameter": { + "$ref": "3974" + }, + "value": { + "$id": "4349", + "kind": "string", + "type": { + "$ref": "3975" + }, + "value": "resource-name123" + } + }, + { + "$id": "4350", + "parameter": { + "$ref": "3982" + }, + "value": { + "$id": "4351", + "kind": "model", + "type": { + "$ref": "1130" + }, + "value": { + "$id": "4352", + "properties": { + "$id": "4353", + "kind": "model", + "type": { + "$ref": "1132" + }, + "value": { + "$id": "4354", + "ports": { + "$id": "4355", + "kind": "array", + "type": { + "$ref": "1138" + }, + "value": [ + { + "$id": "4356", + "kind": "model", + "type": { + "$ref": "1139" + }, + "value": { + "$id": "4357", + "port": { + "$id": "4358", + "kind": "number", + "type": { + "$ref": "1153" + }, + "value": 1883 + } + } + } + ] + } + } + }, + "extendedLocation": { + "$id": "4359", + "kind": "model", + "type": { + "$ref": "669" + }, + "value": { + "$id": "4360", + "name": { + "$id": "4361", + "kind": "string", + "type": { + "$ref": "671" + }, + "value": "qmbrfwcpwwhggszhrdjv" + }, + "type": { + "$id": "4362", + "kind": "string", + "type": { + "$ref": "142" + }, + "value": "CustomLocation" + } + } + } + } + } + } + ], + "responses": [ + { + "$id": "4363", + "response": { + "$ref": "3983" + }, + "statusCode": 200, + "bodyValue": { + "$id": "4364", + "kind": "model", + "type": { + "$ref": "1130" + }, + "value": { + "$id": "4365", + "properties": { + "$id": "4366", + "kind": "model", + "type": { + "$ref": "1132" + }, + "value": { + "$id": "4367", + "serviceName": { + "$id": "4368", + "kind": "string", + "type": { + "$ref": "1134" + }, + "value": "tpfiszlapdpxktx" + }, + "serviceType": { + "$id": "4369", + "kind": "string", + "type": { + "$ref": "266" + }, + "value": "LoadBalancer" + }, + "ports": { + "$id": "4370", + "kind": "array", + "type": { + "$ref": "1138" + }, + "value": [ + { + "$id": "4371", + "kind": "model", + "type": { + "$ref": "1139" + }, + "value": { + "$id": "4372", + "port": { + "$id": "4373", + "kind": "number", + "type": { + "$ref": "1153" + }, + "value": 1883 + } + } + } + ] + }, + "provisioningState": { + "$id": "4374", + "kind": "string", + "type": { + "$ref": "126" + }, + "value": "Succeeded" + } + } + }, + "extendedLocation": { + "$id": "4375", + "kind": "model", + "type": { + "$ref": "669" + }, + "value": { + "$id": "4376", + "name": { + "$id": "4377", + "kind": "string", + "type": { + "$ref": "671" + }, + "value": "qmbrfwcpwwhggszhrdjv" + }, + "type": { + "$id": "4378", + "kind": "string", + "type": { + "$ref": "142" + }, + "value": "CustomLocation" + } + } + }, + "id": { + "$id": "4379", + "kind": "string", + "type": { + "$ref": "330" + }, + "value": "/subscriptions/0000000-0000-0000-0000-000000000000/resourceGroups/resourceGroup123/providers/Microsoft.IoTOperations/instances/resource-name123/brokers/resource-name123/listeners/resource-name123" + }, + "name": { + "$id": "4380", + "kind": "string", + "type": { + "$ref": "335" + }, + "value": "hoqjaachratt" + }, + "type": { + "$id": "4381", + "kind": "string", + "type": { + "$ref": "339" + }, + "value": "hizbknwegcdaeh" + }, + "systemData": { + "$id": "4382", + "kind": "model", + "type": { + "$ref": "344" + }, + "value": { + "$id": "4383", + "createdBy": { + "$id": "4384", + "kind": "string", + "type": { + "$ref": "346" + }, + "value": "ssvaslsmudloholronopqyxjcu" + }, + "createdByType": { + "$id": "4385", + "kind": "string", + "type": { + "$ref": "146" + }, + "value": "User" + }, + "createdAt": { + "$id": "4386", + "kind": "string", + "type": { + "$ref": "353" + }, + "value": "2024-08-09T18:13:29.389Z" + }, + "lastModifiedBy": { + "$id": "4387", + "kind": "string", + "type": { + "$ref": "358" + }, + "value": "gnicpuszwd" + }, + "lastModifiedByType": { + "$id": "4388", + "kind": "string", + "type": { + "$ref": "146" + }, + "value": "User" + }, + "lastModifiedAt": { + "$id": "4389", + "kind": "string", + "type": { + "$ref": "365" + }, + "value": "2024-08-09T18:13:29.389Z" + } + } + } + } + } + }, + { + "$id": "4390", + "response": { + "$ref": "3984" + }, + "statusCode": 201, + "bodyValue": { + "$id": "4391", + "kind": "model", + "type": { + "$ref": "1130" + }, + "value": { + "$id": "4392", + "properties": { + "$id": "4393", + "kind": "model", + "type": { + "$ref": "1132" + }, + "value": { + "$id": "4394", + "serviceName": { + "$id": "4395", + "kind": "string", + "type": { + "$ref": "1134" + }, + "value": "tpfiszlapdpxktx" + }, + "serviceType": { + "$id": "4396", + "kind": "string", + "type": { + "$ref": "266" + }, + "value": "LoadBalancer" + }, + "ports": { + "$id": "4397", + "kind": "array", + "type": { + "$ref": "1138" + }, + "value": [ + { + "$id": "4398", + "kind": "model", + "type": { + "$ref": "1139" + }, + "value": { + "$id": "4399", + "port": { + "$id": "4400", + "kind": "number", + "type": { + "$ref": "1153" + }, + "value": 1883 + } + } + } + ] + }, + "provisioningState": { + "$id": "4401", + "kind": "string", + "type": { + "$ref": "126" + }, + "value": "Succeeded" + } + } + }, + "extendedLocation": { + "$id": "4402", + "kind": "model", + "type": { + "$ref": "669" + }, + "value": { + "$id": "4403", + "name": { + "$id": "4404", + "kind": "string", + "type": { + "$ref": "671" + }, + "value": "qmbrfwcpwwhggszhrdjv" + }, + "type": { + "$id": "4405", + "kind": "string", + "type": { + "$ref": "142" + }, + "value": "CustomLocation" + } + } + }, + "id": { + "$id": "4406", + "kind": "string", + "type": { + "$ref": "330" + }, + "value": "/subscriptions/0000000-0000-0000-0000-000000000000/resourceGroups/resourceGroup123/providers/Microsoft.IoTOperations/instances/resource-name123/brokers/resource-name123/listeners/resource-name123" + }, + "name": { + "$id": "4407", + "kind": "string", + "type": { + "$ref": "335" + }, + "value": "hoqjaachratt" + }, + "type": { + "$id": "4408", + "kind": "string", + "type": { + "$ref": "339" + }, + "value": "hizbknwegcdaeh" + }, + "systemData": { + "$id": "4409", + "kind": "model", + "type": { + "$ref": "344" + }, + "value": { + "$id": "4410", + "createdBy": { + "$id": "4411", + "kind": "string", + "type": { + "$ref": "346" + }, + "value": "ssvaslsmudloholronopqyxjcu" + }, + "createdByType": { + "$id": "4412", + "kind": "string", + "type": { + "$ref": "146" + }, + "value": "User" + }, + "createdAt": { + "$id": "4413", + "kind": "string", + "type": { + "$ref": "353" + }, + "value": "2024-08-09T18:13:29.389Z" + }, + "lastModifiedBy": { + "$id": "4414", + "kind": "string", + "type": { + "$ref": "358" + }, + "value": "gnicpuszwd" + }, + "lastModifiedByType": { + "$id": "4415", + "kind": "string", + "type": { + "$ref": "146" + }, + "value": "User" + }, + "lastModifiedAt": { + "$id": "4416", + "kind": "string", + "type": { + "$ref": "365" + }, + "value": "2024-08-09T18:13:29.389Z" + } + } + } + } + } + } + ] + } + ] + }, + { + "$id": "4417", + "Name": "delete", + "ResourceName": "BrokerListenerResource", + "Doc": "Delete a BrokerListenerResource", + "Accessibility": "public", + "Parameters": [ + { + "$id": "4418", + "Name": "apiVersion", + "NameInRequest": "api-version", + "Doc": "The API version to use for this operation.", + "Type": { + "$id": "4419", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": true, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "DefaultValue": { + "$id": "4420", + "Type": { + "$id": "4421", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "2024-11-01" + }, + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "4422", + "Name": "subscriptionId", + "NameInRequest": "subscriptionId", + "Doc": "The ID of the target subscription. The value must be an UUID.", + "Type": { + "$id": "4423", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "4424", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "4425", + "Name": "resourceGroupName", + "NameInRequest": "resourceGroupName", + "Doc": "The name of the resource group. The name is case insensitive.", + "Type": { + "$id": "4426", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "4427", + "Name": "instanceName", + "NameInRequest": "instanceName", + "Doc": "Name of instance.", + "Type": { + "$id": "4428", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "4429", + "Name": "brokerName", + "NameInRequest": "brokerName", + "Doc": "Name of broker.", + "Type": { + "$id": "4430", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "4431", + "Name": "listenerName", + "NameInRequest": "listenerName", + "Doc": "Name of Instance broker listener resource", + "Type": { + "$id": "4432", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "4433", + "Name": "accept", + "NameInRequest": "Accept", + "Type": { + "$id": "4434", + "kind": "constant", + "valueType": { + "$id": "4435", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "4436", + "StatusCodes": [ + 202 + ], + "BodyMediaType": "Json", + "Headers": [ + { + "$id": "4437", + "Name": "location", + "NameInResponse": "Location", + "Doc": "The Location header contains the URL where the status of the long running operation can be checked.", + "Type": { + "$id": "4438", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + } + }, + { + "$id": "4439", + "Name": "retryAfter", + "NameInResponse": "Retry-After", + "Doc": "The Retry-After header can indicate how long the client should wait before polling the operation status.", + "Type": { + "$id": "4440", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + } + } + ], + "IsErrorResponse": false + }, + { + "$id": "4441", + "StatusCodes": [ + 204 + ], + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false + } + ], + "HttpMethod": "DELETE", + "RequestBodyMediaType": "None", + "Uri": "{endpoint}", + "Path": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/brokers/{brokerName}/listeners/{listenerName}", + "BufferResponse": true, + "LongRunning": { + "$id": "4442", + "FinalStateVia": 1, + "FinalResponse": { + "$id": "4443", + "StatusCodes": [ + 204 + ], + "BodyMediaType": "Json" + } + }, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Microsoft.IoTOperations.BrokerListener.delete", + "Decorators": [], + "Examples": [ + { + "$id": "4444", + "kind": "http", + "name": "BrokerListener_Delete", + "description": "BrokerListener_Delete", + "filePath": "2024-11-01/BrokerListener_Delete_MaximumSet_Gen.json", + "parameters": [ + { + "$id": "4445", + "parameter": { + "$ref": "4418" + }, + "value": { + "$id": "4446", + "kind": "string", + "type": { + "$ref": "4419" + }, + "value": "2024-11-01" + } + }, + { + "$id": "4447", + "parameter": { + "$ref": "4422" + }, + "value": { + "$id": "4448", + "kind": "string", + "type": { + "$ref": "4423" + }, + "value": "F8C729F9-DF9C-4743-848F-96EE433D8E53" + } + }, + { + "$id": "4449", + "parameter": { + "$ref": "4425" + }, + "value": { + "$id": "4450", + "kind": "string", + "type": { + "$ref": "4426" + }, + "value": "rgiotoperations" + } + }, + { + "$id": "4451", + "parameter": { + "$ref": "4427" + }, + "value": { + "$id": "4452", + "kind": "string", + "type": { + "$ref": "4428" + }, + "value": "resource-name123" + } + }, + { + "$id": "4453", + "parameter": { + "$ref": "4429" + }, + "value": { + "$id": "4454", + "kind": "string", + "type": { + "$ref": "4430" + }, + "value": "resource-name123" + } + }, + { + "$id": "4455", + "parameter": { + "$ref": "4431" + }, + "value": { + "$id": "4456", + "kind": "string", + "type": { + "$ref": "4432" + }, + "value": "resource-name123" + } + } + ], + "responses": [ + { + "$id": "4457", + "response": { + "$ref": "4436" + }, + "statusCode": 202 + }, + { + "$id": "4458", + "response": { + "$ref": "4441" + }, + "statusCode": 204 + } + ] + } + ] + }, + { + "$id": "4459", + "Name": "listByResourceGroup", + "ResourceName": "BrokerListenerResource", + "Doc": "List BrokerListenerResource resources by BrokerResource", + "Accessibility": "public", + "Parameters": [ + { + "$id": "4460", + "Name": "apiVersion", + "NameInRequest": "api-version", + "Doc": "The API version to use for this operation.", + "Type": { + "$id": "4461", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": true, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "DefaultValue": { + "$id": "4462", + "Type": { + "$id": "4463", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "2024-11-01" + }, + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "4464", + "Name": "subscriptionId", + "NameInRequest": "subscriptionId", + "Doc": "The ID of the target subscription. The value must be an UUID.", + "Type": { + "$id": "4465", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "4466", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "4467", + "Name": "resourceGroupName", + "NameInRequest": "resourceGroupName", + "Doc": "The name of the resource group. The name is case insensitive.", + "Type": { + "$id": "4468", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "4469", + "Name": "instanceName", + "NameInRequest": "instanceName", + "Doc": "Name of instance.", + "Type": { + "$id": "4470", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "4471", + "Name": "brokerName", + "NameInRequest": "brokerName", + "Doc": "Name of broker.", + "Type": { + "$id": "4472", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "4473", + "Name": "accept", + "NameInRequest": "Accept", + "Type": { + "$id": "4474", + "kind": "constant", + "valueType": { + "$id": "4475", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "4476", + "StatusCodes": [ + 200 + ], + "BodyType": { + "$ref": "1237" + }, + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false, + "ContentTypes": [ + "application/json" + ] + } + ], + "HttpMethod": "GET", + "RequestBodyMediaType": "None", + "Uri": "{endpoint}", + "Path": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/brokers/{brokerName}/listeners", + "BufferResponse": true, + "Paging": { + "$id": "4477", + "ItemName": "value", + "NextLinkName": "nextLink" + }, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Microsoft.IoTOperations.BrokerListener.listByResourceGroup", + "Decorators": [], + "Examples": [ + { + "$id": "4478", + "kind": "http", + "name": "BrokerListener_ListByResourceGroup", + "description": "BrokerListener_ListByResourceGroup", + "filePath": "2024-11-01/BrokerListener_ListByResourceGroup_MaximumSet_Gen.json", + "parameters": [ + { + "$id": "4479", + "parameter": { + "$ref": "4460" + }, + "value": { + "$id": "4480", + "kind": "string", + "type": { + "$ref": "4461" + }, + "value": "2024-11-01" + } + }, + { + "$id": "4481", + "parameter": { + "$ref": "4464" + }, + "value": { + "$id": "4482", + "kind": "string", + "type": { + "$ref": "4465" + }, + "value": "F8C729F9-DF9C-4743-848F-96EE433D8E53" + } + }, + { + "$id": "4483", + "parameter": { + "$ref": "4467" + }, + "value": { + "$id": "4484", + "kind": "string", + "type": { + "$ref": "4468" + }, + "value": "rgiotoperations" + } + }, + { + "$id": "4485", + "parameter": { + "$ref": "4469" + }, + "value": { + "$id": "4486", + "kind": "string", + "type": { + "$ref": "4470" + }, + "value": "resource-name123" + } + }, + { + "$id": "4487", + "parameter": { + "$ref": "4471" + }, + "value": { + "$id": "4488", + "kind": "string", + "type": { + "$ref": "4472" + }, + "value": "resource-name123" + } + } + ], + "responses": [ + { + "$id": "4489", + "response": { + "$ref": "4476" + }, + "statusCode": 200, + "bodyValue": { + "$id": "4490", + "kind": "model", + "type": { + "$ref": "1237" + }, + "value": { + "$id": "4491", + "value": { + "$id": "4492", + "kind": "array", + "type": { + "$ref": "1239" + }, + "value": [ + { + "$id": "4493", + "kind": "model", + "type": { + "$ref": "1130" + }, + "value": { + "$id": "4494", + "properties": { + "$id": "4495", + "kind": "model", + "type": { + "$ref": "1132" + }, + "value": { + "$id": "4496", + "serviceName": { + "$id": "4497", + "kind": "string", + "type": { + "$ref": "1134" + }, + "value": "tpfiszlapdpxktx" + }, + "ports": { + "$id": "4498", + "kind": "array", + "type": { + "$ref": "1138" + }, + "value": [ + { + "$id": "4499", + "kind": "model", + "type": { + "$ref": "1139" + }, + "value": { + "$id": "4500", + "authenticationRef": { + "$id": "4501", + "kind": "string", + "type": { + "$ref": "1141" + }, + "value": "tjvdroaqqy" + }, + "authorizationRef": { + "$id": "4502", + "kind": "string", + "type": { + "$ref": "1145" + }, + "value": "inxhvxnwswyrvt" + }, + "nodePort": { + "$id": "4503", + "kind": "number", + "type": { + "$ref": "1149" + }, + "value": 7281 + }, + "port": { + "$id": "4504", + "kind": "number", + "type": { + "$ref": "1153" + }, + "value": 1268 + }, + "protocol": { + "$id": "4505", + "kind": "string", + "type": { + "$ref": "114" + }, + "value": "Mqtt" + }, + "tls": { + "$id": "4506", + "kind": "model", + "type": { + "$ref": "1160" + }, + "value": { + "$id": "4507", + "mode": { + "$id": "4508", + "kind": "string", + "type": { + "$ref": "232" + }, + "value": "Automatic" + }, + "certManagerCertificateSpec": { + "$id": "4509", + "kind": "model", + "type": { + "$ref": "1165" + }, + "value": { + "$id": "4510", + "duration": { + "$id": "4511", + "kind": "string", + "type": { + "$ref": "1167" + }, + "value": "qmpeffoksron" + }, + "secretName": { + "$id": "4512", + "kind": "string", + "type": { + "$ref": "1171" + }, + "value": "oagi" + }, + "renewBefore": { + "$id": "4513", + "kind": "string", + "type": { + "$ref": "1175" + }, + "value": "hutno" + }, + "issuerRef": { + "$id": "4514", + "kind": "model", + "type": { + "$ref": "1179" + }, + "value": { + "$id": "4515", + "group": { + "$id": "4516", + "kind": "string", + "type": { + "$ref": "1181" + }, + "value": "jtmuladdkpasfpoyvewekmiy" + }, + "kind": { + "$id": "4517", + "kind": "string", + "type": { + "$ref": "238" + }, + "value": "Issuer" + }, + "name": { + "$id": "4518", + "kind": "string", + "type": { + "$ref": "1188" + }, + "value": "ocwoqpgucvjrsuudtjhb" + } + } + }, + "privateKey": { + "$id": "4519", + "kind": "model", + "type": { + "$ref": "1194" + }, + "value": { + "$id": "4520", + "algorithm": { + "$id": "4521", + "kind": "string", + "type": { + "$ref": "244" + }, + "value": "Ec256" + }, + "rotationPolicy": { + "$id": "4522", + "kind": "string", + "type": { + "$ref": "260" + }, + "value": "Always" + } + } + }, + "san": { + "$id": "4523", + "kind": "model", + "type": { + "$ref": "1204" + }, + "value": { + "$id": "4524", + "dns": { + "$id": "4525", + "kind": "array", + "type": { + "$ref": "1206" + }, + "value": [ + { + "$id": "4526", + "kind": "string", + "type": { + "$ref": "1207" + }, + "value": "xhvmhrrhgfsapocjeebqtnzarlj" + } + ] + }, + "ip": { + "$id": "4527", + "kind": "array", + "type": { + "$ref": "1211" + }, + "value": [ + { + "$id": "4528", + "kind": "string", + "type": { + "$ref": "1212" + }, + "value": "zbgugfzcgsmegevzktsnibyuyp" + } + ] + } + } + } + } + }, + "manual": { + "$id": "4529", + "kind": "model", + "type": { + "$ref": "1052" + }, + "value": { + "$id": "4530", + "secretRef": { + "$id": "4531", + "kind": "string", + "type": { + "$ref": "1054" + }, + "value": "secret-name" + } + } + } + } + } + } + } + ] + }, + "serviceType": { + "$id": "4532", + "kind": "string", + "type": { + "$ref": "266" + }, + "value": "ClusterIp" + }, + "provisioningState": { + "$id": "4533", + "kind": "string", + "type": { + "$ref": "126" + }, + "value": "Succeeded" + } + } + }, + "extendedLocation": { + "$id": "4534", + "kind": "model", + "type": { + "$ref": "669" + }, + "value": { + "$id": "4535", + "name": { + "$id": "4536", + "kind": "string", + "type": { + "$ref": "671" + }, + "value": "qmbrfwcpwwhggszhrdjv" + }, + "type": { + "$id": "4537", + "kind": "string", + "type": { + "$ref": "142" + }, + "value": "CustomLocation" + } + } + }, + "id": { + "$id": "4538", + "kind": "string", + "type": { + "$ref": "330" + }, + "value": "/subscriptions/0000000-0000-0000-0000-000000000000/resourceGroups/resourceGroup123/providers/Microsoft.IoTOperations/instances/resource-name123/brokers/resource-name123/listeners/resource-name123" + }, + "name": { + "$id": "4539", + "kind": "string", + "type": { + "$ref": "335" + }, + "value": "hoqjaachratt" + }, + "type": { + "$id": "4540", + "kind": "string", + "type": { + "$ref": "339" + }, + "value": "hizbknwegcdaeh" + }, + "systemData": { + "$id": "4541", + "kind": "model", + "type": { + "$ref": "344" + }, + "value": { + "$id": "4542", + "createdBy": { + "$id": "4543", + "kind": "string", + "type": { + "$ref": "346" + }, + "value": "ssvaslsmudloholronopqyxjcu" + }, + "createdByType": { + "$id": "4544", + "kind": "string", + "type": { + "$ref": "146" + }, + "value": "User" + }, + "createdAt": { + "$id": "4545", + "kind": "string", + "type": { + "$ref": "353" + }, + "value": "2024-08-09T18:13:29.389Z" + }, + "lastModifiedBy": { + "$id": "4546", + "kind": "string", + "type": { + "$ref": "358" + }, + "value": "gnicpuszwd" + }, + "lastModifiedByType": { + "$id": "4547", + "kind": "string", + "type": { + "$ref": "146" + }, + "value": "User" + }, + "lastModifiedAt": { + "$id": "4548", + "kind": "string", + "type": { + "$ref": "365" + }, + "value": "2024-08-09T18:13:29.389Z" + } + } + } + } + } + ] + }, + "nextLink": { + "$id": "4549", + "kind": "string", + "type": { + "$ref": "1243" + }, + "value": "https://microsoft.com/a" + } + } + } + } + ] + } + ] + } + ], + "Protocol": { + "$id": "4550" + }, + "Parent": "IoTOperationsClient", + "Parameters": [ + { + "$id": "4551", + "Name": "endpoint", + "NameInRequest": "endpoint", + "Doc": "Service host", + "Type": { + "$id": "4552", + "kind": "url", + "name": "url", + "crossLanguageDefinitionId": "TypeSpec.url" + }, + "Location": "Uri", + "IsApiVersion": false, + "IsResourceParameter": false, + "IsContentType": false, + "IsRequired": true, + "IsEndpoint": true, + "SkipUrlEncoding": false, + "Explode": false, + "Kind": "Client", + "DefaultValue": { + "$id": "4553", + "Type": { + "$id": "4554", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "https://management.azure.com" + } + } + ], + "Decorators": [] + }, + { + "$id": "4555", + "Name": "BrokerAuthentication", + "ClientNamespace": "Microsoft.IoTOperations", + "Operations": [ + { + "$id": "4556", + "Name": "get", + "ResourceName": "BrokerAuthenticationResource", + "Doc": "Get a BrokerAuthenticationResource", + "Accessibility": "public", + "Parameters": [ + { + "$id": "4557", + "Name": "apiVersion", + "NameInRequest": "api-version", + "Doc": "The API version to use for this operation.", + "Type": { + "$id": "4558", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": true, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "DefaultValue": { + "$id": "4559", + "Type": { + "$id": "4560", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "2024-11-01" + }, + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "4561", + "Name": "subscriptionId", + "NameInRequest": "subscriptionId", + "Doc": "The ID of the target subscription. The value must be an UUID.", + "Type": { + "$id": "4562", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "4563", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "4564", + "Name": "resourceGroupName", + "NameInRequest": "resourceGroupName", + "Doc": "The name of the resource group. The name is case insensitive.", + "Type": { + "$id": "4565", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "4566", + "Name": "instanceName", + "NameInRequest": "instanceName", + "Doc": "Name of instance.", + "Type": { + "$id": "4567", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "4568", + "Name": "brokerName", + "NameInRequest": "brokerName", + "Doc": "Name of broker.", + "Type": { + "$id": "4569", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "4570", + "Name": "authenticationName", + "NameInRequest": "authenticationName", + "Doc": "Name of Instance broker authentication resource", + "Type": { + "$id": "4571", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "4572", + "Name": "accept", + "NameInRequest": "Accept", + "Type": { + "$id": "4573", + "kind": "constant", + "valueType": { + "$id": "4574", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "4575", + "StatusCodes": [ + 200 + ], + "BodyType": { + "$ref": "1038" + }, + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false, + "ContentTypes": [ + "application/json" + ] + } + ], + "HttpMethod": "GET", + "RequestBodyMediaType": "None", + "Uri": "{endpoint}", + "Path": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/brokers/{brokerName}/authentications/{authenticationName}", + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Microsoft.IoTOperations.BrokerAuthentication.get", + "Decorators": [], + "Examples": [ + { + "$id": "4576", + "kind": "http", + "name": "BrokerAuthentication_Get", + "description": "BrokerAuthentication_Get", + "filePath": "2024-11-01/BrokerAuthentication_Get_MaximumSet_Gen.json", + "parameters": [ + { + "$id": "4577", + "parameter": { + "$ref": "4557" + }, + "value": { + "$id": "4578", + "kind": "string", + "type": { + "$ref": "4558" + }, + "value": "2024-11-01" + } + }, + { + "$id": "4579", + "parameter": { + "$ref": "4561" + }, + "value": { + "$id": "4580", + "kind": "string", + "type": { + "$ref": "4562" + }, + "value": "F8C729F9-DF9C-4743-848F-96EE433D8E53" + } + }, + { + "$id": "4581", + "parameter": { + "$ref": "4564" + }, + "value": { + "$id": "4582", + "kind": "string", + "type": { + "$ref": "4565" + }, + "value": "rgiotoperations" + } + }, + { + "$id": "4583", + "parameter": { + "$ref": "4566" + }, + "value": { + "$id": "4584", + "kind": "string", + "type": { + "$ref": "4567" + }, + "value": "resource-name123" + } + }, + { + "$id": "4585", + "parameter": { + "$ref": "4568" + }, + "value": { + "$id": "4586", + "kind": "string", + "type": { + "$ref": "4569" + }, + "value": "resource-name123" + } + }, + { + "$id": "4587", + "parameter": { + "$ref": "4570" + }, + "value": { + "$id": "4588", + "kind": "string", + "type": { + "$ref": "4571" + }, + "value": "resource-name123" + } + } + ], + "responses": [ + { + "$id": "4589", + "response": { + "$ref": "4575" + }, + "statusCode": 200, + "bodyValue": { + "$id": "4590", + "kind": "model", + "type": { + "$ref": "1038" + }, + "value": { + "$id": "4591", + "properties": { + "$id": "4592", + "kind": "model", + "type": { + "$ref": "1040" + }, + "value": { + "$id": "4593", + "authenticationMethods": { + "$id": "4594", + "kind": "array", + "type": { + "$ref": "1042" + }, + "value": [ + { + "$id": "4595", + "kind": "model", + "type": { + "$ref": "1043" + }, + "value": { + "$id": "4596", + "method": { + "$id": "4597", + "kind": "string", + "type": { + "$ref": "224" + }, + "value": "Custom" + }, + "customSettings": { + "$id": "4598", + "kind": "model", + "type": { + "$ref": "1048" + }, + "value": { + "$id": "4599", + "auth": { + "$id": "4600", + "kind": "model", + "type": { + "$ref": "1050" + }, + "value": { + "$id": "4601", + "x509": { + "$id": "4602", + "kind": "model", + "type": { + "$ref": "1052" + }, + "value": { + "$id": "4603", + "secretRef": { + "$id": "4604", + "kind": "string", + "type": { + "$ref": "1054" + }, + "value": "secret-name" + } + } + } + } + }, + "caCertConfigMap": { + "$id": "4605", + "kind": "string", + "type": { + "$ref": "1062" + }, + "value": "pdecudefqyolvncbus" + }, + "endpoint": { + "$id": "4606", + "kind": "string", + "type": { + "$ref": "1066" + }, + "value": "https://www.example.com" + }, + "headers": { + "$id": "4607", + "kind": "dict", + "type": { + "$ref": "1070" + }, + "value": { + "$id": "4608", + "key8518": { + "$id": "4609", + "kind": "string", + "type": { + "$ref": "1072" + }, + "value": "bwityjy" + } + } + } + } + }, + "serviceAccountTokenSettings": { + "$id": "4610", + "kind": "model", + "type": { + "$ref": "1078" + }, + "value": { + "$id": "4611", + "audiences": { + "$id": "4612", + "kind": "array", + "type": { + "$ref": "1080" + }, + "value": [ + { + "$id": "4613", + "kind": "string", + "type": { + "$ref": "1081" + }, + "value": "jqyhyqatuydg" + } + ] + } + } + }, + "x509Settings": { + "$id": "4614", + "kind": "model", + "type": { + "$ref": "1087" + }, + "value": { + "$id": "4615", + "authorizationAttributes": { + "$id": "4616", + "kind": "dict", + "type": { + "$ref": "1089" + }, + "value": { + "$id": "4617", + "key3384": { + "$id": "4618", + "kind": "model", + "type": { + "$ref": "1091" + }, + "value": { + "$id": "4619", + "attributes": { + "$id": "4620", + "kind": "dict", + "type": { + "$ref": "1093" + }, + "value": { + "$id": "4621", + "key186": { + "$id": "4622", + "kind": "string", + "type": { + "$ref": "1095" + }, + "value": "ucpajramsz" + } + } + }, + "subject": { + "$id": "4623", + "kind": "string", + "type": { + "$ref": "1099" + }, + "value": "jpgwctfeixitptfgfnqhua" + } + } + } + } + }, + "trustedClientCaCert": { + "$id": "4624", + "kind": "string", + "type": { + "$ref": "1105" + }, + "value": "vlctsqddl" + } + } + } + } + } + ] + }, + "provisioningState": { + "$id": "4625", + "kind": "string", + "type": { + "$ref": "126" + }, + "value": "Succeeded" + } + } + }, + "extendedLocation": { + "$id": "4626", + "kind": "model", + "type": { + "$ref": "669" + }, + "value": { + "$id": "4627", + "name": { + "$id": "4628", + "kind": "string", + "type": { + "$ref": "671" + }, + "value": "qmbrfwcpwwhggszhrdjv" + }, + "type": { + "$id": "4629", + "kind": "string", + "type": { + "$ref": "142" + }, + "value": "CustomLocation" + } + } + }, + "id": { + "$id": "4630", + "kind": "string", + "type": { + "$ref": "330" + }, + "value": "/subscriptions/0000000-0000-0000-0000-000000000000/resourceGroups/resourceGroup123/providers/Microsoft.IoTOperations/instances/resource-name123/brokers/resource-name123/authentications/resource-name123" + }, + "name": { + "$id": "4631", + "kind": "string", + "type": { + "$ref": "335" + }, + "value": "lwucizfvtsdpx" + }, + "type": { + "$id": "4632", + "kind": "string", + "type": { + "$ref": "339" + }, + "value": "kvtilkgcxanlfozrd" + }, + "systemData": { + "$id": "4633", + "kind": "model", + "type": { + "$ref": "344" + }, + "value": { + "$id": "4634", + "createdBy": { + "$id": "4635", + "kind": "string", + "type": { + "$ref": "346" + }, + "value": "ssvaslsmudloholronopqyxjcu" + }, + "createdByType": { + "$id": "4636", + "kind": "string", + "type": { + "$ref": "146" + }, + "value": "User" + }, + "createdAt": { + "$id": "4637", + "kind": "string", + "type": { + "$ref": "353" + }, + "value": "2024-08-09T18:13:29.389Z" + }, + "lastModifiedBy": { + "$id": "4638", + "kind": "string", + "type": { + "$ref": "358" + }, + "value": "gnicpuszwd" + }, + "lastModifiedByType": { + "$id": "4639", + "kind": "string", + "type": { + "$ref": "146" + }, + "value": "User" + }, + "lastModifiedAt": { + "$id": "4640", + "kind": "string", + "type": { + "$ref": "365" + }, + "value": "2024-08-09T18:13:29.389Z" + } + } + } + } + } + } + ] + } + ] + }, + { + "$id": "4641", + "Name": "createOrUpdate", + "ResourceName": "BrokerAuthenticationResource", + "Doc": "Create a BrokerAuthenticationResource", + "Accessibility": "public", + "Parameters": [ + { + "$id": "4642", + "Name": "apiVersion", + "NameInRequest": "api-version", + "Doc": "The API version to use for this operation.", + "Type": { + "$id": "4643", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": true, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "DefaultValue": { + "$id": "4644", + "Type": { + "$id": "4645", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "2024-11-01" + }, + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "4646", + "Name": "subscriptionId", + "NameInRequest": "subscriptionId", + "Doc": "The ID of the target subscription. The value must be an UUID.", + "Type": { + "$id": "4647", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "4648", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "4649", + "Name": "resourceGroupName", + "NameInRequest": "resourceGroupName", + "Doc": "The name of the resource group. The name is case insensitive.", + "Type": { + "$id": "4650", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "4651", + "Name": "instanceName", + "NameInRequest": "instanceName", + "Doc": "Name of instance.", + "Type": { + "$id": "4652", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "4653", + "Name": "brokerName", + "NameInRequest": "brokerName", + "Doc": "Name of broker.", + "Type": { + "$id": "4654", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "4655", + "Name": "authenticationName", + "NameInRequest": "authenticationName", + "Doc": "Name of Instance broker authentication resource", + "Type": { + "$id": "4656", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "4657", + "Name": "contentType", + "NameInRequest": "Content-Type", + "Doc": "Body parameter's content type. Known values are application/json", + "Type": { + "$id": "4658", + "kind": "constant", + "valueType": { + "$id": "4659", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": true, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "4660", + "Name": "accept", + "NameInRequest": "Accept", + "Type": { + "$id": "4661", + "kind": "constant", + "valueType": { + "$id": "4662", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "4663", + "Name": "resource", + "NameInRequest": "resource", + "Doc": "Resource create parameters.", + "Type": { + "$ref": "1038" + }, + "Location": "Body", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "4664", + "StatusCodes": [ + 200 + ], + "BodyType": { + "$ref": "1038" + }, + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false, + "ContentTypes": [ + "application/json" + ] + }, + { + "$id": "4665", + "StatusCodes": [ + 201 + ], + "BodyType": { + "$ref": "1038" + }, + "BodyMediaType": "Json", + "Headers": [ + { + "$id": "4666", + "Name": "azureAsyncOperation", + "NameInResponse": "Azure-AsyncOperation", + "Doc": "A link to the status monitor", + "Type": { + "$id": "4667", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + } + }, + { + "$id": "4668", + "Name": "retryAfter", + "NameInResponse": "Retry-After", + "Doc": "The Retry-After header can indicate how long the client should wait before polling the operation status.", + "Type": { + "$id": "4669", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + } + } + ], + "IsErrorResponse": false, + "ContentTypes": [ + "application/json" + ] + } + ], + "HttpMethod": "PUT", + "RequestBodyMediaType": "Json", + "Uri": "{endpoint}", + "Path": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/brokers/{brokerName}/authentications/{authenticationName}", + "RequestMediaTypes": [ + "application/json" + ], + "BufferResponse": true, + "LongRunning": { + "$id": "4670", + "FinalStateVia": 0, + "FinalResponse": { + "$id": "4671", + "StatusCodes": [ + 200 + ], + "BodyType": { + "$ref": "1038" + }, + "BodyMediaType": "Json" + } + }, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Microsoft.IoTOperations.BrokerAuthentication.createOrUpdate", + "Decorators": [], + "Examples": [ + { + "$id": "4672", + "kind": "http", + "name": "BrokerAuthentication_CreateOrUpdate_Complex", + "description": "BrokerAuthentication_CreateOrUpdate_Complex", + "filePath": "2024-11-01/BrokerAuthentication_CreateOrUpdate_Complex.json", + "parameters": [ + { + "$id": "4673", + "parameter": { + "$ref": "4642" + }, + "value": { + "$id": "4674", + "kind": "string", + "type": { + "$ref": "4643" + }, + "value": "2024-11-01" + } + }, + { + "$id": "4675", + "parameter": { + "$ref": "4646" + }, + "value": { + "$id": "4676", + "kind": "string", + "type": { + "$ref": "4647" + }, + "value": "F8C729F9-DF9C-4743-848F-96EE433D8E53" + } + }, + { + "$id": "4677", + "parameter": { + "$ref": "4649" + }, + "value": { + "$id": "4678", + "kind": "string", + "type": { + "$ref": "4650" + }, + "value": "rgiotoperations" + } + }, + { + "$id": "4679", + "parameter": { + "$ref": "4651" + }, + "value": { + "$id": "4680", + "kind": "string", + "type": { + "$ref": "4652" + }, + "value": "resource-name123" + } + }, + { + "$id": "4681", + "parameter": { + "$ref": "4653" + }, + "value": { + "$id": "4682", + "kind": "string", + "type": { + "$ref": "4654" + }, + "value": "resource-name123" + } + }, + { + "$id": "4683", + "parameter": { + "$ref": "4655" + }, + "value": { + "$id": "4684", + "kind": "string", + "type": { + "$ref": "4656" + }, + "value": "resource-name123" + } + }, + { + "$id": "4685", + "parameter": { + "$ref": "4663" + }, + "value": { + "$id": "4686", + "kind": "model", + "type": { + "$ref": "1038" + }, + "value": { + "$id": "4687", + "properties": { + "$id": "4688", + "kind": "model", + "type": { + "$ref": "1040" + }, + "value": { + "$id": "4689", + "authenticationMethods": { + "$id": "4690", + "kind": "array", + "type": { + "$ref": "1042" + }, + "value": [ + { + "$id": "4691", + "kind": "model", + "type": { + "$ref": "1043" + }, + "value": { + "$id": "4692", + "method": { + "$id": "4693", + "kind": "string", + "type": { + "$ref": "224" + }, + "value": "ServiceAccountToken" + }, + "serviceAccountTokenSettings": { + "$id": "4694", + "kind": "model", + "type": { + "$ref": "1078" + }, + "value": { + "$id": "4695", + "audiences": { + "$id": "4696", + "kind": "array", + "type": { + "$ref": "1080" + }, + "value": [ + { + "$id": "4697", + "kind": "string", + "type": { + "$ref": "1081" + }, + "value": "aio-internal" + } + ] + } + } + } + } + }, + { + "$id": "4698", + "kind": "model", + "type": { + "$ref": "1043" + }, + "value": { + "$id": "4699", + "method": { + "$id": "4700", + "kind": "string", + "type": { + "$ref": "224" + }, + "value": "X509" + }, + "x509Settings": { + "$id": "4701", + "kind": "model", + "type": { + "$ref": "1087" + }, + "value": { + "$id": "4702", + "trustedClientCaCert": { + "$id": "4703", + "kind": "string", + "type": { + "$ref": "1105" + }, + "value": "my-ca" + }, + "authorizationAttributes": { + "$id": "4704", + "kind": "dict", + "type": { + "$ref": "1089" + }, + "value": { + "$id": "4705", + "root": { + "$id": "4706", + "kind": "model", + "type": { + "$ref": "1091" + }, + "value": { + "$id": "4707", + "subject": { + "$id": "4708", + "kind": "string", + "type": { + "$ref": "1099" + }, + "value": "CN = Contoso Root CA Cert, OU = Engineering, C = US" + }, + "attributes": { + "$id": "4709", + "kind": "dict", + "type": { + "$ref": "1093" + }, + "value": { + "$id": "4710", + "organization": { + "$id": "4711", + "kind": "string", + "type": { + "$ref": "1095" + }, + "value": "contoso" + } + } + } + } + }, + "intermediate": { + "$id": "4712", + "kind": "model", + "type": { + "$ref": "1091" + }, + "value": { + "$id": "4713", + "subject": { + "$id": "4714", + "kind": "string", + "type": { + "$ref": "1099" + }, + "value": "CN = Contoso Intermediate CA" + }, + "attributes": { + "$id": "4715", + "kind": "dict", + "type": { + "$ref": "1093" + }, + "value": { + "$id": "4716", + "city": { + "$id": "4717", + "kind": "string", + "type": { + "$ref": "1095" + }, + "value": "seattle" + }, + "foo": { + "$id": "4718", + "kind": "string", + "type": { + "$ref": "1095" + }, + "value": "bar" + } + } + } + } + }, + "smart-fan": { + "$id": "4719", + "kind": "model", + "type": { + "$ref": "1091" + }, + "value": { + "$id": "4720", + "subject": { + "$id": "4721", + "kind": "string", + "type": { + "$ref": "1099" + }, + "value": "CN = smart-fan" + }, + "attributes": { + "$id": "4722", + "kind": "dict", + "type": { + "$ref": "1093" + }, + "value": { + "$id": "4723", + "building": { + "$id": "4724", + "kind": "string", + "type": { + "$ref": "1095" + }, + "value": "17" + } + } + } + } + } + } + } + } + } + } + } + ] + } + } + }, + "extendedLocation": { + "$id": "4725", + "kind": "model", + "type": { + "$ref": "669" + }, + "value": { + "$id": "4726", + "name": { + "$id": "4727", + "kind": "string", + "type": { + "$ref": "671" + }, + "value": "qmbrfwcpwwhggszhrdjv" + }, + "type": { + "$id": "4728", + "kind": "string", + "type": { + "$ref": "142" + }, + "value": "CustomLocation" + } + } + } + } + } + } + ], + "responses": [ + { + "$id": "4729", + "response": { + "$ref": "4664" + }, + "statusCode": 200, + "bodyValue": { + "$id": "4730", + "kind": "model", + "type": { + "$ref": "1038" + }, + "value": { + "$id": "4731", + "properties": { + "$id": "4732", + "kind": "model", + "type": { + "$ref": "1040" + }, + "value": { + "$id": "4733", + "authenticationMethods": { + "$id": "4734", + "kind": "array", + "type": { + "$ref": "1042" + }, + "value": [ + { + "$id": "4735", + "kind": "model", + "type": { + "$ref": "1043" + }, + "value": { + "$id": "4736", + "method": { + "$id": "4737", + "kind": "string", + "type": { + "$ref": "224" + }, + "value": "ServiceAccountToken" + }, + "serviceAccountTokenSettings": { + "$id": "4738", + "kind": "model", + "type": { + "$ref": "1078" + }, + "value": { + "$id": "4739", + "audiences": { + "$id": "4740", + "kind": "array", + "type": { + "$ref": "1080" + }, + "value": [ + { + "$id": "4741", + "kind": "string", + "type": { + "$ref": "1081" + }, + "value": "aio-internal" + } + ] + } + } + } + } + }, + { + "$id": "4742", + "kind": "model", + "type": { + "$ref": "1043" + }, + "value": { + "$id": "4743", + "method": { + "$id": "4744", + "kind": "string", + "type": { + "$ref": "224" + }, + "value": "X509" + }, + "x509Settings": { + "$id": "4745", + "kind": "model", + "type": { + "$ref": "1087" + }, + "value": { + "$id": "4746", + "trustedClientCaCert": { + "$id": "4747", + "kind": "string", + "type": { + "$ref": "1105" + }, + "value": "my-ca" + }, + "authorizationAttributes": { + "$id": "4748", + "kind": "dict", + "type": { + "$ref": "1089" + }, + "value": { + "$id": "4749", + "root": { + "$id": "4750", + "kind": "model", + "type": { + "$ref": "1091" + }, + "value": { + "$id": "4751", + "subject": { + "$id": "4752", + "kind": "string", + "type": { + "$ref": "1099" + }, + "value": "CN = Contoso Root CA Cert, OU = Engineering, C = US" + }, + "attributes": { + "$id": "4753", + "kind": "dict", + "type": { + "$ref": "1093" + }, + "value": { + "$id": "4754", + "organization": { + "$id": "4755", + "kind": "string", + "type": { + "$ref": "1095" + }, + "value": "contoso" + } + } + } + } + }, + "intermediate": { + "$id": "4756", + "kind": "model", + "type": { + "$ref": "1091" + }, + "value": { + "$id": "4757", + "subject": { + "$id": "4758", + "kind": "string", + "type": { + "$ref": "1099" + }, + "value": "CN = Contoso Intermediate CA" + }, + "attributes": { + "$id": "4759", + "kind": "dict", + "type": { + "$ref": "1093" + }, + "value": { + "$id": "4760", + "city": { + "$id": "4761", + "kind": "string", + "type": { + "$ref": "1095" + }, + "value": "seattle" + }, + "foo": { + "$id": "4762", + "kind": "string", + "type": { + "$ref": "1095" + }, + "value": "bar" + } + } + } + } + }, + "smart-fan": { + "$id": "4763", + "kind": "model", + "type": { + "$ref": "1091" + }, + "value": { + "$id": "4764", + "subject": { + "$id": "4765", + "kind": "string", + "type": { + "$ref": "1099" + }, + "value": "CN = smart-fan" + }, + "attributes": { + "$id": "4766", + "kind": "dict", + "type": { + "$ref": "1093" + }, + "value": { + "$id": "4767", + "building": { + "$id": "4768", + "kind": "string", + "type": { + "$ref": "1095" + }, + "value": "17" + } + } + } + } + } + } + } + } + } + } + } + ] + }, + "provisioningState": { + "$id": "4769", + "kind": "string", + "type": { + "$ref": "126" + }, + "value": "Succeeded" + } + } + }, + "extendedLocation": { + "$id": "4770", + "kind": "model", + "type": { + "$ref": "669" + }, + "value": { + "$id": "4771", + "name": { + "$id": "4772", + "kind": "string", + "type": { + "$ref": "671" + }, + "value": "qmbrfwcpwwhggszhrdjv" + }, + "type": { + "$id": "4773", + "kind": "string", + "type": { + "$ref": "142" + }, + "value": "CustomLocation" + } + } + }, + "id": { + "$id": "4774", + "kind": "string", + "type": { + "$ref": "330" + }, + "value": "/subscriptions/0000000-0000-0000-0000-000000000000/resourceGroups/resourceGroup123/providers/Microsoft.IoTOperations/instances/resource-name123/brokers/resource-name123/authentications/resource-name123" + }, + "name": { + "$id": "4775", + "kind": "string", + "type": { + "$ref": "335" + }, + "value": "lwucizfvtsdpx" + }, + "type": { + "$id": "4776", + "kind": "string", + "type": { + "$ref": "339" + }, + "value": "kvtilkgcxanlfozrd" + }, + "systemData": { + "$id": "4777", + "kind": "model", + "type": { + "$ref": "344" + }, + "value": { + "$id": "4778", + "createdBy": { + "$id": "4779", + "kind": "string", + "type": { + "$ref": "346" + }, + "value": "ssvaslsmudloholronopqyxjcu" + }, + "createdByType": { + "$id": "4780", + "kind": "string", + "type": { + "$ref": "146" + }, + "value": "User" + }, + "createdAt": { + "$id": "4781", + "kind": "string", + "type": { + "$ref": "353" + }, + "value": "2024-08-09T18:13:29.389Z" + }, + "lastModifiedBy": { + "$id": "4782", + "kind": "string", + "type": { + "$ref": "358" + }, + "value": "gnicpuszwd" + }, + "lastModifiedByType": { + "$id": "4783", + "kind": "string", + "type": { + "$ref": "146" + }, + "value": "User" + }, + "lastModifiedAt": { + "$id": "4784", + "kind": "string", + "type": { + "$ref": "365" + }, + "value": "2024-08-09T18:13:29.389Z" + } + } + } + } + } + }, + { + "$id": "4785", + "response": { + "$ref": "4665" + }, + "statusCode": 201, + "bodyValue": { + "$id": "4786", + "kind": "model", + "type": { + "$ref": "1038" + }, + "value": { + "$id": "4787", + "properties": { + "$id": "4788", + "kind": "model", + "type": { + "$ref": "1040" + }, + "value": { + "$id": "4789", + "authenticationMethods": { + "$id": "4790", + "kind": "array", + "type": { + "$ref": "1042" + }, + "value": [ + { + "$id": "4791", + "kind": "model", + "type": { + "$ref": "1043" + }, + "value": { + "$id": "4792", + "method": { + "$id": "4793", + "kind": "string", + "type": { + "$ref": "224" + }, + "value": "ServiceAccountToken" + }, + "serviceAccountTokenSettings": { + "$id": "4794", + "kind": "model", + "type": { + "$ref": "1078" + }, + "value": { + "$id": "4795", + "audiences": { + "$id": "4796", + "kind": "array", + "type": { + "$ref": "1080" + }, + "value": [ + { + "$id": "4797", + "kind": "string", + "type": { + "$ref": "1081" + }, + "value": "aio-internal" + } + ] + } + } + } + } + }, + { + "$id": "4798", + "kind": "model", + "type": { + "$ref": "1043" + }, + "value": { + "$id": "4799", + "method": { + "$id": "4800", + "kind": "string", + "type": { + "$ref": "224" + }, + "value": "X509" + }, + "x509Settings": { + "$id": "4801", + "kind": "model", + "type": { + "$ref": "1087" + }, + "value": { + "$id": "4802", + "trustedClientCaCert": { + "$id": "4803", + "kind": "string", + "type": { + "$ref": "1105" + }, + "value": "my-ca" + }, + "authorizationAttributes": { + "$id": "4804", + "kind": "dict", + "type": { + "$ref": "1089" + }, + "value": { + "$id": "4805", + "root": { + "$id": "4806", + "kind": "model", + "type": { + "$ref": "1091" + }, + "value": { + "$id": "4807", + "subject": { + "$id": "4808", + "kind": "string", + "type": { + "$ref": "1099" + }, + "value": "CN = Contoso Root CA Cert, OU = Engineering, C = US" + }, + "attributes": { + "$id": "4809", + "kind": "dict", + "type": { + "$ref": "1093" + }, + "value": { + "$id": "4810", + "organization": { + "$id": "4811", + "kind": "string", + "type": { + "$ref": "1095" + }, + "value": "contoso" + } + } + } + } + }, + "intermediate": { + "$id": "4812", + "kind": "model", + "type": { + "$ref": "1091" + }, + "value": { + "$id": "4813", + "subject": { + "$id": "4814", + "kind": "string", + "type": { + "$ref": "1099" + }, + "value": "CN = Contoso Intermediate CA" + }, + "attributes": { + "$id": "4815", + "kind": "dict", + "type": { + "$ref": "1093" + }, + "value": { + "$id": "4816", + "city": { + "$id": "4817", + "kind": "string", + "type": { + "$ref": "1095" + }, + "value": "seattle" + }, + "foo": { + "$id": "4818", + "kind": "string", + "type": { + "$ref": "1095" + }, + "value": "bar" + } + } + } + } + }, + "smart-fan": { + "$id": "4819", + "kind": "model", + "type": { + "$ref": "1091" + }, + "value": { + "$id": "4820", + "subject": { + "$id": "4821", + "kind": "string", + "type": { + "$ref": "1099" + }, + "value": "CN = smart-fan" + }, + "attributes": { + "$id": "4822", + "kind": "dict", + "type": { + "$ref": "1093" + }, + "value": { + "$id": "4823", + "building": { + "$id": "4824", + "kind": "string", + "type": { + "$ref": "1095" + }, + "value": "17" + } + } + } + } + } + } + } + } + } + } + } + ] + }, + "provisioningState": { + "$id": "4825", + "kind": "string", + "type": { + "$ref": "126" + }, + "value": "Succeeded" + } + } + }, + "extendedLocation": { + "$id": "4826", + "kind": "model", + "type": { + "$ref": "669" + }, + "value": { + "$id": "4827", + "name": { + "$id": "4828", + "kind": "string", + "type": { + "$ref": "671" + }, + "value": "qmbrfwcpwwhggszhrdjv" + }, + "type": { + "$id": "4829", + "kind": "string", + "type": { + "$ref": "142" + }, + "value": "CustomLocation" + } + } + }, + "id": { + "$id": "4830", + "kind": "string", + "type": { + "$ref": "330" + }, + "value": "/subscriptions/0000000-0000-0000-0000-000000000000/resourceGroups/resourceGroup123/providers/Microsoft.IoTOperations/instances/resource-name123/brokers/resource-name123/authentications/resource-name123" + }, + "name": { + "$id": "4831", + "kind": "string", + "type": { + "$ref": "335" + }, + "value": "lwucizfvtsdpx" + }, + "type": { + "$id": "4832", + "kind": "string", + "type": { + "$ref": "339" + }, + "value": "kvtilkgcxanlfozrd" + }, + "systemData": { + "$id": "4833", + "kind": "model", + "type": { + "$ref": "344" + }, + "value": { + "$id": "4834", + "createdBy": { + "$id": "4835", + "kind": "string", + "type": { + "$ref": "346" + }, + "value": "ssvaslsmudloholronopqyxjcu" + }, + "createdByType": { + "$id": "4836", + "kind": "string", + "type": { + "$ref": "146" + }, + "value": "User" + }, + "createdAt": { + "$id": "4837", + "kind": "string", + "type": { + "$ref": "353" + }, + "value": "2024-08-09T18:13:29.389Z" + }, + "lastModifiedBy": { + "$id": "4838", + "kind": "string", + "type": { + "$ref": "358" + }, + "value": "gnicpuszwd" + }, + "lastModifiedByType": { + "$id": "4839", + "kind": "string", + "type": { + "$ref": "146" + }, + "value": "User" + }, + "lastModifiedAt": { + "$id": "4840", + "kind": "string", + "type": { + "$ref": "365" + }, + "value": "2024-08-09T18:13:29.389Z" + } + } + } + } + } + } + ] + }, + { + "$id": "4841", + "kind": "http", + "name": "BrokerAuthentication_CreateOrUpdate", + "description": "BrokerAuthentication_CreateOrUpdate", + "filePath": "2024-11-01/BrokerAuthentication_CreateOrUpdate_MaximumSet_Gen.json", + "parameters": [ + { + "$id": "4842", + "parameter": { + "$ref": "4642" + }, + "value": { + "$id": "4843", + "kind": "string", + "type": { + "$ref": "4643" + }, + "value": "2024-11-01" + } + }, + { + "$id": "4844", + "parameter": { + "$ref": "4646" + }, + "value": { + "$id": "4845", + "kind": "string", + "type": { + "$ref": "4647" + }, + "value": "F8C729F9-DF9C-4743-848F-96EE433D8E53" + } + }, + { + "$id": "4846", + "parameter": { + "$ref": "4649" + }, + "value": { + "$id": "4847", + "kind": "string", + "type": { + "$ref": "4650" + }, + "value": "rgiotoperations" + } + }, + { + "$id": "4848", + "parameter": { + "$ref": "4651" + }, + "value": { + "$id": "4849", + "kind": "string", + "type": { + "$ref": "4652" + }, + "value": "resource-name123" + } + }, + { + "$id": "4850", + "parameter": { + "$ref": "4653" + }, + "value": { + "$id": "4851", + "kind": "string", + "type": { + "$ref": "4654" + }, + "value": "resource-name123" + } + }, + { + "$id": "4852", + "parameter": { + "$ref": "4655" + }, + "value": { + "$id": "4853", + "kind": "string", + "type": { + "$ref": "4656" + }, + "value": "resource-name123" + } + }, + { + "$id": "4854", + "parameter": { + "$ref": "4663" + }, + "value": { + "$id": "4855", + "kind": "model", + "type": { + "$ref": "1038" + }, + "value": { + "$id": "4856", + "properties": { + "$id": "4857", + "kind": "model", + "type": { + "$ref": "1040" + }, + "value": { + "$id": "4858", + "authenticationMethods": { + "$id": "4859", + "kind": "array", + "type": { + "$ref": "1042" + }, + "value": [ + { + "$id": "4860", + "kind": "model", + "type": { + "$ref": "1043" + }, + "value": { + "$id": "4861", + "method": { + "$id": "4862", + "kind": "string", + "type": { + "$ref": "224" + }, + "value": "Custom" + }, + "customSettings": { + "$id": "4863", + "kind": "model", + "type": { + "$ref": "1048" + }, + "value": { + "$id": "4864", + "auth": { + "$id": "4865", + "kind": "model", + "type": { + "$ref": "1050" + }, + "value": { + "$id": "4866", + "x509": { + "$id": "4867", + "kind": "model", + "type": { + "$ref": "1052" + }, + "value": { + "$id": "4868", + "secretRef": { + "$id": "4869", + "kind": "string", + "type": { + "$ref": "1054" + }, + "value": "secret-name" + } + } + } + } + }, + "caCertConfigMap": { + "$id": "4870", + "kind": "string", + "type": { + "$ref": "1062" + }, + "value": "pdecudefqyolvncbus" + }, + "endpoint": { + "$id": "4871", + "kind": "string", + "type": { + "$ref": "1066" + }, + "value": "https://www.example.com" + }, + "headers": { + "$id": "4872", + "kind": "dict", + "type": { + "$ref": "1070" + }, + "value": { + "$id": "4873", + "key8518": { + "$id": "4874", + "kind": "string", + "type": { + "$ref": "1072" + }, + "value": "bwityjy" + } + } + } + } + }, + "serviceAccountTokenSettings": { + "$id": "4875", + "kind": "model", + "type": { + "$ref": "1078" + }, + "value": { + "$id": "4876", + "audiences": { + "$id": "4877", + "kind": "array", + "type": { + "$ref": "1080" + }, + "value": [ + { + "$id": "4878", + "kind": "string", + "type": { + "$ref": "1081" + }, + "value": "jqyhyqatuydg" + } + ] + } + } + }, + "x509Settings": { + "$id": "4879", + "kind": "model", + "type": { + "$ref": "1087" + }, + "value": { + "$id": "4880", + "authorizationAttributes": { + "$id": "4881", + "kind": "dict", + "type": { + "$ref": "1089" + }, + "value": { + "$id": "4882", + "key3384": { + "$id": "4883", + "kind": "model", + "type": { + "$ref": "1091" + }, + "value": { + "$id": "4884", + "attributes": { + "$id": "4885", + "kind": "dict", + "type": { + "$ref": "1093" + }, + "value": { + "$id": "4886", + "key186": { + "$id": "4887", + "kind": "string", + "type": { + "$ref": "1095" + }, + "value": "ucpajramsz" + } + } + }, + "subject": { + "$id": "4888", + "kind": "string", + "type": { + "$ref": "1099" + }, + "value": "jpgwctfeixitptfgfnqhua" + } + } + } + } + }, + "trustedClientCaCert": { + "$id": "4889", + "kind": "string", + "type": { + "$ref": "1105" + }, + "value": "vlctsqddl" + } + } + } + } + } + ] + } + } + }, + "extendedLocation": { + "$id": "4890", + "kind": "model", + "type": { + "$ref": "669" + }, + "value": { + "$id": "4891", + "name": { + "$id": "4892", + "kind": "string", + "type": { + "$ref": "671" + }, + "value": "qmbrfwcpwwhggszhrdjv" + }, + "type": { + "$id": "4893", + "kind": "string", + "type": { + "$ref": "142" + }, + "value": "CustomLocation" + } + } + } + } + } + } + ], + "responses": [ + { + "$id": "4894", + "response": { + "$ref": "4664" + }, + "statusCode": 200, + "bodyValue": { + "$id": "4895", + "kind": "model", + "type": { + "$ref": "1038" + }, + "value": { + "$id": "4896", + "properties": { + "$id": "4897", + "kind": "model", + "type": { + "$ref": "1040" + }, + "value": { + "$id": "4898", + "authenticationMethods": { + "$id": "4899", + "kind": "array", + "type": { + "$ref": "1042" + }, + "value": [ + { + "$id": "4900", + "kind": "model", + "type": { + "$ref": "1043" + }, + "value": { + "$id": "4901", + "method": { + "$id": "4902", + "kind": "string", + "type": { + "$ref": "224" + }, + "value": "Custom" + }, + "customSettings": { + "$id": "4903", + "kind": "model", + "type": { + "$ref": "1048" + }, + "value": { + "$id": "4904", + "auth": { + "$id": "4905", + "kind": "model", + "type": { + "$ref": "1050" + }, + "value": { + "$id": "4906", + "x509": { + "$id": "4907", + "kind": "model", + "type": { + "$ref": "1052" + }, + "value": { + "$id": "4908", + "secretRef": { + "$id": "4909", + "kind": "string", + "type": { + "$ref": "1054" + }, + "value": "secret-name" + } + } + } + } + }, + "caCertConfigMap": { + "$id": "4910", + "kind": "string", + "type": { + "$ref": "1062" + }, + "value": "pdecudefqyolvncbus" + }, + "endpoint": { + "$id": "4911", + "kind": "string", + "type": { + "$ref": "1066" + }, + "value": "https://www.example.com" + }, + "headers": { + "$id": "4912", + "kind": "dict", + "type": { + "$ref": "1070" + }, + "value": { + "$id": "4913", + "key8518": { + "$id": "4914", + "kind": "string", + "type": { + "$ref": "1072" + }, + "value": "bwityjy" + } + } + } + } + }, + "serviceAccountTokenSettings": { + "$id": "4915", + "kind": "model", + "type": { + "$ref": "1078" + }, + "value": { + "$id": "4916", + "audiences": { + "$id": "4917", + "kind": "array", + "type": { + "$ref": "1080" + }, + "value": [ + { + "$id": "4918", + "kind": "string", + "type": { + "$ref": "1081" + }, + "value": "jqyhyqatuydg" + } + ] + } + } + }, + "x509Settings": { + "$id": "4919", + "kind": "model", + "type": { + "$ref": "1087" + }, + "value": { + "$id": "4920", + "authorizationAttributes": { + "$id": "4921", + "kind": "dict", + "type": { + "$ref": "1089" + }, + "value": { + "$id": "4922", + "key3384": { + "$id": "4923", + "kind": "model", + "type": { + "$ref": "1091" + }, + "value": { + "$id": "4924", + "attributes": { + "$id": "4925", + "kind": "dict", + "type": { + "$ref": "1093" + }, + "value": { + "$id": "4926", + "key186": { + "$id": "4927", + "kind": "string", + "type": { + "$ref": "1095" + }, + "value": "ucpajramsz" + } + } + }, + "subject": { + "$id": "4928", + "kind": "string", + "type": { + "$ref": "1099" + }, + "value": "jpgwctfeixitptfgfnqhua" + } + } + } + } + }, + "trustedClientCaCert": { + "$id": "4929", + "kind": "string", + "type": { + "$ref": "1105" + }, + "value": "vlctsqddl" + } + } + } + } + } + ] + }, + "provisioningState": { + "$id": "4930", + "kind": "string", + "type": { + "$ref": "126" + }, + "value": "Succeeded" + } + } + }, + "extendedLocation": { + "$id": "4931", + "kind": "model", + "type": { + "$ref": "669" + }, + "value": { + "$id": "4932", + "name": { + "$id": "4933", + "kind": "string", + "type": { + "$ref": "671" + }, + "value": "qmbrfwcpwwhggszhrdjv" + }, + "type": { + "$id": "4934", + "kind": "string", + "type": { + "$ref": "142" + }, + "value": "CustomLocation" + } + } + }, + "id": { + "$id": "4935", + "kind": "string", + "type": { + "$ref": "330" + }, + "value": "/subscriptions/0000000-0000-0000-0000-000000000000/resourceGroups/resourceGroup123/providers/Microsoft.IoTOperations/instances/resource-name123/brokers/resource-name123/authentications/resource-name123" + }, + "name": { + "$id": "4936", + "kind": "string", + "type": { + "$ref": "335" + }, + "value": "lwucizfvtsdpx" + }, + "type": { + "$id": "4937", + "kind": "string", + "type": { + "$ref": "339" + }, + "value": "kvtilkgcxanlfozrd" + }, + "systemData": { + "$id": "4938", + "kind": "model", + "type": { + "$ref": "344" + }, + "value": { + "$id": "4939", + "createdBy": { + "$id": "4940", + "kind": "string", + "type": { + "$ref": "346" + }, + "value": "ssvaslsmudloholronopqyxjcu" + }, + "createdByType": { + "$id": "4941", + "kind": "string", + "type": { + "$ref": "146" + }, + "value": "User" + }, + "createdAt": { + "$id": "4942", + "kind": "string", + "type": { + "$ref": "353" + }, + "value": "2024-08-09T18:13:29.389Z" + }, + "lastModifiedBy": { + "$id": "4943", + "kind": "string", + "type": { + "$ref": "358" + }, + "value": "gnicpuszwd" + }, + "lastModifiedByType": { + "$id": "4944", + "kind": "string", + "type": { + "$ref": "146" + }, + "value": "User" + }, + "lastModifiedAt": { + "$id": "4945", + "kind": "string", + "type": { + "$ref": "365" + }, + "value": "2024-08-09T18:13:29.389Z" + } + } + } + } + } + }, + { + "$id": "4946", + "response": { + "$ref": "4665" + }, + "statusCode": 201, + "bodyValue": { + "$id": "4947", + "kind": "model", + "type": { + "$ref": "1038" + }, + "value": { + "$id": "4948", + "properties": { + "$id": "4949", + "kind": "model", + "type": { + "$ref": "1040" + }, + "value": { + "$id": "4950", + "authenticationMethods": { + "$id": "4951", + "kind": "array", + "type": { + "$ref": "1042" + }, + "value": [ + { + "$id": "4952", + "kind": "model", + "type": { + "$ref": "1043" + }, + "value": { + "$id": "4953", + "method": { + "$id": "4954", + "kind": "string", + "type": { + "$ref": "224" + }, + "value": "Custom" + }, + "customSettings": { + "$id": "4955", + "kind": "model", + "type": { + "$ref": "1048" + }, + "value": { + "$id": "4956", + "auth": { + "$id": "4957", + "kind": "model", + "type": { + "$ref": "1050" + }, + "value": { + "$id": "4958", + "x509": { + "$id": "4959", + "kind": "model", + "type": { + "$ref": "1052" + }, + "value": { + "$id": "4960", + "secretRef": { + "$id": "4961", + "kind": "string", + "type": { + "$ref": "1054" + }, + "value": "secret-name" + } + } + } + } + }, + "caCertConfigMap": { + "$id": "4962", + "kind": "string", + "type": { + "$ref": "1062" + }, + "value": "pdecudefqyolvncbus" + }, + "endpoint": { + "$id": "4963", + "kind": "string", + "type": { + "$ref": "1066" + }, + "value": "https://www.example.com" + }, + "headers": { + "$id": "4964", + "kind": "dict", + "type": { + "$ref": "1070" + }, + "value": { + "$id": "4965", + "key8518": { + "$id": "4966", + "kind": "string", + "type": { + "$ref": "1072" + }, + "value": "bwityjy" + } + } + } + } + }, + "serviceAccountTokenSettings": { + "$id": "4967", + "kind": "model", + "type": { + "$ref": "1078" + }, + "value": { + "$id": "4968", + "audiences": { + "$id": "4969", + "kind": "array", + "type": { + "$ref": "1080" + }, + "value": [ + { + "$id": "4970", + "kind": "string", + "type": { + "$ref": "1081" + }, + "value": "jqyhyqatuydg" + } + ] + } + } + }, + "x509Settings": { + "$id": "4971", + "kind": "model", + "type": { + "$ref": "1087" + }, + "value": { + "$id": "4972", + "authorizationAttributes": { + "$id": "4973", + "kind": "dict", + "type": { + "$ref": "1089" + }, + "value": { + "$id": "4974", + "key3384": { + "$id": "4975", + "kind": "model", + "type": { + "$ref": "1091" + }, + "value": { + "$id": "4976", + "attributes": { + "$id": "4977", + "kind": "dict", + "type": { + "$ref": "1093" + }, + "value": { + "$id": "4978", + "key186": { + "$id": "4979", + "kind": "string", + "type": { + "$ref": "1095" + }, + "value": "ucpajramsz" + } + } + }, + "subject": { + "$id": "4980", + "kind": "string", + "type": { + "$ref": "1099" + }, + "value": "jpgwctfeixitptfgfnqhua" + } + } + } + } + }, + "trustedClientCaCert": { + "$id": "4981", + "kind": "string", + "type": { + "$ref": "1105" + }, + "value": "vlctsqddl" + } + } + } + } + } + ] + }, + "provisioningState": { + "$id": "4982", + "kind": "string", + "type": { + "$ref": "126" + }, + "value": "Succeeded" + } + } + }, + "extendedLocation": { + "$id": "4983", + "kind": "model", + "type": { + "$ref": "669" + }, + "value": { + "$id": "4984", + "name": { + "$id": "4985", + "kind": "string", + "type": { + "$ref": "671" + }, + "value": "qmbrfwcpwwhggszhrdjv" + }, + "type": { + "$id": "4986", + "kind": "string", + "type": { + "$ref": "142" + }, + "value": "CustomLocation" + } + } + }, + "id": { + "$id": "4987", + "kind": "string", + "type": { + "$ref": "330" + }, + "value": "/subscriptions/0000000-0000-0000-0000-000000000000/resourceGroups/resourceGroup123/providers/Microsoft.IoTOperations/instances/resource-name123/brokers/resource-name123/authentications/resource-name123" + }, + "name": { + "$id": "4988", + "kind": "string", + "type": { + "$ref": "335" + }, + "value": "lwucizfvtsdpx" + }, + "type": { + "$id": "4989", + "kind": "string", + "type": { + "$ref": "339" + }, + "value": "kvtilkgcxanlfozrd" + }, + "systemData": { + "$id": "4990", + "kind": "model", + "type": { + "$ref": "344" + }, + "value": { + "$id": "4991", + "createdBy": { + "$id": "4992", + "kind": "string", + "type": { + "$ref": "346" + }, + "value": "ssvaslsmudloholronopqyxjcu" + }, + "createdByType": { + "$id": "4993", + "kind": "string", + "type": { + "$ref": "146" + }, + "value": "User" + }, + "createdAt": { + "$id": "4994", + "kind": "string", + "type": { + "$ref": "353" + }, + "value": "2024-08-09T18:13:29.389Z" + }, + "lastModifiedBy": { + "$id": "4995", + "kind": "string", + "type": { + "$ref": "358" + }, + "value": "gnicpuszwd" + }, + "lastModifiedByType": { + "$id": "4996", + "kind": "string", + "type": { + "$ref": "146" + }, + "value": "User" + }, + "lastModifiedAt": { + "$id": "4997", + "kind": "string", + "type": { + "$ref": "365" + }, + "value": "2024-08-09T18:13:29.389Z" + } + } + } + } + } + } + ] + } + ] + }, + { + "$id": "4998", + "Name": "delete", + "ResourceName": "BrokerAuthenticationResource", + "Doc": "Delete a BrokerAuthenticationResource", + "Accessibility": "public", + "Parameters": [ + { + "$id": "4999", + "Name": "apiVersion", + "NameInRequest": "api-version", + "Doc": "The API version to use for this operation.", + "Type": { + "$id": "5000", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": true, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "DefaultValue": { + "$id": "5001", + "Type": { + "$id": "5002", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "2024-11-01" + }, + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "5003", + "Name": "subscriptionId", + "NameInRequest": "subscriptionId", + "Doc": "The ID of the target subscription. The value must be an UUID.", + "Type": { + "$id": "5004", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "5005", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "5006", + "Name": "resourceGroupName", + "NameInRequest": "resourceGroupName", + "Doc": "The name of the resource group. The name is case insensitive.", + "Type": { + "$id": "5007", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "5008", + "Name": "instanceName", + "NameInRequest": "instanceName", + "Doc": "Name of instance.", + "Type": { + "$id": "5009", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "5010", + "Name": "brokerName", + "NameInRequest": "brokerName", + "Doc": "Name of broker.", + "Type": { + "$id": "5011", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "5012", + "Name": "authenticationName", + "NameInRequest": "authenticationName", + "Doc": "Name of Instance broker authentication resource", + "Type": { + "$id": "5013", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "5014", + "Name": "accept", + "NameInRequest": "Accept", + "Type": { + "$id": "5015", + "kind": "constant", + "valueType": { + "$id": "5016", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "5017", + "StatusCodes": [ + 202 + ], + "BodyMediaType": "Json", + "Headers": [ + { + "$id": "5018", + "Name": "location", + "NameInResponse": "Location", + "Doc": "The Location header contains the URL where the status of the long running operation can be checked.", + "Type": { + "$id": "5019", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + } + }, + { + "$id": "5020", + "Name": "retryAfter", + "NameInResponse": "Retry-After", + "Doc": "The Retry-After header can indicate how long the client should wait before polling the operation status.", + "Type": { + "$id": "5021", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + } + } + ], + "IsErrorResponse": false + }, + { + "$id": "5022", + "StatusCodes": [ + 204 + ], + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false + } + ], + "HttpMethod": "DELETE", + "RequestBodyMediaType": "None", + "Uri": "{endpoint}", + "Path": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/brokers/{brokerName}/authentications/{authenticationName}", + "BufferResponse": true, + "LongRunning": { + "$id": "5023", + "FinalStateVia": 1, + "FinalResponse": { + "$id": "5024", + "StatusCodes": [ + 204 + ], + "BodyMediaType": "Json" + } + }, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Microsoft.IoTOperations.BrokerAuthentication.delete", + "Decorators": [], + "Examples": [ + { + "$id": "5025", + "kind": "http", + "name": "BrokerAuthentication_Delete", + "description": "BrokerAuthentication_Delete", + "filePath": "2024-11-01/BrokerAuthentication_Delete_MaximumSet_Gen.json", + "parameters": [ + { + "$id": "5026", + "parameter": { + "$ref": "4999" + }, + "value": { + "$id": "5027", + "kind": "string", + "type": { + "$ref": "5000" + }, + "value": "2024-11-01" + } + }, + { + "$id": "5028", + "parameter": { + "$ref": "5003" + }, + "value": { + "$id": "5029", + "kind": "string", + "type": { + "$ref": "5004" + }, + "value": "F8C729F9-DF9C-4743-848F-96EE433D8E53" + } + }, + { + "$id": "5030", + "parameter": { + "$ref": "5006" + }, + "value": { + "$id": "5031", + "kind": "string", + "type": { + "$ref": "5007" + }, + "value": "rgiotoperations" + } + }, + { + "$id": "5032", + "parameter": { + "$ref": "5008" + }, + "value": { + "$id": "5033", + "kind": "string", + "type": { + "$ref": "5009" + }, + "value": "resource-name123" + } + }, + { + "$id": "5034", + "parameter": { + "$ref": "5010" + }, + "value": { + "$id": "5035", + "kind": "string", + "type": { + "$ref": "5011" + }, + "value": "resource-name123" + } + }, + { + "$id": "5036", + "parameter": { + "$ref": "5012" + }, + "value": { + "$id": "5037", + "kind": "string", + "type": { + "$ref": "5013" + }, + "value": "resource-name123" + } + } + ], + "responses": [ + { + "$id": "5038", + "response": { + "$ref": "5017" + }, + "statusCode": 202 + }, + { + "$id": "5039", + "response": { + "$ref": "5022" + }, + "statusCode": 204 + } + ] + } + ] + }, + { + "$id": "5040", + "Name": "listByResourceGroup", + "ResourceName": "BrokerAuthenticationResource", + "Doc": "List BrokerAuthenticationResource resources by BrokerResource", + "Accessibility": "public", + "Parameters": [ + { + "$id": "5041", + "Name": "apiVersion", + "NameInRequest": "api-version", + "Doc": "The API version to use for this operation.", + "Type": { + "$id": "5042", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": true, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "DefaultValue": { + "$id": "5043", + "Type": { + "$id": "5044", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "2024-11-01" + }, + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "5045", + "Name": "subscriptionId", + "NameInRequest": "subscriptionId", + "Doc": "The ID of the target subscription. The value must be an UUID.", + "Type": { + "$id": "5046", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "5047", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "5048", + "Name": "resourceGroupName", + "NameInRequest": "resourceGroupName", + "Doc": "The name of the resource group. The name is case insensitive.", + "Type": { + "$id": "5049", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "5050", + "Name": "instanceName", + "NameInRequest": "instanceName", + "Doc": "Name of instance.", + "Type": { + "$id": "5051", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "5052", + "Name": "brokerName", + "NameInRequest": "brokerName", + "Doc": "Name of broker.", + "Type": { + "$id": "5053", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "5054", + "Name": "accept", + "NameInRequest": "Accept", + "Type": { + "$id": "5055", + "kind": "constant", + "valueType": { + "$id": "5056", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "5057", + "StatusCodes": [ + 200 + ], + "BodyType": { + "$ref": "1120" + }, + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false, + "ContentTypes": [ + "application/json" + ] + } + ], + "HttpMethod": "GET", + "RequestBodyMediaType": "None", + "Uri": "{endpoint}", + "Path": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/brokers/{brokerName}/authentications", + "BufferResponse": true, + "Paging": { + "$id": "5058", + "ItemName": "value", + "NextLinkName": "nextLink" + }, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Microsoft.IoTOperations.BrokerAuthentication.listByResourceGroup", + "Decorators": [], + "Examples": [ + { + "$id": "5059", + "kind": "http", + "name": "BrokerAuthentication_ListByResourceGroup", + "description": "BrokerAuthentication_ListByResourceGroup", + "filePath": "2024-11-01/BrokerAuthentication_ListByResourceGroup_MaximumSet_Gen.json", + "parameters": [ + { + "$id": "5060", + "parameter": { + "$ref": "5041" + }, + "value": { + "$id": "5061", + "kind": "string", + "type": { + "$ref": "5042" + }, + "value": "2024-11-01" + } + }, + { + "$id": "5062", + "parameter": { + "$ref": "5045" + }, + "value": { + "$id": "5063", + "kind": "string", + "type": { + "$ref": "5046" + }, + "value": "F8C729F9-DF9C-4743-848F-96EE433D8E53" + } + }, + { + "$id": "5064", + "parameter": { + "$ref": "5048" + }, + "value": { + "$id": "5065", + "kind": "string", + "type": { + "$ref": "5049" + }, + "value": "rgiotoperations" + } + }, + { + "$id": "5066", + "parameter": { + "$ref": "5050" + }, + "value": { + "$id": "5067", + "kind": "string", + "type": { + "$ref": "5051" + }, + "value": "resource-name123" + } + }, + { + "$id": "5068", + "parameter": { + "$ref": "5052" + }, + "value": { + "$id": "5069", + "kind": "string", + "type": { + "$ref": "5053" + }, + "value": "resource-name123" + } + } + ], + "responses": [ + { + "$id": "5070", + "response": { + "$ref": "5057" + }, + "statusCode": 200, + "bodyValue": { + "$id": "5071", + "kind": "model", + "type": { + "$ref": "1120" + }, + "value": { + "$id": "5072", + "value": { + "$id": "5073", + "kind": "array", + "type": { + "$ref": "1122" + }, + "value": [ + { + "$id": "5074", + "kind": "model", + "type": { + "$ref": "1038" + }, + "value": { + "$id": "5075", + "properties": { + "$id": "5076", + "kind": "model", + "type": { + "$ref": "1040" + }, + "value": { + "$id": "5077", + "authenticationMethods": { + "$id": "5078", + "kind": "array", + "type": { + "$ref": "1042" + }, + "value": [ + { + "$id": "5079", + "kind": "model", + "type": { + "$ref": "1043" + }, + "value": { + "$id": "5080", + "method": { + "$id": "5081", + "kind": "string", + "type": { + "$ref": "224" + }, + "value": "Custom" + }, + "customSettings": { + "$id": "5082", + "kind": "model", + "type": { + "$ref": "1048" + }, + "value": { + "$id": "5083", + "auth": { + "$id": "5084", + "kind": "model", + "type": { + "$ref": "1050" + }, + "value": { + "$id": "5085", + "x509": { + "$id": "5086", + "kind": "model", + "type": { + "$ref": "1052" + }, + "value": { + "$id": "5087", + "secretRef": { + "$id": "5088", + "kind": "string", + "type": { + "$ref": "1054" + }, + "value": "secret-name" + } + } + } + } + }, + "caCertConfigMap": { + "$id": "5089", + "kind": "string", + "type": { + "$ref": "1062" + }, + "value": "pdecudefqyolvncbus" + }, + "endpoint": { + "$id": "5090", + "kind": "string", + "type": { + "$ref": "1066" + }, + "value": "https://www.example.com" + }, + "headers": { + "$id": "5091", + "kind": "dict", + "type": { + "$ref": "1070" + }, + "value": { + "$id": "5092", + "key8518": { + "$id": "5093", + "kind": "string", + "type": { + "$ref": "1072" + }, + "value": "bwityjy" + } + } + } + } + }, + "serviceAccountTokenSettings": { + "$id": "5094", + "kind": "model", + "type": { + "$ref": "1078" + }, + "value": { + "$id": "5095", + "audiences": { + "$id": "5096", + "kind": "array", + "type": { + "$ref": "1080" + }, + "value": [ + { + "$id": "5097", + "kind": "string", + "type": { + "$ref": "1081" + }, + "value": "jqyhyqatuydg" + } + ] + } + } + }, + "x509Settings": { + "$id": "5098", + "kind": "model", + "type": { + "$ref": "1087" + }, + "value": { + "$id": "5099", + "authorizationAttributes": { + "$id": "5100", + "kind": "dict", + "type": { + "$ref": "1089" + }, + "value": { + "$id": "5101", + "key3384": { + "$id": "5102", + "kind": "model", + "type": { + "$ref": "1091" + }, + "value": { + "$id": "5103", + "attributes": { + "$id": "5104", + "kind": "dict", + "type": { + "$ref": "1093" + }, + "value": { + "$id": "5105", + "key186": { + "$id": "5106", + "kind": "string", + "type": { + "$ref": "1095" + }, + "value": "ucpajramsz" + } + } + }, + "subject": { + "$id": "5107", + "kind": "string", + "type": { + "$ref": "1099" + }, + "value": "jpgwctfeixitptfgfnqhua" + } + } + } + } + }, + "trustedClientCaCert": { + "$id": "5108", + "kind": "string", + "type": { + "$ref": "1105" + }, + "value": "vlctsqddl" + } + } + } + } + } + ] + }, + "provisioningState": { + "$id": "5109", + "kind": "string", + "type": { + "$ref": "126" + }, + "value": "Succeeded" + } + } + }, + "extendedLocation": { + "$id": "5110", + "kind": "model", + "type": { + "$ref": "669" + }, + "value": { + "$id": "5111", + "name": { + "$id": "5112", + "kind": "string", + "type": { + "$ref": "671" + }, + "value": "qmbrfwcpwwhggszhrdjv" + }, + "type": { + "$id": "5113", + "kind": "string", + "type": { + "$ref": "142" + }, + "value": "CustomLocation" + } + } + }, + "id": { + "$id": "5114", + "kind": "string", + "type": { + "$ref": "330" + }, + "value": "/subscriptions/0000000-0000-0000-0000-000000000000/resourceGroups/resourceGroup123/providers/Microsoft.IoTOperations/instances/resource-name123/brokers/resource-name123/authentications/resource-name123" + }, + "name": { + "$id": "5115", + "kind": "string", + "type": { + "$ref": "335" + }, + "value": "lwucizfvtsdpx" + }, + "type": { + "$id": "5116", + "kind": "string", + "type": { + "$ref": "339" + }, + "value": "kvtilkgcxanlfozrd" + }, + "systemData": { + "$id": "5117", + "kind": "model", + "type": { + "$ref": "344" + }, + "value": { + "$id": "5118", + "createdBy": { + "$id": "5119", + "kind": "string", + "type": { + "$ref": "346" + }, + "value": "ssvaslsmudloholronopqyxjcu" + }, + "createdByType": { + "$id": "5120", + "kind": "string", + "type": { + "$ref": "146" + }, + "value": "User" + }, + "createdAt": { + "$id": "5121", + "kind": "string", + "type": { + "$ref": "353" + }, + "value": "2024-08-09T18:13:29.389Z" + }, + "lastModifiedBy": { + "$id": "5122", + "kind": "string", + "type": { + "$ref": "358" + }, + "value": "gnicpuszwd" + }, + "lastModifiedByType": { + "$id": "5123", + "kind": "string", + "type": { + "$ref": "146" + }, + "value": "User" + }, + "lastModifiedAt": { + "$id": "5124", + "kind": "string", + "type": { + "$ref": "365" + }, + "value": "2024-08-09T18:13:29.389Z" + } + } + } + } + } + ] + }, + "nextLink": { + "$id": "5125", + "kind": "string", + "type": { + "$ref": "1126" + }, + "value": "https://microsoft.com/a" + } + } + } + } + ] + } + ] + } + ], + "Protocol": { + "$id": "5126" + }, + "Parent": "IoTOperationsClient", + "Parameters": [ + { + "$id": "5127", + "Name": "endpoint", + "NameInRequest": "endpoint", + "Doc": "Service host", + "Type": { + "$id": "5128", + "kind": "url", + "name": "url", + "crossLanguageDefinitionId": "TypeSpec.url" + }, + "Location": "Uri", + "IsApiVersion": false, + "IsResourceParameter": false, + "IsContentType": false, + "IsRequired": true, + "IsEndpoint": true, + "SkipUrlEncoding": false, + "Explode": false, + "Kind": "Client", + "DefaultValue": { + "$id": "5129", + "Type": { + "$id": "5130", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "https://management.azure.com" + } + } + ], + "Decorators": [] + }, + { + "$id": "5131", + "Name": "BrokerAuthorization", + "ClientNamespace": "Microsoft.IoTOperations", + "Operations": [ + { + "$id": "5132", + "Name": "get", + "ResourceName": "BrokerAuthorizationResource", + "Doc": "Get a BrokerAuthorizationResource", + "Accessibility": "public", + "Parameters": [ + { + "$id": "5133", + "Name": "apiVersion", + "NameInRequest": "api-version", + "Doc": "The API version to use for this operation.", + "Type": { + "$id": "5134", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": true, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "DefaultValue": { + "$id": "5135", + "Type": { + "$id": "5136", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "2024-11-01" + }, + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "5137", + "Name": "subscriptionId", + "NameInRequest": "subscriptionId", + "Doc": "The ID of the target subscription. The value must be an UUID.", + "Type": { + "$id": "5138", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "5139", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "5140", + "Name": "resourceGroupName", + "NameInRequest": "resourceGroupName", + "Doc": "The name of the resource group. The name is case insensitive.", + "Type": { + "$id": "5141", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "5142", + "Name": "instanceName", + "NameInRequest": "instanceName", + "Doc": "Name of instance.", + "Type": { + "$id": "5143", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "5144", + "Name": "brokerName", + "NameInRequest": "brokerName", + "Doc": "Name of broker.", + "Type": { + "$id": "5145", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "5146", + "Name": "authorizationName", + "NameInRequest": "authorizationName", + "Doc": "Name of Instance broker authorization resource", + "Type": { + "$id": "5147", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "5148", + "Name": "accept", + "NameInRequest": "Accept", + "Type": { + "$id": "5149", + "kind": "constant", + "valueType": { + "$id": "5150", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "5151", + "StatusCodes": [ + 200 + ], + "BodyType": { + "$ref": "950" + }, + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false, + "ContentTypes": [ + "application/json" + ] + } + ], + "HttpMethod": "GET", + "RequestBodyMediaType": "None", + "Uri": "{endpoint}", + "Path": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/brokers/{brokerName}/authorizations/{authorizationName}", + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Microsoft.IoTOperations.BrokerAuthorization.get", + "Decorators": [], + "Examples": [ + { + "$id": "5152", + "kind": "http", + "name": "BrokerAuthorization_Get", + "description": "BrokerAuthorization_Get", + "filePath": "2024-11-01/BrokerAuthorization_Get_MaximumSet_Gen.json", + "parameters": [ + { + "$id": "5153", + "parameter": { + "$ref": "5133" + }, + "value": { + "$id": "5154", + "kind": "string", + "type": { + "$ref": "5134" + }, + "value": "2024-11-01" + } + }, + { + "$id": "5155", + "parameter": { + "$ref": "5137" + }, + "value": { + "$id": "5156", + "kind": "string", + "type": { + "$ref": "5138" + }, + "value": "F8C729F9-DF9C-4743-848F-96EE433D8E53" + } + }, + { + "$id": "5157", + "parameter": { + "$ref": "5140" + }, + "value": { + "$id": "5158", + "kind": "string", + "type": { + "$ref": "5141" + }, + "value": "rgiotoperations" + } + }, + { + "$id": "5159", + "parameter": { + "$ref": "5142" + }, + "value": { + "$id": "5160", + "kind": "string", + "type": { + "$ref": "5143" + }, + "value": "resource-name123" + } + }, + { + "$id": "5161", + "parameter": { + "$ref": "5144" + }, + "value": { + "$id": "5162", + "kind": "string", + "type": { + "$ref": "5145" + }, + "value": "resource-name123" + } + }, + { + "$id": "5163", + "parameter": { + "$ref": "5146" + }, + "value": { + "$id": "5164", + "kind": "string", + "type": { + "$ref": "5147" + }, + "value": "resource-name123" + } + } + ], + "responses": [ + { + "$id": "5165", + "response": { + "$ref": "5151" + }, + "statusCode": 200, + "bodyValue": { + "$id": "5166", + "kind": "model", + "type": { + "$ref": "950" + }, + "value": { + "$id": "5167", + "properties": { + "$id": "5168", + "kind": "model", + "type": { + "$ref": "952" + }, + "value": { + "$id": "5169", + "authorizationPolicies": { + "$id": "5170", + "kind": "model", + "type": { + "$ref": "954" + }, + "value": { + "$id": "5171", + "cache": { + "$id": "5172", + "kind": "string", + "type": { + "$ref": "62" + }, + "value": "Enabled" + }, + "rules": { + "$id": "5173", + "kind": "array", + "type": { + "$ref": "959" + }, + "value": [ + { + "$id": "5174", + "kind": "model", + "type": { + "$ref": "960" + }, + "value": { + "$id": "5175", + "brokerResources": { + "$id": "5176", + "kind": "array", + "type": { + "$ref": "962" + }, + "value": [ + { + "$id": "5177", + "kind": "model", + "type": { + "$ref": "963" + }, + "value": { + "$id": "5178", + "method": { + "$id": "5179", + "kind": "string", + "type": { + "$ref": "200" + }, + "value": "Connect" + }, + "clientIds": { + "$id": "5180", + "kind": "array", + "type": { + "$ref": "968" + }, + "value": [ + { + "$id": "5181", + "kind": "string", + "type": { + "$ref": "969" + }, + "value": "nlc" + } + ] + }, + "topics": { + "$id": "5182", + "kind": "array", + "type": { + "$ref": "973" + }, + "value": [ + { + "$id": "5183", + "kind": "string", + "type": { + "$ref": "974" + }, + "value": "wvuca" + } + ] + } + } + } + ] + }, + "principals": { + "$id": "5184", + "kind": "model", + "type": { + "$ref": "980" + }, + "value": { + "$id": "5185", + "attributes": { + "$id": "5186", + "kind": "array", + "type": { + "$ref": "982" + }, + "value": [ + { + "$id": "5187", + "kind": "dict", + "type": { + "$ref": "983" + }, + "value": { + "$id": "5188", + "key5526": { + "$id": "5189", + "kind": "string", + "type": { + "$ref": "985" + }, + "value": "nydhzdhbldygqcn" + } + } + } + ] + }, + "clientIds": { + "$id": "5190", + "kind": "array", + "type": { + "$ref": "989" + }, + "value": [ + { + "$id": "5191", + "kind": "string", + "type": { + "$ref": "990" + }, + "value": "smopeaeddsygz" + } + ] + }, + "usernames": { + "$id": "5192", + "kind": "array", + "type": { + "$ref": "994" + }, + "value": [ + { + "$id": "5193", + "kind": "string", + "type": { + "$ref": "995" + }, + "value": "iozngyqndrteikszkbasinzdjtm" + } + ] + } + } + }, + "stateStoreResources": { + "$id": "5194", + "kind": "array", + "type": { + "$ref": "1001" + }, + "value": [ + { + "$id": "5195", + "kind": "model", + "type": { + "$ref": "1002" + }, + "value": { + "$id": "5196", + "keyType": { + "$id": "5197", + "kind": "string", + "type": { + "$ref": "208" + }, + "value": "Pattern" + }, + "keys": { + "$id": "5198", + "kind": "array", + "type": { + "$ref": "1007" + }, + "value": [ + { + "$id": "5199", + "kind": "string", + "type": { + "$ref": "1008" + }, + "value": "tkounsqtwvzyaklxjqoerpu" + } + ] + }, + "method": { + "$id": "5200", + "kind": "string", + "type": { + "$ref": "216" + }, + "value": "Read" + } + } + } + ] + } + } + } + ] + } + } + }, + "provisioningState": { + "$id": "5201", + "kind": "string", + "type": { + "$ref": "126" + }, + "value": "Succeeded" + } + } + }, + "extendedLocation": { + "$id": "5202", + "kind": "model", + "type": { + "$ref": "669" + }, + "value": { + "$id": "5203", + "name": { + "$id": "5204", + "kind": "string", + "type": { + "$ref": "671" + }, + "value": "qmbrfwcpwwhggszhrdjv" + }, + "type": { + "$id": "5205", + "kind": "string", + "type": { + "$ref": "142" + }, + "value": "CustomLocation" + } + } + }, + "id": { + "$id": "5206", + "kind": "string", + "type": { + "$ref": "330" + }, + "value": "/subscriptions/0000000-0000-0000-0000-000000000000/resourceGroups/resourceGroup123/providers/Microsoft.IoTOperations/instances/resource-name123/brokers/resource-name123/authorizations/resource-name123" + }, + "name": { + "$id": "5207", + "kind": "string", + "type": { + "$ref": "335" + }, + "value": "anqrqsvrjmlvzkrbuav" + }, + "type": { + "$id": "5208", + "kind": "string", + "type": { + "$ref": "339" + }, + "value": "yjlsfarshqoxojvgmy" + }, + "systemData": { + "$id": "5209", + "kind": "model", + "type": { + "$ref": "344" + }, + "value": { + "$id": "5210", + "createdBy": { + "$id": "5211", + "kind": "string", + "type": { + "$ref": "346" + }, + "value": "ssvaslsmudloholronopqyxjcu" + }, + "createdByType": { + "$id": "5212", + "kind": "string", + "type": { + "$ref": "146" + }, + "value": "User" + }, + "createdAt": { + "$id": "5213", + "kind": "string", + "type": { + "$ref": "353" + }, + "value": "2024-08-09T18:13:29.389Z" + }, + "lastModifiedBy": { + "$id": "5214", + "kind": "string", + "type": { + "$ref": "358" + }, + "value": "gnicpuszwd" + }, + "lastModifiedByType": { + "$id": "5215", + "kind": "string", + "type": { + "$ref": "146" + }, + "value": "User" + }, + "lastModifiedAt": { + "$id": "5216", + "kind": "string", + "type": { + "$ref": "365" + }, + "value": "2024-08-09T18:13:29.389Z" + } + } + } + } + } + } + ] + } + ] + }, + { + "$id": "5217", + "Name": "createOrUpdate", + "ResourceName": "BrokerAuthorizationResource", + "Doc": "Create a BrokerAuthorizationResource", + "Accessibility": "public", + "Parameters": [ + { + "$id": "5218", + "Name": "apiVersion", + "NameInRequest": "api-version", + "Doc": "The API version to use for this operation.", + "Type": { + "$id": "5219", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": true, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "DefaultValue": { + "$id": "5220", + "Type": { + "$id": "5221", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "2024-11-01" + }, + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "5222", + "Name": "subscriptionId", + "NameInRequest": "subscriptionId", + "Doc": "The ID of the target subscription. The value must be an UUID.", + "Type": { + "$id": "5223", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "5224", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "5225", + "Name": "resourceGroupName", + "NameInRequest": "resourceGroupName", + "Doc": "The name of the resource group. The name is case insensitive.", + "Type": { + "$id": "5226", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "5227", + "Name": "instanceName", + "NameInRequest": "instanceName", + "Doc": "Name of instance.", + "Type": { + "$id": "5228", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "5229", + "Name": "brokerName", + "NameInRequest": "brokerName", + "Doc": "Name of broker.", + "Type": { + "$id": "5230", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "5231", + "Name": "authorizationName", + "NameInRequest": "authorizationName", + "Doc": "Name of Instance broker authorization resource", + "Type": { + "$id": "5232", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "5233", + "Name": "contentType", + "NameInRequest": "Content-Type", + "Doc": "Body parameter's content type. Known values are application/json", + "Type": { + "$id": "5234", + "kind": "constant", + "valueType": { + "$id": "5235", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": true, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "5236", + "Name": "accept", + "NameInRequest": "Accept", + "Type": { + "$id": "5237", + "kind": "constant", + "valueType": { + "$id": "5238", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "5239", + "Name": "resource", + "NameInRequest": "resource", + "Doc": "Resource create parameters.", + "Type": { + "$ref": "950" + }, + "Location": "Body", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "5240", + "StatusCodes": [ + 200 + ], + "BodyType": { + "$ref": "950" + }, + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false, + "ContentTypes": [ + "application/json" + ] + }, + { + "$id": "5241", + "StatusCodes": [ + 201 + ], + "BodyType": { + "$ref": "950" + }, + "BodyMediaType": "Json", + "Headers": [ + { + "$id": "5242", + "Name": "azureAsyncOperation", + "NameInResponse": "Azure-AsyncOperation", + "Doc": "A link to the status monitor", + "Type": { + "$id": "5243", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + } + }, + { + "$id": "5244", + "Name": "retryAfter", + "NameInResponse": "Retry-After", + "Doc": "The Retry-After header can indicate how long the client should wait before polling the operation status.", + "Type": { + "$id": "5245", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + } + } + ], + "IsErrorResponse": false, + "ContentTypes": [ + "application/json" + ] + } + ], + "HttpMethod": "PUT", + "RequestBodyMediaType": "Json", + "Uri": "{endpoint}", + "Path": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/brokers/{brokerName}/authorizations/{authorizationName}", + "RequestMediaTypes": [ + "application/json" + ], + "BufferResponse": true, + "LongRunning": { + "$id": "5246", + "FinalStateVia": 0, + "FinalResponse": { + "$id": "5247", + "StatusCodes": [ + 200 + ], + "BodyType": { + "$ref": "950" + }, + "BodyMediaType": "Json" + } + }, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Microsoft.IoTOperations.BrokerAuthorization.createOrUpdate", + "Decorators": [], + "Examples": [ + { + "$id": "5248", + "kind": "http", + "name": "BrokerAuthorization_CreateOrUpdate_Complex", + "description": "BrokerAuthorization_CreateOrUpdate_Complex", + "filePath": "2024-11-01/BrokerAuthorization_CreateOrUpdate_Complex.json", + "parameters": [ + { + "$id": "5249", + "parameter": { + "$ref": "5218" + }, + "value": { + "$id": "5250", + "kind": "string", + "type": { + "$ref": "5219" + }, + "value": "2024-11-01" + } + }, + { + "$id": "5251", + "parameter": { + "$ref": "5222" + }, + "value": { + "$id": "5252", + "kind": "string", + "type": { + "$ref": "5223" + }, + "value": "F8C729F9-DF9C-4743-848F-96EE433D8E53" + } + }, + { + "$id": "5253", + "parameter": { + "$ref": "5225" + }, + "value": { + "$id": "5254", + "kind": "string", + "type": { + "$ref": "5226" + }, + "value": "rgiotoperations" + } + }, + { + "$id": "5255", + "parameter": { + "$ref": "5227" + }, + "value": { + "$id": "5256", + "kind": "string", + "type": { + "$ref": "5228" + }, + "value": "resource-name123" + } + }, + { + "$id": "5257", + "parameter": { + "$ref": "5229" + }, + "value": { + "$id": "5258", + "kind": "string", + "type": { + "$ref": "5230" + }, + "value": "resource-name123" + } + }, + { + "$id": "5259", + "parameter": { + "$ref": "5231" + }, + "value": { + "$id": "5260", + "kind": "string", + "type": { + "$ref": "5232" + }, + "value": "resource-name123" + } + }, + { + "$id": "5261", + "parameter": { + "$ref": "5239" + }, + "value": { + "$id": "5262", + "kind": "model", + "type": { + "$ref": "950" + }, + "value": { + "$id": "5263", + "properties": { + "$id": "5264", + "kind": "model", + "type": { + "$ref": "952" + }, + "value": { + "$id": "5265", + "authorizationPolicies": { + "$id": "5266", + "kind": "model", + "type": { + "$ref": "954" + }, + "value": { + "$id": "5267", + "cache": { + "$id": "5268", + "kind": "string", + "type": { + "$ref": "62" + }, + "value": "Enabled" + }, + "rules": { + "$id": "5269", + "kind": "array", + "type": { + "$ref": "959" + }, + "value": [ + { + "$id": "5270", + "kind": "model", + "type": { + "$ref": "960" + }, + "value": { + "$id": "5271", + "principals": { + "$id": "5272", + "kind": "model", + "type": { + "$ref": "980" + }, + "value": { + "$id": "5273", + "usernames": { + "$id": "5274", + "kind": "array", + "type": { + "$ref": "994" + }, + "value": [ + { + "$id": "5275", + "kind": "string", + "type": { + "$ref": "995" + }, + "value": "temperature-sensor" + }, + { + "$id": "5276", + "kind": "string", + "type": { + "$ref": "995" + }, + "value": "humidity-sensor" + } + ] + }, + "attributes": { + "$id": "5277", + "kind": "array", + "type": { + "$ref": "982" + }, + "value": [ + { + "$id": "5278", + "kind": "dict", + "type": { + "$ref": "983" + }, + "value": { + "$id": "5279", + "building": { + "$id": "5280", + "kind": "string", + "type": { + "$ref": "985" + }, + "value": "17" + }, + "organization": { + "$id": "5281", + "kind": "string", + "type": { + "$ref": "985" + }, + "value": "contoso" + } + } + } + ] + } + } + }, + "brokerResources": { + "$id": "5282", + "kind": "array", + "type": { + "$ref": "962" + }, + "value": [ + { + "$id": "5283", + "kind": "model", + "type": { + "$ref": "963" + }, + "value": { + "$id": "5284", + "method": { + "$id": "5285", + "kind": "string", + "type": { + "$ref": "200" + }, + "value": "Connect" + }, + "clientIds": { + "$id": "5286", + "kind": "array", + "type": { + "$ref": "968" + }, + "value": [ + { + "$id": "5287", + "kind": "string", + "type": { + "$ref": "969" + }, + "value": "{principal.attributes.building}*" + } + ] + } + } + }, + { + "$id": "5288", + "kind": "model", + "type": { + "$ref": "963" + }, + "value": { + "$id": "5289", + "method": { + "$id": "5290", + "kind": "string", + "type": { + "$ref": "200" + }, + "value": "Publish" + }, + "topics": { + "$id": "5291", + "kind": "array", + "type": { + "$ref": "973" + }, + "value": [ + { + "$id": "5292", + "kind": "string", + "type": { + "$ref": "974" + }, + "value": "sensors/{principal.attributes.building}/{principal.clientId}/telemetry/*" + } + ] + } + } + }, + { + "$id": "5293", + "kind": "model", + "type": { + "$ref": "963" + }, + "value": { + "$id": "5294", + "method": { + "$id": "5295", + "kind": "string", + "type": { + "$ref": "200" + }, + "value": "Subscribe" + }, + "topics": { + "$id": "5296", + "kind": "array", + "type": { + "$ref": "973" + }, + "value": [ + { + "$id": "5297", + "kind": "string", + "type": { + "$ref": "974" + }, + "value": "commands/{principal.attributes.organization}" + } + ] + } + } + } + ] + }, + "stateStoreResources": { + "$id": "5298", + "kind": "array", + "type": { + "$ref": "1001" + }, + "value": [ + { + "$id": "5299", + "kind": "model", + "type": { + "$ref": "1002" + }, + "value": { + "$id": "5300", + "method": { + "$id": "5301", + "kind": "string", + "type": { + "$ref": "216" + }, + "value": "Read" + }, + "keyType": { + "$id": "5302", + "kind": "string", + "type": { + "$ref": "208" + }, + "value": "Pattern" + }, + "keys": { + "$id": "5303", + "kind": "array", + "type": { + "$ref": "1007" + }, + "value": [ + { + "$id": "5304", + "kind": "string", + "type": { + "$ref": "1008" + }, + "value": "myreadkey" + }, + { + "$id": "5305", + "kind": "string", + "type": { + "$ref": "1008" + }, + "value": "myotherkey?" + }, + { + "$id": "5306", + "kind": "string", + "type": { + "$ref": "1008" + }, + "value": "mynumerickeysuffix[0-9]" + }, + { + "$id": "5307", + "kind": "string", + "type": { + "$ref": "1008" + }, + "value": "clients:{principal.clientId}:*" + } + ] + } + } + }, + { + "$id": "5308", + "kind": "model", + "type": { + "$ref": "1002" + }, + "value": { + "$id": "5309", + "method": { + "$id": "5310", + "kind": "string", + "type": { + "$ref": "216" + }, + "value": "ReadWrite" + }, + "keyType": { + "$id": "5311", + "kind": "string", + "type": { + "$ref": "208" + }, + "value": "Binary" + }, + "keys": { + "$id": "5312", + "kind": "array", + "type": { + "$ref": "1007" + }, + "value": [ + { + "$id": "5313", + "kind": "string", + "type": { + "$ref": "1008" + }, + "value": "MTE2IDEwMSAxMTUgMTE2" + } + ] + } + } + } + ] + } + } + } + ] + } + } + } + } + }, + "extendedLocation": { + "$id": "5314", + "kind": "model", + "type": { + "$ref": "669" + }, + "value": { + "$id": "5315", + "name": { + "$id": "5316", + "kind": "string", + "type": { + "$ref": "671" + }, + "value": "qmbrfwcpwwhggszhrdjv" + }, + "type": { + "$id": "5317", + "kind": "string", + "type": { + "$ref": "142" + }, + "value": "CustomLocation" + } + } + } + } + } + } + ], + "responses": [ + { + "$id": "5318", + "response": { + "$ref": "5240" + }, + "statusCode": 200, + "bodyValue": { + "$id": "5319", + "kind": "model", + "type": { + "$ref": "950" + }, + "value": { + "$id": "5320", + "properties": { + "$id": "5321", + "kind": "model", + "type": { + "$ref": "952" + }, + "value": { + "$id": "5322", + "authorizationPolicies": { + "$id": "5323", + "kind": "model", + "type": { + "$ref": "954" + }, + "value": { + "$id": "5324", + "cache": { + "$id": "5325", + "kind": "string", + "type": { + "$ref": "62" + }, + "value": "Enabled" + }, + "rules": { + "$id": "5326", + "kind": "array", + "type": { + "$ref": "959" + }, + "value": [ + { + "$id": "5327", + "kind": "model", + "type": { + "$ref": "960" + }, + "value": { + "$id": "5328", + "principals": { + "$id": "5329", + "kind": "model", + "type": { + "$ref": "980" + }, + "value": { + "$id": "5330", + "usernames": { + "$id": "5331", + "kind": "array", + "type": { + "$ref": "994" + }, + "value": [ + { + "$id": "5332", + "kind": "string", + "type": { + "$ref": "995" + }, + "value": "temperature-sensor" + }, + { + "$id": "5333", + "kind": "string", + "type": { + "$ref": "995" + }, + "value": "humidity-sensor" + } + ] + }, + "attributes": { + "$id": "5334", + "kind": "array", + "type": { + "$ref": "982" + }, + "value": [ + { + "$id": "5335", + "kind": "dict", + "type": { + "$ref": "983" + }, + "value": { + "$id": "5336", + "building": { + "$id": "5337", + "kind": "string", + "type": { + "$ref": "985" + }, + "value": "17" + }, + "organization": { + "$id": "5338", + "kind": "string", + "type": { + "$ref": "985" + }, + "value": "contoso" + } + } + } + ] + } + } + }, + "brokerResources": { + "$id": "5339", + "kind": "array", + "type": { + "$ref": "962" + }, + "value": [ + { + "$id": "5340", + "kind": "model", + "type": { + "$ref": "963" + }, + "value": { + "$id": "5341", + "method": { + "$id": "5342", + "kind": "string", + "type": { + "$ref": "200" + }, + "value": "Connect" + }, + "clientIds": { + "$id": "5343", + "kind": "array", + "type": { + "$ref": "968" + }, + "value": [ + { + "$id": "5344", + "kind": "string", + "type": { + "$ref": "969" + }, + "value": "{principal.attributes.building}*" + } + ] + } + } + }, + { + "$id": "5345", + "kind": "model", + "type": { + "$ref": "963" + }, + "value": { + "$id": "5346", + "method": { + "$id": "5347", + "kind": "string", + "type": { + "$ref": "200" + }, + "value": "Publish" + }, + "topics": { + "$id": "5348", + "kind": "array", + "type": { + "$ref": "973" + }, + "value": [ + { + "$id": "5349", + "kind": "string", + "type": { + "$ref": "974" + }, + "value": "sensors/{principal.attributes.building}/{principal.clientId}/telemetry/*" + } + ] + } + } + }, + { + "$id": "5350", + "kind": "model", + "type": { + "$ref": "963" + }, + "value": { + "$id": "5351", + "method": { + "$id": "5352", + "kind": "string", + "type": { + "$ref": "200" + }, + "value": "Subscribe" + }, + "topics": { + "$id": "5353", + "kind": "array", + "type": { + "$ref": "973" + }, + "value": [ + { + "$id": "5354", + "kind": "string", + "type": { + "$ref": "974" + }, + "value": "commands/{principal.attributes.organization}" + } + ] + } + } + } + ] + }, + "stateStoreResources": { + "$id": "5355", + "kind": "array", + "type": { + "$ref": "1001" + }, + "value": [ + { + "$id": "5356", + "kind": "model", + "type": { + "$ref": "1002" + }, + "value": { + "$id": "5357", + "method": { + "$id": "5358", + "kind": "string", + "type": { + "$ref": "216" + }, + "value": "Read" + }, + "keyType": { + "$id": "5359", + "kind": "string", + "type": { + "$ref": "208" + }, + "value": "Pattern" + }, + "keys": { + "$id": "5360", + "kind": "array", + "type": { + "$ref": "1007" + }, + "value": [ + { + "$id": "5361", + "kind": "string", + "type": { + "$ref": "1008" + }, + "value": "myreadkey" + }, + { + "$id": "5362", + "kind": "string", + "type": { + "$ref": "1008" + }, + "value": "myotherkey?" + }, + { + "$id": "5363", + "kind": "string", + "type": { + "$ref": "1008" + }, + "value": "mynumerickeysuffix[0-9]" + }, + { + "$id": "5364", + "kind": "string", + "type": { + "$ref": "1008" + }, + "value": "clients:{principal.clientId}:*" + } + ] + } + } + }, + { + "$id": "5365", + "kind": "model", + "type": { + "$ref": "1002" + }, + "value": { + "$id": "5366", + "method": { + "$id": "5367", + "kind": "string", + "type": { + "$ref": "216" + }, + "value": "ReadWrite" + }, + "keyType": { + "$id": "5368", + "kind": "string", + "type": { + "$ref": "208" + }, + "value": "Binary" + }, + "keys": { + "$id": "5369", + "kind": "array", + "type": { + "$ref": "1007" + }, + "value": [ + { + "$id": "5370", + "kind": "string", + "type": { + "$ref": "1008" + }, + "value": "MTE2IDEwMSAxMTUgMTE2" + } + ] + } + } + } + ] + } + } + } + ] + } + } + }, + "provisioningState": { + "$id": "5371", + "kind": "string", + "type": { + "$ref": "126" + }, + "value": "Succeeded" + } + } + }, + "extendedLocation": { + "$id": "5372", + "kind": "model", + "type": { + "$ref": "669" + }, + "value": { + "$id": "5373", + "name": { + "$id": "5374", + "kind": "string", + "type": { + "$ref": "671" + }, + "value": "qmbrfwcpwwhggszhrdjv" + }, + "type": { + "$id": "5375", + "kind": "string", + "type": { + "$ref": "142" + }, + "value": "CustomLocation" + } + } + }, + "id": { + "$id": "5376", + "kind": "string", + "type": { + "$ref": "330" + }, + "value": "/subscriptions/0000000-0000-0000-0000-000000000000/resourceGroups/resourceGroup123/providers/Microsoft.IoTOperations/instances/resource-name123/brokers/resource-name123/authorizations/resource-name123" + }, + "name": { + "$id": "5377", + "kind": "string", + "type": { + "$ref": "335" + }, + "value": "anqrqsvrjmlvzkrbuav" + }, + "type": { + "$id": "5378", + "kind": "string", + "type": { + "$ref": "339" + }, + "value": "yjlsfarshqoxojvgmy" + }, + "systemData": { + "$id": "5379", + "kind": "model", + "type": { + "$ref": "344" + }, + "value": { + "$id": "5380", + "createdBy": { + "$id": "5381", + "kind": "string", + "type": { + "$ref": "346" + }, + "value": "ssvaslsmudloholronopqyxjcu" + }, + "createdByType": { + "$id": "5382", + "kind": "string", + "type": { + "$ref": "146" + }, + "value": "User" + }, + "createdAt": { + "$id": "5383", + "kind": "string", + "type": { + "$ref": "353" + }, + "value": "2024-08-09T18:13:29.389Z" + }, + "lastModifiedBy": { + "$id": "5384", + "kind": "string", + "type": { + "$ref": "358" + }, + "value": "gnicpuszwd" + }, + "lastModifiedByType": { + "$id": "5385", + "kind": "string", + "type": { + "$ref": "146" + }, + "value": "User" + }, + "lastModifiedAt": { + "$id": "5386", + "kind": "string", + "type": { + "$ref": "365" + }, + "value": "2024-08-09T18:13:29.389Z" + } + } + } + } + } + }, + { + "$id": "5387", + "response": { + "$ref": "5241" + }, + "statusCode": 201, + "bodyValue": { + "$id": "5388", + "kind": "model", + "type": { + "$ref": "950" + }, + "value": { + "$id": "5389", + "properties": { + "$id": "5390", + "kind": "model", + "type": { + "$ref": "952" + }, + "value": { + "$id": "5391", + "authorizationPolicies": { + "$id": "5392", + "kind": "model", + "type": { + "$ref": "954" + }, + "value": { + "$id": "5393", + "cache": { + "$id": "5394", + "kind": "string", + "type": { + "$ref": "62" + }, + "value": "Enabled" + }, + "rules": { + "$id": "5395", + "kind": "array", + "type": { + "$ref": "959" + }, + "value": [ + { + "$id": "5396", + "kind": "model", + "type": { + "$ref": "960" + }, + "value": { + "$id": "5397", + "principals": { + "$id": "5398", + "kind": "model", + "type": { + "$ref": "980" + }, + "value": { + "$id": "5399", + "usernames": { + "$id": "5400", + "kind": "array", + "type": { + "$ref": "994" + }, + "value": [ + { + "$id": "5401", + "kind": "string", + "type": { + "$ref": "995" + }, + "value": "temperature-sensor" + }, + { + "$id": "5402", + "kind": "string", + "type": { + "$ref": "995" + }, + "value": "humidity-sensor" + } + ] + }, + "attributes": { + "$id": "5403", + "kind": "array", + "type": { + "$ref": "982" + }, + "value": [ + { + "$id": "5404", + "kind": "dict", + "type": { + "$ref": "983" + }, + "value": { + "$id": "5405", + "building": { + "$id": "5406", + "kind": "string", + "type": { + "$ref": "985" + }, + "value": "17" + }, + "organization": { + "$id": "5407", + "kind": "string", + "type": { + "$ref": "985" + }, + "value": "contoso" + } + } + } + ] + } + } + }, + "brokerResources": { + "$id": "5408", + "kind": "array", + "type": { + "$ref": "962" + }, + "value": [ + { + "$id": "5409", + "kind": "model", + "type": { + "$ref": "963" + }, + "value": { + "$id": "5410", + "method": { + "$id": "5411", + "kind": "string", + "type": { + "$ref": "200" + }, + "value": "Connect" + }, + "clientIds": { + "$id": "5412", + "kind": "array", + "type": { + "$ref": "968" + }, + "value": [ + { + "$id": "5413", + "kind": "string", + "type": { + "$ref": "969" + }, + "value": "{principal.attributes.building}*" + } + ] + } + } + }, + { + "$id": "5414", + "kind": "model", + "type": { + "$ref": "963" + }, + "value": { + "$id": "5415", + "method": { + "$id": "5416", + "kind": "string", + "type": { + "$ref": "200" + }, + "value": "Publish" + }, + "topics": { + "$id": "5417", + "kind": "array", + "type": { + "$ref": "973" + }, + "value": [ + { + "$id": "5418", + "kind": "string", + "type": { + "$ref": "974" + }, + "value": "sensors/{principal.attributes.building}/{principal.clientId}/telemetry/*" + } + ] + } + } + }, + { + "$id": "5419", + "kind": "model", + "type": { + "$ref": "963" + }, + "value": { + "$id": "5420", + "method": { + "$id": "5421", + "kind": "string", + "type": { + "$ref": "200" + }, + "value": "Subscribe" + }, + "topics": { + "$id": "5422", + "kind": "array", + "type": { + "$ref": "973" + }, + "value": [ + { + "$id": "5423", + "kind": "string", + "type": { + "$ref": "974" + }, + "value": "commands/{principal.attributes.organization}" + } + ] + } + } + } + ] + }, + "stateStoreResources": { + "$id": "5424", + "kind": "array", + "type": { + "$ref": "1001" + }, + "value": [ + { + "$id": "5425", + "kind": "model", + "type": { + "$ref": "1002" + }, + "value": { + "$id": "5426", + "method": { + "$id": "5427", + "kind": "string", + "type": { + "$ref": "216" + }, + "value": "Read" + }, + "keyType": { + "$id": "5428", + "kind": "string", + "type": { + "$ref": "208" + }, + "value": "Pattern" + }, + "keys": { + "$id": "5429", + "kind": "array", + "type": { + "$ref": "1007" + }, + "value": [ + { + "$id": "5430", + "kind": "string", + "type": { + "$ref": "1008" + }, + "value": "myreadkey" + }, + { + "$id": "5431", + "kind": "string", + "type": { + "$ref": "1008" + }, + "value": "myotherkey?" + }, + { + "$id": "5432", + "kind": "string", + "type": { + "$ref": "1008" + }, + "value": "mynumerickeysuffix[0-9]" + }, + { + "$id": "5433", + "kind": "string", + "type": { + "$ref": "1008" + }, + "value": "clients:{principal.clientId}:*" + } + ] + } + } + }, + { + "$id": "5434", + "kind": "model", + "type": { + "$ref": "1002" + }, + "value": { + "$id": "5435", + "method": { + "$id": "5436", + "kind": "string", + "type": { + "$ref": "216" + }, + "value": "ReadWrite" + }, + "keyType": { + "$id": "5437", + "kind": "string", + "type": { + "$ref": "208" + }, + "value": "Binary" + }, + "keys": { + "$id": "5438", + "kind": "array", + "type": { + "$ref": "1007" + }, + "value": [ + { + "$id": "5439", + "kind": "string", + "type": { + "$ref": "1008" + }, + "value": "MTE2IDEwMSAxMTUgMTE2" + } + ] + } + } + } + ] + } + } + } + ] + } + } + }, + "provisioningState": { + "$id": "5440", + "kind": "string", + "type": { + "$ref": "126" + }, + "value": "Succeeded" + } + } + }, + "extendedLocation": { + "$id": "5441", + "kind": "model", + "type": { + "$ref": "669" + }, + "value": { + "$id": "5442", + "name": { + "$id": "5443", + "kind": "string", + "type": { + "$ref": "671" + }, + "value": "qmbrfwcpwwhggszhrdjv" + }, + "type": { + "$id": "5444", + "kind": "string", + "type": { + "$ref": "142" + }, + "value": "CustomLocation" + } + } + }, + "id": { + "$id": "5445", + "kind": "string", + "type": { + "$ref": "330" + }, + "value": "/subscriptions/0000000-0000-0000-0000-000000000000/resourceGroups/resourceGroup123/providers/Microsoft.IoTOperations/instances/resource-name123/brokers/resource-name123/authorizations/resource-name123" + }, + "name": { + "$id": "5446", + "kind": "string", + "type": { + "$ref": "335" + }, + "value": "anqrqsvrjmlvzkrbuav" + }, + "type": { + "$id": "5447", + "kind": "string", + "type": { + "$ref": "339" + }, + "value": "yjlsfarshqoxojvgmy" + }, + "systemData": { + "$id": "5448", + "kind": "model", + "type": { + "$ref": "344" + }, + "value": { + "$id": "5449", + "createdBy": { + "$id": "5450", + "kind": "string", + "type": { + "$ref": "346" + }, + "value": "ssvaslsmudloholronopqyxjcu" + }, + "createdByType": { + "$id": "5451", + "kind": "string", + "type": { + "$ref": "146" + }, + "value": "User" + }, + "createdAt": { + "$id": "5452", + "kind": "string", + "type": { + "$ref": "353" + }, + "value": "2024-08-09T18:13:29.389Z" + }, + "lastModifiedBy": { + "$id": "5453", + "kind": "string", + "type": { + "$ref": "358" + }, + "value": "gnicpuszwd" + }, + "lastModifiedByType": { + "$id": "5454", + "kind": "string", + "type": { + "$ref": "146" + }, + "value": "User" + }, + "lastModifiedAt": { + "$id": "5455", + "kind": "string", + "type": { + "$ref": "365" + }, + "value": "2024-08-09T18:13:29.389Z" + } + } + } + } + } + } + ] + }, + { + "$id": "5456", + "kind": "http", + "name": "BrokerAuthorization_CreateOrUpdate", + "description": "BrokerAuthorization_CreateOrUpdate", + "filePath": "2024-11-01/BrokerAuthorization_CreateOrUpdate_MaximumSet_Gen.json", + "parameters": [ + { + "$id": "5457", + "parameter": { + "$ref": "5218" + }, + "value": { + "$id": "5458", + "kind": "string", + "type": { + "$ref": "5219" + }, + "value": "2024-11-01" + } + }, + { + "$id": "5459", + "parameter": { + "$ref": "5222" + }, + "value": { + "$id": "5460", + "kind": "string", + "type": { + "$ref": "5223" + }, + "value": "F8C729F9-DF9C-4743-848F-96EE433D8E53" + } + }, + { + "$id": "5461", + "parameter": { + "$ref": "5225" + }, + "value": { + "$id": "5462", + "kind": "string", + "type": { + "$ref": "5226" + }, + "value": "rgiotoperations" + } + }, + { + "$id": "5463", + "parameter": { + "$ref": "5227" + }, + "value": { + "$id": "5464", + "kind": "string", + "type": { + "$ref": "5228" + }, + "value": "resource-name123" + } + }, + { + "$id": "5465", + "parameter": { + "$ref": "5229" + }, + "value": { + "$id": "5466", + "kind": "string", + "type": { + "$ref": "5230" + }, + "value": "resource-name123" + } + }, + { + "$id": "5467", + "parameter": { + "$ref": "5231" + }, + "value": { + "$id": "5468", + "kind": "string", + "type": { + "$ref": "5232" + }, + "value": "resource-name123" + } + }, + { + "$id": "5469", + "parameter": { + "$ref": "5239" + }, + "value": { + "$id": "5470", + "kind": "model", + "type": { + "$ref": "950" + }, + "value": { + "$id": "5471", + "properties": { + "$id": "5472", + "kind": "model", + "type": { + "$ref": "952" + }, + "value": { + "$id": "5473", + "authorizationPolicies": { + "$id": "5474", + "kind": "model", + "type": { + "$ref": "954" + }, + "value": { + "$id": "5475", + "cache": { + "$id": "5476", + "kind": "string", + "type": { + "$ref": "62" + }, + "value": "Enabled" + }, + "rules": { + "$id": "5477", + "kind": "array", + "type": { + "$ref": "959" + }, + "value": [ + { + "$id": "5478", + "kind": "model", + "type": { + "$ref": "960" + }, + "value": { + "$id": "5479", + "brokerResources": { + "$id": "5480", + "kind": "array", + "type": { + "$ref": "962" + }, + "value": [ + { + "$id": "5481", + "kind": "model", + "type": { + "$ref": "963" + }, + "value": { + "$id": "5482", + "method": { + "$id": "5483", + "kind": "string", + "type": { + "$ref": "200" + }, + "value": "Connect" + }, + "clientIds": { + "$id": "5484", + "kind": "array", + "type": { + "$ref": "968" + }, + "value": [ + { + "$id": "5485", + "kind": "string", + "type": { + "$ref": "969" + }, + "value": "nlc" + } + ] + }, + "topics": { + "$id": "5486", + "kind": "array", + "type": { + "$ref": "973" + }, + "value": [ + { + "$id": "5487", + "kind": "string", + "type": { + "$ref": "974" + }, + "value": "wvuca" + } + ] + } + } + } + ] + }, + "principals": { + "$id": "5488", + "kind": "model", + "type": { + "$ref": "980" + }, + "value": { + "$id": "5489", + "attributes": { + "$id": "5490", + "kind": "array", + "type": { + "$ref": "982" + }, + "value": [ + { + "$id": "5491", + "kind": "dict", + "type": { + "$ref": "983" + }, + "value": { + "$id": "5492", + "key5526": { + "$id": "5493", + "kind": "string", + "type": { + "$ref": "985" + }, + "value": "nydhzdhbldygqcn" + } + } + } + ] + }, + "clientIds": { + "$id": "5494", + "kind": "array", + "type": { + "$ref": "989" + }, + "value": [ + { + "$id": "5495", + "kind": "string", + "type": { + "$ref": "990" + }, + "value": "smopeaeddsygz" + } + ] + }, + "usernames": { + "$id": "5496", + "kind": "array", + "type": { + "$ref": "994" + }, + "value": [ + { + "$id": "5497", + "kind": "string", + "type": { + "$ref": "995" + }, + "value": "iozngyqndrteikszkbasinzdjtm" + } + ] + } + } + }, + "stateStoreResources": { + "$id": "5498", + "kind": "array", + "type": { + "$ref": "1001" + }, + "value": [ + { + "$id": "5499", + "kind": "model", + "type": { + "$ref": "1002" + }, + "value": { + "$id": "5500", + "keyType": { + "$id": "5501", + "kind": "string", + "type": { + "$ref": "208" + }, + "value": "Pattern" + }, + "keys": { + "$id": "5502", + "kind": "array", + "type": { + "$ref": "1007" + }, + "value": [ + { + "$id": "5503", + "kind": "string", + "type": { + "$ref": "1008" + }, + "value": "tkounsqtwvzyaklxjqoerpu" + } + ] + }, + "method": { + "$id": "5504", + "kind": "string", + "type": { + "$ref": "216" + }, + "value": "Read" + } + } + } + ] + } + } + } + ] + } + } + } + } + }, + "extendedLocation": { + "$id": "5505", + "kind": "model", + "type": { + "$ref": "669" + }, + "value": { + "$id": "5506", + "name": { + "$id": "5507", + "kind": "string", + "type": { + "$ref": "671" + }, + "value": "qmbrfwcpwwhggszhrdjv" + }, + "type": { + "$id": "5508", + "kind": "string", + "type": { + "$ref": "142" + }, + "value": "CustomLocation" + } + } + } + } + } + } + ], + "responses": [ + { + "$id": "5509", + "response": { + "$ref": "5240" + }, + "statusCode": 200, + "bodyValue": { + "$id": "5510", + "kind": "model", + "type": { + "$ref": "950" + }, + "value": { + "$id": "5511", + "properties": { + "$id": "5512", + "kind": "model", + "type": { + "$ref": "952" + }, + "value": { + "$id": "5513", + "authorizationPolicies": { + "$id": "5514", + "kind": "model", + "type": { + "$ref": "954" + }, + "value": { + "$id": "5515", + "cache": { + "$id": "5516", + "kind": "string", + "type": { + "$ref": "62" + }, + "value": "Enabled" + }, + "rules": { + "$id": "5517", + "kind": "array", + "type": { + "$ref": "959" + }, + "value": [ + { + "$id": "5518", + "kind": "model", + "type": { + "$ref": "960" + }, + "value": { + "$id": "5519", + "brokerResources": { + "$id": "5520", + "kind": "array", + "type": { + "$ref": "962" + }, + "value": [ + { + "$id": "5521", + "kind": "model", + "type": { + "$ref": "963" + }, + "value": { + "$id": "5522", + "method": { + "$id": "5523", + "kind": "string", + "type": { + "$ref": "200" + }, + "value": "Connect" + }, + "clientIds": { + "$id": "5524", + "kind": "array", + "type": { + "$ref": "968" + }, + "value": [ + { + "$id": "5525", + "kind": "string", + "type": { + "$ref": "969" + }, + "value": "nlc" + } + ] + }, + "topics": { + "$id": "5526", + "kind": "array", + "type": { + "$ref": "973" + }, + "value": [ + { + "$id": "5527", + "kind": "string", + "type": { + "$ref": "974" + }, + "value": "wvuca" + } + ] + } + } + } + ] + }, + "principals": { + "$id": "5528", + "kind": "model", + "type": { + "$ref": "980" + }, + "value": { + "$id": "5529", + "attributes": { + "$id": "5530", + "kind": "array", + "type": { + "$ref": "982" + }, + "value": [ + { + "$id": "5531", + "kind": "dict", + "type": { + "$ref": "983" + }, + "value": { + "$id": "5532", + "key5526": { + "$id": "5533", + "kind": "string", + "type": { + "$ref": "985" + }, + "value": "nydhzdhbldygqcn" + } + } + } + ] + }, + "clientIds": { + "$id": "5534", + "kind": "array", + "type": { + "$ref": "989" + }, + "value": [ + { + "$id": "5535", + "kind": "string", + "type": { + "$ref": "990" + }, + "value": "smopeaeddsygz" + } + ] + }, + "usernames": { + "$id": "5536", + "kind": "array", + "type": { + "$ref": "994" + }, + "value": [ + { + "$id": "5537", + "kind": "string", + "type": { + "$ref": "995" + }, + "value": "iozngyqndrteikszkbasinzdjtm" + } + ] + } + } + }, + "stateStoreResources": { + "$id": "5538", + "kind": "array", + "type": { + "$ref": "1001" + }, + "value": [ + { + "$id": "5539", + "kind": "model", + "type": { + "$ref": "1002" + }, + "value": { + "$id": "5540", + "keyType": { + "$id": "5541", + "kind": "string", + "type": { + "$ref": "208" + }, + "value": "Pattern" + }, + "keys": { + "$id": "5542", + "kind": "array", + "type": { + "$ref": "1007" + }, + "value": [ + { + "$id": "5543", + "kind": "string", + "type": { + "$ref": "1008" + }, + "value": "tkounsqtwvzyaklxjqoerpu" + } + ] + }, + "method": { + "$id": "5544", + "kind": "string", + "type": { + "$ref": "216" + }, + "value": "Read" + } + } + } + ] + } + } + } + ] + } + } + }, + "provisioningState": { + "$id": "5545", + "kind": "string", + "type": { + "$ref": "126" + }, + "value": "Succeeded" + } + } + }, + "extendedLocation": { + "$id": "5546", + "kind": "model", + "type": { + "$ref": "669" + }, + "value": { + "$id": "5547", + "name": { + "$id": "5548", + "kind": "string", + "type": { + "$ref": "671" + }, + "value": "qmbrfwcpwwhggszhrdjv" + }, + "type": { + "$id": "5549", + "kind": "string", + "type": { + "$ref": "142" + }, + "value": "CustomLocation" + } + } + }, + "id": { + "$id": "5550", + "kind": "string", + "type": { + "$ref": "330" + }, + "value": "/subscriptions/0000000-0000-0000-0000-000000000000/resourceGroups/resourceGroup123/providers/Microsoft.IoTOperations/instances/resource-name123/brokers/resource-name123/authorizations/resource-name123" + }, + "name": { + "$id": "5551", + "kind": "string", + "type": { + "$ref": "335" + }, + "value": "anqrqsvrjmlvzkrbuav" + }, + "type": { + "$id": "5552", + "kind": "string", + "type": { + "$ref": "339" + }, + "value": "yjlsfarshqoxojvgmy" + }, + "systemData": { + "$id": "5553", + "kind": "model", + "type": { + "$ref": "344" + }, + "value": { + "$id": "5554", + "createdBy": { + "$id": "5555", + "kind": "string", + "type": { + "$ref": "346" + }, + "value": "ssvaslsmudloholronopqyxjcu" + }, + "createdByType": { + "$id": "5556", + "kind": "string", + "type": { + "$ref": "146" + }, + "value": "User" + }, + "createdAt": { + "$id": "5557", + "kind": "string", + "type": { + "$ref": "353" + }, + "value": "2024-08-09T18:13:29.389Z" + }, + "lastModifiedBy": { + "$id": "5558", + "kind": "string", + "type": { + "$ref": "358" + }, + "value": "gnicpuszwd" + }, + "lastModifiedByType": { + "$id": "5559", + "kind": "string", + "type": { + "$ref": "146" + }, + "value": "User" + }, + "lastModifiedAt": { + "$id": "5560", + "kind": "string", + "type": { + "$ref": "365" + }, + "value": "2024-08-09T18:13:29.389Z" + } + } + } + } + } + }, + { + "$id": "5561", + "response": { + "$ref": "5241" + }, + "statusCode": 201, + "bodyValue": { + "$id": "5562", + "kind": "model", + "type": { + "$ref": "950" + }, + "value": { + "$id": "5563", + "properties": { + "$id": "5564", + "kind": "model", + "type": { + "$ref": "952" + }, + "value": { + "$id": "5565", + "authorizationPolicies": { + "$id": "5566", + "kind": "model", + "type": { + "$ref": "954" + }, + "value": { + "$id": "5567", + "cache": { + "$id": "5568", + "kind": "string", + "type": { + "$ref": "62" + }, + "value": "Enabled" + }, + "rules": { + "$id": "5569", + "kind": "array", + "type": { + "$ref": "959" + }, + "value": [ + { + "$id": "5570", + "kind": "model", + "type": { + "$ref": "960" + }, + "value": { + "$id": "5571", + "brokerResources": { + "$id": "5572", + "kind": "array", + "type": { + "$ref": "962" + }, + "value": [ + { + "$id": "5573", + "kind": "model", + "type": { + "$ref": "963" + }, + "value": { + "$id": "5574", + "method": { + "$id": "5575", + "kind": "string", + "type": { + "$ref": "200" + }, + "value": "Connect" + }, + "clientIds": { + "$id": "5576", + "kind": "array", + "type": { + "$ref": "968" + }, + "value": [ + { + "$id": "5577", + "kind": "string", + "type": { + "$ref": "969" + }, + "value": "nlc" + } + ] + }, + "topics": { + "$id": "5578", + "kind": "array", + "type": { + "$ref": "973" + }, + "value": [ + { + "$id": "5579", + "kind": "string", + "type": { + "$ref": "974" + }, + "value": "wvuca" + } + ] + } + } + } + ] + }, + "principals": { + "$id": "5580", + "kind": "model", + "type": { + "$ref": "980" + }, + "value": { + "$id": "5581", + "attributes": { + "$id": "5582", + "kind": "array", + "type": { + "$ref": "982" + }, + "value": [ + { + "$id": "5583", + "kind": "dict", + "type": { + "$ref": "983" + }, + "value": { + "$id": "5584", + "key5526": { + "$id": "5585", + "kind": "string", + "type": { + "$ref": "985" + }, + "value": "nydhzdhbldygqcn" + } + } + } + ] + }, + "clientIds": { + "$id": "5586", + "kind": "array", + "type": { + "$ref": "989" + }, + "value": [ + { + "$id": "5587", + "kind": "string", + "type": { + "$ref": "990" + }, + "value": "smopeaeddsygz" + } + ] + }, + "usernames": { + "$id": "5588", + "kind": "array", + "type": { + "$ref": "994" + }, + "value": [ + { + "$id": "5589", + "kind": "string", + "type": { + "$ref": "995" + }, + "value": "iozngyqndrteikszkbasinzdjtm" + } + ] + } + } + }, + "stateStoreResources": { + "$id": "5590", + "kind": "array", + "type": { + "$ref": "1001" + }, + "value": [ + { + "$id": "5591", + "kind": "model", + "type": { + "$ref": "1002" + }, + "value": { + "$id": "5592", + "keyType": { + "$id": "5593", + "kind": "string", + "type": { + "$ref": "208" + }, + "value": "Pattern" + }, + "keys": { + "$id": "5594", + "kind": "array", + "type": { + "$ref": "1007" + }, + "value": [ + { + "$id": "5595", + "kind": "string", + "type": { + "$ref": "1008" + }, + "value": "tkounsqtwvzyaklxjqoerpu" + } + ] + }, + "method": { + "$id": "5596", + "kind": "string", + "type": { + "$ref": "216" + }, + "value": "Read" + } + } + } + ] + } + } + } + ] + } + } + }, + "provisioningState": { + "$id": "5597", + "kind": "string", + "type": { + "$ref": "126" + }, + "value": "Succeeded" + } + } + }, + "extendedLocation": { + "$id": "5598", + "kind": "model", + "type": { + "$ref": "669" + }, + "value": { + "$id": "5599", + "name": { + "$id": "5600", + "kind": "string", + "type": { + "$ref": "671" + }, + "value": "qmbrfwcpwwhggszhrdjv" + }, + "type": { + "$id": "5601", + "kind": "string", + "type": { + "$ref": "142" + }, + "value": "CustomLocation" + } + } + }, + "id": { + "$id": "5602", + "kind": "string", + "type": { + "$ref": "330" + }, + "value": "/subscriptions/0000000-0000-0000-0000-000000000000/resourceGroups/resourceGroup123/providers/Microsoft.IoTOperations/instances/resource-name123/brokers/resource-name123/authorizations/resource-name123" + }, + "name": { + "$id": "5603", + "kind": "string", + "type": { + "$ref": "335" + }, + "value": "anqrqsvrjmlvzkrbuav" + }, + "type": { + "$id": "5604", + "kind": "string", + "type": { + "$ref": "339" + }, + "value": "yjlsfarshqoxojvgmy" + }, + "systemData": { + "$id": "5605", + "kind": "model", + "type": { + "$ref": "344" + }, + "value": { + "$id": "5606", + "createdBy": { + "$id": "5607", + "kind": "string", + "type": { + "$ref": "346" + }, + "value": "ssvaslsmudloholronopqyxjcu" + }, + "createdByType": { + "$id": "5608", + "kind": "string", + "type": { + "$ref": "146" + }, + "value": "User" + }, + "createdAt": { + "$id": "5609", + "kind": "string", + "type": { + "$ref": "353" + }, + "value": "2024-08-09T18:13:29.389Z" + }, + "lastModifiedBy": { + "$id": "5610", + "kind": "string", + "type": { + "$ref": "358" + }, + "value": "gnicpuszwd" + }, + "lastModifiedByType": { + "$id": "5611", + "kind": "string", + "type": { + "$ref": "146" + }, + "value": "User" + }, + "lastModifiedAt": { + "$id": "5612", + "kind": "string", + "type": { + "$ref": "365" + }, + "value": "2024-08-09T18:13:29.389Z" + } + } + } + } + } + } + ] + }, + { + "$id": "5613", + "kind": "http", + "name": "BrokerAuthorization_CreateOrUpdate_Simple", + "description": "BrokerAuthorization_CreateOrUpdate_Simple", + "filePath": "2024-11-01/BrokerAuthorization_CreateOrUpdate_Simple.json", + "parameters": [ + { + "$id": "5614", + "parameter": { + "$ref": "5218" + }, + "value": { + "$id": "5615", + "kind": "string", + "type": { + "$ref": "5219" + }, + "value": "2024-11-01" + } + }, + { + "$id": "5616", + "parameter": { + "$ref": "5222" + }, + "value": { + "$id": "5617", + "kind": "string", + "type": { + "$ref": "5223" + }, + "value": "F8C729F9-DF9C-4743-848F-96EE433D8E53" + } + }, + { + "$id": "5618", + "parameter": { + "$ref": "5225" + }, + "value": { + "$id": "5619", + "kind": "string", + "type": { + "$ref": "5226" + }, + "value": "rgiotoperations" + } + }, + { + "$id": "5620", + "parameter": { + "$ref": "5227" + }, + "value": { + "$id": "5621", + "kind": "string", + "type": { + "$ref": "5228" + }, + "value": "resource-name123" + } + }, + { + "$id": "5622", + "parameter": { + "$ref": "5229" + }, + "value": { + "$id": "5623", + "kind": "string", + "type": { + "$ref": "5230" + }, + "value": "resource-name123" + } + }, + { + "$id": "5624", + "parameter": { + "$ref": "5231" + }, + "value": { + "$id": "5625", + "kind": "string", + "type": { + "$ref": "5232" + }, + "value": "resource-name123" + } + }, + { + "$id": "5626", + "parameter": { + "$ref": "5239" + }, + "value": { + "$id": "5627", + "kind": "model", + "type": { + "$ref": "950" + }, + "value": { + "$id": "5628", + "properties": { + "$id": "5629", + "kind": "model", + "type": { + "$ref": "952" + }, + "value": { + "$id": "5630", + "authorizationPolicies": { + "$id": "5631", + "kind": "model", + "type": { + "$ref": "954" + }, + "value": { + "$id": "5632", + "cache": { + "$id": "5633", + "kind": "string", + "type": { + "$ref": "62" + }, + "value": "Enabled" + }, + "rules": { + "$id": "5634", + "kind": "array", + "type": { + "$ref": "959" + }, + "value": [ + { + "$id": "5635", + "kind": "model", + "type": { + "$ref": "960" + }, + "value": { + "$id": "5636", + "principals": { + "$id": "5637", + "kind": "model", + "type": { + "$ref": "980" + }, + "value": { + "$id": "5638", + "clientIds": { + "$id": "5639", + "kind": "array", + "type": { + "$ref": "989" + }, + "value": [ + { + "$id": "5640", + "kind": "string", + "type": { + "$ref": "990" + }, + "value": "my-client-id" + } + ] + }, + "attributes": { + "$id": "5641", + "kind": "array", + "type": { + "$ref": "982" + }, + "value": [ + { + "$id": "5642", + "kind": "dict", + "type": { + "$ref": "983" + }, + "value": { + "$id": "5643", + "floor": { + "$id": "5644", + "kind": "string", + "type": { + "$ref": "985" + }, + "value": "floor1" + }, + "site": { + "$id": "5645", + "kind": "string", + "type": { + "$ref": "985" + }, + "value": "site1" + } + } + } + ] + } + } + }, + "brokerResources": { + "$id": "5646", + "kind": "array", + "type": { + "$ref": "962" + }, + "value": [ + { + "$id": "5647", + "kind": "model", + "type": { + "$ref": "963" + }, + "value": { + "$id": "5648", + "method": { + "$id": "5649", + "kind": "string", + "type": { + "$ref": "200" + }, + "value": "Connect" + } + } + }, + { + "$id": "5650", + "kind": "model", + "type": { + "$ref": "963" + }, + "value": { + "$id": "5651", + "method": { + "$id": "5652", + "kind": "string", + "type": { + "$ref": "200" + }, + "value": "Subscribe" + }, + "topics": { + "$id": "5653", + "kind": "array", + "type": { + "$ref": "973" + }, + "value": [ + { + "$id": "5654", + "kind": "string", + "type": { + "$ref": "974" + }, + "value": "topic" + }, + { + "$id": "5655", + "kind": "string", + "type": { + "$ref": "974" + }, + "value": "topic/with/wildcard/#" + } + ] + } + } + } + ] + }, + "stateStoreResources": { + "$id": "5656", + "kind": "array", + "type": { + "$ref": "1001" + }, + "value": [ + { + "$id": "5657", + "kind": "model", + "type": { + "$ref": "1002" + }, + "value": { + "$id": "5658", + "method": { + "$id": "5659", + "kind": "string", + "type": { + "$ref": "216" + }, + "value": "ReadWrite" + }, + "keyType": { + "$id": "5660", + "kind": "string", + "type": { + "$ref": "208" + }, + "value": "Pattern" + }, + "keys": { + "$id": "5661", + "kind": "array", + "type": { + "$ref": "1007" + }, + "value": [ + { + "$id": "5662", + "kind": "string", + "type": { + "$ref": "1008" + }, + "value": "*" + } + ] + } + } + } + ] + } + } + } + ] + } + } + } + } + }, + "extendedLocation": { + "$id": "5663", + "kind": "model", + "type": { + "$ref": "669" + }, + "value": { + "$id": "5664", + "name": { + "$id": "5665", + "kind": "string", + "type": { + "$ref": "671" + }, + "value": "qmbrfwcpwwhggszhrdjv" + }, + "type": { + "$id": "5666", + "kind": "string", + "type": { + "$ref": "142" + }, + "value": "CustomLocation" + } + } + } + } + } + } + ], + "responses": [ + { + "$id": "5667", + "response": { + "$ref": "5240" + }, + "statusCode": 200, + "bodyValue": { + "$id": "5668", + "kind": "model", + "type": { + "$ref": "950" + }, + "value": { + "$id": "5669", + "properties": { + "$id": "5670", + "kind": "model", + "type": { + "$ref": "952" + }, + "value": { + "$id": "5671", + "authorizationPolicies": { + "$id": "5672", + "kind": "model", + "type": { + "$ref": "954" + }, + "value": { + "$id": "5673", + "cache": { + "$id": "5674", + "kind": "string", + "type": { + "$ref": "62" + }, + "value": "Enabled" + }, + "rules": { + "$id": "5675", + "kind": "array", + "type": { + "$ref": "959" + }, + "value": [ + { + "$id": "5676", + "kind": "model", + "type": { + "$ref": "960" + }, + "value": { + "$id": "5677", + "principals": { + "$id": "5678", + "kind": "model", + "type": { + "$ref": "980" + }, + "value": { + "$id": "5679", + "clientIds": { + "$id": "5680", + "kind": "array", + "type": { + "$ref": "989" + }, + "value": [ + { + "$id": "5681", + "kind": "string", + "type": { + "$ref": "990" + }, + "value": "my-client-id" + } + ] + }, + "attributes": { + "$id": "5682", + "kind": "array", + "type": { + "$ref": "982" + }, + "value": [ + { + "$id": "5683", + "kind": "dict", + "type": { + "$ref": "983" + }, + "value": { + "$id": "5684", + "floor": { + "$id": "5685", + "kind": "string", + "type": { + "$ref": "985" + }, + "value": "floor1" + }, + "site": { + "$id": "5686", + "kind": "string", + "type": { + "$ref": "985" + }, + "value": "site1" + } + } + } + ] + } + } + }, + "brokerResources": { + "$id": "5687", + "kind": "array", + "type": { + "$ref": "962" + }, + "value": [ + { + "$id": "5688", + "kind": "model", + "type": { + "$ref": "963" + }, + "value": { + "$id": "5689", + "method": { + "$id": "5690", + "kind": "string", + "type": { + "$ref": "200" + }, + "value": "Connect" + } + } + }, + { + "$id": "5691", + "kind": "model", + "type": { + "$ref": "963" + }, + "value": { + "$id": "5692", + "method": { + "$id": "5693", + "kind": "string", + "type": { + "$ref": "200" + }, + "value": "Subscribe" + }, + "topics": { + "$id": "5694", + "kind": "array", + "type": { + "$ref": "973" + }, + "value": [ + { + "$id": "5695", + "kind": "string", + "type": { + "$ref": "974" + }, + "value": "topic" + }, + { + "$id": "5696", + "kind": "string", + "type": { + "$ref": "974" + }, + "value": "topic/with/wildcard/#" + } + ] + } + } + } + ] + }, + "stateStoreResources": { + "$id": "5697", + "kind": "array", + "type": { + "$ref": "1001" + }, + "value": [ + { + "$id": "5698", + "kind": "model", + "type": { + "$ref": "1002" + }, + "value": { + "$id": "5699", + "method": { + "$id": "5700", + "kind": "string", + "type": { + "$ref": "216" + }, + "value": "ReadWrite" + }, + "keyType": { + "$id": "5701", + "kind": "string", + "type": { + "$ref": "208" + }, + "value": "Pattern" + }, + "keys": { + "$id": "5702", + "kind": "array", + "type": { + "$ref": "1007" + }, + "value": [ + { + "$id": "5703", + "kind": "string", + "type": { + "$ref": "1008" + }, + "value": "*" + } + ] + } + } + } + ] + } + } + } + ] + } + } + }, + "provisioningState": { + "$id": "5704", + "kind": "string", + "type": { + "$ref": "126" + }, + "value": "Succeeded" + } + } + }, + "extendedLocation": { + "$id": "5705", + "kind": "model", + "type": { + "$ref": "669" + }, + "value": { + "$id": "5706", + "name": { + "$id": "5707", + "kind": "string", + "type": { + "$ref": "671" + }, + "value": "qmbrfwcpwwhggszhrdjv" + }, + "type": { + "$id": "5708", + "kind": "string", + "type": { + "$ref": "142" + }, + "value": "CustomLocation" + } + } + }, + "id": { + "$id": "5709", + "kind": "string", + "type": { + "$ref": "330" + }, + "value": "/subscriptions/0000000-0000-0000-0000-000000000000/resourceGroups/resourceGroup123/providers/Microsoft.IoTOperations/instances/resource-name123/brokers/resource-name123/authorizations/resource-name123" + }, + "name": { + "$id": "5710", + "kind": "string", + "type": { + "$ref": "335" + }, + "value": "anqrqsvrjmlvzkrbuav" + }, + "type": { + "$id": "5711", + "kind": "string", + "type": { + "$ref": "339" + }, + "value": "yjlsfarshqoxojvgmy" + }, + "systemData": { + "$id": "5712", + "kind": "model", + "type": { + "$ref": "344" + }, + "value": { + "$id": "5713", + "createdBy": { + "$id": "5714", + "kind": "string", + "type": { + "$ref": "346" + }, + "value": "ssvaslsmudloholronopqyxjcu" + }, + "createdByType": { + "$id": "5715", + "kind": "string", + "type": { + "$ref": "146" + }, + "value": "User" + }, + "createdAt": { + "$id": "5716", + "kind": "string", + "type": { + "$ref": "353" + }, + "value": "2024-08-09T18:13:29.389Z" + }, + "lastModifiedBy": { + "$id": "5717", + "kind": "string", + "type": { + "$ref": "358" + }, + "value": "gnicpuszwd" + }, + "lastModifiedByType": { + "$id": "5718", + "kind": "string", + "type": { + "$ref": "146" + }, + "value": "User" + }, + "lastModifiedAt": { + "$id": "5719", + "kind": "string", + "type": { + "$ref": "365" + }, + "value": "2024-08-09T18:13:29.389Z" + } + } + } + } + } + }, + { + "$id": "5720", + "response": { + "$ref": "5241" + }, + "statusCode": 201, + "bodyValue": { + "$id": "5721", + "kind": "model", + "type": { + "$ref": "950" + }, + "value": { + "$id": "5722", + "properties": { + "$id": "5723", + "kind": "model", + "type": { + "$ref": "952" + }, + "value": { + "$id": "5724", + "authorizationPolicies": { + "$id": "5725", + "kind": "model", + "type": { + "$ref": "954" + }, + "value": { + "$id": "5726", + "cache": { + "$id": "5727", + "kind": "string", + "type": { + "$ref": "62" + }, + "value": "Enabled" + }, + "rules": { + "$id": "5728", + "kind": "array", + "type": { + "$ref": "959" + }, + "value": [ + { + "$id": "5729", + "kind": "model", + "type": { + "$ref": "960" + }, + "value": { + "$id": "5730", + "principals": { + "$id": "5731", + "kind": "model", + "type": { + "$ref": "980" + }, + "value": { + "$id": "5732", + "clientIds": { + "$id": "5733", + "kind": "array", + "type": { + "$ref": "989" + }, + "value": [ + { + "$id": "5734", + "kind": "string", + "type": { + "$ref": "990" + }, + "value": "my-client-id" + } + ] + }, + "attributes": { + "$id": "5735", + "kind": "array", + "type": { + "$ref": "982" + }, + "value": [ + { + "$id": "5736", + "kind": "dict", + "type": { + "$ref": "983" + }, + "value": { + "$id": "5737", + "floor": { + "$id": "5738", + "kind": "string", + "type": { + "$ref": "985" + }, + "value": "floor1" + }, + "site": { + "$id": "5739", + "kind": "string", + "type": { + "$ref": "985" + }, + "value": "site1" + } + } + } + ] + } + } + }, + "brokerResources": { + "$id": "5740", + "kind": "array", + "type": { + "$ref": "962" + }, + "value": [ + { + "$id": "5741", + "kind": "model", + "type": { + "$ref": "963" + }, + "value": { + "$id": "5742", + "method": { + "$id": "5743", + "kind": "string", + "type": { + "$ref": "200" + }, + "value": "Connect" + } + } + }, + { + "$id": "5744", + "kind": "model", + "type": { + "$ref": "963" + }, + "value": { + "$id": "5745", + "method": { + "$id": "5746", + "kind": "string", + "type": { + "$ref": "200" + }, + "value": "Subscribe" + }, + "topics": { + "$id": "5747", + "kind": "array", + "type": { + "$ref": "973" + }, + "value": [ + { + "$id": "5748", + "kind": "string", + "type": { + "$ref": "974" + }, + "value": "topic" + }, + { + "$id": "5749", + "kind": "string", + "type": { + "$ref": "974" + }, + "value": "topic/with/wildcard/#" + } + ] + } + } + } + ] + }, + "stateStoreResources": { + "$id": "5750", + "kind": "array", + "type": { + "$ref": "1001" + }, + "value": [ + { + "$id": "5751", + "kind": "model", + "type": { + "$ref": "1002" + }, + "value": { + "$id": "5752", + "method": { + "$id": "5753", + "kind": "string", + "type": { + "$ref": "216" + }, + "value": "ReadWrite" + }, + "keyType": { + "$id": "5754", + "kind": "string", + "type": { + "$ref": "208" + }, + "value": "Pattern" + }, + "keys": { + "$id": "5755", + "kind": "array", + "type": { + "$ref": "1007" + }, + "value": [ + { + "$id": "5756", + "kind": "string", + "type": { + "$ref": "1008" + }, + "value": "*" + } + ] + } + } + } + ] + } + } + } + ] + } + } + }, + "provisioningState": { + "$id": "5757", + "kind": "string", + "type": { + "$ref": "126" + }, + "value": "Succeeded" + } + } + }, + "extendedLocation": { + "$id": "5758", + "kind": "model", + "type": { + "$ref": "669" + }, + "value": { + "$id": "5759", + "name": { + "$id": "5760", + "kind": "string", + "type": { + "$ref": "671" + }, + "value": "qmbrfwcpwwhggszhrdjv" + }, + "type": { + "$id": "5761", + "kind": "string", + "type": { + "$ref": "142" + }, + "value": "CustomLocation" + } + } + }, + "id": { + "$id": "5762", + "kind": "string", + "type": { + "$ref": "330" + }, + "value": "/subscriptions/0000000-0000-0000-0000-000000000000/resourceGroups/resourceGroup123/providers/Microsoft.IoTOperations/instances/resource-name123/brokers/resource-name123/authorizations/resource-name123" + }, + "name": { + "$id": "5763", + "kind": "string", + "type": { + "$ref": "335" + }, + "value": "anqrqsvrjmlvzkrbuav" + }, + "type": { + "$id": "5764", + "kind": "string", + "type": { + "$ref": "339" + }, + "value": "yjlsfarshqoxojvgmy" + }, + "systemData": { + "$id": "5765", + "kind": "model", + "type": { + "$ref": "344" + }, + "value": { + "$id": "5766", + "createdBy": { + "$id": "5767", + "kind": "string", + "type": { + "$ref": "346" + }, + "value": "ssvaslsmudloholronopqyxjcu" + }, + "createdByType": { + "$id": "5768", + "kind": "string", + "type": { + "$ref": "146" + }, + "value": "User" + }, + "createdAt": { + "$id": "5769", + "kind": "string", + "type": { + "$ref": "353" + }, + "value": "2024-08-09T18:13:29.389Z" + }, + "lastModifiedBy": { + "$id": "5770", + "kind": "string", + "type": { + "$ref": "358" + }, + "value": "gnicpuszwd" + }, + "lastModifiedByType": { + "$id": "5771", + "kind": "string", + "type": { + "$ref": "146" + }, + "value": "User" + }, + "lastModifiedAt": { + "$id": "5772", + "kind": "string", + "type": { + "$ref": "365" + }, + "value": "2024-08-09T18:13:29.389Z" + } + } + } + } + } + } + ] + } + ] + }, + { + "$id": "5773", + "Name": "delete", + "ResourceName": "BrokerAuthorizationResource", + "Doc": "Delete a BrokerAuthorizationResource", + "Accessibility": "public", + "Parameters": [ + { + "$id": "5774", + "Name": "apiVersion", + "NameInRequest": "api-version", + "Doc": "The API version to use for this operation.", + "Type": { + "$id": "5775", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": true, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "DefaultValue": { + "$id": "5776", + "Type": { + "$id": "5777", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "2024-11-01" + }, + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "5778", + "Name": "subscriptionId", + "NameInRequest": "subscriptionId", + "Doc": "The ID of the target subscription. The value must be an UUID.", + "Type": { + "$id": "5779", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "5780", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "5781", + "Name": "resourceGroupName", + "NameInRequest": "resourceGroupName", + "Doc": "The name of the resource group. The name is case insensitive.", + "Type": { + "$id": "5782", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "5783", + "Name": "instanceName", + "NameInRequest": "instanceName", + "Doc": "Name of instance.", + "Type": { + "$id": "5784", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "5785", + "Name": "brokerName", + "NameInRequest": "brokerName", + "Doc": "Name of broker.", + "Type": { + "$id": "5786", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "5787", + "Name": "authorizationName", + "NameInRequest": "authorizationName", + "Doc": "Name of Instance broker authorization resource", + "Type": { + "$id": "5788", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "5789", + "Name": "accept", + "NameInRequest": "Accept", + "Type": { + "$id": "5790", + "kind": "constant", + "valueType": { + "$id": "5791", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "5792", + "StatusCodes": [ + 202 + ], + "BodyMediaType": "Json", + "Headers": [ + { + "$id": "5793", + "Name": "location", + "NameInResponse": "Location", + "Doc": "The Location header contains the URL where the status of the long running operation can be checked.", + "Type": { + "$id": "5794", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + } + }, + { + "$id": "5795", + "Name": "retryAfter", + "NameInResponse": "Retry-After", + "Doc": "The Retry-After header can indicate how long the client should wait before polling the operation status.", + "Type": { + "$id": "5796", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + } + } + ], + "IsErrorResponse": false + }, + { + "$id": "5797", + "StatusCodes": [ + 204 + ], + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false + } + ], + "HttpMethod": "DELETE", + "RequestBodyMediaType": "None", + "Uri": "{endpoint}", + "Path": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/brokers/{brokerName}/authorizations/{authorizationName}", + "BufferResponse": true, + "LongRunning": { + "$id": "5798", + "FinalStateVia": 1, + "FinalResponse": { + "$id": "5799", + "StatusCodes": [ + 204 + ], + "BodyMediaType": "Json" + } + }, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Microsoft.IoTOperations.BrokerAuthorization.delete", + "Decorators": [], + "Examples": [ + { + "$id": "5800", + "kind": "http", + "name": "BrokerAuthorization_Delete", + "description": "BrokerAuthorization_Delete", + "filePath": "2024-11-01/BrokerAuthorization_Delete_MaximumSet_Gen.json", + "parameters": [ + { + "$id": "5801", + "parameter": { + "$ref": "5774" + }, + "value": { + "$id": "5802", + "kind": "string", + "type": { + "$ref": "5775" + }, + "value": "2024-11-01" + } + }, + { + "$id": "5803", + "parameter": { + "$ref": "5778" + }, + "value": { + "$id": "5804", + "kind": "string", + "type": { + "$ref": "5779" + }, + "value": "F8C729F9-DF9C-4743-848F-96EE433D8E53" + } + }, + { + "$id": "5805", + "parameter": { + "$ref": "5781" + }, + "value": { + "$id": "5806", + "kind": "string", + "type": { + "$ref": "5782" + }, + "value": "rgiotoperations" + } + }, + { + "$id": "5807", + "parameter": { + "$ref": "5783" + }, + "value": { + "$id": "5808", + "kind": "string", + "type": { + "$ref": "5784" + }, + "value": "resource-name123" + } + }, + { + "$id": "5809", + "parameter": { + "$ref": "5785" + }, + "value": { + "$id": "5810", + "kind": "string", + "type": { + "$ref": "5786" + }, + "value": "resource-name123" + } + }, + { + "$id": "5811", + "parameter": { + "$ref": "5787" + }, + "value": { + "$id": "5812", + "kind": "string", + "type": { + "$ref": "5788" + }, + "value": "resource-name123" + } + } + ], + "responses": [ + { + "$id": "5813", + "response": { + "$ref": "5792" + }, + "statusCode": 202 + }, + { + "$id": "5814", + "response": { + "$ref": "5797" + }, + "statusCode": 204 + } + ] + } + ] + }, + { + "$id": "5815", + "Name": "listByResourceGroup", + "ResourceName": "BrokerAuthorizationResource", + "Doc": "List BrokerAuthorizationResource resources by BrokerResource", + "Accessibility": "public", + "Parameters": [ + { + "$id": "5816", + "Name": "apiVersion", + "NameInRequest": "api-version", + "Doc": "The API version to use for this operation.", + "Type": { + "$id": "5817", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": true, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "DefaultValue": { + "$id": "5818", + "Type": { + "$id": "5819", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "2024-11-01" + }, + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "5820", + "Name": "subscriptionId", + "NameInRequest": "subscriptionId", + "Doc": "The ID of the target subscription. The value must be an UUID.", + "Type": { + "$id": "5821", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "5822", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "5823", + "Name": "resourceGroupName", + "NameInRequest": "resourceGroupName", + "Doc": "The name of the resource group. The name is case insensitive.", + "Type": { + "$id": "5824", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "5825", + "Name": "instanceName", + "NameInRequest": "instanceName", + "Doc": "Name of instance.", + "Type": { + "$id": "5826", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "5827", + "Name": "brokerName", + "NameInRequest": "brokerName", + "Doc": "Name of broker.", + "Type": { + "$id": "5828", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "5829", + "Name": "accept", + "NameInRequest": "Accept", + "Type": { + "$id": "5830", + "kind": "constant", + "valueType": { + "$id": "5831", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "5832", + "StatusCodes": [ + 200 + ], + "BodyType": { + "$ref": "1028" + }, + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false, + "ContentTypes": [ + "application/json" + ] + } + ], + "HttpMethod": "GET", + "RequestBodyMediaType": "None", + "Uri": "{endpoint}", + "Path": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/brokers/{brokerName}/authorizations", + "BufferResponse": true, + "Paging": { + "$id": "5833", + "ItemName": "value", + "NextLinkName": "nextLink" + }, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Microsoft.IoTOperations.BrokerAuthorization.listByResourceGroup", + "Decorators": [], + "Examples": [ + { + "$id": "5834", + "kind": "http", + "name": "BrokerAuthorization_ListByResourceGroup", + "description": "BrokerAuthorization_ListByResourceGroup", + "filePath": "2024-11-01/BrokerAuthorization_ListByResourceGroup_MaximumSet_Gen.json", + "parameters": [ + { + "$id": "5835", + "parameter": { + "$ref": "5816" + }, + "value": { + "$id": "5836", + "kind": "string", + "type": { + "$ref": "5817" + }, + "value": "2024-11-01" + } + }, + { + "$id": "5837", + "parameter": { + "$ref": "5820" + }, + "value": { + "$id": "5838", + "kind": "string", + "type": { + "$ref": "5821" + }, + "value": "F8C729F9-DF9C-4743-848F-96EE433D8E53" + } + }, + { + "$id": "5839", + "parameter": { + "$ref": "5823" + }, + "value": { + "$id": "5840", + "kind": "string", + "type": { + "$ref": "5824" + }, + "value": "rgiotoperations" + } + }, + { + "$id": "5841", + "parameter": { + "$ref": "5825" + }, + "value": { + "$id": "5842", + "kind": "string", + "type": { + "$ref": "5826" + }, + "value": "resource-name123" + } + }, + { + "$id": "5843", + "parameter": { + "$ref": "5827" + }, + "value": { + "$id": "5844", + "kind": "string", + "type": { + "$ref": "5828" + }, + "value": "resource-name123" + } + } + ], + "responses": [ + { + "$id": "5845", + "response": { + "$ref": "5832" + }, + "statusCode": 200, + "bodyValue": { + "$id": "5846", + "kind": "model", + "type": { + "$ref": "1028" + }, + "value": { + "$id": "5847", + "value": { + "$id": "5848", + "kind": "array", + "type": { + "$ref": "1030" + }, + "value": [ + { + "$id": "5849", + "kind": "model", + "type": { + "$ref": "950" + }, + "value": { + "$id": "5850", + "properties": { + "$id": "5851", + "kind": "model", + "type": { + "$ref": "952" + }, + "value": { + "$id": "5852", + "authorizationPolicies": { + "$id": "5853", + "kind": "model", + "type": { + "$ref": "954" + }, + "value": { + "$id": "5854", + "cache": { + "$id": "5855", + "kind": "string", + "type": { + "$ref": "62" + }, + "value": "Enabled" + }, + "rules": { + "$id": "5856", + "kind": "array", + "type": { + "$ref": "959" + }, + "value": [ + { + "$id": "5857", + "kind": "model", + "type": { + "$ref": "960" + }, + "value": { + "$id": "5858", + "brokerResources": { + "$id": "5859", + "kind": "array", + "type": { + "$ref": "962" + }, + "value": [ + { + "$id": "5860", + "kind": "model", + "type": { + "$ref": "963" + }, + "value": { + "$id": "5861", + "method": { + "$id": "5862", + "kind": "string", + "type": { + "$ref": "200" + }, + "value": "Connect" + }, + "clientIds": { + "$id": "5863", + "kind": "array", + "type": { + "$ref": "968" + }, + "value": [ + { + "$id": "5864", + "kind": "string", + "type": { + "$ref": "969" + }, + "value": "nlc" + } + ] + }, + "topics": { + "$id": "5865", + "kind": "array", + "type": { + "$ref": "973" + }, + "value": [ + { + "$id": "5866", + "kind": "string", + "type": { + "$ref": "974" + }, + "value": "wvuca" + } + ] + } + } + } + ] + }, + "principals": { + "$id": "5867", + "kind": "model", + "type": { + "$ref": "980" + }, + "value": { + "$id": "5868", + "attributes": { + "$id": "5869", + "kind": "array", + "type": { + "$ref": "982" + }, + "value": [ + { + "$id": "5870", + "kind": "dict", + "type": { + "$ref": "983" + }, + "value": { + "$id": "5871", + "key5526": { + "$id": "5872", + "kind": "string", + "type": { + "$ref": "985" + }, + "value": "nydhzdhbldygqcn" + } + } + } + ] + }, + "clientIds": { + "$id": "5873", + "kind": "array", + "type": { + "$ref": "989" + }, + "value": [ + { + "$id": "5874", + "kind": "string", + "type": { + "$ref": "990" + }, + "value": "smopeaeddsygz" + } + ] + }, + "usernames": { + "$id": "5875", + "kind": "array", + "type": { + "$ref": "994" + }, + "value": [ + { + "$id": "5876", + "kind": "string", + "type": { + "$ref": "995" + }, + "value": "iozngyqndrteikszkbasinzdjtm" + } + ] + } + } + }, + "stateStoreResources": { + "$id": "5877", + "kind": "array", + "type": { + "$ref": "1001" + }, + "value": [ + { + "$id": "5878", + "kind": "model", + "type": { + "$ref": "1002" + }, + "value": { + "$id": "5879", + "keyType": { + "$id": "5880", + "kind": "string", + "type": { + "$ref": "208" + }, + "value": "Pattern" + }, + "keys": { + "$id": "5881", + "kind": "array", + "type": { + "$ref": "1007" + }, + "value": [ + { + "$id": "5882", + "kind": "string", + "type": { + "$ref": "1008" + }, + "value": "tkounsqtwvzyaklxjqoerpu" + } + ] + }, + "method": { + "$id": "5883", + "kind": "string", + "type": { + "$ref": "216" + }, + "value": "Read" + } + } + } + ] + } + } + } + ] + } + } + }, + "provisioningState": { + "$id": "5884", + "kind": "string", + "type": { + "$ref": "126" + }, + "value": "Succeeded" + } + } + }, + "extendedLocation": { + "$id": "5885", + "kind": "model", + "type": { + "$ref": "669" + }, + "value": { + "$id": "5886", + "name": { + "$id": "5887", + "kind": "string", + "type": { + "$ref": "671" + }, + "value": "qmbrfwcpwwhggszhrdjv" + }, + "type": { + "$id": "5888", + "kind": "string", + "type": { + "$ref": "142" + }, + "value": "CustomLocation" + } + } + }, + "id": { + "$id": "5889", + "kind": "string", + "type": { + "$ref": "330" + }, + "value": "/subscriptions/0000000-0000-0000-0000-000000000000/resourceGroups/resourceGroup123/providers/Microsoft.IoTOperations/instances/resource-name123/brokers/resource-name123/authorizations/resource-name123" + }, + "name": { + "$id": "5890", + "kind": "string", + "type": { + "$ref": "335" + }, + "value": "anqrqsvrjmlvzkrbuav" + }, + "type": { + "$id": "5891", + "kind": "string", + "type": { + "$ref": "339" + }, + "value": "yjlsfarshqoxojvgmy" + }, + "systemData": { + "$id": "5892", + "kind": "model", + "type": { + "$ref": "344" + }, + "value": { + "$id": "5893", + "createdBy": { + "$id": "5894", + "kind": "string", + "type": { + "$ref": "346" + }, + "value": "ssvaslsmudloholronopqyxjcu" + }, + "createdByType": { + "$id": "5895", + "kind": "string", + "type": { + "$ref": "146" + }, + "value": "User" + }, + "createdAt": { + "$id": "5896", + "kind": "string", + "type": { + "$ref": "353" + }, + "value": "2024-08-09T18:13:29.389Z" + }, + "lastModifiedBy": { + "$id": "5897", + "kind": "string", + "type": { + "$ref": "358" + }, + "value": "gnicpuszwd" + }, + "lastModifiedByType": { + "$id": "5898", + "kind": "string", + "type": { + "$ref": "146" + }, + "value": "User" + }, + "lastModifiedAt": { + "$id": "5899", + "kind": "string", + "type": { + "$ref": "365" + }, + "value": "2024-08-09T18:13:29.389Z" + } + } + } + } + } + ] + }, + "nextLink": { + "$id": "5900", + "kind": "string", + "type": { + "$ref": "1034" + }, + "value": "https://microsoft.com/a" + } + } + } + } + ] + } + ] + } + ], + "Protocol": { + "$id": "5901" + }, + "Parent": "IoTOperationsClient", + "Parameters": [ + { + "$id": "5902", + "Name": "endpoint", + "NameInRequest": "endpoint", + "Doc": "Service host", + "Type": { + "$id": "5903", + "kind": "url", + "name": "url", + "crossLanguageDefinitionId": "TypeSpec.url" + }, + "Location": "Uri", + "IsApiVersion": false, + "IsResourceParameter": false, + "IsContentType": false, + "IsRequired": true, + "IsEndpoint": true, + "SkipUrlEncoding": false, + "Explode": false, + "Kind": "Client", + "DefaultValue": { + "$id": "5904", + "Type": { + "$id": "5905", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "https://management.azure.com" + } + } + ], + "Decorators": [] + }, + { + "$id": "5906", + "Name": "DataflowProfile", + "ClientNamespace": "Microsoft.IoTOperations", + "Operations": [ + { + "$id": "5907", + "Name": "get", + "ResourceName": "DataflowProfileResource", + "Doc": "Get a DataflowProfileResource", + "Accessibility": "public", + "Parameters": [ + { + "$id": "5908", + "Name": "apiVersion", + "NameInRequest": "api-version", + "Doc": "The API version to use for this operation.", + "Type": { + "$id": "5909", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": true, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "DefaultValue": { + "$id": "5910", + "Type": { + "$id": "5911", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "2024-11-01" + }, + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "5912", + "Name": "subscriptionId", + "NameInRequest": "subscriptionId", + "Doc": "The ID of the target subscription. The value must be an UUID.", + "Type": { + "$id": "5913", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "5914", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "5915", + "Name": "resourceGroupName", + "NameInRequest": "resourceGroupName", + "Doc": "The name of the resource group. The name is case insensitive.", + "Type": { + "$id": "5916", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "5917", + "Name": "instanceName", + "NameInRequest": "instanceName", + "Doc": "Name of instance.", + "Type": { + "$id": "5918", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "5919", + "Name": "dataflowProfileName", + "NameInRequest": "dataflowProfileName", + "Doc": "Name of Instance dataflowProfile resource", + "Type": { + "$id": "5920", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "5921", + "Name": "accept", + "NameInRequest": "Accept", + "Type": { + "$id": "5922", + "kind": "constant", + "valueType": { + "$id": "5923", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "5924", + "StatusCodes": [ + 200 + ], + "BodyType": { + "$ref": "905" + }, + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false, + "ContentTypes": [ + "application/json" + ] + } + ], + "HttpMethod": "GET", + "RequestBodyMediaType": "None", + "Uri": "{endpoint}", + "Path": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/dataflowProfiles/{dataflowProfileName}", + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Microsoft.IoTOperations.DataflowProfile.get", + "Decorators": [], + "Examples": [ + { + "$id": "5925", + "kind": "http", + "name": "DataflowProfile_Get", + "description": "DataflowProfile_Get", + "filePath": "2024-11-01/DataflowProfile_Get_MaximumSet_Gen.json", + "parameters": [ + { + "$id": "5926", + "parameter": { + "$ref": "5908" + }, + "value": { + "$id": "5927", + "kind": "string", + "type": { + "$ref": "5909" + }, + "value": "2024-11-01" + } + }, + { + "$id": "5928", + "parameter": { + "$ref": "5912" + }, + "value": { + "$id": "5929", + "kind": "string", + "type": { + "$ref": "5913" + }, + "value": "F8C729F9-DF9C-4743-848F-96EE433D8E53" + } + }, + { + "$id": "5930", + "parameter": { + "$ref": "5915" + }, + "value": { + "$id": "5931", + "kind": "string", + "type": { + "$ref": "5916" + }, + "value": "rgiotoperations" + } + }, + { + "$id": "5932", + "parameter": { + "$ref": "5917" + }, + "value": { + "$id": "5933", + "kind": "string", + "type": { + "$ref": "5918" + }, + "value": "resource-name123" + } + }, + { + "$id": "5934", + "parameter": { + "$ref": "5919" + }, + "value": { + "$id": "5935", + "kind": "string", + "type": { + "$ref": "5920" + }, + "value": "resource-name123" + } + } + ], + "responses": [ + { + "$id": "5936", + "response": { + "$ref": "5924" + }, + "statusCode": 200, + "bodyValue": { + "$id": "5937", + "kind": "model", + "type": { + "$ref": "905" + }, + "value": { + "$id": "5938", + "properties": { + "$id": "5939", + "kind": "model", + "type": { + "$ref": "907" + }, + "value": { + "$id": "5940", + "diagnostics": { + "$id": "5941", + "kind": "model", + "type": { + "$ref": "909" + }, + "value": { + "$id": "5942", + "logs": { + "$id": "5943", + "kind": "model", + "type": { + "$ref": "911" + }, + "value": { + "$id": "5944", + "level": { + "$id": "5945", + "kind": "string", + "type": { + "$ref": "913" + }, + "value": "rnmwokumdmebpmfxxxzvvjfdywotav" + } + } + }, + "metrics": { + "$id": "5946", + "kind": "model", + "type": { + "$ref": "919" + }, + "value": { + "$id": "5947", + "prometheusPort": { + "$id": "5948", + "kind": "number", + "type": { + "$ref": "921" + }, + "value": 7581 + } + } + } + } + }, + "instanceCount": { + "$id": "5949", + "kind": "number", + "type": { + "$ref": "929" + }, + "value": 14 + }, + "provisioningState": { + "$id": "5950", + "kind": "string", + "type": { + "$ref": "126" + }, + "value": "Succeeded" + } + } + }, + "extendedLocation": { + "$id": "5951", + "kind": "model", + "type": { + "$ref": "669" + }, + "value": { + "$id": "5952", + "name": { + "$id": "5953", + "kind": "string", + "type": { + "$ref": "671" + }, + "value": "qmbrfwcpwwhggszhrdjv" + }, + "type": { + "$id": "5954", + "kind": "string", + "type": { + "$ref": "142" + }, + "value": "CustomLocation" + } + } + }, + "id": { + "$id": "5955", + "kind": "string", + "type": { + "$ref": "330" + }, + "value": "/subscriptions/0000000-0000-0000-0000-000000000000/resourceGroups/resourceGroup123/providers/Microsoft.IoTOperations/instances/resource-name123/dataflowProfiles/resource-name123" + }, + "name": { + "$id": "5956", + "kind": "string", + "type": { + "$ref": "335" + }, + "value": "bwhcjsnnfnrmbixamyxjau" + }, + "type": { + "$id": "5957", + "kind": "string", + "type": { + "$ref": "339" + }, + "value": "ejvancsomtbapgztnerhlvx" + }, + "systemData": { + "$id": "5958", + "kind": "model", + "type": { + "$ref": "344" + }, + "value": { + "$id": "5959", + "createdBy": { + "$id": "5960", + "kind": "string", + "type": { + "$ref": "346" + }, + "value": "ssvaslsmudloholronopqyxjcu" + }, + "createdByType": { + "$id": "5961", + "kind": "string", + "type": { + "$ref": "146" + }, + "value": "User" + }, + "createdAt": { + "$id": "5962", + "kind": "string", + "type": { + "$ref": "353" + }, + "value": "2024-08-09T18:13:29.389Z" + }, + "lastModifiedBy": { + "$id": "5963", + "kind": "string", + "type": { + "$ref": "358" + }, + "value": "gnicpuszwd" + }, + "lastModifiedByType": { + "$id": "5964", + "kind": "string", + "type": { + "$ref": "146" + }, + "value": "User" + }, + "lastModifiedAt": { + "$id": "5965", + "kind": "string", + "type": { + "$ref": "365" + }, + "value": "2024-08-09T18:13:29.389Z" + } + } + } + } + } + } + ] + } + ] + }, + { + "$id": "5966", + "Name": "createOrUpdate", + "ResourceName": "DataflowProfileResource", + "Doc": "Create a DataflowProfileResource", + "Accessibility": "public", + "Parameters": [ + { + "$id": "5967", + "Name": "apiVersion", + "NameInRequest": "api-version", + "Doc": "The API version to use for this operation.", + "Type": { + "$id": "5968", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": true, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "DefaultValue": { + "$id": "5969", + "Type": { + "$id": "5970", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "2024-11-01" + }, + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "5971", + "Name": "subscriptionId", + "NameInRequest": "subscriptionId", + "Doc": "The ID of the target subscription. The value must be an UUID.", + "Type": { + "$id": "5972", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "5973", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "5974", + "Name": "resourceGroupName", + "NameInRequest": "resourceGroupName", + "Doc": "The name of the resource group. The name is case insensitive.", + "Type": { + "$id": "5975", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "5976", + "Name": "instanceName", + "NameInRequest": "instanceName", + "Doc": "Name of instance.", + "Type": { + "$id": "5977", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "5978", + "Name": "dataflowProfileName", + "NameInRequest": "dataflowProfileName", + "Doc": "Name of Instance dataflowProfile resource", + "Type": { + "$id": "5979", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "5980", + "Name": "contentType", + "NameInRequest": "Content-Type", + "Doc": "Body parameter's content type. Known values are application/json", + "Type": { + "$id": "5981", + "kind": "constant", + "valueType": { + "$id": "5982", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": true, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "5983", + "Name": "accept", + "NameInRequest": "Accept", + "Type": { + "$id": "5984", + "kind": "constant", + "valueType": { + "$id": "5985", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "5986", + "Name": "resource", + "NameInRequest": "resource", + "Doc": "Resource create parameters.", + "Type": { + "$ref": "905" + }, + "Location": "Body", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "5987", + "StatusCodes": [ + 200 + ], + "BodyType": { + "$ref": "905" + }, + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false, + "ContentTypes": [ + "application/json" + ] + }, + { + "$id": "5988", + "StatusCodes": [ + 201 + ], + "BodyType": { + "$ref": "905" + }, + "BodyMediaType": "Json", + "Headers": [ + { + "$id": "5989", + "Name": "azureAsyncOperation", + "NameInResponse": "Azure-AsyncOperation", + "Doc": "A link to the status monitor", + "Type": { + "$id": "5990", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + } + }, + { + "$id": "5991", + "Name": "retryAfter", + "NameInResponse": "Retry-After", + "Doc": "The Retry-After header can indicate how long the client should wait before polling the operation status.", + "Type": { + "$id": "5992", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + } + } + ], + "IsErrorResponse": false, + "ContentTypes": [ + "application/json" + ] + } + ], + "HttpMethod": "PUT", + "RequestBodyMediaType": "Json", + "Uri": "{endpoint}", + "Path": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/dataflowProfiles/{dataflowProfileName}", + "RequestMediaTypes": [ + "application/json" + ], + "BufferResponse": true, + "LongRunning": { + "$id": "5993", + "FinalStateVia": 0, + "FinalResponse": { + "$id": "5994", + "StatusCodes": [ + 200 + ], + "BodyType": { + "$ref": "905" + }, + "BodyMediaType": "Json" + } + }, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Microsoft.IoTOperations.DataflowProfile.createOrUpdate", + "Decorators": [], + "Examples": [ + { + "$id": "5995", + "kind": "http", + "name": "DataflowProfile_CreateOrUpdate", + "description": "DataflowProfile_CreateOrUpdate", + "filePath": "2024-11-01/DataflowProfile_CreateOrUpdate_MaximumSet_Gen.json", + "parameters": [ + { + "$id": "5996", + "parameter": { + "$ref": "5967" + }, + "value": { + "$id": "5997", + "kind": "string", + "type": { + "$ref": "5968" + }, + "value": "2024-11-01" + } + }, + { + "$id": "5998", + "parameter": { + "$ref": "5971" + }, + "value": { + "$id": "5999", + "kind": "string", + "type": { + "$ref": "5972" + }, + "value": "F8C729F9-DF9C-4743-848F-96EE433D8E53" + } + }, + { + "$id": "6000", + "parameter": { + "$ref": "5974" + }, + "value": { + "$id": "6001", + "kind": "string", + "type": { + "$ref": "5975" + }, + "value": "rgiotoperations" + } + }, + { + "$id": "6002", + "parameter": { + "$ref": "5976" + }, + "value": { + "$id": "6003", + "kind": "string", + "type": { + "$ref": "5977" + }, + "value": "resource-name123" + } + }, + { + "$id": "6004", + "parameter": { + "$ref": "5978" + }, + "value": { + "$id": "6005", + "kind": "string", + "type": { + "$ref": "5979" + }, + "value": "resource-name123" + } + }, + { + "$id": "6006", + "parameter": { + "$ref": "5986" + }, + "value": { + "$id": "6007", + "kind": "model", + "type": { + "$ref": "905" + }, + "value": { + "$id": "6008", + "properties": { + "$id": "6009", + "kind": "model", + "type": { + "$ref": "907" + }, + "value": { + "$id": "6010", + "diagnostics": { + "$id": "6011", + "kind": "model", + "type": { + "$ref": "909" + }, + "value": { + "$id": "6012", + "logs": { + "$id": "6013", + "kind": "model", + "type": { + "$ref": "911" + }, + "value": { + "$id": "6014", + "level": { + "$id": "6015", + "kind": "string", + "type": { + "$ref": "913" + }, + "value": "rnmwokumdmebpmfxxxzvvjfdywotav" + } + } + }, + "metrics": { + "$id": "6016", + "kind": "model", + "type": { + "$ref": "919" + }, + "value": { + "$id": "6017", + "prometheusPort": { + "$id": "6018", + "kind": "number", + "type": { + "$ref": "921" + }, + "value": 7581 + } + } + } + } + }, + "instanceCount": { + "$id": "6019", + "kind": "number", + "type": { + "$ref": "929" + }, + "value": 14 + } + } + }, + "extendedLocation": { + "$id": "6020", + "kind": "model", + "type": { + "$ref": "669" + }, + "value": { + "$id": "6021", + "name": { + "$id": "6022", + "kind": "string", + "type": { + "$ref": "671" + }, + "value": "qmbrfwcpwwhggszhrdjv" + }, + "type": { + "$id": "6023", + "kind": "string", + "type": { + "$ref": "142" + }, + "value": "CustomLocation" + } + } + } + } + } + } + ], + "responses": [ + { + "$id": "6024", + "response": { + "$ref": "5987" + }, + "statusCode": 200, + "bodyValue": { + "$id": "6025", + "kind": "model", + "type": { + "$ref": "905" + }, + "value": { + "$id": "6026", + "properties": { + "$id": "6027", + "kind": "model", + "type": { + "$ref": "907" + }, + "value": { + "$id": "6028", + "diagnostics": { + "$id": "6029", + "kind": "model", + "type": { + "$ref": "909" + }, + "value": { + "$id": "6030", + "logs": { + "$id": "6031", + "kind": "model", + "type": { + "$ref": "911" + }, + "value": { + "$id": "6032", + "level": { + "$id": "6033", + "kind": "string", + "type": { + "$ref": "913" + }, + "value": "rnmwokumdmebpmfxxxzvvjfdywotav" + } + } + }, + "metrics": { + "$id": "6034", + "kind": "model", + "type": { + "$ref": "919" + }, + "value": { + "$id": "6035", + "prometheusPort": { + "$id": "6036", + "kind": "number", + "type": { + "$ref": "921" + }, + "value": 7581 + } + } + } + } + }, + "instanceCount": { + "$id": "6037", + "kind": "number", + "type": { + "$ref": "929" + }, + "value": 14 + }, + "provisioningState": { + "$id": "6038", + "kind": "string", + "type": { + "$ref": "126" + }, + "value": "Succeeded" + } + } + }, + "extendedLocation": { + "$id": "6039", + "kind": "model", + "type": { + "$ref": "669" + }, + "value": { + "$id": "6040", + "name": { + "$id": "6041", + "kind": "string", + "type": { + "$ref": "671" + }, + "value": "qmbrfwcpwwhggszhrdjv" + }, + "type": { + "$id": "6042", + "kind": "string", + "type": { + "$ref": "142" + }, + "value": "CustomLocation" + } + } + }, + "id": { + "$id": "6043", + "kind": "string", + "type": { + "$ref": "330" + }, + "value": "/subscriptions/0000000-0000-0000-0000-000000000000/resourceGroups/resourceGroup123/providers/Microsoft.IoTOperations/instances/resource-name123/dataflowProfiles/resource-name123" + }, + "name": { + "$id": "6044", + "kind": "string", + "type": { + "$ref": "335" + }, + "value": "bwhcjsnnfnrmbixamyxjau" + }, + "type": { + "$id": "6045", + "kind": "string", + "type": { + "$ref": "339" + }, + "value": "ejvancsomtbapgztnerhlvx" + }, + "systemData": { + "$id": "6046", + "kind": "model", + "type": { + "$ref": "344" + }, + "value": { + "$id": "6047", + "createdBy": { + "$id": "6048", + "kind": "string", + "type": { + "$ref": "346" + }, + "value": "ssvaslsmudloholronopqyxjcu" + }, + "createdByType": { + "$id": "6049", + "kind": "string", + "type": { + "$ref": "146" + }, + "value": "User" + }, + "createdAt": { + "$id": "6050", + "kind": "string", + "type": { + "$ref": "353" + }, + "value": "2024-08-09T18:13:29.389Z" + }, + "lastModifiedBy": { + "$id": "6051", + "kind": "string", + "type": { + "$ref": "358" + }, + "value": "gnicpuszwd" + }, + "lastModifiedByType": { + "$id": "6052", + "kind": "string", + "type": { + "$ref": "146" + }, + "value": "User" + }, + "lastModifiedAt": { + "$id": "6053", + "kind": "string", + "type": { + "$ref": "365" + }, + "value": "2024-08-09T18:13:29.389Z" + } + } + } + } + } + }, + { + "$id": "6054", + "response": { + "$ref": "5988" + }, + "statusCode": 201, + "bodyValue": { + "$id": "6055", + "kind": "model", + "type": { + "$ref": "905" + }, + "value": { + "$id": "6056", + "properties": { + "$id": "6057", + "kind": "model", + "type": { + "$ref": "907" + }, + "value": { + "$id": "6058", + "diagnostics": { + "$id": "6059", + "kind": "model", + "type": { + "$ref": "909" + }, + "value": { + "$id": "6060", + "logs": { + "$id": "6061", + "kind": "model", + "type": { + "$ref": "911" + }, + "value": { + "$id": "6062", + "level": { + "$id": "6063", + "kind": "string", + "type": { + "$ref": "913" + }, + "value": "rnmwokumdmebpmfxxxzvvjfdywotav" + } + } + }, + "metrics": { + "$id": "6064", + "kind": "model", + "type": { + "$ref": "919" + }, + "value": { + "$id": "6065", + "prometheusPort": { + "$id": "6066", + "kind": "number", + "type": { + "$ref": "921" + }, + "value": 7581 + } + } + } + } + }, + "instanceCount": { + "$id": "6067", + "kind": "number", + "type": { + "$ref": "929" + }, + "value": 14 + }, + "provisioningState": { + "$id": "6068", + "kind": "string", + "type": { + "$ref": "126" + }, + "value": "Succeeded" + } + } + }, + "extendedLocation": { + "$id": "6069", + "kind": "model", + "type": { + "$ref": "669" + }, + "value": { + "$id": "6070", + "name": { + "$id": "6071", + "kind": "string", + "type": { + "$ref": "671" + }, + "value": "qmbrfwcpwwhggszhrdjv" + }, + "type": { + "$id": "6072", + "kind": "string", + "type": { + "$ref": "142" + }, + "value": "CustomLocation" + } + } + }, + "id": { + "$id": "6073", + "kind": "string", + "type": { + "$ref": "330" + }, + "value": "/subscriptions/0000000-0000-0000-0000-000000000000/resourceGroups/resourceGroup123/providers/Microsoft.IoTOperations/instances/resource-name123/dataflowProfiles/resource-name123" + }, + "name": { + "$id": "6074", + "kind": "string", + "type": { + "$ref": "335" + }, + "value": "bwhcjsnnfnrmbixamyxjau" + }, + "type": { + "$id": "6075", + "kind": "string", + "type": { + "$ref": "339" + }, + "value": "ejvancsomtbapgztnerhlvx" + }, + "systemData": { + "$id": "6076", + "kind": "model", + "type": { + "$ref": "344" + }, + "value": { + "$id": "6077", + "createdBy": { + "$id": "6078", + "kind": "string", + "type": { + "$ref": "346" + }, + "value": "ssvaslsmudloholronopqyxjcu" + }, + "createdByType": { + "$id": "6079", + "kind": "string", + "type": { + "$ref": "146" + }, + "value": "User" + }, + "createdAt": { + "$id": "6080", + "kind": "string", + "type": { + "$ref": "353" + }, + "value": "2024-08-09T18:13:29.389Z" + }, + "lastModifiedBy": { + "$id": "6081", + "kind": "string", + "type": { + "$ref": "358" + }, + "value": "gnicpuszwd" + }, + "lastModifiedByType": { + "$id": "6082", + "kind": "string", + "type": { + "$ref": "146" + }, + "value": "User" + }, + "lastModifiedAt": { + "$id": "6083", + "kind": "string", + "type": { + "$ref": "365" + }, + "value": "2024-08-09T18:13:29.389Z" + } + } + } + } + } + } + ] + }, + { + "$id": "6084", + "kind": "http", + "name": "DataflowProfile_CreateOrUpdate_Minimal", + "description": "DataflowProfile_CreateOrUpdate_Minimal", + "filePath": "2024-11-01/DataflowProfile_CreateOrUpdate_Minimal.json", + "parameters": [ + { + "$id": "6085", + "parameter": { + "$ref": "5967" + }, + "value": { + "$id": "6086", + "kind": "string", + "type": { + "$ref": "5968" + }, + "value": "2024-11-01" + } + }, + { + "$id": "6087", + "parameter": { + "$ref": "5971" + }, + "value": { + "$id": "6088", + "kind": "string", + "type": { + "$ref": "5972" + }, + "value": "F8C729F9-DF9C-4743-848F-96EE433D8E53" + } + }, + { + "$id": "6089", + "parameter": { + "$ref": "5974" + }, + "value": { + "$id": "6090", + "kind": "string", + "type": { + "$ref": "5975" + }, + "value": "rgiotoperations" + } + }, + { + "$id": "6091", + "parameter": { + "$ref": "5976" + }, + "value": { + "$id": "6092", + "kind": "string", + "type": { + "$ref": "5977" + }, + "value": "resource-name123" + } + }, + { + "$id": "6093", + "parameter": { + "$ref": "5978" + }, + "value": { + "$id": "6094", + "kind": "string", + "type": { + "$ref": "5979" + }, + "value": "aio-dataflowprofile" + } + }, + { + "$id": "6095", + "parameter": { + "$ref": "5986" + }, + "value": { + "$id": "6096", + "kind": "model", + "type": { + "$ref": "905" + }, + "value": { + "$id": "6097", + "properties": { + "$id": "6098", + "kind": "model", + "type": { + "$ref": "907" + }, + "value": { + "$id": "6099", + "instanceCount": { + "$id": "6100", + "kind": "number", + "type": { + "$ref": "929" + }, + "value": 1 + } + } + }, + "extendedLocation": { + "$id": "6101", + "kind": "model", + "type": { + "$ref": "669" + }, + "value": { + "$id": "6102", + "name": { + "$id": "6103", + "kind": "string", + "type": { + "$ref": "671" + }, + "value": "qmbrfwcpwwhggszhrdjv" + }, + "type": { + "$id": "6104", + "kind": "string", + "type": { + "$ref": "142" + }, + "value": "CustomLocation" + } + } + } + } + } + } + ], + "responses": [ + { + "$id": "6105", + "response": { + "$ref": "5987" + }, + "statusCode": 200, + "bodyValue": { + "$id": "6106", + "kind": "model", + "type": { + "$ref": "905" + }, + "value": { + "$id": "6107", + "properties": { + "$id": "6108", + "kind": "model", + "type": { + "$ref": "907" + }, + "value": { + "$id": "6109", + "instanceCount": { + "$id": "6110", + "kind": "number", + "type": { + "$ref": "929" + }, + "value": 1 + }, + "provisioningState": { + "$id": "6111", + "kind": "string", + "type": { + "$ref": "126" + }, + "value": "Succeeded" + } + } + }, + "extendedLocation": { + "$id": "6112", + "kind": "model", + "type": { + "$ref": "669" + }, + "value": { + "$id": "6113", + "name": { + "$id": "6114", + "kind": "string", + "type": { + "$ref": "671" + }, + "value": "qmbrfwcpwwhggszhrdjv" + }, + "type": { + "$id": "6115", + "kind": "string", + "type": { + "$ref": "142" + }, + "value": "CustomLocation" + } + } + }, + "id": { + "$id": "6116", + "kind": "string", + "type": { + "$ref": "330" + }, + "value": "/subscriptions/0000000-0000-0000-0000-000000000000/resourceGroups/resourceGroup123/providers/Microsoft.IoTOperations/instances/resource-name123/dataflowProfiles/resource-name123" + }, + "name": { + "$id": "6117", + "kind": "string", + "type": { + "$ref": "335" + }, + "value": "bwhcjsnnfnrmbixamyxjau" + }, + "type": { + "$id": "6118", + "kind": "string", + "type": { + "$ref": "339" + }, + "value": "ejvancsomtbapgztnerhlvx" + }, + "systemData": { + "$id": "6119", + "kind": "model", + "type": { + "$ref": "344" + }, + "value": { + "$id": "6120", + "createdBy": { + "$id": "6121", + "kind": "string", + "type": { + "$ref": "346" + }, + "value": "ssvaslsmudloholronopqyxjcu" + }, + "createdByType": { + "$id": "6122", + "kind": "string", + "type": { + "$ref": "146" + }, + "value": "User" + }, + "createdAt": { + "$id": "6123", + "kind": "string", + "type": { + "$ref": "353" + }, + "value": "2024-08-09T18:13:29.389Z" + }, + "lastModifiedBy": { + "$id": "6124", + "kind": "string", + "type": { + "$ref": "358" + }, + "value": "gnicpuszwd" + }, + "lastModifiedByType": { + "$id": "6125", + "kind": "string", + "type": { + "$ref": "146" + }, + "value": "User" + }, + "lastModifiedAt": { + "$id": "6126", + "kind": "string", + "type": { + "$ref": "365" + }, + "value": "2024-08-09T18:13:29.389Z" + } + } + } + } + } + }, + { + "$id": "6127", + "response": { + "$ref": "5988" + }, + "statusCode": 201, + "bodyValue": { + "$id": "6128", + "kind": "model", + "type": { + "$ref": "905" + }, + "value": { + "$id": "6129", + "properties": { + "$id": "6130", + "kind": "model", + "type": { + "$ref": "907" + }, + "value": { + "$id": "6131", + "instanceCount": { + "$id": "6132", + "kind": "number", + "type": { + "$ref": "929" + }, + "value": 1 + }, + "provisioningState": { + "$id": "6133", + "kind": "string", + "type": { + "$ref": "126" + }, + "value": "Succeeded" + } + } + }, + "extendedLocation": { + "$id": "6134", + "kind": "model", + "type": { + "$ref": "669" + }, + "value": { + "$id": "6135", + "name": { + "$id": "6136", + "kind": "string", + "type": { + "$ref": "671" + }, + "value": "qmbrfwcpwwhggszhrdjv" + }, + "type": { + "$id": "6137", + "kind": "string", + "type": { + "$ref": "142" + }, + "value": "CustomLocation" + } + } + }, + "id": { + "$id": "6138", + "kind": "string", + "type": { + "$ref": "330" + }, + "value": "/subscriptions/0000000-0000-0000-0000-000000000000/resourceGroups/resourceGroup123/providers/Microsoft.IoTOperations/instances/resource-name123/dataflowProfiles/resource-name123" + }, + "name": { + "$id": "6139", + "kind": "string", + "type": { + "$ref": "335" + }, + "value": "bwhcjsnnfnrmbixamyxjau" + }, + "type": { + "$id": "6140", + "kind": "string", + "type": { + "$ref": "339" + }, + "value": "ejvancsomtbapgztnerhlvx" + }, + "systemData": { + "$id": "6141", + "kind": "model", + "type": { + "$ref": "344" + }, + "value": { + "$id": "6142", + "createdBy": { + "$id": "6143", + "kind": "string", + "type": { + "$ref": "346" + }, + "value": "ssvaslsmudloholronopqyxjcu" + }, + "createdByType": { + "$id": "6144", + "kind": "string", + "type": { + "$ref": "146" + }, + "value": "User" + }, + "createdAt": { + "$id": "6145", + "kind": "string", + "type": { + "$ref": "353" + }, + "value": "2024-08-09T18:13:29.389Z" + }, + "lastModifiedBy": { + "$id": "6146", + "kind": "string", + "type": { + "$ref": "358" + }, + "value": "gnicpuszwd" + }, + "lastModifiedByType": { + "$id": "6147", + "kind": "string", + "type": { + "$ref": "146" + }, + "value": "User" + }, + "lastModifiedAt": { + "$id": "6148", + "kind": "string", + "type": { + "$ref": "365" + }, + "value": "2024-08-09T18:13:29.389Z" + } + } + } + } + } + } + ] + }, + { + "$id": "6149", + "kind": "http", + "name": "DataflowProfile_CreateOrUpdate_Multi", + "description": "DataflowProfile_CreateOrUpdate_Multi", + "filePath": "2024-11-01/DataflowProfile_CreateOrUpdate_Multi.json", + "parameters": [ + { + "$id": "6150", + "parameter": { + "$ref": "5967" + }, + "value": { + "$id": "6151", + "kind": "string", + "type": { + "$ref": "5968" + }, + "value": "2024-11-01" + } + }, + { + "$id": "6152", + "parameter": { + "$ref": "5971" + }, + "value": { + "$id": "6153", + "kind": "string", + "type": { + "$ref": "5972" + }, + "value": "F8C729F9-DF9C-4743-848F-96EE433D8E53" + } + }, + { + "$id": "6154", + "parameter": { + "$ref": "5974" + }, + "value": { + "$id": "6155", + "kind": "string", + "type": { + "$ref": "5975" + }, + "value": "rgiotoperations" + } + }, + { + "$id": "6156", + "parameter": { + "$ref": "5976" + }, + "value": { + "$id": "6157", + "kind": "string", + "type": { + "$ref": "5977" + }, + "value": "resource-name123" + } + }, + { + "$id": "6158", + "parameter": { + "$ref": "5978" + }, + "value": { + "$id": "6159", + "kind": "string", + "type": { + "$ref": "5979" + }, + "value": "aio-dataflowprofile" + } + }, + { + "$id": "6160", + "parameter": { + "$ref": "5986" + }, + "value": { + "$id": "6161", + "kind": "model", + "type": { + "$ref": "905" + }, + "value": { + "$id": "6162", + "properties": { + "$id": "6163", + "kind": "model", + "type": { + "$ref": "907" + }, + "value": { + "$id": "6164", + "instanceCount": { + "$id": "6165", + "kind": "number", + "type": { + "$ref": "929" + }, + "value": 3 + } + } + }, + "extendedLocation": { + "$id": "6166", + "kind": "model", + "type": { + "$ref": "669" + }, + "value": { + "$id": "6167", + "name": { + "$id": "6168", + "kind": "string", + "type": { + "$ref": "671" + }, + "value": "qmbrfwcpwwhggszhrdjv" + }, + "type": { + "$id": "6169", + "kind": "string", + "type": { + "$ref": "142" + }, + "value": "CustomLocation" + } + } + } + } + } + } + ], + "responses": [ + { + "$id": "6170", + "response": { + "$ref": "5987" + }, + "statusCode": 200, + "bodyValue": { + "$id": "6171", + "kind": "model", + "type": { + "$ref": "905" + }, + "value": { + "$id": "6172", + "properties": { + "$id": "6173", + "kind": "model", + "type": { + "$ref": "907" + }, + "value": { + "$id": "6174", + "instanceCount": { + "$id": "6175", + "kind": "number", + "type": { + "$ref": "929" + }, + "value": 3 + }, + "provisioningState": { + "$id": "6176", + "kind": "string", + "type": { + "$ref": "126" + }, + "value": "Succeeded" + } + } + }, + "extendedLocation": { + "$id": "6177", + "kind": "model", + "type": { + "$ref": "669" + }, + "value": { + "$id": "6178", + "name": { + "$id": "6179", + "kind": "string", + "type": { + "$ref": "671" + }, + "value": "qmbrfwcpwwhggszhrdjv" + }, + "type": { + "$id": "6180", + "kind": "string", + "type": { + "$ref": "142" + }, + "value": "CustomLocation" + } + } + }, + "id": { + "$id": "6181", + "kind": "string", + "type": { + "$ref": "330" + }, + "value": "/subscriptions/0000000-0000-0000-0000-000000000000/resourceGroups/resourceGroup123/providers/Microsoft.IoTOperations/instances/resource-name123/dataflowProfiles/resource-name123" + }, + "name": { + "$id": "6182", + "kind": "string", + "type": { + "$ref": "335" + }, + "value": "bwhcjsnnfnrmbixamyxjau" + }, + "type": { + "$id": "6183", + "kind": "string", + "type": { + "$ref": "339" + }, + "value": "ejvancsomtbapgztnerhlvx" + }, + "systemData": { + "$id": "6184", + "kind": "model", + "type": { + "$ref": "344" + }, + "value": { + "$id": "6185", + "createdBy": { + "$id": "6186", + "kind": "string", + "type": { + "$ref": "346" + }, + "value": "ssvaslsmudloholronopqyxjcu" + }, + "createdByType": { + "$id": "6187", + "kind": "string", + "type": { + "$ref": "146" + }, + "value": "User" + }, + "createdAt": { + "$id": "6188", + "kind": "string", + "type": { + "$ref": "353" + }, + "value": "2024-08-09T18:13:29.389Z" + }, + "lastModifiedBy": { + "$id": "6189", + "kind": "string", + "type": { + "$ref": "358" + }, + "value": "gnicpuszwd" + }, + "lastModifiedByType": { + "$id": "6190", + "kind": "string", + "type": { + "$ref": "146" + }, + "value": "User" + }, + "lastModifiedAt": { + "$id": "6191", + "kind": "string", + "type": { + "$ref": "365" + }, + "value": "2024-08-09T18:13:29.389Z" + } + } + } + } + } + }, + { + "$id": "6192", + "response": { + "$ref": "5988" + }, + "statusCode": 201, + "bodyValue": { + "$id": "6193", + "kind": "model", + "type": { + "$ref": "905" + }, + "value": { + "$id": "6194", + "properties": { + "$id": "6195", + "kind": "model", + "type": { + "$ref": "907" + }, + "value": { + "$id": "6196", + "instanceCount": { + "$id": "6197", + "kind": "number", + "type": { + "$ref": "929" + }, + "value": 3 + }, + "provisioningState": { + "$id": "6198", + "kind": "string", + "type": { + "$ref": "126" + }, + "value": "Succeeded" + } + } + }, + "extendedLocation": { + "$id": "6199", + "kind": "model", + "type": { + "$ref": "669" + }, + "value": { + "$id": "6200", + "name": { + "$id": "6201", + "kind": "string", + "type": { + "$ref": "671" + }, + "value": "qmbrfwcpwwhggszhrdjv" + }, + "type": { + "$id": "6202", + "kind": "string", + "type": { + "$ref": "142" + }, + "value": "CustomLocation" + } + } + }, + "id": { + "$id": "6203", + "kind": "string", + "type": { + "$ref": "330" + }, + "value": "/subscriptions/0000000-0000-0000-0000-000000000000/resourceGroups/resourceGroup123/providers/Microsoft.IoTOperations/instances/resource-name123/dataflowProfiles/resource-name123" + }, + "name": { + "$id": "6204", + "kind": "string", + "type": { + "$ref": "335" + }, + "value": "bwhcjsnnfnrmbixamyxjau" + }, + "type": { + "$id": "6205", + "kind": "string", + "type": { + "$ref": "339" + }, + "value": "ejvancsomtbapgztnerhlvx" + }, + "systemData": { + "$id": "6206", + "kind": "model", + "type": { + "$ref": "344" + }, + "value": { + "$id": "6207", + "createdBy": { + "$id": "6208", + "kind": "string", + "type": { + "$ref": "346" + }, + "value": "ssvaslsmudloholronopqyxjcu" + }, + "createdByType": { + "$id": "6209", + "kind": "string", + "type": { + "$ref": "146" + }, + "value": "User" + }, + "createdAt": { + "$id": "6210", + "kind": "string", + "type": { + "$ref": "353" + }, + "value": "2024-08-09T18:13:29.389Z" + }, + "lastModifiedBy": { + "$id": "6211", + "kind": "string", + "type": { + "$ref": "358" + }, + "value": "gnicpuszwd" + }, + "lastModifiedByType": { + "$id": "6212", + "kind": "string", + "type": { + "$ref": "146" + }, + "value": "User" + }, + "lastModifiedAt": { + "$id": "6213", + "kind": "string", + "type": { + "$ref": "365" + }, + "value": "2024-08-09T18:13:29.389Z" + } + } + } + } + } + } + ] + } + ] + }, + { + "$id": "6214", + "Name": "delete", + "ResourceName": "DataflowProfileResource", + "Doc": "Delete a DataflowProfileResource", + "Accessibility": "public", + "Parameters": [ + { + "$id": "6215", + "Name": "apiVersion", + "NameInRequest": "api-version", + "Doc": "The API version to use for this operation.", + "Type": { + "$id": "6216", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": true, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "DefaultValue": { + "$id": "6217", + "Type": { + "$id": "6218", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "2024-11-01" + }, + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "6219", + "Name": "subscriptionId", + "NameInRequest": "subscriptionId", + "Doc": "The ID of the target subscription. The value must be an UUID.", + "Type": { + "$id": "6220", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "6221", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "6222", + "Name": "resourceGroupName", + "NameInRequest": "resourceGroupName", + "Doc": "The name of the resource group. The name is case insensitive.", + "Type": { + "$id": "6223", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "6224", + "Name": "instanceName", + "NameInRequest": "instanceName", + "Doc": "Name of instance.", + "Type": { + "$id": "6225", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "6226", + "Name": "dataflowProfileName", + "NameInRequest": "dataflowProfileName", + "Doc": "Name of Instance dataflowProfile resource", + "Type": { + "$id": "6227", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "6228", + "Name": "accept", + "NameInRequest": "Accept", + "Type": { + "$id": "6229", + "kind": "constant", + "valueType": { + "$id": "6230", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "6231", + "StatusCodes": [ + 202 + ], + "BodyMediaType": "Json", + "Headers": [ + { + "$id": "6232", + "Name": "location", + "NameInResponse": "Location", + "Doc": "The Location header contains the URL where the status of the long running operation can be checked.", + "Type": { + "$id": "6233", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + } + }, + { + "$id": "6234", + "Name": "retryAfter", + "NameInResponse": "Retry-After", + "Doc": "The Retry-After header can indicate how long the client should wait before polling the operation status.", + "Type": { + "$id": "6235", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + } + } + ], + "IsErrorResponse": false + }, + { + "$id": "6236", + "StatusCodes": [ + 204 + ], + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false + } + ], + "HttpMethod": "DELETE", + "RequestBodyMediaType": "None", + "Uri": "{endpoint}", + "Path": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/dataflowProfiles/{dataflowProfileName}", + "BufferResponse": true, + "LongRunning": { + "$id": "6237", + "FinalStateVia": 1, + "FinalResponse": { + "$id": "6238", + "StatusCodes": [ + 204 + ], + "BodyMediaType": "Json" + } + }, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Microsoft.IoTOperations.DataflowProfile.delete", + "Decorators": [], + "Examples": [ + { + "$id": "6239", + "kind": "http", + "name": "DataflowProfile_Delete", + "description": "DataflowProfile_Delete", + "filePath": "2024-11-01/DataflowProfile_Delete_MaximumSet_Gen.json", + "parameters": [ + { + "$id": "6240", + "parameter": { + "$ref": "6215" + }, + "value": { + "$id": "6241", + "kind": "string", + "type": { + "$ref": "6216" + }, + "value": "2024-11-01" + } + }, + { + "$id": "6242", + "parameter": { + "$ref": "6219" + }, + "value": { + "$id": "6243", + "kind": "string", + "type": { + "$ref": "6220" + }, + "value": "F8C729F9-DF9C-4743-848F-96EE433D8E53" + } + }, + { + "$id": "6244", + "parameter": { + "$ref": "6222" + }, + "value": { + "$id": "6245", + "kind": "string", + "type": { + "$ref": "6223" + }, + "value": "rgiotoperations" + } + }, + { + "$id": "6246", + "parameter": { + "$ref": "6224" + }, + "value": { + "$id": "6247", + "kind": "string", + "type": { + "$ref": "6225" + }, + "value": "resource-name123" + } + }, + { + "$id": "6248", + "parameter": { + "$ref": "6226" + }, + "value": { + "$id": "6249", + "kind": "string", + "type": { + "$ref": "6227" + }, + "value": "resource-name123" + } + } + ], + "responses": [ + { + "$id": "6250", + "response": { + "$ref": "6231" + }, + "statusCode": 202 + }, + { + "$id": "6251", + "response": { + "$ref": "6236" + }, + "statusCode": 204 + } + ] + } + ] + }, + { + "$id": "6252", + "Name": "listByResourceGroup", + "ResourceName": "DataflowProfileResource", + "Doc": "List DataflowProfileResource resources by InstanceResource", + "Accessibility": "public", + "Parameters": [ + { + "$id": "6253", + "Name": "apiVersion", + "NameInRequest": "api-version", + "Doc": "The API version to use for this operation.", + "Type": { + "$id": "6254", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": true, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "DefaultValue": { + "$id": "6255", + "Type": { + "$id": "6256", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "2024-11-01" + }, + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "6257", + "Name": "subscriptionId", + "NameInRequest": "subscriptionId", + "Doc": "The ID of the target subscription. The value must be an UUID.", + "Type": { + "$id": "6258", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "6259", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "6260", + "Name": "resourceGroupName", + "NameInRequest": "resourceGroupName", + "Doc": "The name of the resource group. The name is case insensitive.", + "Type": { + "$id": "6261", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "6262", + "Name": "instanceName", + "NameInRequest": "instanceName", + "Doc": "Name of instance.", + "Type": { + "$id": "6263", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "6264", + "Name": "accept", + "NameInRequest": "Accept", + "Type": { + "$id": "6265", + "kind": "constant", + "valueType": { + "$id": "6266", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "6267", + "StatusCodes": [ + 200 + ], + "BodyType": { + "$ref": "940" + }, + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false, + "ContentTypes": [ + "application/json" + ] + } + ], + "HttpMethod": "GET", + "RequestBodyMediaType": "None", + "Uri": "{endpoint}", + "Path": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/dataflowProfiles", + "BufferResponse": true, + "Paging": { + "$id": "6268", + "ItemName": "value", + "NextLinkName": "nextLink" + }, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Microsoft.IoTOperations.DataflowProfile.listByResourceGroup", + "Decorators": [], + "Examples": [ + { + "$id": "6269", + "kind": "http", + "name": "DataflowProfile_ListByResourceGroup", + "description": "DataflowProfile_ListByResourceGroup", + "filePath": "2024-11-01/DataflowProfile_ListByResourceGroup_MaximumSet_Gen.json", + "parameters": [ + { + "$id": "6270", + "parameter": { + "$ref": "6253" + }, + "value": { + "$id": "6271", + "kind": "string", + "type": { + "$ref": "6254" + }, + "value": "2024-11-01" + } + }, + { + "$id": "6272", + "parameter": { + "$ref": "6257" + }, + "value": { + "$id": "6273", + "kind": "string", + "type": { + "$ref": "6258" + }, + "value": "F8C729F9-DF9C-4743-848F-96EE433D8E53" + } + }, + { + "$id": "6274", + "parameter": { + "$ref": "6260" + }, + "value": { + "$id": "6275", + "kind": "string", + "type": { + "$ref": "6261" + }, + "value": "rgiotoperations" + } + }, + { + "$id": "6276", + "parameter": { + "$ref": "6262" + }, + "value": { + "$id": "6277", + "kind": "string", + "type": { + "$ref": "6263" + }, + "value": "resource-name123" + } + } + ], + "responses": [ + { + "$id": "6278", + "response": { + "$ref": "6267" + }, + "statusCode": 200, + "bodyValue": { + "$id": "6279", + "kind": "model", + "type": { + "$ref": "940" + }, + "value": { + "$id": "6280", + "value": { + "$id": "6281", + "kind": "array", + "type": { + "$ref": "942" + }, + "value": [ + { + "$id": "6282", + "kind": "model", + "type": { + "$ref": "905" + }, + "value": { + "$id": "6283", + "properties": { + "$id": "6284", + "kind": "model", + "type": { + "$ref": "907" + }, + "value": { + "$id": "6285", + "diagnostics": { + "$id": "6286", + "kind": "model", + "type": { + "$ref": "909" + }, + "value": { + "$id": "6287", + "logs": { + "$id": "6288", + "kind": "model", + "type": { + "$ref": "911" + }, + "value": { + "$id": "6289", + "level": { + "$id": "6290", + "kind": "string", + "type": { + "$ref": "913" + }, + "value": "rnmwokumdmebpmfxxxzvvjfdywotav" + } + } + }, + "metrics": { + "$id": "6291", + "kind": "model", + "type": { + "$ref": "919" + }, + "value": { + "$id": "6292", + "prometheusPort": { + "$id": "6293", + "kind": "number", + "type": { + "$ref": "921" + }, + "value": 7581 + } + } + } + } + }, + "instanceCount": { + "$id": "6294", + "kind": "number", + "type": { + "$ref": "929" + }, + "value": 14 + }, + "provisioningState": { + "$id": "6295", + "kind": "string", + "type": { + "$ref": "126" + }, + "value": "Succeeded" + } + } + }, + "extendedLocation": { + "$id": "6296", + "kind": "model", + "type": { + "$ref": "669" + }, + "value": { + "$id": "6297", + "name": { + "$id": "6298", + "kind": "string", + "type": { + "$ref": "671" + }, + "value": "qmbrfwcpwwhggszhrdjv" + }, + "type": { + "$id": "6299", + "kind": "string", + "type": { + "$ref": "142" + }, + "value": "CustomLocation" + } + } + }, + "id": { + "$id": "6300", + "kind": "string", + "type": { + "$ref": "330" + }, + "value": "/subscriptions/0000000-0000-0000-0000-000000000000/resourceGroups/resourceGroup123/providers/Microsoft.IoTOperations/instances/resource-name123/dataflowProfiles/resource-name123" + }, + "name": { + "$id": "6301", + "kind": "string", + "type": { + "$ref": "335" + }, + "value": "bwhcjsnnfnrmbixamyxjau" + }, + "type": { + "$id": "6302", + "kind": "string", + "type": { + "$ref": "339" + }, + "value": "ejvancsomtbapgztnerhlvx" + }, + "systemData": { + "$id": "6303", + "kind": "model", + "type": { + "$ref": "344" + }, + "value": { + "$id": "6304", + "createdBy": { + "$id": "6305", + "kind": "string", + "type": { + "$ref": "346" + }, + "value": "ssvaslsmudloholronopqyxjcu" + }, + "createdByType": { + "$id": "6306", + "kind": "string", + "type": { + "$ref": "146" + }, + "value": "User" + }, + "createdAt": { + "$id": "6307", + "kind": "string", + "type": { + "$ref": "353" + }, + "value": "2024-08-09T18:13:29.389Z" + }, + "lastModifiedBy": { + "$id": "6308", + "kind": "string", + "type": { + "$ref": "358" + }, + "value": "gnicpuszwd" + }, + "lastModifiedByType": { + "$id": "6309", + "kind": "string", + "type": { + "$ref": "146" + }, + "value": "User" + }, + "lastModifiedAt": { + "$id": "6310", + "kind": "string", + "type": { + "$ref": "365" + }, + "value": "2024-08-09T18:13:29.389Z" + } + } + } + } + } + ] + }, + "nextLink": { + "$id": "6311", + "kind": "string", + "type": { + "$ref": "946" + }, + "value": "https://microsoft.com/a" + } + } + } + } + ] + } + ] + } + ], + "Protocol": { + "$id": "6312" + }, + "Parent": "IoTOperationsClient", + "Parameters": [ + { + "$id": "6313", + "Name": "endpoint", + "NameInRequest": "endpoint", + "Doc": "Service host", + "Type": { + "$id": "6314", + "kind": "url", + "name": "url", + "crossLanguageDefinitionId": "TypeSpec.url" + }, + "Location": "Uri", + "IsApiVersion": false, + "IsResourceParameter": false, + "IsContentType": false, + "IsRequired": true, + "IsEndpoint": true, + "SkipUrlEncoding": false, + "Explode": false, + "Kind": "Client", + "DefaultValue": { + "$id": "6315", + "Type": { + "$id": "6316", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "https://management.azure.com" + } + } + ], + "Decorators": [] + }, + { + "$id": "6317", + "Name": "Dataflow", + "ClientNamespace": "Microsoft.IoTOperations", + "Operations": [ + { + "$id": "6318", + "Name": "get", + "ResourceName": "DataflowResource", + "Doc": "Get a DataflowResource", + "Accessibility": "public", + "Parameters": [ + { + "$id": "6319", + "Name": "apiVersion", + "NameInRequest": "api-version", + "Doc": "The API version to use for this operation.", + "Type": { + "$id": "6320", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": true, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "DefaultValue": { + "$id": "6321", + "Type": { + "$id": "6322", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "2024-11-01" + }, + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "6323", + "Name": "subscriptionId", + "NameInRequest": "subscriptionId", + "Doc": "The ID of the target subscription. The value must be an UUID.", + "Type": { + "$id": "6324", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "6325", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "6326", + "Name": "resourceGroupName", + "NameInRequest": "resourceGroupName", + "Doc": "The name of the resource group. The name is case insensitive.", + "Type": { + "$id": "6327", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "6328", + "Name": "instanceName", + "NameInRequest": "instanceName", + "Doc": "Name of instance.", + "Type": { + "$id": "6329", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "6330", + "Name": "dataflowProfileName", + "NameInRequest": "dataflowProfileName", + "Doc": "Name of Instance dataflowProfile resource", + "Type": { + "$id": "6331", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "6332", + "Name": "dataflowName", + "NameInRequest": "dataflowName", + "Doc": "Name of Instance dataflowProfile dataflow resource", + "Type": { + "$id": "6333", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "6334", + "Name": "accept", + "NameInRequest": "Accept", + "Type": { + "$id": "6335", + "kind": "constant", + "valueType": { + "$id": "6336", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "6337", + "StatusCodes": [ + 200 + ], + "BodyType": { + "$ref": "748" + }, + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false, + "ContentTypes": [ + "application/json" + ] + } + ], + "HttpMethod": "GET", + "RequestBodyMediaType": "None", + "Uri": "{endpoint}", + "Path": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/dataflowProfiles/{dataflowProfileName}/dataflows/{dataflowName}", + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Microsoft.IoTOperations.Dataflow.get", + "Decorators": [], + "Examples": [ + { + "$id": "6338", + "kind": "http", + "name": "Dataflow_Get", + "description": "Dataflow_Get", + "filePath": "2024-11-01/Dataflow_Get_MaximumSet_Gen.json", + "parameters": [ + { + "$id": "6339", + "parameter": { + "$ref": "6319" + }, + "value": { + "$id": "6340", + "kind": "string", + "type": { + "$ref": "6320" + }, + "value": "2024-11-01" + } + }, + { + "$id": "6341", + "parameter": { + "$ref": "6323" + }, + "value": { + "$id": "6342", + "kind": "string", + "type": { + "$ref": "6324" + }, + "value": "F8C729F9-DF9C-4743-848F-96EE433D8E53" + } + }, + { + "$id": "6343", + "parameter": { + "$ref": "6326" + }, + "value": { + "$id": "6344", + "kind": "string", + "type": { + "$ref": "6327" + }, + "value": "rgiotoperations" + } + }, + { + "$id": "6345", + "parameter": { + "$ref": "6328" + }, + "value": { + "$id": "6346", + "kind": "string", + "type": { + "$ref": "6329" + }, + "value": "resource-name123" + } + }, + { + "$id": "6347", + "parameter": { + "$ref": "6330" + }, + "value": { + "$id": "6348", + "kind": "string", + "type": { + "$ref": "6331" + }, + "value": "resource-name123" + } + }, + { + "$id": "6349", + "parameter": { + "$ref": "6332" + }, + "value": { + "$id": "6350", + "kind": "string", + "type": { + "$ref": "6333" + }, + "value": "resource-name123" + } + } + ], + "responses": [ + { + "$id": "6351", + "response": { + "$ref": "6337" + }, + "statusCode": 200, + "bodyValue": { + "$id": "6352", + "kind": "model", + "type": { + "$ref": "748" + }, + "value": { + "$id": "6353", + "properties": { + "$id": "6354", + "kind": "model", + "type": { + "$ref": "750" + }, + "value": { + "$id": "6355", + "mode": { + "$id": "6356", + "kind": "string", + "type": { + "$ref": "62" + }, + "value": "Enabled" + }, + "operations": { + "$id": "6357", + "kind": "array", + "type": { + "$ref": "755" + }, + "value": [ + { + "$id": "6358", + "kind": "model", + "type": { + "$ref": "756" + }, + "value": { + "$id": "6359", + "operationType": { + "$id": "6360", + "kind": "string", + "type": { + "$ref": "164" + }, + "value": "Source" + }, + "name": { + "$id": "6361", + "kind": "string", + "type": { + "$ref": "761" + }, + "value": "knnafvkwoeakm" + }, + "sourceSettings": { + "$id": "6362", + "kind": "model", + "type": { + "$ref": "765" + }, + "value": { + "$id": "6363", + "endpointRef": { + "$id": "6364", + "kind": "string", + "type": { + "$ref": "767" + }, + "value": "iixotodhvhkkfcfyrkoveslqig" + }, + "assetRef": { + "$id": "6365", + "kind": "string", + "type": { + "$ref": "771" + }, + "value": "zayyykwmckaocywdkohmu" + }, + "serializationFormat": { + "$id": "6366", + "kind": "string", + "type": { + "$ref": "172" + }, + "value": "Json" + }, + "schemaRef": { + "$id": "6367", + "kind": "string", + "type": { + "$ref": "778" + }, + "value": "pknmdzqll" + }, + "dataSources": { + "$id": "6368", + "kind": "array", + "type": { + "$ref": "782" + }, + "value": [ + { + "$id": "6369", + "kind": "string", + "type": { + "$ref": "783" + }, + "value": "chkkpymxhp" + } + ] + } + } + }, + "builtInTransformationSettings": { + "$id": "6370", + "kind": "model", + "type": { + "$ref": "790" + }, + "value": { + "$id": "6371", + "serializationFormat": { + "$id": "6372", + "kind": "string", + "type": { + "$ref": "176" + }, + "value": "Delta" + }, + "schemaRef": { + "$id": "6373", + "kind": "string", + "type": { + "$ref": "795" + }, + "value": "mcdc" + }, + "datasets": { + "$id": "6374", + "kind": "array", + "type": { + "$ref": "799" + }, + "value": [ + { + "$id": "6375", + "kind": "model", + "type": { + "$ref": "800" + }, + "value": { + "$id": "6376", + "key": { + "$id": "6377", + "kind": "string", + "type": { + "$ref": "802" + }, + "value": "qsfqcgxaxnhfumrsdsokwyv" + }, + "description": { + "$id": "6378", + "kind": "string", + "type": { + "$ref": "806" + }, + "value": "Lorem ipsum odor amet, consectetuer adipiscing elit." + }, + "schemaRef": { + "$id": "6379", + "kind": "string", + "type": { + "$ref": "810" + }, + "value": "n" + }, + "inputs": { + "$id": "6380", + "kind": "array", + "type": { + "$ref": "814" + }, + "value": [ + { + "$id": "6381", + "kind": "string", + "type": { + "$ref": "815" + }, + "value": "mosffpsslifkq" + } + ] + }, + "expression": { + "$id": "6382", + "kind": "string", + "type": { + "$ref": "819" + }, + "value": "aatbwomvflemsxialv" + } + } + } + ] + }, + "filter": { + "$id": "6383", + "kind": "array", + "type": { + "$ref": "825" + }, + "value": [ + { + "$id": "6384", + "kind": "model", + "type": { + "$ref": "826" + }, + "value": { + "$id": "6385", + "type": { + "$id": "6386", + "kind": "string", + "type": { + "$ref": "184" + }, + "value": "Filter" + }, + "description": { + "$id": "6387", + "kind": "string", + "type": { + "$ref": "831" + }, + "value": "Lorem ipsum odor amet, consectetuer adipiscing elit." + }, + "inputs": { + "$id": "6388", + "kind": "array", + "type": { + "$ref": "835" + }, + "value": [ + { + "$id": "6389", + "kind": "string", + "type": { + "$ref": "836" + }, + "value": "sxmjkbntgb" + } + ] + }, + "expression": { + "$id": "6390", + "kind": "string", + "type": { + "$ref": "840" + }, + "value": "n" + } + } + } + ] + }, + "map": { + "$id": "6391", + "kind": "array", + "type": { + "$ref": "846" + }, + "value": [ + { + "$id": "6392", + "kind": "model", + "type": { + "$ref": "847" + }, + "value": { + "$id": "6393", + "type": { + "$id": "6394", + "kind": "string", + "type": { + "$ref": "188" + }, + "value": "NewProperties" + }, + "description": { + "$id": "6395", + "kind": "string", + "type": { + "$ref": "852" + }, + "value": "Lorem ipsum odor amet, consectetuer adipiscing elit." + }, + "inputs": { + "$id": "6396", + "kind": "array", + "type": { + "$ref": "856" + }, + "value": [ + { + "$id": "6397", + "kind": "string", + "type": { + "$ref": "857" + }, + "value": "xsbxuk" + } + ] + }, + "expression": { + "$id": "6398", + "kind": "string", + "type": { + "$ref": "861" + }, + "value": "txoiltogsarwkzalsphvlmt" + }, + "output": { + "$id": "6399", + "kind": "string", + "type": { + "$ref": "865" + }, + "value": "nvgtmkfl" + } + } + } + ] + } + } + }, + "destinationSettings": { + "$id": "6400", + "kind": "model", + "type": { + "$ref": "873" + }, + "value": { + "$id": "6401", + "endpointRef": { + "$id": "6402", + "kind": "string", + "type": { + "$ref": "875" + }, + "value": "kybkchnzimerguekuvqlqiqdvvrt" + }, + "dataDestination": { + "$id": "6403", + "kind": "string", + "type": { + "$ref": "879" + }, + "value": "cbrh" + } + } + } + } + } + ] + }, + "provisioningState": { + "$id": "6404", + "kind": "string", + "type": { + "$ref": "126" + }, + "value": "Succeeded" + } + } + }, + "extendedLocation": { + "$id": "6405", + "kind": "model", + "type": { + "$ref": "669" + }, + "value": { + "$id": "6406", + "name": { + "$id": "6407", + "kind": "string", + "type": { + "$ref": "671" + }, + "value": "qmbrfwcpwwhggszhrdjv" + }, + "type": { + "$id": "6408", + "kind": "string", + "type": { + "$ref": "142" + }, + "value": "CustomLocation" + } + } + }, + "id": { + "$id": "6409", + "kind": "string", + "type": { + "$ref": "330" + }, + "value": "/subscriptions/0000000-0000-0000-0000-000000000000/resourceGroups/resourceGroup123/providers/Microsoft.IoTOperations/instances/resource-name123/dataflowProfiles/resource-name123/dataflows/resource-name123" + }, + "name": { + "$id": "6410", + "kind": "string", + "type": { + "$ref": "335" + }, + "value": "jxhcpwgfkxqasbexkookvxk" + }, + "type": { + "$id": "6411", + "kind": "string", + "type": { + "$ref": "339" + }, + "value": "zkuozvgjseokfchkscoswthzjdry" + }, + "systemData": { + "$id": "6412", + "kind": "model", + "type": { + "$ref": "344" + }, + "value": { + "$id": "6413", + "createdBy": { + "$id": "6414", + "kind": "string", + "type": { + "$ref": "346" + }, + "value": "ssvaslsmudloholronopqyxjcu" + }, + "createdByType": { + "$id": "6415", + "kind": "string", + "type": { + "$ref": "146" + }, + "value": "User" + }, + "createdAt": { + "$id": "6416", + "kind": "string", + "type": { + "$ref": "353" + }, + "value": "2024-08-09T18:13:29.389Z" + }, + "lastModifiedBy": { + "$id": "6417", + "kind": "string", + "type": { + "$ref": "358" + }, + "value": "gnicpuszwd" + }, + "lastModifiedByType": { + "$id": "6418", + "kind": "string", + "type": { + "$ref": "146" + }, + "value": "User" + }, + "lastModifiedAt": { + "$id": "6419", + "kind": "string", + "type": { + "$ref": "365" + }, + "value": "2024-08-09T18:13:29.389Z" + } + } + } + } + } + } + ] + } + ] + }, + { + "$id": "6420", + "Name": "createOrUpdate", + "ResourceName": "DataflowResource", + "Doc": "Create a DataflowResource", + "Accessibility": "public", + "Parameters": [ + { + "$id": "6421", + "Name": "apiVersion", + "NameInRequest": "api-version", + "Doc": "The API version to use for this operation.", + "Type": { + "$id": "6422", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": true, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "DefaultValue": { + "$id": "6423", + "Type": { + "$id": "6424", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "2024-11-01" + }, + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "6425", + "Name": "subscriptionId", + "NameInRequest": "subscriptionId", + "Doc": "The ID of the target subscription. The value must be an UUID.", + "Type": { + "$id": "6426", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "6427", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "6428", + "Name": "resourceGroupName", + "NameInRequest": "resourceGroupName", + "Doc": "The name of the resource group. The name is case insensitive.", + "Type": { + "$id": "6429", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "6430", + "Name": "instanceName", + "NameInRequest": "instanceName", + "Doc": "Name of instance.", + "Type": { + "$id": "6431", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "6432", + "Name": "dataflowProfileName", + "NameInRequest": "dataflowProfileName", + "Doc": "Name of Instance dataflowProfile resource", + "Type": { + "$id": "6433", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "6434", + "Name": "dataflowName", + "NameInRequest": "dataflowName", + "Doc": "Name of Instance dataflowProfile dataflow resource", + "Type": { + "$id": "6435", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "6436", + "Name": "contentType", + "NameInRequest": "Content-Type", + "Doc": "Body parameter's content type. Known values are application/json", + "Type": { + "$id": "6437", + "kind": "constant", + "valueType": { + "$id": "6438", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": true, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "6439", + "Name": "accept", + "NameInRequest": "Accept", + "Type": { + "$id": "6440", + "kind": "constant", + "valueType": { + "$id": "6441", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "6442", + "Name": "resource", + "NameInRequest": "resource", + "Doc": "Resource create parameters.", + "Type": { + "$ref": "748" + }, + "Location": "Body", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "6443", + "StatusCodes": [ + 200 + ], + "BodyType": { + "$ref": "748" + }, + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false, + "ContentTypes": [ + "application/json" + ] + }, + { + "$id": "6444", + "StatusCodes": [ + 201 + ], + "BodyType": { + "$ref": "748" + }, + "BodyMediaType": "Json", + "Headers": [ + { + "$id": "6445", + "Name": "azureAsyncOperation", + "NameInResponse": "Azure-AsyncOperation", + "Doc": "A link to the status monitor", + "Type": { + "$id": "6446", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + } + }, + { + "$id": "6447", + "Name": "retryAfter", + "NameInResponse": "Retry-After", + "Doc": "The Retry-After header can indicate how long the client should wait before polling the operation status.", + "Type": { + "$id": "6448", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + } + } + ], + "IsErrorResponse": false, + "ContentTypes": [ + "application/json" + ] + } + ], + "HttpMethod": "PUT", + "RequestBodyMediaType": "Json", + "Uri": "{endpoint}", + "Path": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/dataflowProfiles/{dataflowProfileName}/dataflows/{dataflowName}", + "RequestMediaTypes": [ + "application/json" + ], + "BufferResponse": true, + "LongRunning": { + "$id": "6449", + "FinalStateVia": 0, + "FinalResponse": { + "$id": "6450", + "StatusCodes": [ + 200 + ], + "BodyType": { + "$ref": "748" + }, + "BodyMediaType": "Json" + } + }, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Microsoft.IoTOperations.Dataflow.createOrUpdate", + "Decorators": [], + "Examples": [ + { + "$id": "6451", + "kind": "http", + "name": "Dataflow_CreateOrUpdate_ComplexContextualization", + "description": "Dataflow_CreateOrUpdate_ComplexContextualization", + "filePath": "2024-11-01/Dataflow_CreateOrUpdate_ComplexContextualization.json", + "parameters": [ + { + "$id": "6452", + "parameter": { + "$ref": "6421" + }, + "value": { + "$id": "6453", + "kind": "string", + "type": { + "$ref": "6422" + }, + "value": "2024-11-01" + } + }, + { + "$id": "6454", + "parameter": { + "$ref": "6425" + }, + "value": { + "$id": "6455", + "kind": "string", + "type": { + "$ref": "6426" + }, + "value": "F8C729F9-DF9C-4743-848F-96EE433D8E53" + } + }, + { + "$id": "6456", + "parameter": { + "$ref": "6428" + }, + "value": { + "$id": "6457", + "kind": "string", + "type": { + "$ref": "6429" + }, + "value": "rgiotoperations" + } + }, + { + "$id": "6458", + "parameter": { + "$ref": "6430" + }, + "value": { + "$id": "6459", + "kind": "string", + "type": { + "$ref": "6431" + }, + "value": "resource-name123" + } + }, + { + "$id": "6460", + "parameter": { + "$ref": "6432" + }, + "value": { + "$id": "6461", + "kind": "string", + "type": { + "$ref": "6433" + }, + "value": "resource-name123" + } + }, + { + "$id": "6462", + "parameter": { + "$ref": "6434" + }, + "value": { + "$id": "6463", + "kind": "string", + "type": { + "$ref": "6435" + }, + "value": "aio-to-adx-contexualized" + } + }, + { + "$id": "6464", + "parameter": { + "$ref": "6442" + }, + "value": { + "$id": "6465", + "kind": "model", + "type": { + "$ref": "748" + }, + "value": { + "$id": "6466", + "properties": { + "$id": "6467", + "kind": "model", + "type": { + "$ref": "750" + }, + "value": { + "$id": "6468", + "mode": { + "$id": "6469", + "kind": "string", + "type": { + "$ref": "62" + }, + "value": "Enabled" + }, + "operations": { + "$id": "6470", + "kind": "array", + "type": { + "$ref": "755" + }, + "value": [ + { + "$id": "6471", + "kind": "model", + "type": { + "$ref": "756" + }, + "value": { + "$id": "6472", + "operationType": { + "$id": "6473", + "kind": "string", + "type": { + "$ref": "164" + }, + "value": "Source" + }, + "name": { + "$id": "6474", + "kind": "string", + "type": { + "$ref": "761" + }, + "value": "source1" + }, + "sourceSettings": { + "$id": "6475", + "kind": "model", + "type": { + "$ref": "765" + }, + "value": { + "$id": "6476", + "endpointRef": { + "$id": "6477", + "kind": "string", + "type": { + "$ref": "767" + }, + "value": "aio-builtin-broker-endpoint" + }, + "dataSources": { + "$id": "6478", + "kind": "array", + "type": { + "$ref": "782" + }, + "value": [ + { + "$id": "6479", + "kind": "string", + "type": { + "$ref": "783" + }, + "value": "azure-iot-operations/data/thermostat" + } + ] + } + } + } + } + }, + { + "$id": "6480", + "kind": "model", + "type": { + "$ref": "756" + }, + "value": { + "$id": "6481", + "operationType": { + "$id": "6482", + "kind": "string", + "type": { + "$ref": "164" + }, + "value": "BuiltInTransformation" + }, + "name": { + "$id": "6483", + "kind": "string", + "type": { + "$ref": "761" + }, + "value": "transformation1" + }, + "builtInTransformationSettings": { + "$id": "6484", + "kind": "model", + "type": { + "$ref": "790" + }, + "value": { + "$id": "6485", + "map": { + "$id": "6486", + "kind": "array", + "type": { + "$ref": "846" + }, + "value": [ + { + "$id": "6487", + "kind": "model", + "type": { + "$ref": "847" + }, + "value": { + "$id": "6488", + "inputs": { + "$id": "6489", + "kind": "array", + "type": { + "$ref": "856" + }, + "value": [ + { + "$id": "6490", + "kind": "string", + "type": { + "$ref": "857" + }, + "value": "*" + } + ] + }, + "output": { + "$id": "6491", + "kind": "string", + "type": { + "$ref": "865" + }, + "value": "*" + } + } + }, + { + "$id": "6492", + "kind": "model", + "type": { + "$ref": "847" + }, + "value": { + "$id": "6493", + "inputs": { + "$id": "6494", + "kind": "array", + "type": { + "$ref": "856" + }, + "value": [ + { + "$id": "6495", + "kind": "string", + "type": { + "$ref": "857" + }, + "value": "$context(quality).*" + } + ] + }, + "output": { + "$id": "6496", + "kind": "string", + "type": { + "$ref": "865" + }, + "value": "enriched.*" + } + } + } + ] + }, + "datasets": { + "$id": "6497", + "kind": "array", + "type": { + "$ref": "799" + }, + "value": [ + { + "$id": "6498", + "kind": "model", + "type": { + "$ref": "800" + }, + "value": { + "$id": "6499", + "key": { + "$id": "6500", + "kind": "string", + "type": { + "$ref": "802" + }, + "value": "quality" + }, + "inputs": { + "$id": "6501", + "kind": "array", + "type": { + "$ref": "814" + }, + "value": [ + { + "$id": "6502", + "kind": "string", + "type": { + "$ref": "815" + }, + "value": "$source.country" + }, + { + "$id": "6503", + "kind": "string", + "type": { + "$ref": "815" + }, + "value": "$context.country" + } + ] + }, + "expression": { + "$id": "6504", + "kind": "string", + "type": { + "$ref": "819" + }, + "value": "$1 == $2" + } + } + } + ] + } + } + } + } + }, + { + "$id": "6505", + "kind": "model", + "type": { + "$ref": "756" + }, + "value": { + "$id": "6506", + "operationType": { + "$id": "6507", + "kind": "string", + "type": { + "$ref": "164" + }, + "value": "Destination" + }, + "name": { + "$id": "6508", + "kind": "string", + "type": { + "$ref": "761" + }, + "value": "destination1" + }, + "destinationSettings": { + "$id": "6509", + "kind": "model", + "type": { + "$ref": "873" + }, + "value": { + "$id": "6510", + "endpointRef": { + "$id": "6511", + "kind": "string", + "type": { + "$ref": "875" + }, + "value": "adx-endpoint" + }, + "dataDestination": { + "$id": "6512", + "kind": "string", + "type": { + "$ref": "879" + }, + "value": "mytable" + } + } + } + } + } + ] + } + } + }, + "extendedLocation": { + "$id": "6513", + "kind": "model", + "type": { + "$ref": "669" + }, + "value": { + "$id": "6514", + "name": { + "$id": "6515", + "kind": "string", + "type": { + "$ref": "671" + }, + "value": "qmbrfwcpwwhggszhrdjv" + }, + "type": { + "$id": "6516", + "kind": "string", + "type": { + "$ref": "142" + }, + "value": "CustomLocation" + } + } + } + } + } + } + ], + "responses": [ + { + "$id": "6517", + "response": { + "$ref": "6443" + }, + "statusCode": 200, + "bodyValue": { + "$id": "6518", + "kind": "model", + "type": { + "$ref": "748" + }, + "value": { + "$id": "6519", + "properties": { + "$id": "6520", + "kind": "model", + "type": { + "$ref": "750" + }, + "value": { + "$id": "6521", + "mode": { + "$id": "6522", + "kind": "string", + "type": { + "$ref": "62" + }, + "value": "Enabled" + }, + "operations": { + "$id": "6523", + "kind": "array", + "type": { + "$ref": "755" + }, + "value": [ + { + "$id": "6524", + "kind": "model", + "type": { + "$ref": "756" + }, + "value": { + "$id": "6525", + "operationType": { + "$id": "6526", + "kind": "string", + "type": { + "$ref": "164" + }, + "value": "Source" + }, + "name": { + "$id": "6527", + "kind": "string", + "type": { + "$ref": "761" + }, + "value": "source1" + }, + "sourceSettings": { + "$id": "6528", + "kind": "model", + "type": { + "$ref": "765" + }, + "value": { + "$id": "6529", + "endpointRef": { + "$id": "6530", + "kind": "string", + "type": { + "$ref": "767" + }, + "value": "aio-builtin-broker-endpoint" + }, + "dataSources": { + "$id": "6531", + "kind": "array", + "type": { + "$ref": "782" + }, + "value": [ + { + "$id": "6532", + "kind": "string", + "type": { + "$ref": "783" + }, + "value": "azure-iot-operations/data/thermostat" + } + ] + } + } + } + } + }, + { + "$id": "6533", + "kind": "model", + "type": { + "$ref": "756" + }, + "value": { + "$id": "6534", + "operationType": { + "$id": "6535", + "kind": "string", + "type": { + "$ref": "164" + }, + "value": "BuiltInTransformation" + }, + "name": { + "$id": "6536", + "kind": "string", + "type": { + "$ref": "761" + }, + "value": "transformation1" + }, + "builtInTransformationSettings": { + "$id": "6537", + "kind": "model", + "type": { + "$ref": "790" + }, + "value": { + "$id": "6538", + "map": { + "$id": "6539", + "kind": "array", + "type": { + "$ref": "846" + }, + "value": [ + { + "$id": "6540", + "kind": "model", + "type": { + "$ref": "847" + }, + "value": { + "$id": "6541", + "inputs": { + "$id": "6542", + "kind": "array", + "type": { + "$ref": "856" + }, + "value": [ + { + "$id": "6543", + "kind": "string", + "type": { + "$ref": "857" + }, + "value": "*" + } + ] + }, + "output": { + "$id": "6544", + "kind": "string", + "type": { + "$ref": "865" + }, + "value": "*" + } + } + }, + { + "$id": "6545", + "kind": "model", + "type": { + "$ref": "847" + }, + "value": { + "$id": "6546", + "inputs": { + "$id": "6547", + "kind": "array", + "type": { + "$ref": "856" + }, + "value": [ + { + "$id": "6548", + "kind": "string", + "type": { + "$ref": "857" + }, + "value": "$context(quality).*" + } + ] + }, + "output": { + "$id": "6549", + "kind": "string", + "type": { + "$ref": "865" + }, + "value": "enriched.*" + } + } + } + ] + }, + "datasets": { + "$id": "6550", + "kind": "array", + "type": { + "$ref": "799" + }, + "value": [ + { + "$id": "6551", + "kind": "model", + "type": { + "$ref": "800" + }, + "value": { + "$id": "6552", + "key": { + "$id": "6553", + "kind": "string", + "type": { + "$ref": "802" + }, + "value": "quality" + }, + "inputs": { + "$id": "6554", + "kind": "array", + "type": { + "$ref": "814" + }, + "value": [ + { + "$id": "6555", + "kind": "string", + "type": { + "$ref": "815" + }, + "value": "$source.country" + }, + { + "$id": "6556", + "kind": "string", + "type": { + "$ref": "815" + }, + "value": "$context.country" + } + ] + }, + "expression": { + "$id": "6557", + "kind": "string", + "type": { + "$ref": "819" + }, + "value": "$1 == $2" + } + } + } + ] + } + } + } + } + }, + { + "$id": "6558", + "kind": "model", + "type": { + "$ref": "756" + }, + "value": { + "$id": "6559", + "operationType": { + "$id": "6560", + "kind": "string", + "type": { + "$ref": "164" + }, + "value": "Destination" + }, + "name": { + "$id": "6561", + "kind": "string", + "type": { + "$ref": "761" + }, + "value": "destination1" + }, + "destinationSettings": { + "$id": "6562", + "kind": "model", + "type": { + "$ref": "873" + }, + "value": { + "$id": "6563", + "endpointRef": { + "$id": "6564", + "kind": "string", + "type": { + "$ref": "875" + }, + "value": "adx-endpoint" + }, + "dataDestination": { + "$id": "6565", + "kind": "string", + "type": { + "$ref": "879" + }, + "value": "mytable" + } + } + } + } + } + ] + }, + "provisioningState": { + "$id": "6566", + "kind": "string", + "type": { + "$ref": "126" + }, + "value": "Succeeded" + } + } + }, + "extendedLocation": { + "$id": "6567", + "kind": "model", + "type": { + "$ref": "669" + }, + "value": { + "$id": "6568", + "name": { + "$id": "6569", + "kind": "string", + "type": { + "$ref": "671" + }, + "value": "qmbrfwcpwwhggszhrdjv" + }, + "type": { + "$id": "6570", + "kind": "string", + "type": { + "$ref": "142" + }, + "value": "CustomLocation" + } + } + }, + "id": { + "$id": "6571", + "kind": "string", + "type": { + "$ref": "330" + }, + "value": "/subscriptions/0000000-0000-0000-0000-000000000000/resourceGroups/resourceGroup123/providers/Microsoft.IoTOperations/instances/resource-name123/dataflowProfiles/resource-name123/dataflows/resource-name123" + }, + "name": { + "$id": "6572", + "kind": "string", + "type": { + "$ref": "335" + }, + "value": "jxhcpwgfkxqasbexkookvxk" + }, + "type": { + "$id": "6573", + "kind": "string", + "type": { + "$ref": "339" + }, + "value": "zkuozvgjseokfchkscoswthzjdry" + }, + "systemData": { + "$id": "6574", + "kind": "model", + "type": { + "$ref": "344" + }, + "value": { + "$id": "6575", + "createdBy": { + "$id": "6576", + "kind": "string", + "type": { + "$ref": "346" + }, + "value": "ssvaslsmudloholronopqyxjcu" + }, + "createdByType": { + "$id": "6577", + "kind": "string", + "type": { + "$ref": "146" + }, + "value": "User" + }, + "createdAt": { + "$id": "6578", + "kind": "string", + "type": { + "$ref": "353" + }, + "value": "2024-08-09T18:13:29.389Z" + }, + "lastModifiedBy": { + "$id": "6579", + "kind": "string", + "type": { + "$ref": "358" + }, + "value": "gnicpuszwd" + }, + "lastModifiedByType": { + "$id": "6580", + "kind": "string", + "type": { + "$ref": "146" + }, + "value": "User" + }, + "lastModifiedAt": { + "$id": "6581", + "kind": "string", + "type": { + "$ref": "365" + }, + "value": "2024-08-09T18:13:29.389Z" + } + } + } + } + } + }, + { + "$id": "6582", + "response": { + "$ref": "6444" + }, + "statusCode": 201, + "bodyValue": { + "$id": "6583", + "kind": "model", + "type": { + "$ref": "748" + }, + "value": { + "$id": "6584", + "properties": { + "$id": "6585", + "kind": "model", + "type": { + "$ref": "750" + }, + "value": { + "$id": "6586", + "mode": { + "$id": "6587", + "kind": "string", + "type": { + "$ref": "62" + }, + "value": "Enabled" + }, + "operations": { + "$id": "6588", + "kind": "array", + "type": { + "$ref": "755" + }, + "value": [ + { + "$id": "6589", + "kind": "model", + "type": { + "$ref": "756" + }, + "value": { + "$id": "6590", + "operationType": { + "$id": "6591", + "kind": "string", + "type": { + "$ref": "164" + }, + "value": "Source" + }, + "name": { + "$id": "6592", + "kind": "string", + "type": { + "$ref": "761" + }, + "value": "source1" + }, + "sourceSettings": { + "$id": "6593", + "kind": "model", + "type": { + "$ref": "765" + }, + "value": { + "$id": "6594", + "endpointRef": { + "$id": "6595", + "kind": "string", + "type": { + "$ref": "767" + }, + "value": "aio-builtin-broker-endpoint" + }, + "dataSources": { + "$id": "6596", + "kind": "array", + "type": { + "$ref": "782" + }, + "value": [ + { + "$id": "6597", + "kind": "string", + "type": { + "$ref": "783" + }, + "value": "azure-iot-operations/data/thermostat" + } + ] + } + } + } + } + }, + { + "$id": "6598", + "kind": "model", + "type": { + "$ref": "756" + }, + "value": { + "$id": "6599", + "operationType": { + "$id": "6600", + "kind": "string", + "type": { + "$ref": "164" + }, + "value": "BuiltInTransformation" + }, + "name": { + "$id": "6601", + "kind": "string", + "type": { + "$ref": "761" + }, + "value": "transformation1" + }, + "builtInTransformationSettings": { + "$id": "6602", + "kind": "model", + "type": { + "$ref": "790" + }, + "value": { + "$id": "6603", + "map": { + "$id": "6604", + "kind": "array", + "type": { + "$ref": "846" + }, + "value": [ + { + "$id": "6605", + "kind": "model", + "type": { + "$ref": "847" + }, + "value": { + "$id": "6606", + "inputs": { + "$id": "6607", + "kind": "array", + "type": { + "$ref": "856" + }, + "value": [ + { + "$id": "6608", + "kind": "string", + "type": { + "$ref": "857" + }, + "value": "*" + } + ] + }, + "output": { + "$id": "6609", + "kind": "string", + "type": { + "$ref": "865" + }, + "value": "*" + } + } + }, + { + "$id": "6610", + "kind": "model", + "type": { + "$ref": "847" + }, + "value": { + "$id": "6611", + "inputs": { + "$id": "6612", + "kind": "array", + "type": { + "$ref": "856" + }, + "value": [ + { + "$id": "6613", + "kind": "string", + "type": { + "$ref": "857" + }, + "value": "$context(quality).*" + } + ] + }, + "output": { + "$id": "6614", + "kind": "string", + "type": { + "$ref": "865" + }, + "value": "enriched.*" + } + } + } + ] + }, + "datasets": { + "$id": "6615", + "kind": "array", + "type": { + "$ref": "799" + }, + "value": [ + { + "$id": "6616", + "kind": "model", + "type": { + "$ref": "800" + }, + "value": { + "$id": "6617", + "key": { + "$id": "6618", + "kind": "string", + "type": { + "$ref": "802" + }, + "value": "quality" + }, + "inputs": { + "$id": "6619", + "kind": "array", + "type": { + "$ref": "814" + }, + "value": [ + { + "$id": "6620", + "kind": "string", + "type": { + "$ref": "815" + }, + "value": "$source.country" + }, + { + "$id": "6621", + "kind": "string", + "type": { + "$ref": "815" + }, + "value": "$context.country" + } + ] + }, + "expression": { + "$id": "6622", + "kind": "string", + "type": { + "$ref": "819" + }, + "value": "$1 == $2" + } + } + } + ] + } + } + } + } + }, + { + "$id": "6623", + "kind": "model", + "type": { + "$ref": "756" + }, + "value": { + "$id": "6624", + "operationType": { + "$id": "6625", + "kind": "string", + "type": { + "$ref": "164" + }, + "value": "Destination" + }, + "name": { + "$id": "6626", + "kind": "string", + "type": { + "$ref": "761" + }, + "value": "destination1" + }, + "destinationSettings": { + "$id": "6627", + "kind": "model", + "type": { + "$ref": "873" + }, + "value": { + "$id": "6628", + "endpointRef": { + "$id": "6629", + "kind": "string", + "type": { + "$ref": "875" + }, + "value": "adx-endpoint" + }, + "dataDestination": { + "$id": "6630", + "kind": "string", + "type": { + "$ref": "879" + }, + "value": "mytable" + } + } + } + } + } + ] + }, + "provisioningState": { + "$id": "6631", + "kind": "string", + "type": { + "$ref": "126" + }, + "value": "Succeeded" + } + } + }, + "extendedLocation": { + "$id": "6632", + "kind": "model", + "type": { + "$ref": "669" + }, + "value": { + "$id": "6633", + "name": { + "$id": "6634", + "kind": "string", + "type": { + "$ref": "671" + }, + "value": "qmbrfwcpwwhggszhrdjv" + }, + "type": { + "$id": "6635", + "kind": "string", + "type": { + "$ref": "142" + }, + "value": "CustomLocation" + } + } + }, + "id": { + "$id": "6636", + "kind": "string", + "type": { + "$ref": "330" + }, + "value": "/subscriptions/0000000-0000-0000-0000-000000000000/resourceGroups/resourceGroup123/providers/Microsoft.IoTOperations/instances/resource-name123/dataflowProfiles/resource-name123/dataflows/resource-name123" + }, + "name": { + "$id": "6637", + "kind": "string", + "type": { + "$ref": "335" + }, + "value": "jxhcpwgfkxqasbexkookvxk" + }, + "type": { + "$id": "6638", + "kind": "string", + "type": { + "$ref": "339" + }, + "value": "zkuozvgjseokfchkscoswthzjdry" + }, + "systemData": { + "$id": "6639", + "kind": "model", + "type": { + "$ref": "344" + }, + "value": { + "$id": "6640", + "createdBy": { + "$id": "6641", + "kind": "string", + "type": { + "$ref": "346" + }, + "value": "ssvaslsmudloholronopqyxjcu" + }, + "createdByType": { + "$id": "6642", + "kind": "string", + "type": { + "$ref": "146" + }, + "value": "User" + }, + "createdAt": { + "$id": "6643", + "kind": "string", + "type": { + "$ref": "353" + }, + "value": "2024-08-09T18:13:29.389Z" + }, + "lastModifiedBy": { + "$id": "6644", + "kind": "string", + "type": { + "$ref": "358" + }, + "value": "gnicpuszwd" + }, + "lastModifiedByType": { + "$id": "6645", + "kind": "string", + "type": { + "$ref": "146" + }, + "value": "User" + }, + "lastModifiedAt": { + "$id": "6646", + "kind": "string", + "type": { + "$ref": "365" + }, + "value": "2024-08-09T18:13:29.389Z" + } + } + } + } + } + } + ] + }, + { + "$id": "6647", + "kind": "http", + "name": "Dataflow_CreateOrUpdate_ComplexEventHub", + "description": "Dataflow_CreateOrUpdate_ComplexEventHub", + "filePath": "2024-11-01/Dataflow_CreateOrUpdate_ComplexEventHub.json", + "parameters": [ + { + "$id": "6648", + "parameter": { + "$ref": "6421" + }, + "value": { + "$id": "6649", + "kind": "string", + "type": { + "$ref": "6422" + }, + "value": "2024-11-01" + } + }, + { + "$id": "6650", + "parameter": { + "$ref": "6425" + }, + "value": { + "$id": "6651", + "kind": "string", + "type": { + "$ref": "6426" + }, + "value": "F8C729F9-DF9C-4743-848F-96EE433D8E53" + } + }, + { + "$id": "6652", + "parameter": { + "$ref": "6428" + }, + "value": { + "$id": "6653", + "kind": "string", + "type": { + "$ref": "6429" + }, + "value": "rgiotoperations" + } + }, + { + "$id": "6654", + "parameter": { + "$ref": "6430" + }, + "value": { + "$id": "6655", + "kind": "string", + "type": { + "$ref": "6431" + }, + "value": "resource-name123" + } + }, + { + "$id": "6656", + "parameter": { + "$ref": "6432" + }, + "value": { + "$id": "6657", + "kind": "string", + "type": { + "$ref": "6433" + }, + "value": "resource-name123" + } + }, + { + "$id": "6658", + "parameter": { + "$ref": "6434" + }, + "value": { + "$id": "6659", + "kind": "string", + "type": { + "$ref": "6435" + }, + "value": "aio-to-event-hub-transformed" + } + }, + { + "$id": "6660", + "parameter": { + "$ref": "6442" + }, + "value": { + "$id": "6661", + "kind": "model", + "type": { + "$ref": "748" + }, + "value": { + "$id": "6662", + "properties": { + "$id": "6663", + "kind": "model", + "type": { + "$ref": "750" + }, + "value": { + "$id": "6664", + "mode": { + "$id": "6665", + "kind": "string", + "type": { + "$ref": "62" + }, + "value": "Enabled" + }, + "operations": { + "$id": "6666", + "kind": "array", + "type": { + "$ref": "755" + }, + "value": [ + { + "$id": "6667", + "kind": "model", + "type": { + "$ref": "756" + }, + "value": { + "$id": "6668", + "operationType": { + "$id": "6669", + "kind": "string", + "type": { + "$ref": "164" + }, + "value": "Source" + }, + "name": { + "$id": "6670", + "kind": "string", + "type": { + "$ref": "761" + }, + "value": "source1" + }, + "sourceSettings": { + "$id": "6671", + "kind": "model", + "type": { + "$ref": "765" + }, + "value": { + "$id": "6672", + "endpointRef": { + "$id": "6673", + "kind": "string", + "type": { + "$ref": "767" + }, + "value": "aio-builtin-broker-endpoint" + }, + "dataSources": { + "$id": "6674", + "kind": "array", + "type": { + "$ref": "782" + }, + "value": [ + { + "$id": "6675", + "kind": "string", + "type": { + "$ref": "783" + }, + "value": "azure-iot-operations/data/thermostat" + } + ] + } + } + } + } + }, + { + "$id": "6676", + "kind": "model", + "type": { + "$ref": "756" + }, + "value": { + "$id": "6677", + "operationType": { + "$id": "6678", + "kind": "string", + "type": { + "$ref": "164" + }, + "value": "BuiltInTransformation" + }, + "builtInTransformationSettings": { + "$id": "6679", + "kind": "model", + "type": { + "$ref": "790" + }, + "value": { + "$id": "6680", + "filter": { + "$id": "6681", + "kind": "array", + "type": { + "$ref": "825" + }, + "value": [ + { + "$id": "6682", + "kind": "model", + "type": { + "$ref": "826" + }, + "value": { + "$id": "6683", + "inputs": { + "$id": "6684", + "kind": "array", + "type": { + "$ref": "835" + }, + "value": [ + { + "$id": "6685", + "kind": "string", + "type": { + "$ref": "836" + }, + "value": "temperature.Value" + }, + { + "$id": "6686", + "kind": "string", + "type": { + "$ref": "836" + }, + "value": "\"Tag 10\".Value" + } + ] + }, + "expression": { + "$id": "6687", + "kind": "string", + "type": { + "$ref": "840" + }, + "value": "$1 > 9000 && $2 >= 8000" + } + } + } + ] + }, + "map": { + "$id": "6688", + "kind": "array", + "type": { + "$ref": "846" + }, + "value": [ + { + "$id": "6689", + "kind": "model", + "type": { + "$ref": "847" + }, + "value": { + "$id": "6690", + "inputs": { + "$id": "6691", + "kind": "array", + "type": { + "$ref": "856" + }, + "value": [ + { + "$id": "6692", + "kind": "string", + "type": { + "$ref": "857" + }, + "value": "*" + } + ] + }, + "output": { + "$id": "6693", + "kind": "string", + "type": { + "$ref": "865" + }, + "value": "*" + } + } + }, + { + "$id": "6694", + "kind": "model", + "type": { + "$ref": "847" + }, + "value": { + "$id": "6695", + "inputs": { + "$id": "6696", + "kind": "array", + "type": { + "$ref": "856" + }, + "value": [ + { + "$id": "6697", + "kind": "string", + "type": { + "$ref": "857" + }, + "value": "temperature.Value" + }, + { + "$id": "6698", + "kind": "string", + "type": { + "$ref": "857" + }, + "value": "\"Tag 10\".Value" + } + ] + }, + "expression": { + "$id": "6699", + "kind": "string", + "type": { + "$ref": "861" + }, + "value": "($1+$2)/2" + }, + "output": { + "$id": "6700", + "kind": "string", + "type": { + "$ref": "865" + }, + "value": "AvgTemp.Value" + } + } + }, + { + "$id": "6701", + "kind": "model", + "type": { + "$ref": "847" + }, + "value": { + "$id": "6702", + "inputs": { + "$id": "6703", + "kind": "array", + "type": { + "$ref": "856" + }, + "value": [] + }, + "expression": { + "$id": "6704", + "kind": "string", + "type": { + "$ref": "861" + }, + "value": "true" + }, + "output": { + "$id": "6705", + "kind": "string", + "type": { + "$ref": "865" + }, + "value": "dataflow-processed" + } + } + }, + { + "$id": "6706", + "kind": "model", + "type": { + "$ref": "847" + }, + "value": { + "$id": "6707", + "inputs": { + "$id": "6708", + "kind": "array", + "type": { + "$ref": "856" + }, + "value": [ + { + "$id": "6709", + "kind": "string", + "type": { + "$ref": "857" + }, + "value": "temperature.SourceTimestamp" + } + ] + }, + "expression": { + "$id": "6710", + "kind": "string", + "type": { + "$ref": "861" + }, + "value": "" + }, + "output": { + "$id": "6711", + "kind": "string", + "type": { + "$ref": "865" + }, + "value": "" + } + } + }, + { + "$id": "6712", + "kind": "model", + "type": { + "$ref": "847" + }, + "value": { + "$id": "6713", + "inputs": { + "$id": "6714", + "kind": "array", + "type": { + "$ref": "856" + }, + "value": [ + { + "$id": "6715", + "kind": "string", + "type": { + "$ref": "857" + }, + "value": "\"Tag 10\"" + } + ] + }, + "expression": { + "$id": "6716", + "kind": "string", + "type": { + "$ref": "861" + }, + "value": "" + }, + "output": { + "$id": "6717", + "kind": "string", + "type": { + "$ref": "865" + }, + "value": "pressure" + } + } + }, + { + "$id": "6718", + "kind": "model", + "type": { + "$ref": "847" + }, + "value": { + "$id": "6719", + "inputs": { + "$id": "6720", + "kind": "array", + "type": { + "$ref": "856" + }, + "value": [ + { + "$id": "6721", + "kind": "string", + "type": { + "$ref": "857" + }, + "value": "temperature.Value" + } + ] + }, + "expression": { + "$id": "6722", + "kind": "string", + "type": { + "$ref": "861" + }, + "value": "cToF($1)" + }, + "output": { + "$id": "6723", + "kind": "string", + "type": { + "$ref": "865" + }, + "value": "temperatureF.Value" + } + } + }, + { + "$id": "6724", + "kind": "model", + "type": { + "$ref": "847" + }, + "value": { + "$id": "6725", + "inputs": { + "$id": "6726", + "kind": "array", + "type": { + "$ref": "856" + }, + "value": [ + { + "$id": "6727", + "kind": "string", + "type": { + "$ref": "857" + }, + "value": "\"Tag 10\".Value" + } + ] + }, + "expression": { + "$id": "6728", + "kind": "string", + "type": { + "$ref": "861" + }, + "value": "scale ($1,0,10,0,100)" + }, + "output": { + "$id": "6729", + "kind": "string", + "type": { + "$ref": "865" + }, + "value": "\"Scale Tag 10\".Value" + } + } + } + ] + } + } + } + } + }, + { + "$id": "6730", + "kind": "model", + "type": { + "$ref": "756" + }, + "value": { + "$id": "6731", + "operationType": { + "$id": "6732", + "kind": "string", + "type": { + "$ref": "164" + }, + "value": "Destination" + }, + "name": { + "$id": "6733", + "kind": "string", + "type": { + "$ref": "761" + }, + "value": "destination1" + }, + "destinationSettings": { + "$id": "6734", + "kind": "model", + "type": { + "$ref": "873" + }, + "value": { + "$id": "6735", + "endpointRef": { + "$id": "6736", + "kind": "string", + "type": { + "$ref": "875" + }, + "value": "event-hub-endpoint" + }, + "dataDestination": { + "$id": "6737", + "kind": "string", + "type": { + "$ref": "879" + }, + "value": "myuniqueeventhub" + } + } + } + } + } + ] + } + } + }, + "extendedLocation": { + "$id": "6738", + "kind": "model", + "type": { + "$ref": "669" + }, + "value": { + "$id": "6739", + "name": { + "$id": "6740", + "kind": "string", + "type": { + "$ref": "671" + }, + "value": "qmbrfwcpwwhggszhrdjv" + }, + "type": { + "$id": "6741", + "kind": "string", + "type": { + "$ref": "142" + }, + "value": "CustomLocation" + } + } + } + } + } + } + ], + "responses": [ + { + "$id": "6742", + "response": { + "$ref": "6443" + }, + "statusCode": 200, + "bodyValue": { + "$id": "6743", + "kind": "model", + "type": { + "$ref": "748" + }, + "value": { + "$id": "6744", + "properties": { + "$id": "6745", + "kind": "model", + "type": { + "$ref": "750" + }, + "value": { + "$id": "6746", + "mode": { + "$id": "6747", + "kind": "string", + "type": { + "$ref": "62" + }, + "value": "Enabled" + }, + "operations": { + "$id": "6748", + "kind": "array", + "type": { + "$ref": "755" + }, + "value": [ + { + "$id": "6749", + "kind": "model", + "type": { + "$ref": "756" + }, + "value": { + "$id": "6750", + "operationType": { + "$id": "6751", + "kind": "string", + "type": { + "$ref": "164" + }, + "value": "Source" + }, + "name": { + "$id": "6752", + "kind": "string", + "type": { + "$ref": "761" + }, + "value": "source1" + }, + "sourceSettings": { + "$id": "6753", + "kind": "model", + "type": { + "$ref": "765" + }, + "value": { + "$id": "6754", + "endpointRef": { + "$id": "6755", + "kind": "string", + "type": { + "$ref": "767" + }, + "value": "aio-builtin-broker-endpoint" + }, + "dataSources": { + "$id": "6756", + "kind": "array", + "type": { + "$ref": "782" + }, + "value": [ + { + "$id": "6757", + "kind": "string", + "type": { + "$ref": "783" + }, + "value": "azure-iot-operations/data/thermostat" + } + ] + } + } + } + } + }, + { + "$id": "6758", + "kind": "model", + "type": { + "$ref": "756" + }, + "value": { + "$id": "6759", + "operationType": { + "$id": "6760", + "kind": "string", + "type": { + "$ref": "164" + }, + "value": "BuiltInTransformation" + }, + "name": { + "$id": "6761", + "kind": "string", + "type": { + "$ref": "761" + }, + "value": "transformation1" + }, + "builtInTransformationSettings": { + "$id": "6762", + "kind": "model", + "type": { + "$ref": "790" + }, + "value": { + "$id": "6763", + "map": { + "$id": "6764", + "kind": "array", + "type": { + "$ref": "846" + }, + "value": [ + { + "$id": "6765", + "kind": "model", + "type": { + "$ref": "847" + }, + "value": { + "$id": "6766", + "inputs": { + "$id": "6767", + "kind": "array", + "type": { + "$ref": "856" + }, + "value": [ + { + "$id": "6768", + "kind": "string", + "type": { + "$ref": "857" + }, + "value": "*" + } + ] + }, + "output": { + "$id": "6769", + "kind": "string", + "type": { + "$ref": "865" + }, + "value": "*" + } + } + }, + { + "$id": "6770", + "kind": "model", + "type": { + "$ref": "847" + }, + "value": { + "$id": "6771", + "inputs": { + "$id": "6772", + "kind": "array", + "type": { + "$ref": "856" + }, + "value": [ + { + "$id": "6773", + "kind": "string", + "type": { + "$ref": "857" + }, + "value": "$context(quality).*" + } + ] + }, + "output": { + "$id": "6774", + "kind": "string", + "type": { + "$ref": "865" + }, + "value": "enriched.*" + } + } + } + ] + }, + "datasets": { + "$id": "6775", + "kind": "array", + "type": { + "$ref": "799" + }, + "value": [ + { + "$id": "6776", + "kind": "model", + "type": { + "$ref": "800" + }, + "value": { + "$id": "6777", + "key": { + "$id": "6778", + "kind": "string", + "type": { + "$ref": "802" + }, + "value": "quality" + }, + "inputs": { + "$id": "6779", + "kind": "array", + "type": { + "$ref": "814" + }, + "value": [ + { + "$id": "6780", + "kind": "string", + "type": { + "$ref": "815" + }, + "value": "$source.country" + }, + { + "$id": "6781", + "kind": "string", + "type": { + "$ref": "815" + }, + "value": "$context.country" + } + ] + }, + "expression": { + "$id": "6782", + "kind": "string", + "type": { + "$ref": "819" + }, + "value": "$1 == $2" + } + } + } + ] + } + } + } + } + }, + { + "$id": "6783", + "kind": "model", + "type": { + "$ref": "756" + }, + "value": { + "$id": "6784", + "operationType": { + "$id": "6785", + "kind": "string", + "type": { + "$ref": "164" + }, + "value": "Destination" + }, + "name": { + "$id": "6786", + "kind": "string", + "type": { + "$ref": "761" + }, + "value": "destination1" + }, + "destinationSettings": { + "$id": "6787", + "kind": "model", + "type": { + "$ref": "873" + }, + "value": { + "$id": "6788", + "endpointRef": { + "$id": "6789", + "kind": "string", + "type": { + "$ref": "875" + }, + "value": "adx-endpoint" + }, + "dataDestination": { + "$id": "6790", + "kind": "string", + "type": { + "$ref": "879" + }, + "value": "mytable" + } + } + } + } + } + ] + }, + "provisioningState": { + "$id": "6791", + "kind": "string", + "type": { + "$ref": "126" + }, + "value": "Succeeded" + } + } + }, + "extendedLocation": { + "$id": "6792", + "kind": "model", + "type": { + "$ref": "669" + }, + "value": { + "$id": "6793", + "name": { + "$id": "6794", + "kind": "string", + "type": { + "$ref": "671" + }, + "value": "qmbrfwcpwwhggszhrdjv" + }, + "type": { + "$id": "6795", + "kind": "string", + "type": { + "$ref": "142" + }, + "value": "CustomLocation" + } + } + }, + "id": { + "$id": "6796", + "kind": "string", + "type": { + "$ref": "330" + }, + "value": "/subscriptions/0000000-0000-0000-0000-000000000000/resourceGroups/resourceGroup123/providers/Microsoft.IoTOperations/instances/resource-name123/dataflowProfiles/resource-name123/dataflows/resource-name123" + }, + "name": { + "$id": "6797", + "kind": "string", + "type": { + "$ref": "335" + }, + "value": "jxhcpwgfkxqasbexkookvxk" + }, + "type": { + "$id": "6798", + "kind": "string", + "type": { + "$ref": "339" + }, + "value": "zkuozvgjseokfchkscoswthzjdry" + }, + "systemData": { + "$id": "6799", + "kind": "model", + "type": { + "$ref": "344" + }, + "value": { + "$id": "6800", + "createdBy": { + "$id": "6801", + "kind": "string", + "type": { + "$ref": "346" + }, + "value": "ssvaslsmudloholronopqyxjcu" + }, + "createdByType": { + "$id": "6802", + "kind": "string", + "type": { + "$ref": "146" + }, + "value": "User" + }, + "createdAt": { + "$id": "6803", + "kind": "string", + "type": { + "$ref": "353" + }, + "value": "2024-08-09T18:13:29.389Z" + }, + "lastModifiedBy": { + "$id": "6804", + "kind": "string", + "type": { + "$ref": "358" + }, + "value": "gnicpuszwd" + }, + "lastModifiedByType": { + "$id": "6805", + "kind": "string", + "type": { + "$ref": "146" + }, + "value": "User" + }, + "lastModifiedAt": { + "$id": "6806", + "kind": "string", + "type": { + "$ref": "365" + }, + "value": "2024-08-09T18:13:29.389Z" + } + } + } + } + } + }, + { + "$id": "6807", + "response": { + "$ref": "6444" + }, + "statusCode": 201, + "bodyValue": { + "$id": "6808", + "kind": "model", + "type": { + "$ref": "748" + }, + "value": { + "$id": "6809", + "properties": { + "$id": "6810", + "kind": "model", + "type": { + "$ref": "750" + }, + "value": { + "$id": "6811", + "mode": { + "$id": "6812", + "kind": "string", + "type": { + "$ref": "62" + }, + "value": "Enabled" + }, + "operations": { + "$id": "6813", + "kind": "array", + "type": { + "$ref": "755" + }, + "value": [ + { + "$id": "6814", + "kind": "model", + "type": { + "$ref": "756" + }, + "value": { + "$id": "6815", + "operationType": { + "$id": "6816", + "kind": "string", + "type": { + "$ref": "164" + }, + "value": "Source" + }, + "name": { + "$id": "6817", + "kind": "string", + "type": { + "$ref": "761" + }, + "value": "source1" + }, + "sourceSettings": { + "$id": "6818", + "kind": "model", + "type": { + "$ref": "765" + }, + "value": { + "$id": "6819", + "endpointRef": { + "$id": "6820", + "kind": "string", + "type": { + "$ref": "767" + }, + "value": "aio-builtin-broker-endpoint" + }, + "dataSources": { + "$id": "6821", + "kind": "array", + "type": { + "$ref": "782" + }, + "value": [ + { + "$id": "6822", + "kind": "string", + "type": { + "$ref": "783" + }, + "value": "azure-iot-operations/data/thermostat" + } + ] + } + } + } + } + }, + { + "$id": "6823", + "kind": "model", + "type": { + "$ref": "756" + }, + "value": { + "$id": "6824", + "operationType": { + "$id": "6825", + "kind": "string", + "type": { + "$ref": "164" + }, + "value": "BuiltInTransformation" + }, + "name": { + "$id": "6826", + "kind": "string", + "type": { + "$ref": "761" + }, + "value": "transformation1" + }, + "builtInTransformationSettings": { + "$id": "6827", + "kind": "model", + "type": { + "$ref": "790" + }, + "value": { + "$id": "6828", + "map": { + "$id": "6829", + "kind": "array", + "type": { + "$ref": "846" + }, + "value": [ + { + "$id": "6830", + "kind": "model", + "type": { + "$ref": "847" + }, + "value": { + "$id": "6831", + "inputs": { + "$id": "6832", + "kind": "array", + "type": { + "$ref": "856" + }, + "value": [ + { + "$id": "6833", + "kind": "string", + "type": { + "$ref": "857" + }, + "value": "*" + } + ] + }, + "output": { + "$id": "6834", + "kind": "string", + "type": { + "$ref": "865" + }, + "value": "*" + } + } + }, + { + "$id": "6835", + "kind": "model", + "type": { + "$ref": "847" + }, + "value": { + "$id": "6836", + "inputs": { + "$id": "6837", + "kind": "array", + "type": { + "$ref": "856" + }, + "value": [ + { + "$id": "6838", + "kind": "string", + "type": { + "$ref": "857" + }, + "value": "$context(quality).*" + } + ] + }, + "output": { + "$id": "6839", + "kind": "string", + "type": { + "$ref": "865" + }, + "value": "enriched.*" + } + } + } + ] + }, + "datasets": { + "$id": "6840", + "kind": "array", + "type": { + "$ref": "799" + }, + "value": [ + { + "$id": "6841", + "kind": "model", + "type": { + "$ref": "800" + }, + "value": { + "$id": "6842", + "key": { + "$id": "6843", + "kind": "string", + "type": { + "$ref": "802" + }, + "value": "quality" + }, + "inputs": { + "$id": "6844", + "kind": "array", + "type": { + "$ref": "814" + }, + "value": [ + { + "$id": "6845", + "kind": "string", + "type": { + "$ref": "815" + }, + "value": "$source.country" + }, + { + "$id": "6846", + "kind": "string", + "type": { + "$ref": "815" + }, + "value": "$context.country" + } + ] + }, + "expression": { + "$id": "6847", + "kind": "string", + "type": { + "$ref": "819" + }, + "value": "$1 == $2" + } + } + } + ] + } + } + } + } + }, + { + "$id": "6848", + "kind": "model", + "type": { + "$ref": "756" + }, + "value": { + "$id": "6849", + "operationType": { + "$id": "6850", + "kind": "string", + "type": { + "$ref": "164" + }, + "value": "Destination" + }, + "name": { + "$id": "6851", + "kind": "string", + "type": { + "$ref": "761" + }, + "value": "destination1" + }, + "destinationSettings": { + "$id": "6852", + "kind": "model", + "type": { + "$ref": "873" + }, + "value": { + "$id": "6853", + "endpointRef": { + "$id": "6854", + "kind": "string", + "type": { + "$ref": "875" + }, + "value": "adx-endpoint" + }, + "dataDestination": { + "$id": "6855", + "kind": "string", + "type": { + "$ref": "879" + }, + "value": "mytable" + } + } + } + } + } + ] + }, + "provisioningState": { + "$id": "6856", + "kind": "string", + "type": { + "$ref": "126" + }, + "value": "Succeeded" + } + } + }, + "extendedLocation": { + "$id": "6857", + "kind": "model", + "type": { + "$ref": "669" + }, + "value": { + "$id": "6858", + "name": { + "$id": "6859", + "kind": "string", + "type": { + "$ref": "671" + }, + "value": "qmbrfwcpwwhggszhrdjv" + }, + "type": { + "$id": "6860", + "kind": "string", + "type": { + "$ref": "142" + }, + "value": "CustomLocation" + } + } + }, + "id": { + "$id": "6861", + "kind": "string", + "type": { + "$ref": "330" + }, + "value": "/subscriptions/0000000-0000-0000-0000-000000000000/resourceGroups/resourceGroup123/providers/Microsoft.IoTOperations/instances/resource-name123/dataflowProfiles/resource-name123/dataflows/resource-name123" + }, + "name": { + "$id": "6862", + "kind": "string", + "type": { + "$ref": "335" + }, + "value": "jxhcpwgfkxqasbexkookvxk" + }, + "type": { + "$id": "6863", + "kind": "string", + "type": { + "$ref": "339" + }, + "value": "zkuozvgjseokfchkscoswthzjdry" + }, + "systemData": { + "$id": "6864", + "kind": "model", + "type": { + "$ref": "344" + }, + "value": { + "$id": "6865", + "createdBy": { + "$id": "6866", + "kind": "string", + "type": { + "$ref": "346" + }, + "value": "ssvaslsmudloholronopqyxjcu" + }, + "createdByType": { + "$id": "6867", + "kind": "string", + "type": { + "$ref": "146" + }, + "value": "User" + }, + "createdAt": { + "$id": "6868", + "kind": "string", + "type": { + "$ref": "353" + }, + "value": "2024-08-09T18:13:29.389Z" + }, + "lastModifiedBy": { + "$id": "6869", + "kind": "string", + "type": { + "$ref": "358" + }, + "value": "gnicpuszwd" + }, + "lastModifiedByType": { + "$id": "6870", + "kind": "string", + "type": { + "$ref": "146" + }, + "value": "User" + }, + "lastModifiedAt": { + "$id": "6871", + "kind": "string", + "type": { + "$ref": "365" + }, + "value": "2024-08-09T18:13:29.389Z" + } + } + } + } + } + } + ] + }, + { + "$id": "6872", + "kind": "http", + "name": "Dataflow_CreateOrUpdate_FilterToTopic", + "description": "Dataflow_CreateOrUpdate_FilterToTopic", + "filePath": "2024-11-01/Dataflow_CreateOrUpdate_FilterToTopic.json", + "parameters": [ + { + "$id": "6873", + "parameter": { + "$ref": "6421" + }, + "value": { + "$id": "6874", + "kind": "string", + "type": { + "$ref": "6422" + }, + "value": "2024-11-01" + } + }, + { + "$id": "6875", + "parameter": { + "$ref": "6425" + }, + "value": { + "$id": "6876", + "kind": "string", + "type": { + "$ref": "6426" + }, + "value": "F8C729F9-DF9C-4743-848F-96EE433D8E53" + } + }, + { + "$id": "6877", + "parameter": { + "$ref": "6428" + }, + "value": { + "$id": "6878", + "kind": "string", + "type": { + "$ref": "6429" + }, + "value": "rgiotoperations" + } + }, + { + "$id": "6879", + "parameter": { + "$ref": "6430" + }, + "value": { + "$id": "6880", + "kind": "string", + "type": { + "$ref": "6431" + }, + "value": "resource-name123" + } + }, + { + "$id": "6881", + "parameter": { + "$ref": "6432" + }, + "value": { + "$id": "6882", + "kind": "string", + "type": { + "$ref": "6433" + }, + "value": "resource-name123" + } + }, + { + "$id": "6883", + "parameter": { + "$ref": "6434" + }, + "value": { + "$id": "6884", + "kind": "string", + "type": { + "$ref": "6435" + }, + "value": "mqtt-filter-to-topic" + } + }, + { + "$id": "6885", + "parameter": { + "$ref": "6442" + }, + "value": { + "$id": "6886", + "kind": "model", + "type": { + "$ref": "748" + }, + "value": { + "$id": "6887", + "properties": { + "$id": "6888", + "kind": "model", + "type": { + "$ref": "750" + }, + "value": { + "$id": "6889", + "mode": { + "$id": "6890", + "kind": "string", + "type": { + "$ref": "62" + }, + "value": "Enabled" + }, + "operations": { + "$id": "6891", + "kind": "array", + "type": { + "$ref": "755" + }, + "value": [ + { + "$id": "6892", + "kind": "model", + "type": { + "$ref": "756" + }, + "value": { + "$id": "6893", + "operationType": { + "$id": "6894", + "kind": "string", + "type": { + "$ref": "164" + }, + "value": "Source" + }, + "name": { + "$id": "6895", + "kind": "string", + "type": { + "$ref": "761" + }, + "value": "source1" + }, + "sourceSettings": { + "$id": "6896", + "kind": "model", + "type": { + "$ref": "765" + }, + "value": { + "$id": "6897", + "endpointRef": { + "$id": "6898", + "kind": "string", + "type": { + "$ref": "767" + }, + "value": "aio-builtin-broker-endpoint" + }, + "dataSources": { + "$id": "6899", + "kind": "array", + "type": { + "$ref": "782" + }, + "value": [ + { + "$id": "6900", + "kind": "string", + "type": { + "$ref": "783" + }, + "value": "azure-iot-operations/data/thermostat" + } + ] + } + } + } + } + }, + { + "$id": "6901", + "kind": "model", + "type": { + "$ref": "756" + }, + "value": { + "$id": "6902", + "operationType": { + "$id": "6903", + "kind": "string", + "type": { + "$ref": "164" + }, + "value": "BuiltInTransformation" + }, + "name": { + "$id": "6904", + "kind": "string", + "type": { + "$ref": "761" + }, + "value": "transformation1" + }, + "builtInTransformationSettings": { + "$id": "6905", + "kind": "model", + "type": { + "$ref": "790" + }, + "value": { + "$id": "6906", + "filter": { + "$id": "6907", + "kind": "array", + "type": { + "$ref": "825" + }, + "value": [ + { + "$id": "6908", + "kind": "model", + "type": { + "$ref": "826" + }, + "value": { + "$id": "6909", + "type": { + "$id": "6910", + "kind": "string", + "type": { + "$ref": "184" + }, + "value": "Filter" + }, + "description": { + "$id": "6911", + "kind": "string", + "type": { + "$ref": "831" + }, + "value": "filter-datapoint" + }, + "inputs": { + "$id": "6912", + "kind": "array", + "type": { + "$ref": "835" + }, + "value": [ + { + "$id": "6913", + "kind": "string", + "type": { + "$ref": "836" + }, + "value": "temperature.Value" + }, + { + "$id": "6914", + "kind": "string", + "type": { + "$ref": "836" + }, + "value": "\"Tag 10\".Value" + } + ] + }, + "expression": { + "$id": "6915", + "kind": "string", + "type": { + "$ref": "840" + }, + "value": "$1 > 9000 && $2 >= 8000" + } + } + } + ] + }, + "map": { + "$id": "6916", + "kind": "array", + "type": { + "$ref": "846" + }, + "value": [ + { + "$id": "6917", + "kind": "model", + "type": { + "$ref": "847" + }, + "value": { + "$id": "6918", + "type": { + "$id": "6919", + "kind": "string", + "type": { + "$ref": "188" + }, + "value": "PassThrough" + }, + "inputs": { + "$id": "6920", + "kind": "array", + "type": { + "$ref": "856" + }, + "value": [ + { + "$id": "6921", + "kind": "string", + "type": { + "$ref": "857" + }, + "value": "*" + } + ] + }, + "output": { + "$id": "6922", + "kind": "string", + "type": { + "$ref": "865" + }, + "value": "*" + } + } + } + ] + } + } + } + } + }, + { + "$id": "6923", + "kind": "model", + "type": { + "$ref": "756" + }, + "value": { + "$id": "6924", + "operationType": { + "$id": "6925", + "kind": "string", + "type": { + "$ref": "164" + }, + "value": "Destination" + }, + "name": { + "$id": "6926", + "kind": "string", + "type": { + "$ref": "761" + }, + "value": "destination1" + }, + "destinationSettings": { + "$id": "6927", + "kind": "model", + "type": { + "$ref": "873" + }, + "value": { + "$id": "6928", + "endpointRef": { + "$id": "6929", + "kind": "string", + "type": { + "$ref": "875" + }, + "value": "aio-builtin-broker-endpoint" + }, + "dataDestination": { + "$id": "6930", + "kind": "string", + "type": { + "$ref": "879" + }, + "value": "data/filtered/thermostat" + } + } + } + } + } + ] + } + } + }, + "extendedLocation": { + "$id": "6931", + "kind": "model", + "type": { + "$ref": "669" + }, + "value": { + "$id": "6932", + "name": { + "$id": "6933", + "kind": "string", + "type": { + "$ref": "671" + }, + "value": "qmbrfwcpwwhggszhrdjv" + }, + "type": { + "$id": "6934", + "kind": "string", + "type": { + "$ref": "142" + }, + "value": "CustomLocation" + } + } + } + } + } + } + ], + "responses": [ + { + "$id": "6935", + "response": { + "$ref": "6443" + }, + "statusCode": 200, + "bodyValue": { + "$id": "6936", + "kind": "model", + "type": { + "$ref": "748" + }, + "value": { + "$id": "6937", + "properties": { + "$id": "6938", + "kind": "model", + "type": { + "$ref": "750" + }, + "value": { + "$id": "6939", + "mode": { + "$id": "6940", + "kind": "string", + "type": { + "$ref": "62" + }, + "value": "Enabled" + }, + "operations": { + "$id": "6941", + "kind": "array", + "type": { + "$ref": "755" + }, + "value": [ + { + "$id": "6942", + "kind": "model", + "type": { + "$ref": "756" + }, + "value": { + "$id": "6943", + "operationType": { + "$id": "6944", + "kind": "string", + "type": { + "$ref": "164" + }, + "value": "Source" + }, + "name": { + "$id": "6945", + "kind": "string", + "type": { + "$ref": "761" + }, + "value": "source1" + }, + "sourceSettings": { + "$id": "6946", + "kind": "model", + "type": { + "$ref": "765" + }, + "value": { + "$id": "6947", + "endpointRef": { + "$id": "6948", + "kind": "string", + "type": { + "$ref": "767" + }, + "value": "aio-builtin-broker-endpoint" + }, + "dataSources": { + "$id": "6949", + "kind": "array", + "type": { + "$ref": "782" + }, + "value": [ + { + "$id": "6950", + "kind": "string", + "type": { + "$ref": "783" + }, + "value": "azure-iot-operations/data/thermostat" + } + ] + } + } + } + } + }, + { + "$id": "6951", + "kind": "model", + "type": { + "$ref": "756" + }, + "value": { + "$id": "6952", + "operationType": { + "$id": "6953", + "kind": "string", + "type": { + "$ref": "164" + }, + "value": "BuiltInTransformation" + }, + "name": { + "$id": "6954", + "kind": "string", + "type": { + "$ref": "761" + }, + "value": "transformation1" + }, + "builtInTransformationSettings": { + "$id": "6955", + "kind": "model", + "type": { + "$ref": "790" + }, + "value": { + "$id": "6956", + "filter": { + "$id": "6957", + "kind": "array", + "type": { + "$ref": "825" + }, + "value": [ + { + "$id": "6958", + "kind": "model", + "type": { + "$ref": "826" + }, + "value": { + "$id": "6959", + "type": { + "$id": "6960", + "kind": "string", + "type": { + "$ref": "184" + }, + "value": "Filter" + }, + "description": { + "$id": "6961", + "kind": "string", + "type": { + "$ref": "831" + }, + "value": "filter-datapoint" + }, + "inputs": { + "$id": "6962", + "kind": "array", + "type": { + "$ref": "835" + }, + "value": [ + { + "$id": "6963", + "kind": "string", + "type": { + "$ref": "836" + }, + "value": "temperature.Value" + }, + { + "$id": "6964", + "kind": "string", + "type": { + "$ref": "836" + }, + "value": "\"Tag 10\".Value" + } + ] + }, + "expression": { + "$id": "6965", + "kind": "string", + "type": { + "$ref": "840" + }, + "value": "$1 > 9000 && $2 >= 8000" + } + } + } + ] + }, + "map": { + "$id": "6966", + "kind": "array", + "type": { + "$ref": "846" + }, + "value": [ + { + "$id": "6967", + "kind": "model", + "type": { + "$ref": "847" + }, + "value": { + "$id": "6968", + "type": { + "$id": "6969", + "kind": "string", + "type": { + "$ref": "188" + }, + "value": "PassThrough" + }, + "inputs": { + "$id": "6970", + "kind": "array", + "type": { + "$ref": "856" + }, + "value": [ + { + "$id": "6971", + "kind": "string", + "type": { + "$ref": "857" + }, + "value": "*" + } + ] + }, + "output": { + "$id": "6972", + "kind": "string", + "type": { + "$ref": "865" + }, + "value": "*" + } + } + } + ] + } + } + } + } + }, + { + "$id": "6973", + "kind": "model", + "type": { + "$ref": "756" + }, + "value": { + "$id": "6974", + "operationType": { + "$id": "6975", + "kind": "string", + "type": { + "$ref": "164" + }, + "value": "Destination" + }, + "name": { + "$id": "6976", + "kind": "string", + "type": { + "$ref": "761" + }, + "value": "destination1" + }, + "destinationSettings": { + "$id": "6977", + "kind": "model", + "type": { + "$ref": "873" + }, + "value": { + "$id": "6978", + "endpointRef": { + "$id": "6979", + "kind": "string", + "type": { + "$ref": "875" + }, + "value": "aio-builtin-broker-endpoint" + }, + "dataDestination": { + "$id": "6980", + "kind": "string", + "type": { + "$ref": "879" + }, + "value": "data/filtered/thermostat" + } + } + } + } + } + ] + }, + "provisioningState": { + "$id": "6981", + "kind": "string", + "type": { + "$ref": "126" + }, + "value": "Succeeded" + } + } + }, + "extendedLocation": { + "$id": "6982", + "kind": "model", + "type": { + "$ref": "669" + }, + "value": { + "$id": "6983", + "name": { + "$id": "6984", + "kind": "string", + "type": { + "$ref": "671" + }, + "value": "qmbrfwcpwwhggszhrdjv" + }, + "type": { + "$id": "6985", + "kind": "string", + "type": { + "$ref": "142" + }, + "value": "CustomLocation" + } + } + }, + "id": { + "$id": "6986", + "kind": "string", + "type": { + "$ref": "330" + }, + "value": "/subscriptions/0000000-0000-0000-0000-000000000000/resourceGroups/resourceGroup123/providers/Microsoft.IoTOperations/instances/resource-name123/dataflowProfiles/resource-name123/dataflows/resource-name123" + }, + "name": { + "$id": "6987", + "kind": "string", + "type": { + "$ref": "335" + }, + "value": "jxhcpwgfkxqasbexkookvxk" + }, + "type": { + "$id": "6988", + "kind": "string", + "type": { + "$ref": "339" + }, + "value": "zkuozvgjseokfchkscoswthzjdry" + }, + "systemData": { + "$id": "6989", + "kind": "model", + "type": { + "$ref": "344" + }, + "value": { + "$id": "6990", + "createdBy": { + "$id": "6991", + "kind": "string", + "type": { + "$ref": "346" + }, + "value": "ssvaslsmudloholronopqyxjcu" + }, + "createdByType": { + "$id": "6992", + "kind": "string", + "type": { + "$ref": "146" + }, + "value": "User" + }, + "createdAt": { + "$id": "6993", + "kind": "string", + "type": { + "$ref": "353" + }, + "value": "2024-08-09T18:13:29.389Z" + }, + "lastModifiedBy": { + "$id": "6994", + "kind": "string", + "type": { + "$ref": "358" + }, + "value": "gnicpuszwd" + }, + "lastModifiedByType": { + "$id": "6995", + "kind": "string", + "type": { + "$ref": "146" + }, + "value": "User" + }, + "lastModifiedAt": { + "$id": "6996", + "kind": "string", + "type": { + "$ref": "365" + }, + "value": "2024-08-09T18:13:29.389Z" + } + } + } + } + } + }, + { + "$id": "6997", + "response": { + "$ref": "6444" + }, + "statusCode": 201, + "bodyValue": { + "$id": "6998", + "kind": "model", + "type": { + "$ref": "748" + }, + "value": { + "$id": "6999", + "properties": { + "$id": "7000", + "kind": "model", + "type": { + "$ref": "750" + }, + "value": { + "$id": "7001", + "mode": { + "$id": "7002", + "kind": "string", + "type": { + "$ref": "62" + }, + "value": "Enabled" + }, + "operations": { + "$id": "7003", + "kind": "array", + "type": { + "$ref": "755" + }, + "value": [ + { + "$id": "7004", + "kind": "model", + "type": { + "$ref": "756" + }, + "value": { + "$id": "7005", + "operationType": { + "$id": "7006", + "kind": "string", + "type": { + "$ref": "164" + }, + "value": "Source" + }, + "name": { + "$id": "7007", + "kind": "string", + "type": { + "$ref": "761" + }, + "value": "source1" + }, + "sourceSettings": { + "$id": "7008", + "kind": "model", + "type": { + "$ref": "765" + }, + "value": { + "$id": "7009", + "endpointRef": { + "$id": "7010", + "kind": "string", + "type": { + "$ref": "767" + }, + "value": "aio-builtin-broker-endpoint" + }, + "dataSources": { + "$id": "7011", + "kind": "array", + "type": { + "$ref": "782" + }, + "value": [ + { + "$id": "7012", + "kind": "string", + "type": { + "$ref": "783" + }, + "value": "azure-iot-operations/data/thermostat" + } + ] + } + } + } + } + }, + { + "$id": "7013", + "kind": "model", + "type": { + "$ref": "756" + }, + "value": { + "$id": "7014", + "operationType": { + "$id": "7015", + "kind": "string", + "type": { + "$ref": "164" + }, + "value": "BuiltInTransformation" + }, + "name": { + "$id": "7016", + "kind": "string", + "type": { + "$ref": "761" + }, + "value": "transformation1" + }, + "builtInTransformationSettings": { + "$id": "7017", + "kind": "model", + "type": { + "$ref": "790" + }, + "value": { + "$id": "7018", + "filter": { + "$id": "7019", + "kind": "array", + "type": { + "$ref": "825" + }, + "value": [ + { + "$id": "7020", + "kind": "model", + "type": { + "$ref": "826" + }, + "value": { + "$id": "7021", + "type": { + "$id": "7022", + "kind": "string", + "type": { + "$ref": "184" + }, + "value": "Filter" + }, + "description": { + "$id": "7023", + "kind": "string", + "type": { + "$ref": "831" + }, + "value": "filter-datapoint" + }, + "inputs": { + "$id": "7024", + "kind": "array", + "type": { + "$ref": "835" + }, + "value": [ + { + "$id": "7025", + "kind": "string", + "type": { + "$ref": "836" + }, + "value": "temperature.Value" + }, + { + "$id": "7026", + "kind": "string", + "type": { + "$ref": "836" + }, + "value": "\"Tag 10\".Value" + } + ] + }, + "expression": { + "$id": "7027", + "kind": "string", + "type": { + "$ref": "840" + }, + "value": "$1 > 9000 && $2 >= 8000" + } + } + } + ] + }, + "map": { + "$id": "7028", + "kind": "array", + "type": { + "$ref": "846" + }, + "value": [ + { + "$id": "7029", + "kind": "model", + "type": { + "$ref": "847" + }, + "value": { + "$id": "7030", + "type": { + "$id": "7031", + "kind": "string", + "type": { + "$ref": "188" + }, + "value": "PassThrough" + }, + "inputs": { + "$id": "7032", + "kind": "array", + "type": { + "$ref": "856" + }, + "value": [ + { + "$id": "7033", + "kind": "string", + "type": { + "$ref": "857" + }, + "value": "*" + } + ] + }, + "output": { + "$id": "7034", + "kind": "string", + "type": { + "$ref": "865" + }, + "value": "*" + } + } + } + ] + } + } + } + } + }, + { + "$id": "7035", + "kind": "model", + "type": { + "$ref": "756" + }, + "value": { + "$id": "7036", + "operationType": { + "$id": "7037", + "kind": "string", + "type": { + "$ref": "164" + }, + "value": "Destination" + }, + "name": { + "$id": "7038", + "kind": "string", + "type": { + "$ref": "761" + }, + "value": "destination1" + }, + "destinationSettings": { + "$id": "7039", + "kind": "model", + "type": { + "$ref": "873" + }, + "value": { + "$id": "7040", + "endpointRef": { + "$id": "7041", + "kind": "string", + "type": { + "$ref": "875" + }, + "value": "aio-builtin-broker-endpoint" + }, + "dataDestination": { + "$id": "7042", + "kind": "string", + "type": { + "$ref": "879" + }, + "value": "data/filtered/thermostat" + } + } + } + } + } + ] + }, + "provisioningState": { + "$id": "7043", + "kind": "string", + "type": { + "$ref": "126" + }, + "value": "Succeeded" + } + } + }, + "extendedLocation": { + "$id": "7044", + "kind": "model", + "type": { + "$ref": "669" + }, + "value": { + "$id": "7045", + "name": { + "$id": "7046", + "kind": "string", + "type": { + "$ref": "671" + }, + "value": "qmbrfwcpwwhggszhrdjv" + }, + "type": { + "$id": "7047", + "kind": "string", + "type": { + "$ref": "142" + }, + "value": "CustomLocation" + } + } + }, + "id": { + "$id": "7048", + "kind": "string", + "type": { + "$ref": "330" + }, + "value": "/subscriptions/0000000-0000-0000-0000-000000000000/resourceGroups/resourceGroup123/providers/Microsoft.IoTOperations/instances/resource-name123/dataflowProfiles/resource-name123/dataflows/resource-name123" + }, + "name": { + "$id": "7049", + "kind": "string", + "type": { + "$ref": "335" + }, + "value": "jxhcpwgfkxqasbexkookvxk" + }, + "type": { + "$id": "7050", + "kind": "string", + "type": { + "$ref": "339" + }, + "value": "zkuozvgjseokfchkscoswthzjdry" + }, + "systemData": { + "$id": "7051", + "kind": "model", + "type": { + "$ref": "344" + }, + "value": { + "$id": "7052", + "createdBy": { + "$id": "7053", + "kind": "string", + "type": { + "$ref": "346" + }, + "value": "ssvaslsmudloholronopqyxjcu" + }, + "createdByType": { + "$id": "7054", + "kind": "string", + "type": { + "$ref": "146" + }, + "value": "User" + }, + "createdAt": { + "$id": "7055", + "kind": "string", + "type": { + "$ref": "353" + }, + "value": "2024-08-09T18:13:29.389Z" + }, + "lastModifiedBy": { + "$id": "7056", + "kind": "string", + "type": { + "$ref": "358" + }, + "value": "gnicpuszwd" + }, + "lastModifiedByType": { + "$id": "7057", + "kind": "string", + "type": { + "$ref": "146" + }, + "value": "User" + }, + "lastModifiedAt": { + "$id": "7058", + "kind": "string", + "type": { + "$ref": "365" + }, + "value": "2024-08-09T18:13:29.389Z" + } + } + } + } + } + } + ] + }, + { + "$id": "7059", + "kind": "http", + "name": "Dataflow_CreateOrUpdate", + "description": "Dataflow_CreateOrUpdate", + "filePath": "2024-11-01/Dataflow_CreateOrUpdate_MaximumSet_Gen.json", + "parameters": [ + { + "$id": "7060", + "parameter": { + "$ref": "6421" + }, + "value": { + "$id": "7061", + "kind": "string", + "type": { + "$ref": "6422" + }, + "value": "2024-11-01" + } + }, + { + "$id": "7062", + "parameter": { + "$ref": "6425" + }, + "value": { + "$id": "7063", + "kind": "string", + "type": { + "$ref": "6426" + }, + "value": "F8C729F9-DF9C-4743-848F-96EE433D8E53" + } + }, + { + "$id": "7064", + "parameter": { + "$ref": "6428" + }, + "value": { + "$id": "7065", + "kind": "string", + "type": { + "$ref": "6429" + }, + "value": "rgiotoperations" + } + }, + { + "$id": "7066", + "parameter": { + "$ref": "6430" + }, + "value": { + "$id": "7067", + "kind": "string", + "type": { + "$ref": "6431" + }, + "value": "resource-name123" + } + }, + { + "$id": "7068", + "parameter": { + "$ref": "6432" + }, + "value": { + "$id": "7069", + "kind": "string", + "type": { + "$ref": "6433" + }, + "value": "resource-name123" + } + }, + { + "$id": "7070", + "parameter": { + "$ref": "6434" + }, + "value": { + "$id": "7071", + "kind": "string", + "type": { + "$ref": "6435" + }, + "value": "resource-name123" + } + }, + { + "$id": "7072", + "parameter": { + "$ref": "6442" + }, + "value": { + "$id": "7073", + "kind": "model", + "type": { + "$ref": "748" + }, + "value": { + "$id": "7074", + "properties": { + "$id": "7075", + "kind": "model", + "type": { + "$ref": "750" + }, + "value": { + "$id": "7076", + "mode": { + "$id": "7077", + "kind": "string", + "type": { + "$ref": "62" + }, + "value": "Enabled" + }, + "operations": { + "$id": "7078", + "kind": "array", + "type": { + "$ref": "755" + }, + "value": [ + { + "$id": "7079", + "kind": "model", + "type": { + "$ref": "756" + }, + "value": { + "$id": "7080", + "operationType": { + "$id": "7081", + "kind": "string", + "type": { + "$ref": "164" + }, + "value": "Source" + }, + "name": { + "$id": "7082", + "kind": "string", + "type": { + "$ref": "761" + }, + "value": "knnafvkwoeakm" + }, + "sourceSettings": { + "$id": "7083", + "kind": "model", + "type": { + "$ref": "765" + }, + "value": { + "$id": "7084", + "endpointRef": { + "$id": "7085", + "kind": "string", + "type": { + "$ref": "767" + }, + "value": "iixotodhvhkkfcfyrkoveslqig" + }, + "assetRef": { + "$id": "7086", + "kind": "string", + "type": { + "$ref": "771" + }, + "value": "zayyykwmckaocywdkohmu" + }, + "serializationFormat": { + "$id": "7087", + "kind": "string", + "type": { + "$ref": "172" + }, + "value": "Json" + }, + "schemaRef": { + "$id": "7088", + "kind": "string", + "type": { + "$ref": "778" + }, + "value": "pknmdzqll" + }, + "dataSources": { + "$id": "7089", + "kind": "array", + "type": { + "$ref": "782" + }, + "value": [ + { + "$id": "7090", + "kind": "string", + "type": { + "$ref": "783" + }, + "value": "chkkpymxhp" + } + ] + } + } + }, + "builtInTransformationSettings": { + "$id": "7091", + "kind": "model", + "type": { + "$ref": "790" + }, + "value": { + "$id": "7092", + "serializationFormat": { + "$id": "7093", + "kind": "string", + "type": { + "$ref": "176" + }, + "value": "Delta" + }, + "schemaRef": { + "$id": "7094", + "kind": "string", + "type": { + "$ref": "795" + }, + "value": "mcdc" + }, + "datasets": { + "$id": "7095", + "kind": "array", + "type": { + "$ref": "799" + }, + "value": [ + { + "$id": "7096", + "kind": "model", + "type": { + "$ref": "800" + }, + "value": { + "$id": "7097", + "key": { + "$id": "7098", + "kind": "string", + "type": { + "$ref": "802" + }, + "value": "qsfqcgxaxnhfumrsdsokwyv" + }, + "description": { + "$id": "7099", + "kind": "string", + "type": { + "$ref": "806" + }, + "value": "Lorem ipsum odor amet, consectetuer adipiscing elit." + }, + "schemaRef": { + "$id": "7100", + "kind": "string", + "type": { + "$ref": "810" + }, + "value": "n" + }, + "inputs": { + "$id": "7101", + "kind": "array", + "type": { + "$ref": "814" + }, + "value": [ + { + "$id": "7102", + "kind": "string", + "type": { + "$ref": "815" + }, + "value": "mosffpsslifkq" + } + ] + }, + "expression": { + "$id": "7103", + "kind": "string", + "type": { + "$ref": "819" + }, + "value": "aatbwomvflemsxialv" + } + } + } + ] + }, + "filter": { + "$id": "7104", + "kind": "array", + "type": { + "$ref": "825" + }, + "value": [ + { + "$id": "7105", + "kind": "model", + "type": { + "$ref": "826" + }, + "value": { + "$id": "7106", + "type": { + "$id": "7107", + "kind": "string", + "type": { + "$ref": "184" + }, + "value": "Filter" + }, + "description": { + "$id": "7108", + "kind": "string", + "type": { + "$ref": "831" + }, + "value": "Lorem ipsum odor amet, consectetuer adipiscing elit." + }, + "inputs": { + "$id": "7109", + "kind": "array", + "type": { + "$ref": "835" + }, + "value": [ + { + "$id": "7110", + "kind": "string", + "type": { + "$ref": "836" + }, + "value": "sxmjkbntgb" + } + ] + }, + "expression": { + "$id": "7111", + "kind": "string", + "type": { + "$ref": "840" + }, + "value": "n" + } + } + } + ] + }, + "map": { + "$id": "7112", + "kind": "array", + "type": { + "$ref": "846" + }, + "value": [ + { + "$id": "7113", + "kind": "model", + "type": { + "$ref": "847" + }, + "value": { + "$id": "7114", + "type": { + "$id": "7115", + "kind": "string", + "type": { + "$ref": "188" + }, + "value": "NewProperties" + }, + "description": { + "$id": "7116", + "kind": "string", + "type": { + "$ref": "852" + }, + "value": "Lorem ipsum odor amet, consectetuer adipiscing elit." + }, + "inputs": { + "$id": "7117", + "kind": "array", + "type": { + "$ref": "856" + }, + "value": [ + { + "$id": "7118", + "kind": "string", + "type": { + "$ref": "857" + }, + "value": "xsbxuk" + } + ] + }, + "expression": { + "$id": "7119", + "kind": "string", + "type": { + "$ref": "861" + }, + "value": "txoiltogsarwkzalsphvlmt" + }, + "output": { + "$id": "7120", + "kind": "string", + "type": { + "$ref": "865" + }, + "value": "nvgtmkfl" + } + } + } + ] + } + } + }, + "destinationSettings": { + "$id": "7121", + "kind": "model", + "type": { + "$ref": "873" + }, + "value": { + "$id": "7122", + "endpointRef": { + "$id": "7123", + "kind": "string", + "type": { + "$ref": "875" + }, + "value": "kybkchnzimerguekuvqlqiqdvvrt" + }, + "dataDestination": { + "$id": "7124", + "kind": "string", + "type": { + "$ref": "879" + }, + "value": "cbrh" + } + } + } + } + } + ] + } + } + }, + "extendedLocation": { + "$id": "7125", + "kind": "model", + "type": { + "$ref": "669" + }, + "value": { + "$id": "7126", + "name": { + "$id": "7127", + "kind": "string", + "type": { + "$ref": "671" + }, + "value": "qmbrfwcpwwhggszhrdjv" + }, + "type": { + "$id": "7128", + "kind": "string", + "type": { + "$ref": "142" + }, + "value": "CustomLocation" + } + } + } + } + } + } + ], + "responses": [ + { + "$id": "7129", + "response": { + "$ref": "6443" + }, + "statusCode": 200, + "bodyValue": { + "$id": "7130", + "kind": "model", + "type": { + "$ref": "748" + }, + "value": { + "$id": "7131", + "properties": { + "$id": "7132", + "kind": "model", + "type": { + "$ref": "750" + }, + "value": { + "$id": "7133", + "mode": { + "$id": "7134", + "kind": "string", + "type": { + "$ref": "62" + }, + "value": "Enabled" + }, + "operations": { + "$id": "7135", + "kind": "array", + "type": { + "$ref": "755" + }, + "value": [ + { + "$id": "7136", + "kind": "model", + "type": { + "$ref": "756" + }, + "value": { + "$id": "7137", + "operationType": { + "$id": "7138", + "kind": "string", + "type": { + "$ref": "164" + }, + "value": "Source" + }, + "name": { + "$id": "7139", + "kind": "string", + "type": { + "$ref": "761" + }, + "value": "knnafvkwoeakm" + }, + "sourceSettings": { + "$id": "7140", + "kind": "model", + "type": { + "$ref": "765" + }, + "value": { + "$id": "7141", + "endpointRef": { + "$id": "7142", + "kind": "string", + "type": { + "$ref": "767" + }, + "value": "iixotodhvhkkfcfyrkoveslqig" + }, + "assetRef": { + "$id": "7143", + "kind": "string", + "type": { + "$ref": "771" + }, + "value": "zayyykwmckaocywdkohmu" + }, + "serializationFormat": { + "$id": "7144", + "kind": "string", + "type": { + "$ref": "172" + }, + "value": "Json" + }, + "schemaRef": { + "$id": "7145", + "kind": "string", + "type": { + "$ref": "778" + }, + "value": "pknmdzqll" + }, + "dataSources": { + "$id": "7146", + "kind": "array", + "type": { + "$ref": "782" + }, + "value": [ + { + "$id": "7147", + "kind": "string", + "type": { + "$ref": "783" + }, + "value": "chkkpymxhp" + } + ] + } + } + }, + "builtInTransformationSettings": { + "$id": "7148", + "kind": "model", + "type": { + "$ref": "790" + }, + "value": { + "$id": "7149", + "serializationFormat": { + "$id": "7150", + "kind": "string", + "type": { + "$ref": "176" + }, + "value": "Delta" + }, + "schemaRef": { + "$id": "7151", + "kind": "string", + "type": { + "$ref": "795" + }, + "value": "mcdc" + }, + "datasets": { + "$id": "7152", + "kind": "array", + "type": { + "$ref": "799" + }, + "value": [ + { + "$id": "7153", + "kind": "model", + "type": { + "$ref": "800" + }, + "value": { + "$id": "7154", + "key": { + "$id": "7155", + "kind": "string", + "type": { + "$ref": "802" + }, + "value": "qsfqcgxaxnhfumrsdsokwyv" + }, + "description": { + "$id": "7156", + "kind": "string", + "type": { + "$ref": "806" + }, + "value": "Lorem ipsum odor amet, consectetuer adipiscing elit." + }, + "schemaRef": { + "$id": "7157", + "kind": "string", + "type": { + "$ref": "810" + }, + "value": "n" + }, + "inputs": { + "$id": "7158", + "kind": "array", + "type": { + "$ref": "814" + }, + "value": [ + { + "$id": "7159", + "kind": "string", + "type": { + "$ref": "815" + }, + "value": "mosffpsslifkq" + } + ] + }, + "expression": { + "$id": "7160", + "kind": "string", + "type": { + "$ref": "819" + }, + "value": "aatbwomvflemsxialv" + } + } + } + ] + }, + "filter": { + "$id": "7161", + "kind": "array", + "type": { + "$ref": "825" + }, + "value": [ + { + "$id": "7162", + "kind": "model", + "type": { + "$ref": "826" + }, + "value": { + "$id": "7163", + "type": { + "$id": "7164", + "kind": "string", + "type": { + "$ref": "184" + }, + "value": "Filter" + }, + "description": { + "$id": "7165", + "kind": "string", + "type": { + "$ref": "831" + }, + "value": "Lorem ipsum odor amet, consectetuer adipiscing elit." + }, + "inputs": { + "$id": "7166", + "kind": "array", + "type": { + "$ref": "835" + }, + "value": [ + { + "$id": "7167", + "kind": "string", + "type": { + "$ref": "836" + }, + "value": "sxmjkbntgb" + } + ] + }, + "expression": { + "$id": "7168", + "kind": "string", + "type": { + "$ref": "840" + }, + "value": "n" + } + } + } + ] + }, + "map": { + "$id": "7169", + "kind": "array", + "type": { + "$ref": "846" + }, + "value": [ + { + "$id": "7170", + "kind": "model", + "type": { + "$ref": "847" + }, + "value": { + "$id": "7171", + "type": { + "$id": "7172", + "kind": "string", + "type": { + "$ref": "188" + }, + "value": "NewProperties" + }, + "description": { + "$id": "7173", + "kind": "string", + "type": { + "$ref": "852" + }, + "value": "Lorem ipsum odor amet, consectetuer adipiscing elit." + }, + "inputs": { + "$id": "7174", + "kind": "array", + "type": { + "$ref": "856" + }, + "value": [ + { + "$id": "7175", + "kind": "string", + "type": { + "$ref": "857" + }, + "value": "xsbxuk" + } + ] + }, + "expression": { + "$id": "7176", + "kind": "string", + "type": { + "$ref": "861" + }, + "value": "txoiltogsarwkzalsphvlmt" + }, + "output": { + "$id": "7177", + "kind": "string", + "type": { + "$ref": "865" + }, + "value": "nvgtmkfl" + } + } + } + ] + } + } + }, + "destinationSettings": { + "$id": "7178", + "kind": "model", + "type": { + "$ref": "873" + }, + "value": { + "$id": "7179", + "endpointRef": { + "$id": "7180", + "kind": "string", + "type": { + "$ref": "875" + }, + "value": "kybkchnzimerguekuvqlqiqdvvrt" + }, + "dataDestination": { + "$id": "7181", + "kind": "string", + "type": { + "$ref": "879" + }, + "value": "cbrh" + } + } + } + } + } + ] + }, + "provisioningState": { + "$id": "7182", + "kind": "string", + "type": { + "$ref": "126" + }, + "value": "Succeeded" + } + } + }, + "extendedLocation": { + "$id": "7183", + "kind": "model", + "type": { + "$ref": "669" + }, + "value": { + "$id": "7184", + "name": { + "$id": "7185", + "kind": "string", + "type": { + "$ref": "671" + }, + "value": "qmbrfwcpwwhggszhrdjv" + }, + "type": { + "$id": "7186", + "kind": "string", + "type": { + "$ref": "142" + }, + "value": "CustomLocation" + } + } + }, + "id": { + "$id": "7187", + "kind": "string", + "type": { + "$ref": "330" + }, + "value": "/subscriptions/0000000-0000-0000-0000-000000000000/resourceGroups/resourceGroup123/providers/Microsoft.IoTOperations/instances/resource-name123/dataflowProfiles/resource-name123/dataflows/resource-name123" + }, + "name": { + "$id": "7188", + "kind": "string", + "type": { + "$ref": "335" + }, + "value": "jxhcpwgfkxqasbexkookvxk" + }, + "type": { + "$id": "7189", + "kind": "string", + "type": { + "$ref": "339" + }, + "value": "zkuozvgjseokfchkscoswthzjdry" + }, + "systemData": { + "$id": "7190", + "kind": "model", + "type": { + "$ref": "344" + }, + "value": { + "$id": "7191", + "createdBy": { + "$id": "7192", + "kind": "string", + "type": { + "$ref": "346" + }, + "value": "ssvaslsmudloholronopqyxjcu" + }, + "createdByType": { + "$id": "7193", + "kind": "string", + "type": { + "$ref": "146" + }, + "value": "User" + }, + "createdAt": { + "$id": "7194", + "kind": "string", + "type": { + "$ref": "353" + }, + "value": "2024-08-09T18:13:29.389Z" + }, + "lastModifiedBy": { + "$id": "7195", + "kind": "string", + "type": { + "$ref": "358" + }, + "value": "gnicpuszwd" + }, + "lastModifiedByType": { + "$id": "7196", + "kind": "string", + "type": { + "$ref": "146" + }, + "value": "User" + }, + "lastModifiedAt": { + "$id": "7197", + "kind": "string", + "type": { + "$ref": "365" + }, + "value": "2024-08-09T18:13:29.389Z" + } + } + } + } + } + }, + { + "$id": "7198", + "response": { + "$ref": "6444" + }, + "statusCode": 201, + "bodyValue": { + "$id": "7199", + "kind": "model", + "type": { + "$ref": "748" + }, + "value": { + "$id": "7200", + "properties": { + "$id": "7201", + "kind": "model", + "type": { + "$ref": "750" + }, + "value": { + "$id": "7202", + "mode": { + "$id": "7203", + "kind": "string", + "type": { + "$ref": "62" + }, + "value": "Enabled" + }, + "operations": { + "$id": "7204", + "kind": "array", + "type": { + "$ref": "755" + }, + "value": [ + { + "$id": "7205", + "kind": "model", + "type": { + "$ref": "756" + }, + "value": { + "$id": "7206", + "operationType": { + "$id": "7207", + "kind": "string", + "type": { + "$ref": "164" + }, + "value": "Source" + }, + "name": { + "$id": "7208", + "kind": "string", + "type": { + "$ref": "761" + }, + "value": "knnafvkwoeakm" + }, + "sourceSettings": { + "$id": "7209", + "kind": "model", + "type": { + "$ref": "765" + }, + "value": { + "$id": "7210", + "endpointRef": { + "$id": "7211", + "kind": "string", + "type": { + "$ref": "767" + }, + "value": "iixotodhvhkkfcfyrkoveslqig" + }, + "assetRef": { + "$id": "7212", + "kind": "string", + "type": { + "$ref": "771" + }, + "value": "zayyykwmckaocywdkohmu" + }, + "serializationFormat": { + "$id": "7213", + "kind": "string", + "type": { + "$ref": "172" + }, + "value": "Json" + }, + "schemaRef": { + "$id": "7214", + "kind": "string", + "type": { + "$ref": "778" + }, + "value": "pknmdzqll" + }, + "dataSources": { + "$id": "7215", + "kind": "array", + "type": { + "$ref": "782" + }, + "value": [ + { + "$id": "7216", + "kind": "string", + "type": { + "$ref": "783" + }, + "value": "chkkpymxhp" + } + ] + } + } + }, + "builtInTransformationSettings": { + "$id": "7217", + "kind": "model", + "type": { + "$ref": "790" + }, + "value": { + "$id": "7218", + "serializationFormat": { + "$id": "7219", + "kind": "string", + "type": { + "$ref": "176" + }, + "value": "Delta" + }, + "schemaRef": { + "$id": "7220", + "kind": "string", + "type": { + "$ref": "795" + }, + "value": "mcdc" + }, + "datasets": { + "$id": "7221", + "kind": "array", + "type": { + "$ref": "799" + }, + "value": [ + { + "$id": "7222", + "kind": "model", + "type": { + "$ref": "800" + }, + "value": { + "$id": "7223", + "key": { + "$id": "7224", + "kind": "string", + "type": { + "$ref": "802" + }, + "value": "qsfqcgxaxnhfumrsdsokwyv" + }, + "description": { + "$id": "7225", + "kind": "string", + "type": { + "$ref": "806" + }, + "value": "Lorem ipsum odor amet, consectetuer adipiscing elit." + }, + "schemaRef": { + "$id": "7226", + "kind": "string", + "type": { + "$ref": "810" + }, + "value": "n" + }, + "inputs": { + "$id": "7227", + "kind": "array", + "type": { + "$ref": "814" + }, + "value": [ + { + "$id": "7228", + "kind": "string", + "type": { + "$ref": "815" + }, + "value": "mosffpsslifkq" + } + ] + }, + "expression": { + "$id": "7229", + "kind": "string", + "type": { + "$ref": "819" + }, + "value": "aatbwomvflemsxialv" + } + } + } + ] + }, + "filter": { + "$id": "7230", + "kind": "array", + "type": { + "$ref": "825" + }, + "value": [ + { + "$id": "7231", + "kind": "model", + "type": { + "$ref": "826" + }, + "value": { + "$id": "7232", + "type": { + "$id": "7233", + "kind": "string", + "type": { + "$ref": "184" + }, + "value": "Filter" + }, + "description": { + "$id": "7234", + "kind": "string", + "type": { + "$ref": "831" + }, + "value": "Lorem ipsum odor amet, consectetuer adipiscing elit." + }, + "inputs": { + "$id": "7235", + "kind": "array", + "type": { + "$ref": "835" + }, + "value": [ + { + "$id": "7236", + "kind": "string", + "type": { + "$ref": "836" + }, + "value": "sxmjkbntgb" + } + ] + }, + "expression": { + "$id": "7237", + "kind": "string", + "type": { + "$ref": "840" + }, + "value": "n" + } + } + } + ] + }, + "map": { + "$id": "7238", + "kind": "array", + "type": { + "$ref": "846" + }, + "value": [ + { + "$id": "7239", + "kind": "model", + "type": { + "$ref": "847" + }, + "value": { + "$id": "7240", + "type": { + "$id": "7241", + "kind": "string", + "type": { + "$ref": "188" + }, + "value": "NewProperties" + }, + "description": { + "$id": "7242", + "kind": "string", + "type": { + "$ref": "852" + }, + "value": "Lorem ipsum odor amet, consectetuer adipiscing elit." + }, + "inputs": { + "$id": "7243", + "kind": "array", + "type": { + "$ref": "856" + }, + "value": [ + { + "$id": "7244", + "kind": "string", + "type": { + "$ref": "857" + }, + "value": "xsbxuk" + } + ] + }, + "expression": { + "$id": "7245", + "kind": "string", + "type": { + "$ref": "861" + }, + "value": "txoiltogsarwkzalsphvlmt" + }, + "output": { + "$id": "7246", + "kind": "string", + "type": { + "$ref": "865" + }, + "value": "nvgtmkfl" + } + } + } + ] + } + } + }, + "destinationSettings": { + "$id": "7247", + "kind": "model", + "type": { + "$ref": "873" + }, + "value": { + "$id": "7248", + "endpointRef": { + "$id": "7249", + "kind": "string", + "type": { + "$ref": "875" + }, + "value": "kybkchnzimerguekuvqlqiqdvvrt" + }, + "dataDestination": { + "$id": "7250", + "kind": "string", + "type": { + "$ref": "879" + }, + "value": "cbrh" + } + } + } + } + } + ] + }, + "provisioningState": { + "$id": "7251", + "kind": "string", + "type": { + "$ref": "126" + }, + "value": "Succeeded" + } + } + }, + "extendedLocation": { + "$id": "7252", + "kind": "model", + "type": { + "$ref": "669" + }, + "value": { + "$id": "7253", + "name": { + "$id": "7254", + "kind": "string", + "type": { + "$ref": "671" + }, + "value": "qmbrfwcpwwhggszhrdjv" + }, + "type": { + "$id": "7255", + "kind": "string", + "type": { + "$ref": "142" + }, + "value": "CustomLocation" + } + } + }, + "id": { + "$id": "7256", + "kind": "string", + "type": { + "$ref": "330" + }, + "value": "/subscriptions/0000000-0000-0000-0000-000000000000/resourceGroups/resourceGroup123/providers/Microsoft.IoTOperations/instances/resource-name123/dataflowProfiles/resource-name123/dataflows/resource-name123" + }, + "name": { + "$id": "7257", + "kind": "string", + "type": { + "$ref": "335" + }, + "value": "jxhcpwgfkxqasbexkookvxk" + }, + "type": { + "$id": "7258", + "kind": "string", + "type": { + "$ref": "339" + }, + "value": "zkuozvgjseokfchkscoswthzjdry" + }, + "systemData": { + "$id": "7259", + "kind": "model", + "type": { + "$ref": "344" + }, + "value": { + "$id": "7260", + "createdBy": { + "$id": "7261", + "kind": "string", + "type": { + "$ref": "346" + }, + "value": "ssvaslsmudloholronopqyxjcu" + }, + "createdByType": { + "$id": "7262", + "kind": "string", + "type": { + "$ref": "146" + }, + "value": "User" + }, + "createdAt": { + "$id": "7263", + "kind": "string", + "type": { + "$ref": "353" + }, + "value": "2024-08-09T18:13:29.389Z" + }, + "lastModifiedBy": { + "$id": "7264", + "kind": "string", + "type": { + "$ref": "358" + }, + "value": "gnicpuszwd" + }, + "lastModifiedByType": { + "$id": "7265", + "kind": "string", + "type": { + "$ref": "146" + }, + "value": "User" + }, + "lastModifiedAt": { + "$id": "7266", + "kind": "string", + "type": { + "$ref": "365" + }, + "value": "2024-08-09T18:13:29.389Z" + } + } + } + } + } + } + ] + }, + { + "$id": "7267", + "kind": "http", + "name": "Dataflow_CreateOrUpdate_SimpleEventGrid", + "description": "Dataflow_CreateOrUpdate_SimpleEventGrid", + "filePath": "2024-11-01/Dataflow_CreateOrUpdate_SimpleEventGrid.json", + "parameters": [ + { + "$id": "7268", + "parameter": { + "$ref": "6421" + }, + "value": { + "$id": "7269", + "kind": "string", + "type": { + "$ref": "6422" + }, + "value": "2024-11-01" + } + }, + { + "$id": "7270", + "parameter": { + "$ref": "6425" + }, + "value": { + "$id": "7271", + "kind": "string", + "type": { + "$ref": "6426" + }, + "value": "F8C729F9-DF9C-4743-848F-96EE433D8E53" + } + }, + { + "$id": "7272", + "parameter": { + "$ref": "6428" + }, + "value": { + "$id": "7273", + "kind": "string", + "type": { + "$ref": "6429" + }, + "value": "rgiotoperations" + } + }, + { + "$id": "7274", + "parameter": { + "$ref": "6430" + }, + "value": { + "$id": "7275", + "kind": "string", + "type": { + "$ref": "6431" + }, + "value": "resource-name123" + } + }, + { + "$id": "7276", + "parameter": { + "$ref": "6432" + }, + "value": { + "$id": "7277", + "kind": "string", + "type": { + "$ref": "6433" + }, + "value": "resource-name123" + } + }, + { + "$id": "7278", + "parameter": { + "$ref": "6434" + }, + "value": { + "$id": "7279", + "kind": "string", + "type": { + "$ref": "6435" + }, + "value": "aio-to-event-grid" + } + }, + { + "$id": "7280", + "parameter": { + "$ref": "6442" + }, + "value": { + "$id": "7281", + "kind": "model", + "type": { + "$ref": "748" + }, + "value": { + "$id": "7282", + "properties": { + "$id": "7283", + "kind": "model", + "type": { + "$ref": "750" + }, + "value": { + "$id": "7284", + "mode": { + "$id": "7285", + "kind": "string", + "type": { + "$ref": "62" + }, + "value": "Enabled" + }, + "operations": { + "$id": "7286", + "kind": "array", + "type": { + "$ref": "755" + }, + "value": [ + { + "$id": "7287", + "kind": "model", + "type": { + "$ref": "756" + }, + "value": { + "$id": "7288", + "operationType": { + "$id": "7289", + "kind": "string", + "type": { + "$ref": "164" + }, + "value": "Source" + }, + "name": { + "$id": "7290", + "kind": "string", + "type": { + "$ref": "761" + }, + "value": "source1" + }, + "sourceSettings": { + "$id": "7291", + "kind": "model", + "type": { + "$ref": "765" + }, + "value": { + "$id": "7292", + "endpointRef": { + "$id": "7293", + "kind": "string", + "type": { + "$ref": "767" + }, + "value": "aio-builtin-broker-endpoint" + }, + "dataSources": { + "$id": "7294", + "kind": "array", + "type": { + "$ref": "782" + }, + "value": [ + { + "$id": "7295", + "kind": "string", + "type": { + "$ref": "783" + }, + "value": "thermostats/+/telemetry/temperature/#" + } + ] + } + } + } + } + }, + { + "$id": "7296", + "kind": "model", + "type": { + "$ref": "756" + }, + "value": { + "$id": "7297", + "operationType": { + "$id": "7298", + "kind": "string", + "type": { + "$ref": "164" + }, + "value": "Destination" + }, + "name": { + "$id": "7299", + "kind": "string", + "type": { + "$ref": "761" + }, + "value": "destination1" + }, + "destinationSettings": { + "$id": "7300", + "kind": "model", + "type": { + "$ref": "873" + }, + "value": { + "$id": "7301", + "endpointRef": { + "$id": "7302", + "kind": "string", + "type": { + "$ref": "875" + }, + "value": "event-grid-endpoint" + }, + "dataDestination": { + "$id": "7303", + "kind": "string", + "type": { + "$ref": "879" + }, + "value": "factory/telemetry" + } + } + } + } + } + ] + } + } + }, + "extendedLocation": { + "$id": "7304", + "kind": "model", + "type": { + "$ref": "669" + }, + "value": { + "$id": "7305", + "name": { + "$id": "7306", + "kind": "string", + "type": { + "$ref": "671" + }, + "value": "qmbrfwcpwwhggszhrdjv" + }, + "type": { + "$id": "7307", + "kind": "string", + "type": { + "$ref": "142" + }, + "value": "CustomLocation" + } + } + } + } + } + } + ], + "responses": [ + { + "$id": "7308", + "response": { + "$ref": "6443" + }, + "statusCode": 200, + "bodyValue": { + "$id": "7309", + "kind": "model", + "type": { + "$ref": "748" + }, + "value": { + "$id": "7310", + "properties": { + "$id": "7311", + "kind": "model", + "type": { + "$ref": "750" + }, + "value": { + "$id": "7312", + "mode": { + "$id": "7313", + "kind": "string", + "type": { + "$ref": "62" + }, + "value": "Enabled" + }, + "operations": { + "$id": "7314", + "kind": "array", + "type": { + "$ref": "755" + }, + "value": [ + { + "$id": "7315", + "kind": "model", + "type": { + "$ref": "756" + }, + "value": { + "$id": "7316", + "operationType": { + "$id": "7317", + "kind": "string", + "type": { + "$ref": "164" + }, + "value": "Source" + }, + "name": { + "$id": "7318", + "kind": "string", + "type": { + "$ref": "761" + }, + "value": "source1" + }, + "sourceSettings": { + "$id": "7319", + "kind": "model", + "type": { + "$ref": "765" + }, + "value": { + "$id": "7320", + "endpointRef": { + "$id": "7321", + "kind": "string", + "type": { + "$ref": "767" + }, + "value": "aio-builtin-broker-endpoint" + }, + "dataSources": { + "$id": "7322", + "kind": "array", + "type": { + "$ref": "782" + }, + "value": [ + { + "$id": "7323", + "kind": "string", + "type": { + "$ref": "783" + }, + "value": "thermostats/+/telemetry/temperature/#" + } + ] + } + } + } + } + }, + { + "$id": "7324", + "kind": "model", + "type": { + "$ref": "756" + }, + "value": { + "$id": "7325", + "operationType": { + "$id": "7326", + "kind": "string", + "type": { + "$ref": "164" + }, + "value": "Destination" + }, + "name": { + "$id": "7327", + "kind": "string", + "type": { + "$ref": "761" + }, + "value": "destination1" + }, + "destinationSettings": { + "$id": "7328", + "kind": "model", + "type": { + "$ref": "873" + }, + "value": { + "$id": "7329", + "endpointRef": { + "$id": "7330", + "kind": "string", + "type": { + "$ref": "875" + }, + "value": "event-grid-endpoint" + }, + "dataDestination": { + "$id": "7331", + "kind": "string", + "type": { + "$ref": "879" + }, + "value": "factory/telemetry" + } + } + } + } + } + ] + }, + "provisioningState": { + "$id": "7332", + "kind": "string", + "type": { + "$ref": "126" + }, + "value": "Succeeded" + } + } + }, + "extendedLocation": { + "$id": "7333", + "kind": "model", + "type": { + "$ref": "669" + }, + "value": { + "$id": "7334", + "name": { + "$id": "7335", + "kind": "string", + "type": { + "$ref": "671" + }, + "value": "qmbrfwcpwwhggszhrdjv" + }, + "type": { + "$id": "7336", + "kind": "string", + "type": { + "$ref": "142" + }, + "value": "CustomLocation" + } + } + }, + "id": { + "$id": "7337", + "kind": "string", + "type": { + "$ref": "330" + }, + "value": "/subscriptions/0000000-0000-0000-0000-000000000000/resourceGroups/resourceGroup123/providers/Microsoft.IoTOperations/instances/resource-name123/dataflowProfiles/resource-name123/dataflows/resource-name123" + }, + "name": { + "$id": "7338", + "kind": "string", + "type": { + "$ref": "335" + }, + "value": "jxhcpwgfkxqasbexkookvxk" + }, + "type": { + "$id": "7339", + "kind": "string", + "type": { + "$ref": "339" + }, + "value": "zkuozvgjseokfchkscoswthzjdry" + }, + "systemData": { + "$id": "7340", + "kind": "model", + "type": { + "$ref": "344" + }, + "value": { + "$id": "7341", + "createdBy": { + "$id": "7342", + "kind": "string", + "type": { + "$ref": "346" + }, + "value": "ssvaslsmudloholronopqyxjcu" + }, + "createdByType": { + "$id": "7343", + "kind": "string", + "type": { + "$ref": "146" + }, + "value": "User" + }, + "createdAt": { + "$id": "7344", + "kind": "string", + "type": { + "$ref": "353" + }, + "value": "2024-08-09T18:13:29.389Z" + }, + "lastModifiedBy": { + "$id": "7345", + "kind": "string", + "type": { + "$ref": "358" + }, + "value": "gnicpuszwd" + }, + "lastModifiedByType": { + "$id": "7346", + "kind": "string", + "type": { + "$ref": "146" + }, + "value": "User" + }, + "lastModifiedAt": { + "$id": "7347", + "kind": "string", + "type": { + "$ref": "365" + }, + "value": "2024-08-09T18:13:29.389Z" + } + } + } + } + } + }, + { + "$id": "7348", + "response": { + "$ref": "6444" + }, + "statusCode": 201, + "bodyValue": { + "$id": "7349", + "kind": "model", + "type": { + "$ref": "748" + }, + "value": { + "$id": "7350", + "properties": { + "$id": "7351", + "kind": "model", + "type": { + "$ref": "750" + }, + "value": { + "$id": "7352", + "mode": { + "$id": "7353", + "kind": "string", + "type": { + "$ref": "62" + }, + "value": "Enabled" + }, + "operations": { + "$id": "7354", + "kind": "array", + "type": { + "$ref": "755" + }, + "value": [ + { + "$id": "7355", + "kind": "model", + "type": { + "$ref": "756" + }, + "value": { + "$id": "7356", + "operationType": { + "$id": "7357", + "kind": "string", + "type": { + "$ref": "164" + }, + "value": "Source" + }, + "name": { + "$id": "7358", + "kind": "string", + "type": { + "$ref": "761" + }, + "value": "source1" + }, + "sourceSettings": { + "$id": "7359", + "kind": "model", + "type": { + "$ref": "765" + }, + "value": { + "$id": "7360", + "endpointRef": { + "$id": "7361", + "kind": "string", + "type": { + "$ref": "767" + }, + "value": "aio-builtin-broker-endpoint" + }, + "dataSources": { + "$id": "7362", + "kind": "array", + "type": { + "$ref": "782" + }, + "value": [ + { + "$id": "7363", + "kind": "string", + "type": { + "$ref": "783" + }, + "value": "thermostats/+/telemetry/temperature/#" + } + ] + } + } + } + } + }, + { + "$id": "7364", + "kind": "model", + "type": { + "$ref": "756" + }, + "value": { + "$id": "7365", + "operationType": { + "$id": "7366", + "kind": "string", + "type": { + "$ref": "164" + }, + "value": "Destination" + }, + "name": { + "$id": "7367", + "kind": "string", + "type": { + "$ref": "761" + }, + "value": "destination1" + }, + "destinationSettings": { + "$id": "7368", + "kind": "model", + "type": { + "$ref": "873" + }, + "value": { + "$id": "7369", + "endpointRef": { + "$id": "7370", + "kind": "string", + "type": { + "$ref": "875" + }, + "value": "event-grid-endpoint" + }, + "dataDestination": { + "$id": "7371", + "kind": "string", + "type": { + "$ref": "879" + }, + "value": "factory/telemetry" + } + } + } + } + } + ] + }, + "provisioningState": { + "$id": "7372", + "kind": "string", + "type": { + "$ref": "126" + }, + "value": "Succeeded" + } + } + }, + "extendedLocation": { + "$id": "7373", + "kind": "model", + "type": { + "$ref": "669" + }, + "value": { + "$id": "7374", + "name": { + "$id": "7375", + "kind": "string", + "type": { + "$ref": "671" + }, + "value": "qmbrfwcpwwhggszhrdjv" + }, + "type": { + "$id": "7376", + "kind": "string", + "type": { + "$ref": "142" + }, + "value": "CustomLocation" + } + } + }, + "id": { + "$id": "7377", + "kind": "string", + "type": { + "$ref": "330" + }, + "value": "/subscriptions/0000000-0000-0000-0000-000000000000/resourceGroups/resourceGroup123/providers/Microsoft.IoTOperations/instances/resource-name123/dataflowProfiles/resource-name123/dataflows/resource-name123" + }, + "name": { + "$id": "7378", + "kind": "string", + "type": { + "$ref": "335" + }, + "value": "jxhcpwgfkxqasbexkookvxk" + }, + "type": { + "$id": "7379", + "kind": "string", + "type": { + "$ref": "339" + }, + "value": "zkuozvgjseokfchkscoswthzjdry" + }, + "systemData": { + "$id": "7380", + "kind": "model", + "type": { + "$ref": "344" + }, + "value": { + "$id": "7381", + "createdBy": { + "$id": "7382", + "kind": "string", + "type": { + "$ref": "346" + }, + "value": "ssvaslsmudloholronopqyxjcu" + }, + "createdByType": { + "$id": "7383", + "kind": "string", + "type": { + "$ref": "146" + }, + "value": "User" + }, + "createdAt": { + "$id": "7384", + "kind": "string", + "type": { + "$ref": "353" + }, + "value": "2024-08-09T18:13:29.389Z" + }, + "lastModifiedBy": { + "$id": "7385", + "kind": "string", + "type": { + "$ref": "358" + }, + "value": "gnicpuszwd" + }, + "lastModifiedByType": { + "$id": "7386", + "kind": "string", + "type": { + "$ref": "146" + }, + "value": "User" + }, + "lastModifiedAt": { + "$id": "7387", + "kind": "string", + "type": { + "$ref": "365" + }, + "value": "2024-08-09T18:13:29.389Z" + } + } + } + } + } + } + ] + }, + { + "$id": "7388", + "kind": "http", + "name": "Dataflow_CreateOrUpdate_SimpleFabric", + "description": "Dataflow_CreateOrUpdate_SimpleFabric", + "filePath": "2024-11-01/Dataflow_CreateOrUpdate_SimpleFabric.json", + "parameters": [ + { + "$id": "7389", + "parameter": { + "$ref": "6421" + }, + "value": { + "$id": "7390", + "kind": "string", + "type": { + "$ref": "6422" + }, + "value": "2024-11-01" + } + }, + { + "$id": "7391", + "parameter": { + "$ref": "6425" + }, + "value": { + "$id": "7392", + "kind": "string", + "type": { + "$ref": "6426" + }, + "value": "F8C729F9-DF9C-4743-848F-96EE433D8E53" + } + }, + { + "$id": "7393", + "parameter": { + "$ref": "6428" + }, + "value": { + "$id": "7394", + "kind": "string", + "type": { + "$ref": "6429" + }, + "value": "rgiotoperations" + } + }, + { + "$id": "7395", + "parameter": { + "$ref": "6430" + }, + "value": { + "$id": "7396", + "kind": "string", + "type": { + "$ref": "6431" + }, + "value": "resource-name123" + } + }, + { + "$id": "7397", + "parameter": { + "$ref": "6432" + }, + "value": { + "$id": "7398", + "kind": "string", + "type": { + "$ref": "6433" + }, + "value": "resource-name123" + } + }, + { + "$id": "7399", + "parameter": { + "$ref": "6434" + }, + "value": { + "$id": "7400", + "kind": "string", + "type": { + "$ref": "6435" + }, + "value": "aio-to-fabric" + } + }, + { + "$id": "7401", + "parameter": { + "$ref": "6442" + }, + "value": { + "$id": "7402", + "kind": "model", + "type": { + "$ref": "748" + }, + "value": { + "$id": "7403", + "properties": { + "$id": "7404", + "kind": "model", + "type": { + "$ref": "750" + }, + "value": { + "$id": "7405", + "mode": { + "$id": "7406", + "kind": "string", + "type": { + "$ref": "62" + }, + "value": "Enabled" + }, + "operations": { + "$id": "7407", + "kind": "array", + "type": { + "$ref": "755" + }, + "value": [ + { + "$id": "7408", + "kind": "model", + "type": { + "$ref": "756" + }, + "value": { + "$id": "7409", + "operationType": { + "$id": "7410", + "kind": "string", + "type": { + "$ref": "164" + }, + "value": "Source" + }, + "name": { + "$id": "7411", + "kind": "string", + "type": { + "$ref": "761" + }, + "value": "source1" + }, + "sourceSettings": { + "$id": "7412", + "kind": "model", + "type": { + "$ref": "765" + }, + "value": { + "$id": "7413", + "endpointRef": { + "$id": "7414", + "kind": "string", + "type": { + "$ref": "767" + }, + "value": "aio-builtin-broker-endpoint" + }, + "dataSources": { + "$id": "7415", + "kind": "array", + "type": { + "$ref": "782" + }, + "value": [ + { + "$id": "7416", + "kind": "string", + "type": { + "$ref": "783" + }, + "value": "azure-iot-operations/data/thermostat" + } + ] + } + } + } + } + }, + { + "$id": "7417", + "kind": "model", + "type": { + "$ref": "756" + }, + "value": { + "$id": "7418", + "operationType": { + "$id": "7419", + "kind": "string", + "type": { + "$ref": "164" + }, + "value": "BuiltInTransformation" + }, + "builtInTransformationSettings": { + "$id": "7420", + "kind": "model", + "type": { + "$ref": "790" + }, + "value": { + "$id": "7421", + "serializationFormat": { + "$id": "7422", + "kind": "string", + "type": { + "$ref": "176" + }, + "value": "Parquet" + }, + "schemaRef": { + "$id": "7423", + "kind": "string", + "type": { + "$ref": "795" + }, + "value": "aio-sr://exampleNamespace/exmapleParquetSchema:1.0.0" + } + } + } + } + }, + { + "$id": "7424", + "kind": "model", + "type": { + "$ref": "756" + }, + "value": { + "$id": "7425", + "operationType": { + "$id": "7426", + "kind": "string", + "type": { + "$ref": "164" + }, + "value": "Destination" + }, + "name": { + "$id": "7427", + "kind": "string", + "type": { + "$ref": "761" + }, + "value": "destination1" + }, + "destinationSettings": { + "$id": "7428", + "kind": "model", + "type": { + "$ref": "873" + }, + "value": { + "$id": "7429", + "endpointRef": { + "$id": "7430", + "kind": "string", + "type": { + "$ref": "875" + }, + "value": "fabric-endpoint" + }, + "dataDestination": { + "$id": "7431", + "kind": "string", + "type": { + "$ref": "879" + }, + "value": "telemetryTable" + } + } + } + } + } + ] + } + } + }, + "extendedLocation": { + "$id": "7432", + "kind": "model", + "type": { + "$ref": "669" + }, + "value": { + "$id": "7433", + "name": { + "$id": "7434", + "kind": "string", + "type": { + "$ref": "671" + }, + "value": "qmbrfwcpwwhggszhrdjv" + }, + "type": { + "$id": "7435", + "kind": "string", + "type": { + "$ref": "142" + }, + "value": "CustomLocation" + } + } + } + } + } + } + ], + "responses": [ + { + "$id": "7436", + "response": { + "$ref": "6443" + }, + "statusCode": 200, + "bodyValue": { + "$id": "7437", + "kind": "model", + "type": { + "$ref": "748" + }, + "value": { + "$id": "7438", + "properties": { + "$id": "7439", + "kind": "model", + "type": { + "$ref": "750" + }, + "value": { + "$id": "7440", + "mode": { + "$id": "7441", + "kind": "string", + "type": { + "$ref": "62" + }, + "value": "Enabled" + }, + "operations": { + "$id": "7442", + "kind": "array", + "type": { + "$ref": "755" + }, + "value": [ + { + "$id": "7443", + "kind": "model", + "type": { + "$ref": "756" + }, + "value": { + "$id": "7444", + "operationType": { + "$id": "7445", + "kind": "string", + "type": { + "$ref": "164" + }, + "value": "Source" + }, + "name": { + "$id": "7446", + "kind": "string", + "type": { + "$ref": "761" + }, + "value": "source1" + }, + "sourceSettings": { + "$id": "7447", + "kind": "model", + "type": { + "$ref": "765" + }, + "value": { + "$id": "7448", + "endpointRef": { + "$id": "7449", + "kind": "string", + "type": { + "$ref": "767" + }, + "value": "aio-builtin-broker-endpoint" + }, + "dataSources": { + "$id": "7450", + "kind": "array", + "type": { + "$ref": "782" + }, + "value": [ + { + "$id": "7451", + "kind": "string", + "type": { + "$ref": "783" + }, + "value": "azure-iot-operations/data/thermostat" + } + ] + } + } + } + } + }, + { + "$id": "7452", + "kind": "model", + "type": { + "$ref": "756" + }, + "value": { + "$id": "7453", + "operationType": { + "$id": "7454", + "kind": "string", + "type": { + "$ref": "164" + }, + "value": "BuiltInTransformation" + }, + "builtInTransformationSettings": { + "$id": "7455", + "kind": "model", + "type": { + "$ref": "790" + }, + "value": { + "$id": "7456", + "serializationFormat": { + "$id": "7457", + "kind": "string", + "type": { + "$ref": "176" + }, + "value": "Parquet" + }, + "schemaRef": { + "$id": "7458", + "kind": "string", + "type": { + "$ref": "795" + }, + "value": "aio-sr://exampleNamespace/exmapleParquetSchema:1.0.0" + } + } + } + } + }, + { + "$id": "7459", + "kind": "model", + "type": { + "$ref": "756" + }, + "value": { + "$id": "7460", + "operationType": { + "$id": "7461", + "kind": "string", + "type": { + "$ref": "164" + }, + "value": "Destination" + }, + "name": { + "$id": "7462", + "kind": "string", + "type": { + "$ref": "761" + }, + "value": "destination1" + }, + "destinationSettings": { + "$id": "7463", + "kind": "model", + "type": { + "$ref": "873" + }, + "value": { + "$id": "7464", + "endpointRef": { + "$id": "7465", + "kind": "string", + "type": { + "$ref": "875" + }, + "value": "fabric-endpoint" + }, + "dataDestination": { + "$id": "7466", + "kind": "string", + "type": { + "$ref": "879" + }, + "value": "telemetryTable" + } + } + } + } + } + ] + }, + "provisioningState": { + "$id": "7467", + "kind": "string", + "type": { + "$ref": "126" + }, + "value": "Succeeded" + } + } + }, + "extendedLocation": { + "$id": "7468", + "kind": "model", + "type": { + "$ref": "669" + }, + "value": { + "$id": "7469", + "name": { + "$id": "7470", + "kind": "string", + "type": { + "$ref": "671" + }, + "value": "qmbrfwcpwwhggszhrdjv" + }, + "type": { + "$id": "7471", + "kind": "string", + "type": { + "$ref": "142" + }, + "value": "CustomLocation" + } + } + }, + "id": { + "$id": "7472", + "kind": "string", + "type": { + "$ref": "330" + }, + "value": "/subscriptions/0000000-0000-0000-0000-000000000000/resourceGroups/resourceGroup123/providers/Microsoft.IoTOperations/instances/resource-name123/dataflowProfiles/resource-name123/dataflows/resource-name123" + }, + "name": { + "$id": "7473", + "kind": "string", + "type": { + "$ref": "335" + }, + "value": "jxhcpwgfkxqasbexkookvxk" + }, + "type": { + "$id": "7474", + "kind": "string", + "type": { + "$ref": "339" + }, + "value": "zkuozvgjseokfchkscoswthzjdry" + }, + "systemData": { + "$id": "7475", + "kind": "model", + "type": { + "$ref": "344" + }, + "value": { + "$id": "7476", + "createdBy": { + "$id": "7477", + "kind": "string", + "type": { + "$ref": "346" + }, + "value": "ssvaslsmudloholronopqyxjcu" + }, + "createdByType": { + "$id": "7478", + "kind": "string", + "type": { + "$ref": "146" + }, + "value": "User" + }, + "createdAt": { + "$id": "7479", + "kind": "string", + "type": { + "$ref": "353" + }, + "value": "2024-08-09T18:13:29.389Z" + }, + "lastModifiedBy": { + "$id": "7480", + "kind": "string", + "type": { + "$ref": "358" + }, + "value": "gnicpuszwd" + }, + "lastModifiedByType": { + "$id": "7481", + "kind": "string", + "type": { + "$ref": "146" + }, + "value": "User" + }, + "lastModifiedAt": { + "$id": "7482", + "kind": "string", + "type": { + "$ref": "365" + }, + "value": "2024-08-09T18:13:29.389Z" + } + } + } + } + } + }, + { + "$id": "7483", + "response": { + "$ref": "6444" + }, + "statusCode": 201, + "bodyValue": { + "$id": "7484", + "kind": "model", + "type": { + "$ref": "748" + }, + "value": { + "$id": "7485", + "properties": { + "$id": "7486", + "kind": "model", + "type": { + "$ref": "750" + }, + "value": { + "$id": "7487", + "mode": { + "$id": "7488", + "kind": "string", + "type": { + "$ref": "62" + }, + "value": "Enabled" + }, + "operations": { + "$id": "7489", + "kind": "array", + "type": { + "$ref": "755" + }, + "value": [ + { + "$id": "7490", + "kind": "model", + "type": { + "$ref": "756" + }, + "value": { + "$id": "7491", + "operationType": { + "$id": "7492", + "kind": "string", + "type": { + "$ref": "164" + }, + "value": "Source" + }, + "name": { + "$id": "7493", + "kind": "string", + "type": { + "$ref": "761" + }, + "value": "source1" + }, + "sourceSettings": { + "$id": "7494", + "kind": "model", + "type": { + "$ref": "765" + }, + "value": { + "$id": "7495", + "endpointRef": { + "$id": "7496", + "kind": "string", + "type": { + "$ref": "767" + }, + "value": "aio-builtin-broker-endpoint" + }, + "dataSources": { + "$id": "7497", + "kind": "array", + "type": { + "$ref": "782" + }, + "value": [ + { + "$id": "7498", + "kind": "string", + "type": { + "$ref": "783" + }, + "value": "azure-iot-operations/data/thermostat" + } + ] + } + } + } + } + }, + { + "$id": "7499", + "kind": "model", + "type": { + "$ref": "756" + }, + "value": { + "$id": "7500", + "operationType": { + "$id": "7501", + "kind": "string", + "type": { + "$ref": "164" + }, + "value": "BuiltInTransformation" + }, + "builtInTransformationSettings": { + "$id": "7502", + "kind": "model", + "type": { + "$ref": "790" + }, + "value": { + "$id": "7503", + "serializationFormat": { + "$id": "7504", + "kind": "string", + "type": { + "$ref": "176" + }, + "value": "Parquet" + }, + "schemaRef": { + "$id": "7505", + "kind": "string", + "type": { + "$ref": "795" + }, + "value": "aio-sr://exampleNamespace/exmapleParquetSchema:1.0.0" + } + } + } + } + }, + { + "$id": "7506", + "kind": "model", + "type": { + "$ref": "756" + }, + "value": { + "$id": "7507", + "operationType": { + "$id": "7508", + "kind": "string", + "type": { + "$ref": "164" + }, + "value": "Destination" + }, + "name": { + "$id": "7509", + "kind": "string", + "type": { + "$ref": "761" + }, + "value": "destination1" + }, + "destinationSettings": { + "$id": "7510", + "kind": "model", + "type": { + "$ref": "873" + }, + "value": { + "$id": "7511", + "endpointRef": { + "$id": "7512", + "kind": "string", + "type": { + "$ref": "875" + }, + "value": "fabric-endpoint" + }, + "dataDestination": { + "$id": "7513", + "kind": "string", + "type": { + "$ref": "879" + }, + "value": "telemetryTable" + } + } + } + } + } + ] + }, + "provisioningState": { + "$id": "7514", + "kind": "string", + "type": { + "$ref": "126" + }, + "value": "Succeeded" + } + } + }, + "extendedLocation": { + "$id": "7515", + "kind": "model", + "type": { + "$ref": "669" + }, + "value": { + "$id": "7516", + "name": { + "$id": "7517", + "kind": "string", + "type": { + "$ref": "671" + }, + "value": "qmbrfwcpwwhggszhrdjv" + }, + "type": { + "$id": "7518", + "kind": "string", + "type": { + "$ref": "142" + }, + "value": "CustomLocation" + } + } + }, + "id": { + "$id": "7519", + "kind": "string", + "type": { + "$ref": "330" + }, + "value": "/subscriptions/0000000-0000-0000-0000-000000000000/resourceGroups/resourceGroup123/providers/Microsoft.IoTOperations/instances/resource-name123/dataflowProfiles/resource-name123/dataflows/resource-name123" + }, + "name": { + "$id": "7520", + "kind": "string", + "type": { + "$ref": "335" + }, + "value": "jxhcpwgfkxqasbexkookvxk" + }, + "type": { + "$id": "7521", + "kind": "string", + "type": { + "$ref": "339" + }, + "value": "zkuozvgjseokfchkscoswthzjdry" + }, + "systemData": { + "$id": "7522", + "kind": "model", + "type": { + "$ref": "344" + }, + "value": { + "$id": "7523", + "createdBy": { + "$id": "7524", + "kind": "string", + "type": { + "$ref": "346" + }, + "value": "ssvaslsmudloholronopqyxjcu" + }, + "createdByType": { + "$id": "7525", + "kind": "string", + "type": { + "$ref": "146" + }, + "value": "User" + }, + "createdAt": { + "$id": "7526", + "kind": "string", + "type": { + "$ref": "353" + }, + "value": "2024-08-09T18:13:29.389Z" + }, + "lastModifiedBy": { + "$id": "7527", + "kind": "string", + "type": { + "$ref": "358" + }, + "value": "gnicpuszwd" + }, + "lastModifiedByType": { + "$id": "7528", + "kind": "string", + "type": { + "$ref": "146" + }, + "value": "User" + }, + "lastModifiedAt": { + "$id": "7529", + "kind": "string", + "type": { + "$ref": "365" + }, + "value": "2024-08-09T18:13:29.389Z" + } + } + } + } + } + } + ] + } + ] + }, + { + "$id": "7530", + "Name": "delete", + "ResourceName": "DataflowResource", + "Doc": "Delete a DataflowResource", + "Accessibility": "public", + "Parameters": [ + { + "$id": "7531", + "Name": "apiVersion", + "NameInRequest": "api-version", + "Doc": "The API version to use for this operation.", + "Type": { + "$id": "7532", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": true, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "DefaultValue": { + "$id": "7533", + "Type": { + "$id": "7534", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "2024-11-01" + }, + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "7535", + "Name": "subscriptionId", + "NameInRequest": "subscriptionId", + "Doc": "The ID of the target subscription. The value must be an UUID.", + "Type": { + "$id": "7536", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "7537", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "7538", + "Name": "resourceGroupName", + "NameInRequest": "resourceGroupName", + "Doc": "The name of the resource group. The name is case insensitive.", + "Type": { + "$id": "7539", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "7540", + "Name": "instanceName", + "NameInRequest": "instanceName", + "Doc": "Name of instance.", + "Type": { + "$id": "7541", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "7542", + "Name": "dataflowProfileName", + "NameInRequest": "dataflowProfileName", + "Doc": "Name of Instance dataflowProfile resource", + "Type": { + "$id": "7543", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "7544", + "Name": "dataflowName", + "NameInRequest": "dataflowName", + "Doc": "Name of Instance dataflowProfile dataflow resource", + "Type": { + "$id": "7545", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "7546", + "Name": "accept", + "NameInRequest": "Accept", + "Type": { + "$id": "7547", + "kind": "constant", + "valueType": { + "$id": "7548", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "7549", + "StatusCodes": [ + 202 + ], + "BodyMediaType": "Json", + "Headers": [ + { + "$id": "7550", + "Name": "location", + "NameInResponse": "Location", + "Doc": "The Location header contains the URL where the status of the long running operation can be checked.", + "Type": { + "$id": "7551", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + } + }, + { + "$id": "7552", + "Name": "retryAfter", + "NameInResponse": "Retry-After", + "Doc": "The Retry-After header can indicate how long the client should wait before polling the operation status.", + "Type": { + "$id": "7553", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + } + } + ], + "IsErrorResponse": false + }, + { + "$id": "7554", + "StatusCodes": [ + 204 + ], + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false + } + ], + "HttpMethod": "DELETE", + "RequestBodyMediaType": "None", + "Uri": "{endpoint}", + "Path": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/dataflowProfiles/{dataflowProfileName}/dataflows/{dataflowName}", + "BufferResponse": true, + "LongRunning": { + "$id": "7555", + "FinalStateVia": 1, + "FinalResponse": { + "$id": "7556", + "StatusCodes": [ + 204 + ], + "BodyMediaType": "Json" + } + }, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Microsoft.IoTOperations.Dataflow.delete", + "Decorators": [], + "Examples": [ + { + "$id": "7557", + "kind": "http", + "name": "Dataflow_Delete", + "description": "Dataflow_Delete", + "filePath": "2024-11-01/Dataflow_Delete_MaximumSet_Gen.json", + "parameters": [ + { + "$id": "7558", + "parameter": { + "$ref": "7531" + }, + "value": { + "$id": "7559", + "kind": "string", + "type": { + "$ref": "7532" + }, + "value": "2024-11-01" + } + }, + { + "$id": "7560", + "parameter": { + "$ref": "7535" + }, + "value": { + "$id": "7561", + "kind": "string", + "type": { + "$ref": "7536" + }, + "value": "F8C729F9-DF9C-4743-848F-96EE433D8E53" + } + }, + { + "$id": "7562", + "parameter": { + "$ref": "7538" + }, + "value": { + "$id": "7563", + "kind": "string", + "type": { + "$ref": "7539" + }, + "value": "rgiotoperations" + } + }, + { + "$id": "7564", + "parameter": { + "$ref": "7540" + }, + "value": { + "$id": "7565", + "kind": "string", + "type": { + "$ref": "7541" + }, + "value": "resource-name123" + } + }, + { + "$id": "7566", + "parameter": { + "$ref": "7542" + }, + "value": { + "$id": "7567", + "kind": "string", + "type": { + "$ref": "7543" + }, + "value": "resource-name123" + } + }, + { + "$id": "7568", + "parameter": { + "$ref": "7544" + }, + "value": { + "$id": "7569", + "kind": "string", + "type": { + "$ref": "7545" + }, + "value": "resource-name123" + } + } + ], + "responses": [ + { + "$id": "7570", + "response": { + "$ref": "7549" + }, + "statusCode": 202 + }, + { + "$id": "7571", + "response": { + "$ref": "7554" + }, + "statusCode": 204 + } + ] + } + ] + }, + { + "$id": "7572", + "Name": "listByResourceGroup", + "ResourceName": "DataflowResource", + "Doc": "List DataflowResource resources by DataflowProfileResource", + "Accessibility": "public", + "Parameters": [ + { + "$id": "7573", + "Name": "apiVersion", + "NameInRequest": "api-version", + "Doc": "The API version to use for this operation.", + "Type": { + "$id": "7574", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": true, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "DefaultValue": { + "$id": "7575", + "Type": { + "$id": "7576", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "2024-11-01" + }, + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "7577", + "Name": "subscriptionId", + "NameInRequest": "subscriptionId", + "Doc": "The ID of the target subscription. The value must be an UUID.", + "Type": { + "$id": "7578", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "7579", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "7580", + "Name": "resourceGroupName", + "NameInRequest": "resourceGroupName", + "Doc": "The name of the resource group. The name is case insensitive.", + "Type": { + "$id": "7581", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "7582", + "Name": "instanceName", + "NameInRequest": "instanceName", + "Doc": "Name of instance.", + "Type": { + "$id": "7583", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "7584", + "Name": "dataflowProfileName", + "NameInRequest": "dataflowProfileName", + "Doc": "Name of Instance dataflowProfile resource", + "Type": { + "$id": "7585", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "7586", + "Name": "accept", + "NameInRequest": "Accept", + "Type": { + "$id": "7587", + "kind": "constant", + "valueType": { + "$id": "7588", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "7589", + "StatusCodes": [ + 200 + ], + "BodyType": { + "$ref": "895" + }, + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false, + "ContentTypes": [ + "application/json" + ] + } + ], + "HttpMethod": "GET", + "RequestBodyMediaType": "None", + "Uri": "{endpoint}", + "Path": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/dataflowProfiles/{dataflowProfileName}/dataflows", + "BufferResponse": true, + "Paging": { + "$id": "7590", + "ItemName": "value", + "NextLinkName": "nextLink" + }, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Microsoft.IoTOperations.Dataflow.listByResourceGroup", + "Decorators": [], + "Examples": [ + { + "$id": "7591", + "kind": "http", + "name": "Dataflow_ListByProfileResource", + "description": "Dataflow_ListByProfileResource", + "filePath": "2024-11-01/Dataflow_ListByProfileResource_MaximumSet_Gen.json", + "parameters": [ + { + "$id": "7592", + "parameter": { + "$ref": "7573" + }, + "value": { + "$id": "7593", + "kind": "string", + "type": { + "$ref": "7574" + }, + "value": "2024-11-01" + } + }, + { + "$id": "7594", + "parameter": { + "$ref": "7577" + }, + "value": { + "$id": "7595", + "kind": "string", + "type": { + "$ref": "7578" + }, + "value": "F8C729F9-DF9C-4743-848F-96EE433D8E53" + } + }, + { + "$id": "7596", + "parameter": { + "$ref": "7580" + }, + "value": { + "$id": "7597", + "kind": "string", + "type": { + "$ref": "7581" + }, + "value": "rgiotoperations" + } + }, + { + "$id": "7598", + "parameter": { + "$ref": "7582" + }, + "value": { + "$id": "7599", + "kind": "string", + "type": { + "$ref": "7583" + }, + "value": "resource-name123" + } + }, + { + "$id": "7600", + "parameter": { + "$ref": "7584" + }, + "value": { + "$id": "7601", + "kind": "string", + "type": { + "$ref": "7585" + }, + "value": "resource-name123" + } + } + ], + "responses": [ + { + "$id": "7602", + "response": { + "$ref": "7589" + }, + "statusCode": 200, + "bodyValue": { + "$id": "7603", + "kind": "model", + "type": { + "$ref": "895" + }, + "value": { + "$id": "7604", + "value": { + "$id": "7605", + "kind": "array", + "type": { + "$ref": "897" + }, + "value": [ + { + "$id": "7606", + "kind": "model", + "type": { + "$ref": "748" + }, + "value": { + "$id": "7607", + "properties": { + "$id": "7608", + "kind": "model", + "type": { + "$ref": "750" + }, + "value": { + "$id": "7609", + "mode": { + "$id": "7610", + "kind": "string", + "type": { + "$ref": "62" + }, + "value": "Enabled" + }, + "operations": { + "$id": "7611", + "kind": "array", + "type": { + "$ref": "755" + }, + "value": [ + { + "$id": "7612", + "kind": "model", + "type": { + "$ref": "756" + }, + "value": { + "$id": "7613", + "operationType": { + "$id": "7614", + "kind": "string", + "type": { + "$ref": "164" + }, + "value": "Source" + }, + "name": { + "$id": "7615", + "kind": "string", + "type": { + "$ref": "761" + }, + "value": "knnafvkwoeakm" + }, + "sourceSettings": { + "$id": "7616", + "kind": "model", + "type": { + "$ref": "765" + }, + "value": { + "$id": "7617", + "endpointRef": { + "$id": "7618", + "kind": "string", + "type": { + "$ref": "767" + }, + "value": "iixotodhvhkkfcfyrkoveslqig" + }, + "assetRef": { + "$id": "7619", + "kind": "string", + "type": { + "$ref": "771" + }, + "value": "zayyykwmckaocywdkohmu" + }, + "serializationFormat": { + "$id": "7620", + "kind": "string", + "type": { + "$ref": "172" + }, + "value": "Json" + }, + "schemaRef": { + "$id": "7621", + "kind": "string", + "type": { + "$ref": "778" + }, + "value": "pknmdzqll" + }, + "dataSources": { + "$id": "7622", + "kind": "array", + "type": { + "$ref": "782" + }, + "value": [ + { + "$id": "7623", + "kind": "string", + "type": { + "$ref": "783" + }, + "value": "chkkpymxhp" + } + ] + } + } + }, + "builtInTransformationSettings": { + "$id": "7624", + "kind": "model", + "type": { + "$ref": "790" + }, + "value": { + "$id": "7625", + "serializationFormat": { + "$id": "7626", + "kind": "string", + "type": { + "$ref": "176" + }, + "value": "Delta" + }, + "schemaRef": { + "$id": "7627", + "kind": "string", + "type": { + "$ref": "795" + }, + "value": "mcdc" + }, + "datasets": { + "$id": "7628", + "kind": "array", + "type": { + "$ref": "799" + }, + "value": [ + { + "$id": "7629", + "kind": "model", + "type": { + "$ref": "800" + }, + "value": { + "$id": "7630", + "key": { + "$id": "7631", + "kind": "string", + "type": { + "$ref": "802" + }, + "value": "qsfqcgxaxnhfumrsdsokwyv" + }, + "description": { + "$id": "7632", + "kind": "string", + "type": { + "$ref": "806" + }, + "value": "Lorem ipsum odor amet, consectetuer adipiscing elit." + }, + "schemaRef": { + "$id": "7633", + "kind": "string", + "type": { + "$ref": "810" + }, + "value": "n" + }, + "inputs": { + "$id": "7634", + "kind": "array", + "type": { + "$ref": "814" + }, + "value": [ + { + "$id": "7635", + "kind": "string", + "type": { + "$ref": "815" + }, + "value": "mosffpsslifkq" + } + ] + }, + "expression": { + "$id": "7636", + "kind": "string", + "type": { + "$ref": "819" + }, + "value": "aatbwomvflemsxialv" + } + } + } + ] + }, + "filter": { + "$id": "7637", + "kind": "array", + "type": { + "$ref": "825" + }, + "value": [ + { + "$id": "7638", + "kind": "model", + "type": { + "$ref": "826" + }, + "value": { + "$id": "7639", + "type": { + "$id": "7640", + "kind": "string", + "type": { + "$ref": "184" + }, + "value": "Filter" + }, + "description": { + "$id": "7641", + "kind": "string", + "type": { + "$ref": "831" + }, + "value": "Lorem ipsum odor amet, consectetuer adipiscing elit." + }, + "inputs": { + "$id": "7642", + "kind": "array", + "type": { + "$ref": "835" + }, + "value": [ + { + "$id": "7643", + "kind": "string", + "type": { + "$ref": "836" + }, + "value": "sxmjkbntgb" + } + ] + }, + "expression": { + "$id": "7644", + "kind": "string", + "type": { + "$ref": "840" + }, + "value": "n" + } + } + } + ] + }, + "map": { + "$id": "7645", + "kind": "array", + "type": { + "$ref": "846" + }, + "value": [ + { + "$id": "7646", + "kind": "model", + "type": { + "$ref": "847" + }, + "value": { + "$id": "7647", + "type": { + "$id": "7648", + "kind": "string", + "type": { + "$ref": "188" + }, + "value": "NewProperties" + }, + "description": { + "$id": "7649", + "kind": "string", + "type": { + "$ref": "852" + }, + "value": "Lorem ipsum odor amet, consectetuer adipiscing elit." + }, + "inputs": { + "$id": "7650", + "kind": "array", + "type": { + "$ref": "856" + }, + "value": [ + { + "$id": "7651", + "kind": "string", + "type": { + "$ref": "857" + }, + "value": "xsbxuk" + } + ] + }, + "expression": { + "$id": "7652", + "kind": "string", + "type": { + "$ref": "861" + }, + "value": "txoiltogsarwkzalsphvlmt" + }, + "output": { + "$id": "7653", + "kind": "string", + "type": { + "$ref": "865" + }, + "value": "nvgtmkfl" + } + } + } + ] + } + } + }, + "destinationSettings": { + "$id": "7654", + "kind": "model", + "type": { + "$ref": "873" + }, + "value": { + "$id": "7655", + "endpointRef": { + "$id": "7656", + "kind": "string", + "type": { + "$ref": "875" + }, + "value": "kybkchnzimerguekuvqlqiqdvvrt" + }, + "dataDestination": { + "$id": "7657", + "kind": "string", + "type": { + "$ref": "879" + }, + "value": "cbrh" + } + } + } + } + } + ] + }, + "provisioningState": { + "$id": "7658", + "kind": "string", + "type": { + "$ref": "126" + }, + "value": "Succeeded" + } + } + }, + "extendedLocation": { + "$id": "7659", + "kind": "model", + "type": { + "$ref": "669" + }, + "value": { + "$id": "7660", + "name": { + "$id": "7661", + "kind": "string", + "type": { + "$ref": "671" + }, + "value": "qmbrfwcpwwhggszhrdjv" + }, + "type": { + "$id": "7662", + "kind": "string", + "type": { + "$ref": "142" + }, + "value": "CustomLocation" + } + } + }, + "id": { + "$id": "7663", + "kind": "string", + "type": { + "$ref": "330" + }, + "value": "/subscriptions/0000000-0000-0000-0000-000000000000/resourceGroups/resourceGroup123/providers/Microsoft.IoTOperations/instances/resource-name123/dataflowProfiles/resource-name123/dataflows/resource-name123" + }, + "name": { + "$id": "7664", + "kind": "string", + "type": { + "$ref": "335" + }, + "value": "jxhcpwgfkxqasbexkookvxk" + }, + "type": { + "$id": "7665", + "kind": "string", + "type": { + "$ref": "339" + }, + "value": "zkuozvgjseokfchkscoswthzjdry" + }, + "systemData": { + "$id": "7666", + "kind": "model", + "type": { + "$ref": "344" + }, + "value": { + "$id": "7667", + "createdBy": { + "$id": "7668", + "kind": "string", + "type": { + "$ref": "346" + }, + "value": "ssvaslsmudloholronopqyxjcu" + }, + "createdByType": { + "$id": "7669", + "kind": "string", + "type": { + "$ref": "146" + }, + "value": "User" + }, + "createdAt": { + "$id": "7670", + "kind": "string", + "type": { + "$ref": "353" + }, + "value": "2024-08-09T18:13:29.389Z" + }, + "lastModifiedBy": { + "$id": "7671", + "kind": "string", + "type": { + "$ref": "358" + }, + "value": "gnicpuszwd" + }, + "lastModifiedByType": { + "$id": "7672", + "kind": "string", + "type": { + "$ref": "146" + }, + "value": "User" + }, + "lastModifiedAt": { + "$id": "7673", + "kind": "string", + "type": { + "$ref": "365" + }, + "value": "2024-08-09T18:13:29.389Z" + } + } + } + } + } + ] + }, + "nextLink": { + "$id": "7674", + "kind": "string", + "type": { + "$ref": "901" + }, + "value": "https://microsoft.com/a" + } + } + } + } + ] + } + ] + } + ], + "Protocol": { + "$id": "7675" + }, + "Parent": "IoTOperationsClient", + "Parameters": [ + { + "$id": "7676", + "Name": "endpoint", + "NameInRequest": "endpoint", + "Doc": "Service host", + "Type": { + "$id": "7677", + "kind": "url", + "name": "url", + "crossLanguageDefinitionId": "TypeSpec.url" + }, + "Location": "Uri", + "IsApiVersion": false, + "IsResourceParameter": false, + "IsContentType": false, + "IsRequired": true, + "IsEndpoint": true, + "SkipUrlEncoding": false, + "Explode": false, + "Kind": "Client", + "DefaultValue": { + "$id": "7678", + "Type": { + "$id": "7679", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "https://management.azure.com" + } + } + ], + "Decorators": [] + }, + { + "$id": "7680", + "Name": "DataflowEndpoint", + "ClientNamespace": "Microsoft.IoTOperations", + "Operations": [ + { + "$id": "7681", + "Name": "get", + "ResourceName": "DataflowEndpointResource", + "Doc": "Get a DataflowEndpointResource", + "Accessibility": "public", + "Parameters": [ + { + "$id": "7682", + "Name": "apiVersion", + "NameInRequest": "api-version", + "Doc": "The API version to use for this operation.", + "Type": { + "$id": "7683", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": true, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "DefaultValue": { + "$id": "7684", + "Type": { + "$id": "7685", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "2024-11-01" + }, + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "7686", + "Name": "subscriptionId", + "NameInRequest": "subscriptionId", + "Doc": "The ID of the target subscription. The value must be an UUID.", + "Type": { + "$id": "7687", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "7688", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "7689", + "Name": "resourceGroupName", + "NameInRequest": "resourceGroupName", + "Doc": "The name of the resource group. The name is case insensitive.", + "Type": { + "$id": "7690", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "7691", + "Name": "instanceName", + "NameInRequest": "instanceName", + "Doc": "Name of instance.", + "Type": { + "$id": "7692", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "7693", + "Name": "dataflowEndpointName", + "NameInRequest": "dataflowEndpointName", + "Doc": "Name of Instance dataflowEndpoint resource", + "Type": { + "$id": "7694", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "7695", + "Name": "accept", + "NameInRequest": "Accept", + "Type": { + "$id": "7696", + "kind": "constant", + "valueType": { + "$id": "7697", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "7698", + "StatusCodes": [ + 200 + ], + "BodyType": { + "$ref": "326" + }, + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false, + "ContentTypes": [ + "application/json" + ] + } + ], + "HttpMethod": "GET", + "RequestBodyMediaType": "None", + "Uri": "{endpoint}", + "Path": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/dataflowEndpoints/{dataflowEndpointName}", + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Microsoft.IoTOperations.DataflowEndpoint.get", + "Decorators": [], + "Examples": [ + { + "$id": "7699", + "kind": "http", + "name": "DataflowEndpoint_Get", + "description": "DataflowEndpoint_Get", + "filePath": "2024-11-01/DataflowEndpoint_Get_MaximumSet_Gen.json", + "parameters": [ + { + "$id": "7700", + "parameter": { + "$ref": "7682" + }, + "value": { + "$id": "7701", + "kind": "string", + "type": { + "$ref": "7683" + }, + "value": "2024-11-01" + } + }, + { + "$id": "7702", + "parameter": { + "$ref": "7686" + }, + "value": { + "$id": "7703", + "kind": "string", + "type": { + "$ref": "7687" + }, + "value": "F8C729F9-DF9C-4743-848F-96EE433D8E53" + } + }, + { + "$id": "7704", + "parameter": { + "$ref": "7689" + }, + "value": { + "$id": "7705", + "kind": "string", + "type": { + "$ref": "7690" + }, + "value": "rgiotoperations" + } + }, + { + "$id": "7706", + "parameter": { + "$ref": "7691" + }, + "value": { + "$id": "7707", + "kind": "string", + "type": { + "$ref": "7692" + }, + "value": "resource-name123" + } + }, + { + "$id": "7708", + "parameter": { + "$ref": "7693" + }, + "value": { + "$id": "7709", + "kind": "string", + "type": { + "$ref": "7694" + }, + "value": "resource-name123" + } + } + ], + "responses": [ + { + "$id": "7710", + "response": { + "$ref": "7698" + }, + "statusCode": 200, + "bodyValue": { + "$id": "7711", + "kind": "model", + "type": { + "$ref": "326" + }, + "value": { + "$id": "7712", + "properties": { + "$id": "7713", + "kind": "model", + "type": { + "$ref": "372" + }, + "value": { + "$id": "7714", + "endpointType": { + "$id": "7715", + "kind": "string", + "type": { + "$ref": "2" + }, + "value": "DataExplorer" + }, + "dataExplorerSettings": { + "$id": "7716", + "kind": "model", + "type": { + "$ref": "377" + }, + "value": { + "$id": "7717", + "authentication": { + "$id": "7718", + "kind": "model", + "type": { + "$ref": "379" + }, + "value": { + "$id": "7719", + "method": { + "$id": "7720", + "kind": "string", + "type": { + "$ref": "16" + }, + "value": "SystemAssignedManagedIdentity" + }, + "systemAssignedManagedIdentitySettings": { + "$id": "7721", + "kind": "model", + "type": { + "$ref": "384" + }, + "value": { + "$id": "7722", + "audience": { + "$id": "7723", + "kind": "string", + "type": { + "$ref": "386" + }, + "value": "psxomrfbhoflycm" + } + } + }, + "userAssignedManagedIdentitySettings": { + "$id": "7724", + "kind": "model", + "type": { + "$ref": "392" + }, + "value": { + "$id": "7725", + "clientId": { + "$id": "7726", + "kind": "string", + "type": { + "$ref": "394" + }, + "value": "fb90f267-8872-431a-a76a-a1cec5d3c4d2" + }, + "scope": { + "$id": "7727", + "kind": "string", + "type": { + "$ref": "398" + }, + "value": "zop" + }, + "tenantId": { + "$id": "7728", + "kind": "string", + "type": { + "$ref": "402" + }, + "value": "ed060aa2-71ff-4d3f-99c4-a9138356fdec" + } + } + } + } + }, + "database": { + "$id": "7729", + "kind": "string", + "type": { + "$ref": "410" + }, + "value": "yqcdpjsifm" + }, + "host": { + "$id": "7730", + "kind": "string", + "type": { + "$ref": "414" + }, + "value": "..kusto.windows.net" + }, + "batching": { + "$id": "7731", + "kind": "model", + "type": { + "$ref": "418" + }, + "value": { + "$id": "7732", + "latencySeconds": { + "$id": "7733", + "kind": "number", + "type": { + "$ref": "420" + }, + "value": 1228 + }, + "maxMessages": { + "$id": "7734", + "kind": "number", + "type": { + "$ref": "424" + }, + "value": 171 + } + } + } + } + }, + "dataLakeStorageSettings": { + "$id": "7735", + "kind": "model", + "type": { + "$ref": "432" + }, + "value": { + "$id": "7736", + "authentication": { + "$id": "7737", + "kind": "model", + "type": { + "$ref": "434" + }, + "value": { + "$id": "7738", + "method": { + "$id": "7739", + "kind": "string", + "type": { + "$ref": "22" + }, + "value": "SystemAssignedManagedIdentity" + }, + "accessTokenSettings": { + "$id": "7740", + "kind": "model", + "type": { + "$ref": "439" + }, + "value": { + "$id": "7741", + "secretRef": { + "$id": "7742", + "kind": "string", + "type": { + "$ref": "441" + }, + "value": "sevriyphcvnlrnfudqzejecwa" + } + } + }, + "systemAssignedManagedIdentitySettings": { + "$id": "7743", + "kind": "model", + "type": { + "$ref": "384" + }, + "value": { + "$id": "7744", + "audience": { + "$id": "7745", + "kind": "string", + "type": { + "$ref": "386" + }, + "value": "psxomrfbhoflycm" + } + } + }, + "userAssignedManagedIdentitySettings": { + "$id": "7746", + "kind": "model", + "type": { + "$ref": "392" + }, + "value": { + "$id": "7747", + "clientId": { + "$id": "7748", + "kind": "string", + "type": { + "$ref": "394" + }, + "value": "fb90f267-8872-431a-a76a-a1cec5d3c4d2" + }, + "scope": { + "$id": "7749", + "kind": "string", + "type": { + "$ref": "398" + }, + "value": "zop" + }, + "tenantId": { + "$id": "7750", + "kind": "string", + "type": { + "$ref": "402" + }, + "value": "ed060aa2-71ff-4d3f-99c4-a9138356fdec" + } + } + } + } + }, + "host": { + "$id": "7751", + "kind": "string", + "type": { + "$ref": "455" + }, + "value": ".blob.core.windows.net" + }, + "batching": { + "$id": "7752", + "kind": "model", + "type": { + "$ref": "418" + }, + "value": { + "$id": "7753", + "latencySeconds": { + "$id": "7754", + "kind": "number", + "type": { + "$ref": "420" + }, + "value": 1228 + }, + "maxMessages": { + "$id": "7755", + "kind": "number", + "type": { + "$ref": "424" + }, + "value": 171 + } + } + } + } + }, + "fabricOneLakeSettings": { + "$id": "7756", + "kind": "model", + "type": { + "$ref": "464" + }, + "value": { + "$id": "7757", + "authentication": { + "$id": "7758", + "kind": "model", + "type": { + "$ref": "466" + }, + "value": { + "$id": "7759", + "method": { + "$id": "7760", + "kind": "string", + "type": { + "$ref": "30" + }, + "value": "SystemAssignedManagedIdentity" + }, + "systemAssignedManagedIdentitySettings": { + "$id": "7761", + "kind": "model", + "type": { + "$ref": "384" + }, + "value": { + "$id": "7762", + "audience": { + "$id": "7763", + "kind": "string", + "type": { + "$ref": "386" + }, + "value": "psxomrfbhoflycm" + } + } + }, + "userAssignedManagedIdentitySettings": { + "$id": "7764", + "kind": "model", + "type": { + "$ref": "392" + }, + "value": { + "$id": "7765", + "clientId": { + "$id": "7766", + "kind": "string", + "type": { + "$ref": "394" + }, + "value": "fb90f267-8872-431a-a76a-a1cec5d3c4d2" + }, + "scope": { + "$id": "7767", + "kind": "string", + "type": { + "$ref": "398" + }, + "value": "zop" + }, + "tenantId": { + "$id": "7768", + "kind": "string", + "type": { + "$ref": "402" + }, + "value": "ed060aa2-71ff-4d3f-99c4-a9138356fdec" + } + } + } + } + }, + "names": { + "$id": "7769", + "kind": "model", + "type": { + "$ref": "479" + }, + "value": { + "$id": "7770", + "lakehouseName": { + "$id": "7771", + "kind": "string", + "type": { + "$ref": "481" + }, + "value": "wpeathi" + }, + "workspaceName": { + "$id": "7772", + "kind": "string", + "type": { + "$ref": "485" + }, + "value": "nwgmitkbljztgms" + } + } + }, + "oneLakePathType": { + "$id": "7773", + "kind": "string", + "type": { + "$ref": "36" + }, + "value": "Files" + }, + "host": { + "$id": "7774", + "kind": "string", + "type": { + "$ref": "494" + }, + "value": "https://.fabric.microsoft.com" + }, + "batching": { + "$id": "7775", + "kind": "model", + "type": { + "$ref": "418" + }, + "value": { + "$id": "7776", + "latencySeconds": { + "$id": "7777", + "kind": "number", + "type": { + "$ref": "420" + }, + "value": 1228 + }, + "maxMessages": { + "$id": "7778", + "kind": "number", + "type": { + "$ref": "424" + }, + "value": 171 + } + } + } + } + }, + "kafkaSettings": { + "$id": "7779", + "kind": "model", + "type": { + "$ref": "503" + }, + "value": { + "$id": "7780", + "authentication": { + "$id": "7781", + "kind": "model", + "type": { + "$ref": "505" + }, + "value": { + "$id": "7782", + "method": { + "$id": "7783", + "kind": "string", + "type": { + "$ref": "42" + }, + "value": "SystemAssignedManagedIdentity" + }, + "systemAssignedManagedIdentitySettings": { + "$id": "7784", + "kind": "model", + "type": { + "$ref": "384" + }, + "value": { + "$id": "7785", + "audience": { + "$id": "7786", + "kind": "string", + "type": { + "$ref": "386" + }, + "value": "psxomrfbhoflycm" + } + } + }, + "userAssignedManagedIdentitySettings": { + "$id": "7787", + "kind": "model", + "type": { + "$ref": "392" + }, + "value": { + "$id": "7788", + "clientId": { + "$id": "7789", + "kind": "string", + "type": { + "$ref": "394" + }, + "value": "fb90f267-8872-431a-a76a-a1cec5d3c4d2" + }, + "scope": { + "$id": "7790", + "kind": "string", + "type": { + "$ref": "398" + }, + "value": "zop" + }, + "tenantId": { + "$id": "7791", + "kind": "string", + "type": { + "$ref": "402" + }, + "value": "ed060aa2-71ff-4d3f-99c4-a9138356fdec" + } + } + }, + "saslSettings": { + "$id": "7792", + "kind": "model", + "type": { + "$ref": "516" + }, + "value": { + "$id": "7793", + "saslType": { + "$id": "7794", + "kind": "string", + "type": { + "$ref": "54" + }, + "value": "Plain" + }, + "secretRef": { + "$id": "7795", + "kind": "string", + "type": { + "$ref": "521" + }, + "value": "visyxoztqnylvbyokhtmpdkwes" + } + } + }, + "x509CertificateSettings": { + "$id": "7796", + "kind": "model", + "type": { + "$ref": "527" + }, + "value": { + "$id": "7797", + "secretRef": { + "$id": "7798", + "kind": "string", + "type": { + "$ref": "529" + }, + "value": "afwizrystfslkfqd" + } + } + } + } + }, + "consumerGroupId": { + "$id": "7799", + "kind": "string", + "type": { + "$ref": "537" + }, + "value": "ukkzcjiyenhxokat" + }, + "host": { + "$id": "7800", + "kind": "string", + "type": { + "$ref": "541" + }, + "value": "pwcqfiqclcgneolpewnyavoulbip" + }, + "batching": { + "$id": "7801", + "kind": "model", + "type": { + "$ref": "545" + }, + "value": { + "$id": "7802", + "mode": { + "$id": "7803", + "kind": "string", + "type": { + "$ref": "62" + }, + "value": "Enabled" + }, + "latencyMs": { + "$id": "7804", + "kind": "number", + "type": { + "$ref": "550" + }, + "value": 3679 + }, + "maxBytes": { + "$id": "7805", + "kind": "number", + "type": { + "$ref": "554" + }, + "value": 8887 + }, + "maxMessages": { + "$id": "7806", + "kind": "number", + "type": { + "$ref": "558" + }, + "value": 2174 + } + } + }, + "copyMqttProperties": { + "$id": "7807", + "kind": "string", + "type": { + "$ref": "62" + }, + "value": "Enabled" + }, + "compression": { + "$id": "7808", + "kind": "string", + "type": { + "$ref": "68" + }, + "value": "None" + }, + "kafkaAcks": { + "$id": "7809", + "kind": "string", + "type": { + "$ref": "78" + }, + "value": "Zero" + }, + "partitionStrategy": { + "$id": "7810", + "kind": "string", + "type": { + "$ref": "86" + }, + "value": "Default" + }, + "tls": { + "$id": "7811", + "kind": "model", + "type": { + "$ref": "576" + }, + "value": { + "$id": "7812", + "mode": { + "$id": "7813", + "kind": "string", + "type": { + "$ref": "62" + }, + "value": "Enabled" + }, + "trustedCaCertificateConfigMapRef": { + "$id": "7814", + "kind": "string", + "type": { + "$ref": "581" + }, + "value": "tectjjvukvelsreihwadh" + } + } + } + } + }, + "localStorageSettings": { + "$id": "7815", + "kind": "model", + "type": { + "$ref": "592" + }, + "value": { + "$id": "7816", + "persistentVolumeClaimRef": { + "$id": "7817", + "kind": "string", + "type": { + "$ref": "594" + }, + "value": "jjwqwvd" + } + } + }, + "mqttSettings": { + "$id": "7818", + "kind": "model", + "type": { + "$ref": "600" + }, + "value": { + "$id": "7819", + "authentication": { + "$id": "7820", + "kind": "model", + "type": { + "$ref": "602" + }, + "value": { + "$id": "7821", + "method": { + "$id": "7822", + "kind": "string", + "type": { + "$ref": "102" + }, + "value": "SystemAssignedManagedIdentity" + }, + "systemAssignedManagedIdentitySettings": { + "$id": "7823", + "kind": "model", + "type": { + "$ref": "384" + }, + "value": { + "$id": "7824", + "audience": { + "$id": "7825", + "kind": "string", + "type": { + "$ref": "386" + }, + "value": "psxomrfbhoflycm" + } + } + }, + "userAssignedManagedIdentitySettings": { + "$id": "7826", + "kind": "model", + "type": { + "$ref": "392" + }, + "value": { + "$id": "7827", + "clientId": { + "$id": "7828", + "kind": "string", + "type": { + "$ref": "394" + }, + "value": "fb90f267-8872-431a-a76a-a1cec5d3c4d2" + }, + "scope": { + "$id": "7829", + "kind": "string", + "type": { + "$ref": "398" + }, + "value": "zop" + }, + "tenantId": { + "$id": "7830", + "kind": "string", + "type": { + "$ref": "402" + }, + "value": "ed060aa2-71ff-4d3f-99c4-a9138356fdec" + } + } + }, + "serviceAccountTokenSettings": { + "$id": "7831", + "kind": "model", + "type": { + "$ref": "613" + }, + "value": { + "$id": "7832", + "audience": { + "$id": "7833", + "kind": "string", + "type": { + "$ref": "615" + }, + "value": "ejbklrbxgjaqleoycgpje" + } + } + }, + "x509CertificateSettings": { + "$id": "7834", + "kind": "model", + "type": { + "$ref": "527" + }, + "value": { + "$id": "7835", + "secretRef": { + "$id": "7836", + "kind": "string", + "type": { + "$ref": "529" + }, + "value": "afwizrystfslkfqd" + } + } + } + } + }, + "clientIdPrefix": { + "$id": "7837", + "kind": "string", + "type": { + "$ref": "626" + }, + "value": "kkljsdxdirfhwxtkavldekeqhv" + }, + "host": { + "$id": "7838", + "kind": "string", + "type": { + "$ref": "630" + }, + "value": "nyhnxqnbspstctl" + }, + "protocol": { + "$id": "7839", + "kind": "string", + "type": { + "$ref": "114" + }, + "value": "Mqtt" + }, + "keepAliveSeconds": { + "$id": "7840", + "kind": "number", + "type": { + "$ref": "637" + }, + "value": 0 + }, + "retain": { + "$id": "7841", + "kind": "string", + "type": { + "$ref": "120" + }, + "value": "Keep" + }, + "maxInflightMessages": { + "$id": "7842", + "kind": "number", + "type": { + "$ref": "644" + }, + "value": 0 + }, + "qos": { + "$id": "7843", + "kind": "number", + "type": { + "$ref": "648" + }, + "value": 1 + }, + "sessionExpirySeconds": { + "$id": "7844", + "kind": "number", + "type": { + "$ref": "652" + }, + "value": 0 + }, + "tls": { + "$id": "7845", + "kind": "model", + "type": { + "$ref": "576" + }, + "value": { + "$id": "7846", + "mode": { + "$id": "7847", + "kind": "string", + "type": { + "$ref": "62" + }, + "value": "Enabled" + }, + "trustedCaCertificateConfigMapRef": { + "$id": "7848", + "kind": "string", + "type": { + "$ref": "581" + }, + "value": "tectjjvukvelsreihwadh" + } + } + } + } + }, + "provisioningState": { + "$id": "7849", + "kind": "string", + "type": { + "$ref": "126" + }, + "value": "Succeeded" + } + } + }, + "extendedLocation": { + "$id": "7850", + "kind": "model", + "type": { + "$ref": "669" + }, + "value": { + "$id": "7851", + "name": { + "$id": "7852", + "kind": "string", + "type": { + "$ref": "671" + }, + "value": "qmbrfwcpwwhggszhrdjv" + }, + "type": { + "$id": "7853", + "kind": "string", + "type": { + "$ref": "142" + }, + "value": "CustomLocation" + } + } + }, + "id": { + "$id": "7854", + "kind": "string", + "type": { + "$ref": "330" + }, + "value": "/subscriptions/0000000-0000-0000-0000-000000000000/resourceGroups/resourceGroup123/providers/Microsoft.IoTOperations/instances/resource-name123/dataflowEndpoints/resource-name123" + }, + "name": { + "$id": "7855", + "kind": "string", + "type": { + "$ref": "335" + }, + "value": "zyhxscudobzfacetvgyjiav" + }, + "type": { + "$id": "7856", + "kind": "string", + "type": { + "$ref": "339" + }, + "value": "iay" + }, + "systemData": { + "$id": "7857", + "kind": "model", + "type": { + "$ref": "344" + }, + "value": { + "$id": "7858", + "createdBy": { + "$id": "7859", + "kind": "string", + "type": { + "$ref": "346" + }, + "value": "ssvaslsmudloholronopqyxjcu" + }, + "createdByType": { + "$id": "7860", + "kind": "string", + "type": { + "$ref": "146" + }, + "value": "User" + }, + "createdAt": { + "$id": "7861", + "kind": "string", + "type": { + "$ref": "353" + }, + "value": "2024-08-09T18:13:29.389Z" + }, + "lastModifiedBy": { + "$id": "7862", + "kind": "string", + "type": { + "$ref": "358" + }, + "value": "gnicpuszwd" + }, + "lastModifiedByType": { + "$id": "7863", + "kind": "string", + "type": { + "$ref": "146" + }, + "value": "User" + }, + "lastModifiedAt": { + "$id": "7864", + "kind": "string", + "type": { + "$ref": "365" + }, + "value": "2024-08-09T18:13:29.389Z" + } + } + } + } + } + } + ] + } + ] + }, + { + "$id": "7865", + "Name": "createOrUpdate", + "ResourceName": "DataflowEndpointResource", + "Doc": "Create a DataflowEndpointResource", + "Accessibility": "public", + "Parameters": [ + { + "$id": "7866", + "Name": "apiVersion", + "NameInRequest": "api-version", + "Doc": "The API version to use for this operation.", + "Type": { + "$id": "7867", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": true, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "DefaultValue": { + "$id": "7868", + "Type": { + "$id": "7869", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "2024-11-01" + }, + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "7870", + "Name": "subscriptionId", + "NameInRequest": "subscriptionId", + "Doc": "The ID of the target subscription. The value must be an UUID.", + "Type": { + "$id": "7871", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "7872", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "7873", + "Name": "resourceGroupName", + "NameInRequest": "resourceGroupName", + "Doc": "The name of the resource group. The name is case insensitive.", + "Type": { + "$id": "7874", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "7875", + "Name": "instanceName", + "NameInRequest": "instanceName", + "Doc": "Name of instance.", + "Type": { + "$id": "7876", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "7877", + "Name": "dataflowEndpointName", + "NameInRequest": "dataflowEndpointName", + "Doc": "Name of Instance dataflowEndpoint resource", + "Type": { + "$id": "7878", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "7879", + "Name": "contentType", + "NameInRequest": "Content-Type", + "Doc": "Body parameter's content type. Known values are application/json", + "Type": { + "$id": "7880", + "kind": "constant", + "valueType": { + "$id": "7881", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": true, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "7882", + "Name": "accept", + "NameInRequest": "Accept", + "Type": { + "$id": "7883", + "kind": "constant", + "valueType": { + "$id": "7884", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "7885", + "Name": "resource", + "NameInRequest": "resource", + "Doc": "Resource create parameters.", + "Type": { + "$ref": "326" + }, + "Location": "Body", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "7886", + "StatusCodes": [ + 200 + ], + "BodyType": { + "$ref": "326" + }, + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false, + "ContentTypes": [ + "application/json" + ] + }, + { + "$id": "7887", + "StatusCodes": [ + 201 + ], + "BodyType": { + "$ref": "326" + }, + "BodyMediaType": "Json", + "Headers": [ + { + "$id": "7888", + "Name": "azureAsyncOperation", + "NameInResponse": "Azure-AsyncOperation", + "Doc": "A link to the status monitor", + "Type": { + "$id": "7889", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + } + }, + { + "$id": "7890", + "Name": "retryAfter", + "NameInResponse": "Retry-After", + "Doc": "The Retry-After header can indicate how long the client should wait before polling the operation status.", + "Type": { + "$id": "7891", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + } + } + ], + "IsErrorResponse": false, + "ContentTypes": [ + "application/json" + ] + } + ], + "HttpMethod": "PUT", + "RequestBodyMediaType": "Json", + "Uri": "{endpoint}", + "Path": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/dataflowEndpoints/{dataflowEndpointName}", + "RequestMediaTypes": [ + "application/json" + ], + "BufferResponse": true, + "LongRunning": { + "$id": "7892", + "FinalStateVia": 0, + "FinalResponse": { + "$id": "7893", + "StatusCodes": [ + 200 + ], + "BodyType": { + "$ref": "326" + }, + "BodyMediaType": "Json" + } + }, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Microsoft.IoTOperations.DataflowEndpoint.createOrUpdate", + "Decorators": [], + "Examples": [ + { + "$id": "7894", + "kind": "http", + "name": "DataflowEndpoint_CreateOrUpdate_ADLSv2", + "description": "DataflowEndpoint_CreateOrUpdate_ADLSv2", + "filePath": "2024-11-01/DataflowEndpoint_CreateOrUpdate_ADLSv2.json", + "parameters": [ + { + "$id": "7895", + "parameter": { + "$ref": "7866" + }, + "value": { + "$id": "7896", + "kind": "string", + "type": { + "$ref": "7867" + }, + "value": "2024-11-01" + } + }, + { + "$id": "7897", + "parameter": { + "$ref": "7870" + }, + "value": { + "$id": "7898", + "kind": "string", + "type": { + "$ref": "7871" + }, + "value": "F8C729F9-DF9C-4743-848F-96EE433D8E53" + } + }, + { + "$id": "7899", + "parameter": { + "$ref": "7873" + }, + "value": { + "$id": "7900", + "kind": "string", + "type": { + "$ref": "7874" + }, + "value": "rgiotoperations" + } + }, + { + "$id": "7901", + "parameter": { + "$ref": "7875" + }, + "value": { + "$id": "7902", + "kind": "string", + "type": { + "$ref": "7876" + }, + "value": "resource-name123" + } + }, + { + "$id": "7903", + "parameter": { + "$ref": "7877" + }, + "value": { + "$id": "7904", + "kind": "string", + "type": { + "$ref": "7878" + }, + "value": "adlsv2-endpoint" + } + }, + { + "$id": "7905", + "parameter": { + "$ref": "7885" + }, + "value": { + "$id": "7906", + "kind": "model", + "type": { + "$ref": "326" + }, + "value": { + "$id": "7907", + "properties": { + "$id": "7908", + "kind": "model", + "type": { + "$ref": "372" + }, + "value": { + "$id": "7909", + "endpointType": { + "$id": "7910", + "kind": "string", + "type": { + "$ref": "2" + }, + "value": "DataLakeStorage" + }, + "dataLakeStorageSettings": { + "$id": "7911", + "kind": "model", + "type": { + "$ref": "432" + }, + "value": { + "$id": "7912", + "host": { + "$id": "7913", + "kind": "string", + "type": { + "$ref": "455" + }, + "value": "example.blob.core.windows.net" + }, + "authentication": { + "$id": "7914", + "kind": "model", + "type": { + "$ref": "434" + }, + "value": { + "$id": "7915", + "method": { + "$id": "7916", + "kind": "string", + "type": { + "$ref": "22" + }, + "value": "AccessToken" + }, + "accessTokenSettings": { + "$id": "7917", + "kind": "model", + "type": { + "$ref": "439" + }, + "value": { + "$id": "7918", + "secretRef": { + "$id": "7919", + "kind": "string", + "type": { + "$ref": "441" + }, + "value": "my-secret" + } + } + } + } + } + } + } + } + }, + "extendedLocation": { + "$id": "7920", + "kind": "model", + "type": { + "$ref": "669" + }, + "value": { + "$id": "7921", + "name": { + "$id": "7922", + "kind": "string", + "type": { + "$ref": "671" + }, + "value": "qmbrfwcpwwhggszhrdjv" + }, + "type": { + "$id": "7923", + "kind": "string", + "type": { + "$ref": "142" + }, + "value": "CustomLocation" + } + } + } + } + } + } + ], + "responses": [ + { + "$id": "7924", + "response": { + "$ref": "7886" + }, + "statusCode": 200, + "bodyValue": { + "$id": "7925", + "kind": "model", + "type": { + "$ref": "326" + }, + "value": { + "$id": "7926", + "properties": { + "$id": "7927", + "kind": "model", + "type": { + "$ref": "372" + }, + "value": { + "$id": "7928", + "endpointType": { + "$id": "7929", + "kind": "string", + "type": { + "$ref": "2" + }, + "value": "DataLakeStorage" + }, + "dataLakeStorageSettings": { + "$id": "7930", + "kind": "model", + "type": { + "$ref": "432" + }, + "value": { + "$id": "7931", + "host": { + "$id": "7932", + "kind": "string", + "type": { + "$ref": "455" + }, + "value": "example.blob.core.windows.net" + }, + "authentication": { + "$id": "7933", + "kind": "model", + "type": { + "$ref": "434" + }, + "value": { + "$id": "7934", + "method": { + "$id": "7935", + "kind": "string", + "type": { + "$ref": "22" + }, + "value": "AccessToken" + }, + "accessTokenSettings": { + "$id": "7936", + "kind": "model", + "type": { + "$ref": "439" + }, + "value": { + "$id": "7937", + "secretRef": { + "$id": "7938", + "kind": "string", + "type": { + "$ref": "441" + }, + "value": "my-secret" + } + } + } + } + } + } + }, + "provisioningState": { + "$id": "7939", + "kind": "string", + "type": { + "$ref": "126" + }, + "value": "Succeeded" + } + } + }, + "extendedLocation": { + "$id": "7940", + "kind": "model", + "type": { + "$ref": "669" + }, + "value": { + "$id": "7941", + "name": { + "$id": "7942", + "kind": "string", + "type": { + "$ref": "671" + }, + "value": "qmbrfwcpwwhggszhrdjv" + }, + "type": { + "$id": "7943", + "kind": "string", + "type": { + "$ref": "142" + }, + "value": "CustomLocation" + } + } + }, + "id": { + "$id": "7944", + "kind": "string", + "type": { + "$ref": "330" + }, + "value": "/subscriptions/0000000-0000-0000-0000-000000000000/resourceGroups/resourceGroup123/providers/Microsoft.IoTOperations/instances/resource-name123/dataflowEndpoints/resource-name123" + }, + "name": { + "$id": "7945", + "kind": "string", + "type": { + "$ref": "335" + }, + "value": "zyhxscudobzfacetvgyjiav" + }, + "type": { + "$id": "7946", + "kind": "string", + "type": { + "$ref": "339" + }, + "value": "iay" + }, + "systemData": { + "$id": "7947", + "kind": "model", + "type": { + "$ref": "344" + }, + "value": { + "$id": "7948", + "createdBy": { + "$id": "7949", + "kind": "string", + "type": { + "$ref": "346" + }, + "value": "ssvaslsmudloholronopqyxjcu" + }, + "createdByType": { + "$id": "7950", + "kind": "string", + "type": { + "$ref": "146" + }, + "value": "User" + }, + "createdAt": { + "$id": "7951", + "kind": "string", + "type": { + "$ref": "353" + }, + "value": "2024-08-09T18:13:29.389Z" + }, + "lastModifiedBy": { + "$id": "7952", + "kind": "string", + "type": { + "$ref": "358" + }, + "value": "gnicpuszwd" + }, + "lastModifiedByType": { + "$id": "7953", + "kind": "string", + "type": { + "$ref": "146" + }, + "value": "User" + }, + "lastModifiedAt": { + "$id": "7954", + "kind": "string", + "type": { + "$ref": "365" + }, + "value": "2024-08-09T18:13:29.389Z" + } + } + } + } + } + }, + { + "$id": "7955", + "response": { + "$ref": "7887" + }, + "statusCode": 201, + "bodyValue": { + "$id": "7956", + "kind": "model", + "type": { + "$ref": "326" + }, + "value": { + "$id": "7957", + "properties": { + "$id": "7958", + "kind": "model", + "type": { + "$ref": "372" + }, + "value": { + "$id": "7959", + "endpointType": { + "$id": "7960", + "kind": "string", + "type": { + "$ref": "2" + }, + "value": "DataLakeStorage" + }, + "dataLakeStorageSettings": { + "$id": "7961", + "kind": "model", + "type": { + "$ref": "432" + }, + "value": { + "$id": "7962", + "host": { + "$id": "7963", + "kind": "string", + "type": { + "$ref": "455" + }, + "value": "example.blob.core.windows.net" + }, + "authentication": { + "$id": "7964", + "kind": "model", + "type": { + "$ref": "434" + }, + "value": { + "$id": "7965", + "method": { + "$id": "7966", + "kind": "string", + "type": { + "$ref": "22" + }, + "value": "AccessToken" + }, + "accessTokenSettings": { + "$id": "7967", + "kind": "model", + "type": { + "$ref": "439" + }, + "value": { + "$id": "7968", + "secretRef": { + "$id": "7969", + "kind": "string", + "type": { + "$ref": "441" + }, + "value": "my-secret" + } + } + } + } + } + } + }, + "provisioningState": { + "$id": "7970", + "kind": "string", + "type": { + "$ref": "126" + }, + "value": "Succeeded" + } + } + }, + "extendedLocation": { + "$id": "7971", + "kind": "model", + "type": { + "$ref": "669" + }, + "value": { + "$id": "7972", + "name": { + "$id": "7973", + "kind": "string", + "type": { + "$ref": "671" + }, + "value": "qmbrfwcpwwhggszhrdjv" + }, + "type": { + "$id": "7974", + "kind": "string", + "type": { + "$ref": "142" + }, + "value": "CustomLocation" + } + } + }, + "id": { + "$id": "7975", + "kind": "string", + "type": { + "$ref": "330" + }, + "value": "/subscriptions/0000000-0000-0000-0000-000000000000/resourceGroups/resourceGroup123/providers/Microsoft.IoTOperations/instances/resource-name123/dataflowEndpoints/resource-name123" + }, + "name": { + "$id": "7976", + "kind": "string", + "type": { + "$ref": "335" + }, + "value": "zyhxscudobzfacetvgyjiav" + }, + "type": { + "$id": "7977", + "kind": "string", + "type": { + "$ref": "339" + }, + "value": "iay" + }, + "systemData": { + "$id": "7978", + "kind": "model", + "type": { + "$ref": "344" + }, + "value": { + "$id": "7979", + "createdBy": { + "$id": "7980", + "kind": "string", + "type": { + "$ref": "346" + }, + "value": "ssvaslsmudloholronopqyxjcu" + }, + "createdByType": { + "$id": "7981", + "kind": "string", + "type": { + "$ref": "146" + }, + "value": "User" + }, + "createdAt": { + "$id": "7982", + "kind": "string", + "type": { + "$ref": "353" + }, + "value": "2024-08-09T18:13:29.389Z" + }, + "lastModifiedBy": { + "$id": "7983", + "kind": "string", + "type": { + "$ref": "358" + }, + "value": "gnicpuszwd" + }, + "lastModifiedByType": { + "$id": "7984", + "kind": "string", + "type": { + "$ref": "146" + }, + "value": "User" + }, + "lastModifiedAt": { + "$id": "7985", + "kind": "string", + "type": { + "$ref": "365" + }, + "value": "2024-08-09T18:13:29.389Z" + } + } + } + } + } + } + ] + }, + { + "$id": "7986", + "kind": "http", + "name": "DataflowEndpoint_CreateOrUpdate_ADX", + "description": "DataflowEndpoint_CreateOrUpdate_ADX", + "filePath": "2024-11-01/DataflowEndpoint_CreateOrUpdate_ADX.json", + "parameters": [ + { + "$id": "7987", + "parameter": { + "$ref": "7866" + }, + "value": { + "$id": "7988", + "kind": "string", + "type": { + "$ref": "7867" + }, + "value": "2024-11-01" + } + }, + { + "$id": "7989", + "parameter": { + "$ref": "7870" + }, + "value": { + "$id": "7990", + "kind": "string", + "type": { + "$ref": "7871" + }, + "value": "F8C729F9-DF9C-4743-848F-96EE433D8E53" + } + }, + { + "$id": "7991", + "parameter": { + "$ref": "7873" + }, + "value": { + "$id": "7992", + "kind": "string", + "type": { + "$ref": "7874" + }, + "value": "rgiotoperations" + } + }, + { + "$id": "7993", + "parameter": { + "$ref": "7875" + }, + "value": { + "$id": "7994", + "kind": "string", + "type": { + "$ref": "7876" + }, + "value": "resource-name123" + } + }, + { + "$id": "7995", + "parameter": { + "$ref": "7877" + }, + "value": { + "$id": "7996", + "kind": "string", + "type": { + "$ref": "7878" + }, + "value": "adx-endpoint" + } + }, + { + "$id": "7997", + "parameter": { + "$ref": "7885" + }, + "value": { + "$id": "7998", + "kind": "model", + "type": { + "$ref": "326" + }, + "value": { + "$id": "7999", + "properties": { + "$id": "8000", + "kind": "model", + "type": { + "$ref": "372" + }, + "value": { + "$id": "8001", + "endpointType": { + "$id": "8002", + "kind": "string", + "type": { + "$ref": "2" + }, + "value": "DataExplorer" + }, + "dataExplorerSettings": { + "$id": "8003", + "kind": "model", + "type": { + "$ref": "377" + }, + "value": { + "$id": "8004", + "host": { + "$id": "8005", + "kind": "string", + "type": { + "$ref": "414" + }, + "value": "example.westeurope.kusto.windows.net" + }, + "authentication": { + "$id": "8006", + "kind": "model", + "type": { + "$ref": "379" + }, + "value": { + "$id": "8007", + "method": { + "$id": "8008", + "kind": "string", + "type": { + "$ref": "16" + }, + "value": "SystemAssignedManagedIdentity" + }, + "systemAssignedManagedIdentitySettings": { + "$id": "8009", + "kind": "model", + "type": { + "$ref": "384" + }, + "value": { + "$id": "8010" + } + } + } + }, + "database": { + "$id": "8011", + "kind": "string", + "type": { + "$ref": "410" + }, + "value": "example-database" + }, + "batching": { + "$id": "8012", + "kind": "model", + "type": { + "$ref": "418" + }, + "value": { + "$id": "8013", + "latencySeconds": { + "$id": "8014", + "kind": "number", + "type": { + "$ref": "420" + }, + "value": 9312 + }, + "maxMessages": { + "$id": "8015", + "kind": "number", + "type": { + "$ref": "424" + }, + "value": 9028 + } + } + } + } + } + } + }, + "extendedLocation": { + "$id": "8016", + "kind": "model", + "type": { + "$ref": "669" + }, + "value": { + "$id": "8017", + "name": { + "$id": "8018", + "kind": "string", + "type": { + "$ref": "671" + }, + "value": "qmbrfwcpwwhggszhrdjv" + }, + "type": { + "$id": "8019", + "kind": "string", + "type": { + "$ref": "142" + }, + "value": "CustomLocation" + } + } + } + } + } + } + ], + "responses": [ + { + "$id": "8020", + "response": { + "$ref": "7886" + }, + "statusCode": 200, + "bodyValue": { + "$id": "8021", + "kind": "model", + "type": { + "$ref": "326" + }, + "value": { + "$id": "8022", + "properties": { + "$id": "8023", + "kind": "model", + "type": { + "$ref": "372" + }, + "value": { + "$id": "8024", + "endpointType": { + "$id": "8025", + "kind": "string", + "type": { + "$ref": "2" + }, + "value": "DataExplorer" + }, + "dataExplorerSettings": { + "$id": "8026", + "kind": "model", + "type": { + "$ref": "377" + }, + "value": { + "$id": "8027", + "host": { + "$id": "8028", + "kind": "string", + "type": { + "$ref": "414" + }, + "value": "example.westeurope.kusto.windows.net" + }, + "authentication": { + "$id": "8029", + "kind": "model", + "type": { + "$ref": "379" + }, + "value": { + "$id": "8030", + "method": { + "$id": "8031", + "kind": "string", + "type": { + "$ref": "16" + }, + "value": "SystemAssignedManagedIdentity" + }, + "systemAssignedManagedIdentitySettings": { + "$id": "8032", + "kind": "model", + "type": { + "$ref": "384" + }, + "value": { + "$id": "8033" + } + } + } + }, + "database": { + "$id": "8034", + "kind": "string", + "type": { + "$ref": "410" + }, + "value": "example-database" + }, + "batching": { + "$id": "8035", + "kind": "model", + "type": { + "$ref": "418" + }, + "value": { + "$id": "8036", + "latencySeconds": { + "$id": "8037", + "kind": "number", + "type": { + "$ref": "420" + }, + "value": 9312 + }, + "maxMessages": { + "$id": "8038", + "kind": "number", + "type": { + "$ref": "424" + }, + "value": 9028 + } + } + } + } + }, + "provisioningState": { + "$id": "8039", + "kind": "string", + "type": { + "$ref": "126" + }, + "value": "Succeeded" + } + } + }, + "extendedLocation": { + "$id": "8040", + "kind": "model", + "type": { + "$ref": "669" + }, + "value": { + "$id": "8041", + "name": { + "$id": "8042", + "kind": "string", + "type": { + "$ref": "671" + }, + "value": "qmbrfwcpwwhggszhrdjv" + }, + "type": { + "$id": "8043", + "kind": "string", + "type": { + "$ref": "142" + }, + "value": "CustomLocation" + } + } + }, + "id": { + "$id": "8044", + "kind": "string", + "type": { + "$ref": "330" + }, + "value": "/subscriptions/0000000-0000-0000-0000-000000000000/resourceGroups/resourceGroup123/providers/Microsoft.IoTOperations/instances/resource-name123/dataflowEndpoints/resource-name123" + }, + "name": { + "$id": "8045", + "kind": "string", + "type": { + "$ref": "335" + }, + "value": "zyhxscudobzfacetvgyjiav" + }, + "type": { + "$id": "8046", + "kind": "string", + "type": { + "$ref": "339" + }, + "value": "iay" + }, + "systemData": { + "$id": "8047", + "kind": "model", + "type": { + "$ref": "344" + }, + "value": { + "$id": "8048", + "createdBy": { + "$id": "8049", + "kind": "string", + "type": { + "$ref": "346" + }, + "value": "ssvaslsmudloholronopqyxjcu" + }, + "createdByType": { + "$id": "8050", + "kind": "string", + "type": { + "$ref": "146" + }, + "value": "User" + }, + "createdAt": { + "$id": "8051", + "kind": "string", + "type": { + "$ref": "353" + }, + "value": "2024-08-09T18:13:29.389Z" + }, + "lastModifiedBy": { + "$id": "8052", + "kind": "string", + "type": { + "$ref": "358" + }, + "value": "gnicpuszwd" + }, + "lastModifiedByType": { + "$id": "8053", + "kind": "string", + "type": { + "$ref": "146" + }, + "value": "User" + }, + "lastModifiedAt": { + "$id": "8054", + "kind": "string", + "type": { + "$ref": "365" + }, + "value": "2024-08-09T18:13:29.389Z" + } + } + } + } + } + }, + { + "$id": "8055", + "response": { + "$ref": "7887" + }, + "statusCode": 201, + "bodyValue": { + "$id": "8056", + "kind": "model", + "type": { + "$ref": "326" + }, + "value": { + "$id": "8057", + "properties": { + "$id": "8058", + "kind": "model", + "type": { + "$ref": "372" + }, + "value": { + "$id": "8059", + "endpointType": { + "$id": "8060", + "kind": "string", + "type": { + "$ref": "2" + }, + "value": "DataExplorer" + }, + "dataExplorerSettings": { + "$id": "8061", + "kind": "model", + "type": { + "$ref": "377" + }, + "value": { + "$id": "8062", + "host": { + "$id": "8063", + "kind": "string", + "type": { + "$ref": "414" + }, + "value": "example.westeurope.kusto.windows.net" + }, + "authentication": { + "$id": "8064", + "kind": "model", + "type": { + "$ref": "379" + }, + "value": { + "$id": "8065", + "method": { + "$id": "8066", + "kind": "string", + "type": { + "$ref": "16" + }, + "value": "SystemAssignedManagedIdentity" + }, + "systemAssignedManagedIdentitySettings": { + "$id": "8067", + "kind": "model", + "type": { + "$ref": "384" + }, + "value": { + "$id": "8068" + } + } + } + }, + "database": { + "$id": "8069", + "kind": "string", + "type": { + "$ref": "410" + }, + "value": "example-database" + }, + "batching": { + "$id": "8070", + "kind": "model", + "type": { + "$ref": "418" + }, + "value": { + "$id": "8071", + "latencySeconds": { + "$id": "8072", + "kind": "number", + "type": { + "$ref": "420" + }, + "value": 9312 + }, + "maxMessages": { + "$id": "8073", + "kind": "number", + "type": { + "$ref": "424" + }, + "value": 9028 + } + } + } + } + }, + "provisioningState": { + "$id": "8074", + "kind": "string", + "type": { + "$ref": "126" + }, + "value": "Succeeded" + } + } + }, + "extendedLocation": { + "$id": "8075", + "kind": "model", + "type": { + "$ref": "669" + }, + "value": { + "$id": "8076", + "name": { + "$id": "8077", + "kind": "string", + "type": { + "$ref": "671" + }, + "value": "qmbrfwcpwwhggszhrdjv" + }, + "type": { + "$id": "8078", + "kind": "string", + "type": { + "$ref": "142" + }, + "value": "CustomLocation" + } + } + }, + "id": { + "$id": "8079", + "kind": "string", + "type": { + "$ref": "330" + }, + "value": "/subscriptions/0000000-0000-0000-0000-000000000000/resourceGroups/resourceGroup123/providers/Microsoft.IoTOperations/instances/resource-name123/dataflowEndpoints/resource-name123" + }, + "name": { + "$id": "8080", + "kind": "string", + "type": { + "$ref": "335" + }, + "value": "zyhxscudobzfacetvgyjiav" + }, + "type": { + "$id": "8081", + "kind": "string", + "type": { + "$ref": "339" + }, + "value": "iay" + }, + "systemData": { + "$id": "8082", + "kind": "model", + "type": { + "$ref": "344" + }, + "value": { + "$id": "8083", + "createdBy": { + "$id": "8084", + "kind": "string", + "type": { + "$ref": "346" + }, + "value": "ssvaslsmudloholronopqyxjcu" + }, + "createdByType": { + "$id": "8085", + "kind": "string", + "type": { + "$ref": "146" + }, + "value": "User" + }, + "createdAt": { + "$id": "8086", + "kind": "string", + "type": { + "$ref": "353" + }, + "value": "2024-08-09T18:13:29.389Z" + }, + "lastModifiedBy": { + "$id": "8087", + "kind": "string", + "type": { + "$ref": "358" + }, + "value": "gnicpuszwd" + }, + "lastModifiedByType": { + "$id": "8088", + "kind": "string", + "type": { + "$ref": "146" + }, + "value": "User" + }, + "lastModifiedAt": { + "$id": "8089", + "kind": "string", + "type": { + "$ref": "365" + }, + "value": "2024-08-09T18:13:29.389Z" + } + } + } + } + } + } + ] + }, + { + "$id": "8090", + "kind": "http", + "name": "DataflowEndpoint_CreateOrUpdate_AIO", + "description": "DataflowEndpoint_CreateOrUpdate_AIO", + "filePath": "2024-11-01/DataflowEndpoint_CreateOrUpdate_AIO.json", + "parameters": [ + { + "$id": "8091", + "parameter": { + "$ref": "7866" + }, + "value": { + "$id": "8092", + "kind": "string", + "type": { + "$ref": "7867" + }, + "value": "2024-11-01" + } + }, + { + "$id": "8093", + "parameter": { + "$ref": "7870" + }, + "value": { + "$id": "8094", + "kind": "string", + "type": { + "$ref": "7871" + }, + "value": "F8C729F9-DF9C-4743-848F-96EE433D8E53" + } + }, + { + "$id": "8095", + "parameter": { + "$ref": "7873" + }, + "value": { + "$id": "8096", + "kind": "string", + "type": { + "$ref": "7874" + }, + "value": "rgiotoperations" + } + }, + { + "$id": "8097", + "parameter": { + "$ref": "7875" + }, + "value": { + "$id": "8098", + "kind": "string", + "type": { + "$ref": "7876" + }, + "value": "resource-name123" + } + }, + { + "$id": "8099", + "parameter": { + "$ref": "7877" + }, + "value": { + "$id": "8100", + "kind": "string", + "type": { + "$ref": "7878" + }, + "value": "aio-builtin-broker-endpoint" + } + }, + { + "$id": "8101", + "parameter": { + "$ref": "7885" + }, + "value": { + "$id": "8102", + "kind": "model", + "type": { + "$ref": "326" + }, + "value": { + "$id": "8103", + "properties": { + "$id": "8104", + "kind": "model", + "type": { + "$ref": "372" + }, + "value": { + "$id": "8105", + "endpointType": { + "$id": "8106", + "kind": "string", + "type": { + "$ref": "2" + }, + "value": "Mqtt" + }, + "mqttSettings": { + "$id": "8107", + "kind": "model", + "type": { + "$ref": "600" + }, + "value": { + "$id": "8108", + "host": { + "$id": "8109", + "kind": "string", + "type": { + "$ref": "630" + }, + "value": "aio-broker:18883" + }, + "authentication": { + "$id": "8110", + "kind": "model", + "type": { + "$ref": "602" + }, + "value": { + "$id": "8111", + "serviceAccountTokenSettings": { + "$id": "8112", + "kind": "model", + "type": { + "$ref": "613" + }, + "value": { + "$id": "8113", + "audience": { + "$id": "8114", + "kind": "string", + "type": { + "$ref": "615" + }, + "value": "aio-internal" + } + } + } + } + }, + "tls": { + "$id": "8115", + "kind": "model", + "type": { + "$ref": "576" + }, + "value": { + "$id": "8116", + "mode": { + "$id": "8117", + "kind": "string", + "type": { + "$ref": "62" + }, + "value": "Enabled" + }, + "trustedCaCertificateConfigMapRef": { + "$id": "8118", + "kind": "string", + "type": { + "$ref": "581" + }, + "value": "aio-ca-trust-bundle-test-only" + } + } + } + } + } + } + }, + "extendedLocation": { + "$id": "8119", + "kind": "model", + "type": { + "$ref": "669" + }, + "value": { + "$id": "8120", + "name": { + "$id": "8121", + "kind": "string", + "type": { + "$ref": "671" + }, + "value": "qmbrfwcpwwhggszhrdjv" + }, + "type": { + "$id": "8122", + "kind": "string", + "type": { + "$ref": "142" + }, + "value": "CustomLocation" + } + } + } + } + } + } + ], + "responses": [ + { + "$id": "8123", + "response": { + "$ref": "7886" + }, + "statusCode": 200, + "bodyValue": { + "$id": "8124", + "kind": "model", + "type": { + "$ref": "326" + }, + "value": { + "$id": "8125", + "properties": { + "$id": "8126", + "kind": "model", + "type": { + "$ref": "372" + }, + "value": { + "$id": "8127", + "endpointType": { + "$id": "8128", + "kind": "string", + "type": { + "$ref": "2" + }, + "value": "Mqtt" + }, + "mqttSettings": { + "$id": "8129", + "kind": "model", + "type": { + "$ref": "600" + }, + "value": { + "$id": "8130", + "host": { + "$id": "8131", + "kind": "string", + "type": { + "$ref": "630" + }, + "value": "aio-broker:18883" + }, + "authentication": { + "$id": "8132", + "kind": "model", + "type": { + "$ref": "602" + }, + "value": { + "$id": "8133", + "serviceAccountTokenSettings": { + "$id": "8134", + "kind": "model", + "type": { + "$ref": "613" + }, + "value": { + "$id": "8135", + "audience": { + "$id": "8136", + "kind": "string", + "type": { + "$ref": "615" + }, + "value": "aio-internal" + } + } + } + } + }, + "tls": { + "$id": "8137", + "kind": "model", + "type": { + "$ref": "576" + }, + "value": { + "$id": "8138", + "mode": { + "$id": "8139", + "kind": "string", + "type": { + "$ref": "62" + }, + "value": "Enabled" + }, + "trustedCaCertificateConfigMapRef": { + "$id": "8140", + "kind": "string", + "type": { + "$ref": "581" + }, + "value": "aio-ca-trust-bundle-test-only" + } + } + } + } + }, + "provisioningState": { + "$id": "8141", + "kind": "string", + "type": { + "$ref": "126" + }, + "value": "Succeeded" + } + } + }, + "extendedLocation": { + "$id": "8142", + "kind": "model", + "type": { + "$ref": "669" + }, + "value": { + "$id": "8143", + "name": { + "$id": "8144", + "kind": "string", + "type": { + "$ref": "671" + }, + "value": "qmbrfwcpwwhggszhrdjv" + }, + "type": { + "$id": "8145", + "kind": "string", + "type": { + "$ref": "142" + }, + "value": "CustomLocation" + } + } + }, + "id": { + "$id": "8146", + "kind": "string", + "type": { + "$ref": "330" + }, + "value": "/subscriptions/0000000-0000-0000-0000-000000000000/resourceGroups/resourceGroup123/providers/Microsoft.IoTOperations/instances/resource-name123/dataflowEndpoints/resource-name123" + }, + "name": { + "$id": "8147", + "kind": "string", + "type": { + "$ref": "335" + }, + "value": "zyhxscudobzfacetvgyjiav" + }, + "type": { + "$id": "8148", + "kind": "string", + "type": { + "$ref": "339" + }, + "value": "iay" + }, + "systemData": { + "$id": "8149", + "kind": "model", + "type": { + "$ref": "344" + }, + "value": { + "$id": "8150", + "createdBy": { + "$id": "8151", + "kind": "string", + "type": { + "$ref": "346" + }, + "value": "ssvaslsmudloholronopqyxjcu" + }, + "createdByType": { + "$id": "8152", + "kind": "string", + "type": { + "$ref": "146" + }, + "value": "User" + }, + "createdAt": { + "$id": "8153", + "kind": "string", + "type": { + "$ref": "353" + }, + "value": "2024-08-09T18:13:29.389Z" + }, + "lastModifiedBy": { + "$id": "8154", + "kind": "string", + "type": { + "$ref": "358" + }, + "value": "gnicpuszwd" + }, + "lastModifiedByType": { + "$id": "8155", + "kind": "string", + "type": { + "$ref": "146" + }, + "value": "User" + }, + "lastModifiedAt": { + "$id": "8156", + "kind": "string", + "type": { + "$ref": "365" + }, + "value": "2024-08-09T18:13:29.389Z" + } + } + } + } + } + }, + { + "$id": "8157", + "response": { + "$ref": "7887" + }, + "statusCode": 201, + "bodyValue": { + "$id": "8158", + "kind": "model", + "type": { + "$ref": "326" + }, + "value": { + "$id": "8159", + "properties": { + "$id": "8160", + "kind": "model", + "type": { + "$ref": "372" + }, + "value": { + "$id": "8161", + "endpointType": { + "$id": "8162", + "kind": "string", + "type": { + "$ref": "2" + }, + "value": "Mqtt" + }, + "mqttSettings": { + "$id": "8163", + "kind": "model", + "type": { + "$ref": "600" + }, + "value": { + "$id": "8164", + "host": { + "$id": "8165", + "kind": "string", + "type": { + "$ref": "630" + }, + "value": "aio-broker:18883" + }, + "authentication": { + "$id": "8166", + "kind": "model", + "type": { + "$ref": "602" + }, + "value": { + "$id": "8167", + "serviceAccountTokenSettings": { + "$id": "8168", + "kind": "model", + "type": { + "$ref": "613" + }, + "value": { + "$id": "8169", + "audience": { + "$id": "8170", + "kind": "string", + "type": { + "$ref": "615" + }, + "value": "aio-internal" + } + } + } + } + }, + "tls": { + "$id": "8171", + "kind": "model", + "type": { + "$ref": "576" + }, + "value": { + "$id": "8172", + "mode": { + "$id": "8173", + "kind": "string", + "type": { + "$ref": "62" + }, + "value": "Enabled" + }, + "trustedCaCertificateConfigMapRef": { + "$id": "8174", + "kind": "string", + "type": { + "$ref": "581" + }, + "value": "aio-ca-trust-bundle-test-only" + } + } + } + } + }, + "provisioningState": { + "$id": "8175", + "kind": "string", + "type": { + "$ref": "126" + }, + "value": "Succeeded" + } + } + }, + "extendedLocation": { + "$id": "8176", + "kind": "model", + "type": { + "$ref": "669" + }, + "value": { + "$id": "8177", + "name": { + "$id": "8178", + "kind": "string", + "type": { + "$ref": "671" + }, + "value": "qmbrfwcpwwhggszhrdjv" + }, + "type": { + "$id": "8179", + "kind": "string", + "type": { + "$ref": "142" + }, + "value": "CustomLocation" + } + } + }, + "id": { + "$id": "8180", + "kind": "string", + "type": { + "$ref": "330" + }, + "value": "/subscriptions/0000000-0000-0000-0000-000000000000/resourceGroups/resourceGroup123/providers/Microsoft.IoTOperations/instances/resource-name123/dataflowEndpoints/resource-name123" + }, + "name": { + "$id": "8181", + "kind": "string", + "type": { + "$ref": "335" + }, + "value": "zyhxscudobzfacetvgyjiav" + }, + "type": { + "$id": "8182", + "kind": "string", + "type": { + "$ref": "339" + }, + "value": "iay" + }, + "systemData": { + "$id": "8183", + "kind": "model", + "type": { + "$ref": "344" + }, + "value": { + "$id": "8184", + "createdBy": { + "$id": "8185", + "kind": "string", + "type": { + "$ref": "346" + }, + "value": "ssvaslsmudloholronopqyxjcu" + }, + "createdByType": { + "$id": "8186", + "kind": "string", + "type": { + "$ref": "146" + }, + "value": "User" + }, + "createdAt": { + "$id": "8187", + "kind": "string", + "type": { + "$ref": "353" + }, + "value": "2024-08-09T18:13:29.389Z" + }, + "lastModifiedBy": { + "$id": "8188", + "kind": "string", + "type": { + "$ref": "358" + }, + "value": "gnicpuszwd" + }, + "lastModifiedByType": { + "$id": "8189", + "kind": "string", + "type": { + "$ref": "146" + }, + "value": "User" + }, + "lastModifiedAt": { + "$id": "8190", + "kind": "string", + "type": { + "$ref": "365" + }, + "value": "2024-08-09T18:13:29.389Z" + } + } + } + } + } + } + ] + }, + { + "$id": "8191", + "kind": "http", + "name": "DataflowEndpoint_CreateOrUpdate_EventGrid", + "description": "DataflowEndpoint_CreateOrUpdate_EventGrid", + "filePath": "2024-11-01/DataflowEndpoint_CreateOrUpdate_EventGrid.json", + "parameters": [ + { + "$id": "8192", + "parameter": { + "$ref": "7866" + }, + "value": { + "$id": "8193", + "kind": "string", + "type": { + "$ref": "7867" + }, + "value": "2024-11-01" + } + }, + { + "$id": "8194", + "parameter": { + "$ref": "7870" + }, + "value": { + "$id": "8195", + "kind": "string", + "type": { + "$ref": "7871" + }, + "value": "F8C729F9-DF9C-4743-848F-96EE433D8E53" + } + }, + { + "$id": "8196", + "parameter": { + "$ref": "7873" + }, + "value": { + "$id": "8197", + "kind": "string", + "type": { + "$ref": "7874" + }, + "value": "rgiotoperations" + } + }, + { + "$id": "8198", + "parameter": { + "$ref": "7875" + }, + "value": { + "$id": "8199", + "kind": "string", + "type": { + "$ref": "7876" + }, + "value": "resource-name123" + } + }, + { + "$id": "8200", + "parameter": { + "$ref": "7877" + }, + "value": { + "$id": "8201", + "kind": "string", + "type": { + "$ref": "7878" + }, + "value": "event-grid-endpoint" + } + }, + { + "$id": "8202", + "parameter": { + "$ref": "7885" + }, + "value": { + "$id": "8203", + "kind": "model", + "type": { + "$ref": "326" + }, + "value": { + "$id": "8204", + "properties": { + "$id": "8205", + "kind": "model", + "type": { + "$ref": "372" + }, + "value": { + "$id": "8206", + "endpointType": { + "$id": "8207", + "kind": "string", + "type": { + "$ref": "2" + }, + "value": "Mqtt" + }, + "mqttSettings": { + "$id": "8208", + "kind": "model", + "type": { + "$ref": "600" + }, + "value": { + "$id": "8209", + "host": { + "$id": "8210", + "kind": "string", + "type": { + "$ref": "630" + }, + "value": "example.westeurope-1.ts.eventgrid.azure.net:8883" + }, + "authentication": { + "$id": "8211", + "kind": "model", + "type": { + "$ref": "602" + }, + "value": { + "$id": "8212", + "method": { + "$id": "8213", + "kind": "string", + "type": { + "$ref": "102" + }, + "value": "SystemAssignedManagedIdentity" + }, + "systemAssignedManagedIdentitySettings": { + "$id": "8214", + "kind": "model", + "type": { + "$ref": "384" + }, + "value": { + "$id": "8215" + } + } + } + }, + "tls": { + "$id": "8216", + "kind": "model", + "type": { + "$ref": "576" + }, + "value": { + "$id": "8217", + "mode": { + "$id": "8218", + "kind": "string", + "type": { + "$ref": "62" + }, + "value": "Enabled" + } + } + } + } + } + } + }, + "extendedLocation": { + "$id": "8219", + "kind": "model", + "type": { + "$ref": "669" + }, + "value": { + "$id": "8220", + "name": { + "$id": "8221", + "kind": "string", + "type": { + "$ref": "671" + }, + "value": "qmbrfwcpwwhggszhrdjv" + }, + "type": { + "$id": "8222", + "kind": "string", + "type": { + "$ref": "142" + }, + "value": "CustomLocation" + } + } + } + } + } + } + ], + "responses": [ + { + "$id": "8223", + "response": { + "$ref": "7886" + }, + "statusCode": 200, + "bodyValue": { + "$id": "8224", + "kind": "model", + "type": { + "$ref": "326" + }, + "value": { + "$id": "8225", + "properties": { + "$id": "8226", + "kind": "model", + "type": { + "$ref": "372" + }, + "value": { + "$id": "8227", + "endpointType": { + "$id": "8228", + "kind": "string", + "type": { + "$ref": "2" + }, + "value": "Mqtt" + }, + "mqttSettings": { + "$id": "8229", + "kind": "model", + "type": { + "$ref": "600" + }, + "value": { + "$id": "8230", + "host": { + "$id": "8231", + "kind": "string", + "type": { + "$ref": "630" + }, + "value": "example.westeurope-1.ts.eventgrid.azure.net:8883" + }, + "authentication": { + "$id": "8232", + "kind": "model", + "type": { + "$ref": "602" + }, + "value": { + "$id": "8233", + "method": { + "$id": "8234", + "kind": "string", + "type": { + "$ref": "102" + }, + "value": "SystemAssignedManagedIdentity" + }, + "systemAssignedManagedIdentitySettings": { + "$id": "8235", + "kind": "model", + "type": { + "$ref": "384" + }, + "value": { + "$id": "8236" + } + } + } + }, + "tls": { + "$id": "8237", + "kind": "model", + "type": { + "$ref": "576" + }, + "value": { + "$id": "8238", + "mode": { + "$id": "8239", + "kind": "string", + "type": { + "$ref": "62" + }, + "value": "Enabled" + } + } + } + } + }, + "provisioningState": { + "$id": "8240", + "kind": "string", + "type": { + "$ref": "126" + }, + "value": "Succeeded" + } + } + }, + "extendedLocation": { + "$id": "8241", + "kind": "model", + "type": { + "$ref": "669" + }, + "value": { + "$id": "8242", + "name": { + "$id": "8243", + "kind": "string", + "type": { + "$ref": "671" + }, + "value": "qmbrfwcpwwhggszhrdjv" + }, + "type": { + "$id": "8244", + "kind": "string", + "type": { + "$ref": "142" + }, + "value": "CustomLocation" + } + } + }, + "id": { + "$id": "8245", + "kind": "string", + "type": { + "$ref": "330" + }, + "value": "/subscriptions/0000000-0000-0000-0000-000000000000/resourceGroups/resourceGroup123/providers/Microsoft.IoTOperations/instances/resource-name123/dataflowEndpoints/resource-name123" + }, + "name": { + "$id": "8246", + "kind": "string", + "type": { + "$ref": "335" + }, + "value": "zyhxscudobzfacetvgyjiav" + }, + "type": { + "$id": "8247", + "kind": "string", + "type": { + "$ref": "339" + }, + "value": "iay" + }, + "systemData": { + "$id": "8248", + "kind": "model", + "type": { + "$ref": "344" + }, + "value": { + "$id": "8249", + "createdBy": { + "$id": "8250", + "kind": "string", + "type": { + "$ref": "346" + }, + "value": "ssvaslsmudloholronopqyxjcu" + }, + "createdByType": { + "$id": "8251", + "kind": "string", + "type": { + "$ref": "146" + }, + "value": "User" + }, + "createdAt": { + "$id": "8252", + "kind": "string", + "type": { + "$ref": "353" + }, + "value": "2024-08-09T18:13:29.389Z" + }, + "lastModifiedBy": { + "$id": "8253", + "kind": "string", + "type": { + "$ref": "358" + }, + "value": "gnicpuszwd" + }, + "lastModifiedByType": { + "$id": "8254", + "kind": "string", + "type": { + "$ref": "146" + }, + "value": "User" + }, + "lastModifiedAt": { + "$id": "8255", + "kind": "string", + "type": { + "$ref": "365" + }, + "value": "2024-08-09T18:13:29.389Z" + } + } + } + } + } + }, + { + "$id": "8256", + "response": { + "$ref": "7887" + }, + "statusCode": 201, + "bodyValue": { + "$id": "8257", + "kind": "model", + "type": { + "$ref": "326" + }, + "value": { + "$id": "8258", + "properties": { + "$id": "8259", + "kind": "model", + "type": { + "$ref": "372" + }, + "value": { + "$id": "8260", + "endpointType": { + "$id": "8261", + "kind": "string", + "type": { + "$ref": "2" + }, + "value": "Mqtt" + }, + "mqttSettings": { + "$id": "8262", + "kind": "model", + "type": { + "$ref": "600" + }, + "value": { + "$id": "8263", + "host": { + "$id": "8264", + "kind": "string", + "type": { + "$ref": "630" + }, + "value": "example.westeurope-1.ts.eventgrid.azure.net:8883" + }, + "authentication": { + "$id": "8265", + "kind": "model", + "type": { + "$ref": "602" + }, + "value": { + "$id": "8266", + "method": { + "$id": "8267", + "kind": "string", + "type": { + "$ref": "102" + }, + "value": "SystemAssignedManagedIdentity" + }, + "systemAssignedManagedIdentitySettings": { + "$id": "8268", + "kind": "model", + "type": { + "$ref": "384" + }, + "value": { + "$id": "8269" + } + } + } + }, + "tls": { + "$id": "8270", + "kind": "model", + "type": { + "$ref": "576" + }, + "value": { + "$id": "8271", + "mode": { + "$id": "8272", + "kind": "string", + "type": { + "$ref": "62" + }, + "value": "Enabled" + } + } + } + } + }, + "provisioningState": { + "$id": "8273", + "kind": "string", + "type": { + "$ref": "126" + }, + "value": "Succeeded" + } + } + }, + "extendedLocation": { + "$id": "8274", + "kind": "model", + "type": { + "$ref": "669" + }, + "value": { + "$id": "8275", + "name": { + "$id": "8276", + "kind": "string", + "type": { + "$ref": "671" + }, + "value": "qmbrfwcpwwhggszhrdjv" + }, + "type": { + "$id": "8277", + "kind": "string", + "type": { + "$ref": "142" + }, + "value": "CustomLocation" + } + } + }, + "id": { + "$id": "8278", + "kind": "string", + "type": { + "$ref": "330" + }, + "value": "/subscriptions/0000000-0000-0000-0000-000000000000/resourceGroups/resourceGroup123/providers/Microsoft.IoTOperations/instances/resource-name123/dataflowEndpoints/resource-name123" + }, + "name": { + "$id": "8279", + "kind": "string", + "type": { + "$ref": "335" + }, + "value": "zyhxscudobzfacetvgyjiav" + }, + "type": { + "$id": "8280", + "kind": "string", + "type": { + "$ref": "339" + }, + "value": "iay" + }, + "systemData": { + "$id": "8281", + "kind": "model", + "type": { + "$ref": "344" + }, + "value": { + "$id": "8282", + "createdBy": { + "$id": "8283", + "kind": "string", + "type": { + "$ref": "346" + }, + "value": "ssvaslsmudloholronopqyxjcu" + }, + "createdByType": { + "$id": "8284", + "kind": "string", + "type": { + "$ref": "146" + }, + "value": "User" + }, + "createdAt": { + "$id": "8285", + "kind": "string", + "type": { + "$ref": "353" + }, + "value": "2024-08-09T18:13:29.389Z" + }, + "lastModifiedBy": { + "$id": "8286", + "kind": "string", + "type": { + "$ref": "358" + }, + "value": "gnicpuszwd" + }, + "lastModifiedByType": { + "$id": "8287", + "kind": "string", + "type": { + "$ref": "146" + }, + "value": "User" + }, + "lastModifiedAt": { + "$id": "8288", + "kind": "string", + "type": { + "$ref": "365" + }, + "value": "2024-08-09T18:13:29.389Z" + } + } + } + } + } + } + ] + }, + { + "$id": "8289", + "kind": "http", + "name": "DataflowEndpoint_CreateOrUpdate_EventHub", + "description": "DataflowEndpoint_CreateOrUpdate_EventHub", + "filePath": "2024-11-01/DataflowEndpoint_CreateOrUpdate_EventHub.json", + "parameters": [ + { + "$id": "8290", + "parameter": { + "$ref": "7866" + }, + "value": { + "$id": "8291", + "kind": "string", + "type": { + "$ref": "7867" + }, + "value": "2024-11-01" + } + }, + { + "$id": "8292", + "parameter": { + "$ref": "7870" + }, + "value": { + "$id": "8293", + "kind": "string", + "type": { + "$ref": "7871" + }, + "value": "F8C729F9-DF9C-4743-848F-96EE433D8E53" + } + }, + { + "$id": "8294", + "parameter": { + "$ref": "7873" + }, + "value": { + "$id": "8295", + "kind": "string", + "type": { + "$ref": "7874" + }, + "value": "rgiotoperations" + } + }, + { + "$id": "8296", + "parameter": { + "$ref": "7875" + }, + "value": { + "$id": "8297", + "kind": "string", + "type": { + "$ref": "7876" + }, + "value": "resource-name123" + } + }, + { + "$id": "8298", + "parameter": { + "$ref": "7877" + }, + "value": { + "$id": "8299", + "kind": "string", + "type": { + "$ref": "7878" + }, + "value": "event-hub-endpoint" + } + }, + { + "$id": "8300", + "parameter": { + "$ref": "7885" + }, + "value": { + "$id": "8301", + "kind": "model", + "type": { + "$ref": "326" + }, + "value": { + "$id": "8302", + "properties": { + "$id": "8303", + "kind": "model", + "type": { + "$ref": "372" + }, + "value": { + "$id": "8304", + "endpointType": { + "$id": "8305", + "kind": "string", + "type": { + "$ref": "2" + }, + "value": "Kafka" + }, + "kafkaSettings": { + "$id": "8306", + "kind": "model", + "type": { + "$ref": "503" + }, + "value": { + "$id": "8307", + "host": { + "$id": "8308", + "kind": "string", + "type": { + "$ref": "541" + }, + "value": "example.servicebus.windows.net:9093" + }, + "authentication": { + "$id": "8309", + "kind": "model", + "type": { + "$ref": "505" + }, + "value": { + "$id": "8310", + "method": { + "$id": "8311", + "kind": "string", + "type": { + "$ref": "42" + }, + "value": "SystemAssignedManagedIdentity" + }, + "systemAssignedManagedIdentitySettings": { + "$id": "8312", + "kind": "model", + "type": { + "$ref": "384" + }, + "value": { + "$id": "8313" + } + } + } + }, + "tls": { + "$id": "8314", + "kind": "model", + "type": { + "$ref": "576" + }, + "value": { + "$id": "8315", + "mode": { + "$id": "8316", + "kind": "string", + "type": { + "$ref": "62" + }, + "value": "Enabled" + } + } + }, + "consumerGroupId": { + "$id": "8317", + "kind": "string", + "type": { + "$ref": "537" + }, + "value": "aiodataflows" + } + } + } + } + }, + "extendedLocation": { + "$id": "8318", + "kind": "model", + "type": { + "$ref": "669" + }, + "value": { + "$id": "8319", + "name": { + "$id": "8320", + "kind": "string", + "type": { + "$ref": "671" + }, + "value": "qmbrfwcpwwhggszhrdjv" + }, + "type": { + "$id": "8321", + "kind": "string", + "type": { + "$ref": "142" + }, + "value": "CustomLocation" + } + } + } + } + } + } + ], + "responses": [ + { + "$id": "8322", + "response": { + "$ref": "7886" + }, + "statusCode": 200, + "bodyValue": { + "$id": "8323", + "kind": "model", + "type": { + "$ref": "326" + }, + "value": { + "$id": "8324", + "properties": { + "$id": "8325", + "kind": "model", + "type": { + "$ref": "372" + }, + "value": { + "$id": "8326", + "endpointType": { + "$id": "8327", + "kind": "string", + "type": { + "$ref": "2" + }, + "value": "Kafka" + }, + "kafkaSettings": { + "$id": "8328", + "kind": "model", + "type": { + "$ref": "503" + }, + "value": { + "$id": "8329", + "host": { + "$id": "8330", + "kind": "string", + "type": { + "$ref": "541" + }, + "value": "example.servicebus.windows.net:9093" + }, + "authentication": { + "$id": "8331", + "kind": "model", + "type": { + "$ref": "505" + }, + "value": { + "$id": "8332", + "method": { + "$id": "8333", + "kind": "string", + "type": { + "$ref": "42" + }, + "value": "SystemAssignedManagedIdentity" + }, + "systemAssignedManagedIdentitySettings": { + "$id": "8334", + "kind": "model", + "type": { + "$ref": "384" + }, + "value": { + "$id": "8335" + } + } + } + }, + "tls": { + "$id": "8336", + "kind": "model", + "type": { + "$ref": "576" + }, + "value": { + "$id": "8337", + "mode": { + "$id": "8338", + "kind": "string", + "type": { + "$ref": "62" + }, + "value": "Enabled" + } + } + }, + "consumerGroupId": { + "$id": "8339", + "kind": "string", + "type": { + "$ref": "537" + }, + "value": "aiodataflows" + } + } + }, + "provisioningState": { + "$id": "8340", + "kind": "string", + "type": { + "$ref": "126" + }, + "value": "Succeeded" + } + } + }, + "extendedLocation": { + "$id": "8341", + "kind": "model", + "type": { + "$ref": "669" + }, + "value": { + "$id": "8342", + "name": { + "$id": "8343", + "kind": "string", + "type": { + "$ref": "671" + }, + "value": "qmbrfwcpwwhggszhrdjv" + }, + "type": { + "$id": "8344", + "kind": "string", + "type": { + "$ref": "142" + }, + "value": "CustomLocation" + } + } + }, + "id": { + "$id": "8345", + "kind": "string", + "type": { + "$ref": "330" + }, + "value": "/subscriptions/0000000-0000-0000-0000-000000000000/resourceGroups/resourceGroup123/providers/Microsoft.IoTOperations/instances/resource-name123/dataflowEndpoints/resource-name123" + }, + "name": { + "$id": "8346", + "kind": "string", + "type": { + "$ref": "335" + }, + "value": "zyhxscudobzfacetvgyjiav" + }, + "type": { + "$id": "8347", + "kind": "string", + "type": { + "$ref": "339" + }, + "value": "iay" + }, + "systemData": { + "$id": "8348", + "kind": "model", + "type": { + "$ref": "344" + }, + "value": { + "$id": "8349", + "createdBy": { + "$id": "8350", + "kind": "string", + "type": { + "$ref": "346" + }, + "value": "ssvaslsmudloholronopqyxjcu" + }, + "createdByType": { + "$id": "8351", + "kind": "string", + "type": { + "$ref": "146" + }, + "value": "User" + }, + "createdAt": { + "$id": "8352", + "kind": "string", + "type": { + "$ref": "353" + }, + "value": "2024-08-09T18:13:29.389Z" + }, + "lastModifiedBy": { + "$id": "8353", + "kind": "string", + "type": { + "$ref": "358" + }, + "value": "gnicpuszwd" + }, + "lastModifiedByType": { + "$id": "8354", + "kind": "string", + "type": { + "$ref": "146" + }, + "value": "User" + }, + "lastModifiedAt": { + "$id": "8355", + "kind": "string", + "type": { + "$ref": "365" + }, + "value": "2024-08-09T18:13:29.389Z" + } + } + } + } + } + }, + { + "$id": "8356", + "response": { + "$ref": "7887" + }, + "statusCode": 201, + "bodyValue": { + "$id": "8357", + "kind": "model", + "type": { + "$ref": "326" + }, + "value": { + "$id": "8358", + "properties": { + "$id": "8359", + "kind": "model", + "type": { + "$ref": "372" + }, + "value": { + "$id": "8360", + "endpointType": { + "$id": "8361", + "kind": "string", + "type": { + "$ref": "2" + }, + "value": "Kafka" + }, + "kafkaSettings": { + "$id": "8362", + "kind": "model", + "type": { + "$ref": "503" + }, + "value": { + "$id": "8363", + "host": { + "$id": "8364", + "kind": "string", + "type": { + "$ref": "541" + }, + "value": "example.servicebus.windows.net:9093" + }, + "authentication": { + "$id": "8365", + "kind": "model", + "type": { + "$ref": "505" + }, + "value": { + "$id": "8366", + "method": { + "$id": "8367", + "kind": "string", + "type": { + "$ref": "42" + }, + "value": "SystemAssignedManagedIdentity" + }, + "systemAssignedManagedIdentitySettings": { + "$id": "8368", + "kind": "model", + "type": { + "$ref": "384" + }, + "value": { + "$id": "8369" + } + } + } + }, + "tls": { + "$id": "8370", + "kind": "model", + "type": { + "$ref": "576" + }, + "value": { + "$id": "8371", + "mode": { + "$id": "8372", + "kind": "string", + "type": { + "$ref": "62" + }, + "value": "Enabled" + } + } + }, + "consumerGroupId": { + "$id": "8373", + "kind": "string", + "type": { + "$ref": "537" + }, + "value": "aiodataflows" + } + } + }, + "provisioningState": { + "$id": "8374", + "kind": "string", + "type": { + "$ref": "126" + }, + "value": "Succeeded" + } + } + }, + "extendedLocation": { + "$id": "8375", + "kind": "model", + "type": { + "$ref": "669" + }, + "value": { + "$id": "8376", + "name": { + "$id": "8377", + "kind": "string", + "type": { + "$ref": "671" + }, + "value": "qmbrfwcpwwhggszhrdjv" + }, + "type": { + "$id": "8378", + "kind": "string", + "type": { + "$ref": "142" + }, + "value": "CustomLocation" + } + } + }, + "id": { + "$id": "8379", + "kind": "string", + "type": { + "$ref": "330" + }, + "value": "/subscriptions/0000000-0000-0000-0000-000000000000/resourceGroups/resourceGroup123/providers/Microsoft.IoTOperations/instances/resource-name123/dataflowEndpoints/resource-name123" + }, + "name": { + "$id": "8380", + "kind": "string", + "type": { + "$ref": "335" + }, + "value": "zyhxscudobzfacetvgyjiav" + }, + "type": { + "$id": "8381", + "kind": "string", + "type": { + "$ref": "339" + }, + "value": "iay" + }, + "systemData": { + "$id": "8382", + "kind": "model", + "type": { + "$ref": "344" + }, + "value": { + "$id": "8383", + "createdBy": { + "$id": "8384", + "kind": "string", + "type": { + "$ref": "346" + }, + "value": "ssvaslsmudloholronopqyxjcu" + }, + "createdByType": { + "$id": "8385", + "kind": "string", + "type": { + "$ref": "146" + }, + "value": "User" + }, + "createdAt": { + "$id": "8386", + "kind": "string", + "type": { + "$ref": "353" + }, + "value": "2024-08-09T18:13:29.389Z" + }, + "lastModifiedBy": { + "$id": "8387", + "kind": "string", + "type": { + "$ref": "358" + }, + "value": "gnicpuszwd" + }, + "lastModifiedByType": { + "$id": "8388", + "kind": "string", + "type": { + "$ref": "146" + }, + "value": "User" + }, + "lastModifiedAt": { + "$id": "8389", + "kind": "string", + "type": { + "$ref": "365" + }, + "value": "2024-08-09T18:13:29.389Z" + } + } + } + } + } + } + ] + }, + { + "$id": "8390", + "kind": "http", + "name": "DataflowEndpoint_CreateOrUpdate_Fabric", + "description": "DataflowEndpoint_CreateOrUpdate_Fabric", + "filePath": "2024-11-01/DataflowEndpoint_CreateOrUpdate_Fabric.json", + "parameters": [ + { + "$id": "8391", + "parameter": { + "$ref": "7866" + }, + "value": { + "$id": "8392", + "kind": "string", + "type": { + "$ref": "7867" + }, + "value": "2024-11-01" + } + }, + { + "$id": "8393", + "parameter": { + "$ref": "7870" + }, + "value": { + "$id": "8394", + "kind": "string", + "type": { + "$ref": "7871" + }, + "value": "F8C729F9-DF9C-4743-848F-96EE433D8E53" + } + }, + { + "$id": "8395", + "parameter": { + "$ref": "7873" + }, + "value": { + "$id": "8396", + "kind": "string", + "type": { + "$ref": "7874" + }, + "value": "rgiotoperations" + } + }, + { + "$id": "8397", + "parameter": { + "$ref": "7875" + }, + "value": { + "$id": "8398", + "kind": "string", + "type": { + "$ref": "7876" + }, + "value": "resource-name123" + } + }, + { + "$id": "8399", + "parameter": { + "$ref": "7877" + }, + "value": { + "$id": "8400", + "kind": "string", + "type": { + "$ref": "7878" + }, + "value": "fabric-endpoint" + } + }, + { + "$id": "8401", + "parameter": { + "$ref": "7885" + }, + "value": { + "$id": "8402", + "kind": "model", + "type": { + "$ref": "326" + }, + "value": { + "$id": "8403", + "properties": { + "$id": "8404", + "kind": "model", + "type": { + "$ref": "372" + }, + "value": { + "$id": "8405", + "endpointType": { + "$id": "8406", + "kind": "string", + "type": { + "$ref": "2" + }, + "value": "FabricOneLake" + }, + "fabricOneLakeSettings": { + "$id": "8407", + "kind": "model", + "type": { + "$ref": "464" + }, + "value": { + "$id": "8408", + "host": { + "$id": "8409", + "kind": "string", + "type": { + "$ref": "494" + }, + "value": "onelake.dfs.fabric.microsoft.com" + }, + "authentication": { + "$id": "8410", + "kind": "model", + "type": { + "$ref": "466" + }, + "value": { + "$id": "8411", + "method": { + "$id": "8412", + "kind": "string", + "type": { + "$ref": "30" + }, + "value": "SystemAssignedManagedIdentity" + }, + "systemAssignedManagedIdentitySettings": { + "$id": "8413", + "kind": "model", + "type": { + "$ref": "384" + }, + "value": { + "$id": "8414" + } + } + } + }, + "names": { + "$id": "8415", + "kind": "model", + "type": { + "$ref": "479" + }, + "value": { + "$id": "8416", + "workspaceName": { + "$id": "8417", + "kind": "string", + "type": { + "$ref": "485" + }, + "value": "example-workspace" + }, + "lakehouseName": { + "$id": "8418", + "kind": "string", + "type": { + "$ref": "481" + }, + "value": "example-lakehouse" + } + } + }, + "oneLakePathType": { + "$id": "8419", + "kind": "string", + "type": { + "$ref": "36" + }, + "value": "Tables" + } + } + } + } + }, + "extendedLocation": { + "$id": "8420", + "kind": "model", + "type": { + "$ref": "669" + }, + "value": { + "$id": "8421", + "name": { + "$id": "8422", + "kind": "string", + "type": { + "$ref": "671" + }, + "value": "qmbrfwcpwwhggszhrdjv" + }, + "type": { + "$id": "8423", + "kind": "string", + "type": { + "$ref": "142" + }, + "value": "CustomLocation" + } + } + } + } + } + } + ], + "responses": [ + { + "$id": "8424", + "response": { + "$ref": "7886" + }, + "statusCode": 200, + "bodyValue": { + "$id": "8425", + "kind": "model", + "type": { + "$ref": "326" + }, + "value": { + "$id": "8426", + "properties": { + "$id": "8427", + "kind": "model", + "type": { + "$ref": "372" + }, + "value": { + "$id": "8428", + "endpointType": { + "$id": "8429", + "kind": "string", + "type": { + "$ref": "2" + }, + "value": "FabricOneLake" + }, + "fabricOneLakeSettings": { + "$id": "8430", + "kind": "model", + "type": { + "$ref": "464" + }, + "value": { + "$id": "8431", + "host": { + "$id": "8432", + "kind": "string", + "type": { + "$ref": "494" + }, + "value": "onelake.dfs.fabric.microsoft.com" + }, + "authentication": { + "$id": "8433", + "kind": "model", + "type": { + "$ref": "466" + }, + "value": { + "$id": "8434", + "method": { + "$id": "8435", + "kind": "string", + "type": { + "$ref": "30" + }, + "value": "SystemAssignedManagedIdentity" + }, + "systemAssignedManagedIdentitySettings": { + "$id": "8436", + "kind": "model", + "type": { + "$ref": "384" + }, + "value": { + "$id": "8437" + } + } + } + }, + "names": { + "$id": "8438", + "kind": "model", + "type": { + "$ref": "479" + }, + "value": { + "$id": "8439", + "workspaceName": { + "$id": "8440", + "kind": "string", + "type": { + "$ref": "485" + }, + "value": "example-workspace" + }, + "lakehouseName": { + "$id": "8441", + "kind": "string", + "type": { + "$ref": "481" + }, + "value": "example-lakehouse" + } + } + }, + "oneLakePathType": { + "$id": "8442", + "kind": "string", + "type": { + "$ref": "36" + }, + "value": "Tables" + } + } + }, + "provisioningState": { + "$id": "8443", + "kind": "string", + "type": { + "$ref": "126" + }, + "value": "Succeeded" + } + } + }, + "extendedLocation": { + "$id": "8444", + "kind": "model", + "type": { + "$ref": "669" + }, + "value": { + "$id": "8445", + "name": { + "$id": "8446", + "kind": "string", + "type": { + "$ref": "671" + }, + "value": "qmbrfwcpwwhggszhrdjv" + }, + "type": { + "$id": "8447", + "kind": "string", + "type": { + "$ref": "142" + }, + "value": "CustomLocation" + } + } + }, + "id": { + "$id": "8448", + "kind": "string", + "type": { + "$ref": "330" + }, + "value": "/subscriptions/0000000-0000-0000-0000-000000000000/resourceGroups/resourceGroup123/providers/Microsoft.IoTOperations/instances/resource-name123/dataflowEndpoints/resource-name123" + }, + "name": { + "$id": "8449", + "kind": "string", + "type": { + "$ref": "335" + }, + "value": "zyhxscudobzfacetvgyjiav" + }, + "type": { + "$id": "8450", + "kind": "string", + "type": { + "$ref": "339" + }, + "value": "iay" + }, + "systemData": { + "$id": "8451", + "kind": "model", + "type": { + "$ref": "344" + }, + "value": { + "$id": "8452", + "createdBy": { + "$id": "8453", + "kind": "string", + "type": { + "$ref": "346" + }, + "value": "ssvaslsmudloholronopqyxjcu" + }, + "createdByType": { + "$id": "8454", + "kind": "string", + "type": { + "$ref": "146" + }, + "value": "User" + }, + "createdAt": { + "$id": "8455", + "kind": "string", + "type": { + "$ref": "353" + }, + "value": "2024-08-09T18:13:29.389Z" + }, + "lastModifiedBy": { + "$id": "8456", + "kind": "string", + "type": { + "$ref": "358" + }, + "value": "gnicpuszwd" + }, + "lastModifiedByType": { + "$id": "8457", + "kind": "string", + "type": { + "$ref": "146" + }, + "value": "User" + }, + "lastModifiedAt": { + "$id": "8458", + "kind": "string", + "type": { + "$ref": "365" + }, + "value": "2024-08-09T18:13:29.389Z" + } + } + } + } + } + }, + { + "$id": "8459", + "response": { + "$ref": "7887" + }, + "statusCode": 201, + "bodyValue": { + "$id": "8460", + "kind": "model", + "type": { + "$ref": "326" + }, + "value": { + "$id": "8461", + "properties": { + "$id": "8462", + "kind": "model", + "type": { + "$ref": "372" + }, + "value": { + "$id": "8463", + "endpointType": { + "$id": "8464", + "kind": "string", + "type": { + "$ref": "2" + }, + "value": "FabricOneLake" + }, + "fabricOneLakeSettings": { + "$id": "8465", + "kind": "model", + "type": { + "$ref": "464" + }, + "value": { + "$id": "8466", + "host": { + "$id": "8467", + "kind": "string", + "type": { + "$ref": "494" + }, + "value": "onelake.dfs.fabric.microsoft.com" + }, + "authentication": { + "$id": "8468", + "kind": "model", + "type": { + "$ref": "466" + }, + "value": { + "$id": "8469", + "method": { + "$id": "8470", + "kind": "string", + "type": { + "$ref": "30" + }, + "value": "SystemAssignedManagedIdentity" + }, + "systemAssignedManagedIdentitySettings": { + "$id": "8471", + "kind": "model", + "type": { + "$ref": "384" + }, + "value": { + "$id": "8472" + } + } + } + }, + "names": { + "$id": "8473", + "kind": "model", + "type": { + "$ref": "479" + }, + "value": { + "$id": "8474", + "workspaceName": { + "$id": "8475", + "kind": "string", + "type": { + "$ref": "485" + }, + "value": "example-workspace" + }, + "lakehouseName": { + "$id": "8476", + "kind": "string", + "type": { + "$ref": "481" + }, + "value": "example-lakehouse" + } + } + }, + "oneLakePathType": { + "$id": "8477", + "kind": "string", + "type": { + "$ref": "36" + }, + "value": "Tables" + } + } + }, + "provisioningState": { + "$id": "8478", + "kind": "string", + "type": { + "$ref": "126" + }, + "value": "Succeeded" + } + } + }, + "extendedLocation": { + "$id": "8479", + "kind": "model", + "type": { + "$ref": "669" + }, + "value": { + "$id": "8480", + "name": { + "$id": "8481", + "kind": "string", + "type": { + "$ref": "671" + }, + "value": "qmbrfwcpwwhggszhrdjv" + }, + "type": { + "$id": "8482", + "kind": "string", + "type": { + "$ref": "142" + }, + "value": "CustomLocation" + } + } + }, + "id": { + "$id": "8483", + "kind": "string", + "type": { + "$ref": "330" + }, + "value": "/subscriptions/0000000-0000-0000-0000-000000000000/resourceGroups/resourceGroup123/providers/Microsoft.IoTOperations/instances/resource-name123/dataflowEndpoints/resource-name123" + }, + "name": { + "$id": "8484", + "kind": "string", + "type": { + "$ref": "335" + }, + "value": "zyhxscudobzfacetvgyjiav" + }, + "type": { + "$id": "8485", + "kind": "string", + "type": { + "$ref": "339" + }, + "value": "iay" + }, + "systemData": { + "$id": "8486", + "kind": "model", + "type": { + "$ref": "344" + }, + "value": { + "$id": "8487", + "createdBy": { + "$id": "8488", + "kind": "string", + "type": { + "$ref": "346" + }, + "value": "ssvaslsmudloholronopqyxjcu" + }, + "createdByType": { + "$id": "8489", + "kind": "string", + "type": { + "$ref": "146" + }, + "value": "User" + }, + "createdAt": { + "$id": "8490", + "kind": "string", + "type": { + "$ref": "353" + }, + "value": "2024-08-09T18:13:29.389Z" + }, + "lastModifiedBy": { + "$id": "8491", + "kind": "string", + "type": { + "$ref": "358" + }, + "value": "gnicpuszwd" + }, + "lastModifiedByType": { + "$id": "8492", + "kind": "string", + "type": { + "$ref": "146" + }, + "value": "User" + }, + "lastModifiedAt": { + "$id": "8493", + "kind": "string", + "type": { + "$ref": "365" + }, + "value": "2024-08-09T18:13:29.389Z" + } + } + } + } + } + } + ] + }, + { + "$id": "8494", + "kind": "http", + "name": "DataflowEndpoint_CreateOrUpdate_Kafka", + "description": "DataflowEndpoint_CreateOrUpdate_Kafka", + "filePath": "2024-11-01/DataflowEndpoint_CreateOrUpdate_Kafka.json", + "parameters": [ + { + "$id": "8495", + "parameter": { + "$ref": "7866" + }, + "value": { + "$id": "8496", + "kind": "string", + "type": { + "$ref": "7867" + }, + "value": "2024-11-01" + } + }, + { + "$id": "8497", + "parameter": { + "$ref": "7870" + }, + "value": { + "$id": "8498", + "kind": "string", + "type": { + "$ref": "7871" + }, + "value": "F8C729F9-DF9C-4743-848F-96EE433D8E53" + } + }, + { + "$id": "8499", + "parameter": { + "$ref": "7873" + }, + "value": { + "$id": "8500", + "kind": "string", + "type": { + "$ref": "7874" + }, + "value": "rgiotoperations" + } + }, + { + "$id": "8501", + "parameter": { + "$ref": "7875" + }, + "value": { + "$id": "8502", + "kind": "string", + "type": { + "$ref": "7876" + }, + "value": "resource-name123" + } + }, + { + "$id": "8503", + "parameter": { + "$ref": "7877" + }, + "value": { + "$id": "8504", + "kind": "string", + "type": { + "$ref": "7878" + }, + "value": "generic-kafka-endpoint" + } + }, + { + "$id": "8505", + "parameter": { + "$ref": "7885" + }, + "value": { + "$id": "8506", + "kind": "model", + "type": { + "$ref": "326" + }, + "value": { + "$id": "8507", + "properties": { + "$id": "8508", + "kind": "model", + "type": { + "$ref": "372" + }, + "value": { + "$id": "8509", + "endpointType": { + "$id": "8510", + "kind": "string", + "type": { + "$ref": "2" + }, + "value": "Kafka" + }, + "kafkaSettings": { + "$id": "8511", + "kind": "model", + "type": { + "$ref": "503" + }, + "value": { + "$id": "8512", + "host": { + "$id": "8513", + "kind": "string", + "type": { + "$ref": "541" + }, + "value": "example.kafka.local:9093" + }, + "authentication": { + "$id": "8514", + "kind": "model", + "type": { + "$ref": "505" + }, + "value": { + "$id": "8515", + "method": { + "$id": "8516", + "kind": "string", + "type": { + "$ref": "42" + }, + "value": "Sasl" + }, + "saslSettings": { + "$id": "8517", + "kind": "model", + "type": { + "$ref": "516" + }, + "value": { + "$id": "8518", + "saslType": { + "$id": "8519", + "kind": "string", + "type": { + "$ref": "54" + }, + "value": "Plain" + }, + "secretRef": { + "$id": "8520", + "kind": "string", + "type": { + "$ref": "521" + }, + "value": "my-secret" + } + } + } + } + }, + "tls": { + "$id": "8521", + "kind": "model", + "type": { + "$ref": "576" + }, + "value": { + "$id": "8522", + "mode": { + "$id": "8523", + "kind": "string", + "type": { + "$ref": "62" + }, + "value": "Enabled" + }, + "trustedCaCertificateConfigMapRef": { + "$id": "8524", + "kind": "string", + "type": { + "$ref": "581" + }, + "value": "ca-certificates" + } + } + }, + "consumerGroupId": { + "$id": "8525", + "kind": "string", + "type": { + "$ref": "537" + }, + "value": "dataflows" + }, + "compression": { + "$id": "8526", + "kind": "string", + "type": { + "$ref": "68" + }, + "value": "Gzip" + }, + "batching": { + "$id": "8527", + "kind": "model", + "type": { + "$ref": "545" + }, + "value": { + "$id": "8528", + "mode": { + "$id": "8529", + "kind": "string", + "type": { + "$ref": "62" + }, + "value": "Enabled" + }, + "latencyMs": { + "$id": "8530", + "kind": "number", + "type": { + "$ref": "550" + }, + "value": 5 + }, + "maxBytes": { + "$id": "8531", + "kind": "number", + "type": { + "$ref": "554" + }, + "value": 1000000 + }, + "maxMessages": { + "$id": "8532", + "kind": "number", + "type": { + "$ref": "558" + }, + "value": 100000 + } + } + }, + "partitionStrategy": { + "$id": "8533", + "kind": "string", + "type": { + "$ref": "86" + }, + "value": "Default" + }, + "kafkaAcks": { + "$id": "8534", + "kind": "string", + "type": { + "$ref": "78" + }, + "value": "All" + }, + "copyMqttProperties": { + "$id": "8535", + "kind": "string", + "type": { + "$ref": "62" + }, + "value": "Enabled" + }, + "cloudEventAttributes": { + "$id": "8536", + "kind": "string", + "type": { + "$ref": "96" + }, + "value": "Propagate" + } + } + } + } + }, + "extendedLocation": { + "$id": "8537", + "kind": "model", + "type": { + "$ref": "669" + }, + "value": { + "$id": "8538", + "name": { + "$id": "8539", + "kind": "string", + "type": { + "$ref": "671" + }, + "value": "qmbrfwcpwwhggszhrdjv" + }, + "type": { + "$id": "8540", + "kind": "string", + "type": { + "$ref": "142" + }, + "value": "CustomLocation" + } + } + } + } + } + } + ], + "responses": [ + { + "$id": "8541", + "response": { + "$ref": "7886" + }, + "statusCode": 200, + "bodyValue": { + "$id": "8542", + "kind": "model", + "type": { + "$ref": "326" + }, + "value": { + "$id": "8543", + "properties": { + "$id": "8544", + "kind": "model", + "type": { + "$ref": "372" + }, + "value": { + "$id": "8545", + "endpointType": { + "$id": "8546", + "kind": "string", + "type": { + "$ref": "2" + }, + "value": "Kafka" + }, + "kafkaSettings": { + "$id": "8547", + "kind": "model", + "type": { + "$ref": "503" + }, + "value": { + "$id": "8548", + "host": { + "$id": "8549", + "kind": "string", + "type": { + "$ref": "541" + }, + "value": "example.kafka.local:9093" + }, + "authentication": { + "$id": "8550", + "kind": "model", + "type": { + "$ref": "505" + }, + "value": { + "$id": "8551", + "method": { + "$id": "8552", + "kind": "string", + "type": { + "$ref": "42" + }, + "value": "Sasl" + }, + "saslSettings": { + "$id": "8553", + "kind": "model", + "type": { + "$ref": "516" + }, + "value": { + "$id": "8554", + "saslType": { + "$id": "8555", + "kind": "string", + "type": { + "$ref": "54" + }, + "value": "Plain" + }, + "secretRef": { + "$id": "8556", + "kind": "string", + "type": { + "$ref": "521" + }, + "value": "my-secret" + } + } + } + } + }, + "tls": { + "$id": "8557", + "kind": "model", + "type": { + "$ref": "576" + }, + "value": { + "$id": "8558", + "mode": { + "$id": "8559", + "kind": "string", + "type": { + "$ref": "62" + }, + "value": "Enabled" + }, + "trustedCaCertificateConfigMapRef": { + "$id": "8560", + "kind": "string", + "type": { + "$ref": "581" + }, + "value": "ca-certificates" + } + } + }, + "consumerGroupId": { + "$id": "8561", + "kind": "string", + "type": { + "$ref": "537" + }, + "value": "dataflows" + }, + "compression": { + "$id": "8562", + "kind": "string", + "type": { + "$ref": "68" + }, + "value": "Gzip" + }, + "batching": { + "$id": "8563", + "kind": "model", + "type": { + "$ref": "545" + }, + "value": { + "$id": "8564", + "mode": { + "$id": "8565", + "kind": "string", + "type": { + "$ref": "62" + }, + "value": "Enabled" + }, + "latencyMs": { + "$id": "8566", + "kind": "number", + "type": { + "$ref": "550" + }, + "value": 5 + }, + "maxBytes": { + "$id": "8567", + "kind": "number", + "type": { + "$ref": "554" + }, + "value": 1000000 + }, + "maxMessages": { + "$id": "8568", + "kind": "number", + "type": { + "$ref": "558" + }, + "value": 100000 + } + } + }, + "partitionStrategy": { + "$id": "8569", + "kind": "string", + "type": { + "$ref": "86" + }, + "value": "Default" + }, + "kafkaAcks": { + "$id": "8570", + "kind": "string", + "type": { + "$ref": "78" + }, + "value": "All" + }, + "copyMqttProperties": { + "$id": "8571", + "kind": "string", + "type": { + "$ref": "62" + }, + "value": "Enabled" + }, + "cloudEventAttributes": { + "$id": "8572", + "kind": "string", + "type": { + "$ref": "96" + }, + "value": "Propagate" + } + } + }, + "provisioningState": { + "$id": "8573", + "kind": "string", + "type": { + "$ref": "126" + }, + "value": "Succeeded" + } + } + }, + "extendedLocation": { + "$id": "8574", + "kind": "model", + "type": { + "$ref": "669" + }, + "value": { + "$id": "8575", + "name": { + "$id": "8576", + "kind": "string", + "type": { + "$ref": "671" + }, + "value": "qmbrfwcpwwhggszhrdjv" + }, + "type": { + "$id": "8577", + "kind": "string", + "type": { + "$ref": "142" + }, + "value": "CustomLocation" + } + } + }, + "id": { + "$id": "8578", + "kind": "string", + "type": { + "$ref": "330" + }, + "value": "/subscriptions/0000000-0000-0000-0000-000000000000/resourceGroups/resourceGroup123/providers/Microsoft.IoTOperations/instances/resource-name123/dataflowEndpoints/resource-name123" + }, + "name": { + "$id": "8579", + "kind": "string", + "type": { + "$ref": "335" + }, + "value": "zyhxscudobzfacetvgyjiav" + }, + "type": { + "$id": "8580", + "kind": "string", + "type": { + "$ref": "339" + }, + "value": "iay" + }, + "systemData": { + "$id": "8581", + "kind": "model", + "type": { + "$ref": "344" + }, + "value": { + "$id": "8582", + "createdBy": { + "$id": "8583", + "kind": "string", + "type": { + "$ref": "346" + }, + "value": "ssvaslsmudloholronopqyxjcu" + }, + "createdByType": { + "$id": "8584", + "kind": "string", + "type": { + "$ref": "146" + }, + "value": "User" + }, + "createdAt": { + "$id": "8585", + "kind": "string", + "type": { + "$ref": "353" + }, + "value": "2024-08-09T18:13:29.389Z" + }, + "lastModifiedBy": { + "$id": "8586", + "kind": "string", + "type": { + "$ref": "358" + }, + "value": "gnicpuszwd" + }, + "lastModifiedByType": { + "$id": "8587", + "kind": "string", + "type": { + "$ref": "146" + }, + "value": "User" + }, + "lastModifiedAt": { + "$id": "8588", + "kind": "string", + "type": { + "$ref": "365" + }, + "value": "2024-08-09T18:13:29.389Z" + } + } + } + } + } + }, + { + "$id": "8589", + "response": { + "$ref": "7887" + }, + "statusCode": 201, + "bodyValue": { + "$id": "8590", + "kind": "model", + "type": { + "$ref": "326" + }, + "value": { + "$id": "8591", + "properties": { + "$id": "8592", + "kind": "model", + "type": { + "$ref": "372" + }, + "value": { + "$id": "8593", + "endpointType": { + "$id": "8594", + "kind": "string", + "type": { + "$ref": "2" + }, + "value": "Kafka" + }, + "kafkaSettings": { + "$id": "8595", + "kind": "model", + "type": { + "$ref": "503" + }, + "value": { + "$id": "8596", + "host": { + "$id": "8597", + "kind": "string", + "type": { + "$ref": "541" + }, + "value": "example.kafka.local:9093" + }, + "authentication": { + "$id": "8598", + "kind": "model", + "type": { + "$ref": "505" + }, + "value": { + "$id": "8599", + "method": { + "$id": "8600", + "kind": "string", + "type": { + "$ref": "42" + }, + "value": "Sasl" + }, + "saslSettings": { + "$id": "8601", + "kind": "model", + "type": { + "$ref": "516" + }, + "value": { + "$id": "8602", + "saslType": { + "$id": "8603", + "kind": "string", + "type": { + "$ref": "54" + }, + "value": "Plain" + }, + "secretRef": { + "$id": "8604", + "kind": "string", + "type": { + "$ref": "521" + }, + "value": "my-secret" + } + } + } + } + }, + "tls": { + "$id": "8605", + "kind": "model", + "type": { + "$ref": "576" + }, + "value": { + "$id": "8606", + "mode": { + "$id": "8607", + "kind": "string", + "type": { + "$ref": "62" + }, + "value": "Enabled" + }, + "trustedCaCertificateConfigMapRef": { + "$id": "8608", + "kind": "string", + "type": { + "$ref": "581" + }, + "value": "ca-certificates" + } + } + }, + "consumerGroupId": { + "$id": "8609", + "kind": "string", + "type": { + "$ref": "537" + }, + "value": "dataflows" + }, + "compression": { + "$id": "8610", + "kind": "string", + "type": { + "$ref": "68" + }, + "value": "Gzip" + }, + "batching": { + "$id": "8611", + "kind": "model", + "type": { + "$ref": "545" + }, + "value": { + "$id": "8612", + "mode": { + "$id": "8613", + "kind": "string", + "type": { + "$ref": "62" + }, + "value": "Enabled" + }, + "latencyMs": { + "$id": "8614", + "kind": "number", + "type": { + "$ref": "550" + }, + "value": 5 + }, + "maxBytes": { + "$id": "8615", + "kind": "number", + "type": { + "$ref": "554" + }, + "value": 1000000 + }, + "maxMessages": { + "$id": "8616", + "kind": "number", + "type": { + "$ref": "558" + }, + "value": 100000 + } + } + }, + "partitionStrategy": { + "$id": "8617", + "kind": "string", + "type": { + "$ref": "86" + }, + "value": "Default" + }, + "kafkaAcks": { + "$id": "8618", + "kind": "string", + "type": { + "$ref": "78" + }, + "value": "All" + }, + "copyMqttProperties": { + "$id": "8619", + "kind": "string", + "type": { + "$ref": "62" + }, + "value": "Enabled" + }, + "cloudEventAttributes": { + "$id": "8620", + "kind": "string", + "type": { + "$ref": "96" + }, + "value": "Propagate" + } + } + }, + "provisioningState": { + "$id": "8621", + "kind": "string", + "type": { + "$ref": "126" + }, + "value": "Succeeded" + } + } + }, + "extendedLocation": { + "$id": "8622", + "kind": "model", + "type": { + "$ref": "669" + }, + "value": { + "$id": "8623", + "name": { + "$id": "8624", + "kind": "string", + "type": { + "$ref": "671" + }, + "value": "qmbrfwcpwwhggszhrdjv" + }, + "type": { + "$id": "8625", + "kind": "string", + "type": { + "$ref": "142" + }, + "value": "CustomLocation" + } + } + }, + "id": { + "$id": "8626", + "kind": "string", + "type": { + "$ref": "330" + }, + "value": "/subscriptions/0000000-0000-0000-0000-000000000000/resourceGroups/resourceGroup123/providers/Microsoft.IoTOperations/instances/resource-name123/dataflowEndpoints/resource-name123" + }, + "name": { + "$id": "8627", + "kind": "string", + "type": { + "$ref": "335" + }, + "value": "zyhxscudobzfacetvgyjiav" + }, + "type": { + "$id": "8628", + "kind": "string", + "type": { + "$ref": "339" + }, + "value": "iay" + }, + "systemData": { + "$id": "8629", + "kind": "model", + "type": { + "$ref": "344" + }, + "value": { + "$id": "8630", + "createdBy": { + "$id": "8631", + "kind": "string", + "type": { + "$ref": "346" + }, + "value": "ssvaslsmudloholronopqyxjcu" + }, + "createdByType": { + "$id": "8632", + "kind": "string", + "type": { + "$ref": "146" + }, + "value": "User" + }, + "createdAt": { + "$id": "8633", + "kind": "string", + "type": { + "$ref": "353" + }, + "value": "2024-08-09T18:13:29.389Z" + }, + "lastModifiedBy": { + "$id": "8634", + "kind": "string", + "type": { + "$ref": "358" + }, + "value": "gnicpuszwd" + }, + "lastModifiedByType": { + "$id": "8635", + "kind": "string", + "type": { + "$ref": "146" + }, + "value": "User" + }, + "lastModifiedAt": { + "$id": "8636", + "kind": "string", + "type": { + "$ref": "365" + }, + "value": "2024-08-09T18:13:29.389Z" + } + } + } + } + } + } + ] + }, + { + "$id": "8637", + "kind": "http", + "name": "DataflowEndpoint_CreateOrUpdate_LocalStorage", + "description": "DataflowEndpoint_CreateOrUpdate_LocalStorage", + "filePath": "2024-11-01/DataflowEndpoint_CreateOrUpdate_LocalStorage.json", + "parameters": [ + { + "$id": "8638", + "parameter": { + "$ref": "7866" + }, + "value": { + "$id": "8639", + "kind": "string", + "type": { + "$ref": "7867" + }, + "value": "2024-11-01" + } + }, + { + "$id": "8640", + "parameter": { + "$ref": "7870" + }, + "value": { + "$id": "8641", + "kind": "string", + "type": { + "$ref": "7871" + }, + "value": "F8C729F9-DF9C-4743-848F-96EE433D8E53" + } + }, + { + "$id": "8642", + "parameter": { + "$ref": "7873" + }, + "value": { + "$id": "8643", + "kind": "string", + "type": { + "$ref": "7874" + }, + "value": "rgiotoperations" + } + }, + { + "$id": "8644", + "parameter": { + "$ref": "7875" + }, + "value": { + "$id": "8645", + "kind": "string", + "type": { + "$ref": "7876" + }, + "value": "resource-name123" + } + }, + { + "$id": "8646", + "parameter": { + "$ref": "7877" + }, + "value": { + "$id": "8647", + "kind": "string", + "type": { + "$ref": "7878" + }, + "value": "local-storage-endpoint" + } + }, + { + "$id": "8648", + "parameter": { + "$ref": "7885" + }, + "value": { + "$id": "8649", + "kind": "model", + "type": { + "$ref": "326" + }, + "value": { + "$id": "8650", + "properties": { + "$id": "8651", + "kind": "model", + "type": { + "$ref": "372" + }, + "value": { + "$id": "8652", + "endpointType": { + "$id": "8653", + "kind": "string", + "type": { + "$ref": "2" + }, + "value": "LocalStorage" + }, + "localStorageSettings": { + "$id": "8654", + "kind": "model", + "type": { + "$ref": "592" + }, + "value": { + "$id": "8655", + "persistentVolumeClaimRef": { + "$id": "8656", + "kind": "string", + "type": { + "$ref": "594" + }, + "value": "example-pvc" + } + } + } + } + }, + "extendedLocation": { + "$id": "8657", + "kind": "model", + "type": { + "$ref": "669" + }, + "value": { + "$id": "8658", + "name": { + "$id": "8659", + "kind": "string", + "type": { + "$ref": "671" + }, + "value": "qmbrfwcpwwhggszhrdjv" + }, + "type": { + "$id": "8660", + "kind": "string", + "type": { + "$ref": "142" + }, + "value": "CustomLocation" + } + } + } + } + } + } + ], + "responses": [ + { + "$id": "8661", + "response": { + "$ref": "7886" + }, + "statusCode": 200, + "bodyValue": { + "$id": "8662", + "kind": "model", + "type": { + "$ref": "326" + }, + "value": { + "$id": "8663", + "properties": { + "$id": "8664", + "kind": "model", + "type": { + "$ref": "372" + }, + "value": { + "$id": "8665", + "endpointType": { + "$id": "8666", + "kind": "string", + "type": { + "$ref": "2" + }, + "value": "LocalStorage" + }, + "localStorageSettings": { + "$id": "8667", + "kind": "model", + "type": { + "$ref": "592" + }, + "value": { + "$id": "8668", + "persistentVolumeClaimRef": { + "$id": "8669", + "kind": "string", + "type": { + "$ref": "594" + }, + "value": "example-pvc" + } + } + }, + "provisioningState": { + "$id": "8670", + "kind": "string", + "type": { + "$ref": "126" + }, + "value": "Succeeded" + } + } + }, + "extendedLocation": { + "$id": "8671", + "kind": "model", + "type": { + "$ref": "669" + }, + "value": { + "$id": "8672", + "name": { + "$id": "8673", + "kind": "string", + "type": { + "$ref": "671" + }, + "value": "qmbrfwcpwwhggszhrdjv" + }, + "type": { + "$id": "8674", + "kind": "string", + "type": { + "$ref": "142" + }, + "value": "CustomLocation" + } + } + }, + "id": { + "$id": "8675", + "kind": "string", + "type": { + "$ref": "330" + }, + "value": "/subscriptions/0000000-0000-0000-0000-000000000000/resourceGroups/resourceGroup123/providers/Microsoft.IoTOperations/instances/resource-name123/dataflowEndpoints/resource-name123" + }, + "name": { + "$id": "8676", + "kind": "string", + "type": { + "$ref": "335" + }, + "value": "zyhxscudobzfacetvgyjiav" + }, + "type": { + "$id": "8677", + "kind": "string", + "type": { + "$ref": "339" + }, + "value": "iay" + }, + "systemData": { + "$id": "8678", + "kind": "model", + "type": { + "$ref": "344" + }, + "value": { + "$id": "8679", + "createdBy": { + "$id": "8680", + "kind": "string", + "type": { + "$ref": "346" + }, + "value": "ssvaslsmudloholronopqyxjcu" + }, + "createdByType": { + "$id": "8681", + "kind": "string", + "type": { + "$ref": "146" + }, + "value": "User" + }, + "createdAt": { + "$id": "8682", + "kind": "string", + "type": { + "$ref": "353" + }, + "value": "2024-08-09T18:13:29.389Z" + }, + "lastModifiedBy": { + "$id": "8683", + "kind": "string", + "type": { + "$ref": "358" + }, + "value": "gnicpuszwd" + }, + "lastModifiedByType": { + "$id": "8684", + "kind": "string", + "type": { + "$ref": "146" + }, + "value": "User" + }, + "lastModifiedAt": { + "$id": "8685", + "kind": "string", + "type": { + "$ref": "365" + }, + "value": "2024-08-09T18:13:29.389Z" + } + } + } + } + } + }, + { + "$id": "8686", + "response": { + "$ref": "7887" + }, + "statusCode": 201, + "bodyValue": { + "$id": "8687", + "kind": "model", + "type": { + "$ref": "326" + }, + "value": { + "$id": "8688", + "properties": { + "$id": "8689", + "kind": "model", + "type": { + "$ref": "372" + }, + "value": { + "$id": "8690", + "endpointType": { + "$id": "8691", + "kind": "string", + "type": { + "$ref": "2" + }, + "value": "LocalStorage" + }, + "localStorageSettings": { + "$id": "8692", + "kind": "model", + "type": { + "$ref": "592" + }, + "value": { + "$id": "8693", + "persistentVolumeClaimRef": { + "$id": "8694", + "kind": "string", + "type": { + "$ref": "594" + }, + "value": "example-pvc" + } + } + }, + "provisioningState": { + "$id": "8695", + "kind": "string", + "type": { + "$ref": "126" + }, + "value": "Succeeded" + } + } + }, + "extendedLocation": { + "$id": "8696", + "kind": "model", + "type": { + "$ref": "669" + }, + "value": { + "$id": "8697", + "name": { + "$id": "8698", + "kind": "string", + "type": { + "$ref": "671" + }, + "value": "qmbrfwcpwwhggszhrdjv" + }, + "type": { + "$id": "8699", + "kind": "string", + "type": { + "$ref": "142" + }, + "value": "CustomLocation" + } + } + }, + "id": { + "$id": "8700", + "kind": "string", + "type": { + "$ref": "330" + }, + "value": "/subscriptions/0000000-0000-0000-0000-000000000000/resourceGroups/resourceGroup123/providers/Microsoft.IoTOperations/instances/resource-name123/dataflowEndpoints/resource-name123" + }, + "name": { + "$id": "8701", + "kind": "string", + "type": { + "$ref": "335" + }, + "value": "zyhxscudobzfacetvgyjiav" + }, + "type": { + "$id": "8702", + "kind": "string", + "type": { + "$ref": "339" + }, + "value": "iay" + }, + "systemData": { + "$id": "8703", + "kind": "model", + "type": { + "$ref": "344" + }, + "value": { + "$id": "8704", + "createdBy": { + "$id": "8705", + "kind": "string", + "type": { + "$ref": "346" + }, + "value": "ssvaslsmudloholronopqyxjcu" + }, + "createdByType": { + "$id": "8706", + "kind": "string", + "type": { + "$ref": "146" + }, + "value": "User" + }, + "createdAt": { + "$id": "8707", + "kind": "string", + "type": { + "$ref": "353" + }, + "value": "2024-08-09T18:13:29.389Z" + }, + "lastModifiedBy": { + "$id": "8708", + "kind": "string", + "type": { + "$ref": "358" + }, + "value": "gnicpuszwd" + }, + "lastModifiedByType": { + "$id": "8709", + "kind": "string", + "type": { + "$ref": "146" + }, + "value": "User" + }, + "lastModifiedAt": { + "$id": "8710", + "kind": "string", + "type": { + "$ref": "365" + }, + "value": "2024-08-09T18:13:29.389Z" + } + } + } + } + } + } + ] + }, + { + "$id": "8711", + "kind": "http", + "name": "DataflowEndpoint_CreateOrUpdate_MQTT", + "description": "DataflowEndpoint_CreateOrUpdate_MQTT", + "filePath": "2024-11-01/DataflowEndpoint_CreateOrUpdate_MQTT.json", + "parameters": [ + { + "$id": "8712", + "parameter": { + "$ref": "7866" + }, + "value": { + "$id": "8713", + "kind": "string", + "type": { + "$ref": "7867" + }, + "value": "2024-11-01" + } + }, + { + "$id": "8714", + "parameter": { + "$ref": "7870" + }, + "value": { + "$id": "8715", + "kind": "string", + "type": { + "$ref": "7871" + }, + "value": "F8C729F9-DF9C-4743-848F-96EE433D8E53" + } + }, + { + "$id": "8716", + "parameter": { + "$ref": "7873" + }, + "value": { + "$id": "8717", + "kind": "string", + "type": { + "$ref": "7874" + }, + "value": "rgiotoperations" + } + }, + { + "$id": "8718", + "parameter": { + "$ref": "7875" + }, + "value": { + "$id": "8719", + "kind": "string", + "type": { + "$ref": "7876" + }, + "value": "resource-name123" + } + }, + { + "$id": "8720", + "parameter": { + "$ref": "7877" + }, + "value": { + "$id": "8721", + "kind": "string", + "type": { + "$ref": "7878" + }, + "value": "generic-mqtt-broker-endpoint" + } + }, + { + "$id": "8722", + "parameter": { + "$ref": "7885" + }, + "value": { + "$id": "8723", + "kind": "model", + "type": { + "$ref": "326" + }, + "value": { + "$id": "8724", + "properties": { + "$id": "8725", + "kind": "model", + "type": { + "$ref": "372" + }, + "value": { + "$id": "8726", + "endpointType": { + "$id": "8727", + "kind": "string", + "type": { + "$ref": "2" + }, + "value": "Mqtt" + }, + "mqttSettings": { + "$id": "8728", + "kind": "model", + "type": { + "$ref": "600" + }, + "value": { + "$id": "8729", + "host": { + "$id": "8730", + "kind": "string", + "type": { + "$ref": "630" + }, + "value": "example.broker.local:1883" + }, + "authentication": { + "$id": "8731", + "kind": "model", + "type": { + "$ref": "602" + }, + "value": { + "$id": "8732", + "method": { + "$id": "8733", + "kind": "string", + "type": { + "$ref": "102" + }, + "value": "X509Certificate" + }, + "x509CertificateSettings": { + "$id": "8734", + "kind": "model", + "type": { + "$ref": "527" + }, + "value": { + "$id": "8735", + "secretRef": { + "$id": "8736", + "kind": "string", + "type": { + "$ref": "529" + }, + "value": "example-secret" + } + } + } + } + }, + "tls": { + "$id": "8737", + "kind": "model", + "type": { + "$ref": "576" + }, + "value": { + "$id": "8738", + "mode": { + "$id": "8739", + "kind": "string", + "type": { + "$ref": "62" + }, + "value": "Disabled" + } + } + }, + "clientIdPrefix": { + "$id": "8740", + "kind": "string", + "type": { + "$ref": "626" + }, + "value": "factory-gateway" + }, + "retain": { + "$id": "8741", + "kind": "string", + "type": { + "$ref": "120" + }, + "value": "Keep" + }, + "sessionExpirySeconds": { + "$id": "8742", + "kind": "number", + "type": { + "$ref": "652" + }, + "value": 3600 + }, + "qos": { + "$id": "8743", + "kind": "number", + "type": { + "$ref": "648" + }, + "value": 1 + }, + "protocol": { + "$id": "8744", + "kind": "string", + "type": { + "$ref": "114" + }, + "value": "WebSockets" + }, + "maxInflightMessages": { + "$id": "8745", + "kind": "number", + "type": { + "$ref": "644" + }, + "value": 100 + }, + "keepAliveSeconds": { + "$id": "8746", + "kind": "number", + "type": { + "$ref": "637" + }, + "value": 60 + } + } + } + } + }, + "extendedLocation": { + "$id": "8747", + "kind": "model", + "type": { + "$ref": "669" + }, + "value": { + "$id": "8748", + "name": { + "$id": "8749", + "kind": "string", + "type": { + "$ref": "671" + }, + "value": "qmbrfwcpwwhggszhrdjv" + }, + "type": { + "$id": "8750", + "kind": "string", + "type": { + "$ref": "142" + }, + "value": "CustomLocation" + } + } + } + } + } + } + ], + "responses": [ + { + "$id": "8751", + "response": { + "$ref": "7886" + }, + "statusCode": 200, + "bodyValue": { + "$id": "8752", + "kind": "model", + "type": { + "$ref": "326" + }, + "value": { + "$id": "8753", + "properties": { + "$id": "8754", + "kind": "model", + "type": { + "$ref": "372" + }, + "value": { + "$id": "8755", + "endpointType": { + "$id": "8756", + "kind": "string", + "type": { + "$ref": "2" + }, + "value": "Mqtt" + }, + "mqttSettings": { + "$id": "8757", + "kind": "model", + "type": { + "$ref": "600" + }, + "value": { + "$id": "8758", + "host": { + "$id": "8759", + "kind": "string", + "type": { + "$ref": "630" + }, + "value": "example.broker.local:1883" + }, + "authentication": { + "$id": "8760", + "kind": "model", + "type": { + "$ref": "602" + }, + "value": { + "$id": "8761", + "method": { + "$id": "8762", + "kind": "string", + "type": { + "$ref": "102" + }, + "value": "X509Certificate" + }, + "x509CertificateSettings": { + "$id": "8763", + "kind": "model", + "type": { + "$ref": "527" + }, + "value": { + "$id": "8764", + "secretRef": { + "$id": "8765", + "kind": "string", + "type": { + "$ref": "529" + }, + "value": "example-secret" + } + } + } + } + }, + "tls": { + "$id": "8766", + "kind": "model", + "type": { + "$ref": "576" + }, + "value": { + "$id": "8767", + "mode": { + "$id": "8768", + "kind": "string", + "type": { + "$ref": "62" + }, + "value": "Disabled" + } + } + }, + "clientIdPrefix": { + "$id": "8769", + "kind": "string", + "type": { + "$ref": "626" + }, + "value": "factory-gateway" + }, + "retain": { + "$id": "8770", + "kind": "string", + "type": { + "$ref": "120" + }, + "value": "Keep" + }, + "sessionExpirySeconds": { + "$id": "8771", + "kind": "number", + "type": { + "$ref": "652" + }, + "value": 3600 + }, + "qos": { + "$id": "8772", + "kind": "number", + "type": { + "$ref": "648" + }, + "value": 1 + }, + "protocol": { + "$id": "8773", + "kind": "string", + "type": { + "$ref": "114" + }, + "value": "WebSockets" + }, + "maxInflightMessages": { + "$id": "8774", + "kind": "number", + "type": { + "$ref": "644" + }, + "value": 100 + }, + "keepAliveSeconds": { + "$id": "8775", + "kind": "number", + "type": { + "$ref": "637" + }, + "value": 60 + } + } + }, + "provisioningState": { + "$id": "8776", + "kind": "string", + "type": { + "$ref": "126" + }, + "value": "Succeeded" + } + } + }, + "extendedLocation": { + "$id": "8777", + "kind": "model", + "type": { + "$ref": "669" + }, + "value": { + "$id": "8778", + "name": { + "$id": "8779", + "kind": "string", + "type": { + "$ref": "671" + }, + "value": "qmbrfwcpwwhggszhrdjv" + }, + "type": { + "$id": "8780", + "kind": "string", + "type": { + "$ref": "142" + }, + "value": "CustomLocation" + } + } + }, + "id": { + "$id": "8781", + "kind": "string", + "type": { + "$ref": "330" + }, + "value": "/subscriptions/0000000-0000-0000-0000-000000000000/resourceGroups/resourceGroup123/providers/Microsoft.IoTOperations/instances/resource-name123/dataflowEndpoints/resource-name123" + }, + "name": { + "$id": "8782", + "kind": "string", + "type": { + "$ref": "335" + }, + "value": "zyhxscudobzfacetvgyjiav" + }, + "type": { + "$id": "8783", + "kind": "string", + "type": { + "$ref": "339" + }, + "value": "iay" + }, + "systemData": { + "$id": "8784", + "kind": "model", + "type": { + "$ref": "344" + }, + "value": { + "$id": "8785", + "createdBy": { + "$id": "8786", + "kind": "string", + "type": { + "$ref": "346" + }, + "value": "ssvaslsmudloholronopqyxjcu" + }, + "createdByType": { + "$id": "8787", + "kind": "string", + "type": { + "$ref": "146" + }, + "value": "User" + }, + "createdAt": { + "$id": "8788", + "kind": "string", + "type": { + "$ref": "353" + }, + "value": "2024-08-09T18:13:29.389Z" + }, + "lastModifiedBy": { + "$id": "8789", + "kind": "string", + "type": { + "$ref": "358" + }, + "value": "gnicpuszwd" + }, + "lastModifiedByType": { + "$id": "8790", + "kind": "string", + "type": { + "$ref": "146" + }, + "value": "User" + }, + "lastModifiedAt": { + "$id": "8791", + "kind": "string", + "type": { + "$ref": "365" + }, + "value": "2024-08-09T18:13:29.389Z" + } + } + } + } + } + }, + { + "$id": "8792", + "response": { + "$ref": "7887" + }, + "statusCode": 201, + "bodyValue": { + "$id": "8793", + "kind": "model", + "type": { + "$ref": "326" + }, + "value": { + "$id": "8794", + "properties": { + "$id": "8795", + "kind": "model", + "type": { + "$ref": "372" + }, + "value": { + "$id": "8796", + "endpointType": { + "$id": "8797", + "kind": "string", + "type": { + "$ref": "2" + }, + "value": "Mqtt" + }, + "mqttSettings": { + "$id": "8798", + "kind": "model", + "type": { + "$ref": "600" + }, + "value": { + "$id": "8799", + "host": { + "$id": "8800", + "kind": "string", + "type": { + "$ref": "630" + }, + "value": "example.broker.local:1883" + }, + "authentication": { + "$id": "8801", + "kind": "model", + "type": { + "$ref": "602" + }, + "value": { + "$id": "8802", + "method": { + "$id": "8803", + "kind": "string", + "type": { + "$ref": "102" + }, + "value": "X509Certificate" + }, + "x509CertificateSettings": { + "$id": "8804", + "kind": "model", + "type": { + "$ref": "527" + }, + "value": { + "$id": "8805", + "secretRef": { + "$id": "8806", + "kind": "string", + "type": { + "$ref": "529" + }, + "value": "example-secret" + } + } + } + } + }, + "tls": { + "$id": "8807", + "kind": "model", + "type": { + "$ref": "576" + }, + "value": { + "$id": "8808", + "mode": { + "$id": "8809", + "kind": "string", + "type": { + "$ref": "62" + }, + "value": "Disabled" + } + } + }, + "clientIdPrefix": { + "$id": "8810", + "kind": "string", + "type": { + "$ref": "626" + }, + "value": "factory-gateway" + }, + "retain": { + "$id": "8811", + "kind": "string", + "type": { + "$ref": "120" + }, + "value": "Keep" + }, + "sessionExpirySeconds": { + "$id": "8812", + "kind": "number", + "type": { + "$ref": "652" + }, + "value": 3600 + }, + "qos": { + "$id": "8813", + "kind": "number", + "type": { + "$ref": "648" + }, + "value": 1 + }, + "protocol": { + "$id": "8814", + "kind": "string", + "type": { + "$ref": "114" + }, + "value": "WebSockets" + }, + "maxInflightMessages": { + "$id": "8815", + "kind": "number", + "type": { + "$ref": "644" + }, + "value": 100 + }, + "keepAliveSeconds": { + "$id": "8816", + "kind": "number", + "type": { + "$ref": "637" + }, + "value": 60 + } + } + }, + "provisioningState": { + "$id": "8817", + "kind": "string", + "type": { + "$ref": "126" + }, + "value": "Succeeded" + } + } + }, + "extendedLocation": { + "$id": "8818", + "kind": "model", + "type": { + "$ref": "669" + }, + "value": { + "$id": "8819", + "name": { + "$id": "8820", + "kind": "string", + "type": { + "$ref": "671" + }, + "value": "qmbrfwcpwwhggszhrdjv" + }, + "type": { + "$id": "8821", + "kind": "string", + "type": { + "$ref": "142" + }, + "value": "CustomLocation" + } + } + }, + "id": { + "$id": "8822", + "kind": "string", + "type": { + "$ref": "330" + }, + "value": "/subscriptions/0000000-0000-0000-0000-000000000000/resourceGroups/resourceGroup123/providers/Microsoft.IoTOperations/instances/resource-name123/dataflowEndpoints/resource-name123" + }, + "name": { + "$id": "8823", + "kind": "string", + "type": { + "$ref": "335" + }, + "value": "zyhxscudobzfacetvgyjiav" + }, + "type": { + "$id": "8824", + "kind": "string", + "type": { + "$ref": "339" + }, + "value": "iay" + }, + "systemData": { + "$id": "8825", + "kind": "model", + "type": { + "$ref": "344" + }, + "value": { + "$id": "8826", + "createdBy": { + "$id": "8827", + "kind": "string", + "type": { + "$ref": "346" + }, + "value": "ssvaslsmudloholronopqyxjcu" + }, + "createdByType": { + "$id": "8828", + "kind": "string", + "type": { + "$ref": "146" + }, + "value": "User" + }, + "createdAt": { + "$id": "8829", + "kind": "string", + "type": { + "$ref": "353" + }, + "value": "2024-08-09T18:13:29.389Z" + }, + "lastModifiedBy": { + "$id": "8830", + "kind": "string", + "type": { + "$ref": "358" + }, + "value": "gnicpuszwd" + }, + "lastModifiedByType": { + "$id": "8831", + "kind": "string", + "type": { + "$ref": "146" + }, + "value": "User" + }, + "lastModifiedAt": { + "$id": "8832", + "kind": "string", + "type": { + "$ref": "365" + }, + "value": "2024-08-09T18:13:29.389Z" + } + } + } + } + } + } + ] + }, + { + "$id": "8833", + "kind": "http", + "name": "DataflowEndpoint_CreateOrUpdate", + "description": "DataflowEndpoint_CreateOrUpdate", + "filePath": "2024-11-01/DataflowEndpoint_CreateOrUpdate_MaximumSet_Gen.json", + "parameters": [ + { + "$id": "8834", + "parameter": { + "$ref": "7866" + }, + "value": { + "$id": "8835", + "kind": "string", + "type": { + "$ref": "7867" + }, + "value": "2024-11-01" + } + }, + { + "$id": "8836", + "parameter": { + "$ref": "7870" + }, + "value": { + "$id": "8837", + "kind": "string", + "type": { + "$ref": "7871" + }, + "value": "F8C729F9-DF9C-4743-848F-96EE433D8E53" + } + }, + { + "$id": "8838", + "parameter": { + "$ref": "7873" + }, + "value": { + "$id": "8839", + "kind": "string", + "type": { + "$ref": "7874" + }, + "value": "rgiotoperations" + } + }, + { + "$id": "8840", + "parameter": { + "$ref": "7875" + }, + "value": { + "$id": "8841", + "kind": "string", + "type": { + "$ref": "7876" + }, + "value": "resource-name123" + } + }, + { + "$id": "8842", + "parameter": { + "$ref": "7877" + }, + "value": { + "$id": "8843", + "kind": "string", + "type": { + "$ref": "7878" + }, + "value": "resource-name123" + } + }, + { + "$id": "8844", + "parameter": { + "$ref": "7885" + }, + "value": { + "$id": "8845", + "kind": "model", + "type": { + "$ref": "326" + }, + "value": { + "$id": "8846", + "properties": { + "$id": "8847", + "kind": "model", + "type": { + "$ref": "372" + }, + "value": { + "$id": "8848", + "endpointType": { + "$id": "8849", + "kind": "string", + "type": { + "$ref": "2" + }, + "value": "DataExplorer" + }, + "dataExplorerSettings": { + "$id": "8850", + "kind": "model", + "type": { + "$ref": "377" + }, + "value": { + "$id": "8851", + "authentication": { + "$id": "8852", + "kind": "model", + "type": { + "$ref": "379" + }, + "value": { + "$id": "8853", + "method": { + "$id": "8854", + "kind": "string", + "type": { + "$ref": "16" + }, + "value": "SystemAssignedManagedIdentity" + }, + "systemAssignedManagedIdentitySettings": { + "$id": "8855", + "kind": "model", + "type": { + "$ref": "384" + }, + "value": { + "$id": "8856", + "audience": { + "$id": "8857", + "kind": "string", + "type": { + "$ref": "386" + }, + "value": "psxomrfbhoflycm" + } + } + }, + "userAssignedManagedIdentitySettings": { + "$id": "8858", + "kind": "model", + "type": { + "$ref": "392" + }, + "value": { + "$id": "8859", + "clientId": { + "$id": "8860", + "kind": "string", + "type": { + "$ref": "394" + }, + "value": "fb90f267-8872-431a-a76a-a1cec5d3c4d2" + }, + "scope": { + "$id": "8861", + "kind": "string", + "type": { + "$ref": "398" + }, + "value": "zop" + }, + "tenantId": { + "$id": "8862", + "kind": "string", + "type": { + "$ref": "402" + }, + "value": "ed060aa2-71ff-4d3f-99c4-a9138356fdec" + } + } + } + } + }, + "database": { + "$id": "8863", + "kind": "string", + "type": { + "$ref": "410" + }, + "value": "yqcdpjsifm" + }, + "host": { + "$id": "8864", + "kind": "string", + "type": { + "$ref": "414" + }, + "value": "..kusto.windows.net" + }, + "batching": { + "$id": "8865", + "kind": "model", + "type": { + "$ref": "418" + }, + "value": { + "$id": "8866", + "latencySeconds": { + "$id": "8867", + "kind": "number", + "type": { + "$ref": "420" + }, + "value": 9312 + }, + "maxMessages": { + "$id": "8868", + "kind": "number", + "type": { + "$ref": "424" + }, + "value": 9028 + } + } + } + } + }, + "dataLakeStorageSettings": { + "$id": "8869", + "kind": "model", + "type": { + "$ref": "432" + }, + "value": { + "$id": "8870", + "authentication": { + "$id": "8871", + "kind": "model", + "type": { + "$ref": "434" + }, + "value": { + "$id": "8872", + "method": { + "$id": "8873", + "kind": "string", + "type": { + "$ref": "22" + }, + "value": "SystemAssignedManagedIdentity" + }, + "accessTokenSettings": { + "$id": "8874", + "kind": "model", + "type": { + "$ref": "439" + }, + "value": { + "$id": "8875", + "secretRef": { + "$id": "8876", + "kind": "string", + "type": { + "$ref": "441" + }, + "value": "sevriyphcvnlrnfudqzejecwa" + } + } + }, + "systemAssignedManagedIdentitySettings": { + "$id": "8877", + "kind": "model", + "type": { + "$ref": "384" + }, + "value": { + "$id": "8878", + "audience": { + "$id": "8879", + "kind": "string", + "type": { + "$ref": "386" + }, + "value": "psxomrfbhoflycm" + } + } + }, + "userAssignedManagedIdentitySettings": { + "$id": "8880", + "kind": "model", + "type": { + "$ref": "392" + }, + "value": { + "$id": "8881", + "clientId": { + "$id": "8882", + "kind": "string", + "type": { + "$ref": "394" + }, + "value": "fb90f267-8872-431a-a76a-a1cec5d3c4d2" + }, + "scope": { + "$id": "8883", + "kind": "string", + "type": { + "$ref": "398" + }, + "value": "zop" + }, + "tenantId": { + "$id": "8884", + "kind": "string", + "type": { + "$ref": "402" + }, + "value": "ed060aa2-71ff-4d3f-99c4-a9138356fdec" + } + } + } + } + }, + "host": { + "$id": "8885", + "kind": "string", + "type": { + "$ref": "455" + }, + "value": ".blob.core.windows.net" + }, + "batching": { + "$id": "8886", + "kind": "model", + "type": { + "$ref": "418" + }, + "value": { + "$id": "8887", + "latencySeconds": { + "$id": "8888", + "kind": "number", + "type": { + "$ref": "420" + }, + "value": 9312 + }, + "maxMessages": { + "$id": "8889", + "kind": "number", + "type": { + "$ref": "424" + }, + "value": 9028 + } + } + } + } + }, + "fabricOneLakeSettings": { + "$id": "8890", + "kind": "model", + "type": { + "$ref": "464" + }, + "value": { + "$id": "8891", + "authentication": { + "$id": "8892", + "kind": "model", + "type": { + "$ref": "466" + }, + "value": { + "$id": "8893", + "method": { + "$id": "8894", + "kind": "string", + "type": { + "$ref": "30" + }, + "value": "SystemAssignedManagedIdentity" + }, + "systemAssignedManagedIdentitySettings": { + "$id": "8895", + "kind": "model", + "type": { + "$ref": "384" + }, + "value": { + "$id": "8896", + "audience": { + "$id": "8897", + "kind": "string", + "type": { + "$ref": "386" + }, + "value": "psxomrfbhoflycm" + } + } + }, + "userAssignedManagedIdentitySettings": { + "$id": "8898", + "kind": "model", + "type": { + "$ref": "392" + }, + "value": { + "$id": "8899", + "clientId": { + "$id": "8900", + "kind": "string", + "type": { + "$ref": "394" + }, + "value": "fb90f267-8872-431a-a76a-a1cec5d3c4d2" + }, + "scope": { + "$id": "8901", + "kind": "string", + "type": { + "$ref": "398" + }, + "value": "zop" + }, + "tenantId": { + "$id": "8902", + "kind": "string", + "type": { + "$ref": "402" + }, + "value": "ed060aa2-71ff-4d3f-99c4-a9138356fdec" + } + } + } + } + }, + "names": { + "$id": "8903", + "kind": "model", + "type": { + "$ref": "479" + }, + "value": { + "$id": "8904", + "lakehouseName": { + "$id": "8905", + "kind": "string", + "type": { + "$ref": "481" + }, + "value": "wpeathi" + }, + "workspaceName": { + "$id": "8906", + "kind": "string", + "type": { + "$ref": "485" + }, + "value": "nwgmitkbljztgms" + } + } + }, + "oneLakePathType": { + "$id": "8907", + "kind": "string", + "type": { + "$ref": "36" + }, + "value": "Files" + }, + "host": { + "$id": "8908", + "kind": "string", + "type": { + "$ref": "494" + }, + "value": "https://.fabric.microsoft.com" + }, + "batching": { + "$id": "8909", + "kind": "model", + "type": { + "$ref": "418" + }, + "value": { + "$id": "8910", + "latencySeconds": { + "$id": "8911", + "kind": "number", + "type": { + "$ref": "420" + }, + "value": 9312 + }, + "maxMessages": { + "$id": "8912", + "kind": "number", + "type": { + "$ref": "424" + }, + "value": 9028 + } + } + } + } + }, + "kafkaSettings": { + "$id": "8913", + "kind": "model", + "type": { + "$ref": "503" + }, + "value": { + "$id": "8914", + "authentication": { + "$id": "8915", + "kind": "model", + "type": { + "$ref": "505" + }, + "value": { + "$id": "8916", + "method": { + "$id": "8917", + "kind": "string", + "type": { + "$ref": "42" + }, + "value": "SystemAssignedManagedIdentity" + }, + "systemAssignedManagedIdentitySettings": { + "$id": "8918", + "kind": "model", + "type": { + "$ref": "384" + }, + "value": { + "$id": "8919", + "audience": { + "$id": "8920", + "kind": "string", + "type": { + "$ref": "386" + }, + "value": "psxomrfbhoflycm" + } + } + }, + "userAssignedManagedIdentitySettings": { + "$id": "8921", + "kind": "model", + "type": { + "$ref": "392" + }, + "value": { + "$id": "8922", + "clientId": { + "$id": "8923", + "kind": "string", + "type": { + "$ref": "394" + }, + "value": "fb90f267-8872-431a-a76a-a1cec5d3c4d2" + }, + "scope": { + "$id": "8924", + "kind": "string", + "type": { + "$ref": "398" + }, + "value": "zop" + }, + "tenantId": { + "$id": "8925", + "kind": "string", + "type": { + "$ref": "402" + }, + "value": "ed060aa2-71ff-4d3f-99c4-a9138356fdec" + } + } + }, + "saslSettings": { + "$id": "8926", + "kind": "model", + "type": { + "$ref": "516" + }, + "value": { + "$id": "8927", + "saslType": { + "$id": "8928", + "kind": "string", + "type": { + "$ref": "54" + }, + "value": "Plain" + }, + "secretRef": { + "$id": "8929", + "kind": "string", + "type": { + "$ref": "521" + }, + "value": "visyxoztqnylvbyokhtmpdkwes" + } + } + }, + "x509CertificateSettings": { + "$id": "8930", + "kind": "model", + "type": { + "$ref": "527" + }, + "value": { + "$id": "8931", + "secretRef": { + "$id": "8932", + "kind": "string", + "type": { + "$ref": "529" + }, + "value": "afwizrystfslkfqd" + } + } + } + } + }, + "consumerGroupId": { + "$id": "8933", + "kind": "string", + "type": { + "$ref": "537" + }, + "value": "ukkzcjiyenhxokat" + }, + "host": { + "$id": "8934", + "kind": "string", + "type": { + "$ref": "541" + }, + "value": "pwcqfiqclcgneolpewnyavoulbip" + }, + "batching": { + "$id": "8935", + "kind": "model", + "type": { + "$ref": "545" + }, + "value": { + "$id": "8936", + "mode": { + "$id": "8937", + "kind": "string", + "type": { + "$ref": "62" + }, + "value": "Enabled" + }, + "latencyMs": { + "$id": "8938", + "kind": "number", + "type": { + "$ref": "550" + }, + "value": 3679 + }, + "maxBytes": { + "$id": "8939", + "kind": "number", + "type": { + "$ref": "554" + }, + "value": 8887 + }, + "maxMessages": { + "$id": "8940", + "kind": "number", + "type": { + "$ref": "558" + }, + "value": 2174 + } + } + }, + "copyMqttProperties": { + "$id": "8941", + "kind": "string", + "type": { + "$ref": "62" + }, + "value": "Enabled" + }, + "compression": { + "$id": "8942", + "kind": "string", + "type": { + "$ref": "68" + }, + "value": "None" + }, + "kafkaAcks": { + "$id": "8943", + "kind": "string", + "type": { + "$ref": "78" + }, + "value": "Zero" + }, + "partitionStrategy": { + "$id": "8944", + "kind": "string", + "type": { + "$ref": "86" + }, + "value": "Default" + }, + "tls": { + "$id": "8945", + "kind": "model", + "type": { + "$ref": "576" + }, + "value": { + "$id": "8946", + "mode": { + "$id": "8947", + "kind": "string", + "type": { + "$ref": "62" + }, + "value": "Enabled" + }, + "trustedCaCertificateConfigMapRef": { + "$id": "8948", + "kind": "string", + "type": { + "$ref": "581" + }, + "value": "tectjjvukvelsreihwadh" + } + } + } + } + }, + "localStorageSettings": { + "$id": "8949", + "kind": "model", + "type": { + "$ref": "592" + }, + "value": { + "$id": "8950", + "persistentVolumeClaimRef": { + "$id": "8951", + "kind": "string", + "type": { + "$ref": "594" + }, + "value": "jjwqwvd" + } + } + }, + "mqttSettings": { + "$id": "8952", + "kind": "model", + "type": { + "$ref": "600" + }, + "value": { + "$id": "8953", + "authentication": { + "$id": "8954", + "kind": "model", + "type": { + "$ref": "602" + }, + "value": { + "$id": "8955", + "method": { + "$id": "8956", + "kind": "string", + "type": { + "$ref": "102" + }, + "value": "SystemAssignedManagedIdentity" + }, + "systemAssignedManagedIdentitySettings": { + "$id": "8957", + "kind": "model", + "type": { + "$ref": "384" + }, + "value": { + "$id": "8958", + "audience": { + "$id": "8959", + "kind": "string", + "type": { + "$ref": "386" + }, + "value": "psxomrfbhoflycm" + } + } + }, + "userAssignedManagedIdentitySettings": { + "$id": "8960", + "kind": "model", + "type": { + "$ref": "392" + }, + "value": { + "$id": "8961", + "clientId": { + "$id": "8962", + "kind": "string", + "type": { + "$ref": "394" + }, + "value": "fb90f267-8872-431a-a76a-a1cec5d3c4d2" + }, + "scope": { + "$id": "8963", + "kind": "string", + "type": { + "$ref": "398" + }, + "value": "zop" + }, + "tenantId": { + "$id": "8964", + "kind": "string", + "type": { + "$ref": "402" + }, + "value": "ed060aa2-71ff-4d3f-99c4-a9138356fdec" + } + } + }, + "serviceAccountTokenSettings": { + "$id": "8965", + "kind": "model", + "type": { + "$ref": "613" + }, + "value": { + "$id": "8966", + "audience": { + "$id": "8967", + "kind": "string", + "type": { + "$ref": "615" + }, + "value": "ejbklrbxgjaqleoycgpje" + } + } + }, + "x509CertificateSettings": { + "$id": "8968", + "kind": "model", + "type": { + "$ref": "527" + }, + "value": { + "$id": "8969", + "secretRef": { + "$id": "8970", + "kind": "string", + "type": { + "$ref": "529" + }, + "value": "afwizrystfslkfqd" + } + } + } + } + }, + "clientIdPrefix": { + "$id": "8971", + "kind": "string", + "type": { + "$ref": "626" + }, + "value": "kkljsdxdirfhwxtkavldekeqhv" + }, + "host": { + "$id": "8972", + "kind": "string", + "type": { + "$ref": "630" + }, + "value": "nyhnxqnbspstctl" + }, + "protocol": { + "$id": "8973", + "kind": "string", + "type": { + "$ref": "114" + }, + "value": "Mqtt" + }, + "keepAliveSeconds": { + "$id": "8974", + "kind": "number", + "type": { + "$ref": "637" + }, + "value": 0 + }, + "retain": { + "$id": "8975", + "kind": "string", + "type": { + "$ref": "120" + }, + "value": "Keep" + }, + "maxInflightMessages": { + "$id": "8976", + "kind": "number", + "type": { + "$ref": "644" + }, + "value": 0 + }, + "qos": { + "$id": "8977", + "kind": "number", + "type": { + "$ref": "648" + }, + "value": 1 + }, + "sessionExpirySeconds": { + "$id": "8978", + "kind": "number", + "type": { + "$ref": "652" + }, + "value": 0 + }, + "tls": { + "$id": "8979", + "kind": "model", + "type": { + "$ref": "576" + }, + "value": { + "$id": "8980", + "mode": { + "$id": "8981", + "kind": "string", + "type": { + "$ref": "62" + }, + "value": "Enabled" + }, + "trustedCaCertificateConfigMapRef": { + "$id": "8982", + "kind": "string", + "type": { + "$ref": "581" + }, + "value": "tectjjvukvelsreihwadh" + } + } + } + } + } + } + }, + "extendedLocation": { + "$id": "8983", + "kind": "model", + "type": { + "$ref": "669" + }, + "value": { + "$id": "8984", + "name": { + "$id": "8985", + "kind": "string", + "type": { + "$ref": "671" + }, + "value": "qmbrfwcpwwhggszhrdjv" + }, + "type": { + "$id": "8986", + "kind": "string", + "type": { + "$ref": "142" + }, + "value": "CustomLocation" + } + } + } + } + } + } + ], + "responses": [ + { + "$id": "8987", + "response": { + "$ref": "7886" + }, + "statusCode": 200, + "bodyValue": { + "$id": "8988", + "kind": "model", + "type": { + "$ref": "326" + }, + "value": { + "$id": "8989", + "properties": { + "$id": "8990", + "kind": "model", + "type": { + "$ref": "372" + }, + "value": { + "$id": "8991", + "endpointType": { + "$id": "8992", + "kind": "string", + "type": { + "$ref": "2" + }, + "value": "DataExplorer" + }, + "dataExplorerSettings": { + "$id": "8993", + "kind": "model", + "type": { + "$ref": "377" + }, + "value": { + "$id": "8994", + "authentication": { + "$id": "8995", + "kind": "model", + "type": { + "$ref": "379" + }, + "value": { + "$id": "8996", + "method": { + "$id": "8997", + "kind": "string", + "type": { + "$ref": "16" + }, + "value": "SystemAssignedManagedIdentity" + }, + "systemAssignedManagedIdentitySettings": { + "$id": "8998", + "kind": "model", + "type": { + "$ref": "384" + }, + "value": { + "$id": "8999", + "audience": { + "$id": "9000", + "kind": "string", + "type": { + "$ref": "386" + }, + "value": "psxomrfbhoflycm" + } + } + }, + "userAssignedManagedIdentitySettings": { + "$id": "9001", + "kind": "model", + "type": { + "$ref": "392" + }, + "value": { + "$id": "9002", + "clientId": { + "$id": "9003", + "kind": "string", + "type": { + "$ref": "394" + }, + "value": "fb90f267-8872-431a-a76a-a1cec5d3c4d2" + }, + "scope": { + "$id": "9004", + "kind": "string", + "type": { + "$ref": "398" + }, + "value": "zop" + }, + "tenantId": { + "$id": "9005", + "kind": "string", + "type": { + "$ref": "402" + }, + "value": "ed060aa2-71ff-4d3f-99c4-a9138356fdec" + } + } + } + } + }, + "database": { + "$id": "9006", + "kind": "string", + "type": { + "$ref": "410" + }, + "value": "yqcdpjsifm" + }, + "host": { + "$id": "9007", + "kind": "string", + "type": { + "$ref": "414" + }, + "value": "..kusto.windows.net" + }, + "batching": { + "$id": "9008", + "kind": "model", + "type": { + "$ref": "418" + }, + "value": { + "$id": "9009", + "latencySeconds": { + "$id": "9010", + "kind": "number", + "type": { + "$ref": "420" + }, + "value": 1228 + }, + "maxMessages": { + "$id": "9011", + "kind": "number", + "type": { + "$ref": "424" + }, + "value": 171 + } + } + } + } + }, + "dataLakeStorageSettings": { + "$id": "9012", + "kind": "model", + "type": { + "$ref": "432" + }, + "value": { + "$id": "9013", + "authentication": { + "$id": "9014", + "kind": "model", + "type": { + "$ref": "434" + }, + "value": { + "$id": "9015", + "method": { + "$id": "9016", + "kind": "string", + "type": { + "$ref": "22" + }, + "value": "SystemAssignedManagedIdentity" + }, + "accessTokenSettings": { + "$id": "9017", + "kind": "model", + "type": { + "$ref": "439" + }, + "value": { + "$id": "9018", + "secretRef": { + "$id": "9019", + "kind": "string", + "type": { + "$ref": "441" + }, + "value": "sevriyphcvnlrnfudqzejecwa" + } + } + }, + "systemAssignedManagedIdentitySettings": { + "$id": "9020", + "kind": "model", + "type": { + "$ref": "384" + }, + "value": { + "$id": "9021", + "audience": { + "$id": "9022", + "kind": "string", + "type": { + "$ref": "386" + }, + "value": "psxomrfbhoflycm" + } + } + }, + "userAssignedManagedIdentitySettings": { + "$id": "9023", + "kind": "model", + "type": { + "$ref": "392" + }, + "value": { + "$id": "9024", + "clientId": { + "$id": "9025", + "kind": "string", + "type": { + "$ref": "394" + }, + "value": "fb90f267-8872-431a-a76a-a1cec5d3c4d2" + }, + "scope": { + "$id": "9026", + "kind": "string", + "type": { + "$ref": "398" + }, + "value": "zop" + }, + "tenantId": { + "$id": "9027", + "kind": "string", + "type": { + "$ref": "402" + }, + "value": "ed060aa2-71ff-4d3f-99c4-a9138356fdec" + } + } + } + } + }, + "host": { + "$id": "9028", + "kind": "string", + "type": { + "$ref": "455" + }, + "value": ".blob.core.windows.net" + }, + "batching": { + "$id": "9029", + "kind": "model", + "type": { + "$ref": "418" + }, + "value": { + "$id": "9030", + "latencySeconds": { + "$id": "9031", + "kind": "number", + "type": { + "$ref": "420" + }, + "value": 1228 + }, + "maxMessages": { + "$id": "9032", + "kind": "number", + "type": { + "$ref": "424" + }, + "value": 171 + } + } + } + } + }, + "fabricOneLakeSettings": { + "$id": "9033", + "kind": "model", + "type": { + "$ref": "464" + }, + "value": { + "$id": "9034", + "authentication": { + "$id": "9035", + "kind": "model", + "type": { + "$ref": "466" + }, + "value": { + "$id": "9036", + "method": { + "$id": "9037", + "kind": "string", + "type": { + "$ref": "30" + }, + "value": "SystemAssignedManagedIdentity" + }, + "systemAssignedManagedIdentitySettings": { + "$id": "9038", + "kind": "model", + "type": { + "$ref": "384" + }, + "value": { + "$id": "9039", + "audience": { + "$id": "9040", + "kind": "string", + "type": { + "$ref": "386" + }, + "value": "psxomrfbhoflycm" + } + } + }, + "userAssignedManagedIdentitySettings": { + "$id": "9041", + "kind": "model", + "type": { + "$ref": "392" + }, + "value": { + "$id": "9042", + "clientId": { + "$id": "9043", + "kind": "string", + "type": { + "$ref": "394" + }, + "value": "fb90f267-8872-431a-a76a-a1cec5d3c4d2" + }, + "scope": { + "$id": "9044", + "kind": "string", + "type": { + "$ref": "398" + }, + "value": "zop" + }, + "tenantId": { + "$id": "9045", + "kind": "string", + "type": { + "$ref": "402" + }, + "value": "ed060aa2-71ff-4d3f-99c4-a9138356fdec" + } + } + } + } + }, + "names": { + "$id": "9046", + "kind": "model", + "type": { + "$ref": "479" + }, + "value": { + "$id": "9047", + "lakehouseName": { + "$id": "9048", + "kind": "string", + "type": { + "$ref": "481" + }, + "value": "wpeathi" + }, + "workspaceName": { + "$id": "9049", + "kind": "string", + "type": { + "$ref": "485" + }, + "value": "nwgmitkbljztgms" + } + } + }, + "oneLakePathType": { + "$id": "9050", + "kind": "string", + "type": { + "$ref": "36" + }, + "value": "Files" + }, + "host": { + "$id": "9051", + "kind": "string", + "type": { + "$ref": "494" + }, + "value": "https://.fabric.microsoft.com" + }, + "batching": { + "$id": "9052", + "kind": "model", + "type": { + "$ref": "418" + }, + "value": { + "$id": "9053", + "latencySeconds": { + "$id": "9054", + "kind": "number", + "type": { + "$ref": "420" + }, + "value": 1228 + }, + "maxMessages": { + "$id": "9055", + "kind": "number", + "type": { + "$ref": "424" + }, + "value": 171 + } + } + } + } + }, + "kafkaSettings": { + "$id": "9056", + "kind": "model", + "type": { + "$ref": "503" + }, + "value": { + "$id": "9057", + "authentication": { + "$id": "9058", + "kind": "model", + "type": { + "$ref": "505" + }, + "value": { + "$id": "9059", + "method": { + "$id": "9060", + "kind": "string", + "type": { + "$ref": "42" + }, + "value": "SystemAssignedManagedIdentity" + }, + "systemAssignedManagedIdentitySettings": { + "$id": "9061", + "kind": "model", + "type": { + "$ref": "384" + }, + "value": { + "$id": "9062", + "audience": { + "$id": "9063", + "kind": "string", + "type": { + "$ref": "386" + }, + "value": "psxomrfbhoflycm" + } + } + }, + "userAssignedManagedIdentitySettings": { + "$id": "9064", + "kind": "model", + "type": { + "$ref": "392" + }, + "value": { + "$id": "9065", + "clientId": { + "$id": "9066", + "kind": "string", + "type": { + "$ref": "394" + }, + "value": "fb90f267-8872-431a-a76a-a1cec5d3c4d2" + }, + "scope": { + "$id": "9067", + "kind": "string", + "type": { + "$ref": "398" + }, + "value": "zop" + }, + "tenantId": { + "$id": "9068", + "kind": "string", + "type": { + "$ref": "402" + }, + "value": "ed060aa2-71ff-4d3f-99c4-a9138356fdec" + } + } + }, + "saslSettings": { + "$id": "9069", + "kind": "model", + "type": { + "$ref": "516" + }, + "value": { + "$id": "9070", + "saslType": { + "$id": "9071", + "kind": "string", + "type": { + "$ref": "54" + }, + "value": "Plain" + }, + "secretRef": { + "$id": "9072", + "kind": "string", + "type": { + "$ref": "521" + }, + "value": "visyxoztqnylvbyokhtmpdkwes" + } + } + }, + "x509CertificateSettings": { + "$id": "9073", + "kind": "model", + "type": { + "$ref": "527" + }, + "value": { + "$id": "9074", + "secretRef": { + "$id": "9075", + "kind": "string", + "type": { + "$ref": "529" + }, + "value": "afwizrystfslkfqd" + } + } + } + } + }, + "consumerGroupId": { + "$id": "9076", + "kind": "string", + "type": { + "$ref": "537" + }, + "value": "ukkzcjiyenhxokat" + }, + "host": { + "$id": "9077", + "kind": "string", + "type": { + "$ref": "541" + }, + "value": "pwcqfiqclcgneolpewnyavoulbip" + }, + "batching": { + "$id": "9078", + "kind": "model", + "type": { + "$ref": "545" + }, + "value": { + "$id": "9079", + "mode": { + "$id": "9080", + "kind": "string", + "type": { + "$ref": "62" + }, + "value": "Enabled" + }, + "latencyMs": { + "$id": "9081", + "kind": "number", + "type": { + "$ref": "550" + }, + "value": 3679 + }, + "maxBytes": { + "$id": "9082", + "kind": "number", + "type": { + "$ref": "554" + }, + "value": 8887 + }, + "maxMessages": { + "$id": "9083", + "kind": "number", + "type": { + "$ref": "558" + }, + "value": 2174 + } + } + }, + "copyMqttProperties": { + "$id": "9084", + "kind": "string", + "type": { + "$ref": "62" + }, + "value": "Enabled" + }, + "compression": { + "$id": "9085", + "kind": "string", + "type": { + "$ref": "68" + }, + "value": "None" + }, + "kafkaAcks": { + "$id": "9086", + "kind": "string", + "type": { + "$ref": "78" + }, + "value": "Zero" + }, + "partitionStrategy": { + "$id": "9087", + "kind": "string", + "type": { + "$ref": "86" + }, + "value": "Default" + }, + "tls": { + "$id": "9088", + "kind": "model", + "type": { + "$ref": "576" + }, + "value": { + "$id": "9089", + "mode": { + "$id": "9090", + "kind": "string", + "type": { + "$ref": "62" + }, + "value": "Enabled" + }, + "trustedCaCertificateConfigMapRef": { + "$id": "9091", + "kind": "string", + "type": { + "$ref": "581" + }, + "value": "tectjjvukvelsreihwadh" + } + } + } + } + }, + "localStorageSettings": { + "$id": "9092", + "kind": "model", + "type": { + "$ref": "592" + }, + "value": { + "$id": "9093", + "persistentVolumeClaimRef": { + "$id": "9094", + "kind": "string", + "type": { + "$ref": "594" + }, + "value": "jjwqwvd" + } + } + }, + "mqttSettings": { + "$id": "9095", + "kind": "model", + "type": { + "$ref": "600" + }, + "value": { + "$id": "9096", + "authentication": { + "$id": "9097", + "kind": "model", + "type": { + "$ref": "602" + }, + "value": { + "$id": "9098", + "method": { + "$id": "9099", + "kind": "string", + "type": { + "$ref": "102" + }, + "value": "SystemAssignedManagedIdentity" + }, + "systemAssignedManagedIdentitySettings": { + "$id": "9100", + "kind": "model", + "type": { + "$ref": "384" + }, + "value": { + "$id": "9101", + "audience": { + "$id": "9102", + "kind": "string", + "type": { + "$ref": "386" + }, + "value": "psxomrfbhoflycm" + } + } + }, + "userAssignedManagedIdentitySettings": { + "$id": "9103", + "kind": "model", + "type": { + "$ref": "392" + }, + "value": { + "$id": "9104", + "clientId": { + "$id": "9105", + "kind": "string", + "type": { + "$ref": "394" + }, + "value": "fb90f267-8872-431a-a76a-a1cec5d3c4d2" + }, + "scope": { + "$id": "9106", + "kind": "string", + "type": { + "$ref": "398" + }, + "value": "zop" + }, + "tenantId": { + "$id": "9107", + "kind": "string", + "type": { + "$ref": "402" + }, + "value": "ed060aa2-71ff-4d3f-99c4-a9138356fdec" + } + } + }, + "serviceAccountTokenSettings": { + "$id": "9108", + "kind": "model", + "type": { + "$ref": "613" + }, + "value": { + "$id": "9109", + "audience": { + "$id": "9110", + "kind": "string", + "type": { + "$ref": "615" + }, + "value": "ejbklrbxgjaqleoycgpje" + } + } + }, + "x509CertificateSettings": { + "$id": "9111", + "kind": "model", + "type": { + "$ref": "527" + }, + "value": { + "$id": "9112", + "secretRef": { + "$id": "9113", + "kind": "string", + "type": { + "$ref": "529" + }, + "value": "afwizrystfslkfqd" + } + } + } + } + }, + "clientIdPrefix": { + "$id": "9114", + "kind": "string", + "type": { + "$ref": "626" + }, + "value": "kkljsdxdirfhwxtkavldekeqhv" + }, + "host": { + "$id": "9115", + "kind": "string", + "type": { + "$ref": "630" + }, + "value": "nyhnxqnbspstctl" + }, + "protocol": { + "$id": "9116", + "kind": "string", + "type": { + "$ref": "114" + }, + "value": "Mqtt" + }, + "keepAliveSeconds": { + "$id": "9117", + "kind": "number", + "type": { + "$ref": "637" + }, + "value": 0 + }, + "retain": { + "$id": "9118", + "kind": "string", + "type": { + "$ref": "120" + }, + "value": "Keep" + }, + "maxInflightMessages": { + "$id": "9119", + "kind": "number", + "type": { + "$ref": "644" + }, + "value": 0 + }, + "qos": { + "$id": "9120", + "kind": "number", + "type": { + "$ref": "648" + }, + "value": 1 + }, + "sessionExpirySeconds": { + "$id": "9121", + "kind": "number", + "type": { + "$ref": "652" + }, + "value": 0 + }, + "tls": { + "$id": "9122", + "kind": "model", + "type": { + "$ref": "576" + }, + "value": { + "$id": "9123", + "mode": { + "$id": "9124", + "kind": "string", + "type": { + "$ref": "62" + }, + "value": "Enabled" + }, + "trustedCaCertificateConfigMapRef": { + "$id": "9125", + "kind": "string", + "type": { + "$ref": "581" + }, + "value": "tectjjvukvelsreihwadh" + } + } + } + } + }, + "provisioningState": { + "$id": "9126", + "kind": "string", + "type": { + "$ref": "126" + }, + "value": "Succeeded" + } + } + }, + "extendedLocation": { + "$id": "9127", + "kind": "model", + "type": { + "$ref": "669" + }, + "value": { + "$id": "9128", + "name": { + "$id": "9129", + "kind": "string", + "type": { + "$ref": "671" + }, + "value": "qmbrfwcpwwhggszhrdjv" + }, + "type": { + "$id": "9130", + "kind": "string", + "type": { + "$ref": "142" + }, + "value": "CustomLocation" + } + } + }, + "id": { + "$id": "9131", + "kind": "string", + "type": { + "$ref": "330" + }, + "value": "/subscriptions/0000000-0000-0000-0000-000000000000/resourceGroups/resourceGroup123/providers/Microsoft.IoTOperations/instances/resource-name123/dataflowEndpoints/resource-name123" + }, + "name": { + "$id": "9132", + "kind": "string", + "type": { + "$ref": "335" + }, + "value": "zyhxscudobzfacetvgyjiav" + }, + "type": { + "$id": "9133", + "kind": "string", + "type": { + "$ref": "339" + }, + "value": "iay" + }, + "systemData": { + "$id": "9134", + "kind": "model", + "type": { + "$ref": "344" + }, + "value": { + "$id": "9135", + "createdBy": { + "$id": "9136", + "kind": "string", + "type": { + "$ref": "346" + }, + "value": "ssvaslsmudloholronopqyxjcu" + }, + "createdByType": { + "$id": "9137", + "kind": "string", + "type": { + "$ref": "146" + }, + "value": "User" + }, + "createdAt": { + "$id": "9138", + "kind": "string", + "type": { + "$ref": "353" + }, + "value": "2024-08-09T18:13:29.389Z" + }, + "lastModifiedBy": { + "$id": "9139", + "kind": "string", + "type": { + "$ref": "358" + }, + "value": "gnicpuszwd" + }, + "lastModifiedByType": { + "$id": "9140", + "kind": "string", + "type": { + "$ref": "146" + }, + "value": "User" + }, + "lastModifiedAt": { + "$id": "9141", + "kind": "string", + "type": { + "$ref": "365" + }, + "value": "2024-08-09T18:13:29.389Z" + } + } + } + } + } + }, + { + "$id": "9142", + "response": { + "$ref": "7887" + }, + "statusCode": 201, + "bodyValue": { + "$id": "9143", + "kind": "model", + "type": { + "$ref": "326" + }, + "value": { + "$id": "9144", + "properties": { + "$id": "9145", + "kind": "model", + "type": { + "$ref": "372" + }, + "value": { + "$id": "9146", + "endpointType": { + "$id": "9147", + "kind": "string", + "type": { + "$ref": "2" + }, + "value": "DataExplorer" + }, + "dataExplorerSettings": { + "$id": "9148", + "kind": "model", + "type": { + "$ref": "377" + }, + "value": { + "$id": "9149", + "authentication": { + "$id": "9150", + "kind": "model", + "type": { + "$ref": "379" + }, + "value": { + "$id": "9151", + "method": { + "$id": "9152", + "kind": "string", + "type": { + "$ref": "16" + }, + "value": "SystemAssignedManagedIdentity" + }, + "systemAssignedManagedIdentitySettings": { + "$id": "9153", + "kind": "model", + "type": { + "$ref": "384" + }, + "value": { + "$id": "9154", + "audience": { + "$id": "9155", + "kind": "string", + "type": { + "$ref": "386" + }, + "value": "psxomrfbhoflycm" + } + } + }, + "userAssignedManagedIdentitySettings": { + "$id": "9156", + "kind": "model", + "type": { + "$ref": "392" + }, + "value": { + "$id": "9157", + "clientId": { + "$id": "9158", + "kind": "string", + "type": { + "$ref": "394" + }, + "value": "fb90f267-8872-431a-a76a-a1cec5d3c4d2" + }, + "scope": { + "$id": "9159", + "kind": "string", + "type": { + "$ref": "398" + }, + "value": "zop" + }, + "tenantId": { + "$id": "9160", + "kind": "string", + "type": { + "$ref": "402" + }, + "value": "ed060aa2-71ff-4d3f-99c4-a9138356fdec" + } + } + } + } + }, + "database": { + "$id": "9161", + "kind": "string", + "type": { + "$ref": "410" + }, + "value": "yqcdpjsifm" + }, + "host": { + "$id": "9162", + "kind": "string", + "type": { + "$ref": "414" + }, + "value": "..kusto.windows.net" + }, + "batching": { + "$id": "9163", + "kind": "model", + "type": { + "$ref": "418" + }, + "value": { + "$id": "9164", + "latencySeconds": { + "$id": "9165", + "kind": "number", + "type": { + "$ref": "420" + }, + "value": 1228 + }, + "maxMessages": { + "$id": "9166", + "kind": "number", + "type": { + "$ref": "424" + }, + "value": 171 + } + } + } + } + }, + "dataLakeStorageSettings": { + "$id": "9167", + "kind": "model", + "type": { + "$ref": "432" + }, + "value": { + "$id": "9168", + "authentication": { + "$id": "9169", + "kind": "model", + "type": { + "$ref": "434" + }, + "value": { + "$id": "9170", + "method": { + "$id": "9171", + "kind": "string", + "type": { + "$ref": "22" + }, + "value": "SystemAssignedManagedIdentity" + }, + "accessTokenSettings": { + "$id": "9172", + "kind": "model", + "type": { + "$ref": "439" + }, + "value": { + "$id": "9173", + "secretRef": { + "$id": "9174", + "kind": "string", + "type": { + "$ref": "441" + }, + "value": "sevriyphcvnlrnfudqzejecwa" + } + } + }, + "systemAssignedManagedIdentitySettings": { + "$id": "9175", + "kind": "model", + "type": { + "$ref": "384" + }, + "value": { + "$id": "9176", + "audience": { + "$id": "9177", + "kind": "string", + "type": { + "$ref": "386" + }, + "value": "psxomrfbhoflycm" + } + } + }, + "userAssignedManagedIdentitySettings": { + "$id": "9178", + "kind": "model", + "type": { + "$ref": "392" + }, + "value": { + "$id": "9179", + "clientId": { + "$id": "9180", + "kind": "string", + "type": { + "$ref": "394" + }, + "value": "fb90f267-8872-431a-a76a-a1cec5d3c4d2" + }, + "scope": { + "$id": "9181", + "kind": "string", + "type": { + "$ref": "398" + }, + "value": "zop" + }, + "tenantId": { + "$id": "9182", + "kind": "string", + "type": { + "$ref": "402" + }, + "value": "ed060aa2-71ff-4d3f-99c4-a9138356fdec" + } + } + } + } + }, + "host": { + "$id": "9183", + "kind": "string", + "type": { + "$ref": "455" + }, + "value": ".blob.core.windows.net" + }, + "batching": { + "$id": "9184", + "kind": "model", + "type": { + "$ref": "418" + }, + "value": { + "$id": "9185", + "latencySeconds": { + "$id": "9186", + "kind": "number", + "type": { + "$ref": "420" + }, + "value": 1228 + }, + "maxMessages": { + "$id": "9187", + "kind": "number", + "type": { + "$ref": "424" + }, + "value": 171 + } + } + } + } + }, + "fabricOneLakeSettings": { + "$id": "9188", + "kind": "model", + "type": { + "$ref": "464" + }, + "value": { + "$id": "9189", + "authentication": { + "$id": "9190", + "kind": "model", + "type": { + "$ref": "466" + }, + "value": { + "$id": "9191", + "method": { + "$id": "9192", + "kind": "string", + "type": { + "$ref": "30" + }, + "value": "SystemAssignedManagedIdentity" + }, + "systemAssignedManagedIdentitySettings": { + "$id": "9193", + "kind": "model", + "type": { + "$ref": "384" + }, + "value": { + "$id": "9194", + "audience": { + "$id": "9195", + "kind": "string", + "type": { + "$ref": "386" + }, + "value": "psxomrfbhoflycm" + } + } + }, + "userAssignedManagedIdentitySettings": { + "$id": "9196", + "kind": "model", + "type": { + "$ref": "392" + }, + "value": { + "$id": "9197", + "clientId": { + "$id": "9198", + "kind": "string", + "type": { + "$ref": "394" + }, + "value": "fb90f267-8872-431a-a76a-a1cec5d3c4d2" + }, + "scope": { + "$id": "9199", + "kind": "string", + "type": { + "$ref": "398" + }, + "value": "zop" + }, + "tenantId": { + "$id": "9200", + "kind": "string", + "type": { + "$ref": "402" + }, + "value": "ed060aa2-71ff-4d3f-99c4-a9138356fdec" + } + } + } + } + }, + "names": { + "$id": "9201", + "kind": "model", + "type": { + "$ref": "479" + }, + "value": { + "$id": "9202", + "lakehouseName": { + "$id": "9203", + "kind": "string", + "type": { + "$ref": "481" + }, + "value": "wpeathi" + }, + "workspaceName": { + "$id": "9204", + "kind": "string", + "type": { + "$ref": "485" + }, + "value": "nwgmitkbljztgms" + } + } + }, + "oneLakePathType": { + "$id": "9205", + "kind": "string", + "type": { + "$ref": "36" + }, + "value": "Files" + }, + "host": { + "$id": "9206", + "kind": "string", + "type": { + "$ref": "494" + }, + "value": "https://.fabric.microsoft.com" + }, + "batching": { + "$id": "9207", + "kind": "model", + "type": { + "$ref": "418" + }, + "value": { + "$id": "9208", + "latencySeconds": { + "$id": "9209", + "kind": "number", + "type": { + "$ref": "420" + }, + "value": 1228 + }, + "maxMessages": { + "$id": "9210", + "kind": "number", + "type": { + "$ref": "424" + }, + "value": 171 + } + } + } + } + }, + "kafkaSettings": { + "$id": "9211", + "kind": "model", + "type": { + "$ref": "503" + }, + "value": { + "$id": "9212", + "authentication": { + "$id": "9213", + "kind": "model", + "type": { + "$ref": "505" + }, + "value": { + "$id": "9214", + "method": { + "$id": "9215", + "kind": "string", + "type": { + "$ref": "42" + }, + "value": "SystemAssignedManagedIdentity" + }, + "systemAssignedManagedIdentitySettings": { + "$id": "9216", + "kind": "model", + "type": { + "$ref": "384" + }, + "value": { + "$id": "9217", + "audience": { + "$id": "9218", + "kind": "string", + "type": { + "$ref": "386" + }, + "value": "psxomrfbhoflycm" + } + } + }, + "userAssignedManagedIdentitySettings": { + "$id": "9219", + "kind": "model", + "type": { + "$ref": "392" + }, + "value": { + "$id": "9220", + "clientId": { + "$id": "9221", + "kind": "string", + "type": { + "$ref": "394" + }, + "value": "fb90f267-8872-431a-a76a-a1cec5d3c4d2" + }, + "scope": { + "$id": "9222", + "kind": "string", + "type": { + "$ref": "398" + }, + "value": "zop" + }, + "tenantId": { + "$id": "9223", + "kind": "string", + "type": { + "$ref": "402" + }, + "value": "ed060aa2-71ff-4d3f-99c4-a9138356fdec" + } + } + }, + "saslSettings": { + "$id": "9224", + "kind": "model", + "type": { + "$ref": "516" + }, + "value": { + "$id": "9225", + "saslType": { + "$id": "9226", + "kind": "string", + "type": { + "$ref": "54" + }, + "value": "Plain" + }, + "secretRef": { + "$id": "9227", + "kind": "string", + "type": { + "$ref": "521" + }, + "value": "visyxoztqnylvbyokhtmpdkwes" + } + } + }, + "x509CertificateSettings": { + "$id": "9228", + "kind": "model", + "type": { + "$ref": "527" + }, + "value": { + "$id": "9229", + "secretRef": { + "$id": "9230", + "kind": "string", + "type": { + "$ref": "529" + }, + "value": "afwizrystfslkfqd" + } + } + } + } + }, + "consumerGroupId": { + "$id": "9231", + "kind": "string", + "type": { + "$ref": "537" + }, + "value": "ukkzcjiyenhxokat" + }, + "host": { + "$id": "9232", + "kind": "string", + "type": { + "$ref": "541" + }, + "value": "pwcqfiqclcgneolpewnyavoulbip" + }, + "batching": { + "$id": "9233", + "kind": "model", + "type": { + "$ref": "545" + }, + "value": { + "$id": "9234", + "mode": { + "$id": "9235", + "kind": "string", + "type": { + "$ref": "62" + }, + "value": "Enabled" + }, + "latencyMs": { + "$id": "9236", + "kind": "number", + "type": { + "$ref": "550" + }, + "value": 3679 + }, + "maxBytes": { + "$id": "9237", + "kind": "number", + "type": { + "$ref": "554" + }, + "value": 8887 + }, + "maxMessages": { + "$id": "9238", + "kind": "number", + "type": { + "$ref": "558" + }, + "value": 2174 + } + } + }, + "copyMqttProperties": { + "$id": "9239", + "kind": "string", + "type": { + "$ref": "62" + }, + "value": "Enabled" + }, + "compression": { + "$id": "9240", + "kind": "string", + "type": { + "$ref": "68" + }, + "value": "None" + }, + "kafkaAcks": { + "$id": "9241", + "kind": "string", + "type": { + "$ref": "78" + }, + "value": "Zero" + }, + "partitionStrategy": { + "$id": "9242", + "kind": "string", + "type": { + "$ref": "86" + }, + "value": "Default" + }, + "tls": { + "$id": "9243", + "kind": "model", + "type": { + "$ref": "576" + }, + "value": { + "$id": "9244", + "mode": { + "$id": "9245", + "kind": "string", + "type": { + "$ref": "62" + }, + "value": "Enabled" + }, + "trustedCaCertificateConfigMapRef": { + "$id": "9246", + "kind": "string", + "type": { + "$ref": "581" + }, + "value": "tectjjvukvelsreihwadh" + } + } + } + } + }, + "localStorageSettings": { + "$id": "9247", + "kind": "model", + "type": { + "$ref": "592" + }, + "value": { + "$id": "9248", + "persistentVolumeClaimRef": { + "$id": "9249", + "kind": "string", + "type": { + "$ref": "594" + }, + "value": "jjwqwvd" + } + } + }, + "mqttSettings": { + "$id": "9250", + "kind": "model", + "type": { + "$ref": "600" + }, + "value": { + "$id": "9251", + "authentication": { + "$id": "9252", + "kind": "model", + "type": { + "$ref": "602" + }, + "value": { + "$id": "9253", + "method": { + "$id": "9254", + "kind": "string", + "type": { + "$ref": "102" + }, + "value": "SystemAssignedManagedIdentity" + }, + "systemAssignedManagedIdentitySettings": { + "$id": "9255", + "kind": "model", + "type": { + "$ref": "384" + }, + "value": { + "$id": "9256", + "audience": { + "$id": "9257", + "kind": "string", + "type": { + "$ref": "386" + }, + "value": "psxomrfbhoflycm" + } + } + }, + "userAssignedManagedIdentitySettings": { + "$id": "9258", + "kind": "model", + "type": { + "$ref": "392" + }, + "value": { + "$id": "9259", + "clientId": { + "$id": "9260", + "kind": "string", + "type": { + "$ref": "394" + }, + "value": "fb90f267-8872-431a-a76a-a1cec5d3c4d2" + }, + "scope": { + "$id": "9261", + "kind": "string", + "type": { + "$ref": "398" + }, + "value": "zop" + }, + "tenantId": { + "$id": "9262", + "kind": "string", + "type": { + "$ref": "402" + }, + "value": "ed060aa2-71ff-4d3f-99c4-a9138356fdec" + } + } + }, + "serviceAccountTokenSettings": { + "$id": "9263", + "kind": "model", + "type": { + "$ref": "613" + }, + "value": { + "$id": "9264", + "audience": { + "$id": "9265", + "kind": "string", + "type": { + "$ref": "615" + }, + "value": "ejbklrbxgjaqleoycgpje" + } + } + }, + "x509CertificateSettings": { + "$id": "9266", + "kind": "model", + "type": { + "$ref": "527" + }, + "value": { + "$id": "9267", + "secretRef": { + "$id": "9268", + "kind": "string", + "type": { + "$ref": "529" + }, + "value": "afwizrystfslkfqd" + } + } + } + } + }, + "clientIdPrefix": { + "$id": "9269", + "kind": "string", + "type": { + "$ref": "626" + }, + "value": "kkljsdxdirfhwxtkavldekeqhv" + }, + "host": { + "$id": "9270", + "kind": "string", + "type": { + "$ref": "630" + }, + "value": "nyhnxqnbspstctl" + }, + "protocol": { + "$id": "9271", + "kind": "string", + "type": { + "$ref": "114" + }, + "value": "Mqtt" + }, + "keepAliveSeconds": { + "$id": "9272", + "kind": "number", + "type": { + "$ref": "637" + }, + "value": 0 + }, + "retain": { + "$id": "9273", + "kind": "string", + "type": { + "$ref": "120" + }, + "value": "Keep" + }, + "maxInflightMessages": { + "$id": "9274", + "kind": "number", + "type": { + "$ref": "644" + }, + "value": 0 + }, + "qos": { + "$id": "9275", + "kind": "number", + "type": { + "$ref": "648" + }, + "value": 1 + }, + "sessionExpirySeconds": { + "$id": "9276", + "kind": "number", + "type": { + "$ref": "652" + }, + "value": 0 + }, + "tls": { + "$id": "9277", + "kind": "model", + "type": { + "$ref": "576" + }, + "value": { + "$id": "9278", + "mode": { + "$id": "9279", + "kind": "string", + "type": { + "$ref": "62" + }, + "value": "Enabled" + }, + "trustedCaCertificateConfigMapRef": { + "$id": "9280", + "kind": "string", + "type": { + "$ref": "581" + }, + "value": "tectjjvukvelsreihwadh" + } + } + } + } + }, + "provisioningState": { + "$id": "9281", + "kind": "string", + "type": { + "$ref": "126" + }, + "value": "Succeeded" + } + } + }, + "extendedLocation": { + "$id": "9282", + "kind": "model", + "type": { + "$ref": "669" + }, + "value": { + "$id": "9283", + "name": { + "$id": "9284", + "kind": "string", + "type": { + "$ref": "671" + }, + "value": "qmbrfwcpwwhggszhrdjv" + }, + "type": { + "$id": "9285", + "kind": "string", + "type": { + "$ref": "142" + }, + "value": "CustomLocation" + } + } + }, + "id": { + "$id": "9286", + "kind": "string", + "type": { + "$ref": "330" + }, + "value": "/subscriptions/0000000-0000-0000-0000-000000000000/resourceGroups/resourceGroup123/providers/Microsoft.IoTOperations/instances/resource-name123/dataflowEndpoints/resource-name123" + }, + "name": { + "$id": "9287", + "kind": "string", + "type": { + "$ref": "335" + }, + "value": "zyhxscudobzfacetvgyjiav" + }, + "type": { + "$id": "9288", + "kind": "string", + "type": { + "$ref": "339" + }, + "value": "iay" + }, + "systemData": { + "$id": "9289", + "kind": "model", + "type": { + "$ref": "344" + }, + "value": { + "$id": "9290", + "createdBy": { + "$id": "9291", + "kind": "string", + "type": { + "$ref": "346" + }, + "value": "ssvaslsmudloholronopqyxjcu" + }, + "createdByType": { + "$id": "9292", + "kind": "string", + "type": { + "$ref": "146" + }, + "value": "User" + }, + "createdAt": { + "$id": "9293", + "kind": "string", + "type": { + "$ref": "353" + }, + "value": "2024-08-09T18:13:29.389Z" + }, + "lastModifiedBy": { + "$id": "9294", + "kind": "string", + "type": { + "$ref": "358" + }, + "value": "gnicpuszwd" + }, + "lastModifiedByType": { + "$id": "9295", + "kind": "string", + "type": { + "$ref": "146" + }, + "value": "User" + }, + "lastModifiedAt": { + "$id": "9296", + "kind": "string", + "type": { + "$ref": "365" + }, + "value": "2024-08-09T18:13:29.389Z" + } + } + } + } + } + } + ] + } + ] + }, + { + "$id": "9297", + "Name": "delete", + "ResourceName": "DataflowEndpointResource", + "Doc": "Delete a DataflowEndpointResource", + "Accessibility": "public", + "Parameters": [ + { + "$id": "9298", + "Name": "apiVersion", + "NameInRequest": "api-version", + "Doc": "The API version to use for this operation.", + "Type": { + "$id": "9299", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": true, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "DefaultValue": { + "$id": "9300", + "Type": { + "$id": "9301", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "2024-11-01" + }, + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "9302", + "Name": "subscriptionId", + "NameInRequest": "subscriptionId", + "Doc": "The ID of the target subscription. The value must be an UUID.", + "Type": { + "$id": "9303", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "9304", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "9305", + "Name": "resourceGroupName", + "NameInRequest": "resourceGroupName", + "Doc": "The name of the resource group. The name is case insensitive.", + "Type": { + "$id": "9306", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "9307", + "Name": "instanceName", + "NameInRequest": "instanceName", + "Doc": "Name of instance.", + "Type": { + "$id": "9308", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "9309", + "Name": "dataflowEndpointName", + "NameInRequest": "dataflowEndpointName", + "Doc": "Name of Instance dataflowEndpoint resource", + "Type": { + "$id": "9310", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "9311", + "Name": "accept", + "NameInRequest": "Accept", + "Type": { + "$id": "9312", + "kind": "constant", + "valueType": { + "$id": "9313", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "9314", + "StatusCodes": [ + 202 + ], + "BodyMediaType": "Json", + "Headers": [ + { + "$id": "9315", + "Name": "location", + "NameInResponse": "Location", + "Doc": "The Location header contains the URL where the status of the long running operation can be checked.", + "Type": { + "$id": "9316", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + } + }, + { + "$id": "9317", + "Name": "retryAfter", + "NameInResponse": "Retry-After", + "Doc": "The Retry-After header can indicate how long the client should wait before polling the operation status.", + "Type": { + "$id": "9318", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + } + } + ], + "IsErrorResponse": false + }, + { + "$id": "9319", + "StatusCodes": [ + 204 + ], + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false + } + ], + "HttpMethod": "DELETE", + "RequestBodyMediaType": "None", + "Uri": "{endpoint}", + "Path": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/dataflowEndpoints/{dataflowEndpointName}", + "BufferResponse": true, + "LongRunning": { + "$id": "9320", + "FinalStateVia": 1, + "FinalResponse": { + "$id": "9321", + "StatusCodes": [ + 204 + ], + "BodyMediaType": "Json" + } + }, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Microsoft.IoTOperations.DataflowEndpoint.delete", + "Decorators": [], + "Examples": [ + { + "$id": "9322", + "kind": "http", + "name": "DataflowEndpoint_Delete", + "description": "DataflowEndpoint_Delete", + "filePath": "2024-11-01/DataflowEndpoint_Delete_MaximumSet_Gen.json", + "parameters": [ + { + "$id": "9323", + "parameter": { + "$ref": "9298" + }, + "value": { + "$id": "9324", + "kind": "string", + "type": { + "$ref": "9299" + }, + "value": "2024-11-01" + } + }, + { + "$id": "9325", + "parameter": { + "$ref": "9302" + }, + "value": { + "$id": "9326", + "kind": "string", + "type": { + "$ref": "9303" + }, + "value": "F8C729F9-DF9C-4743-848F-96EE433D8E53" + } + }, + { + "$id": "9327", + "parameter": { + "$ref": "9305" + }, + "value": { + "$id": "9328", + "kind": "string", + "type": { + "$ref": "9306" + }, + "value": "rgiotoperations" + } + }, + { + "$id": "9329", + "parameter": { + "$ref": "9307" + }, + "value": { + "$id": "9330", + "kind": "string", + "type": { + "$ref": "9308" + }, + "value": "resource-name123" + } + }, + { + "$id": "9331", + "parameter": { + "$ref": "9309" + }, + "value": { + "$id": "9332", + "kind": "string", + "type": { + "$ref": "9310" + }, + "value": "resource-name123" + } + } + ], + "responses": [ + { + "$id": "9333", + "response": { + "$ref": "9314" + }, + "statusCode": 202 + }, + { + "$id": "9334", + "response": { + "$ref": "9319" + }, + "statusCode": 204 + } + ] + } + ] + }, + { + "$id": "9335", + "Name": "listByResourceGroup", + "ResourceName": "DataflowEndpointResource", + "Doc": "List DataflowEndpointResource resources by InstanceResource", + "Accessibility": "public", + "Parameters": [ + { + "$id": "9336", + "Name": "apiVersion", + "NameInRequest": "api-version", + "Doc": "The API version to use for this operation.", + "Type": { + "$id": "9337", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": true, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "DefaultValue": { + "$id": "9338", + "Type": { + "$id": "9339", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "2024-11-01" + }, + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "9340", + "Name": "subscriptionId", + "NameInRequest": "subscriptionId", + "Doc": "The ID of the target subscription. The value must be an UUID.", + "Type": { + "$id": "9341", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "9342", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "9343", + "Name": "resourceGroupName", + "NameInRequest": "resourceGroupName", + "Doc": "The name of the resource group. The name is case insensitive.", + "Type": { + "$id": "9344", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "9345", + "Name": "instanceName", + "NameInRequest": "instanceName", + "Doc": "Name of instance.", + "Type": { + "$id": "9346", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "9347", + "Name": "accept", + "NameInRequest": "Accept", + "Type": { + "$id": "9348", + "kind": "constant", + "valueType": { + "$id": "9349", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "9350", + "StatusCodes": [ + 200 + ], + "BodyType": { + "$ref": "738" + }, + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false, + "ContentTypes": [ + "application/json" + ] + } + ], + "HttpMethod": "GET", + "RequestBodyMediaType": "None", + "Uri": "{endpoint}", + "Path": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/dataflowEndpoints", + "BufferResponse": true, + "Paging": { + "$id": "9351", + "ItemName": "value", + "NextLinkName": "nextLink" + }, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Microsoft.IoTOperations.DataflowEndpoint.listByResourceGroup", + "Decorators": [], + "Examples": [ + { + "$id": "9352", + "kind": "http", + "name": "DataflowEndpoint_ListByResourceGroup", + "description": "DataflowEndpoint_ListByResourceGroup", + "filePath": "2024-11-01/DataflowEndpoint_ListByResourceGroup_MaximumSet_Gen.json", + "parameters": [ + { + "$id": "9353", + "parameter": { + "$ref": "9336" + }, + "value": { + "$id": "9354", + "kind": "string", + "type": { + "$ref": "9337" + }, + "value": "2024-11-01" + } + }, + { + "$id": "9355", + "parameter": { + "$ref": "9340" + }, + "value": { + "$id": "9356", + "kind": "string", + "type": { + "$ref": "9341" + }, + "value": "F8C729F9-DF9C-4743-848F-96EE433D8E53" + } + }, + { + "$id": "9357", + "parameter": { + "$ref": "9343" + }, + "value": { + "$id": "9358", + "kind": "string", + "type": { + "$ref": "9344" + }, + "value": "rgiotoperations" + } + }, + { + "$id": "9359", + "parameter": { + "$ref": "9345" + }, + "value": { + "$id": "9360", + "kind": "string", + "type": { + "$ref": "9346" + }, + "value": "resource-name123" + } + } + ], + "responses": [ + { + "$id": "9361", + "response": { + "$ref": "9350" + }, + "statusCode": 200, + "bodyValue": { + "$id": "9362", + "kind": "model", + "type": { + "$ref": "738" + }, + "value": { + "$id": "9363", + "value": { + "$id": "9364", + "kind": "array", + "type": { + "$ref": "740" + }, + "value": [ + { + "$id": "9365", + "kind": "model", + "type": { + "$ref": "326" + }, + "value": { + "$id": "9366", + "properties": { + "$id": "9367", + "kind": "model", + "type": { + "$ref": "372" + }, + "value": { + "$id": "9368", + "endpointType": { + "$id": "9369", + "kind": "string", + "type": { + "$ref": "2" + }, + "value": "DataExplorer" + }, + "dataExplorerSettings": { + "$id": "9370", + "kind": "model", + "type": { + "$ref": "377" + }, + "value": { + "$id": "9371", + "authentication": { + "$id": "9372", + "kind": "model", + "type": { + "$ref": "379" + }, + "value": { + "$id": "9373", + "method": { + "$id": "9374", + "kind": "string", + "type": { + "$ref": "16" + }, + "value": "SystemAssignedManagedIdentity" + }, + "systemAssignedManagedIdentitySettings": { + "$id": "9375", + "kind": "model", + "type": { + "$ref": "384" + }, + "value": { + "$id": "9376", + "audience": { + "$id": "9377", + "kind": "string", + "type": { + "$ref": "386" + }, + "value": "psxomrfbhoflycm" + } + } + }, + "userAssignedManagedIdentitySettings": { + "$id": "9378", + "kind": "model", + "type": { + "$ref": "392" + }, + "value": { + "$id": "9379", + "clientId": { + "$id": "9380", + "kind": "string", + "type": { + "$ref": "394" + }, + "value": "fb90f267-8872-431a-a76a-a1cec5d3c4d2" + }, + "scope": { + "$id": "9381", + "kind": "string", + "type": { + "$ref": "398" + }, + "value": "zop" + }, + "tenantId": { + "$id": "9382", + "kind": "string", + "type": { + "$ref": "402" + }, + "value": "ed060aa2-71ff-4d3f-99c4-a9138356fdec" + } + } + } + } + }, + "database": { + "$id": "9383", + "kind": "string", + "type": { + "$ref": "410" + }, + "value": "yqcdpjsifm" + }, + "host": { + "$id": "9384", + "kind": "string", + "type": { + "$ref": "414" + }, + "value": "..kusto.windows.net" + }, + "batching": { + "$id": "9385", + "kind": "model", + "type": { + "$ref": "418" + }, + "value": { + "$id": "9386", + "latencySeconds": { + "$id": "9387", + "kind": "number", + "type": { + "$ref": "420" + }, + "value": 1228 + }, + "maxMessages": { + "$id": "9388", + "kind": "number", + "type": { + "$ref": "424" + }, + "value": 171 + } + } + } + } + }, + "dataLakeStorageSettings": { + "$id": "9389", + "kind": "model", + "type": { + "$ref": "432" + }, + "value": { + "$id": "9390", + "authentication": { + "$id": "9391", + "kind": "model", + "type": { + "$ref": "434" + }, + "value": { + "$id": "9392", + "method": { + "$id": "9393", + "kind": "string", + "type": { + "$ref": "22" + }, + "value": "SystemAssignedManagedIdentity" + }, + "accessTokenSettings": { + "$id": "9394", + "kind": "model", + "type": { + "$ref": "439" + }, + "value": { + "$id": "9395", + "secretRef": { + "$id": "9396", + "kind": "string", + "type": { + "$ref": "441" + }, + "value": "sevriyphcvnlrnfudqzejecwa" + } + } + }, + "systemAssignedManagedIdentitySettings": { + "$id": "9397", + "kind": "model", + "type": { + "$ref": "384" + }, + "value": { + "$id": "9398", + "audience": { + "$id": "9399", + "kind": "string", + "type": { + "$ref": "386" + }, + "value": "psxomrfbhoflycm" + } + } + }, + "userAssignedManagedIdentitySettings": { + "$id": "9400", + "kind": "model", + "type": { + "$ref": "392" + }, + "value": { + "$id": "9401", + "clientId": { + "$id": "9402", + "kind": "string", + "type": { + "$ref": "394" + }, + "value": "fb90f267-8872-431a-a76a-a1cec5d3c4d2" + }, + "scope": { + "$id": "9403", + "kind": "string", + "type": { + "$ref": "398" + }, + "value": "zop" + }, + "tenantId": { + "$id": "9404", + "kind": "string", + "type": { + "$ref": "402" + }, + "value": "ed060aa2-71ff-4d3f-99c4-a9138356fdec" + } + } + } + } + }, + "host": { + "$id": "9405", + "kind": "string", + "type": { + "$ref": "455" + }, + "value": ".blob.core.windows.net" + }, + "batching": { + "$id": "9406", + "kind": "model", + "type": { + "$ref": "418" + }, + "value": { + "$id": "9407", + "latencySeconds": { + "$id": "9408", + "kind": "number", + "type": { + "$ref": "420" + }, + "value": 1228 + }, + "maxMessages": { + "$id": "9409", + "kind": "number", + "type": { + "$ref": "424" + }, + "value": 171 + } + } + } + } + }, + "fabricOneLakeSettings": { + "$id": "9410", + "kind": "model", + "type": { + "$ref": "464" + }, + "value": { + "$id": "9411", + "authentication": { + "$id": "9412", + "kind": "model", + "type": { + "$ref": "466" + }, + "value": { + "$id": "9413", + "method": { + "$id": "9414", + "kind": "string", + "type": { + "$ref": "30" + }, + "value": "SystemAssignedManagedIdentity" + }, + "systemAssignedManagedIdentitySettings": { + "$id": "9415", + "kind": "model", + "type": { + "$ref": "384" + }, + "value": { + "$id": "9416", + "audience": { + "$id": "9417", + "kind": "string", + "type": { + "$ref": "386" + }, + "value": "psxomrfbhoflycm" + } + } + }, + "userAssignedManagedIdentitySettings": { + "$id": "9418", + "kind": "model", + "type": { + "$ref": "392" + }, + "value": { + "$id": "9419", + "clientId": { + "$id": "9420", + "kind": "string", + "type": { + "$ref": "394" + }, + "value": "fb90f267-8872-431a-a76a-a1cec5d3c4d2" + }, + "scope": { + "$id": "9421", + "kind": "string", + "type": { + "$ref": "398" + }, + "value": "zop" + }, + "tenantId": { + "$id": "9422", + "kind": "string", + "type": { + "$ref": "402" + }, + "value": "ed060aa2-71ff-4d3f-99c4-a9138356fdec" + } + } + } + } + }, + "names": { + "$id": "9423", + "kind": "model", + "type": { + "$ref": "479" + }, + "value": { + "$id": "9424", + "lakehouseName": { + "$id": "9425", + "kind": "string", + "type": { + "$ref": "481" + }, + "value": "wpeathi" + }, + "workspaceName": { + "$id": "9426", + "kind": "string", + "type": { + "$ref": "485" + }, + "value": "nwgmitkbljztgms" + } + } + }, + "oneLakePathType": { + "$id": "9427", + "kind": "string", + "type": { + "$ref": "36" + }, + "value": "Files" + }, + "host": { + "$id": "9428", + "kind": "string", + "type": { + "$ref": "494" + }, + "value": "https://.fabric.microsoft.com" + }, + "batching": { + "$id": "9429", + "kind": "model", + "type": { + "$ref": "418" + }, + "value": { + "$id": "9430", + "latencySeconds": { + "$id": "9431", + "kind": "number", + "type": { + "$ref": "420" + }, + "value": 1228 + }, + "maxMessages": { + "$id": "9432", + "kind": "number", + "type": { + "$ref": "424" + }, + "value": 171 + } + } + } + } + }, + "kafkaSettings": { + "$id": "9433", + "kind": "model", + "type": { + "$ref": "503" + }, + "value": { + "$id": "9434", + "authentication": { + "$id": "9435", + "kind": "model", + "type": { + "$ref": "505" + }, + "value": { + "$id": "9436", + "method": { + "$id": "9437", + "kind": "string", + "type": { + "$ref": "42" + }, + "value": "SystemAssignedManagedIdentity" + }, + "systemAssignedManagedIdentitySettings": { + "$id": "9438", + "kind": "model", + "type": { + "$ref": "384" + }, + "value": { + "$id": "9439", + "audience": { + "$id": "9440", + "kind": "string", + "type": { + "$ref": "386" + }, + "value": "psxomrfbhoflycm" + } + } + }, + "userAssignedManagedIdentitySettings": { + "$id": "9441", + "kind": "model", + "type": { + "$ref": "392" + }, + "value": { + "$id": "9442", + "clientId": { + "$id": "9443", + "kind": "string", + "type": { + "$ref": "394" + }, + "value": "fb90f267-8872-431a-a76a-a1cec5d3c4d2" + }, + "scope": { + "$id": "9444", + "kind": "string", + "type": { + "$ref": "398" + }, + "value": "zop" + }, + "tenantId": { + "$id": "9445", + "kind": "string", + "type": { + "$ref": "402" + }, + "value": "ed060aa2-71ff-4d3f-99c4-a9138356fdec" + } + } + }, + "saslSettings": { + "$id": "9446", + "kind": "model", + "type": { + "$ref": "516" + }, + "value": { + "$id": "9447", + "saslType": { + "$id": "9448", + "kind": "string", + "type": { + "$ref": "54" + }, + "value": "Plain" + }, + "secretRef": { + "$id": "9449", + "kind": "string", + "type": { + "$ref": "521" + }, + "value": "visyxoztqnylvbyokhtmpdkwes" + } + } + }, + "x509CertificateSettings": { + "$id": "9450", + "kind": "model", + "type": { + "$ref": "527" + }, + "value": { + "$id": "9451", + "secretRef": { + "$id": "9452", + "kind": "string", + "type": { + "$ref": "529" + }, + "value": "afwizrystfslkfqd" + } + } + } + } + }, + "consumerGroupId": { + "$id": "9453", + "kind": "string", + "type": { + "$ref": "537" + }, + "value": "ukkzcjiyenhxokat" + }, + "host": { + "$id": "9454", + "kind": "string", + "type": { + "$ref": "541" + }, + "value": "pwcqfiqclcgneolpewnyavoulbip" + }, + "batching": { + "$id": "9455", + "kind": "model", + "type": { + "$ref": "545" + }, + "value": { + "$id": "9456", + "mode": { + "$id": "9457", + "kind": "string", + "type": { + "$ref": "62" + }, + "value": "Enabled" + }, + "latencyMs": { + "$id": "9458", + "kind": "number", + "type": { + "$ref": "550" + }, + "value": 3679 + }, + "maxBytes": { + "$id": "9459", + "kind": "number", + "type": { + "$ref": "554" + }, + "value": 8887 + }, + "maxMessages": { + "$id": "9460", + "kind": "number", + "type": { + "$ref": "558" + }, + "value": 2174 + } + } + }, + "copyMqttProperties": { + "$id": "9461", + "kind": "string", + "type": { + "$ref": "62" + }, + "value": "Enabled" + }, + "compression": { + "$id": "9462", + "kind": "string", + "type": { + "$ref": "68" + }, + "value": "None" + }, + "kafkaAcks": { + "$id": "9463", + "kind": "string", + "type": { + "$ref": "78" + }, + "value": "Zero" + }, + "partitionStrategy": { + "$id": "9464", + "kind": "string", + "type": { + "$ref": "86" + }, + "value": "Default" + }, + "tls": { + "$id": "9465", + "kind": "model", + "type": { + "$ref": "576" + }, + "value": { + "$id": "9466", + "mode": { + "$id": "9467", + "kind": "string", + "type": { + "$ref": "62" + }, + "value": "Enabled" + }, + "trustedCaCertificateConfigMapRef": { + "$id": "9468", + "kind": "string", + "type": { + "$ref": "581" + }, + "value": "tectjjvukvelsreihwadh" + } + } + } + } + }, + "localStorageSettings": { + "$id": "9469", + "kind": "model", + "type": { + "$ref": "592" + }, + "value": { + "$id": "9470", + "persistentVolumeClaimRef": { + "$id": "9471", + "kind": "string", + "type": { + "$ref": "594" + }, + "value": "jjwqwvd" + } + } + }, + "mqttSettings": { + "$id": "9472", + "kind": "model", + "type": { + "$ref": "600" + }, + "value": { + "$id": "9473", + "authentication": { + "$id": "9474", + "kind": "model", + "type": { + "$ref": "602" + }, + "value": { + "$id": "9475", + "method": { + "$id": "9476", + "kind": "string", + "type": { + "$ref": "102" + }, + "value": "SystemAssignedManagedIdentity" + }, + "systemAssignedManagedIdentitySettings": { + "$id": "9477", + "kind": "model", + "type": { + "$ref": "384" + }, + "value": { + "$id": "9478", + "audience": { + "$id": "9479", + "kind": "string", + "type": { + "$ref": "386" + }, + "value": "psxomrfbhoflycm" + } + } + }, + "userAssignedManagedIdentitySettings": { + "$id": "9480", + "kind": "model", + "type": { + "$ref": "392" + }, + "value": { + "$id": "9481", + "clientId": { + "$id": "9482", + "kind": "string", + "type": { + "$ref": "394" + }, + "value": "fb90f267-8872-431a-a76a-a1cec5d3c4d2" + }, + "scope": { + "$id": "9483", + "kind": "string", + "type": { + "$ref": "398" + }, + "value": "zop" + }, + "tenantId": { + "$id": "9484", + "kind": "string", + "type": { + "$ref": "402" + }, + "value": "ed060aa2-71ff-4d3f-99c4-a9138356fdec" + } + } + }, + "serviceAccountTokenSettings": { + "$id": "9485", + "kind": "model", + "type": { + "$ref": "613" + }, + "value": { + "$id": "9486", + "audience": { + "$id": "9487", + "kind": "string", + "type": { + "$ref": "615" + }, + "value": "ejbklrbxgjaqleoycgpje" + } + } + }, + "x509CertificateSettings": { + "$id": "9488", + "kind": "model", + "type": { + "$ref": "527" + }, + "value": { + "$id": "9489", + "secretRef": { + "$id": "9490", + "kind": "string", + "type": { + "$ref": "529" + }, + "value": "afwizrystfslkfqd" + } + } + } + } + }, + "clientIdPrefix": { + "$id": "9491", + "kind": "string", + "type": { + "$ref": "626" + }, + "value": "kkljsdxdirfhwxtkavldekeqhv" + }, + "host": { + "$id": "9492", + "kind": "string", + "type": { + "$ref": "630" + }, + "value": "nyhnxqnbspstctl" + }, + "protocol": { + "$id": "9493", + "kind": "string", + "type": { + "$ref": "114" + }, + "value": "Mqtt" + }, + "keepAliveSeconds": { + "$id": "9494", + "kind": "number", + "type": { + "$ref": "637" + }, + "value": 0 + }, + "retain": { + "$id": "9495", + "kind": "string", + "type": { + "$ref": "120" + }, + "value": "Keep" + }, + "maxInflightMessages": { + "$id": "9496", + "kind": "number", + "type": { + "$ref": "644" + }, + "value": 0 + }, + "qos": { + "$id": "9497", + "kind": "number", + "type": { + "$ref": "648" + }, + "value": 1 + }, + "sessionExpirySeconds": { + "$id": "9498", + "kind": "number", + "type": { + "$ref": "652" + }, + "value": 0 + }, + "tls": { + "$id": "9499", + "kind": "model", + "type": { + "$ref": "576" + }, + "value": { + "$id": "9500", + "mode": { + "$id": "9501", + "kind": "string", + "type": { + "$ref": "62" + }, + "value": "Enabled" + }, + "trustedCaCertificateConfigMapRef": { + "$id": "9502", + "kind": "string", + "type": { + "$ref": "581" + }, + "value": "tectjjvukvelsreihwadh" + } + } + } + } + }, + "provisioningState": { + "$id": "9503", + "kind": "string", + "type": { + "$ref": "126" + }, + "value": "Succeeded" + } + } + }, + "extendedLocation": { + "$id": "9504", + "kind": "model", + "type": { + "$ref": "669" + }, + "value": { + "$id": "9505", + "name": { + "$id": "9506", + "kind": "string", + "type": { + "$ref": "671" + }, + "value": "qmbrfwcpwwhggszhrdjv" + }, + "type": { + "$id": "9507", + "kind": "string", + "type": { + "$ref": "142" + }, + "value": "CustomLocation" + } + } + }, + "id": { + "$id": "9508", + "kind": "string", + "type": { + "$ref": "330" + }, + "value": "/subscriptions/0000000-0000-0000-0000-000000000000/resourceGroups/resourceGroup123/providers/Microsoft.IoTOperations/instances/resource-name123/dataflowEndpoints/resource-name123" + }, + "name": { + "$id": "9509", + "kind": "string", + "type": { + "$ref": "335" + }, + "value": "zyhxscudobzfacetvgyjiav" + }, + "type": { + "$id": "9510", + "kind": "string", + "type": { + "$ref": "339" + }, + "value": "iay" + }, + "systemData": { + "$id": "9511", + "kind": "model", + "type": { + "$ref": "344" + }, + "value": { + "$id": "9512", + "createdBy": { + "$id": "9513", + "kind": "string", + "type": { + "$ref": "346" + }, + "value": "ssvaslsmudloholronopqyxjcu" + }, + "createdByType": { + "$id": "9514", + "kind": "string", + "type": { + "$ref": "146" + }, + "value": "User" + }, + "createdAt": { + "$id": "9515", + "kind": "string", + "type": { + "$ref": "353" + }, + "value": "2024-08-09T18:13:29.389Z" + }, + "lastModifiedBy": { + "$id": "9516", + "kind": "string", + "type": { + "$ref": "358" + }, + "value": "gnicpuszwd" + }, + "lastModifiedByType": { + "$id": "9517", + "kind": "string", + "type": { + "$ref": "146" + }, + "value": "User" + }, + "lastModifiedAt": { + "$id": "9518", + "kind": "string", + "type": { + "$ref": "365" + }, + "value": "2024-08-09T18:13:29.389Z" + } + } + } + } + } + ] + }, + "nextLink": { + "$id": "9519", + "kind": "string", + "type": { + "$ref": "744" + }, + "value": "https://microsoft.com/a" + } + } + } + } + ] + } + ] + } + ], + "Protocol": { + "$id": "9520" + }, + "Parent": "IoTOperationsClient", + "Parameters": [ + { + "$id": "9521", + "Name": "endpoint", + "NameInRequest": "endpoint", + "Doc": "Service host", + "Type": { + "$id": "9522", + "kind": "url", + "name": "url", + "crossLanguageDefinitionId": "TypeSpec.url" + }, + "Location": "Uri", + "IsApiVersion": false, + "IsResourceParameter": false, + "IsContentType": false, + "IsRequired": true, + "IsEndpoint": true, + "SkipUrlEncoding": false, + "Explode": false, + "Kind": "Client", + "DefaultValue": { + "$id": "9523", + "Type": { + "$id": "9524", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "https://management.azure.com" + } + } + ], + "Decorators": [] + } + ], + "Auth": { + "$id": "9525", + "OAuth2": { + "$id": "9526", + "Scopes": [ + "user_impersonation" + ] + } + } +} diff --git a/sdk/mongocluster/Azure.ResourceManager.MongoCluster/api/Azure.ResourceManager.MongoCluster.net8.0.cs b/sdk/mongocluster/Azure.ResourceManager.MongoCluster/api/Azure.ResourceManager.MongoCluster.net8.0.cs index be41ef5b289c..61a91910b891 100644 --- a/sdk/mongocluster/Azure.ResourceManager.MongoCluster/api/Azure.ResourceManager.MongoCluster.net8.0.cs +++ b/sdk/mongocluster/Azure.ResourceManager.MongoCluster/api/Azure.ResourceManager.MongoCluster.net8.0.cs @@ -215,12 +215,30 @@ public static partial class ArmMongoClusterModelFactory public static Azure.ResourceManager.MongoCluster.MongoClusterPrivateEndpointConnectionResourceData MongoClusterPrivateEndpointConnectionResourceData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.MongoCluster.Models.MongoClusterPrivateEndpointConnectionProperties properties = null) { throw null; } public static Azure.ResourceManager.MongoCluster.Models.MongoClusterPrivateLinkResourceData MongoClusterPrivateLinkResourceData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.MongoCluster.Models.MongoClusterPrivateLinkResourceProperties properties = null) { throw null; } public static Azure.ResourceManager.MongoCluster.Models.MongoClusterPrivateLinkResourceProperties MongoClusterPrivateLinkResourceProperties(string groupId = null, System.Collections.Generic.IEnumerable requiredMembers = null, System.Collections.Generic.IEnumerable requiredZoneNames = null) { throw null; } - public static Azure.ResourceManager.MongoCluster.Models.MongoClusterProperties MongoClusterProperties(Azure.ResourceManager.MongoCluster.Models.MongoClusterCreateMode? createMode = default(Azure.ResourceManager.MongoCluster.Models.MongoClusterCreateMode?), Azure.ResourceManager.MongoCluster.Models.MongoClusterRestoreContent restoreParameters = null, Azure.ResourceManager.MongoCluster.Models.MongoClusterReplicaContent replicaParameters = null, Azure.ResourceManager.MongoCluster.Models.MongoClusterAdministratorProperties administrator = null, string serverVersion = null, string connectionString = null, Azure.ResourceManager.MongoCluster.Models.MongoClusterProvisioningState? provisioningState = default(Azure.ResourceManager.MongoCluster.Models.MongoClusterProvisioningState?), Azure.ResourceManager.MongoCluster.Models.MongoClusterStatus? clusterStatus = default(Azure.ResourceManager.MongoCluster.Models.MongoClusterStatus?), Azure.ResourceManager.MongoCluster.Models.MongoClusterPublicNetworkAccess? publicNetworkAccess = default(Azure.ResourceManager.MongoCluster.Models.MongoClusterPublicNetworkAccess?), Azure.ResourceManager.MongoCluster.Models.HighAvailabilityMode? highAvailabilityTargetMode = default(Azure.ResourceManager.MongoCluster.Models.HighAvailabilityMode?), long? storageSizeGb = default(long?), int? shardingShardCount = default(int?), string computeTier = null, string backupEarliestRestoreTime = null, System.Collections.Generic.IEnumerable privateEndpointConnections = null, System.Collections.Generic.IEnumerable previewFeatures = null, Azure.ResourceManager.MongoCluster.Models.MongoClusterReplicationProperties replica = null, string infrastructureVersion = null) { throw null; } + public static Azure.ResourceManager.MongoCluster.Models.MongoClusterProperties MongoClusterProperties(Azure.ResourceManager.MongoCluster.Models.MongoClusterCreateMode? createMode = default(Azure.ResourceManager.MongoCluster.Models.MongoClusterCreateMode?), Azure.ResourceManager.MongoCluster.Models.MongoClusterRestoreContent restoreParameters = null, Azure.ResourceManager.MongoCluster.Models.MongoClusterReplicaContent replicaParameters = null, Azure.ResourceManager.MongoCluster.Models.MongoClusterAdministratorProperties administrator = null, string serverVersion = null, string connectionString = null, Azure.ResourceManager.MongoCluster.Models.MongoClusterProvisioningState? provisioningState = default(Azure.ResourceManager.MongoCluster.Models.MongoClusterProvisioningState?), Azure.ResourceManager.MongoCluster.Models.MongoClusterStatus? clusterStatus = default(Azure.ResourceManager.MongoCluster.Models.MongoClusterStatus?), Azure.ResourceManager.MongoCluster.Models.MongoClusterPublicNetworkAccess? publicNetworkAccess = default(Azure.ResourceManager.MongoCluster.Models.MongoClusterPublicNetworkAccess?), Azure.ResourceManager.MongoCluster.Models.HighAvailabilityMode? highAvailabilityTargetMode = default(Azure.ResourceManager.MongoCluster.Models.HighAvailabilityMode?), long? storageSizeGb = default(long?), int? shardingShardCount = default(int?), string computeTier = null, string backupEarliestRestoreTime = null, Azure.ResourceManager.MongoCluster.Models.DataApiMode? dataApiMode = default(Azure.ResourceManager.MongoCluster.Models.DataApiMode?), System.Collections.Generic.IEnumerable privateEndpointConnections = null, System.Collections.Generic.IEnumerable previewFeatures = null, Azure.ResourceManager.MongoCluster.Models.MongoClusterReplicationProperties replica = null, string infrastructureVersion = null) { throw null; } public static Azure.ResourceManager.MongoCluster.Models.MongoClusterReplica MongoClusterReplica(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.MongoCluster.Models.MongoClusterProperties properties = null) { throw null; } public static Azure.ResourceManager.MongoCluster.Models.MongoClusterReplicationProperties MongoClusterReplicationProperties(Azure.Core.ResourceIdentifier sourceResourceId = null, Azure.ResourceManager.MongoCluster.Models.MongoClusterReplicationRole? role = default(Azure.ResourceManager.MongoCluster.Models.MongoClusterReplicationRole?), Azure.ResourceManager.MongoCluster.Models.MongoClusterReplicationState? replicationState = default(Azure.ResourceManager.MongoCluster.Models.MongoClusterReplicationState?)) { throw null; } public static Azure.ResourceManager.MongoCluster.Models.PromoteReplicaContent PromoteReplicaContent(Azure.ResourceManager.MongoCluster.Models.MongoClusterPromoteOption promoteOption = default(Azure.ResourceManager.MongoCluster.Models.MongoClusterPromoteOption), Azure.ResourceManager.MongoCluster.Models.MongoClusterPromoteMode? mode = default(Azure.ResourceManager.MongoCluster.Models.MongoClusterPromoteMode?)) { throw null; } } [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct DataApiMode : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public DataApiMode(string value) { throw null; } + public static Azure.ResourceManager.MongoCluster.Models.DataApiMode Disabled { get { throw null; } } + public static Azure.ResourceManager.MongoCluster.Models.DataApiMode Enabled { get { throw null; } } + public bool Equals(Azure.ResourceManager.MongoCluster.Models.DataApiMode other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.MongoCluster.Models.DataApiMode left, Azure.ResourceManager.MongoCluster.Models.DataApiMode right) { throw null; } + public static implicit operator Azure.ResourceManager.MongoCluster.Models.DataApiMode (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.MongoCluster.Models.DataApiMode left, Azure.ResourceManager.MongoCluster.Models.DataApiMode right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] public readonly partial struct HighAvailabilityMode : System.IEquatable { private readonly object _dummy; @@ -524,6 +542,7 @@ public MongoClusterProperties() { } public string ComputeTier { get { throw null; } set { } } public string ConnectionString { get { throw null; } } public Azure.ResourceManager.MongoCluster.Models.MongoClusterCreateMode? CreateMode { get { throw null; } set { } } + public Azure.ResourceManager.MongoCluster.Models.DataApiMode? DataApiMode { get { throw null; } set { } } public Azure.ResourceManager.MongoCluster.Models.HighAvailabilityMode? HighAvailabilityTargetMode { get { throw null; } set { } } public string InfrastructureVersion { get { throw null; } } public System.Collections.Generic.IList PreviewFeatures { get { throw null; } } @@ -701,6 +720,7 @@ public MongoClusterUpdateProperties() { } public Azure.ResourceManager.MongoCluster.Models.MongoClusterAdministratorProperties Administrator { get { throw null; } set { } } public string BackupEarliestRestoreTime { get { throw null; } } public string ComputeTier { get { throw null; } set { } } + public Azure.ResourceManager.MongoCluster.Models.DataApiMode? DataApiMode { get { throw null; } set { } } public Azure.ResourceManager.MongoCluster.Models.HighAvailabilityMode? HighAvailabilityTargetMode { get { throw null; } set { } } public System.Collections.Generic.IList PreviewFeatures { get { throw null; } } public Azure.ResourceManager.MongoCluster.Models.MongoClusterPublicNetworkAccess? PublicNetworkAccess { get { throw null; } set { } } diff --git a/sdk/mongocluster/Azure.ResourceManager.MongoCluster/api/Azure.ResourceManager.MongoCluster.netstandard2.0.cs b/sdk/mongocluster/Azure.ResourceManager.MongoCluster/api/Azure.ResourceManager.MongoCluster.netstandard2.0.cs index be41ef5b289c..61a91910b891 100644 --- a/sdk/mongocluster/Azure.ResourceManager.MongoCluster/api/Azure.ResourceManager.MongoCluster.netstandard2.0.cs +++ b/sdk/mongocluster/Azure.ResourceManager.MongoCluster/api/Azure.ResourceManager.MongoCluster.netstandard2.0.cs @@ -215,12 +215,30 @@ public static partial class ArmMongoClusterModelFactory public static Azure.ResourceManager.MongoCluster.MongoClusterPrivateEndpointConnectionResourceData MongoClusterPrivateEndpointConnectionResourceData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.MongoCluster.Models.MongoClusterPrivateEndpointConnectionProperties properties = null) { throw null; } public static Azure.ResourceManager.MongoCluster.Models.MongoClusterPrivateLinkResourceData MongoClusterPrivateLinkResourceData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.MongoCluster.Models.MongoClusterPrivateLinkResourceProperties properties = null) { throw null; } public static Azure.ResourceManager.MongoCluster.Models.MongoClusterPrivateLinkResourceProperties MongoClusterPrivateLinkResourceProperties(string groupId = null, System.Collections.Generic.IEnumerable requiredMembers = null, System.Collections.Generic.IEnumerable requiredZoneNames = null) { throw null; } - public static Azure.ResourceManager.MongoCluster.Models.MongoClusterProperties MongoClusterProperties(Azure.ResourceManager.MongoCluster.Models.MongoClusterCreateMode? createMode = default(Azure.ResourceManager.MongoCluster.Models.MongoClusterCreateMode?), Azure.ResourceManager.MongoCluster.Models.MongoClusterRestoreContent restoreParameters = null, Azure.ResourceManager.MongoCluster.Models.MongoClusterReplicaContent replicaParameters = null, Azure.ResourceManager.MongoCluster.Models.MongoClusterAdministratorProperties administrator = null, string serverVersion = null, string connectionString = null, Azure.ResourceManager.MongoCluster.Models.MongoClusterProvisioningState? provisioningState = default(Azure.ResourceManager.MongoCluster.Models.MongoClusterProvisioningState?), Azure.ResourceManager.MongoCluster.Models.MongoClusterStatus? clusterStatus = default(Azure.ResourceManager.MongoCluster.Models.MongoClusterStatus?), Azure.ResourceManager.MongoCluster.Models.MongoClusterPublicNetworkAccess? publicNetworkAccess = default(Azure.ResourceManager.MongoCluster.Models.MongoClusterPublicNetworkAccess?), Azure.ResourceManager.MongoCluster.Models.HighAvailabilityMode? highAvailabilityTargetMode = default(Azure.ResourceManager.MongoCluster.Models.HighAvailabilityMode?), long? storageSizeGb = default(long?), int? shardingShardCount = default(int?), string computeTier = null, string backupEarliestRestoreTime = null, System.Collections.Generic.IEnumerable privateEndpointConnections = null, System.Collections.Generic.IEnumerable previewFeatures = null, Azure.ResourceManager.MongoCluster.Models.MongoClusterReplicationProperties replica = null, string infrastructureVersion = null) { throw null; } + public static Azure.ResourceManager.MongoCluster.Models.MongoClusterProperties MongoClusterProperties(Azure.ResourceManager.MongoCluster.Models.MongoClusterCreateMode? createMode = default(Azure.ResourceManager.MongoCluster.Models.MongoClusterCreateMode?), Azure.ResourceManager.MongoCluster.Models.MongoClusterRestoreContent restoreParameters = null, Azure.ResourceManager.MongoCluster.Models.MongoClusterReplicaContent replicaParameters = null, Azure.ResourceManager.MongoCluster.Models.MongoClusterAdministratorProperties administrator = null, string serverVersion = null, string connectionString = null, Azure.ResourceManager.MongoCluster.Models.MongoClusterProvisioningState? provisioningState = default(Azure.ResourceManager.MongoCluster.Models.MongoClusterProvisioningState?), Azure.ResourceManager.MongoCluster.Models.MongoClusterStatus? clusterStatus = default(Azure.ResourceManager.MongoCluster.Models.MongoClusterStatus?), Azure.ResourceManager.MongoCluster.Models.MongoClusterPublicNetworkAccess? publicNetworkAccess = default(Azure.ResourceManager.MongoCluster.Models.MongoClusterPublicNetworkAccess?), Azure.ResourceManager.MongoCluster.Models.HighAvailabilityMode? highAvailabilityTargetMode = default(Azure.ResourceManager.MongoCluster.Models.HighAvailabilityMode?), long? storageSizeGb = default(long?), int? shardingShardCount = default(int?), string computeTier = null, string backupEarliestRestoreTime = null, Azure.ResourceManager.MongoCluster.Models.DataApiMode? dataApiMode = default(Azure.ResourceManager.MongoCluster.Models.DataApiMode?), System.Collections.Generic.IEnumerable privateEndpointConnections = null, System.Collections.Generic.IEnumerable previewFeatures = null, Azure.ResourceManager.MongoCluster.Models.MongoClusterReplicationProperties replica = null, string infrastructureVersion = null) { throw null; } public static Azure.ResourceManager.MongoCluster.Models.MongoClusterReplica MongoClusterReplica(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.MongoCluster.Models.MongoClusterProperties properties = null) { throw null; } public static Azure.ResourceManager.MongoCluster.Models.MongoClusterReplicationProperties MongoClusterReplicationProperties(Azure.Core.ResourceIdentifier sourceResourceId = null, Azure.ResourceManager.MongoCluster.Models.MongoClusterReplicationRole? role = default(Azure.ResourceManager.MongoCluster.Models.MongoClusterReplicationRole?), Azure.ResourceManager.MongoCluster.Models.MongoClusterReplicationState? replicationState = default(Azure.ResourceManager.MongoCluster.Models.MongoClusterReplicationState?)) { throw null; } public static Azure.ResourceManager.MongoCluster.Models.PromoteReplicaContent PromoteReplicaContent(Azure.ResourceManager.MongoCluster.Models.MongoClusterPromoteOption promoteOption = default(Azure.ResourceManager.MongoCluster.Models.MongoClusterPromoteOption), Azure.ResourceManager.MongoCluster.Models.MongoClusterPromoteMode? mode = default(Azure.ResourceManager.MongoCluster.Models.MongoClusterPromoteMode?)) { throw null; } } [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct DataApiMode : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public DataApiMode(string value) { throw null; } + public static Azure.ResourceManager.MongoCluster.Models.DataApiMode Disabled { get { throw null; } } + public static Azure.ResourceManager.MongoCluster.Models.DataApiMode Enabled { get { throw null; } } + public bool Equals(Azure.ResourceManager.MongoCluster.Models.DataApiMode other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.MongoCluster.Models.DataApiMode left, Azure.ResourceManager.MongoCluster.Models.DataApiMode right) { throw null; } + public static implicit operator Azure.ResourceManager.MongoCluster.Models.DataApiMode (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.MongoCluster.Models.DataApiMode left, Azure.ResourceManager.MongoCluster.Models.DataApiMode right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] public readonly partial struct HighAvailabilityMode : System.IEquatable { private readonly object _dummy; @@ -524,6 +542,7 @@ public MongoClusterProperties() { } public string ComputeTier { get { throw null; } set { } } public string ConnectionString { get { throw null; } } public Azure.ResourceManager.MongoCluster.Models.MongoClusterCreateMode? CreateMode { get { throw null; } set { } } + public Azure.ResourceManager.MongoCluster.Models.DataApiMode? DataApiMode { get { throw null; } set { } } public Azure.ResourceManager.MongoCluster.Models.HighAvailabilityMode? HighAvailabilityTargetMode { get { throw null; } set { } } public string InfrastructureVersion { get { throw null; } } public System.Collections.Generic.IList PreviewFeatures { get { throw null; } } @@ -701,6 +720,7 @@ public MongoClusterUpdateProperties() { } public Azure.ResourceManager.MongoCluster.Models.MongoClusterAdministratorProperties Administrator { get { throw null; } set { } } public string BackupEarliestRestoreTime { get { throw null; } } public string ComputeTier { get { throw null; } set { } } + public Azure.ResourceManager.MongoCluster.Models.DataApiMode? DataApiMode { get { throw null; } set { } } public Azure.ResourceManager.MongoCluster.Models.HighAvailabilityMode? HighAvailabilityTargetMode { get { throw null; } set { } } public System.Collections.Generic.IList PreviewFeatures { get { throw null; } } public Azure.ResourceManager.MongoCluster.Models.MongoClusterPublicNetworkAccess? PublicNetworkAccess { get { throw null; } set { } } diff --git a/sdk/mongocluster/Azure.ResourceManager.MongoCluster/samples/Generated/Samples/Sample_MongoClusterCollection.cs b/sdk/mongocluster/Azure.ResourceManager.MongoCluster/samples/Generated/Samples/Sample_MongoClusterCollection.cs index 3a1dea587e91..ec076fb08bcb 100644 --- a/sdk/mongocluster/Azure.ResourceManager.MongoCluster/samples/Generated/Samples/Sample_MongoClusterCollection.cs +++ b/sdk/mongocluster/Azure.ResourceManager.MongoCluster/samples/Generated/Samples/Sample_MongoClusterCollection.cs @@ -21,7 +21,7 @@ public partial class Sample_MongoClusterCollection [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_CreatesANewMongoClusterResource() { - // Generated from example definition: 2024-07-01/MongoClusters_Create.json + // Generated from example definition: 2024-10-01-preview/MongoClusters_Create.json // this example is just showing the usage of "MongoCluster_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 @@ -71,7 +71,7 @@ public async Task CreateOrUpdate_CreatesANewMongoClusterResource() [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_CreatesAReplicaMongoClusterResourceFromASourceResource() { - // Generated from example definition: 2024-07-01/MongoClusters_CreateGeoReplica.json + // Generated from example definition: 2024-10-01-preview/MongoClusters_CreateGeoReplica.json // this example is just showing the usage of "MongoCluster_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 @@ -113,7 +113,7 @@ public async Task CreateOrUpdate_CreatesAReplicaMongoClusterResourceFromASourceR [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_CreatesAMongoClusterResourceFromAPointInTimeRestore() { - // Generated from example definition: 2024-07-01/MongoClusters_CreatePITR.json + // Generated from example definition: 2024-10-01-preview/MongoClusters_CreatePITR.json // this example is just showing the usage of "MongoCluster_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 @@ -159,7 +159,7 @@ public async Task CreateOrUpdate_CreatesAMongoClusterResourceFromAPointInTimeRes [Ignore("Only validating compilation of examples")] public async Task Get_GetsAMongoClusterResource() { - // Generated from example definition: 2024-07-01/MongoClusters_Get.json + // Generated from example definition: 2024-10-01-preview/MongoClusters_Get.json // this example is just showing the usage of "MongoCluster_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -192,7 +192,7 @@ public async Task Get_GetsAMongoClusterResource() [Ignore("Only validating compilation of examples")] public async Task GetAll_ListsTheMongoClusterResourcesInAResourceGroup() { - // Generated from example definition: 2024-07-01/MongoClusters_ListByResourceGroup.json + // Generated from example definition: 2024-10-01-preview/MongoClusters_ListByResourceGroup.json // this example is just showing the usage of "MongoCluster_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 @@ -227,7 +227,7 @@ public async Task GetAll_ListsTheMongoClusterResourcesInAResourceGroup() [Ignore("Only validating compilation of examples")] public async Task Exists_GetsAMongoClusterResource() { - // Generated from example definition: 2024-07-01/MongoClusters_Get.json + // Generated from example definition: 2024-10-01-preview/MongoClusters_Get.json // this example is just showing the usage of "MongoCluster_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 @@ -256,7 +256,7 @@ public async Task Exists_GetsAMongoClusterResource() [Ignore("Only validating compilation of examples")] public async Task GetIfExists_GetsAMongoClusterResource() { - // Generated from example definition: 2024-07-01/MongoClusters_Get.json + // Generated from example definition: 2024-10-01-preview/MongoClusters_Get.json // this example is just showing the usage of "MongoCluster_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/mongocluster/Azure.ResourceManager.MongoCluster/samples/Generated/Samples/Sample_MongoClusterFirewallRuleCollection.cs b/sdk/mongocluster/Azure.ResourceManager.MongoCluster/samples/Generated/Samples/Sample_MongoClusterFirewallRuleCollection.cs index f95bd4dccd14..1fd66ec01117 100644 --- a/sdk/mongocluster/Azure.ResourceManager.MongoCluster/samples/Generated/Samples/Sample_MongoClusterFirewallRuleCollection.cs +++ b/sdk/mongocluster/Azure.ResourceManager.MongoCluster/samples/Generated/Samples/Sample_MongoClusterFirewallRuleCollection.cs @@ -20,7 +20,7 @@ public partial class Sample_MongoClusterFirewallRuleCollection [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_CreatesAFirewallRuleOnAMongoClusterResource() { - // Generated from example definition: 2024-07-01/MongoClusters_FirewallRuleCreate.json + // Generated from example definition: 2024-10-01-preview/MongoClusters_FirewallRuleCreate.json // this example is just showing the usage of "FirewallRule_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 @@ -59,7 +59,7 @@ public async Task CreateOrUpdate_CreatesAFirewallRuleOnAMongoClusterResource() [Ignore("Only validating compilation of examples")] public async Task Get_GetsAFirewallRuleOnAMongoClusterResource() { - // Generated from example definition: 2024-07-01/MongoClusters_FirewallRuleGet.json + // Generated from example definition: 2024-10-01-preview/MongoClusters_FirewallRuleGet.json // this example is just showing the usage of "FirewallRule_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 @@ -93,7 +93,7 @@ public async Task Get_GetsAFirewallRuleOnAMongoClusterResource() [Ignore("Only validating compilation of examples")] public async Task GetAll_ListTheFirewallRulesOnAMongoClusterResource() { - // Generated from example definition: 2024-07-01/MongoClusters_FirewallRuleList.json + // Generated from example definition: 2024-10-01-preview/MongoClusters_FirewallRuleList.json // this example is just showing the usage of "FirewallRule_ListByMongoCluster" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -129,7 +129,7 @@ public async Task GetAll_ListTheFirewallRulesOnAMongoClusterResource() [Ignore("Only validating compilation of examples")] public async Task Exists_GetsAFirewallRuleOnAMongoClusterResource() { - // Generated from example definition: 2024-07-01/MongoClusters_FirewallRuleGet.json + // Generated from example definition: 2024-10-01-preview/MongoClusters_FirewallRuleGet.json // this example is just showing the usage of "FirewallRule_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 @@ -159,7 +159,7 @@ public async Task Exists_GetsAFirewallRuleOnAMongoClusterResource() [Ignore("Only validating compilation of examples")] public async Task GetIfExists_GetsAFirewallRuleOnAMongoClusterResource() { - // Generated from example definition: 2024-07-01/MongoClusters_FirewallRuleGet.json + // Generated from example definition: 2024-10-01-preview/MongoClusters_FirewallRuleGet.json // this example is just showing the usage of "FirewallRule_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/mongocluster/Azure.ResourceManager.MongoCluster/samples/Generated/Samples/Sample_MongoClusterFirewallRuleResource.cs b/sdk/mongocluster/Azure.ResourceManager.MongoCluster/samples/Generated/Samples/Sample_MongoClusterFirewallRuleResource.cs index d4aa354b7aaf..c56bc9192467 100644 --- a/sdk/mongocluster/Azure.ResourceManager.MongoCluster/samples/Generated/Samples/Sample_MongoClusterFirewallRuleResource.cs +++ b/sdk/mongocluster/Azure.ResourceManager.MongoCluster/samples/Generated/Samples/Sample_MongoClusterFirewallRuleResource.cs @@ -20,7 +20,7 @@ public partial class Sample_MongoClusterFirewallRuleResource [Ignore("Only validating compilation of examples")] public async Task Get_GetsAFirewallRuleOnAMongoClusterResource() { - // Generated from example definition: 2024-07-01/MongoClusters_FirewallRuleGet.json + // Generated from example definition: 2024-10-01-preview/MongoClusters_FirewallRuleGet.json // this example is just showing the usage of "FirewallRule_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 @@ -51,7 +51,7 @@ public async Task Get_GetsAFirewallRuleOnAMongoClusterResource() [Ignore("Only validating compilation of examples")] public async Task Delete_DeletesAFirewallRuleOnAMongoClusterResource() { - // Generated from example definition: 2024-07-01/MongoClusters_FirewallRuleDelete.json + // Generated from example definition: 2024-10-01-preview/MongoClusters_FirewallRuleDelete.json // this example is just showing the usage of "FirewallRule_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 @@ -78,7 +78,7 @@ public async Task Delete_DeletesAFirewallRuleOnAMongoClusterResource() [Ignore("Only validating compilation of examples")] public async Task Update_CreatesAFirewallRuleOnAMongoClusterResource() { - // Generated from example definition: 2024-07-01/MongoClusters_FirewallRuleCreate.json + // Generated from example definition: 2024-10-01-preview/MongoClusters_FirewallRuleCreate.json // this example is just showing the usage of "FirewallRule_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/mongocluster/Azure.ResourceManager.MongoCluster/samples/Generated/Samples/Sample_MongoClusterPrivateEndpointConnectionResource.cs b/sdk/mongocluster/Azure.ResourceManager.MongoCluster/samples/Generated/Samples/Sample_MongoClusterPrivateEndpointConnectionResource.cs index b613f615940e..5c8ec07c0c79 100644 --- a/sdk/mongocluster/Azure.ResourceManager.MongoCluster/samples/Generated/Samples/Sample_MongoClusterPrivateEndpointConnectionResource.cs +++ b/sdk/mongocluster/Azure.ResourceManager.MongoCluster/samples/Generated/Samples/Sample_MongoClusterPrivateEndpointConnectionResource.cs @@ -20,7 +20,7 @@ public partial class Sample_MongoClusterPrivateEndpointConnectionResource [Ignore("Only validating compilation of examples")] public async Task Get_GetAPrivateEndpointConnectionOnAMongoClusterResource() { - // Generated from example definition: 2024-07-01/MongoClusters_PrivateEndpointConnectionGet.json + // Generated from example definition: 2024-10-01-preview/MongoClusters_PrivateEndpointConnectionGet.json // this example is just showing the usage of "PrivateEndpointConnectionResource_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 @@ -51,7 +51,7 @@ public async Task Get_GetAPrivateEndpointConnectionOnAMongoClusterResource() [Ignore("Only validating compilation of examples")] public async Task Delete_DeleteAPrivateEndpointConnectionOnAMongoClusterResource() { - // Generated from example definition: 2024-07-01/MongoClusters_PrivateEndpointConnectionDelete.json + // Generated from example definition: 2024-10-01-preview/MongoClusters_PrivateEndpointConnectionDelete.json // this example is just showing the usage of "PrivateEndpointConnectionResource_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 @@ -78,7 +78,7 @@ public async Task Delete_DeleteAPrivateEndpointConnectionOnAMongoClusterResource [Ignore("Only validating compilation of examples")] public async Task Update_ApprovesAPrivateEndpointConnectionOnAMongoClusterResource() { - // Generated from example definition: 2024-07-01/MongoClusters_PrivateEndpointConnectionPut.json + // Generated from example definition: 2024-10-01-preview/MongoClusters_PrivateEndpointConnectionPut.json // this example is just showing the usage of "PrivateEndpointConnectionResource_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 diff --git a/sdk/mongocluster/Azure.ResourceManager.MongoCluster/samples/Generated/Samples/Sample_MongoClusterPrivateEndpointConnectionResourceCollection.cs b/sdk/mongocluster/Azure.ResourceManager.MongoCluster/samples/Generated/Samples/Sample_MongoClusterPrivateEndpointConnectionResourceCollection.cs index f0480e5f2648..4b57ad591764 100644 --- a/sdk/mongocluster/Azure.ResourceManager.MongoCluster/samples/Generated/Samples/Sample_MongoClusterPrivateEndpointConnectionResourceCollection.cs +++ b/sdk/mongocluster/Azure.ResourceManager.MongoCluster/samples/Generated/Samples/Sample_MongoClusterPrivateEndpointConnectionResourceCollection.cs @@ -20,7 +20,7 @@ public partial class Sample_MongoClusterPrivateEndpointConnectionResourceCollect [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_ApprovesAPrivateEndpointConnectionOnAMongoClusterResource() { - // Generated from example definition: 2024-07-01/MongoClusters_PrivateEndpointConnectionPut.json + // Generated from example definition: 2024-10-01-preview/MongoClusters_PrivateEndpointConnectionPut.json // this example is just showing the usage of "PrivateEndpointConnectionResource_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 @@ -63,7 +63,7 @@ public async Task CreateOrUpdate_ApprovesAPrivateEndpointConnectionOnAMongoClust [Ignore("Only validating compilation of examples")] public async Task Get_GetAPrivateEndpointConnectionOnAMongoClusterResource() { - // Generated from example definition: 2024-07-01/MongoClusters_PrivateEndpointConnectionGet.json + // Generated from example definition: 2024-10-01-preview/MongoClusters_PrivateEndpointConnectionGet.json // this example is just showing the usage of "PrivateEndpointConnectionResource_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 @@ -97,7 +97,7 @@ public async Task Get_GetAPrivateEndpointConnectionOnAMongoClusterResource() [Ignore("Only validating compilation of examples")] public async Task GetAll_ListsThePrivateEndpointConnectionResourcesOnAMongoClusterResource() { - // Generated from example definition: 2024-07-01/MongoClusters_PrivateEndpointConnectionList.json + // Generated from example definition: 2024-10-01-preview/MongoClusters_PrivateEndpointConnectionList.json // this example is just showing the usage of "PrivateEndpointConnectionResource_ListByMongoCluster" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -133,7 +133,7 @@ public async Task GetAll_ListsThePrivateEndpointConnectionResourcesOnAMongoClust [Ignore("Only validating compilation of examples")] public async Task Exists_GetAPrivateEndpointConnectionOnAMongoClusterResource() { - // Generated from example definition: 2024-07-01/MongoClusters_PrivateEndpointConnectionGet.json + // Generated from example definition: 2024-10-01-preview/MongoClusters_PrivateEndpointConnectionGet.json // this example is just showing the usage of "PrivateEndpointConnectionResource_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 @@ -163,7 +163,7 @@ public async Task Exists_GetAPrivateEndpointConnectionOnAMongoClusterResource() [Ignore("Only validating compilation of examples")] public async Task GetIfExists_GetAPrivateEndpointConnectionOnAMongoClusterResource() { - // Generated from example definition: 2024-07-01/MongoClusters_PrivateEndpointConnectionGet.json + // Generated from example definition: 2024-10-01-preview/MongoClusters_PrivateEndpointConnectionGet.json // this example is just showing the usage of "PrivateEndpointConnectionResource_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/mongocluster/Azure.ResourceManager.MongoCluster/samples/Generated/Samples/Sample_MongoClusterResource.cs b/sdk/mongocluster/Azure.ResourceManager.MongoCluster/samples/Generated/Samples/Sample_MongoClusterResource.cs index 89dc0e9ea8fe..a256b8b856f5 100644 --- a/sdk/mongocluster/Azure.ResourceManager.MongoCluster/samples/Generated/Samples/Sample_MongoClusterResource.cs +++ b/sdk/mongocluster/Azure.ResourceManager.MongoCluster/samples/Generated/Samples/Sample_MongoClusterResource.cs @@ -20,7 +20,7 @@ public partial class Sample_MongoClusterResource [Ignore("Only validating compilation of examples")] public async Task Get_GetsAMongoClusterResource() { - // Generated from example definition: 2024-07-01/MongoClusters_Get.json + // Generated from example definition: 2024-10-01-preview/MongoClusters_Get.json // this example is just showing the usage of "MongoCluster_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 @@ -50,7 +50,7 @@ public async Task Get_GetsAMongoClusterResource() [Ignore("Only validating compilation of examples")] public async Task Delete_DeletesAMongoClusterResource() { - // Generated from example definition: 2024-07-01/MongoClusters_Delete.json + // Generated from example definition: 2024-10-01-preview/MongoClusters_Delete.json // this example is just showing the usage of "MongoCluster_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 @@ -72,11 +72,49 @@ public async Task Delete_DeletesAMongoClusterResource() Console.WriteLine("Succeeded"); } + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Update_EnablesDataAPIOnAMongoClusterResource() + { + // Generated from example definition: 2024-10-01-preview/MongoClusters_PatchDataApi.json + // this example is just showing the usage of "MongoCluster_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 MongoClusterResource created on azure + // for more information of creating MongoClusterResource, please refer to the document of MongoClusterResource + string subscriptionId = "ffffffff-ffff-ffff-ffff-ffffffffffff"; + string resourceGroupName = "TestResourceGroup"; + string mongoClusterName = "myMongoCluster"; + ResourceIdentifier mongoClusterResourceId = MongoClusterResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, mongoClusterName); + MongoClusterResource mongoCluster = client.GetMongoClusterResource(mongoClusterResourceId); + + // invoke the operation + MongoClusterPatch patch = new MongoClusterPatch + { + Properties = new MongoClusterUpdateProperties + { + DataApiMode = DataApiMode.Enabled, + }, + }; + ArmOperation lro = await mongoCluster.UpdateAsync(WaitUntil.Completed, patch); + MongoClusterResource 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 + MongoClusterData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + [Test] [Ignore("Only validating compilation of examples")] public async Task Update_UpdatesTheDiskSizeOnAMongoClusterResource() { - // Generated from example definition: 2024-07-01/MongoClusters_PatchDiskSize.json + // Generated from example definition: 2024-10-01-preview/MongoClusters_PatchDiskSize.json // this example is just showing the usage of "MongoCluster_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 @@ -114,7 +152,7 @@ public async Task Update_UpdatesTheDiskSizeOnAMongoClusterResource() [Ignore("Only validating compilation of examples")] public async Task Update_DisablesPublicNetworkAccessOnAMongoClusterResourceWithAPrivateEndpointConnection() { - // Generated from example definition: 2024-07-01/MongoClusters_PatchPrivateNetworkAccess.json + // Generated from example definition: 2024-10-01-preview/MongoClusters_PatchPrivateNetworkAccess.json // this example is just showing the usage of "MongoCluster_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 @@ -152,7 +190,7 @@ public async Task Update_DisablesPublicNetworkAccessOnAMongoClusterResourceWithA [Ignore("Only validating compilation of examples")] public async Task Update_ResetsTheAdministratorLoginPassword() { - // Generated from example definition: 2024-07-01/MongoClusters_ResetPassword.json + // Generated from example definition: 2024-10-01-preview/MongoClusters_ResetPassword.json // this example is just showing the usage of "MongoCluster_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 @@ -194,7 +232,7 @@ public async Task Update_ResetsTheAdministratorLoginPassword() [Ignore("Only validating compilation of examples")] public async Task Update_UpdatesAMongoClusterResource() { - // Generated from example definition: 2024-07-01/MongoClusters_Update.json + // Generated from example definition: 2024-10-01-preview/MongoClusters_Update.json // this example is just showing the usage of "MongoCluster_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 @@ -242,7 +280,7 @@ public async Task Update_UpdatesAMongoClusterResource() [Ignore("Only validating compilation of examples")] public async Task GetConnectionStrings_ListTheAvailableConnectionStringsForTheMongoClusterResource() { - // Generated from example definition: 2024-07-01/MongoClusters_ListConnectionStrings.json + // Generated from example definition: 2024-10-01-preview/MongoClusters_ListConnectionStrings.json // this example is just showing the usage of "MongoClusters_ListConnectionStrings" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -268,7 +306,7 @@ public async Task GetConnectionStrings_ListTheAvailableConnectionStringsForTheMo [Ignore("Only validating compilation of examples")] public async Task Promote_PromotesAReplicaMongoClusterResourceToAPrimaryRole() { - // Generated from example definition: 2024-07-01/MongoClusters_ForcePromoteReplica.json + // Generated from example definition: 2024-10-01-preview/MongoClusters_ForcePromoteReplica.json // this example is just showing the usage of "MongoClusters_Promote" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -298,7 +336,7 @@ public async Task Promote_PromotesAReplicaMongoClusterResourceToAPrimaryRole() [Ignore("Only validating compilation of examples")] public async Task GetPrivateLinks_ListsThePrivateLinkResourcesAvailableOnAMongoClusterResource() { - // Generated from example definition: 2024-07-01/MongoClusters_PrivateLinkResourceList.json + // Generated from example definition: 2024-10-01-preview/MongoClusters_PrivateLinkResourceList.json // this example is just showing the usage of "PrivateLinkResource_ListByMongoCluster" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -327,7 +365,7 @@ public async Task GetPrivateLinks_ListsThePrivateLinkResourcesAvailableOnAMongoC [Ignore("Only validating compilation of examples")] public async Task GetReplicasByParent_ListTheReplicasLinkedToAMongoClusterResource() { - // Generated from example definition: 2024-07-01/MongoClusters_ReplicaList.json + // Generated from example definition: 2024-10-01-preview/MongoClusters_ReplicaList.json // this example is just showing the usage of "Replica_ListByParent" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/mongocluster/Azure.ResourceManager.MongoCluster/samples/Generated/Samples/Sample_SubscriptionResourceExtensions.cs b/sdk/mongocluster/Azure.ResourceManager.MongoCluster/samples/Generated/Samples/Sample_SubscriptionResourceExtensions.cs index 30d2c455dea6..b1a0920f2f00 100644 --- a/sdk/mongocluster/Azure.ResourceManager.MongoCluster/samples/Generated/Samples/Sample_SubscriptionResourceExtensions.cs +++ b/sdk/mongocluster/Azure.ResourceManager.MongoCluster/samples/Generated/Samples/Sample_SubscriptionResourceExtensions.cs @@ -21,7 +21,7 @@ public partial class Sample_SubscriptionResourceExtensions [Ignore("Only validating compilation of examples")] public async Task GetMongoClusters_ListsTheMongoClusterResourcesInASubscription() { - // Generated from example definition: 2024-07-01/MongoClusters_List.json + // Generated from example definition: 2024-10-01-preview/MongoClusters_List.json // this example is just showing the usage of "MongoCluster_List" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -52,7 +52,7 @@ public async Task GetMongoClusters_ListsTheMongoClusterResourcesInASubscription( [Ignore("Only validating compilation of examples")] public async Task CheckMongoClusterNameAvailability_ChecksAndConfirmsTheMongoClusterNameIsAvailabilityForUse() { - // Generated from example definition: 2024-07-01/MongoClusters_NameAvailability.json + // Generated from example definition: 2024-10-01-preview/MongoClusters_NameAvailability.json // this example is just showing the usage of "MongoClusters_CheckMongoClusterNameAvailability" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -82,7 +82,7 @@ public async Task CheckMongoClusterNameAvailability_ChecksAndConfirmsTheMongoClu [Ignore("Only validating compilation of examples")] public async Task CheckMongoClusterNameAvailability_ChecksAndReturnsThatTheMongoClusterNameIsAlreadyInUse() { - // Generated from example definition: 2024-07-01/MongoClusters_NameAvailability_AlreadyExists.json + // Generated from example definition: 2024-10-01-preview/MongoClusters_NameAvailability_AlreadyExists.json // this example is just showing the usage of "MongoClusters_CheckMongoClusterNameAvailability" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/ArmMongoClusterModelFactory.cs b/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/ArmMongoClusterModelFactory.cs index c34be115aacd..efe73ca88d92 100644 --- a/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/ArmMongoClusterModelFactory.cs +++ b/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/ArmMongoClusterModelFactory.cs @@ -49,12 +49,13 @@ public static MongoClusterReplica MongoClusterReplica(ResourceIdentifier id = nu /// The sharding properties of the mongo cluster. /// The compute properties of the mongo cluster. /// The backup properties of the mongo cluster. + /// The Data API properties of the mongo cluster. /// List of private endpoint connections. /// List of private endpoint connections. /// The replication properties for the mongo cluster. /// The infrastructure version the cluster is provisioned on. /// A new instance for mocking. - public static MongoClusterProperties MongoClusterProperties(MongoClusterCreateMode? createMode = null, MongoClusterRestoreContent restoreParameters = null, MongoClusterReplicaContent replicaParameters = null, MongoClusterAdministratorProperties administrator = null, string serverVersion = null, string connectionString = null, MongoClusterProvisioningState? provisioningState = null, MongoClusterStatus? clusterStatus = null, MongoClusterPublicNetworkAccess? publicNetworkAccess = null, HighAvailabilityMode? highAvailabilityTargetMode = null, long? storageSizeGb = null, int? shardingShardCount = null, string computeTier = null, string backupEarliestRestoreTime = null, IEnumerable privateEndpointConnections = null, IEnumerable previewFeatures = null, MongoClusterReplicationProperties replica = null, string infrastructureVersion = null) + public static MongoClusterProperties MongoClusterProperties(MongoClusterCreateMode? createMode = null, MongoClusterRestoreContent restoreParameters = null, MongoClusterReplicaContent replicaParameters = null, MongoClusterAdministratorProperties administrator = null, string serverVersion = null, string connectionString = null, MongoClusterProvisioningState? provisioningState = null, MongoClusterStatus? clusterStatus = null, MongoClusterPublicNetworkAccess? publicNetworkAccess = null, HighAvailabilityMode? highAvailabilityTargetMode = null, long? storageSizeGb = null, int? shardingShardCount = null, string computeTier = null, string backupEarliestRestoreTime = null, DataApiMode? dataApiMode = null, IEnumerable privateEndpointConnections = null, IEnumerable previewFeatures = null, MongoClusterReplicationProperties replica = null, string infrastructureVersion = null) { privateEndpointConnections ??= new List(); previewFeatures ??= new List(); @@ -74,6 +75,7 @@ public static MongoClusterProperties MongoClusterProperties(MongoClusterCreateMo shardingShardCount != null ? new ShardingProperties(shardingShardCount, serializedAdditionalRawData: null) : null, computeTier != null ? new ComputeProperties(computeTier, serializedAdditionalRawData: null) : null, backupEarliestRestoreTime != null ? new BackupProperties(backupEarliestRestoreTime, serializedAdditionalRawData: null) : null, + dataApiMode != null ? new DataApiProperties(dataApiMode, serializedAdditionalRawData: null) : null, privateEndpointConnections?.ToList(), previewFeatures?.ToList(), replica, diff --git a/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/Extensions/MockableMongoClusterResourceGroupResource.cs b/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/Extensions/MockableMongoClusterResourceGroupResource.cs index 87e8ad903dcb..44026ea2aba3 100644 --- a/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/Extensions/MockableMongoClusterResourceGroupResource.cs +++ b/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/Extensions/MockableMongoClusterResourceGroupResource.cs @@ -53,7 +53,7 @@ public virtual MongoClusterCollection GetMongoClusters() /// /// /// Default Api Version - /// 2024-07-01 + /// 2024-10-01-preview /// /// /// Resource @@ -84,7 +84,7 @@ public virtual async Task> GetMongoClusterAsync(s /// /// /// Default Api Version - /// 2024-07-01 + /// 2024-10-01-preview /// /// /// Resource diff --git a/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/Extensions/MockableMongoClusterSubscriptionResource.cs b/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/Extensions/MockableMongoClusterSubscriptionResource.cs index bcba1d0d3f84..f39a86ce17b1 100644 --- a/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/Extensions/MockableMongoClusterSubscriptionResource.cs +++ b/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/Extensions/MockableMongoClusterSubscriptionResource.cs @@ -55,7 +55,7 @@ private string GetApiVersionOrNull(ResourceType resourceType) /// /// /// Default Api Version - /// 2024-07-01 + /// 2024-10-01-preview /// /// /// Resource @@ -85,7 +85,7 @@ public virtual AsyncPageable GetMongoClustersAsync(Cancell /// /// /// Default Api Version - /// 2024-07-01 + /// 2024-10-01-preview /// /// /// Resource @@ -115,7 +115,7 @@ public virtual Pageable GetMongoClusters(CancellationToken /// /// /// Default Api Version - /// 2024-07-01 + /// 2024-10-01-preview /// /// /// Resource @@ -158,7 +158,7 @@ public virtual async Task> CheckMon /// /// /// Default Api Version - /// 2024-07-01 + /// 2024-10-01-preview /// /// /// Resource diff --git a/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/Extensions/MongoClusterExtensions.cs b/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/Extensions/MongoClusterExtensions.cs index ee4d0e4ffd35..5553f5d5064c 100644 --- a/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/Extensions/MongoClusterExtensions.cs +++ b/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/Extensions/MongoClusterExtensions.cs @@ -120,7 +120,7 @@ public static MongoClusterCollection GetMongoClusters(this ResourceGroupResource /// /// /// Default Api Version - /// 2024-07-01 + /// 2024-10-01-preview /// /// /// Resource @@ -158,7 +158,7 @@ public static async Task> GetMongoClusterAsync(th /// /// /// Default Api Version - /// 2024-07-01 + /// 2024-10-01-preview /// /// /// Resource @@ -196,7 +196,7 @@ public static Response GetMongoCluster(this ResourceGroupR /// /// /// Default Api Version - /// 2024-07-01 + /// 2024-10-01-preview /// /// /// Resource @@ -232,7 +232,7 @@ public static AsyncPageable GetMongoClustersAsync(this Sub /// /// /// Default Api Version - /// 2024-07-01 + /// 2024-10-01-preview /// /// /// Resource @@ -268,7 +268,7 @@ public static Pageable GetMongoClusters(this SubscriptionR /// /// /// Default Api Version - /// 2024-07-01 + /// 2024-10-01-preview /// /// /// Resource @@ -305,7 +305,7 @@ public static async Task> CheckMong /// /// /// Default Api Version - /// 2024-07-01 + /// 2024-10-01-preview /// /// /// Resource diff --git a/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/Models/DataApiMode.cs b/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/Models/DataApiMode.cs new file mode 100644 index 000000000000..72ce8ed51f95 --- /dev/null +++ b/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/Models/DataApiMode.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.MongoCluster.Models +{ + /// The mode to apply to the Mongo Data API. + public readonly partial struct DataApiMode : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public DataApiMode(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string EnabledValue = "Enabled"; + private const string DisabledValue = "Disabled"; + + /// Mongo Data API is enabled for the cluster. + public static DataApiMode Enabled { get; } = new DataApiMode(EnabledValue); + /// Mongo Data API is disabled for the cluster. + public static DataApiMode Disabled { get; } = new DataApiMode(DisabledValue); + /// Determines if two values are the same. + public static bool operator ==(DataApiMode left, DataApiMode right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(DataApiMode left, DataApiMode right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator DataApiMode(string value) => new DataApiMode(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is DataApiMode other && Equals(other); + /// + public bool Equals(DataApiMode other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/Models/DataApiProperties.Serialization.cs b/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/Models/DataApiProperties.Serialization.cs new file mode 100644 index 000000000000..08f5d06138fa --- /dev/null +++ b/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/Models/DataApiProperties.Serialization.cs @@ -0,0 +1,133 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.MongoCluster.Models +{ + internal partial class DataApiProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataApiProperties)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(Mode)) + { + writer.WritePropertyName("mode"u8); + writer.WriteStringValue(Mode.Value.ToString()); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + DataApiProperties 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(DataApiProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDataApiProperties(document.RootElement, options); + } + + internal static DataApiProperties DeserializeDataApiProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + DataApiMode? mode = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("mode"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + mode = new DataApiMode(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DataApiProperties(mode, 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(DataApiProperties)} does not support writing '{options.Format}' format."); + } + } + + DataApiProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeDataApiProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DataApiProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/Models/DataApiProperties.cs b/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/Models/DataApiProperties.cs new file mode 100644 index 000000000000..5eccac330a35 --- /dev/null +++ b/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/Models/DataApiProperties.cs @@ -0,0 +1,65 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.MongoCluster.Models +{ + /// Data API properties. + internal partial class DataApiProperties + { + /// + /// 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 DataApiProperties() + { + } + + /// Initializes a new instance of . + /// The mode to indicate whether the Mongo Data API is enabled for a cluster. + /// Keeps track of any properties unknown to the library. + internal DataApiProperties(DataApiMode? mode, IDictionary serializedAdditionalRawData) + { + Mode = mode; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The mode to indicate whether the Mongo Data API is enabled for a cluster. + public DataApiMode? Mode { get; set; } + } +} diff --git a/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/Models/MongoClusterProperties.Serialization.cs b/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/Models/MongoClusterProperties.Serialization.cs index c1ab76b6b8b5..3c57478a4386 100644 --- a/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/Models/MongoClusterProperties.Serialization.cs +++ b/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/Models/MongoClusterProperties.Serialization.cs @@ -104,6 +104,11 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("backup"u8); writer.WriteObjectValue(Backup, options); } + if (Optional.IsDefined(DataApi)) + { + writer.WritePropertyName("dataApi"u8); + writer.WriteObjectValue(DataApi, options); + } if (options.Format != "W" && Optional.IsCollectionDefined(PrivateEndpointConnections)) { writer.WritePropertyName("privateEndpointConnections"u8); @@ -185,6 +190,7 @@ internal static MongoClusterProperties DeserializeMongoClusterProperties(JsonEle ShardingProperties sharding = default; ComputeProperties compute = default; BackupProperties backup = default; + DataApiProperties dataApi = default; IReadOnlyList privateEndpointConnections = default; IList previewFeatures = default; MongoClusterReplicationProperties replica = default; @@ -311,6 +317,15 @@ internal static MongoClusterProperties DeserializeMongoClusterProperties(JsonEle backup = BackupProperties.DeserializeBackupProperties(property.Value, options); continue; } + if (property.NameEquals("dataApi"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + dataApi = DataApiProperties.DeserializeDataApiProperties(property.Value, options); + continue; + } if (property.NameEquals("privateEndpointConnections"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -374,6 +389,7 @@ internal static MongoClusterProperties DeserializeMongoClusterProperties(JsonEle sharding, compute, backup, + dataApi, privateEndpointConnections ?? new ChangeTrackingList(), previewFeatures ?? new ChangeTrackingList(), replica, diff --git a/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/Models/MongoClusterProperties.cs b/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/Models/MongoClusterProperties.cs index 34981443c068..fbd8073d21cd 100644 --- a/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/Models/MongoClusterProperties.cs +++ b/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/Models/MongoClusterProperties.cs @@ -67,12 +67,13 @@ public MongoClusterProperties() /// The sharding properties of the mongo cluster. /// The compute properties of the mongo cluster. /// The backup properties of the mongo cluster. + /// The Data API properties of the mongo cluster. /// List of private endpoint connections. /// List of private endpoint connections. /// The replication properties for the mongo cluster. /// The infrastructure version the cluster is provisioned on. /// Keeps track of any properties unknown to the library. - internal MongoClusterProperties(MongoClusterCreateMode? createMode, MongoClusterRestoreContent restoreParameters, MongoClusterReplicaContent replicaParameters, MongoClusterAdministratorProperties administrator, string serverVersion, string connectionString, MongoClusterProvisioningState? provisioningState, MongoClusterStatus? clusterStatus, MongoClusterPublicNetworkAccess? publicNetworkAccess, HighAvailabilityProperties highAvailability, StorageProperties storage, ShardingProperties sharding, ComputeProperties compute, BackupProperties backup, IReadOnlyList privateEndpointConnections, IList previewFeatures, MongoClusterReplicationProperties replica, string infrastructureVersion, IDictionary serializedAdditionalRawData) + internal MongoClusterProperties(MongoClusterCreateMode? createMode, MongoClusterRestoreContent restoreParameters, MongoClusterReplicaContent replicaParameters, MongoClusterAdministratorProperties administrator, string serverVersion, string connectionString, MongoClusterProvisioningState? provisioningState, MongoClusterStatus? clusterStatus, MongoClusterPublicNetworkAccess? publicNetworkAccess, HighAvailabilityProperties highAvailability, StorageProperties storage, ShardingProperties sharding, ComputeProperties compute, BackupProperties backup, DataApiProperties dataApi, IReadOnlyList privateEndpointConnections, IList previewFeatures, MongoClusterReplicationProperties replica, string infrastructureVersion, IDictionary serializedAdditionalRawData) { CreateMode = createMode; RestoreParameters = restoreParameters; @@ -88,6 +89,7 @@ internal MongoClusterProperties(MongoClusterCreateMode? createMode, MongoCluster Sharding = sharding; Compute = compute; Backup = backup; + DataApi = dataApi; PrivateEndpointConnections = privateEndpointConnections; PreviewFeatures = previewFeatures; Replica = replica; @@ -177,6 +179,20 @@ public string BackupEarliestRestoreTime get => Backup is null ? default : Backup.EarliestRestoreTime; } + /// The Data API properties of the mongo cluster. + internal DataApiProperties DataApi { get; set; } + /// The mode to indicate whether the Mongo Data API is enabled for a cluster. + public DataApiMode? DataApiMode + { + get => DataApi is null ? default : DataApi.Mode; + set + { + if (DataApi is null) + DataApi = new DataApiProperties(); + DataApi.Mode = value; + } + } + /// List of private endpoint connections. public IReadOnlyList PrivateEndpointConnections { get; } /// List of private endpoint connections. diff --git a/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/Models/MongoClusterUpdateProperties.Serialization.cs b/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/Models/MongoClusterUpdateProperties.Serialization.cs index f2db8c5c6527..7a97b05f61b3 100644 --- a/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/Models/MongoClusterUpdateProperties.Serialization.cs +++ b/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/Models/MongoClusterUpdateProperties.Serialization.cs @@ -74,6 +74,11 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("backup"u8); writer.WriteObjectValue(Backup, options); } + if (Optional.IsDefined(DataApi)) + { + writer.WritePropertyName("dataApi"u8); + writer.WriteObjectValue(DataApi, options); + } if (Optional.IsCollectionDefined(PreviewFeatures)) { writer.WritePropertyName("previewFeatures"u8); @@ -129,6 +134,7 @@ internal static MongoClusterUpdateProperties DeserializeMongoClusterUpdateProper ShardingProperties sharding = default; ComputeProperties compute = default; BackupProperties backup = default; + DataApiProperties dataApi = default; IList previewFeatures = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); @@ -202,6 +208,15 @@ internal static MongoClusterUpdateProperties DeserializeMongoClusterUpdateProper backup = BackupProperties.DeserializeBackupProperties(property.Value, options); continue; } + if (property.NameEquals("dataApi"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + dataApi = DataApiProperties.DeserializeDataApiProperties(property.Value, options); + continue; + } if (property.NameEquals("previewFeatures"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -231,6 +246,7 @@ internal static MongoClusterUpdateProperties DeserializeMongoClusterUpdateProper sharding, compute, backup, + dataApi, previewFeatures ?? new ChangeTrackingList(), serializedAdditionalRawData); } diff --git a/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/Models/MongoClusterUpdateProperties.cs b/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/Models/MongoClusterUpdateProperties.cs index 182cdb763b42..6a5064ab3b83 100644 --- a/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/Models/MongoClusterUpdateProperties.cs +++ b/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/Models/MongoClusterUpdateProperties.cs @@ -60,9 +60,10 @@ public MongoClusterUpdateProperties() /// The sharding properties of the mongo cluster. /// The compute properties of the mongo cluster. /// The backup properties of the mongo cluster. + /// The Data API properties of the mongo cluster. /// List of private endpoint connections. /// Keeps track of any properties unknown to the library. - internal MongoClusterUpdateProperties(MongoClusterAdministratorProperties administrator, string serverVersion, MongoClusterPublicNetworkAccess? publicNetworkAccess, HighAvailabilityProperties highAvailability, StorageProperties storage, ShardingProperties sharding, ComputeProperties compute, BackupProperties backup, IList previewFeatures, IDictionary serializedAdditionalRawData) + internal MongoClusterUpdateProperties(MongoClusterAdministratorProperties administrator, string serverVersion, MongoClusterPublicNetworkAccess? publicNetworkAccess, HighAvailabilityProperties highAvailability, StorageProperties storage, ShardingProperties sharding, ComputeProperties compute, BackupProperties backup, DataApiProperties dataApi, IList previewFeatures, IDictionary serializedAdditionalRawData) { Administrator = administrator; ServerVersion = serverVersion; @@ -72,6 +73,7 @@ internal MongoClusterUpdateProperties(MongoClusterAdministratorProperties admini Sharding = sharding; Compute = compute; Backup = backup; + DataApi = dataApi; PreviewFeatures = previewFeatures; _serializedAdditionalRawData = serializedAdditionalRawData; } @@ -146,6 +148,20 @@ public string BackupEarliestRestoreTime get => Backup is null ? default : Backup.EarliestRestoreTime; } + /// The Data API properties of the mongo cluster. + internal DataApiProperties DataApi { get; set; } + /// The mode to indicate whether the Mongo Data API is enabled for a cluster. + public DataApiMode? DataApiMode + { + get => DataApi is null ? default : DataApi.Mode; + set + { + if (DataApi is null) + DataApi = new DataApiProperties(); + DataApi.Mode = value; + } + } + /// List of private endpoint connections. public IList PreviewFeatures { get; } } diff --git a/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/MongoClusterCollection.cs b/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/MongoClusterCollection.cs index c8d9efdce71d..fa42720d1dca 100644 --- a/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/MongoClusterCollection.cs +++ b/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/MongoClusterCollection.cs @@ -65,7 +65,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-07-01 + /// 2024-10-01-preview /// /// /// Resource @@ -114,7 +114,7 @@ public virtual async Task> CreateOrUpdateAsyn /// /// /// Default Api Version - /// 2024-07-01 + /// 2024-10-01-preview /// /// /// Resource @@ -163,7 +163,7 @@ public virtual ArmOperation CreateOrUpdate(WaitUntil waitU /// /// /// Default Api Version - /// 2024-07-01 + /// 2024-10-01-preview /// /// /// Resource @@ -208,7 +208,7 @@ public virtual async Task> GetAsync(string mongoC /// /// /// Default Api Version - /// 2024-07-01 + /// 2024-10-01-preview /// /// /// Resource @@ -253,7 +253,7 @@ public virtual Response Get(string mongoClusterName, Cance /// /// /// Default Api Version - /// 2024-07-01 + /// 2024-10-01-preview /// /// /// Resource @@ -283,7 +283,7 @@ public virtual AsyncPageable GetAllAsync(CancellationToken /// /// /// Default Api Version - /// 2024-07-01 + /// 2024-10-01-preview /// /// /// Resource @@ -313,7 +313,7 @@ public virtual Pageable GetAll(CancellationToken cancellat /// /// /// Default Api Version - /// 2024-07-01 + /// 2024-10-01-preview /// /// /// Resource @@ -356,7 +356,7 @@ public virtual async Task> ExistsAsync(string mongoClusterName, C /// /// /// Default Api Version - /// 2024-07-01 + /// 2024-10-01-preview /// /// /// Resource @@ -399,7 +399,7 @@ public virtual Response Exists(string mongoClusterName, CancellationToken /// /// /// Default Api Version - /// 2024-07-01 + /// 2024-10-01-preview /// /// /// Resource @@ -444,7 +444,7 @@ public virtual async Task> GetIfExistsAsy /// /// /// Default Api Version - /// 2024-07-01 + /// 2024-10-01-preview /// /// /// Resource diff --git a/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/MongoClusterFirewallRuleCollection.cs b/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/MongoClusterFirewallRuleCollection.cs index 941f285a6a0f..339303e8b618 100644 --- a/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/MongoClusterFirewallRuleCollection.cs +++ b/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/MongoClusterFirewallRuleCollection.cs @@ -64,7 +64,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-07-01 + /// 2024-10-01-preview /// /// /// Resource @@ -113,7 +113,7 @@ public virtual async Task> Create /// /// /// Default Api Version - /// 2024-07-01 + /// 2024-10-01-preview /// /// /// Resource @@ -162,7 +162,7 @@ public virtual ArmOperation CreateOrUpdate(Wai /// /// /// Default Api Version - /// 2024-07-01 + /// 2024-10-01-preview /// /// /// Resource @@ -207,7 +207,7 @@ public virtual async Task> GetAsync(s /// /// /// Default Api Version - /// 2024-07-01 + /// 2024-10-01-preview /// /// /// Resource @@ -252,7 +252,7 @@ public virtual Response Get(string firewallRul /// /// /// Default Api Version - /// 2024-07-01 + /// 2024-10-01-preview /// /// /// Resource @@ -282,7 +282,7 @@ public virtual AsyncPageable GetAllAsync(Cance /// /// /// Default Api Version - /// 2024-07-01 + /// 2024-10-01-preview /// /// /// Resource @@ -312,7 +312,7 @@ public virtual Pageable GetAll(CancellationTok /// /// /// Default Api Version - /// 2024-07-01 + /// 2024-10-01-preview /// /// /// Resource @@ -355,7 +355,7 @@ public virtual async Task> ExistsAsync(string firewallRuleName, C /// /// /// Default Api Version - /// 2024-07-01 + /// 2024-10-01-preview /// /// /// Resource @@ -398,7 +398,7 @@ public virtual Response Exists(string firewallRuleName, CancellationToken /// /// /// Default Api Version - /// 2024-07-01 + /// 2024-10-01-preview /// /// /// Resource @@ -443,7 +443,7 @@ public virtual async Task> Ge /// /// /// Default Api Version - /// 2024-07-01 + /// 2024-10-01-preview /// /// /// Resource diff --git a/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/MongoClusterFirewallRuleResource.cs b/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/MongoClusterFirewallRuleResource.cs index fd29a6f95f8d..54451a15a37b 100644 --- a/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/MongoClusterFirewallRuleResource.cs +++ b/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/MongoClusterFirewallRuleResource.cs @@ -101,7 +101,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-07-01 + /// 2024-10-01-preview /// /// /// Resource @@ -141,7 +141,7 @@ public virtual async Task> GetAsync(C /// /// /// Default Api Version - /// 2024-07-01 + /// 2024-10-01-preview /// /// /// Resource @@ -181,7 +181,7 @@ public virtual Response Get(CancellationToken /// /// /// Default Api Version - /// 2024-07-01 + /// 2024-10-01-preview /// /// /// Resource @@ -223,7 +223,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2024-07-01 + /// 2024-10-01-preview /// /// /// Resource @@ -265,7 +265,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2024-07-01 + /// 2024-10-01-preview /// /// /// Resource @@ -311,7 +311,7 @@ public virtual async Task> Update /// /// /// Default Api Version - /// 2024-07-01 + /// 2024-10-01-preview /// /// /// Resource diff --git a/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/MongoClusterPrivateEndpointConnectionResource.cs b/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/MongoClusterPrivateEndpointConnectionResource.cs index 07c1a1c07d42..03d574d3fe68 100644 --- a/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/MongoClusterPrivateEndpointConnectionResource.cs +++ b/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/MongoClusterPrivateEndpointConnectionResource.cs @@ -101,7 +101,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-07-01 + /// 2024-10-01-preview /// /// /// Resource @@ -141,7 +141,7 @@ public virtual async Task /// /// Default Api Version - /// 2024-07-01 + /// 2024-10-01-preview /// /// /// Resource @@ -181,7 +181,7 @@ public virtual Response Get(Cance /// /// /// Default Api Version - /// 2024-07-01 + /// 2024-10-01-preview /// /// /// Resource @@ -223,7 +223,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2024-07-01 + /// 2024-10-01-preview /// /// /// Resource @@ -265,7 +265,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2024-07-01 + /// 2024-10-01-preview /// /// /// Resource @@ -311,7 +311,7 @@ public virtual async Task /// /// Default Api Version - /// 2024-07-01 + /// 2024-10-01-preview /// /// /// Resource diff --git a/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/MongoClusterPrivateEndpointConnectionResourceCollection.cs b/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/MongoClusterPrivateEndpointConnectionResourceCollection.cs index 8136ff74d1d0..d6f6245505b1 100644 --- a/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/MongoClusterPrivateEndpointConnectionResourceCollection.cs +++ b/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/MongoClusterPrivateEndpointConnectionResourceCollection.cs @@ -64,7 +64,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-07-01 + /// 2024-10-01-preview /// /// /// Resource @@ -113,7 +113,7 @@ public virtual async Task /// /// Default Api Version - /// 2024-07-01 + /// 2024-10-01-preview /// /// /// Resource @@ -162,7 +162,7 @@ public virtual ArmOperation Creat /// /// /// Default Api Version - /// 2024-07-01 + /// 2024-10-01-preview /// /// /// Resource @@ -207,7 +207,7 @@ public virtual async Task /// /// Default Api Version - /// 2024-07-01 + /// 2024-10-01-preview /// /// /// Resource @@ -252,7 +252,7 @@ public virtual Response Get(strin /// /// /// Default Api Version - /// 2024-07-01 + /// 2024-10-01-preview /// /// /// Resource @@ -282,7 +282,7 @@ public virtual AsyncPageable GetA /// /// /// Default Api Version - /// 2024-07-01 + /// 2024-10-01-preview /// /// /// Resource @@ -312,7 +312,7 @@ public virtual Pageable GetAll(Ca /// /// /// Default Api Version - /// 2024-07-01 + /// 2024-10-01-preview /// /// /// Resource @@ -355,7 +355,7 @@ public virtual async Task> ExistsAsync(string privateEndpointConn /// /// /// Default Api Version - /// 2024-07-01 + /// 2024-10-01-preview /// /// /// Resource @@ -398,7 +398,7 @@ public virtual Response Exists(string privateEndpointConnectionName, Cance /// /// /// Default Api Version - /// 2024-07-01 + /// 2024-10-01-preview /// /// /// Resource @@ -443,7 +443,7 @@ public virtual async Task /// /// Default Api Version - /// 2024-07-01 + /// 2024-10-01-preview /// /// /// Resource diff --git a/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/MongoClusterResource.cs b/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/MongoClusterResource.cs index 6804c462bb87..fe2df69ff779 100644 --- a/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/MongoClusterResource.cs +++ b/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/MongoClusterResource.cs @@ -119,7 +119,7 @@ public virtual MongoClusterFirewallRuleCollection GetMongoClusterFirewallRules() /// /// /// Default Api Version - /// 2024-07-01 + /// 2024-10-01-preview /// /// /// Resource @@ -150,7 +150,7 @@ public virtual async Task> GetMongoCl /// /// /// Default Api Version - /// 2024-07-01 + /// 2024-10-01-preview /// /// /// Resource @@ -188,7 +188,7 @@ public virtual MongoClusterPrivateEndpointConnectionResourceCollection GetMongoC /// /// /// Default Api Version - /// 2024-07-01 + /// 2024-10-01-preview /// /// /// Resource @@ -219,7 +219,7 @@ public virtual async Task /// /// Default Api Version - /// 2024-07-01 + /// 2024-10-01-preview /// /// /// Resource @@ -250,7 +250,7 @@ public virtual Response GetMongoC /// /// /// Default Api Version - /// 2024-07-01 + /// 2024-10-01-preview /// /// /// Resource @@ -290,7 +290,7 @@ public virtual async Task> GetAsync(CancellationT /// /// /// Default Api Version - /// 2024-07-01 + /// 2024-10-01-preview /// /// /// Resource @@ -330,7 +330,7 @@ public virtual Response Get(CancellationToken cancellation /// /// /// Default Api Version - /// 2024-07-01 + /// 2024-10-01-preview /// /// /// Resource @@ -372,7 +372,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2024-07-01 + /// 2024-10-01-preview /// /// /// Resource @@ -414,7 +414,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2024-07-01 + /// 2024-10-01-preview /// /// /// Resource @@ -460,7 +460,7 @@ public virtual async Task> UpdateAsync(WaitUn /// /// /// Default Api Version - /// 2024-07-01 + /// 2024-10-01-preview /// /// /// Resource @@ -506,7 +506,7 @@ public virtual ArmOperation Update(WaitUntil waitUntil, Mo /// /// /// Default Api Version - /// 2024-07-01 + /// 2024-10-01-preview /// /// /// Resource @@ -544,7 +544,7 @@ public virtual async Task> GetConn /// /// /// Default Api Version - /// 2024-07-01 + /// 2024-10-01-preview /// /// /// Resource @@ -582,7 +582,7 @@ public virtual Response GetConnectionString /// /// /// Default Api Version - /// 2024-07-01 + /// 2024-10-01-preview /// /// /// Resource @@ -628,7 +628,7 @@ public virtual async Task PromoteAsync(WaitUntil waitUntil, Promot /// /// /// Default Api Version - /// 2024-07-01 + /// 2024-10-01-preview /// /// /// Resource @@ -674,7 +674,7 @@ public virtual ArmOperation Promote(WaitUntil waitUntil, PromoteReplicaContent c /// /// /// Default Api Version - /// 2024-07-01 + /// 2024-10-01-preview /// /// /// @@ -700,7 +700,7 @@ public virtual AsyncPageable GetPrivateLink /// /// /// Default Api Version - /// 2024-07-01 + /// 2024-10-01-preview /// /// /// @@ -726,7 +726,7 @@ public virtual Pageable GetPrivateLinks(Can /// /// /// Default Api Version - /// 2024-07-01 + /// 2024-10-01-preview /// /// /// @@ -752,7 +752,7 @@ public virtual AsyncPageable GetReplicasByParentAsync(Cance /// /// /// Default Api Version - /// 2024-07-01 + /// 2024-10-01-preview /// /// /// @@ -778,7 +778,7 @@ public virtual Pageable GetReplicasByParent(CancellationTok /// /// /// Default Api Version - /// 2024-07-01 + /// 2024-10-01-preview /// /// /// Resource @@ -840,7 +840,7 @@ public virtual async Task> AddTagAsync(string key /// /// /// Default Api Version - /// 2024-07-01 + /// 2024-10-01-preview /// /// /// Resource @@ -902,7 +902,7 @@ public virtual Response AddTag(string key, string value, C /// /// /// Default Api Version - /// 2024-07-01 + /// 2024-10-01-preview /// /// /// Resource @@ -959,7 +959,7 @@ public virtual async Task> SetTagsAsync(IDictiona /// /// /// Default Api Version - /// 2024-07-01 + /// 2024-10-01-preview /// /// /// Resource @@ -1016,7 +1016,7 @@ public virtual Response SetTags(IDictionary /// /// Default Api Version - /// 2024-07-01 + /// 2024-10-01-preview /// /// /// Resource @@ -1076,7 +1076,7 @@ public virtual async Task> RemoveTagAsync(string /// /// /// Default Api Version - /// 2024-07-01 + /// 2024-10-01-preview /// /// /// Resource diff --git a/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/RestOperations/FirewallRulesRestOperations.cs b/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/RestOperations/FirewallRulesRestOperations.cs index bf20b85c4206..d62a5fdb604e 100644 --- a/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/RestOperations/FirewallRulesRestOperations.cs +++ b/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/RestOperations/FirewallRulesRestOperations.cs @@ -32,7 +32,7 @@ public FirewallRulesRestOperations(HttpPipeline pipeline, string applicationId, { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-07-01"; + _apiVersion = apiVersion ?? "2024-10-01-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/RestOperations/MongoClustersRestOperations.cs b/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/RestOperations/MongoClustersRestOperations.cs index db09b8aa6411..08bb3ce90162 100644 --- a/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/RestOperations/MongoClustersRestOperations.cs +++ b/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/RestOperations/MongoClustersRestOperations.cs @@ -32,7 +32,7 @@ public MongoClustersRestOperations(HttpPipeline pipeline, string applicationId, { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-07-01"; + _apiVersion = apiVersion ?? "2024-10-01-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/RestOperations/PrivateEndpointConnectionsRestOperations.cs b/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/RestOperations/PrivateEndpointConnectionsRestOperations.cs index f6170a8230f9..81273605b4eb 100644 --- a/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/RestOperations/PrivateEndpointConnectionsRestOperations.cs +++ b/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/RestOperations/PrivateEndpointConnectionsRestOperations.cs @@ -32,7 +32,7 @@ public PrivateEndpointConnectionsRestOperations(HttpPipeline pipeline, string ap { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-07-01"; + _apiVersion = apiVersion ?? "2024-10-01-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/RestOperations/PrivateLinksRestOperations.cs b/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/RestOperations/PrivateLinksRestOperations.cs index 1f471b6e3234..1a274fc9a40b 100644 --- a/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/RestOperations/PrivateLinksRestOperations.cs +++ b/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/RestOperations/PrivateLinksRestOperations.cs @@ -32,7 +32,7 @@ public PrivateLinksRestOperations(HttpPipeline pipeline, string applicationId, U { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-07-01"; + _apiVersion = apiVersion ?? "2024-10-01-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/RestOperations/ReplicasRestOperations.cs b/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/RestOperations/ReplicasRestOperations.cs index 79337d42e173..b6ebe380adfe 100644 --- a/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/RestOperations/ReplicasRestOperations.cs +++ b/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/RestOperations/ReplicasRestOperations.cs @@ -32,7 +32,7 @@ public ReplicasRestOperations(HttpPipeline pipeline, string applicationId, Uri e { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-07-01"; + _apiVersion = apiVersion ?? "2024-10-01-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/mongocluster/Azure.ResourceManager.MongoCluster/tsp-location.yaml b/sdk/mongocluster/Azure.ResourceManager.MongoCluster/tsp-location.yaml index 95a1e28c447e..adc762804517 100644 --- a/sdk/mongocluster/Azure.ResourceManager.MongoCluster/tsp-location.yaml +++ b/sdk/mongocluster/Azure.ResourceManager.MongoCluster/tsp-location.yaml @@ -1,3 +1,4 @@ -directory: specification\mongocluster\DocumentDB.MongoCluster.Management -commit: 9ce76c4f113368361dac4de5d0a71eb058602756 -repo: Azure/azure-rest-api-specs \ No newline at end of file +directory: specification/mongocluster/DocumentDB.MongoCluster.Management +commit: 676334a284e5136f0a0721d6ae844bb04332f579 +repo: Azure/azure-rest-api-specs +additionalDirectories: diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/Azure.ResourceManager.RecoveryServicesDataReplication.sln b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/Azure.ResourceManager.RecoveryServicesDataReplication.sln new file mode 100644 index 000000000000..fa8a7db58bc9 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/Azure.ResourceManager.RecoveryServicesDataReplication.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.RecoveryServicesDataReplication.Samples", "samples\Azure.ResourceManager.RecoveryServicesDataReplication.Samples.csproj", "{7A2DFF15-5746-49F4-BD0F-C6C35337088A}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Azure.ResourceManager.RecoveryServicesDataReplication", "src\Azure.ResourceManager.RecoveryServicesDataReplication.csproj", "{28FF4005-4467-4E36-92E7-DEA27DEB1519}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Azure.ResourceManager.RecoveryServicesDataReplication.Tests", "tests\Azure.ResourceManager.RecoveryServicesDataReplication.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/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/CHANGELOG.md b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/CHANGELOG.md new file mode 100644 index 000000000000..8b33f0fedccc --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/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/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/Directory.Build.props b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/Directory.Build.props new file mode 100644 index 000000000000..63bd836ad44b --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/Directory.Build.props @@ -0,0 +1,6 @@ + + + + diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/README.md b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/README.md new file mode 100644 index 000000000000..8531bbf7e62c --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/README.md @@ -0,0 +1,80 @@ +# Microsoft Azure RecoveryServicesDataReplication 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 RecoveryServicesDataReplication management library for .NET with [NuGet](https://www.nuget.org/): + +```dotnetcli +dotnet add package Azure.ResourceManager.RecoveryServicesDataReplication --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/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/api/Azure.ResourceManager.RecoveryServicesDataReplication.net8.0.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/api/Azure.ResourceManager.RecoveryServicesDataReplication.net8.0.cs new file mode 100644 index 000000000000..c52eb06ba888 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/api/Azure.ResourceManager.RecoveryServicesDataReplication.net8.0.cs @@ -0,0 +1,2403 @@ +namespace Azure.ResourceManager.RecoveryServicesDataReplication +{ + public partial class EmailConfigurationModelCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected EmailConfigurationModelCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string emailConfigurationName, Azure.ResourceManager.RecoveryServicesDataReplication.EmailConfigurationModelData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string emailConfigurationName, Azure.ResourceManager.RecoveryServicesDataReplication.EmailConfigurationModelData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string emailConfigurationName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string emailConfigurationName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string emailConfigurationName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string emailConfigurationName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string emailConfigurationName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string emailConfigurationName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class EmailConfigurationModelData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public EmailConfigurationModelData() { } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.EmailConfigurationModelProperties Properties { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.EmailConfigurationModelData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.EmailConfigurationModelData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class EmailConfigurationModelResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected EmailConfigurationModelResource() { } + public virtual Azure.ResourceManager.RecoveryServicesDataReplication.EmailConfigurationModelData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string vaultName, string emailConfigurationName) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + Azure.ResourceManager.RecoveryServicesDataReplication.EmailConfigurationModelData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.EmailConfigurationModelData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.RecoveryServicesDataReplication.EmailConfigurationModelData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.RecoveryServicesDataReplication.EmailConfigurationModelData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class EventModelCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected EventModelCollection() { } + public virtual Azure.Response Exists(string eventName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string eventName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string eventName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(string odataOptions = null, string continuationToken = null, int? pageSize = default(int?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(string odataOptions = null, string continuationToken = null, int? pageSize = default(int?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string eventName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string eventName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string eventName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class EventModelData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal EventModelData() { } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.EventModelProperties Properties { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.EventModelData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.EventModelData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class EventModelResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected EventModelResource() { } + public virtual Azure.ResourceManager.RecoveryServicesDataReplication.EventModelData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string vaultName, string eventName) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + Azure.ResourceManager.RecoveryServicesDataReplication.EventModelData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.EventModelData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class FabricAgentModelCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected FabricAgentModelCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string fabricAgentName, Azure.ResourceManager.RecoveryServicesDataReplication.FabricAgentModelData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string fabricAgentName, Azure.ResourceManager.RecoveryServicesDataReplication.FabricAgentModelData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string fabricAgentName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string fabricAgentName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string fabricAgentName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string fabricAgentName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string fabricAgentName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string fabricAgentName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class FabricAgentModelData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public FabricAgentModelData() { } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.FabricAgentModelProperties Properties { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.FabricAgentModelData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.FabricAgentModelData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class FabricAgentModelResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected FabricAgentModelResource() { } + public virtual Azure.ResourceManager.RecoveryServicesDataReplication.FabricAgentModelData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string fabricName, string fabricAgentName) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + Azure.ResourceManager.RecoveryServicesDataReplication.FabricAgentModelData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.FabricAgentModelData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.RecoveryServicesDataReplication.FabricAgentModelData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.RecoveryServicesDataReplication.FabricAgentModelData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class FabricModelCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected FabricModelCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string fabricName, Azure.ResourceManager.RecoveryServicesDataReplication.FabricModelData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string fabricName, Azure.ResourceManager.RecoveryServicesDataReplication.FabricModelData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string fabricName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string fabricName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string fabricName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(string continuationToken = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(string continuationToken = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string fabricName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string fabricName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string fabricName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class FabricModelData : Azure.ResourceManager.Models.TrackedResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public FabricModelData(Azure.Core.AzureLocation location) { } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.FabricModelProperties Properties { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.FabricModelData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.FabricModelData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class FabricModelResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected FabricModelResource() { } + public virtual Azure.ResourceManager.RecoveryServicesDataReplication.FabricModelData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public virtual Azure.Response AddTag(string key, string value, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> AddTagAsync(string key, string value, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string fabricName) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response GetFabricAgentModel(string fabricAgentName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetFabricAgentModelAsync(string fabricAgentName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.RecoveryServicesDataReplication.FabricAgentModelCollection GetFabricAgentModels() { throw null; } + public virtual Azure.Response RemoveTag(string key, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> RemoveTagAsync(string key, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response SetTags(System.Collections.Generic.IDictionary tags, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> SetTagsAsync(System.Collections.Generic.IDictionary tags, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + Azure.ResourceManager.RecoveryServicesDataReplication.FabricModelData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.FabricModelData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.RecoveryServicesDataReplication.Models.FabricModelPatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.RecoveryServicesDataReplication.Models.FabricModelPatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class JobModelCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected JobModelCollection() { } + public virtual Azure.Response Exists(string jobName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string jobName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string jobName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(string odataOptions = null, string continuationToken = null, int? pageSize = default(int?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(string odataOptions = null, string continuationToken = null, int? pageSize = default(int?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string jobName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string jobName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string jobName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class JobModelData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal JobModelData() { } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.JobModelProperties Properties { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.JobModelData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.JobModelData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class JobModelResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected JobModelResource() { } + public virtual Azure.ResourceManager.RecoveryServicesDataReplication.JobModelData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string vaultName, string jobName) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + Azure.ResourceManager.RecoveryServicesDataReplication.JobModelData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.JobModelData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class PolicyModelCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected PolicyModelCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string policyName, Azure.ResourceManager.RecoveryServicesDataReplication.PolicyModelData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string policyName, Azure.ResourceManager.RecoveryServicesDataReplication.PolicyModelData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string policyName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string policyName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string policyName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string policyName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string policyName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string policyName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class PolicyModelData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public PolicyModelData() { } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.PolicyModelProperties Properties { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.PolicyModelData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.PolicyModelData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class PolicyModelResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected PolicyModelResource() { } + public virtual Azure.ResourceManager.RecoveryServicesDataReplication.PolicyModelData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string vaultName, string policyName) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + Azure.ResourceManager.RecoveryServicesDataReplication.PolicyModelData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.PolicyModelData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.RecoveryServicesDataReplication.PolicyModelData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.RecoveryServicesDataReplication.PolicyModelData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class PrivateEndpointConnectionProxyCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected PrivateEndpointConnectionProxyCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string privateEndpointConnectionProxyName, Azure.ResourceManager.RecoveryServicesDataReplication.PrivateEndpointConnectionProxyData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string privateEndpointConnectionProxyName, Azure.ResourceManager.RecoveryServicesDataReplication.PrivateEndpointConnectionProxyData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string privateEndpointConnectionProxyName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string privateEndpointConnectionProxyName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string privateEndpointConnectionProxyName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string privateEndpointConnectionProxyName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string privateEndpointConnectionProxyName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string privateEndpointConnectionProxyName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class PrivateEndpointConnectionProxyData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public PrivateEndpointConnectionProxyData() { } + public string ETag { get { throw null; } set { } } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.PrivateEndpointConnectionProxyProperties Properties { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.PrivateEndpointConnectionProxyData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.PrivateEndpointConnectionProxyData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class PrivateEndpointConnectionProxyResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected PrivateEndpointConnectionProxyResource() { } + public virtual Azure.ResourceManager.RecoveryServicesDataReplication.PrivateEndpointConnectionProxyData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string vaultName, string privateEndpointConnectionProxyName) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + Azure.ResourceManager.RecoveryServicesDataReplication.PrivateEndpointConnectionProxyData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.PrivateEndpointConnectionProxyData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.RecoveryServicesDataReplication.PrivateEndpointConnectionProxyData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.RecoveryServicesDataReplication.PrivateEndpointConnectionProxyData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Validate(Azure.ResourceManager.RecoveryServicesDataReplication.PrivateEndpointConnectionProxyData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ValidateAsync(Azure.ResourceManager.RecoveryServicesDataReplication.PrivateEndpointConnectionProxyData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class ProtectedItemModelCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected ProtectedItemModelCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string protectedItemName, Azure.ResourceManager.RecoveryServicesDataReplication.ProtectedItemModelData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string protectedItemName, Azure.ResourceManager.RecoveryServicesDataReplication.ProtectedItemModelData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string protectedItemName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string protectedItemName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string protectedItemName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(string odataOptions = null, string continuationToken = null, int? pageSize = default(int?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(string odataOptions = null, string continuationToken = null, int? pageSize = default(int?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string protectedItemName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string protectedItemName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string protectedItemName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class ProtectedItemModelData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ProtectedItemModelData() { } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProtectedItemModelProperties Properties { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.ProtectedItemModelData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.ProtectedItemModelData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ProtectedItemModelResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected ProtectedItemModelResource() { } + public virtual Azure.ResourceManager.RecoveryServicesDataReplication.ProtectedItemModelData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string vaultName, string protectedItemName) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, bool? forceDelete = default(bool?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, bool? forceDelete = default(bool?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response GetRecoveryPointModel(string recoveryPointName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetRecoveryPointModelAsync(string recoveryPointName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.RecoveryServicesDataReplication.RecoveryPointModelCollection GetRecoveryPointModels() { throw null; } + public virtual Azure.ResourceManager.ArmOperation PlannedFailover(Azure.WaitUntil waitUntil, Azure.ResourceManager.RecoveryServicesDataReplication.Models.PlannedFailoverModel body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> PlannedFailoverAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.RecoveryServicesDataReplication.Models.PlannedFailoverModel body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + Azure.ResourceManager.RecoveryServicesDataReplication.ProtectedItemModelData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.ProtectedItemModelData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProtectedItemModelPatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProtectedItemModelPatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class RecoveryPointModelCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected RecoveryPointModelCollection() { } + public virtual Azure.Response Exists(string recoveryPointName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string recoveryPointName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string recoveryPointName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string recoveryPointName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string recoveryPointName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string recoveryPointName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class RecoveryPointModelData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal RecoveryPointModelData() { } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.RecoveryPointModelProperties Properties { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.RecoveryPointModelData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.RecoveryPointModelData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class RecoveryPointModelResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected RecoveryPointModelResource() { } + public virtual Azure.ResourceManager.RecoveryServicesDataReplication.RecoveryPointModelData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string vaultName, string protectedItemName, string recoveryPointName) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + Azure.ResourceManager.RecoveryServicesDataReplication.RecoveryPointModelData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.RecoveryPointModelData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public static partial class RecoveryServicesDataReplicationExtensions + { + public static Azure.ResourceManager.RecoveryServicesDataReplication.EmailConfigurationModelResource GetEmailConfigurationModelResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.EventModelResource GetEventModelResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.FabricAgentModelResource GetFabricAgentModelResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.Response GetFabricModel(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string fabricName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static System.Threading.Tasks.Task> GetFabricModelAsync(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string fabricName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.FabricModelResource GetFabricModelResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.FabricModelCollection GetFabricModels(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource) { throw null; } + public static Azure.Pageable GetFabricModels(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.AsyncPageable GetFabricModelsAsync(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.JobModelResource GetJobModelResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.Response GetOperationResult(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string operationId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static System.Threading.Tasks.Task> GetOperationResultAsync(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string operationId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.PolicyModelResource GetPolicyModelResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.PrivateEndpointConnectionProxyResource GetPrivateEndpointConnectionProxyResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.ProtectedItemModelResource GetProtectedItemModelResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.RecoveryPointModelResource GetRecoveryPointModelResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.RecoveryServicesDataReplicationPrivateEndpointConnectionResource GetRecoveryServicesDataReplicationPrivateEndpointConnectionResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.RecoveryServicesDataReplicationPrivateLinkResourceDataResource GetRecoveryServicesDataReplicationPrivateLinkResourceDataResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.ReplicationExtensionModelResource GetReplicationExtensionModelResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.Response GetVaultModel(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string vaultName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static System.Threading.Tasks.Task> GetVaultModelAsync(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string vaultName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.VaultModelResource GetVaultModelResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.VaultModelCollection GetVaultModels(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource) { throw null; } + public static Azure.Pageable GetVaultModels(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.AsyncPageable GetVaultModelsAsync(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.Response PostCheckNameAvailability(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, Azure.Core.AzureLocation location, Azure.ResourceManager.RecoveryServicesDataReplication.Models.CheckNameAvailabilityModel body = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static System.Threading.Tasks.Task> PostCheckNameAvailabilityAsync(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, Azure.Core.AzureLocation location, Azure.ResourceManager.RecoveryServicesDataReplication.Models.CheckNameAvailabilityModel body = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.Response PostDeploymentPreflight(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string deploymentId, Azure.ResourceManager.RecoveryServicesDataReplication.Models.DeploymentPreflightModel body = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static System.Threading.Tasks.Task> PostDeploymentPreflightAsync(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string deploymentId, Azure.ResourceManager.RecoveryServicesDataReplication.Models.DeploymentPreflightModel body = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class RecoveryServicesDataReplicationPrivateEndpointConnectionCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected RecoveryServicesDataReplicationPrivateEndpointConnectionCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string privateEndpointConnectionName, Azure.ResourceManager.RecoveryServicesDataReplication.RecoveryServicesDataReplicationPrivateEndpointConnectionData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string privateEndpointConnectionName, Azure.ResourceManager.RecoveryServicesDataReplication.RecoveryServicesDataReplicationPrivateEndpointConnectionData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string privateEndpointConnectionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string privateEndpointConnectionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string privateEndpointConnectionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string privateEndpointConnectionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string privateEndpointConnectionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string privateEndpointConnectionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class RecoveryServicesDataReplicationPrivateEndpointConnectionData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public RecoveryServicesDataReplicationPrivateEndpointConnectionData() { } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.PrivateEndpointConnectionResponseProperties Properties { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.RecoveryServicesDataReplicationPrivateEndpointConnectionData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.RecoveryServicesDataReplicationPrivateEndpointConnectionData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class RecoveryServicesDataReplicationPrivateEndpointConnectionResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected RecoveryServicesDataReplicationPrivateEndpointConnectionResource() { } + public virtual Azure.ResourceManager.RecoveryServicesDataReplication.RecoveryServicesDataReplicationPrivateEndpointConnectionData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string vaultName, string privateEndpointConnectionName) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + Azure.ResourceManager.RecoveryServicesDataReplication.RecoveryServicesDataReplicationPrivateEndpointConnectionData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.RecoveryServicesDataReplicationPrivateEndpointConnectionData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.RecoveryServicesDataReplication.RecoveryServicesDataReplicationPrivateEndpointConnectionData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.RecoveryServicesDataReplication.RecoveryServicesDataReplicationPrivateEndpointConnectionData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class RecoveryServicesDataReplicationPrivateLinkResourceDataCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected RecoveryServicesDataReplicationPrivateLinkResourceDataCollection() { } + public virtual Azure.Response Exists(string privateLinkResourceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string privateLinkResourceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string privateLinkResourceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string privateLinkResourceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string privateLinkResourceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string privateLinkResourceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class RecoveryServicesDataReplicationPrivateLinkResourceDataData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal RecoveryServicesDataReplicationPrivateLinkResourceDataData() { } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.RecoveryServicesDataReplicationPrivateLinkResourceProperties Properties { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.RecoveryServicesDataReplicationPrivateLinkResourceDataData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.RecoveryServicesDataReplicationPrivateLinkResourceDataData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class RecoveryServicesDataReplicationPrivateLinkResourceDataResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected RecoveryServicesDataReplicationPrivateLinkResourceDataResource() { } + public virtual Azure.ResourceManager.RecoveryServicesDataReplication.RecoveryServicesDataReplicationPrivateLinkResourceDataData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string vaultName, string privateLinkResourceName) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + Azure.ResourceManager.RecoveryServicesDataReplication.RecoveryServicesDataReplicationPrivateLinkResourceDataData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.RecoveryServicesDataReplicationPrivateLinkResourceDataData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ReplicationExtensionModelCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected ReplicationExtensionModelCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string replicationExtensionName, Azure.ResourceManager.RecoveryServicesDataReplication.ReplicationExtensionModelData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string replicationExtensionName, Azure.ResourceManager.RecoveryServicesDataReplication.ReplicationExtensionModelData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string replicationExtensionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string replicationExtensionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string replicationExtensionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string replicationExtensionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string replicationExtensionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string replicationExtensionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class ReplicationExtensionModelData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ReplicationExtensionModelData() { } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.ReplicationExtensionModelProperties Properties { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.ReplicationExtensionModelData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.ReplicationExtensionModelData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ReplicationExtensionModelResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected ReplicationExtensionModelResource() { } + public virtual Azure.ResourceManager.RecoveryServicesDataReplication.ReplicationExtensionModelData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string vaultName, string replicationExtensionName) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + Azure.ResourceManager.RecoveryServicesDataReplication.ReplicationExtensionModelData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.ReplicationExtensionModelData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.RecoveryServicesDataReplication.ReplicationExtensionModelData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.RecoveryServicesDataReplication.ReplicationExtensionModelData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class VaultModelCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected VaultModelCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string vaultName, Azure.ResourceManager.RecoveryServicesDataReplication.VaultModelData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string vaultName, Azure.ResourceManager.RecoveryServicesDataReplication.VaultModelData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string vaultName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string vaultName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string vaultName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(string continuationToken = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(string continuationToken = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string vaultName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string vaultName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string vaultName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class VaultModelData : Azure.ResourceManager.Models.TrackedResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public VaultModelData(Azure.Core.AzureLocation location) { } + public Azure.ResourceManager.Models.ManagedServiceIdentity Identity { get { throw null; } set { } } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.VaultModelProperties Properties { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.VaultModelData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.VaultModelData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class VaultModelResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected VaultModelResource() { } + public virtual Azure.ResourceManager.RecoveryServicesDataReplication.VaultModelData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public virtual Azure.Response AddTag(string key, string value, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> AddTagAsync(string key, string value, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string vaultName) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.RecoveryServicesDataReplication.RecoveryServicesDataReplicationPrivateLinkResourceDataCollection GetAllRecoveryServicesDataReplicationPrivateLinkResourceData() { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response GetEmailConfigurationModel(string emailConfigurationName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetEmailConfigurationModelAsync(string emailConfigurationName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.RecoveryServicesDataReplication.EmailConfigurationModelCollection GetEmailConfigurationModels() { throw null; } + public virtual Azure.Response GetEventModel(string eventName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetEventModelAsync(string eventName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.RecoveryServicesDataReplication.EventModelCollection GetEventModels() { throw null; } + public virtual Azure.Response GetJobModel(string jobName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetJobModelAsync(string jobName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.RecoveryServicesDataReplication.JobModelCollection GetJobModels() { throw null; } + public virtual Azure.Response GetPolicyModel(string policyName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetPolicyModelAsync(string policyName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.RecoveryServicesDataReplication.PolicyModelCollection GetPolicyModels() { throw null; } + public virtual Azure.ResourceManager.RecoveryServicesDataReplication.PrivateEndpointConnectionProxyCollection GetPrivateEndpointConnectionProxies() { throw null; } + public virtual Azure.Response GetPrivateEndpointConnectionProxy(string privateEndpointConnectionProxyName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetPrivateEndpointConnectionProxyAsync(string privateEndpointConnectionProxyName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response GetProtectedItemModel(string protectedItemName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetProtectedItemModelAsync(string protectedItemName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.RecoveryServicesDataReplication.ProtectedItemModelCollection GetProtectedItemModels() { throw null; } + public virtual Azure.Response GetRecoveryServicesDataReplicationPrivateEndpointConnection(string privateEndpointConnectionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetRecoveryServicesDataReplicationPrivateEndpointConnectionAsync(string privateEndpointConnectionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.RecoveryServicesDataReplication.RecoveryServicesDataReplicationPrivateEndpointConnectionCollection GetRecoveryServicesDataReplicationPrivateEndpointConnections() { throw null; } + public virtual Azure.Response GetRecoveryServicesDataReplicationPrivateLinkResourceData(string privateLinkResourceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetRecoveryServicesDataReplicationPrivateLinkResourceDataAsync(string privateLinkResourceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response GetReplicationExtensionModel(string replicationExtensionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetReplicationExtensionModelAsync(string replicationExtensionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.RecoveryServicesDataReplication.ReplicationExtensionModelCollection GetReplicationExtensionModels() { throw null; } + public virtual Azure.Response RemoveTag(string key, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> RemoveTagAsync(string key, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response SetTags(System.Collections.Generic.IDictionary tags, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> SetTagsAsync(System.Collections.Generic.IDictionary tags, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + Azure.ResourceManager.RecoveryServicesDataReplication.VaultModelData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.VaultModelData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.RecoveryServicesDataReplication.Models.VaultModelPatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.RecoveryServicesDataReplication.Models.VaultModelPatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } +} +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Mocking +{ + public partial class MockableRecoveryServicesDataReplicationArmClient : Azure.ResourceManager.ArmResource + { + protected MockableRecoveryServicesDataReplicationArmClient() { } + public virtual Azure.ResourceManager.RecoveryServicesDataReplication.EmailConfigurationModelResource GetEmailConfigurationModelResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.RecoveryServicesDataReplication.EventModelResource GetEventModelResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.RecoveryServicesDataReplication.FabricAgentModelResource GetFabricAgentModelResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.RecoveryServicesDataReplication.FabricModelResource GetFabricModelResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.RecoveryServicesDataReplication.JobModelResource GetJobModelResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.RecoveryServicesDataReplication.PolicyModelResource GetPolicyModelResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.RecoveryServicesDataReplication.PrivateEndpointConnectionProxyResource GetPrivateEndpointConnectionProxyResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.RecoveryServicesDataReplication.ProtectedItemModelResource GetProtectedItemModelResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.RecoveryServicesDataReplication.RecoveryPointModelResource GetRecoveryPointModelResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.RecoveryServicesDataReplication.RecoveryServicesDataReplicationPrivateEndpointConnectionResource GetRecoveryServicesDataReplicationPrivateEndpointConnectionResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.RecoveryServicesDataReplication.RecoveryServicesDataReplicationPrivateLinkResourceDataResource GetRecoveryServicesDataReplicationPrivateLinkResourceDataResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.RecoveryServicesDataReplication.ReplicationExtensionModelResource GetReplicationExtensionModelResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.RecoveryServicesDataReplication.VaultModelResource GetVaultModelResource(Azure.Core.ResourceIdentifier id) { throw null; } + } + public partial class MockableRecoveryServicesDataReplicationResourceGroupResource : Azure.ResourceManager.ArmResource + { + protected MockableRecoveryServicesDataReplicationResourceGroupResource() { } + public virtual Azure.Response GetFabricModel(string fabricName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetFabricModelAsync(string fabricName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.RecoveryServicesDataReplication.FabricModelCollection GetFabricModels() { throw null; } + public virtual Azure.Response GetOperationResult(string operationId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetOperationResultAsync(string operationId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response GetVaultModel(string vaultName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetVaultModelAsync(string vaultName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.RecoveryServicesDataReplication.VaultModelCollection GetVaultModels() { throw null; } + public virtual Azure.Response PostDeploymentPreflight(string deploymentId, Azure.ResourceManager.RecoveryServicesDataReplication.Models.DeploymentPreflightModel body = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> PostDeploymentPreflightAsync(string deploymentId, Azure.ResourceManager.RecoveryServicesDataReplication.Models.DeploymentPreflightModel body = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class MockableRecoveryServicesDataReplicationSubscriptionResource : Azure.ResourceManager.ArmResource + { + protected MockableRecoveryServicesDataReplicationSubscriptionResource() { } + public virtual Azure.Pageable GetFabricModels(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetFabricModelsAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetVaultModels(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetVaultModelsAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response PostCheckNameAvailability(Azure.Core.AzureLocation location, Azure.ResourceManager.RecoveryServicesDataReplication.Models.CheckNameAvailabilityModel body = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> PostCheckNameAvailabilityAsync(Azure.Core.AzureLocation location, Azure.ResourceManager.RecoveryServicesDataReplication.Models.CheckNameAvailabilityModel body = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } +} +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + public static partial class ArmRecoveryServicesDataReplicationModelFactory + { + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.AzStackHCIFabricModelCustomProperties AzStackHCIFabricModelCustomProperties(string azStackHciSiteId = null, System.Collections.Generic.IEnumerable applianceName = null, Azure.ResourceManager.RecoveryServicesDataReplication.Models.AzStackHCIClusterProperties cluster = null, string fabricResourceId = null, string fabricContainerId = null, string migrationSolutionId = null, string migrationHubUri = null) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.CheckNameAvailabilityResponseModel CheckNameAvailabilityResponseModel(bool? nameAvailable = default(bool?), string reason = null, string message = null) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.EmailConfigurationModelData EmailConfigurationModelData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.RecoveryServicesDataReplication.Models.EmailConfigurationModelProperties properties = null) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.EmailConfigurationModelProperties EmailConfigurationModelProperties(bool sendToOwners = false, System.Collections.Generic.IEnumerable customEmailAddresses = null, string locale = null, Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProvisioningState? provisioningState = default(Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProvisioningState?)) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.ErrorModel ErrorModel(string code = null, string type = null, string severity = null, System.DateTimeOffset? createdOn = default(System.DateTimeOffset?), string message = null, string causes = null, string recommendation = null) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.EventModelData EventModelData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.RecoveryServicesDataReplication.Models.EventModelProperties properties = null) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.EventModelProperties EventModelProperties(string resourceType = null, string resourceName = null, string eventType = null, string eventName = null, System.DateTimeOffset? timeOfOccurrence = default(System.DateTimeOffset?), string severity = null, string description = null, string correlationId = null, System.Collections.Generic.IEnumerable healthErrors = null, Azure.ResourceManager.RecoveryServicesDataReplication.Models.EventModelCustomProperties customProperties = null, Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProvisioningState? provisioningState = default(Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProvisioningState?)) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.FabricAgentModelData FabricAgentModelData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.RecoveryServicesDataReplication.Models.FabricAgentModelProperties properties = null) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.FabricAgentModelProperties FabricAgentModelProperties(string correlationId = null, string machineId = null, string machineName = null, Azure.ResourceManager.RecoveryServicesDataReplication.Models.IdentityModel authenticationIdentity = null, Azure.ResourceManager.RecoveryServicesDataReplication.Models.IdentityModel resourceAccessIdentity = null, bool? isResponsive = default(bool?), System.DateTimeOffset? lastHeartbeat = default(System.DateTimeOffset?), string versionNumber = null, Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProvisioningState? provisioningState = default(Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProvisioningState?), System.Collections.Generic.IEnumerable healthErrors = null, Azure.ResourceManager.RecoveryServicesDataReplication.Models.FabricAgentModelCustomProperties customProperties = null) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.FabricModelData FabricModelData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), Azure.ResourceManager.RecoveryServicesDataReplication.Models.FabricModelProperties properties = null) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.FabricModelPatch FabricModelPatch(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.ResourceManager.RecoveryServicesDataReplication.Models.FabricModelProperties properties = null) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.FabricModelProperties FabricModelProperties(Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProvisioningState? provisioningState = default(Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProvisioningState?), string serviceEndpoint = null, string serviceResourceId = null, Azure.ResourceManager.RecoveryServicesDataReplication.Models.HealthStatus? health = default(Azure.ResourceManager.RecoveryServicesDataReplication.Models.HealthStatus?), System.Collections.Generic.IEnumerable healthErrors = null, Azure.ResourceManager.RecoveryServicesDataReplication.Models.FabricModelCustomProperties customProperties = null) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.FailoverJobModelCustomProperties FailoverJobModelCustomProperties(Azure.ResourceManager.RecoveryServicesDataReplication.Models.JobModelCustomPropertiesAffectedObjectDetails affectedObjectDetails = null, System.Collections.Generic.IEnumerable protectedItemDetails = null) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.FailoverProtectedItemProperties FailoverProtectedItemProperties(string protectedItemName = null, string vmName = null, string testVmName = null, string recoveryPointId = null, System.DateTimeOffset? recoveryPointOn = default(System.DateTimeOffset?), string networkName = null, string subnet = null) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.HealthErrorModel HealthErrorModel(string affectedResourceType = null, System.Collections.Generic.IEnumerable affectedResourceCorrelationIds = null, System.Collections.Generic.IEnumerable childErrors = null, string code = null, string healthCategory = null, string category = null, string severity = null, string source = null, System.DateTimeOffset? createdOn = default(System.DateTimeOffset?), bool? isCustomerResolvable = default(bool?), string summary = null, string message = null, string causes = null, string recommendation = null) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.HyperVMigrateFabricModelCustomProperties HyperVMigrateFabricModelCustomProperties(string hyperVSiteId = null, string fabricResourceId = null, string fabricContainerId = null, string migrationSolutionId = null, string migrationHubUri = null) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.HyperVToAzStackHCIEventModelCustomProperties HyperVToAzStackHCIEventModelCustomProperties(string eventSourceFriendlyName = null, string protectedItemFriendlyName = null, string sourceApplianceName = null, string targetApplianceName = null, string serverType = null) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.HyperVToAzStackHCINicInput HyperVToAzStackHCINicInput(string nicId = null, string networkName = null, string targetNetworkId = null, string testNetworkId = null, Azure.ResourceManager.RecoveryServicesDataReplication.Models.VmNicSelection selectionTypeForFailover = default(Azure.ResourceManager.RecoveryServicesDataReplication.Models.VmNicSelection), bool? isStaticIPMigrationEnabled = default(bool?), bool? isMacMigrationEnabled = default(bool?)) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.HyperVToAzStackHCIProtectedDiskProperties HyperVToAzStackHCIProtectedDiskProperties(string storageContainerId = null, string storageContainerLocalPath = null, string sourceDiskId = null, string sourceDiskName = null, string seedDiskName = null, string testMigrateDiskName = null, string migrateDiskName = null, bool? isOSDisk = default(bool?), long? capacityInBytes = default(long?), bool? isDynamic = default(bool?), string diskType = null, long? diskBlockSize = default(long?), long? diskLogicalSectorSize = default(long?), long? diskPhysicalSectorSize = default(long?)) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.HyperVToAzStackHCIProtectedItemModelCustomProperties HyperVToAzStackHCIProtectedItemModelCustomProperties(Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProtectedItemActiveLocation? activeLocation = default(Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProtectedItemActiveLocation?), string targetHciClusterId = null, string targetArcClusterCustomLocationId = null, string targetAzStackHciClusterName = null, string fabricDiscoveryMachineId = null, System.Collections.Generic.IEnumerable disksToInclude = null, System.Collections.Generic.IEnumerable nicsToInclude = null, string sourceVmName = null, int? sourceCpuCores = default(int?), double? sourceMemoryInMegaBytes = default(double?), string targetVmName = null, string targetResourceGroupId = null, string storageContainerId = null, string hyperVGeneration = null, string targetNetworkId = null, string testNetworkId = null, int? targetCpuCores = default(int?), bool? isDynamicRam = default(bool?), Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProtectedItemDynamicMemoryConfig dynamicMemoryConfig = null, int? targetMemoryInMegaBytes = default(int?), string runAsAccountId = null, string sourceFabricAgentName = null, string targetFabricAgentName = null, string sourceApplianceName = null, string targetApplianceName = null, string osType = null, string osName = null, string firmwareType = null, string targetLocation = null, string customLocationRegion = null, string failoverRecoveryPointId = null, System.DateTimeOffset? lastRecoveryPointReceived = default(System.DateTimeOffset?), string lastRecoveryPointId = null, int? initialReplicationProgressPercentage = default(int?), int? resyncProgressPercentage = default(int?), System.Collections.Generic.IEnumerable protectedDisks = null, System.Collections.Generic.IEnumerable protectedNics = null, string targetVmBiosId = null, System.DateTimeOffset? lastReplicationUpdateOn = default(System.DateTimeOffset?)) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.HyperVToAzStackHCIProtectedNicProperties HyperVToAzStackHCIProtectedNicProperties(string nicId = null, string macAddress = null, string networkName = null, string targetNetworkId = null, string testNetworkId = null, Azure.ResourceManager.RecoveryServicesDataReplication.Models.VmNicSelection? selectionTypeForFailover = default(Azure.ResourceManager.RecoveryServicesDataReplication.Models.VmNicSelection?)) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.HyperVToAzStackHCIRecoveryPointModelCustomProperties HyperVToAzStackHCIRecoveryPointModelCustomProperties(System.Collections.Generic.IEnumerable diskIds = null) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.HyperVToAzStackHCIReplicationExtensionModelCustomProperties HyperVToAzStackHCIReplicationExtensionModelCustomProperties(string hyperVFabricArmId = null, string hyperVSiteId = null, string azStackHciFabricArmId = null, string azStackHciSiteId = null, string storageAccountId = null, string storageAccountSasSecretName = null, string asrServiceUri = null, string rcmServiceUri = null, string gatewayServiceUri = null, string sourceGatewayServiceId = null, string targetGatewayServiceId = null, string sourceStorageContainerName = null, string targetStorageContainerName = null, string resourceLocation = null, string subscriptionId = null, string resourceGroup = null) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.InnerHealthErrorModel InnerHealthErrorModel(string code = null, string healthCategory = null, string category = null, string severity = null, string source = null, System.DateTimeOffset? createdOn = default(System.DateTimeOffset?), bool? isCustomerResolvable = default(bool?), string summary = null, string message = null, string causes = null, string recommendation = null) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.JobModelCustomProperties JobModelCustomProperties(string instanceType = null, Azure.ResourceManager.RecoveryServicesDataReplication.Models.JobModelCustomPropertiesAffectedObjectDetails affectedObjectDetails = null) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.JobModelCustomPropertiesAffectedObjectDetails JobModelCustomPropertiesAffectedObjectDetails(string description = null, Azure.ResourceManager.RecoveryServicesDataReplication.Models.JobModelCustomPropertiesAffectedObjectDetailsType? type = default(Azure.ResourceManager.RecoveryServicesDataReplication.Models.JobModelCustomPropertiesAffectedObjectDetailsType?)) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.JobModelData JobModelData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.RecoveryServicesDataReplication.Models.JobModelProperties properties = null) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.JobModelProperties JobModelProperties(string displayName = null, Azure.ResourceManager.RecoveryServicesDataReplication.Models.JobState? state = default(Azure.ResourceManager.RecoveryServicesDataReplication.Models.JobState?), System.DateTimeOffset? startOn = default(System.DateTimeOffset?), System.DateTimeOffset? endOn = default(System.DateTimeOffset?), string objectId = null, string objectName = null, string objectInternalId = null, string objectInternalName = null, Azure.ResourceManager.RecoveryServicesDataReplication.Models.JobObjectType? objectType = default(Azure.ResourceManager.RecoveryServicesDataReplication.Models.JobObjectType?), string replicationProviderId = null, string sourceFabricProviderId = null, string targetFabricProviderId = null, System.Collections.Generic.IEnumerable allowedActions = null, string activityId = null, System.Collections.Generic.IEnumerable tasks = null, System.Collections.Generic.IEnumerable errors = null, Azure.ResourceManager.RecoveryServicesDataReplication.Models.JobModelCustomProperties customProperties = null, Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProvisioningState? provisioningState = default(Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProvisioningState?)) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.OperationStatus OperationStatus(string id = null, string name = null, string status = null, string startTime = null, string endTime = null) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.PolicyModelData PolicyModelData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.RecoveryServicesDataReplication.Models.PolicyModelProperties properties = null) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.PolicyModelProperties PolicyModelProperties(Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProvisioningState? provisioningState = default(Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProvisioningState?), Azure.ResourceManager.RecoveryServicesDataReplication.Models.PolicyModelCustomProperties customProperties = null) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.PrivateEndpointConnectionProxyData PrivateEndpointConnectionProxyData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.RecoveryServicesDataReplication.Models.PrivateEndpointConnectionProxyProperties properties = null, string etag = null) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.PrivateEndpointConnectionProxyProperties PrivateEndpointConnectionProxyProperties(Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProvisioningState? provisioningState = default(Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProvisioningState?), Azure.ResourceManager.RecoveryServicesDataReplication.Models.RemotePrivateEndpoint remotePrivateEndpoint = null) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.PrivateEndpointConnectionResponseProperties PrivateEndpointConnectionResponseProperties(Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProvisioningState? provisioningState = default(Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProvisioningState?), Azure.Core.ResourceIdentifier privateEndpointId = null, Azure.ResourceManager.RecoveryServicesDataReplication.Models.RecoveryServicesDataReplicationPrivateLinkServiceConnectionState privateLinkServiceConnectionState = null) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProtectedItemJobProperties ProtectedItemJobProperties(string scenarioName = null, string id = null, string name = null, string displayName = null, string state = null, System.DateTimeOffset? startOn = default(System.DateTimeOffset?), System.DateTimeOffset? endOn = default(System.DateTimeOffset?)) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.ProtectedItemModelData ProtectedItemModelData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProtectedItemModelProperties properties = null) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProtectedItemModelPatch ProtectedItemModelPatch(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProtectedItemModelCustomPropertiesUpdate customProperties = null) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProtectedItemModelProperties ProtectedItemModelProperties(string policyName = null, string replicationExtensionName = null, string correlationId = null, Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProvisioningState? provisioningState = default(Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProvisioningState?), Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProtectionState? protectionState = default(Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProtectionState?), string protectionStateDescription = null, Azure.ResourceManager.RecoveryServicesDataReplication.Models.TestFailoverState? testFailoverState = default(Azure.ResourceManager.RecoveryServicesDataReplication.Models.TestFailoverState?), string testFailoverStateDescription = null, Azure.ResourceManager.RecoveryServicesDataReplication.Models.ResynchronizationState? resynchronizationState = default(Azure.ResourceManager.RecoveryServicesDataReplication.Models.ResynchronizationState?), string fabricObjectId = null, string fabricObjectName = null, string sourceFabricProviderId = null, string targetFabricProviderId = null, string fabricId = null, string targetFabricId = null, string fabricAgentId = null, string targetFabricAgentId = null, bool? resyncRequired = default(bool?), System.DateTimeOffset? lastSuccessfulPlannedFailoverOn = default(System.DateTimeOffset?), System.DateTimeOffset? lastSuccessfulUnplannedFailoverOn = default(System.DateTimeOffset?), System.DateTimeOffset? lastSuccessfulTestFailoverOn = default(System.DateTimeOffset?), Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProtectedItemJobProperties currentJob = null, System.Collections.Generic.IEnumerable allowedJobs = null, Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProtectedItemJobProperties lastFailedEnableProtectionJob = null, Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProtectedItemJobProperties lastFailedPlannedFailoverJob = null, Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProtectedItemJobProperties lastTestFailoverJob = null, Azure.ResourceManager.RecoveryServicesDataReplication.Models.HealthStatus? replicationHealth = default(Azure.ResourceManager.RecoveryServicesDataReplication.Models.HealthStatus?), System.Collections.Generic.IEnumerable healthErrors = null, Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProtectedItemModelCustomProperties customProperties = null) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.RecoveryPointModelData RecoveryPointModelData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.RecoveryServicesDataReplication.Models.RecoveryPointModelProperties properties = null) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.RecoveryPointModelProperties RecoveryPointModelProperties(System.DateTimeOffset recoveryPointOn = default(System.DateTimeOffset), Azure.ResourceManager.RecoveryServicesDataReplication.Models.RecoveryPointType recoveryPointType = default(Azure.ResourceManager.RecoveryServicesDataReplication.Models.RecoveryPointType), Azure.ResourceManager.RecoveryServicesDataReplication.Models.RecoveryPointModelCustomProperties customProperties = null, Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProvisioningState? provisioningState = default(Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProvisioningState?)) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.RecoveryServicesDataReplicationPrivateEndpointConnectionData RecoveryServicesDataReplicationPrivateEndpointConnectionData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.RecoveryServicesDataReplication.Models.PrivateEndpointConnectionResponseProperties properties = null) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.RecoveryServicesDataReplicationPrivateLinkResourceDataData RecoveryServicesDataReplicationPrivateLinkResourceDataData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.RecoveryServicesDataReplication.Models.RecoveryServicesDataReplicationPrivateLinkResourceProperties properties = null) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.RecoveryServicesDataReplicationPrivateLinkResourceProperties RecoveryServicesDataReplicationPrivateLinkResourceProperties(string groupId = null, System.Collections.Generic.IEnumerable requiredMembers = null, System.Collections.Generic.IEnumerable requiredZoneNames = null, Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProvisioningState? provisioningState = default(Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProvisioningState?)) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.ReplicationExtensionModelData ReplicationExtensionModelData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.RecoveryServicesDataReplication.Models.ReplicationExtensionModelProperties properties = null) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.ReplicationExtensionModelProperties ReplicationExtensionModelProperties(Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProvisioningState? provisioningState = default(Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProvisioningState?), Azure.ResourceManager.RecoveryServicesDataReplication.Models.ReplicationExtensionModelCustomProperties customProperties = null) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.TaskModel TaskModel(string taskName = null, Azure.ResourceManager.RecoveryServicesDataReplication.Models.TaskState? state = default(Azure.ResourceManager.RecoveryServicesDataReplication.Models.TaskState?), System.DateTimeOffset? startOn = default(System.DateTimeOffset?), System.DateTimeOffset? endOn = default(System.DateTimeOffset?), string customInstanceType = null, System.Collections.Generic.IEnumerable childrenJobs = null) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.TestFailoverCleanupJobModelCustomProperties TestFailoverCleanupJobModelCustomProperties(Azure.ResourceManager.RecoveryServicesDataReplication.Models.JobModelCustomPropertiesAffectedObjectDetails affectedObjectDetails = null, string comments = null) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.TestFailoverJobModelCustomProperties TestFailoverJobModelCustomProperties(Azure.ResourceManager.RecoveryServicesDataReplication.Models.JobModelCustomPropertiesAffectedObjectDetails affectedObjectDetails = null, System.Collections.Generic.IEnumerable protectedItemDetails = null) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.VaultModelData VaultModelData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), Azure.ResourceManager.RecoveryServicesDataReplication.Models.VaultModelProperties properties = null, Azure.ResourceManager.Models.ManagedServiceIdentity identity = null) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.VaultModelPatch VaultModelPatch(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.ResourceManager.RecoveryServicesDataReplication.Models.VaultModelProperties properties = null, Azure.ResourceManager.Models.ManagedServiceIdentity identity = null) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.VaultModelProperties VaultModelProperties(Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProvisioningState? provisioningState = default(Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProvisioningState?), string serviceResourceId = null, Azure.ResourceManager.RecoveryServicesDataReplication.Models.ReplicationVaultType? vaultType = default(Azure.ResourceManager.RecoveryServicesDataReplication.Models.ReplicationVaultType?)) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.VMwareToAzStackHCIEventModelCustomProperties VMwareToAzStackHCIEventModelCustomProperties(string eventSourceFriendlyName = null, string protectedItemFriendlyName = null, string sourceApplianceName = null, string targetApplianceName = null, string serverType = null) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.VMwareToAzStackHCINicInput VMwareToAzStackHCINicInput(string nicId = null, string label = null, string networkName = null, string targetNetworkId = null, string testNetworkId = null, Azure.ResourceManager.RecoveryServicesDataReplication.Models.VmNicSelection selectionTypeForFailover = default(Azure.ResourceManager.RecoveryServicesDataReplication.Models.VmNicSelection), bool? isStaticIPMigrationEnabled = default(bool?), bool? isMacMigrationEnabled = default(bool?)) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.VMwareToAzStackHCIProtectedDiskProperties VMwareToAzStackHCIProtectedDiskProperties(string storageContainerId = null, string storageContainerLocalPath = null, string sourceDiskId = null, string sourceDiskName = null, string seedDiskName = null, string testMigrateDiskName = null, string migrateDiskName = null, bool? isOSDisk = default(bool?), long? capacityInBytes = default(long?), bool? isDynamic = default(bool?), string diskType = null, long? diskBlockSize = default(long?), long? diskLogicalSectorSize = default(long?), long? diskPhysicalSectorSize = default(long?)) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.VMwareToAzStackHCIProtectedItemModelCustomProperties VMwareToAzStackHCIProtectedItemModelCustomProperties(Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProtectedItemActiveLocation? activeLocation = default(Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProtectedItemActiveLocation?), string targetHciClusterId = null, string targetArcClusterCustomLocationId = null, string targetAzStackHciClusterName = null, string storageContainerId = null, string targetResourceGroupId = null, string targetLocation = null, string customLocationRegion = null, System.Collections.Generic.IEnumerable disksToInclude = null, System.Collections.Generic.IEnumerable nicsToInclude = null, System.Collections.Generic.IEnumerable protectedDisks = null, System.Collections.Generic.IEnumerable protectedNics = null, string targetVmBiosId = null, string targetVmName = null, string hyperVGeneration = null, string targetNetworkId = null, string testNetworkId = null, int? targetCpuCores = default(int?), bool? isDynamicRam = default(bool?), Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProtectedItemDynamicMemoryConfig dynamicMemoryConfig = null, int? targetMemoryInMegaBytes = default(int?), string osType = null, string osName = null, string firmwareType = null, string fabricDiscoveryMachineId = null, string sourceVmName = null, int? sourceCpuCores = default(int?), double? sourceMemoryInMegaBytes = default(double?), string runAsAccountId = null, string sourceFabricAgentName = null, string targetFabricAgentName = null, string sourceApplianceName = null, string targetApplianceName = null, string failoverRecoveryPointId = null, System.DateTimeOffset? lastRecoveryPointReceived = default(System.DateTimeOffset?), string lastRecoveryPointId = null, int? initialReplicationProgressPercentage = default(int?), int? migrationProgressPercentage = default(int?), int? resumeProgressPercentage = default(int?), int? resyncProgressPercentage = default(int?), long? resyncRetryCount = default(long?), bool? resyncRequired = default(bool?), Azure.ResourceManager.RecoveryServicesDataReplication.Models.VMwareToAzureMigrateResyncState? resyncState = default(Azure.ResourceManager.RecoveryServicesDataReplication.Models.VMwareToAzureMigrateResyncState?), bool? performAutoResync = default(bool?), long? resumeRetryCount = default(long?), System.DateTimeOffset? lastReplicationUpdateOn = default(System.DateTimeOffset?)) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.VMwareToAzStackHCIProtectedNicProperties VMwareToAzStackHCIProtectedNicProperties(string nicId = null, string macAddress = null, string label = null, bool? isPrimaryNic = default(bool?), string networkName = null, string targetNetworkId = null, string testNetworkId = null, Azure.ResourceManager.RecoveryServicesDataReplication.Models.VmNicSelection? selectionTypeForFailover = default(Azure.ResourceManager.RecoveryServicesDataReplication.Models.VmNicSelection?)) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.VMwareToAzStackHCIRecoveryPointModelCustomProperties VMwareToAzStackHCIRecoveryPointModelCustomProperties(System.Collections.Generic.IEnumerable diskIds = null) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.VMwareToAzStackHCIReplicationExtensionModelCustomProperties VMwareToAzStackHCIReplicationExtensionModelCustomProperties(string vmwareFabricArmId = null, string vmwareSiteId = null, string azStackHciFabricArmId = null, string azStackHciSiteId = null, string storageAccountId = null, string storageAccountSasSecretName = null, string asrServiceUri = null, string rcmServiceUri = null, string gatewayServiceUri = null, string sourceGatewayServiceId = null, string targetGatewayServiceId = null, string sourceStorageContainerName = null, string targetStorageContainerName = null, string resourceLocation = null, string subscriptionId = null, string resourceGroup = null) { throw null; } + } + public partial class AzStackHCIClusterProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public AzStackHCIClusterProperties(string clusterName, string resourceName, string storageAccountName, System.Collections.Generic.IEnumerable storageContainers) { } + public string ClusterName { get { throw null; } set { } } + public string ResourceName { get { throw null; } set { } } + public string StorageAccountName { get { throw null; } set { } } + public System.Collections.Generic.IList StorageContainers { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.AzStackHCIClusterProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.AzStackHCIClusterProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class AzStackHCIFabricModelCustomProperties : Azure.ResourceManager.RecoveryServicesDataReplication.Models.FabricModelCustomProperties, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public AzStackHCIFabricModelCustomProperties(string azStackHciSiteId, Azure.ResourceManager.RecoveryServicesDataReplication.Models.AzStackHCIClusterProperties cluster, string migrationSolutionId) { } + public System.Collections.Generic.IReadOnlyList ApplianceName { get { throw null; } } + public string AzStackHciSiteId { get { throw null; } set { } } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.AzStackHCIClusterProperties Cluster { get { throw null; } set { } } + public string FabricContainerId { get { throw null; } } + public string FabricResourceId { get { throw null; } } + public string MigrationHubUri { get { throw null; } } + public string MigrationSolutionId { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.AzStackHCIFabricModelCustomProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.AzStackHCIFabricModelCustomProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class CheckNameAvailabilityModel : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public CheckNameAvailabilityModel() { } + public string Name { get { throw null; } set { } } + public string Type { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.CheckNameAvailabilityModel System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.CheckNameAvailabilityModel System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class CheckNameAvailabilityResponseModel : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal CheckNameAvailabilityResponseModel() { } + public string Message { get { throw null; } } + public bool? NameAvailable { get { throw null; } } + public string Reason { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.CheckNameAvailabilityResponseModel System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.CheckNameAvailabilityResponseModel System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ConnectionDetails : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ConnectionDetails() { } + public string GroupId { get { throw null; } set { } } + public string Id { get { throw null; } set { } } + public string LinkIdentifier { get { throw null; } set { } } + public string MemberName { get { throw null; } set { } } + public string PrivateIPAddress { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.ConnectionDetails System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.ConnectionDetails System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DeploymentPreflightModel : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DeploymentPreflightModel() { } + public System.Collections.Generic.IList Resources { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.DeploymentPreflightModel System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.DeploymentPreflightModel System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DeploymentPreflightResource : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DeploymentPreflightResource() { } + public string ApiVersion { get { throw null; } set { } } + public string Location { get { throw null; } set { } } + public string Name { get { throw null; } set { } } + public System.BinaryData Properties { get { throw null; } set { } } + public string Type { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.DeploymentPreflightResource System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.DeploymentPreflightResource System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DiskControllerInputs : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DiskControllerInputs(string controllerName, int controllerId, int controllerLocation) { } + public int ControllerId { get { throw null; } set { } } + public int ControllerLocation { get { throw null; } set { } } + public string ControllerName { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.DiskControllerInputs System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.DiskControllerInputs System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class EmailConfigurationModelProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public EmailConfigurationModelProperties(bool sendToOwners) { } + public System.Collections.Generic.IList CustomEmailAddresses { get { throw null; } } + public string Locale { get { throw null; } set { } } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProvisioningState? ProvisioningState { get { throw null; } } + public bool SendToOwners { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.EmailConfigurationModelProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.EmailConfigurationModelProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ErrorModel : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal ErrorModel() { } + public string Causes { get { throw null; } } + public string Code { get { throw null; } } + public System.DateTimeOffset? CreatedOn { get { throw null; } } + public string Message { get { throw null; } } + public string Recommendation { get { throw null; } } + public string Severity { get { throw null; } } + public string Type { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.ErrorModel System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.ErrorModel System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public abstract partial class EventModelCustomProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + protected EventModelCustomProperties() { } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.EventModelCustomProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.EventModelCustomProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class EventModelProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal EventModelProperties() { } + public string CorrelationId { get { throw null; } } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.EventModelCustomProperties CustomProperties { get { throw null; } } + public string Description { get { throw null; } } + public string EventName { get { throw null; } } + public string EventType { get { throw null; } } + public System.Collections.Generic.IReadOnlyList HealthErrors { get { throw null; } } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProvisioningState? ProvisioningState { get { throw null; } } + public string ResourceName { get { throw null; } } + public string ResourceType { get { throw null; } } + public string Severity { get { throw null; } } + public System.DateTimeOffset? TimeOfOccurrence { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.EventModelProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.EventModelProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public abstract partial class FabricAgentModelCustomProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + protected FabricAgentModelCustomProperties() { } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.FabricAgentModelCustomProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.FabricAgentModelCustomProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class FabricAgentModelProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public FabricAgentModelProperties(string machineId, string machineName, Azure.ResourceManager.RecoveryServicesDataReplication.Models.IdentityModel authenticationIdentity, Azure.ResourceManager.RecoveryServicesDataReplication.Models.IdentityModel resourceAccessIdentity, Azure.ResourceManager.RecoveryServicesDataReplication.Models.FabricAgentModelCustomProperties customProperties) { } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.IdentityModel AuthenticationIdentity { get { throw null; } set { } } + public string CorrelationId { get { throw null; } } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.FabricAgentModelCustomProperties CustomProperties { get { throw null; } set { } } + public System.Collections.Generic.IReadOnlyList HealthErrors { get { throw null; } } + public bool? IsResponsive { get { throw null; } } + public System.DateTimeOffset? LastHeartbeat { get { throw null; } } + public string MachineId { get { throw null; } set { } } + public string MachineName { get { throw null; } set { } } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProvisioningState? ProvisioningState { get { throw null; } } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.IdentityModel ResourceAccessIdentity { get { throw null; } set { } } + public string VersionNumber { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.FabricAgentModelProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.FabricAgentModelProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public abstract partial class FabricModelCustomProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + protected FabricModelCustomProperties() { } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.FabricModelCustomProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.FabricModelCustomProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class FabricModelPatch : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public FabricModelPatch() { } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.FabricModelProperties Properties { get { throw null; } set { } } + public System.Collections.Generic.IDictionary Tags { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.FabricModelPatch System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.FabricModelPatch System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class FabricModelProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public FabricModelProperties(Azure.ResourceManager.RecoveryServicesDataReplication.Models.FabricModelCustomProperties customProperties) { } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.FabricModelCustomProperties CustomProperties { get { throw null; } set { } } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.HealthStatus? Health { get { throw null; } } + public System.Collections.Generic.IReadOnlyList HealthErrors { get { throw null; } } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProvisioningState? ProvisioningState { get { throw null; } } + public string ServiceEndpoint { get { throw null; } } + public string ServiceResourceId { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.FabricModelProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.FabricModelProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class FailoverJobModelCustomProperties : Azure.ResourceManager.RecoveryServicesDataReplication.Models.JobModelCustomProperties, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal FailoverJobModelCustomProperties() { } + public System.Collections.Generic.IReadOnlyList ProtectedItemDetails { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.FailoverJobModelCustomProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.FailoverJobModelCustomProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class FailoverProtectedItemProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal FailoverProtectedItemProperties() { } + public string NetworkName { get { throw null; } } + public string ProtectedItemName { get { throw null; } } + public string RecoveryPointId { get { throw null; } } + public System.DateTimeOffset? RecoveryPointOn { get { throw null; } } + public string Subnet { get { throw null; } } + public string TestVmName { get { throw null; } } + public string VmName { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.FailoverProtectedItemProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.FailoverProtectedItemProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class GroupConnectivityInformation : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public GroupConnectivityInformation() { } + public System.Collections.Generic.IList CustomerVisibleFqdns { get { throw null; } } + public string GroupId { get { throw null; } set { } } + public string InternalFqdn { get { throw null; } set { } } + public string MemberName { get { throw null; } set { } } + public string PrivateLinkServiceArmRegion { get { throw null; } set { } } + public string RedirectMapId { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.GroupConnectivityInformation System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.GroupConnectivityInformation System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class HealthErrorModel : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal HealthErrorModel() { } + public System.Collections.Generic.IReadOnlyList AffectedResourceCorrelationIds { get { throw null; } } + public string AffectedResourceType { get { throw null; } } + public string Category { get { throw null; } } + public string Causes { get { throw null; } } + public System.Collections.Generic.IReadOnlyList ChildErrors { get { throw null; } } + public string Code { get { throw null; } } + public System.DateTimeOffset? CreatedOn { get { throw null; } } + public string HealthCategory { get { throw null; } } + public bool? IsCustomerResolvable { get { throw null; } } + public string Message { get { throw null; } } + public string Recommendation { get { throw null; } } + public string Severity { get { throw null; } } + public string Source { get { throw null; } } + public string Summary { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.HealthErrorModel System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.HealthErrorModel System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct HealthStatus : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public HealthStatus(string value) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.HealthStatus Critical { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.HealthStatus Normal { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.HealthStatus Warning { get { throw null; } } + public bool Equals(Azure.ResourceManager.RecoveryServicesDataReplication.Models.HealthStatus other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.RecoveryServicesDataReplication.Models.HealthStatus left, Azure.ResourceManager.RecoveryServicesDataReplication.Models.HealthStatus right) { throw null; } + public static implicit operator Azure.ResourceManager.RecoveryServicesDataReplication.Models.HealthStatus (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.RecoveryServicesDataReplication.Models.HealthStatus left, Azure.ResourceManager.RecoveryServicesDataReplication.Models.HealthStatus right) { throw null; } + public override string ToString() { throw null; } + } + public partial class HyperVMigrateFabricModelCustomProperties : Azure.ResourceManager.RecoveryServicesDataReplication.Models.FabricModelCustomProperties, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public HyperVMigrateFabricModelCustomProperties(string hyperVSiteId, string migrationSolutionId) { } + public string FabricContainerId { get { throw null; } } + public string FabricResourceId { get { throw null; } } + public string HyperVSiteId { get { throw null; } set { } } + public string MigrationHubUri { get { throw null; } } + public string MigrationSolutionId { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.HyperVMigrateFabricModelCustomProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.HyperVMigrateFabricModelCustomProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class HyperVToAzStackHCIDiskInput : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public HyperVToAzStackHCIDiskInput(string diskId, long diskSizeGB, string diskFileFormat, bool isOSDisk) { } + public long? DiskBlockSize { get { throw null; } set { } } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.DiskControllerInputs DiskController { get { throw null; } set { } } + public string DiskFileFormat { get { throw null; } set { } } + public string DiskId { get { throw null; } set { } } + public string DiskIdentifier { get { throw null; } set { } } + public long? DiskLogicalSectorSize { get { throw null; } set { } } + public long? DiskPhysicalSectorSize { get { throw null; } set { } } + public long DiskSizeGB { get { throw null; } set { } } + public bool? IsDynamic { get { throw null; } set { } } + public bool IsOSDisk { get { throw null; } set { } } + public string StorageContainerId { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.HyperVToAzStackHCIDiskInput System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.HyperVToAzStackHCIDiskInput System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class HyperVToAzStackHCIEventModelCustomProperties : Azure.ResourceManager.RecoveryServicesDataReplication.Models.EventModelCustomProperties, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal HyperVToAzStackHCIEventModelCustomProperties() { } + public string EventSourceFriendlyName { get { throw null; } } + public string ProtectedItemFriendlyName { get { throw null; } } + public string ServerType { get { throw null; } } + public string SourceApplianceName { get { throw null; } } + public string TargetApplianceName { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.HyperVToAzStackHCIEventModelCustomProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.HyperVToAzStackHCIEventModelCustomProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class HyperVToAzStackHCINicInput : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public HyperVToAzStackHCINicInput(string nicId, Azure.ResourceManager.RecoveryServicesDataReplication.Models.VmNicSelection selectionTypeForFailover) { } + public bool? IsMacMigrationEnabled { get { throw null; } set { } } + public bool? IsStaticIPMigrationEnabled { get { throw null; } set { } } + public string NetworkName { get { throw null; } } + public string NicId { get { throw null; } set { } } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.VmNicSelection SelectionTypeForFailover { get { throw null; } set { } } + public string TargetNetworkId { get { throw null; } set { } } + public string TestNetworkId { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.HyperVToAzStackHCINicInput System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.HyperVToAzStackHCINicInput System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class HyperVToAzStackHCIPlannedFailoverModelCustomProperties : Azure.ResourceManager.RecoveryServicesDataReplication.Models.PlannedFailoverModelCustomProperties, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public HyperVToAzStackHCIPlannedFailoverModelCustomProperties(bool shutdownSourceVm) { } + public bool ShutdownSourceVm { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.HyperVToAzStackHCIPlannedFailoverModelCustomProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.HyperVToAzStackHCIPlannedFailoverModelCustomProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class HyperVToAzStackHCIPolicyModelCustomProperties : Azure.ResourceManager.RecoveryServicesDataReplication.Models.PolicyModelCustomProperties, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public HyperVToAzStackHCIPolicyModelCustomProperties(int recoveryPointHistoryInMinutes, int crashConsistentFrequencyInMinutes, int appConsistentFrequencyInMinutes) { } + public int AppConsistentFrequencyInMinutes { get { throw null; } set { } } + public int CrashConsistentFrequencyInMinutes { get { throw null; } set { } } + public int RecoveryPointHistoryInMinutes { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.HyperVToAzStackHCIPolicyModelCustomProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.HyperVToAzStackHCIPolicyModelCustomProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class HyperVToAzStackHCIProtectedDiskProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal HyperVToAzStackHCIProtectedDiskProperties() { } + public long? CapacityInBytes { get { throw null; } } + public long? DiskBlockSize { get { throw null; } } + public long? DiskLogicalSectorSize { get { throw null; } } + public long? DiskPhysicalSectorSize { get { throw null; } } + public string DiskType { get { throw null; } } + public bool? IsDynamic { get { throw null; } } + public bool? IsOSDisk { get { throw null; } } + public string MigrateDiskName { get { throw null; } } + public string SeedDiskName { get { throw null; } } + public string SourceDiskId { get { throw null; } } + public string SourceDiskName { get { throw null; } } + public string StorageContainerId { get { throw null; } } + public string StorageContainerLocalPath { get { throw null; } } + public string TestMigrateDiskName { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.HyperVToAzStackHCIProtectedDiskProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.HyperVToAzStackHCIProtectedDiskProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class HyperVToAzStackHCIProtectedItemModelCustomProperties : Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProtectedItemModelCustomProperties, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public HyperVToAzStackHCIProtectedItemModelCustomProperties(string targetHciClusterId, string targetArcClusterCustomLocationId, string fabricDiscoveryMachineId, System.Collections.Generic.IEnumerable disksToInclude, System.Collections.Generic.IEnumerable nicsToInclude, string targetResourceGroupId, string storageContainerId, string hyperVGeneration, string runAsAccountId, string sourceFabricAgentName, string targetFabricAgentName, string customLocationRegion) { } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProtectedItemActiveLocation? ActiveLocation { get { throw null; } } + public string CustomLocationRegion { get { throw null; } set { } } + public System.Collections.Generic.IList DisksToInclude { get { throw null; } } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProtectedItemDynamicMemoryConfig DynamicMemoryConfig { get { throw null; } set { } } + public string FabricDiscoveryMachineId { get { throw null; } set { } } + public string FailoverRecoveryPointId { get { throw null; } } + public string FirmwareType { get { throw null; } } + public string HyperVGeneration { get { throw null; } set { } } + public int? InitialReplicationProgressPercentage { get { throw null; } } + public bool? IsDynamicRam { get { throw null; } set { } } + public string LastRecoveryPointId { get { throw null; } } + public System.DateTimeOffset? LastRecoveryPointReceived { get { throw null; } } + public System.DateTimeOffset? LastReplicationUpdateOn { get { throw null; } } + public System.Collections.Generic.IList NicsToInclude { get { throw null; } } + public string OSName { get { throw null; } } + public string OSType { get { throw null; } } + public System.Collections.Generic.IReadOnlyList ProtectedDisks { get { throw null; } } + public System.Collections.Generic.IReadOnlyList ProtectedNics { get { throw null; } } + public int? ResyncProgressPercentage { get { throw null; } } + public string RunAsAccountId { get { throw null; } set { } } + public string SourceApplianceName { get { throw null; } } + public int? SourceCpuCores { get { throw null; } } + public string SourceFabricAgentName { get { throw null; } set { } } + public double? SourceMemoryInMegaBytes { get { throw null; } } + public string SourceVmName { get { throw null; } } + public string StorageContainerId { get { throw null; } set { } } + public string TargetApplianceName { get { throw null; } } + public string TargetArcClusterCustomLocationId { get { throw null; } set { } } + public string TargetAzStackHciClusterName { get { throw null; } } + public int? TargetCpuCores { get { throw null; } set { } } + public string TargetFabricAgentName { get { throw null; } set { } } + public string TargetHciClusterId { get { throw null; } set { } } + public string TargetLocation { get { throw null; } } + public int? TargetMemoryInMegaBytes { get { throw null; } set { } } + public string TargetNetworkId { get { throw null; } set { } } + public string TargetResourceGroupId { get { throw null; } set { } } + public string TargetVmBiosId { get { throw null; } } + public string TargetVmName { get { throw null; } set { } } + public string TestNetworkId { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.HyperVToAzStackHCIProtectedItemModelCustomProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.HyperVToAzStackHCIProtectedItemModelCustomProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class HyperVToAzStackHCIProtectedItemModelCustomPropertiesUpdate : Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProtectedItemModelCustomPropertiesUpdate, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public HyperVToAzStackHCIProtectedItemModelCustomPropertiesUpdate() { } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProtectedItemDynamicMemoryConfig DynamicMemoryConfig { get { throw null; } set { } } + public bool? IsDynamicRam { get { throw null; } set { } } + public System.Collections.Generic.IList NicsToInclude { get { throw null; } } + public string OSType { get { throw null; } set { } } + public int? TargetCpuCores { get { throw null; } set { } } + public int? TargetMemoryInMegaBytes { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.HyperVToAzStackHCIProtectedItemModelCustomPropertiesUpdate System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.HyperVToAzStackHCIProtectedItemModelCustomPropertiesUpdate System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class HyperVToAzStackHCIProtectedNicProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal HyperVToAzStackHCIProtectedNicProperties() { } + public string MacAddress { get { throw null; } } + public string NetworkName { get { throw null; } } + public string NicId { get { throw null; } } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.VmNicSelection? SelectionTypeForFailover { get { throw null; } } + public string TargetNetworkId { get { throw null; } } + public string TestNetworkId { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.HyperVToAzStackHCIProtectedNicProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.HyperVToAzStackHCIProtectedNicProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class HyperVToAzStackHCIRecoveryPointModelCustomProperties : Azure.ResourceManager.RecoveryServicesDataReplication.Models.RecoveryPointModelCustomProperties, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal HyperVToAzStackHCIRecoveryPointModelCustomProperties() { } + public System.Collections.Generic.IReadOnlyList DiskIds { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.HyperVToAzStackHCIRecoveryPointModelCustomProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.HyperVToAzStackHCIRecoveryPointModelCustomProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class HyperVToAzStackHCIReplicationExtensionModelCustomProperties : Azure.ResourceManager.RecoveryServicesDataReplication.Models.ReplicationExtensionModelCustomProperties, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public HyperVToAzStackHCIReplicationExtensionModelCustomProperties(string hyperVFabricArmId, string azStackHciFabricArmId) { } + public string AsrServiceUri { get { throw null; } } + public string AzStackHciFabricArmId { get { throw null; } set { } } + public string AzStackHciSiteId { get { throw null; } } + public string GatewayServiceUri { get { throw null; } } + public string HyperVFabricArmId { get { throw null; } set { } } + public string HyperVSiteId { get { throw null; } } + public string RcmServiceUri { get { throw null; } } + public string ResourceGroup { get { throw null; } } + public string ResourceLocation { get { throw null; } } + public string SourceGatewayServiceId { get { throw null; } } + public string SourceStorageContainerName { get { throw null; } } + public string StorageAccountId { get { throw null; } set { } } + public string StorageAccountSasSecretName { get { throw null; } set { } } + public string SubscriptionId { get { throw null; } } + public string TargetGatewayServiceId { get { throw null; } } + public string TargetStorageContainerName { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.HyperVToAzStackHCIReplicationExtensionModelCustomProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.HyperVToAzStackHCIReplicationExtensionModelCustomProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class IdentityModel : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public IdentityModel(string tenantId, string applicationId, string objectId, string audience, string aadAuthority) { } + public string AadAuthority { get { throw null; } set { } } + public string ApplicationId { get { throw null; } set { } } + public string Audience { get { throw null; } set { } } + public string ObjectId { get { throw null; } set { } } + public string TenantId { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.IdentityModel System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.IdentityModel System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class InnerHealthErrorModel : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal InnerHealthErrorModel() { } + public string Category { get { throw null; } } + public string Causes { get { throw null; } } + public string Code { get { throw null; } } + public System.DateTimeOffset? CreatedOn { get { throw null; } } + public string HealthCategory { get { throw null; } } + public bool? IsCustomerResolvable { get { throw null; } } + public string Message { get { throw null; } } + public string Recommendation { get { throw null; } } + public string Severity { get { throw null; } } + public string Source { get { throw null; } } + public string Summary { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.InnerHealthErrorModel System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.InnerHealthErrorModel System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public abstract partial class JobModelCustomProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + protected JobModelCustomProperties() { } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.JobModelCustomPropertiesAffectedObjectDetails AffectedObjectDetails { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.JobModelCustomProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.JobModelCustomProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class JobModelCustomPropertiesAffectedObjectDetails : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal JobModelCustomPropertiesAffectedObjectDetails() { } + public string Description { get { throw null; } } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.JobModelCustomPropertiesAffectedObjectDetailsType? Type { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.JobModelCustomPropertiesAffectedObjectDetails System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.JobModelCustomPropertiesAffectedObjectDetails System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct JobModelCustomPropertiesAffectedObjectDetailsType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public JobModelCustomPropertiesAffectedObjectDetailsType(string value) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.JobModelCustomPropertiesAffectedObjectDetailsType Object { get { throw null; } } + public bool Equals(Azure.ResourceManager.RecoveryServicesDataReplication.Models.JobModelCustomPropertiesAffectedObjectDetailsType other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.RecoveryServicesDataReplication.Models.JobModelCustomPropertiesAffectedObjectDetailsType left, Azure.ResourceManager.RecoveryServicesDataReplication.Models.JobModelCustomPropertiesAffectedObjectDetailsType right) { throw null; } + public static implicit operator Azure.ResourceManager.RecoveryServicesDataReplication.Models.JobModelCustomPropertiesAffectedObjectDetailsType (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.RecoveryServicesDataReplication.Models.JobModelCustomPropertiesAffectedObjectDetailsType left, Azure.ResourceManager.RecoveryServicesDataReplication.Models.JobModelCustomPropertiesAffectedObjectDetailsType right) { throw null; } + public override string ToString() { throw null; } + } + public partial class JobModelProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal JobModelProperties() { } + public string ActivityId { get { throw null; } } + public System.Collections.Generic.IReadOnlyList AllowedActions { get { throw null; } } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.JobModelCustomProperties CustomProperties { get { throw null; } } + public string DisplayName { get { throw null; } } + public System.DateTimeOffset? EndOn { get { throw null; } } + public System.Collections.Generic.IReadOnlyList Errors { get { throw null; } } + public string ObjectId { get { throw null; } } + public string ObjectInternalId { get { throw null; } } + public string ObjectInternalName { get { throw null; } } + public string ObjectName { get { throw null; } } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.JobObjectType? ObjectType { get { throw null; } } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProvisioningState? ProvisioningState { get { throw null; } } + public string ReplicationProviderId { get { throw null; } } + public string SourceFabricProviderId { get { throw null; } } + public System.DateTimeOffset? StartOn { get { throw null; } } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.JobState? State { get { throw null; } } + public string TargetFabricProviderId { get { throw null; } } + public System.Collections.Generic.IReadOnlyList Tasks { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.JobModelProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.JobModelProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct JobObjectType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public JobObjectType(string value) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.JobObjectType AvsDiskPool { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.JobObjectType Fabric { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.JobObjectType FabricAgent { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.JobObjectType Policy { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.JobObjectType ProtectedItem { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.JobObjectType RecoveryPlan { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.JobObjectType ReplicationExtension { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.JobObjectType Vault { get { throw null; } } + public bool Equals(Azure.ResourceManager.RecoveryServicesDataReplication.Models.JobObjectType other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.RecoveryServicesDataReplication.Models.JobObjectType left, Azure.ResourceManager.RecoveryServicesDataReplication.Models.JobObjectType right) { throw null; } + public static implicit operator Azure.ResourceManager.RecoveryServicesDataReplication.Models.JobObjectType (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.RecoveryServicesDataReplication.Models.JobObjectType left, Azure.ResourceManager.RecoveryServicesDataReplication.Models.JobObjectType right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct JobState : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public JobState(string value) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.JobState Cancelled { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.JobState Cancelling { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.JobState CompletedWithErrors { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.JobState CompletedWithInformation { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.JobState CompletedWithWarnings { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.JobState Failed { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.JobState Pending { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.JobState Started { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.JobState Succeeded { get { throw null; } } + public bool Equals(Azure.ResourceManager.RecoveryServicesDataReplication.Models.JobState other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.RecoveryServicesDataReplication.Models.JobState left, Azure.ResourceManager.RecoveryServicesDataReplication.Models.JobState right) { throw null; } + public static implicit operator Azure.ResourceManager.RecoveryServicesDataReplication.Models.JobState (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.RecoveryServicesDataReplication.Models.JobState left, Azure.ResourceManager.RecoveryServicesDataReplication.Models.JobState right) { throw null; } + public override string ToString() { throw null; } + } + public partial class OperationStatus : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal OperationStatus() { } + public string EndTime { get { throw null; } } + public string Id { get { throw null; } } + public string Name { get { throw null; } } + public string StartTime { get { throw null; } } + public string Status { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.OperationStatus System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.OperationStatus System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class PlannedFailoverModel : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public PlannedFailoverModel(Azure.ResourceManager.RecoveryServicesDataReplication.Models.PlannedFailoverModelProperties properties) { } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.PlannedFailoverModelCustomProperties PlannedFailoverModelCustomProperties { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.PlannedFailoverModel System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.PlannedFailoverModel System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public abstract partial class PlannedFailoverModelCustomProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + protected PlannedFailoverModelCustomProperties() { } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.PlannedFailoverModelCustomProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.PlannedFailoverModelCustomProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class PlannedFailoverModelProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public PlannedFailoverModelProperties(Azure.ResourceManager.RecoveryServicesDataReplication.Models.PlannedFailoverModelCustomProperties customProperties) { } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.PlannedFailoverModelCustomProperties CustomProperties { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.PlannedFailoverModelProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.PlannedFailoverModelProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public abstract partial class PolicyModelCustomProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + protected PolicyModelCustomProperties() { } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.PolicyModelCustomProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.PolicyModelCustomProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class PolicyModelProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public PolicyModelProperties(Azure.ResourceManager.RecoveryServicesDataReplication.Models.PolicyModelCustomProperties customProperties) { } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.PolicyModelCustomProperties CustomProperties { get { throw null; } set { } } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProvisioningState? ProvisioningState { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.PolicyModelProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.PolicyModelProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class PrivateEndpointConnectionProxyProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public PrivateEndpointConnectionProxyProperties() { } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProvisioningState? ProvisioningState { get { throw null; } } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.RemotePrivateEndpoint RemotePrivateEndpoint { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.PrivateEndpointConnectionProxyProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.PrivateEndpointConnectionProxyProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class PrivateEndpointConnectionResponseProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public PrivateEndpointConnectionResponseProperties() { } + public Azure.Core.ResourceIdentifier PrivateEndpointId { get { throw null; } set { } } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.RecoveryServicesDataReplicationPrivateLinkServiceConnectionState PrivateLinkServiceConnectionState { get { throw null; } set { } } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProvisioningState? ProvisioningState { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.PrivateEndpointConnectionResponseProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.PrivateEndpointConnectionResponseProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct PrivateEndpointConnectionStatus : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public PrivateEndpointConnectionStatus(string value) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.PrivateEndpointConnectionStatus Approved { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.PrivateEndpointConnectionStatus Disconnected { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.PrivateEndpointConnectionStatus Pending { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.PrivateEndpointConnectionStatus Rejected { get { throw null; } } + public bool Equals(Azure.ResourceManager.RecoveryServicesDataReplication.Models.PrivateEndpointConnectionStatus other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.RecoveryServicesDataReplication.Models.PrivateEndpointConnectionStatus left, Azure.ResourceManager.RecoveryServicesDataReplication.Models.PrivateEndpointConnectionStatus right) { throw null; } + public static implicit operator Azure.ResourceManager.RecoveryServicesDataReplication.Models.PrivateEndpointConnectionStatus (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.RecoveryServicesDataReplication.Models.PrivateEndpointConnectionStatus left, Azure.ResourceManager.RecoveryServicesDataReplication.Models.PrivateEndpointConnectionStatus right) { throw null; } + public override string ToString() { throw null; } + } + public partial class PrivateLinkServiceConnection : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public PrivateLinkServiceConnection() { } + public System.Collections.Generic.IList GroupIds { get { throw null; } } + public string Name { get { throw null; } set { } } + public string RequestMessage { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.PrivateLinkServiceConnection System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.PrivateLinkServiceConnection System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class PrivateLinkServiceProxy : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public PrivateLinkServiceProxy() { } + public System.Collections.Generic.IList GroupConnectivityInformation { get { throw null; } } + public string Id { get { throw null; } set { } } + public Azure.Core.ResourceIdentifier RemotePrivateEndpointConnectionId { get { throw null; } set { } } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.RecoveryServicesDataReplicationPrivateLinkServiceConnectionState RemotePrivateLinkServiceConnectionState { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.PrivateLinkServiceProxy System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.PrivateLinkServiceProxy System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct ProtectedItemActiveLocation : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public ProtectedItemActiveLocation(string value) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProtectedItemActiveLocation Primary { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProtectedItemActiveLocation Recovery { get { throw null; } } + public bool Equals(Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProtectedItemActiveLocation other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProtectedItemActiveLocation left, Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProtectedItemActiveLocation right) { throw null; } + public static implicit operator Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProtectedItemActiveLocation (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProtectedItemActiveLocation left, Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProtectedItemActiveLocation right) { throw null; } + public override string ToString() { throw null; } + } + public partial class ProtectedItemDynamicMemoryConfig : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ProtectedItemDynamicMemoryConfig(long maximumMemoryInMegaBytes, long minimumMemoryInMegaBytes, int targetMemoryBufferPercentage) { } + public long MaximumMemoryInMegaBytes { get { throw null; } set { } } + public long MinimumMemoryInMegaBytes { get { throw null; } set { } } + public int TargetMemoryBufferPercentage { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProtectedItemDynamicMemoryConfig System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProtectedItemDynamicMemoryConfig System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ProtectedItemJobProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal ProtectedItemJobProperties() { } + public string DisplayName { get { throw null; } } + public System.DateTimeOffset? EndOn { get { throw null; } } + public string Id { get { throw null; } } + public string Name { get { throw null; } } + public string ScenarioName { get { throw null; } } + public System.DateTimeOffset? StartOn { get { throw null; } } + public string State { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProtectedItemJobProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProtectedItemJobProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public abstract partial class ProtectedItemModelCustomProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + protected ProtectedItemModelCustomProperties() { } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProtectedItemModelCustomProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProtectedItemModelCustomProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public abstract partial class ProtectedItemModelCustomPropertiesUpdate : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + protected ProtectedItemModelCustomPropertiesUpdate() { } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProtectedItemModelCustomPropertiesUpdate System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProtectedItemModelCustomPropertiesUpdate System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ProtectedItemModelPatch : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ProtectedItemModelPatch() { } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProtectedItemModelCustomPropertiesUpdate CustomProperties { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProtectedItemModelPatch System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProtectedItemModelPatch System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ProtectedItemModelProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ProtectedItemModelProperties(string policyName, string replicationExtensionName, Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProtectedItemModelCustomProperties customProperties) { } + public System.Collections.Generic.IReadOnlyList AllowedJobs { get { throw null; } } + public string CorrelationId { get { throw null; } } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProtectedItemJobProperties CurrentJob { get { throw null; } } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProtectedItemModelCustomProperties CustomProperties { get { throw null; } set { } } + public string FabricAgentId { get { throw null; } } + public string FabricId { get { throw null; } } + public string FabricObjectId { get { throw null; } } + public string FabricObjectName { get { throw null; } } + public System.Collections.Generic.IReadOnlyList HealthErrors { get { throw null; } } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProtectedItemJobProperties LastFailedEnableProtectionJob { get { throw null; } } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProtectedItemJobProperties LastFailedPlannedFailoverJob { get { throw null; } } + public System.DateTimeOffset? LastSuccessfulPlannedFailoverOn { get { throw null; } } + public System.DateTimeOffset? LastSuccessfulTestFailoverOn { get { throw null; } } + public System.DateTimeOffset? LastSuccessfulUnplannedFailoverOn { get { throw null; } } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProtectedItemJobProperties LastTestFailoverJob { get { throw null; } } + public string PolicyName { get { throw null; } set { } } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProtectionState? ProtectionState { get { throw null; } } + public string ProtectionStateDescription { get { throw null; } } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProvisioningState? ProvisioningState { get { throw null; } } + public string ReplicationExtensionName { get { throw null; } set { } } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.HealthStatus? ReplicationHealth { get { throw null; } } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.ResynchronizationState? ResynchronizationState { get { throw null; } } + public bool? ResyncRequired { get { throw null; } } + public string SourceFabricProviderId { get { throw null; } } + public string TargetFabricAgentId { get { throw null; } } + public string TargetFabricId { get { throw null; } } + public string TargetFabricProviderId { get { throw null; } } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.TestFailoverState? TestFailoverState { get { throw null; } } + public string TestFailoverStateDescription { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProtectedItemModelProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProtectedItemModelProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct ProtectionState : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public ProtectionState(string value) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProtectionState CancelFailoverFailedOnPrimary { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProtectionState CancelFailoverFailedOnRecovery { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProtectionState CancelFailoverInProgressOnPrimary { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProtectionState CancelFailoverInProgressOnRecovery { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProtectionState CancelFailoverStatesBegin { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProtectionState CancelFailoverStatesEnd { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProtectionState ChangeRecoveryPointCompleted { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProtectionState ChangeRecoveryPointFailed { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProtectionState ChangeRecoveryPointInitiated { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProtectionState ChangeRecoveryPointStatesBegin { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProtectionState ChangeRecoveryPointStatesEnd { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProtectionState CommitFailoverCompleted { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProtectionState CommitFailoverFailedOnPrimary { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProtectionState CommitFailoverFailedOnRecovery { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProtectionState CommitFailoverInProgressOnPrimary { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProtectionState CommitFailoverInProgressOnRecovery { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProtectionState CommitFailoverStatesBegin { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProtectionState CommitFailoverStatesEnd { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProtectionState DisablingFailed { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProtectionState DisablingProtection { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProtectionState EnablingFailed { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProtectionState EnablingProtection { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProtectionState InitialReplicationCompletedOnPrimary { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProtectionState InitialReplicationCompletedOnRecovery { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProtectionState InitialReplicationFailed { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProtectionState InitialReplicationInProgress { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProtectionState InitialReplicationStatesBegin { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProtectionState InitialReplicationStatesEnd { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProtectionState MarkedForDeletion { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProtectionState PlannedFailoverCompleted { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProtectionState PlannedFailoverCompleting { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProtectionState PlannedFailoverCompletionFailed { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProtectionState PlannedFailoverFailed { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProtectionState PlannedFailoverInitiated { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProtectionState PlannedFailoverTransitionStatesBegin { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProtectionState PlannedFailoverTransitionStatesEnd { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProtectionState Protected { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProtectionState ProtectedStatesBegin { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProtectionState ProtectedStatesEnd { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProtectionState ReprotectFailed { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProtectionState ReprotectInitiated { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProtectionState ReprotectStatesBegin { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProtectionState ReprotectStatesEnd { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProtectionState UnplannedFailoverCompleted { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProtectionState UnplannedFailoverCompleting { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProtectionState UnplannedFailoverCompletionFailed { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProtectionState UnplannedFailoverFailed { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProtectionState UnplannedFailoverInitiated { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProtectionState UnplannedFailoverTransitionStatesBegin { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProtectionState UnplannedFailoverTransitionStatesEnd { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProtectionState UnprotectedStatesBegin { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProtectionState UnprotectedStatesEnd { get { throw null; } } + public bool Equals(Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProtectionState other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProtectionState left, Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProtectionState right) { throw null; } + public static implicit operator Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProtectionState (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProtectionState left, Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProtectionState right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct ProvisioningState : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public ProvisioningState(string value) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProvisioningState Canceled { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProvisioningState Creating { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProvisioningState Deleted { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProvisioningState Deleting { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProvisioningState Failed { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProvisioningState Succeeded { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProvisioningState Updating { get { throw null; } } + public bool Equals(Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProvisioningState other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProvisioningState left, Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProvisioningState right) { throw null; } + public static implicit operator Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProvisioningState (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProvisioningState left, Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProvisioningState right) { throw null; } + public override string ToString() { throw null; } + } + public abstract partial class RecoveryPointModelCustomProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + protected RecoveryPointModelCustomProperties() { } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.RecoveryPointModelCustomProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.RecoveryPointModelCustomProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class RecoveryPointModelProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal RecoveryPointModelProperties() { } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.RecoveryPointModelCustomProperties CustomProperties { get { throw null; } } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProvisioningState? ProvisioningState { get { throw null; } } + public System.DateTimeOffset RecoveryPointOn { get { throw null; } } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.RecoveryPointType RecoveryPointType { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.RecoveryPointModelProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.RecoveryPointModelProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct RecoveryPointType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public RecoveryPointType(string value) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.RecoveryPointType ApplicationConsistent { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.RecoveryPointType CrashConsistent { get { throw null; } } + public bool Equals(Azure.ResourceManager.RecoveryServicesDataReplication.Models.RecoveryPointType other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.RecoveryServicesDataReplication.Models.RecoveryPointType left, Azure.ResourceManager.RecoveryServicesDataReplication.Models.RecoveryPointType right) { throw null; } + public static implicit operator Azure.ResourceManager.RecoveryServicesDataReplication.Models.RecoveryPointType (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.RecoveryServicesDataReplication.Models.RecoveryPointType left, Azure.ResourceManager.RecoveryServicesDataReplication.Models.RecoveryPointType right) { throw null; } + public override string ToString() { throw null; } + } + public partial class RecoveryServicesDataReplicationPrivateLinkResourceProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal RecoveryServicesDataReplicationPrivateLinkResourceProperties() { } + public string GroupId { get { throw null; } } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProvisioningState? ProvisioningState { get { throw null; } } + public System.Collections.Generic.IReadOnlyList RequiredMembers { get { throw null; } } + public System.Collections.Generic.IReadOnlyList RequiredZoneNames { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.RecoveryServicesDataReplicationPrivateLinkResourceProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.RecoveryServicesDataReplicationPrivateLinkResourceProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class RecoveryServicesDataReplicationPrivateLinkServiceConnectionState : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public RecoveryServicesDataReplicationPrivateLinkServiceConnectionState() { } + public string ActionsRequired { get { throw null; } set { } } + public string Description { get { throw null; } set { } } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.PrivateEndpointConnectionStatus? Status { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.RecoveryServicesDataReplicationPrivateLinkServiceConnectionState System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.RecoveryServicesDataReplicationPrivateLinkServiceConnectionState System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class RemotePrivateEndpoint : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public RemotePrivateEndpoint(string id) { } + public System.Collections.Generic.IList ConnectionDetails { get { throw null; } } + public string Id { get { throw null; } set { } } + public System.Collections.Generic.IList ManualPrivateLinkServiceConnections { get { throw null; } } + public System.Collections.Generic.IList PrivateLinkServiceConnections { get { throw null; } } + public System.Collections.Generic.IList PrivateLinkServiceProxies { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.RemotePrivateEndpoint System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.RemotePrivateEndpoint System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public abstract partial class ReplicationExtensionModelCustomProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + protected ReplicationExtensionModelCustomProperties() { } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.ReplicationExtensionModelCustomProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.ReplicationExtensionModelCustomProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ReplicationExtensionModelProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ReplicationExtensionModelProperties(Azure.ResourceManager.RecoveryServicesDataReplication.Models.ReplicationExtensionModelCustomProperties customProperties) { } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.ReplicationExtensionModelCustomProperties CustomProperties { get { throw null; } set { } } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProvisioningState? ProvisioningState { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.ReplicationExtensionModelProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.ReplicationExtensionModelProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct ReplicationVaultType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public ReplicationVaultType(string value) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.ReplicationVaultType DisasterRecovery { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.ReplicationVaultType Migrate { get { throw null; } } + public bool Equals(Azure.ResourceManager.RecoveryServicesDataReplication.Models.ReplicationVaultType other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.RecoveryServicesDataReplication.Models.ReplicationVaultType left, Azure.ResourceManager.RecoveryServicesDataReplication.Models.ReplicationVaultType right) { throw null; } + public static implicit operator Azure.ResourceManager.RecoveryServicesDataReplication.Models.ReplicationVaultType (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.RecoveryServicesDataReplication.Models.ReplicationVaultType left, Azure.ResourceManager.RecoveryServicesDataReplication.Models.ReplicationVaultType right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct ResynchronizationState : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public ResynchronizationState(string value) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.ResynchronizationState None { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.ResynchronizationState ResynchronizationCompleted { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.ResynchronizationState ResynchronizationFailed { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.ResynchronizationState ResynchronizationInitiated { get { throw null; } } + public bool Equals(Azure.ResourceManager.RecoveryServicesDataReplication.Models.ResynchronizationState other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.RecoveryServicesDataReplication.Models.ResynchronizationState left, Azure.ResourceManager.RecoveryServicesDataReplication.Models.ResynchronizationState right) { throw null; } + public static implicit operator Azure.ResourceManager.RecoveryServicesDataReplication.Models.ResynchronizationState (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.RecoveryServicesDataReplication.Models.ResynchronizationState left, Azure.ResourceManager.RecoveryServicesDataReplication.Models.ResynchronizationState right) { throw null; } + public override string ToString() { throw null; } + } + public partial class StorageContainerProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public StorageContainerProperties(string name, string clusterSharedVolumePath) { } + public string ClusterSharedVolumePath { get { throw null; } set { } } + public string Name { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.StorageContainerProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.StorageContainerProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class TaskModel : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal TaskModel() { } + public System.Collections.Generic.IReadOnlyList ChildrenJobs { get { throw null; } } + public string CustomInstanceType { get { throw null; } } + public System.DateTimeOffset? EndOn { get { throw null; } } + public System.DateTimeOffset? StartOn { get { throw null; } } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.TaskState? State { get { throw null; } } + public string TaskName { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.TaskModel System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.TaskModel System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct TaskState : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public TaskState(string value) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.TaskState Cancelled { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.TaskState Failed { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.TaskState Pending { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.TaskState Skipped { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.TaskState Started { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.TaskState Succeeded { get { throw null; } } + public bool Equals(Azure.ResourceManager.RecoveryServicesDataReplication.Models.TaskState other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.RecoveryServicesDataReplication.Models.TaskState left, Azure.ResourceManager.RecoveryServicesDataReplication.Models.TaskState right) { throw null; } + public static implicit operator Azure.ResourceManager.RecoveryServicesDataReplication.Models.TaskState (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.RecoveryServicesDataReplication.Models.TaskState left, Azure.ResourceManager.RecoveryServicesDataReplication.Models.TaskState right) { throw null; } + public override string ToString() { throw null; } + } + public partial class TestFailoverCleanupJobModelCustomProperties : Azure.ResourceManager.RecoveryServicesDataReplication.Models.JobModelCustomProperties, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal TestFailoverCleanupJobModelCustomProperties() { } + public string Comments { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.TestFailoverCleanupJobModelCustomProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.TestFailoverCleanupJobModelCustomProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class TestFailoverJobModelCustomProperties : Azure.ResourceManager.RecoveryServicesDataReplication.Models.JobModelCustomProperties, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal TestFailoverJobModelCustomProperties() { } + public System.Collections.Generic.IReadOnlyList ProtectedItemDetails { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.TestFailoverJobModelCustomProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.TestFailoverJobModelCustomProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct TestFailoverState : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public TestFailoverState(string value) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.TestFailoverState MarkedForDeletion { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.TestFailoverState None { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.TestFailoverState TestFailoverCleanupCompleting { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.TestFailoverState TestFailoverCleanupInitiated { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.TestFailoverState TestFailoverCompleted { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.TestFailoverState TestFailoverCompleting { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.TestFailoverState TestFailoverCompletionFailed { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.TestFailoverState TestFailoverFailed { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.TestFailoverState TestFailoverInitiated { get { throw null; } } + public bool Equals(Azure.ResourceManager.RecoveryServicesDataReplication.Models.TestFailoverState other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.RecoveryServicesDataReplication.Models.TestFailoverState left, Azure.ResourceManager.RecoveryServicesDataReplication.Models.TestFailoverState right) { throw null; } + public static implicit operator Azure.ResourceManager.RecoveryServicesDataReplication.Models.TestFailoverState (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.RecoveryServicesDataReplication.Models.TestFailoverState left, Azure.ResourceManager.RecoveryServicesDataReplication.Models.TestFailoverState right) { throw null; } + public override string ToString() { throw null; } + } + public partial class VaultModelPatch : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public VaultModelPatch() { } + public Azure.ResourceManager.Models.ManagedServiceIdentity Identity { get { throw null; } set { } } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.VaultModelProperties Properties { get { throw null; } set { } } + public System.Collections.Generic.IDictionary Tags { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.VaultModelPatch System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.VaultModelPatch System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class VaultModelProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public VaultModelProperties() { } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProvisioningState? ProvisioningState { get { throw null; } } + public string ServiceResourceId { get { throw null; } } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.ReplicationVaultType? VaultType { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.VaultModelProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.VaultModelProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct VmNicSelection : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public VmNicSelection(string value) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.VmNicSelection NotSelected { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.VmNicSelection SelectedByDefault { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.VmNicSelection SelectedByUser { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.VmNicSelection SelectedByUserOverride { get { throw null; } } + public bool Equals(Azure.ResourceManager.RecoveryServicesDataReplication.Models.VmNicSelection other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.RecoveryServicesDataReplication.Models.VmNicSelection left, Azure.ResourceManager.RecoveryServicesDataReplication.Models.VmNicSelection right) { throw null; } + public static implicit operator Azure.ResourceManager.RecoveryServicesDataReplication.Models.VmNicSelection (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.RecoveryServicesDataReplication.Models.VmNicSelection left, Azure.ResourceManager.RecoveryServicesDataReplication.Models.VmNicSelection right) { throw null; } + public override string ToString() { throw null; } + } + public partial class VMwareFabricAgentModelCustomProperties : Azure.ResourceManager.RecoveryServicesDataReplication.Models.FabricAgentModelCustomProperties, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public VMwareFabricAgentModelCustomProperties(string biosId, Azure.ResourceManager.RecoveryServicesDataReplication.Models.IdentityModel marsAuthenticationIdentity) { } + public string BiosId { get { throw null; } set { } } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.IdentityModel MarsAuthenticationIdentity { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.VMwareFabricAgentModelCustomProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.VMwareFabricAgentModelCustomProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class VMwareMigrateFabricModelCustomProperties : Azure.ResourceManager.RecoveryServicesDataReplication.Models.FabricModelCustomProperties, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public VMwareMigrateFabricModelCustomProperties(string vmwareSiteId, string migrationSolutionId) { } + public string MigrationSolutionId { get { throw null; } set { } } + public string VmwareSiteId { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.VMwareMigrateFabricModelCustomProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.VMwareMigrateFabricModelCustomProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class VMwareToAzStackHCIDiskInput : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public VMwareToAzStackHCIDiskInput(string diskId, long diskSizeGB, string diskFileFormat, bool isOSDisk) { } + public long? DiskBlockSize { get { throw null; } set { } } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.DiskControllerInputs DiskController { get { throw null; } set { } } + public string DiskFileFormat { get { throw null; } set { } } + public string DiskId { get { throw null; } set { } } + public string DiskIdentifier { get { throw null; } set { } } + public long? DiskLogicalSectorSize { get { throw null; } set { } } + public long? DiskPhysicalSectorSize { get { throw null; } set { } } + public long DiskSizeGB { get { throw null; } set { } } + public bool? IsDynamic { get { throw null; } set { } } + public bool IsOSDisk { get { throw null; } set { } } + public string StorageContainerId { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.VMwareToAzStackHCIDiskInput System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.VMwareToAzStackHCIDiskInput System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class VMwareToAzStackHCIEventModelCustomProperties : Azure.ResourceManager.RecoveryServicesDataReplication.Models.EventModelCustomProperties, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal VMwareToAzStackHCIEventModelCustomProperties() { } + public string EventSourceFriendlyName { get { throw null; } } + public string ProtectedItemFriendlyName { get { throw null; } } + public string ServerType { get { throw null; } } + public string SourceApplianceName { get { throw null; } } + public string TargetApplianceName { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.VMwareToAzStackHCIEventModelCustomProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.VMwareToAzStackHCIEventModelCustomProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class VMwareToAzStackHCINicInput : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public VMwareToAzStackHCINicInput(string nicId, string label, Azure.ResourceManager.RecoveryServicesDataReplication.Models.VmNicSelection selectionTypeForFailover) { } + public bool? IsMacMigrationEnabled { get { throw null; } set { } } + public bool? IsStaticIPMigrationEnabled { get { throw null; } set { } } + public string Label { get { throw null; } set { } } + public string NetworkName { get { throw null; } } + public string NicId { get { throw null; } set { } } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.VmNicSelection SelectionTypeForFailover { get { throw null; } set { } } + public string TargetNetworkId { get { throw null; } set { } } + public string TestNetworkId { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.VMwareToAzStackHCINicInput System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.VMwareToAzStackHCINicInput System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class VMwareToAzStackHCIPlannedFailoverModelCustomProperties : Azure.ResourceManager.RecoveryServicesDataReplication.Models.PlannedFailoverModelCustomProperties, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public VMwareToAzStackHCIPlannedFailoverModelCustomProperties(bool shutdownSourceVm) { } + public bool ShutdownSourceVm { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.VMwareToAzStackHCIPlannedFailoverModelCustomProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.VMwareToAzStackHCIPlannedFailoverModelCustomProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class VMwareToAzStackHCIPolicyModelCustomProperties : Azure.ResourceManager.RecoveryServicesDataReplication.Models.PolicyModelCustomProperties, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public VMwareToAzStackHCIPolicyModelCustomProperties(int recoveryPointHistoryInMinutes, int crashConsistentFrequencyInMinutes, int appConsistentFrequencyInMinutes) { } + public int AppConsistentFrequencyInMinutes { get { throw null; } set { } } + public int CrashConsistentFrequencyInMinutes { get { throw null; } set { } } + public int RecoveryPointHistoryInMinutes { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.VMwareToAzStackHCIPolicyModelCustomProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.VMwareToAzStackHCIPolicyModelCustomProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class VMwareToAzStackHCIProtectedDiskProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal VMwareToAzStackHCIProtectedDiskProperties() { } + public long? CapacityInBytes { get { throw null; } } + public long? DiskBlockSize { get { throw null; } } + public long? DiskLogicalSectorSize { get { throw null; } } + public long? DiskPhysicalSectorSize { get { throw null; } } + public string DiskType { get { throw null; } } + public bool? IsDynamic { get { throw null; } } + public bool? IsOSDisk { get { throw null; } } + public string MigrateDiskName { get { throw null; } } + public string SeedDiskName { get { throw null; } } + public string SourceDiskId { get { throw null; } } + public string SourceDiskName { get { throw null; } } + public string StorageContainerId { get { throw null; } } + public string StorageContainerLocalPath { get { throw null; } } + public string TestMigrateDiskName { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.VMwareToAzStackHCIProtectedDiskProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.VMwareToAzStackHCIProtectedDiskProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class VMwareToAzStackHCIProtectedItemModelCustomProperties : Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProtectedItemModelCustomProperties, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public VMwareToAzStackHCIProtectedItemModelCustomProperties(string targetHciClusterId, string targetArcClusterCustomLocationId, string storageContainerId, string targetResourceGroupId, string customLocationRegion, System.Collections.Generic.IEnumerable disksToInclude, System.Collections.Generic.IEnumerable nicsToInclude, string hyperVGeneration, string fabricDiscoveryMachineId, string runAsAccountId, string sourceFabricAgentName, string targetFabricAgentName) { } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProtectedItemActiveLocation? ActiveLocation { get { throw null; } } + public string CustomLocationRegion { get { throw null; } set { } } + public System.Collections.Generic.IList DisksToInclude { get { throw null; } } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProtectedItemDynamicMemoryConfig DynamicMemoryConfig { get { throw null; } set { } } + public string FabricDiscoveryMachineId { get { throw null; } set { } } + public string FailoverRecoveryPointId { get { throw null; } } + public string FirmwareType { get { throw null; } } + public string HyperVGeneration { get { throw null; } set { } } + public int? InitialReplicationProgressPercentage { get { throw null; } } + public bool? IsDynamicRam { get { throw null; } set { } } + public string LastRecoveryPointId { get { throw null; } } + public System.DateTimeOffset? LastRecoveryPointReceived { get { throw null; } } + public System.DateTimeOffset? LastReplicationUpdateOn { get { throw null; } } + public int? MigrationProgressPercentage { get { throw null; } } + public System.Collections.Generic.IList NicsToInclude { get { throw null; } } + public string OSName { get { throw null; } } + public string OSType { get { throw null; } } + public bool? PerformAutoResync { get { throw null; } set { } } + public System.Collections.Generic.IReadOnlyList ProtectedDisks { get { throw null; } } + public System.Collections.Generic.IReadOnlyList ProtectedNics { get { throw null; } } + public int? ResumeProgressPercentage { get { throw null; } } + public long? ResumeRetryCount { get { throw null; } } + public int? ResyncProgressPercentage { get { throw null; } } + public bool? ResyncRequired { get { throw null; } } + public long? ResyncRetryCount { get { throw null; } } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.VMwareToAzureMigrateResyncState? ResyncState { get { throw null; } } + public string RunAsAccountId { get { throw null; } set { } } + public string SourceApplianceName { get { throw null; } } + public int? SourceCpuCores { get { throw null; } } + public string SourceFabricAgentName { get { throw null; } set { } } + public double? SourceMemoryInMegaBytes { get { throw null; } } + public string SourceVmName { get { throw null; } } + public string StorageContainerId { get { throw null; } set { } } + public string TargetApplianceName { get { throw null; } } + public string TargetArcClusterCustomLocationId { get { throw null; } set { } } + public string TargetAzStackHciClusterName { get { throw null; } } + public int? TargetCpuCores { get { throw null; } set { } } + public string TargetFabricAgentName { get { throw null; } set { } } + public string TargetHciClusterId { get { throw null; } set { } } + public string TargetLocation { get { throw null; } } + public int? TargetMemoryInMegaBytes { get { throw null; } set { } } + public string TargetNetworkId { get { throw null; } set { } } + public string TargetResourceGroupId { get { throw null; } set { } } + public string TargetVmBiosId { get { throw null; } } + public string TargetVmName { get { throw null; } set { } } + public string TestNetworkId { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.VMwareToAzStackHCIProtectedItemModelCustomProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.VMwareToAzStackHCIProtectedItemModelCustomProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class VMwareToAzStackHCIProtectedItemModelCustomPropertiesUpdate : Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProtectedItemModelCustomPropertiesUpdate, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public VMwareToAzStackHCIProtectedItemModelCustomPropertiesUpdate() { } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProtectedItemDynamicMemoryConfig DynamicMemoryConfig { get { throw null; } set { } } + public bool? IsDynamicRam { get { throw null; } set { } } + public System.Collections.Generic.IList NicsToInclude { get { throw null; } } + public string OSType { get { throw null; } set { } } + public int? TargetCpuCores { get { throw null; } set { } } + public int? TargetMemoryInMegaBytes { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.VMwareToAzStackHCIProtectedItemModelCustomPropertiesUpdate System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.VMwareToAzStackHCIProtectedItemModelCustomPropertiesUpdate System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class VMwareToAzStackHCIProtectedNicProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal VMwareToAzStackHCIProtectedNicProperties() { } + public bool? IsPrimaryNic { get { throw null; } } + public string Label { get { throw null; } } + public string MacAddress { get { throw null; } } + public string NetworkName { get { throw null; } } + public string NicId { get { throw null; } } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.VmNicSelection? SelectionTypeForFailover { get { throw null; } } + public string TargetNetworkId { get { throw null; } } + public string TestNetworkId { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.VMwareToAzStackHCIProtectedNicProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.VMwareToAzStackHCIProtectedNicProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class VMwareToAzStackHCIRecoveryPointModelCustomProperties : Azure.ResourceManager.RecoveryServicesDataReplication.Models.RecoveryPointModelCustomProperties, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal VMwareToAzStackHCIRecoveryPointModelCustomProperties() { } + public System.Collections.Generic.IReadOnlyList DiskIds { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.VMwareToAzStackHCIRecoveryPointModelCustomProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.VMwareToAzStackHCIRecoveryPointModelCustomProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class VMwareToAzStackHCIReplicationExtensionModelCustomProperties : Azure.ResourceManager.RecoveryServicesDataReplication.Models.ReplicationExtensionModelCustomProperties, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public VMwareToAzStackHCIReplicationExtensionModelCustomProperties(string vmwareFabricArmId, string azStackHciFabricArmId) { } + public string AsrServiceUri { get { throw null; } } + public string AzStackHciFabricArmId { get { throw null; } set { } } + public string AzStackHciSiteId { get { throw null; } } + public string GatewayServiceUri { get { throw null; } } + public string RcmServiceUri { get { throw null; } } + public string ResourceGroup { get { throw null; } } + public string ResourceLocation { get { throw null; } } + public string SourceGatewayServiceId { get { throw null; } } + public string SourceStorageContainerName { get { throw null; } } + public string StorageAccountId { get { throw null; } set { } } + public string StorageAccountSasSecretName { get { throw null; } set { } } + public string SubscriptionId { get { throw null; } } + public string TargetGatewayServiceId { get { throw null; } } + public string TargetStorageContainerName { get { throw null; } } + public string VmwareFabricArmId { get { throw null; } set { } } + public string VmwareSiteId { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.VMwareToAzStackHCIReplicationExtensionModelCustomProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.VMwareToAzStackHCIReplicationExtensionModelCustomProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct VMwareToAzureMigrateResyncState : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public VMwareToAzureMigrateResyncState(string value) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.VMwareToAzureMigrateResyncState None { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.VMwareToAzureMigrateResyncState PreparedForResynchronization { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.VMwareToAzureMigrateResyncState StartedResynchronization { get { throw null; } } + public bool Equals(Azure.ResourceManager.RecoveryServicesDataReplication.Models.VMwareToAzureMigrateResyncState other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.RecoveryServicesDataReplication.Models.VMwareToAzureMigrateResyncState left, Azure.ResourceManager.RecoveryServicesDataReplication.Models.VMwareToAzureMigrateResyncState right) { throw null; } + public static implicit operator Azure.ResourceManager.RecoveryServicesDataReplication.Models.VMwareToAzureMigrateResyncState (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.RecoveryServicesDataReplication.Models.VMwareToAzureMigrateResyncState left, Azure.ResourceManager.RecoveryServicesDataReplication.Models.VMwareToAzureMigrateResyncState right) { throw null; } + public override string ToString() { throw null; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/api/Azure.ResourceManager.RecoveryServicesDataReplication.netstandard2.0.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/api/Azure.ResourceManager.RecoveryServicesDataReplication.netstandard2.0.cs new file mode 100644 index 000000000000..c52eb06ba888 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/api/Azure.ResourceManager.RecoveryServicesDataReplication.netstandard2.0.cs @@ -0,0 +1,2403 @@ +namespace Azure.ResourceManager.RecoveryServicesDataReplication +{ + public partial class EmailConfigurationModelCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected EmailConfigurationModelCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string emailConfigurationName, Azure.ResourceManager.RecoveryServicesDataReplication.EmailConfigurationModelData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string emailConfigurationName, Azure.ResourceManager.RecoveryServicesDataReplication.EmailConfigurationModelData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string emailConfigurationName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string emailConfigurationName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string emailConfigurationName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string emailConfigurationName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string emailConfigurationName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string emailConfigurationName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class EmailConfigurationModelData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public EmailConfigurationModelData() { } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.EmailConfigurationModelProperties Properties { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.EmailConfigurationModelData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.EmailConfigurationModelData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class EmailConfigurationModelResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected EmailConfigurationModelResource() { } + public virtual Azure.ResourceManager.RecoveryServicesDataReplication.EmailConfigurationModelData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string vaultName, string emailConfigurationName) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + Azure.ResourceManager.RecoveryServicesDataReplication.EmailConfigurationModelData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.EmailConfigurationModelData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.RecoveryServicesDataReplication.EmailConfigurationModelData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.RecoveryServicesDataReplication.EmailConfigurationModelData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class EventModelCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected EventModelCollection() { } + public virtual Azure.Response Exists(string eventName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string eventName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string eventName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(string odataOptions = null, string continuationToken = null, int? pageSize = default(int?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(string odataOptions = null, string continuationToken = null, int? pageSize = default(int?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string eventName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string eventName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string eventName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class EventModelData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal EventModelData() { } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.EventModelProperties Properties { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.EventModelData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.EventModelData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class EventModelResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected EventModelResource() { } + public virtual Azure.ResourceManager.RecoveryServicesDataReplication.EventModelData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string vaultName, string eventName) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + Azure.ResourceManager.RecoveryServicesDataReplication.EventModelData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.EventModelData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class FabricAgentModelCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected FabricAgentModelCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string fabricAgentName, Azure.ResourceManager.RecoveryServicesDataReplication.FabricAgentModelData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string fabricAgentName, Azure.ResourceManager.RecoveryServicesDataReplication.FabricAgentModelData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string fabricAgentName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string fabricAgentName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string fabricAgentName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string fabricAgentName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string fabricAgentName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string fabricAgentName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class FabricAgentModelData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public FabricAgentModelData() { } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.FabricAgentModelProperties Properties { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.FabricAgentModelData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.FabricAgentModelData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class FabricAgentModelResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected FabricAgentModelResource() { } + public virtual Azure.ResourceManager.RecoveryServicesDataReplication.FabricAgentModelData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string fabricName, string fabricAgentName) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + Azure.ResourceManager.RecoveryServicesDataReplication.FabricAgentModelData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.FabricAgentModelData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.RecoveryServicesDataReplication.FabricAgentModelData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.RecoveryServicesDataReplication.FabricAgentModelData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class FabricModelCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected FabricModelCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string fabricName, Azure.ResourceManager.RecoveryServicesDataReplication.FabricModelData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string fabricName, Azure.ResourceManager.RecoveryServicesDataReplication.FabricModelData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string fabricName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string fabricName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string fabricName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(string continuationToken = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(string continuationToken = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string fabricName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string fabricName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string fabricName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class FabricModelData : Azure.ResourceManager.Models.TrackedResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public FabricModelData(Azure.Core.AzureLocation location) { } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.FabricModelProperties Properties { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.FabricModelData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.FabricModelData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class FabricModelResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected FabricModelResource() { } + public virtual Azure.ResourceManager.RecoveryServicesDataReplication.FabricModelData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public virtual Azure.Response AddTag(string key, string value, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> AddTagAsync(string key, string value, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string fabricName) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response GetFabricAgentModel(string fabricAgentName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetFabricAgentModelAsync(string fabricAgentName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.RecoveryServicesDataReplication.FabricAgentModelCollection GetFabricAgentModels() { throw null; } + public virtual Azure.Response RemoveTag(string key, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> RemoveTagAsync(string key, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response SetTags(System.Collections.Generic.IDictionary tags, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> SetTagsAsync(System.Collections.Generic.IDictionary tags, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + Azure.ResourceManager.RecoveryServicesDataReplication.FabricModelData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.FabricModelData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.RecoveryServicesDataReplication.Models.FabricModelPatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.RecoveryServicesDataReplication.Models.FabricModelPatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class JobModelCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected JobModelCollection() { } + public virtual Azure.Response Exists(string jobName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string jobName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string jobName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(string odataOptions = null, string continuationToken = null, int? pageSize = default(int?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(string odataOptions = null, string continuationToken = null, int? pageSize = default(int?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string jobName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string jobName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string jobName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class JobModelData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal JobModelData() { } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.JobModelProperties Properties { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.JobModelData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.JobModelData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class JobModelResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected JobModelResource() { } + public virtual Azure.ResourceManager.RecoveryServicesDataReplication.JobModelData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string vaultName, string jobName) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + Azure.ResourceManager.RecoveryServicesDataReplication.JobModelData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.JobModelData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class PolicyModelCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected PolicyModelCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string policyName, Azure.ResourceManager.RecoveryServicesDataReplication.PolicyModelData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string policyName, Azure.ResourceManager.RecoveryServicesDataReplication.PolicyModelData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string policyName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string policyName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string policyName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string policyName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string policyName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string policyName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class PolicyModelData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public PolicyModelData() { } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.PolicyModelProperties Properties { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.PolicyModelData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.PolicyModelData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class PolicyModelResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected PolicyModelResource() { } + public virtual Azure.ResourceManager.RecoveryServicesDataReplication.PolicyModelData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string vaultName, string policyName) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + Azure.ResourceManager.RecoveryServicesDataReplication.PolicyModelData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.PolicyModelData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.RecoveryServicesDataReplication.PolicyModelData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.RecoveryServicesDataReplication.PolicyModelData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class PrivateEndpointConnectionProxyCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected PrivateEndpointConnectionProxyCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string privateEndpointConnectionProxyName, Azure.ResourceManager.RecoveryServicesDataReplication.PrivateEndpointConnectionProxyData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string privateEndpointConnectionProxyName, Azure.ResourceManager.RecoveryServicesDataReplication.PrivateEndpointConnectionProxyData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string privateEndpointConnectionProxyName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string privateEndpointConnectionProxyName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string privateEndpointConnectionProxyName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string privateEndpointConnectionProxyName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string privateEndpointConnectionProxyName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string privateEndpointConnectionProxyName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class PrivateEndpointConnectionProxyData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public PrivateEndpointConnectionProxyData() { } + public string ETag { get { throw null; } set { } } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.PrivateEndpointConnectionProxyProperties Properties { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.PrivateEndpointConnectionProxyData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.PrivateEndpointConnectionProxyData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class PrivateEndpointConnectionProxyResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected PrivateEndpointConnectionProxyResource() { } + public virtual Azure.ResourceManager.RecoveryServicesDataReplication.PrivateEndpointConnectionProxyData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string vaultName, string privateEndpointConnectionProxyName) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + Azure.ResourceManager.RecoveryServicesDataReplication.PrivateEndpointConnectionProxyData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.PrivateEndpointConnectionProxyData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.RecoveryServicesDataReplication.PrivateEndpointConnectionProxyData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.RecoveryServicesDataReplication.PrivateEndpointConnectionProxyData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Validate(Azure.ResourceManager.RecoveryServicesDataReplication.PrivateEndpointConnectionProxyData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ValidateAsync(Azure.ResourceManager.RecoveryServicesDataReplication.PrivateEndpointConnectionProxyData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class ProtectedItemModelCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected ProtectedItemModelCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string protectedItemName, Azure.ResourceManager.RecoveryServicesDataReplication.ProtectedItemModelData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string protectedItemName, Azure.ResourceManager.RecoveryServicesDataReplication.ProtectedItemModelData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string protectedItemName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string protectedItemName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string protectedItemName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(string odataOptions = null, string continuationToken = null, int? pageSize = default(int?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(string odataOptions = null, string continuationToken = null, int? pageSize = default(int?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string protectedItemName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string protectedItemName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string protectedItemName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class ProtectedItemModelData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ProtectedItemModelData() { } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProtectedItemModelProperties Properties { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.ProtectedItemModelData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.ProtectedItemModelData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ProtectedItemModelResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected ProtectedItemModelResource() { } + public virtual Azure.ResourceManager.RecoveryServicesDataReplication.ProtectedItemModelData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string vaultName, string protectedItemName) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, bool? forceDelete = default(bool?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, bool? forceDelete = default(bool?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response GetRecoveryPointModel(string recoveryPointName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetRecoveryPointModelAsync(string recoveryPointName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.RecoveryServicesDataReplication.RecoveryPointModelCollection GetRecoveryPointModels() { throw null; } + public virtual Azure.ResourceManager.ArmOperation PlannedFailover(Azure.WaitUntil waitUntil, Azure.ResourceManager.RecoveryServicesDataReplication.Models.PlannedFailoverModel body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> PlannedFailoverAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.RecoveryServicesDataReplication.Models.PlannedFailoverModel body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + Azure.ResourceManager.RecoveryServicesDataReplication.ProtectedItemModelData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.ProtectedItemModelData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProtectedItemModelPatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProtectedItemModelPatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class RecoveryPointModelCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected RecoveryPointModelCollection() { } + public virtual Azure.Response Exists(string recoveryPointName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string recoveryPointName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string recoveryPointName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string recoveryPointName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string recoveryPointName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string recoveryPointName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class RecoveryPointModelData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal RecoveryPointModelData() { } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.RecoveryPointModelProperties Properties { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.RecoveryPointModelData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.RecoveryPointModelData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class RecoveryPointModelResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected RecoveryPointModelResource() { } + public virtual Azure.ResourceManager.RecoveryServicesDataReplication.RecoveryPointModelData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string vaultName, string protectedItemName, string recoveryPointName) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + Azure.ResourceManager.RecoveryServicesDataReplication.RecoveryPointModelData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.RecoveryPointModelData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public static partial class RecoveryServicesDataReplicationExtensions + { + public static Azure.ResourceManager.RecoveryServicesDataReplication.EmailConfigurationModelResource GetEmailConfigurationModelResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.EventModelResource GetEventModelResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.FabricAgentModelResource GetFabricAgentModelResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.Response GetFabricModel(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string fabricName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static System.Threading.Tasks.Task> GetFabricModelAsync(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string fabricName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.FabricModelResource GetFabricModelResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.FabricModelCollection GetFabricModels(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource) { throw null; } + public static Azure.Pageable GetFabricModels(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.AsyncPageable GetFabricModelsAsync(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.JobModelResource GetJobModelResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.Response GetOperationResult(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string operationId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static System.Threading.Tasks.Task> GetOperationResultAsync(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string operationId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.PolicyModelResource GetPolicyModelResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.PrivateEndpointConnectionProxyResource GetPrivateEndpointConnectionProxyResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.ProtectedItemModelResource GetProtectedItemModelResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.RecoveryPointModelResource GetRecoveryPointModelResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.RecoveryServicesDataReplicationPrivateEndpointConnectionResource GetRecoveryServicesDataReplicationPrivateEndpointConnectionResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.RecoveryServicesDataReplicationPrivateLinkResourceDataResource GetRecoveryServicesDataReplicationPrivateLinkResourceDataResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.ReplicationExtensionModelResource GetReplicationExtensionModelResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.Response GetVaultModel(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string vaultName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static System.Threading.Tasks.Task> GetVaultModelAsync(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string vaultName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.VaultModelResource GetVaultModelResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.VaultModelCollection GetVaultModels(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource) { throw null; } + public static Azure.Pageable GetVaultModels(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.AsyncPageable GetVaultModelsAsync(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.Response PostCheckNameAvailability(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, Azure.Core.AzureLocation location, Azure.ResourceManager.RecoveryServicesDataReplication.Models.CheckNameAvailabilityModel body = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static System.Threading.Tasks.Task> PostCheckNameAvailabilityAsync(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, Azure.Core.AzureLocation location, Azure.ResourceManager.RecoveryServicesDataReplication.Models.CheckNameAvailabilityModel body = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.Response PostDeploymentPreflight(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string deploymentId, Azure.ResourceManager.RecoveryServicesDataReplication.Models.DeploymentPreflightModel body = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static System.Threading.Tasks.Task> PostDeploymentPreflightAsync(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string deploymentId, Azure.ResourceManager.RecoveryServicesDataReplication.Models.DeploymentPreflightModel body = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class RecoveryServicesDataReplicationPrivateEndpointConnectionCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected RecoveryServicesDataReplicationPrivateEndpointConnectionCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string privateEndpointConnectionName, Azure.ResourceManager.RecoveryServicesDataReplication.RecoveryServicesDataReplicationPrivateEndpointConnectionData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string privateEndpointConnectionName, Azure.ResourceManager.RecoveryServicesDataReplication.RecoveryServicesDataReplicationPrivateEndpointConnectionData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string privateEndpointConnectionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string privateEndpointConnectionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string privateEndpointConnectionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string privateEndpointConnectionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string privateEndpointConnectionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string privateEndpointConnectionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class RecoveryServicesDataReplicationPrivateEndpointConnectionData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public RecoveryServicesDataReplicationPrivateEndpointConnectionData() { } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.PrivateEndpointConnectionResponseProperties Properties { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.RecoveryServicesDataReplicationPrivateEndpointConnectionData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.RecoveryServicesDataReplicationPrivateEndpointConnectionData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class RecoveryServicesDataReplicationPrivateEndpointConnectionResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected RecoveryServicesDataReplicationPrivateEndpointConnectionResource() { } + public virtual Azure.ResourceManager.RecoveryServicesDataReplication.RecoveryServicesDataReplicationPrivateEndpointConnectionData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string vaultName, string privateEndpointConnectionName) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + Azure.ResourceManager.RecoveryServicesDataReplication.RecoveryServicesDataReplicationPrivateEndpointConnectionData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.RecoveryServicesDataReplicationPrivateEndpointConnectionData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.RecoveryServicesDataReplication.RecoveryServicesDataReplicationPrivateEndpointConnectionData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.RecoveryServicesDataReplication.RecoveryServicesDataReplicationPrivateEndpointConnectionData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class RecoveryServicesDataReplicationPrivateLinkResourceDataCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected RecoveryServicesDataReplicationPrivateLinkResourceDataCollection() { } + public virtual Azure.Response Exists(string privateLinkResourceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string privateLinkResourceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string privateLinkResourceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string privateLinkResourceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string privateLinkResourceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string privateLinkResourceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class RecoveryServicesDataReplicationPrivateLinkResourceDataData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal RecoveryServicesDataReplicationPrivateLinkResourceDataData() { } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.RecoveryServicesDataReplicationPrivateLinkResourceProperties Properties { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.RecoveryServicesDataReplicationPrivateLinkResourceDataData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.RecoveryServicesDataReplicationPrivateLinkResourceDataData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class RecoveryServicesDataReplicationPrivateLinkResourceDataResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected RecoveryServicesDataReplicationPrivateLinkResourceDataResource() { } + public virtual Azure.ResourceManager.RecoveryServicesDataReplication.RecoveryServicesDataReplicationPrivateLinkResourceDataData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string vaultName, string privateLinkResourceName) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + Azure.ResourceManager.RecoveryServicesDataReplication.RecoveryServicesDataReplicationPrivateLinkResourceDataData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.RecoveryServicesDataReplicationPrivateLinkResourceDataData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ReplicationExtensionModelCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected ReplicationExtensionModelCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string replicationExtensionName, Azure.ResourceManager.RecoveryServicesDataReplication.ReplicationExtensionModelData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string replicationExtensionName, Azure.ResourceManager.RecoveryServicesDataReplication.ReplicationExtensionModelData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string replicationExtensionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string replicationExtensionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string replicationExtensionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string replicationExtensionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string replicationExtensionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string replicationExtensionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class ReplicationExtensionModelData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ReplicationExtensionModelData() { } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.ReplicationExtensionModelProperties Properties { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.ReplicationExtensionModelData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.ReplicationExtensionModelData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ReplicationExtensionModelResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected ReplicationExtensionModelResource() { } + public virtual Azure.ResourceManager.RecoveryServicesDataReplication.ReplicationExtensionModelData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string vaultName, string replicationExtensionName) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + Azure.ResourceManager.RecoveryServicesDataReplication.ReplicationExtensionModelData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.ReplicationExtensionModelData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.RecoveryServicesDataReplication.ReplicationExtensionModelData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.RecoveryServicesDataReplication.ReplicationExtensionModelData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class VaultModelCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected VaultModelCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string vaultName, Azure.ResourceManager.RecoveryServicesDataReplication.VaultModelData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string vaultName, Azure.ResourceManager.RecoveryServicesDataReplication.VaultModelData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string vaultName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string vaultName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string vaultName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(string continuationToken = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(string continuationToken = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string vaultName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string vaultName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string vaultName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class VaultModelData : Azure.ResourceManager.Models.TrackedResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public VaultModelData(Azure.Core.AzureLocation location) { } + public Azure.ResourceManager.Models.ManagedServiceIdentity Identity { get { throw null; } set { } } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.VaultModelProperties Properties { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.VaultModelData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.VaultModelData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class VaultModelResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected VaultModelResource() { } + public virtual Azure.ResourceManager.RecoveryServicesDataReplication.VaultModelData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public virtual Azure.Response AddTag(string key, string value, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> AddTagAsync(string key, string value, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string vaultName) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.RecoveryServicesDataReplication.RecoveryServicesDataReplicationPrivateLinkResourceDataCollection GetAllRecoveryServicesDataReplicationPrivateLinkResourceData() { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response GetEmailConfigurationModel(string emailConfigurationName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetEmailConfigurationModelAsync(string emailConfigurationName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.RecoveryServicesDataReplication.EmailConfigurationModelCollection GetEmailConfigurationModels() { throw null; } + public virtual Azure.Response GetEventModel(string eventName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetEventModelAsync(string eventName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.RecoveryServicesDataReplication.EventModelCollection GetEventModels() { throw null; } + public virtual Azure.Response GetJobModel(string jobName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetJobModelAsync(string jobName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.RecoveryServicesDataReplication.JobModelCollection GetJobModels() { throw null; } + public virtual Azure.Response GetPolicyModel(string policyName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetPolicyModelAsync(string policyName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.RecoveryServicesDataReplication.PolicyModelCollection GetPolicyModels() { throw null; } + public virtual Azure.ResourceManager.RecoveryServicesDataReplication.PrivateEndpointConnectionProxyCollection GetPrivateEndpointConnectionProxies() { throw null; } + public virtual Azure.Response GetPrivateEndpointConnectionProxy(string privateEndpointConnectionProxyName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetPrivateEndpointConnectionProxyAsync(string privateEndpointConnectionProxyName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response GetProtectedItemModel(string protectedItemName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetProtectedItemModelAsync(string protectedItemName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.RecoveryServicesDataReplication.ProtectedItemModelCollection GetProtectedItemModels() { throw null; } + public virtual Azure.Response GetRecoveryServicesDataReplicationPrivateEndpointConnection(string privateEndpointConnectionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetRecoveryServicesDataReplicationPrivateEndpointConnectionAsync(string privateEndpointConnectionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.RecoveryServicesDataReplication.RecoveryServicesDataReplicationPrivateEndpointConnectionCollection GetRecoveryServicesDataReplicationPrivateEndpointConnections() { throw null; } + public virtual Azure.Response GetRecoveryServicesDataReplicationPrivateLinkResourceData(string privateLinkResourceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetRecoveryServicesDataReplicationPrivateLinkResourceDataAsync(string privateLinkResourceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response GetReplicationExtensionModel(string replicationExtensionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetReplicationExtensionModelAsync(string replicationExtensionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.RecoveryServicesDataReplication.ReplicationExtensionModelCollection GetReplicationExtensionModels() { throw null; } + public virtual Azure.Response RemoveTag(string key, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> RemoveTagAsync(string key, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response SetTags(System.Collections.Generic.IDictionary tags, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> SetTagsAsync(System.Collections.Generic.IDictionary tags, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + Azure.ResourceManager.RecoveryServicesDataReplication.VaultModelData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.VaultModelData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.RecoveryServicesDataReplication.Models.VaultModelPatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.RecoveryServicesDataReplication.Models.VaultModelPatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } +} +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Mocking +{ + public partial class MockableRecoveryServicesDataReplicationArmClient : Azure.ResourceManager.ArmResource + { + protected MockableRecoveryServicesDataReplicationArmClient() { } + public virtual Azure.ResourceManager.RecoveryServicesDataReplication.EmailConfigurationModelResource GetEmailConfigurationModelResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.RecoveryServicesDataReplication.EventModelResource GetEventModelResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.RecoveryServicesDataReplication.FabricAgentModelResource GetFabricAgentModelResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.RecoveryServicesDataReplication.FabricModelResource GetFabricModelResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.RecoveryServicesDataReplication.JobModelResource GetJobModelResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.RecoveryServicesDataReplication.PolicyModelResource GetPolicyModelResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.RecoveryServicesDataReplication.PrivateEndpointConnectionProxyResource GetPrivateEndpointConnectionProxyResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.RecoveryServicesDataReplication.ProtectedItemModelResource GetProtectedItemModelResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.RecoveryServicesDataReplication.RecoveryPointModelResource GetRecoveryPointModelResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.RecoveryServicesDataReplication.RecoveryServicesDataReplicationPrivateEndpointConnectionResource GetRecoveryServicesDataReplicationPrivateEndpointConnectionResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.RecoveryServicesDataReplication.RecoveryServicesDataReplicationPrivateLinkResourceDataResource GetRecoveryServicesDataReplicationPrivateLinkResourceDataResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.RecoveryServicesDataReplication.ReplicationExtensionModelResource GetReplicationExtensionModelResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.RecoveryServicesDataReplication.VaultModelResource GetVaultModelResource(Azure.Core.ResourceIdentifier id) { throw null; } + } + public partial class MockableRecoveryServicesDataReplicationResourceGroupResource : Azure.ResourceManager.ArmResource + { + protected MockableRecoveryServicesDataReplicationResourceGroupResource() { } + public virtual Azure.Response GetFabricModel(string fabricName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetFabricModelAsync(string fabricName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.RecoveryServicesDataReplication.FabricModelCollection GetFabricModels() { throw null; } + public virtual Azure.Response GetOperationResult(string operationId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetOperationResultAsync(string operationId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response GetVaultModel(string vaultName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetVaultModelAsync(string vaultName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.RecoveryServicesDataReplication.VaultModelCollection GetVaultModels() { throw null; } + public virtual Azure.Response PostDeploymentPreflight(string deploymentId, Azure.ResourceManager.RecoveryServicesDataReplication.Models.DeploymentPreflightModel body = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> PostDeploymentPreflightAsync(string deploymentId, Azure.ResourceManager.RecoveryServicesDataReplication.Models.DeploymentPreflightModel body = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class MockableRecoveryServicesDataReplicationSubscriptionResource : Azure.ResourceManager.ArmResource + { + protected MockableRecoveryServicesDataReplicationSubscriptionResource() { } + public virtual Azure.Pageable GetFabricModels(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetFabricModelsAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetVaultModels(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetVaultModelsAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response PostCheckNameAvailability(Azure.Core.AzureLocation location, Azure.ResourceManager.RecoveryServicesDataReplication.Models.CheckNameAvailabilityModel body = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> PostCheckNameAvailabilityAsync(Azure.Core.AzureLocation location, Azure.ResourceManager.RecoveryServicesDataReplication.Models.CheckNameAvailabilityModel body = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } +} +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + public static partial class ArmRecoveryServicesDataReplicationModelFactory + { + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.AzStackHCIFabricModelCustomProperties AzStackHCIFabricModelCustomProperties(string azStackHciSiteId = null, System.Collections.Generic.IEnumerable applianceName = null, Azure.ResourceManager.RecoveryServicesDataReplication.Models.AzStackHCIClusterProperties cluster = null, string fabricResourceId = null, string fabricContainerId = null, string migrationSolutionId = null, string migrationHubUri = null) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.CheckNameAvailabilityResponseModel CheckNameAvailabilityResponseModel(bool? nameAvailable = default(bool?), string reason = null, string message = null) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.EmailConfigurationModelData EmailConfigurationModelData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.RecoveryServicesDataReplication.Models.EmailConfigurationModelProperties properties = null) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.EmailConfigurationModelProperties EmailConfigurationModelProperties(bool sendToOwners = false, System.Collections.Generic.IEnumerable customEmailAddresses = null, string locale = null, Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProvisioningState? provisioningState = default(Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProvisioningState?)) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.ErrorModel ErrorModel(string code = null, string type = null, string severity = null, System.DateTimeOffset? createdOn = default(System.DateTimeOffset?), string message = null, string causes = null, string recommendation = null) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.EventModelData EventModelData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.RecoveryServicesDataReplication.Models.EventModelProperties properties = null) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.EventModelProperties EventModelProperties(string resourceType = null, string resourceName = null, string eventType = null, string eventName = null, System.DateTimeOffset? timeOfOccurrence = default(System.DateTimeOffset?), string severity = null, string description = null, string correlationId = null, System.Collections.Generic.IEnumerable healthErrors = null, Azure.ResourceManager.RecoveryServicesDataReplication.Models.EventModelCustomProperties customProperties = null, Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProvisioningState? provisioningState = default(Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProvisioningState?)) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.FabricAgentModelData FabricAgentModelData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.RecoveryServicesDataReplication.Models.FabricAgentModelProperties properties = null) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.FabricAgentModelProperties FabricAgentModelProperties(string correlationId = null, string machineId = null, string machineName = null, Azure.ResourceManager.RecoveryServicesDataReplication.Models.IdentityModel authenticationIdentity = null, Azure.ResourceManager.RecoveryServicesDataReplication.Models.IdentityModel resourceAccessIdentity = null, bool? isResponsive = default(bool?), System.DateTimeOffset? lastHeartbeat = default(System.DateTimeOffset?), string versionNumber = null, Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProvisioningState? provisioningState = default(Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProvisioningState?), System.Collections.Generic.IEnumerable healthErrors = null, Azure.ResourceManager.RecoveryServicesDataReplication.Models.FabricAgentModelCustomProperties customProperties = null) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.FabricModelData FabricModelData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), Azure.ResourceManager.RecoveryServicesDataReplication.Models.FabricModelProperties properties = null) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.FabricModelPatch FabricModelPatch(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.ResourceManager.RecoveryServicesDataReplication.Models.FabricModelProperties properties = null) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.FabricModelProperties FabricModelProperties(Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProvisioningState? provisioningState = default(Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProvisioningState?), string serviceEndpoint = null, string serviceResourceId = null, Azure.ResourceManager.RecoveryServicesDataReplication.Models.HealthStatus? health = default(Azure.ResourceManager.RecoveryServicesDataReplication.Models.HealthStatus?), System.Collections.Generic.IEnumerable healthErrors = null, Azure.ResourceManager.RecoveryServicesDataReplication.Models.FabricModelCustomProperties customProperties = null) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.FailoverJobModelCustomProperties FailoverJobModelCustomProperties(Azure.ResourceManager.RecoveryServicesDataReplication.Models.JobModelCustomPropertiesAffectedObjectDetails affectedObjectDetails = null, System.Collections.Generic.IEnumerable protectedItemDetails = null) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.FailoverProtectedItemProperties FailoverProtectedItemProperties(string protectedItemName = null, string vmName = null, string testVmName = null, string recoveryPointId = null, System.DateTimeOffset? recoveryPointOn = default(System.DateTimeOffset?), string networkName = null, string subnet = null) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.HealthErrorModel HealthErrorModel(string affectedResourceType = null, System.Collections.Generic.IEnumerable affectedResourceCorrelationIds = null, System.Collections.Generic.IEnumerable childErrors = null, string code = null, string healthCategory = null, string category = null, string severity = null, string source = null, System.DateTimeOffset? createdOn = default(System.DateTimeOffset?), bool? isCustomerResolvable = default(bool?), string summary = null, string message = null, string causes = null, string recommendation = null) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.HyperVMigrateFabricModelCustomProperties HyperVMigrateFabricModelCustomProperties(string hyperVSiteId = null, string fabricResourceId = null, string fabricContainerId = null, string migrationSolutionId = null, string migrationHubUri = null) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.HyperVToAzStackHCIEventModelCustomProperties HyperVToAzStackHCIEventModelCustomProperties(string eventSourceFriendlyName = null, string protectedItemFriendlyName = null, string sourceApplianceName = null, string targetApplianceName = null, string serverType = null) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.HyperVToAzStackHCINicInput HyperVToAzStackHCINicInput(string nicId = null, string networkName = null, string targetNetworkId = null, string testNetworkId = null, Azure.ResourceManager.RecoveryServicesDataReplication.Models.VmNicSelection selectionTypeForFailover = default(Azure.ResourceManager.RecoveryServicesDataReplication.Models.VmNicSelection), bool? isStaticIPMigrationEnabled = default(bool?), bool? isMacMigrationEnabled = default(bool?)) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.HyperVToAzStackHCIProtectedDiskProperties HyperVToAzStackHCIProtectedDiskProperties(string storageContainerId = null, string storageContainerLocalPath = null, string sourceDiskId = null, string sourceDiskName = null, string seedDiskName = null, string testMigrateDiskName = null, string migrateDiskName = null, bool? isOSDisk = default(bool?), long? capacityInBytes = default(long?), bool? isDynamic = default(bool?), string diskType = null, long? diskBlockSize = default(long?), long? diskLogicalSectorSize = default(long?), long? diskPhysicalSectorSize = default(long?)) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.HyperVToAzStackHCIProtectedItemModelCustomProperties HyperVToAzStackHCIProtectedItemModelCustomProperties(Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProtectedItemActiveLocation? activeLocation = default(Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProtectedItemActiveLocation?), string targetHciClusterId = null, string targetArcClusterCustomLocationId = null, string targetAzStackHciClusterName = null, string fabricDiscoveryMachineId = null, System.Collections.Generic.IEnumerable disksToInclude = null, System.Collections.Generic.IEnumerable nicsToInclude = null, string sourceVmName = null, int? sourceCpuCores = default(int?), double? sourceMemoryInMegaBytes = default(double?), string targetVmName = null, string targetResourceGroupId = null, string storageContainerId = null, string hyperVGeneration = null, string targetNetworkId = null, string testNetworkId = null, int? targetCpuCores = default(int?), bool? isDynamicRam = default(bool?), Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProtectedItemDynamicMemoryConfig dynamicMemoryConfig = null, int? targetMemoryInMegaBytes = default(int?), string runAsAccountId = null, string sourceFabricAgentName = null, string targetFabricAgentName = null, string sourceApplianceName = null, string targetApplianceName = null, string osType = null, string osName = null, string firmwareType = null, string targetLocation = null, string customLocationRegion = null, string failoverRecoveryPointId = null, System.DateTimeOffset? lastRecoveryPointReceived = default(System.DateTimeOffset?), string lastRecoveryPointId = null, int? initialReplicationProgressPercentage = default(int?), int? resyncProgressPercentage = default(int?), System.Collections.Generic.IEnumerable protectedDisks = null, System.Collections.Generic.IEnumerable protectedNics = null, string targetVmBiosId = null, System.DateTimeOffset? lastReplicationUpdateOn = default(System.DateTimeOffset?)) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.HyperVToAzStackHCIProtectedNicProperties HyperVToAzStackHCIProtectedNicProperties(string nicId = null, string macAddress = null, string networkName = null, string targetNetworkId = null, string testNetworkId = null, Azure.ResourceManager.RecoveryServicesDataReplication.Models.VmNicSelection? selectionTypeForFailover = default(Azure.ResourceManager.RecoveryServicesDataReplication.Models.VmNicSelection?)) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.HyperVToAzStackHCIRecoveryPointModelCustomProperties HyperVToAzStackHCIRecoveryPointModelCustomProperties(System.Collections.Generic.IEnumerable diskIds = null) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.HyperVToAzStackHCIReplicationExtensionModelCustomProperties HyperVToAzStackHCIReplicationExtensionModelCustomProperties(string hyperVFabricArmId = null, string hyperVSiteId = null, string azStackHciFabricArmId = null, string azStackHciSiteId = null, string storageAccountId = null, string storageAccountSasSecretName = null, string asrServiceUri = null, string rcmServiceUri = null, string gatewayServiceUri = null, string sourceGatewayServiceId = null, string targetGatewayServiceId = null, string sourceStorageContainerName = null, string targetStorageContainerName = null, string resourceLocation = null, string subscriptionId = null, string resourceGroup = null) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.InnerHealthErrorModel InnerHealthErrorModel(string code = null, string healthCategory = null, string category = null, string severity = null, string source = null, System.DateTimeOffset? createdOn = default(System.DateTimeOffset?), bool? isCustomerResolvable = default(bool?), string summary = null, string message = null, string causes = null, string recommendation = null) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.JobModelCustomProperties JobModelCustomProperties(string instanceType = null, Azure.ResourceManager.RecoveryServicesDataReplication.Models.JobModelCustomPropertiesAffectedObjectDetails affectedObjectDetails = null) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.JobModelCustomPropertiesAffectedObjectDetails JobModelCustomPropertiesAffectedObjectDetails(string description = null, Azure.ResourceManager.RecoveryServicesDataReplication.Models.JobModelCustomPropertiesAffectedObjectDetailsType? type = default(Azure.ResourceManager.RecoveryServicesDataReplication.Models.JobModelCustomPropertiesAffectedObjectDetailsType?)) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.JobModelData JobModelData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.RecoveryServicesDataReplication.Models.JobModelProperties properties = null) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.JobModelProperties JobModelProperties(string displayName = null, Azure.ResourceManager.RecoveryServicesDataReplication.Models.JobState? state = default(Azure.ResourceManager.RecoveryServicesDataReplication.Models.JobState?), System.DateTimeOffset? startOn = default(System.DateTimeOffset?), System.DateTimeOffset? endOn = default(System.DateTimeOffset?), string objectId = null, string objectName = null, string objectInternalId = null, string objectInternalName = null, Azure.ResourceManager.RecoveryServicesDataReplication.Models.JobObjectType? objectType = default(Azure.ResourceManager.RecoveryServicesDataReplication.Models.JobObjectType?), string replicationProviderId = null, string sourceFabricProviderId = null, string targetFabricProviderId = null, System.Collections.Generic.IEnumerable allowedActions = null, string activityId = null, System.Collections.Generic.IEnumerable tasks = null, System.Collections.Generic.IEnumerable errors = null, Azure.ResourceManager.RecoveryServicesDataReplication.Models.JobModelCustomProperties customProperties = null, Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProvisioningState? provisioningState = default(Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProvisioningState?)) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.OperationStatus OperationStatus(string id = null, string name = null, string status = null, string startTime = null, string endTime = null) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.PolicyModelData PolicyModelData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.RecoveryServicesDataReplication.Models.PolicyModelProperties properties = null) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.PolicyModelProperties PolicyModelProperties(Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProvisioningState? provisioningState = default(Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProvisioningState?), Azure.ResourceManager.RecoveryServicesDataReplication.Models.PolicyModelCustomProperties customProperties = null) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.PrivateEndpointConnectionProxyData PrivateEndpointConnectionProxyData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.RecoveryServicesDataReplication.Models.PrivateEndpointConnectionProxyProperties properties = null, string etag = null) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.PrivateEndpointConnectionProxyProperties PrivateEndpointConnectionProxyProperties(Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProvisioningState? provisioningState = default(Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProvisioningState?), Azure.ResourceManager.RecoveryServicesDataReplication.Models.RemotePrivateEndpoint remotePrivateEndpoint = null) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.PrivateEndpointConnectionResponseProperties PrivateEndpointConnectionResponseProperties(Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProvisioningState? provisioningState = default(Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProvisioningState?), Azure.Core.ResourceIdentifier privateEndpointId = null, Azure.ResourceManager.RecoveryServicesDataReplication.Models.RecoveryServicesDataReplicationPrivateLinkServiceConnectionState privateLinkServiceConnectionState = null) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProtectedItemJobProperties ProtectedItemJobProperties(string scenarioName = null, string id = null, string name = null, string displayName = null, string state = null, System.DateTimeOffset? startOn = default(System.DateTimeOffset?), System.DateTimeOffset? endOn = default(System.DateTimeOffset?)) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.ProtectedItemModelData ProtectedItemModelData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProtectedItemModelProperties properties = null) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProtectedItemModelPatch ProtectedItemModelPatch(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProtectedItemModelCustomPropertiesUpdate customProperties = null) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProtectedItemModelProperties ProtectedItemModelProperties(string policyName = null, string replicationExtensionName = null, string correlationId = null, Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProvisioningState? provisioningState = default(Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProvisioningState?), Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProtectionState? protectionState = default(Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProtectionState?), string protectionStateDescription = null, Azure.ResourceManager.RecoveryServicesDataReplication.Models.TestFailoverState? testFailoverState = default(Azure.ResourceManager.RecoveryServicesDataReplication.Models.TestFailoverState?), string testFailoverStateDescription = null, Azure.ResourceManager.RecoveryServicesDataReplication.Models.ResynchronizationState? resynchronizationState = default(Azure.ResourceManager.RecoveryServicesDataReplication.Models.ResynchronizationState?), string fabricObjectId = null, string fabricObjectName = null, string sourceFabricProviderId = null, string targetFabricProviderId = null, string fabricId = null, string targetFabricId = null, string fabricAgentId = null, string targetFabricAgentId = null, bool? resyncRequired = default(bool?), System.DateTimeOffset? lastSuccessfulPlannedFailoverOn = default(System.DateTimeOffset?), System.DateTimeOffset? lastSuccessfulUnplannedFailoverOn = default(System.DateTimeOffset?), System.DateTimeOffset? lastSuccessfulTestFailoverOn = default(System.DateTimeOffset?), Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProtectedItemJobProperties currentJob = null, System.Collections.Generic.IEnumerable allowedJobs = null, Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProtectedItemJobProperties lastFailedEnableProtectionJob = null, Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProtectedItemJobProperties lastFailedPlannedFailoverJob = null, Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProtectedItemJobProperties lastTestFailoverJob = null, Azure.ResourceManager.RecoveryServicesDataReplication.Models.HealthStatus? replicationHealth = default(Azure.ResourceManager.RecoveryServicesDataReplication.Models.HealthStatus?), System.Collections.Generic.IEnumerable healthErrors = null, Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProtectedItemModelCustomProperties customProperties = null) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.RecoveryPointModelData RecoveryPointModelData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.RecoveryServicesDataReplication.Models.RecoveryPointModelProperties properties = null) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.RecoveryPointModelProperties RecoveryPointModelProperties(System.DateTimeOffset recoveryPointOn = default(System.DateTimeOffset), Azure.ResourceManager.RecoveryServicesDataReplication.Models.RecoveryPointType recoveryPointType = default(Azure.ResourceManager.RecoveryServicesDataReplication.Models.RecoveryPointType), Azure.ResourceManager.RecoveryServicesDataReplication.Models.RecoveryPointModelCustomProperties customProperties = null, Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProvisioningState? provisioningState = default(Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProvisioningState?)) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.RecoveryServicesDataReplicationPrivateEndpointConnectionData RecoveryServicesDataReplicationPrivateEndpointConnectionData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.RecoveryServicesDataReplication.Models.PrivateEndpointConnectionResponseProperties properties = null) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.RecoveryServicesDataReplicationPrivateLinkResourceDataData RecoveryServicesDataReplicationPrivateLinkResourceDataData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.RecoveryServicesDataReplication.Models.RecoveryServicesDataReplicationPrivateLinkResourceProperties properties = null) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.RecoveryServicesDataReplicationPrivateLinkResourceProperties RecoveryServicesDataReplicationPrivateLinkResourceProperties(string groupId = null, System.Collections.Generic.IEnumerable requiredMembers = null, System.Collections.Generic.IEnumerable requiredZoneNames = null, Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProvisioningState? provisioningState = default(Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProvisioningState?)) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.ReplicationExtensionModelData ReplicationExtensionModelData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.RecoveryServicesDataReplication.Models.ReplicationExtensionModelProperties properties = null) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.ReplicationExtensionModelProperties ReplicationExtensionModelProperties(Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProvisioningState? provisioningState = default(Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProvisioningState?), Azure.ResourceManager.RecoveryServicesDataReplication.Models.ReplicationExtensionModelCustomProperties customProperties = null) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.TaskModel TaskModel(string taskName = null, Azure.ResourceManager.RecoveryServicesDataReplication.Models.TaskState? state = default(Azure.ResourceManager.RecoveryServicesDataReplication.Models.TaskState?), System.DateTimeOffset? startOn = default(System.DateTimeOffset?), System.DateTimeOffset? endOn = default(System.DateTimeOffset?), string customInstanceType = null, System.Collections.Generic.IEnumerable childrenJobs = null) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.TestFailoverCleanupJobModelCustomProperties TestFailoverCleanupJobModelCustomProperties(Azure.ResourceManager.RecoveryServicesDataReplication.Models.JobModelCustomPropertiesAffectedObjectDetails affectedObjectDetails = null, string comments = null) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.TestFailoverJobModelCustomProperties TestFailoverJobModelCustomProperties(Azure.ResourceManager.RecoveryServicesDataReplication.Models.JobModelCustomPropertiesAffectedObjectDetails affectedObjectDetails = null, System.Collections.Generic.IEnumerable protectedItemDetails = null) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.VaultModelData VaultModelData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), Azure.ResourceManager.RecoveryServicesDataReplication.Models.VaultModelProperties properties = null, Azure.ResourceManager.Models.ManagedServiceIdentity identity = null) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.VaultModelPatch VaultModelPatch(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.ResourceManager.RecoveryServicesDataReplication.Models.VaultModelProperties properties = null, Azure.ResourceManager.Models.ManagedServiceIdentity identity = null) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.VaultModelProperties VaultModelProperties(Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProvisioningState? provisioningState = default(Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProvisioningState?), string serviceResourceId = null, Azure.ResourceManager.RecoveryServicesDataReplication.Models.ReplicationVaultType? vaultType = default(Azure.ResourceManager.RecoveryServicesDataReplication.Models.ReplicationVaultType?)) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.VMwareToAzStackHCIEventModelCustomProperties VMwareToAzStackHCIEventModelCustomProperties(string eventSourceFriendlyName = null, string protectedItemFriendlyName = null, string sourceApplianceName = null, string targetApplianceName = null, string serverType = null) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.VMwareToAzStackHCINicInput VMwareToAzStackHCINicInput(string nicId = null, string label = null, string networkName = null, string targetNetworkId = null, string testNetworkId = null, Azure.ResourceManager.RecoveryServicesDataReplication.Models.VmNicSelection selectionTypeForFailover = default(Azure.ResourceManager.RecoveryServicesDataReplication.Models.VmNicSelection), bool? isStaticIPMigrationEnabled = default(bool?), bool? isMacMigrationEnabled = default(bool?)) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.VMwareToAzStackHCIProtectedDiskProperties VMwareToAzStackHCIProtectedDiskProperties(string storageContainerId = null, string storageContainerLocalPath = null, string sourceDiskId = null, string sourceDiskName = null, string seedDiskName = null, string testMigrateDiskName = null, string migrateDiskName = null, bool? isOSDisk = default(bool?), long? capacityInBytes = default(long?), bool? isDynamic = default(bool?), string diskType = null, long? diskBlockSize = default(long?), long? diskLogicalSectorSize = default(long?), long? diskPhysicalSectorSize = default(long?)) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.VMwareToAzStackHCIProtectedItemModelCustomProperties VMwareToAzStackHCIProtectedItemModelCustomProperties(Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProtectedItemActiveLocation? activeLocation = default(Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProtectedItemActiveLocation?), string targetHciClusterId = null, string targetArcClusterCustomLocationId = null, string targetAzStackHciClusterName = null, string storageContainerId = null, string targetResourceGroupId = null, string targetLocation = null, string customLocationRegion = null, System.Collections.Generic.IEnumerable disksToInclude = null, System.Collections.Generic.IEnumerable nicsToInclude = null, System.Collections.Generic.IEnumerable protectedDisks = null, System.Collections.Generic.IEnumerable protectedNics = null, string targetVmBiosId = null, string targetVmName = null, string hyperVGeneration = null, string targetNetworkId = null, string testNetworkId = null, int? targetCpuCores = default(int?), bool? isDynamicRam = default(bool?), Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProtectedItemDynamicMemoryConfig dynamicMemoryConfig = null, int? targetMemoryInMegaBytes = default(int?), string osType = null, string osName = null, string firmwareType = null, string fabricDiscoveryMachineId = null, string sourceVmName = null, int? sourceCpuCores = default(int?), double? sourceMemoryInMegaBytes = default(double?), string runAsAccountId = null, string sourceFabricAgentName = null, string targetFabricAgentName = null, string sourceApplianceName = null, string targetApplianceName = null, string failoverRecoveryPointId = null, System.DateTimeOffset? lastRecoveryPointReceived = default(System.DateTimeOffset?), string lastRecoveryPointId = null, int? initialReplicationProgressPercentage = default(int?), int? migrationProgressPercentage = default(int?), int? resumeProgressPercentage = default(int?), int? resyncProgressPercentage = default(int?), long? resyncRetryCount = default(long?), bool? resyncRequired = default(bool?), Azure.ResourceManager.RecoveryServicesDataReplication.Models.VMwareToAzureMigrateResyncState? resyncState = default(Azure.ResourceManager.RecoveryServicesDataReplication.Models.VMwareToAzureMigrateResyncState?), bool? performAutoResync = default(bool?), long? resumeRetryCount = default(long?), System.DateTimeOffset? lastReplicationUpdateOn = default(System.DateTimeOffset?)) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.VMwareToAzStackHCIProtectedNicProperties VMwareToAzStackHCIProtectedNicProperties(string nicId = null, string macAddress = null, string label = null, bool? isPrimaryNic = default(bool?), string networkName = null, string targetNetworkId = null, string testNetworkId = null, Azure.ResourceManager.RecoveryServicesDataReplication.Models.VmNicSelection? selectionTypeForFailover = default(Azure.ResourceManager.RecoveryServicesDataReplication.Models.VmNicSelection?)) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.VMwareToAzStackHCIRecoveryPointModelCustomProperties VMwareToAzStackHCIRecoveryPointModelCustomProperties(System.Collections.Generic.IEnumerable diskIds = null) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.VMwareToAzStackHCIReplicationExtensionModelCustomProperties VMwareToAzStackHCIReplicationExtensionModelCustomProperties(string vmwareFabricArmId = null, string vmwareSiteId = null, string azStackHciFabricArmId = null, string azStackHciSiteId = null, string storageAccountId = null, string storageAccountSasSecretName = null, string asrServiceUri = null, string rcmServiceUri = null, string gatewayServiceUri = null, string sourceGatewayServiceId = null, string targetGatewayServiceId = null, string sourceStorageContainerName = null, string targetStorageContainerName = null, string resourceLocation = null, string subscriptionId = null, string resourceGroup = null) { throw null; } + } + public partial class AzStackHCIClusterProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public AzStackHCIClusterProperties(string clusterName, string resourceName, string storageAccountName, System.Collections.Generic.IEnumerable storageContainers) { } + public string ClusterName { get { throw null; } set { } } + public string ResourceName { get { throw null; } set { } } + public string StorageAccountName { get { throw null; } set { } } + public System.Collections.Generic.IList StorageContainers { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.AzStackHCIClusterProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.AzStackHCIClusterProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class AzStackHCIFabricModelCustomProperties : Azure.ResourceManager.RecoveryServicesDataReplication.Models.FabricModelCustomProperties, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public AzStackHCIFabricModelCustomProperties(string azStackHciSiteId, Azure.ResourceManager.RecoveryServicesDataReplication.Models.AzStackHCIClusterProperties cluster, string migrationSolutionId) { } + public System.Collections.Generic.IReadOnlyList ApplianceName { get { throw null; } } + public string AzStackHciSiteId { get { throw null; } set { } } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.AzStackHCIClusterProperties Cluster { get { throw null; } set { } } + public string FabricContainerId { get { throw null; } } + public string FabricResourceId { get { throw null; } } + public string MigrationHubUri { get { throw null; } } + public string MigrationSolutionId { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.AzStackHCIFabricModelCustomProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.AzStackHCIFabricModelCustomProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class CheckNameAvailabilityModel : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public CheckNameAvailabilityModel() { } + public string Name { get { throw null; } set { } } + public string Type { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.CheckNameAvailabilityModel System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.CheckNameAvailabilityModel System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class CheckNameAvailabilityResponseModel : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal CheckNameAvailabilityResponseModel() { } + public string Message { get { throw null; } } + public bool? NameAvailable { get { throw null; } } + public string Reason { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.CheckNameAvailabilityResponseModel System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.CheckNameAvailabilityResponseModel System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ConnectionDetails : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ConnectionDetails() { } + public string GroupId { get { throw null; } set { } } + public string Id { get { throw null; } set { } } + public string LinkIdentifier { get { throw null; } set { } } + public string MemberName { get { throw null; } set { } } + public string PrivateIPAddress { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.ConnectionDetails System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.ConnectionDetails System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DeploymentPreflightModel : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DeploymentPreflightModel() { } + public System.Collections.Generic.IList Resources { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.DeploymentPreflightModel System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.DeploymentPreflightModel System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DeploymentPreflightResource : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DeploymentPreflightResource() { } + public string ApiVersion { get { throw null; } set { } } + public string Location { get { throw null; } set { } } + public string Name { get { throw null; } set { } } + public System.BinaryData Properties { get { throw null; } set { } } + public string Type { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.DeploymentPreflightResource System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.DeploymentPreflightResource System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DiskControllerInputs : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DiskControllerInputs(string controllerName, int controllerId, int controllerLocation) { } + public int ControllerId { get { throw null; } set { } } + public int ControllerLocation { get { throw null; } set { } } + public string ControllerName { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.DiskControllerInputs System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.DiskControllerInputs System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class EmailConfigurationModelProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public EmailConfigurationModelProperties(bool sendToOwners) { } + public System.Collections.Generic.IList CustomEmailAddresses { get { throw null; } } + public string Locale { get { throw null; } set { } } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProvisioningState? ProvisioningState { get { throw null; } } + public bool SendToOwners { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.EmailConfigurationModelProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.EmailConfigurationModelProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ErrorModel : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal ErrorModel() { } + public string Causes { get { throw null; } } + public string Code { get { throw null; } } + public System.DateTimeOffset? CreatedOn { get { throw null; } } + public string Message { get { throw null; } } + public string Recommendation { get { throw null; } } + public string Severity { get { throw null; } } + public string Type { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.ErrorModel System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.ErrorModel System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public abstract partial class EventModelCustomProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + protected EventModelCustomProperties() { } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.EventModelCustomProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.EventModelCustomProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class EventModelProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal EventModelProperties() { } + public string CorrelationId { get { throw null; } } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.EventModelCustomProperties CustomProperties { get { throw null; } } + public string Description { get { throw null; } } + public string EventName { get { throw null; } } + public string EventType { get { throw null; } } + public System.Collections.Generic.IReadOnlyList HealthErrors { get { throw null; } } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProvisioningState? ProvisioningState { get { throw null; } } + public string ResourceName { get { throw null; } } + public string ResourceType { get { throw null; } } + public string Severity { get { throw null; } } + public System.DateTimeOffset? TimeOfOccurrence { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.EventModelProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.EventModelProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public abstract partial class FabricAgentModelCustomProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + protected FabricAgentModelCustomProperties() { } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.FabricAgentModelCustomProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.FabricAgentModelCustomProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class FabricAgentModelProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public FabricAgentModelProperties(string machineId, string machineName, Azure.ResourceManager.RecoveryServicesDataReplication.Models.IdentityModel authenticationIdentity, Azure.ResourceManager.RecoveryServicesDataReplication.Models.IdentityModel resourceAccessIdentity, Azure.ResourceManager.RecoveryServicesDataReplication.Models.FabricAgentModelCustomProperties customProperties) { } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.IdentityModel AuthenticationIdentity { get { throw null; } set { } } + public string CorrelationId { get { throw null; } } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.FabricAgentModelCustomProperties CustomProperties { get { throw null; } set { } } + public System.Collections.Generic.IReadOnlyList HealthErrors { get { throw null; } } + public bool? IsResponsive { get { throw null; } } + public System.DateTimeOffset? LastHeartbeat { get { throw null; } } + public string MachineId { get { throw null; } set { } } + public string MachineName { get { throw null; } set { } } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProvisioningState? ProvisioningState { get { throw null; } } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.IdentityModel ResourceAccessIdentity { get { throw null; } set { } } + public string VersionNumber { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.FabricAgentModelProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.FabricAgentModelProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public abstract partial class FabricModelCustomProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + protected FabricModelCustomProperties() { } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.FabricModelCustomProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.FabricModelCustomProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class FabricModelPatch : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public FabricModelPatch() { } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.FabricModelProperties Properties { get { throw null; } set { } } + public System.Collections.Generic.IDictionary Tags { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.FabricModelPatch System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.FabricModelPatch System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class FabricModelProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public FabricModelProperties(Azure.ResourceManager.RecoveryServicesDataReplication.Models.FabricModelCustomProperties customProperties) { } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.FabricModelCustomProperties CustomProperties { get { throw null; } set { } } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.HealthStatus? Health { get { throw null; } } + public System.Collections.Generic.IReadOnlyList HealthErrors { get { throw null; } } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProvisioningState? ProvisioningState { get { throw null; } } + public string ServiceEndpoint { get { throw null; } } + public string ServiceResourceId { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.FabricModelProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.FabricModelProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class FailoverJobModelCustomProperties : Azure.ResourceManager.RecoveryServicesDataReplication.Models.JobModelCustomProperties, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal FailoverJobModelCustomProperties() { } + public System.Collections.Generic.IReadOnlyList ProtectedItemDetails { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.FailoverJobModelCustomProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.FailoverJobModelCustomProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class FailoverProtectedItemProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal FailoverProtectedItemProperties() { } + public string NetworkName { get { throw null; } } + public string ProtectedItemName { get { throw null; } } + public string RecoveryPointId { get { throw null; } } + public System.DateTimeOffset? RecoveryPointOn { get { throw null; } } + public string Subnet { get { throw null; } } + public string TestVmName { get { throw null; } } + public string VmName { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.FailoverProtectedItemProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.FailoverProtectedItemProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class GroupConnectivityInformation : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public GroupConnectivityInformation() { } + public System.Collections.Generic.IList CustomerVisibleFqdns { get { throw null; } } + public string GroupId { get { throw null; } set { } } + public string InternalFqdn { get { throw null; } set { } } + public string MemberName { get { throw null; } set { } } + public string PrivateLinkServiceArmRegion { get { throw null; } set { } } + public string RedirectMapId { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.GroupConnectivityInformation System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.GroupConnectivityInformation System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class HealthErrorModel : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal HealthErrorModel() { } + public System.Collections.Generic.IReadOnlyList AffectedResourceCorrelationIds { get { throw null; } } + public string AffectedResourceType { get { throw null; } } + public string Category { get { throw null; } } + public string Causes { get { throw null; } } + public System.Collections.Generic.IReadOnlyList ChildErrors { get { throw null; } } + public string Code { get { throw null; } } + public System.DateTimeOffset? CreatedOn { get { throw null; } } + public string HealthCategory { get { throw null; } } + public bool? IsCustomerResolvable { get { throw null; } } + public string Message { get { throw null; } } + public string Recommendation { get { throw null; } } + public string Severity { get { throw null; } } + public string Source { get { throw null; } } + public string Summary { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.HealthErrorModel System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.HealthErrorModel System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct HealthStatus : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public HealthStatus(string value) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.HealthStatus Critical { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.HealthStatus Normal { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.HealthStatus Warning { get { throw null; } } + public bool Equals(Azure.ResourceManager.RecoveryServicesDataReplication.Models.HealthStatus other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.RecoveryServicesDataReplication.Models.HealthStatus left, Azure.ResourceManager.RecoveryServicesDataReplication.Models.HealthStatus right) { throw null; } + public static implicit operator Azure.ResourceManager.RecoveryServicesDataReplication.Models.HealthStatus (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.RecoveryServicesDataReplication.Models.HealthStatus left, Azure.ResourceManager.RecoveryServicesDataReplication.Models.HealthStatus right) { throw null; } + public override string ToString() { throw null; } + } + public partial class HyperVMigrateFabricModelCustomProperties : Azure.ResourceManager.RecoveryServicesDataReplication.Models.FabricModelCustomProperties, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public HyperVMigrateFabricModelCustomProperties(string hyperVSiteId, string migrationSolutionId) { } + public string FabricContainerId { get { throw null; } } + public string FabricResourceId { get { throw null; } } + public string HyperVSiteId { get { throw null; } set { } } + public string MigrationHubUri { get { throw null; } } + public string MigrationSolutionId { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.HyperVMigrateFabricModelCustomProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.HyperVMigrateFabricModelCustomProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class HyperVToAzStackHCIDiskInput : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public HyperVToAzStackHCIDiskInput(string diskId, long diskSizeGB, string diskFileFormat, bool isOSDisk) { } + public long? DiskBlockSize { get { throw null; } set { } } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.DiskControllerInputs DiskController { get { throw null; } set { } } + public string DiskFileFormat { get { throw null; } set { } } + public string DiskId { get { throw null; } set { } } + public string DiskIdentifier { get { throw null; } set { } } + public long? DiskLogicalSectorSize { get { throw null; } set { } } + public long? DiskPhysicalSectorSize { get { throw null; } set { } } + public long DiskSizeGB { get { throw null; } set { } } + public bool? IsDynamic { get { throw null; } set { } } + public bool IsOSDisk { get { throw null; } set { } } + public string StorageContainerId { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.HyperVToAzStackHCIDiskInput System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.HyperVToAzStackHCIDiskInput System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class HyperVToAzStackHCIEventModelCustomProperties : Azure.ResourceManager.RecoveryServicesDataReplication.Models.EventModelCustomProperties, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal HyperVToAzStackHCIEventModelCustomProperties() { } + public string EventSourceFriendlyName { get { throw null; } } + public string ProtectedItemFriendlyName { get { throw null; } } + public string ServerType { get { throw null; } } + public string SourceApplianceName { get { throw null; } } + public string TargetApplianceName { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.HyperVToAzStackHCIEventModelCustomProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.HyperVToAzStackHCIEventModelCustomProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class HyperVToAzStackHCINicInput : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public HyperVToAzStackHCINicInput(string nicId, Azure.ResourceManager.RecoveryServicesDataReplication.Models.VmNicSelection selectionTypeForFailover) { } + public bool? IsMacMigrationEnabled { get { throw null; } set { } } + public bool? IsStaticIPMigrationEnabled { get { throw null; } set { } } + public string NetworkName { get { throw null; } } + public string NicId { get { throw null; } set { } } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.VmNicSelection SelectionTypeForFailover { get { throw null; } set { } } + public string TargetNetworkId { get { throw null; } set { } } + public string TestNetworkId { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.HyperVToAzStackHCINicInput System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.HyperVToAzStackHCINicInput System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class HyperVToAzStackHCIPlannedFailoverModelCustomProperties : Azure.ResourceManager.RecoveryServicesDataReplication.Models.PlannedFailoverModelCustomProperties, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public HyperVToAzStackHCIPlannedFailoverModelCustomProperties(bool shutdownSourceVm) { } + public bool ShutdownSourceVm { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.HyperVToAzStackHCIPlannedFailoverModelCustomProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.HyperVToAzStackHCIPlannedFailoverModelCustomProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class HyperVToAzStackHCIPolicyModelCustomProperties : Azure.ResourceManager.RecoveryServicesDataReplication.Models.PolicyModelCustomProperties, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public HyperVToAzStackHCIPolicyModelCustomProperties(int recoveryPointHistoryInMinutes, int crashConsistentFrequencyInMinutes, int appConsistentFrequencyInMinutes) { } + public int AppConsistentFrequencyInMinutes { get { throw null; } set { } } + public int CrashConsistentFrequencyInMinutes { get { throw null; } set { } } + public int RecoveryPointHistoryInMinutes { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.HyperVToAzStackHCIPolicyModelCustomProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.HyperVToAzStackHCIPolicyModelCustomProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class HyperVToAzStackHCIProtectedDiskProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal HyperVToAzStackHCIProtectedDiskProperties() { } + public long? CapacityInBytes { get { throw null; } } + public long? DiskBlockSize { get { throw null; } } + public long? DiskLogicalSectorSize { get { throw null; } } + public long? DiskPhysicalSectorSize { get { throw null; } } + public string DiskType { get { throw null; } } + public bool? IsDynamic { get { throw null; } } + public bool? IsOSDisk { get { throw null; } } + public string MigrateDiskName { get { throw null; } } + public string SeedDiskName { get { throw null; } } + public string SourceDiskId { get { throw null; } } + public string SourceDiskName { get { throw null; } } + public string StorageContainerId { get { throw null; } } + public string StorageContainerLocalPath { get { throw null; } } + public string TestMigrateDiskName { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.HyperVToAzStackHCIProtectedDiskProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.HyperVToAzStackHCIProtectedDiskProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class HyperVToAzStackHCIProtectedItemModelCustomProperties : Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProtectedItemModelCustomProperties, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public HyperVToAzStackHCIProtectedItemModelCustomProperties(string targetHciClusterId, string targetArcClusterCustomLocationId, string fabricDiscoveryMachineId, System.Collections.Generic.IEnumerable disksToInclude, System.Collections.Generic.IEnumerable nicsToInclude, string targetResourceGroupId, string storageContainerId, string hyperVGeneration, string runAsAccountId, string sourceFabricAgentName, string targetFabricAgentName, string customLocationRegion) { } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProtectedItemActiveLocation? ActiveLocation { get { throw null; } } + public string CustomLocationRegion { get { throw null; } set { } } + public System.Collections.Generic.IList DisksToInclude { get { throw null; } } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProtectedItemDynamicMemoryConfig DynamicMemoryConfig { get { throw null; } set { } } + public string FabricDiscoveryMachineId { get { throw null; } set { } } + public string FailoverRecoveryPointId { get { throw null; } } + public string FirmwareType { get { throw null; } } + public string HyperVGeneration { get { throw null; } set { } } + public int? InitialReplicationProgressPercentage { get { throw null; } } + public bool? IsDynamicRam { get { throw null; } set { } } + public string LastRecoveryPointId { get { throw null; } } + public System.DateTimeOffset? LastRecoveryPointReceived { get { throw null; } } + public System.DateTimeOffset? LastReplicationUpdateOn { get { throw null; } } + public System.Collections.Generic.IList NicsToInclude { get { throw null; } } + public string OSName { get { throw null; } } + public string OSType { get { throw null; } } + public System.Collections.Generic.IReadOnlyList ProtectedDisks { get { throw null; } } + public System.Collections.Generic.IReadOnlyList ProtectedNics { get { throw null; } } + public int? ResyncProgressPercentage { get { throw null; } } + public string RunAsAccountId { get { throw null; } set { } } + public string SourceApplianceName { get { throw null; } } + public int? SourceCpuCores { get { throw null; } } + public string SourceFabricAgentName { get { throw null; } set { } } + public double? SourceMemoryInMegaBytes { get { throw null; } } + public string SourceVmName { get { throw null; } } + public string StorageContainerId { get { throw null; } set { } } + public string TargetApplianceName { get { throw null; } } + public string TargetArcClusterCustomLocationId { get { throw null; } set { } } + public string TargetAzStackHciClusterName { get { throw null; } } + public int? TargetCpuCores { get { throw null; } set { } } + public string TargetFabricAgentName { get { throw null; } set { } } + public string TargetHciClusterId { get { throw null; } set { } } + public string TargetLocation { get { throw null; } } + public int? TargetMemoryInMegaBytes { get { throw null; } set { } } + public string TargetNetworkId { get { throw null; } set { } } + public string TargetResourceGroupId { get { throw null; } set { } } + public string TargetVmBiosId { get { throw null; } } + public string TargetVmName { get { throw null; } set { } } + public string TestNetworkId { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.HyperVToAzStackHCIProtectedItemModelCustomProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.HyperVToAzStackHCIProtectedItemModelCustomProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class HyperVToAzStackHCIProtectedItemModelCustomPropertiesUpdate : Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProtectedItemModelCustomPropertiesUpdate, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public HyperVToAzStackHCIProtectedItemModelCustomPropertiesUpdate() { } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProtectedItemDynamicMemoryConfig DynamicMemoryConfig { get { throw null; } set { } } + public bool? IsDynamicRam { get { throw null; } set { } } + public System.Collections.Generic.IList NicsToInclude { get { throw null; } } + public string OSType { get { throw null; } set { } } + public int? TargetCpuCores { get { throw null; } set { } } + public int? TargetMemoryInMegaBytes { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.HyperVToAzStackHCIProtectedItemModelCustomPropertiesUpdate System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.HyperVToAzStackHCIProtectedItemModelCustomPropertiesUpdate System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class HyperVToAzStackHCIProtectedNicProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal HyperVToAzStackHCIProtectedNicProperties() { } + public string MacAddress { get { throw null; } } + public string NetworkName { get { throw null; } } + public string NicId { get { throw null; } } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.VmNicSelection? SelectionTypeForFailover { get { throw null; } } + public string TargetNetworkId { get { throw null; } } + public string TestNetworkId { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.HyperVToAzStackHCIProtectedNicProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.HyperVToAzStackHCIProtectedNicProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class HyperVToAzStackHCIRecoveryPointModelCustomProperties : Azure.ResourceManager.RecoveryServicesDataReplication.Models.RecoveryPointModelCustomProperties, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal HyperVToAzStackHCIRecoveryPointModelCustomProperties() { } + public System.Collections.Generic.IReadOnlyList DiskIds { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.HyperVToAzStackHCIRecoveryPointModelCustomProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.HyperVToAzStackHCIRecoveryPointModelCustomProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class HyperVToAzStackHCIReplicationExtensionModelCustomProperties : Azure.ResourceManager.RecoveryServicesDataReplication.Models.ReplicationExtensionModelCustomProperties, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public HyperVToAzStackHCIReplicationExtensionModelCustomProperties(string hyperVFabricArmId, string azStackHciFabricArmId) { } + public string AsrServiceUri { get { throw null; } } + public string AzStackHciFabricArmId { get { throw null; } set { } } + public string AzStackHciSiteId { get { throw null; } } + public string GatewayServiceUri { get { throw null; } } + public string HyperVFabricArmId { get { throw null; } set { } } + public string HyperVSiteId { get { throw null; } } + public string RcmServiceUri { get { throw null; } } + public string ResourceGroup { get { throw null; } } + public string ResourceLocation { get { throw null; } } + public string SourceGatewayServiceId { get { throw null; } } + public string SourceStorageContainerName { get { throw null; } } + public string StorageAccountId { get { throw null; } set { } } + public string StorageAccountSasSecretName { get { throw null; } set { } } + public string SubscriptionId { get { throw null; } } + public string TargetGatewayServiceId { get { throw null; } } + public string TargetStorageContainerName { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.HyperVToAzStackHCIReplicationExtensionModelCustomProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.HyperVToAzStackHCIReplicationExtensionModelCustomProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class IdentityModel : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public IdentityModel(string tenantId, string applicationId, string objectId, string audience, string aadAuthority) { } + public string AadAuthority { get { throw null; } set { } } + public string ApplicationId { get { throw null; } set { } } + public string Audience { get { throw null; } set { } } + public string ObjectId { get { throw null; } set { } } + public string TenantId { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.IdentityModel System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.IdentityModel System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class InnerHealthErrorModel : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal InnerHealthErrorModel() { } + public string Category { get { throw null; } } + public string Causes { get { throw null; } } + public string Code { get { throw null; } } + public System.DateTimeOffset? CreatedOn { get { throw null; } } + public string HealthCategory { get { throw null; } } + public bool? IsCustomerResolvable { get { throw null; } } + public string Message { get { throw null; } } + public string Recommendation { get { throw null; } } + public string Severity { get { throw null; } } + public string Source { get { throw null; } } + public string Summary { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.InnerHealthErrorModel System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.InnerHealthErrorModel System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public abstract partial class JobModelCustomProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + protected JobModelCustomProperties() { } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.JobModelCustomPropertiesAffectedObjectDetails AffectedObjectDetails { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.JobModelCustomProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.JobModelCustomProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class JobModelCustomPropertiesAffectedObjectDetails : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal JobModelCustomPropertiesAffectedObjectDetails() { } + public string Description { get { throw null; } } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.JobModelCustomPropertiesAffectedObjectDetailsType? Type { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.JobModelCustomPropertiesAffectedObjectDetails System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.JobModelCustomPropertiesAffectedObjectDetails System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct JobModelCustomPropertiesAffectedObjectDetailsType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public JobModelCustomPropertiesAffectedObjectDetailsType(string value) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.JobModelCustomPropertiesAffectedObjectDetailsType Object { get { throw null; } } + public bool Equals(Azure.ResourceManager.RecoveryServicesDataReplication.Models.JobModelCustomPropertiesAffectedObjectDetailsType other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.RecoveryServicesDataReplication.Models.JobModelCustomPropertiesAffectedObjectDetailsType left, Azure.ResourceManager.RecoveryServicesDataReplication.Models.JobModelCustomPropertiesAffectedObjectDetailsType right) { throw null; } + public static implicit operator Azure.ResourceManager.RecoveryServicesDataReplication.Models.JobModelCustomPropertiesAffectedObjectDetailsType (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.RecoveryServicesDataReplication.Models.JobModelCustomPropertiesAffectedObjectDetailsType left, Azure.ResourceManager.RecoveryServicesDataReplication.Models.JobModelCustomPropertiesAffectedObjectDetailsType right) { throw null; } + public override string ToString() { throw null; } + } + public partial class JobModelProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal JobModelProperties() { } + public string ActivityId { get { throw null; } } + public System.Collections.Generic.IReadOnlyList AllowedActions { get { throw null; } } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.JobModelCustomProperties CustomProperties { get { throw null; } } + public string DisplayName { get { throw null; } } + public System.DateTimeOffset? EndOn { get { throw null; } } + public System.Collections.Generic.IReadOnlyList Errors { get { throw null; } } + public string ObjectId { get { throw null; } } + public string ObjectInternalId { get { throw null; } } + public string ObjectInternalName { get { throw null; } } + public string ObjectName { get { throw null; } } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.JobObjectType? ObjectType { get { throw null; } } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProvisioningState? ProvisioningState { get { throw null; } } + public string ReplicationProviderId { get { throw null; } } + public string SourceFabricProviderId { get { throw null; } } + public System.DateTimeOffset? StartOn { get { throw null; } } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.JobState? State { get { throw null; } } + public string TargetFabricProviderId { get { throw null; } } + public System.Collections.Generic.IReadOnlyList Tasks { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.JobModelProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.JobModelProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct JobObjectType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public JobObjectType(string value) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.JobObjectType AvsDiskPool { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.JobObjectType Fabric { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.JobObjectType FabricAgent { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.JobObjectType Policy { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.JobObjectType ProtectedItem { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.JobObjectType RecoveryPlan { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.JobObjectType ReplicationExtension { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.JobObjectType Vault { get { throw null; } } + public bool Equals(Azure.ResourceManager.RecoveryServicesDataReplication.Models.JobObjectType other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.RecoveryServicesDataReplication.Models.JobObjectType left, Azure.ResourceManager.RecoveryServicesDataReplication.Models.JobObjectType right) { throw null; } + public static implicit operator Azure.ResourceManager.RecoveryServicesDataReplication.Models.JobObjectType (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.RecoveryServicesDataReplication.Models.JobObjectType left, Azure.ResourceManager.RecoveryServicesDataReplication.Models.JobObjectType right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct JobState : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public JobState(string value) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.JobState Cancelled { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.JobState Cancelling { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.JobState CompletedWithErrors { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.JobState CompletedWithInformation { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.JobState CompletedWithWarnings { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.JobState Failed { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.JobState Pending { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.JobState Started { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.JobState Succeeded { get { throw null; } } + public bool Equals(Azure.ResourceManager.RecoveryServicesDataReplication.Models.JobState other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.RecoveryServicesDataReplication.Models.JobState left, Azure.ResourceManager.RecoveryServicesDataReplication.Models.JobState right) { throw null; } + public static implicit operator Azure.ResourceManager.RecoveryServicesDataReplication.Models.JobState (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.RecoveryServicesDataReplication.Models.JobState left, Azure.ResourceManager.RecoveryServicesDataReplication.Models.JobState right) { throw null; } + public override string ToString() { throw null; } + } + public partial class OperationStatus : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal OperationStatus() { } + public string EndTime { get { throw null; } } + public string Id { get { throw null; } } + public string Name { get { throw null; } } + public string StartTime { get { throw null; } } + public string Status { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.OperationStatus System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.OperationStatus System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class PlannedFailoverModel : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public PlannedFailoverModel(Azure.ResourceManager.RecoveryServicesDataReplication.Models.PlannedFailoverModelProperties properties) { } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.PlannedFailoverModelCustomProperties PlannedFailoverModelCustomProperties { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.PlannedFailoverModel System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.PlannedFailoverModel System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public abstract partial class PlannedFailoverModelCustomProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + protected PlannedFailoverModelCustomProperties() { } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.PlannedFailoverModelCustomProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.PlannedFailoverModelCustomProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class PlannedFailoverModelProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public PlannedFailoverModelProperties(Azure.ResourceManager.RecoveryServicesDataReplication.Models.PlannedFailoverModelCustomProperties customProperties) { } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.PlannedFailoverModelCustomProperties CustomProperties { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.PlannedFailoverModelProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.PlannedFailoverModelProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public abstract partial class PolicyModelCustomProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + protected PolicyModelCustomProperties() { } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.PolicyModelCustomProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.PolicyModelCustomProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class PolicyModelProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public PolicyModelProperties(Azure.ResourceManager.RecoveryServicesDataReplication.Models.PolicyModelCustomProperties customProperties) { } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.PolicyModelCustomProperties CustomProperties { get { throw null; } set { } } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProvisioningState? ProvisioningState { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.PolicyModelProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.PolicyModelProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class PrivateEndpointConnectionProxyProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public PrivateEndpointConnectionProxyProperties() { } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProvisioningState? ProvisioningState { get { throw null; } } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.RemotePrivateEndpoint RemotePrivateEndpoint { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.PrivateEndpointConnectionProxyProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.PrivateEndpointConnectionProxyProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class PrivateEndpointConnectionResponseProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public PrivateEndpointConnectionResponseProperties() { } + public Azure.Core.ResourceIdentifier PrivateEndpointId { get { throw null; } set { } } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.RecoveryServicesDataReplicationPrivateLinkServiceConnectionState PrivateLinkServiceConnectionState { get { throw null; } set { } } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProvisioningState? ProvisioningState { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.PrivateEndpointConnectionResponseProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.PrivateEndpointConnectionResponseProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct PrivateEndpointConnectionStatus : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public PrivateEndpointConnectionStatus(string value) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.PrivateEndpointConnectionStatus Approved { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.PrivateEndpointConnectionStatus Disconnected { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.PrivateEndpointConnectionStatus Pending { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.PrivateEndpointConnectionStatus Rejected { get { throw null; } } + public bool Equals(Azure.ResourceManager.RecoveryServicesDataReplication.Models.PrivateEndpointConnectionStatus other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.RecoveryServicesDataReplication.Models.PrivateEndpointConnectionStatus left, Azure.ResourceManager.RecoveryServicesDataReplication.Models.PrivateEndpointConnectionStatus right) { throw null; } + public static implicit operator Azure.ResourceManager.RecoveryServicesDataReplication.Models.PrivateEndpointConnectionStatus (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.RecoveryServicesDataReplication.Models.PrivateEndpointConnectionStatus left, Azure.ResourceManager.RecoveryServicesDataReplication.Models.PrivateEndpointConnectionStatus right) { throw null; } + public override string ToString() { throw null; } + } + public partial class PrivateLinkServiceConnection : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public PrivateLinkServiceConnection() { } + public System.Collections.Generic.IList GroupIds { get { throw null; } } + public string Name { get { throw null; } set { } } + public string RequestMessage { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.PrivateLinkServiceConnection System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.PrivateLinkServiceConnection System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class PrivateLinkServiceProxy : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public PrivateLinkServiceProxy() { } + public System.Collections.Generic.IList GroupConnectivityInformation { get { throw null; } } + public string Id { get { throw null; } set { } } + public Azure.Core.ResourceIdentifier RemotePrivateEndpointConnectionId { get { throw null; } set { } } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.RecoveryServicesDataReplicationPrivateLinkServiceConnectionState RemotePrivateLinkServiceConnectionState { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.PrivateLinkServiceProxy System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.PrivateLinkServiceProxy System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct ProtectedItemActiveLocation : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public ProtectedItemActiveLocation(string value) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProtectedItemActiveLocation Primary { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProtectedItemActiveLocation Recovery { get { throw null; } } + public bool Equals(Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProtectedItemActiveLocation other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProtectedItemActiveLocation left, Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProtectedItemActiveLocation right) { throw null; } + public static implicit operator Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProtectedItemActiveLocation (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProtectedItemActiveLocation left, Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProtectedItemActiveLocation right) { throw null; } + public override string ToString() { throw null; } + } + public partial class ProtectedItemDynamicMemoryConfig : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ProtectedItemDynamicMemoryConfig(long maximumMemoryInMegaBytes, long minimumMemoryInMegaBytes, int targetMemoryBufferPercentage) { } + public long MaximumMemoryInMegaBytes { get { throw null; } set { } } + public long MinimumMemoryInMegaBytes { get { throw null; } set { } } + public int TargetMemoryBufferPercentage { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProtectedItemDynamicMemoryConfig System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProtectedItemDynamicMemoryConfig System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ProtectedItemJobProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal ProtectedItemJobProperties() { } + public string DisplayName { get { throw null; } } + public System.DateTimeOffset? EndOn { get { throw null; } } + public string Id { get { throw null; } } + public string Name { get { throw null; } } + public string ScenarioName { get { throw null; } } + public System.DateTimeOffset? StartOn { get { throw null; } } + public string State { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProtectedItemJobProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProtectedItemJobProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public abstract partial class ProtectedItemModelCustomProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + protected ProtectedItemModelCustomProperties() { } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProtectedItemModelCustomProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProtectedItemModelCustomProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public abstract partial class ProtectedItemModelCustomPropertiesUpdate : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + protected ProtectedItemModelCustomPropertiesUpdate() { } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProtectedItemModelCustomPropertiesUpdate System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProtectedItemModelCustomPropertiesUpdate System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ProtectedItemModelPatch : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ProtectedItemModelPatch() { } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProtectedItemModelCustomPropertiesUpdate CustomProperties { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProtectedItemModelPatch System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProtectedItemModelPatch System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ProtectedItemModelProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ProtectedItemModelProperties(string policyName, string replicationExtensionName, Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProtectedItemModelCustomProperties customProperties) { } + public System.Collections.Generic.IReadOnlyList AllowedJobs { get { throw null; } } + public string CorrelationId { get { throw null; } } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProtectedItemJobProperties CurrentJob { get { throw null; } } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProtectedItemModelCustomProperties CustomProperties { get { throw null; } set { } } + public string FabricAgentId { get { throw null; } } + public string FabricId { get { throw null; } } + public string FabricObjectId { get { throw null; } } + public string FabricObjectName { get { throw null; } } + public System.Collections.Generic.IReadOnlyList HealthErrors { get { throw null; } } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProtectedItemJobProperties LastFailedEnableProtectionJob { get { throw null; } } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProtectedItemJobProperties LastFailedPlannedFailoverJob { get { throw null; } } + public System.DateTimeOffset? LastSuccessfulPlannedFailoverOn { get { throw null; } } + public System.DateTimeOffset? LastSuccessfulTestFailoverOn { get { throw null; } } + public System.DateTimeOffset? LastSuccessfulUnplannedFailoverOn { get { throw null; } } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProtectedItemJobProperties LastTestFailoverJob { get { throw null; } } + public string PolicyName { get { throw null; } set { } } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProtectionState? ProtectionState { get { throw null; } } + public string ProtectionStateDescription { get { throw null; } } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProvisioningState? ProvisioningState { get { throw null; } } + public string ReplicationExtensionName { get { throw null; } set { } } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.HealthStatus? ReplicationHealth { get { throw null; } } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.ResynchronizationState? ResynchronizationState { get { throw null; } } + public bool? ResyncRequired { get { throw null; } } + public string SourceFabricProviderId { get { throw null; } } + public string TargetFabricAgentId { get { throw null; } } + public string TargetFabricId { get { throw null; } } + public string TargetFabricProviderId { get { throw null; } } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.TestFailoverState? TestFailoverState { get { throw null; } } + public string TestFailoverStateDescription { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProtectedItemModelProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProtectedItemModelProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct ProtectionState : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public ProtectionState(string value) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProtectionState CancelFailoverFailedOnPrimary { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProtectionState CancelFailoverFailedOnRecovery { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProtectionState CancelFailoverInProgressOnPrimary { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProtectionState CancelFailoverInProgressOnRecovery { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProtectionState CancelFailoverStatesBegin { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProtectionState CancelFailoverStatesEnd { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProtectionState ChangeRecoveryPointCompleted { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProtectionState ChangeRecoveryPointFailed { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProtectionState ChangeRecoveryPointInitiated { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProtectionState ChangeRecoveryPointStatesBegin { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProtectionState ChangeRecoveryPointStatesEnd { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProtectionState CommitFailoverCompleted { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProtectionState CommitFailoverFailedOnPrimary { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProtectionState CommitFailoverFailedOnRecovery { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProtectionState CommitFailoverInProgressOnPrimary { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProtectionState CommitFailoverInProgressOnRecovery { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProtectionState CommitFailoverStatesBegin { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProtectionState CommitFailoverStatesEnd { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProtectionState DisablingFailed { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProtectionState DisablingProtection { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProtectionState EnablingFailed { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProtectionState EnablingProtection { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProtectionState InitialReplicationCompletedOnPrimary { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProtectionState InitialReplicationCompletedOnRecovery { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProtectionState InitialReplicationFailed { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProtectionState InitialReplicationInProgress { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProtectionState InitialReplicationStatesBegin { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProtectionState InitialReplicationStatesEnd { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProtectionState MarkedForDeletion { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProtectionState PlannedFailoverCompleted { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProtectionState PlannedFailoverCompleting { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProtectionState PlannedFailoverCompletionFailed { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProtectionState PlannedFailoverFailed { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProtectionState PlannedFailoverInitiated { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProtectionState PlannedFailoverTransitionStatesBegin { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProtectionState PlannedFailoverTransitionStatesEnd { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProtectionState Protected { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProtectionState ProtectedStatesBegin { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProtectionState ProtectedStatesEnd { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProtectionState ReprotectFailed { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProtectionState ReprotectInitiated { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProtectionState ReprotectStatesBegin { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProtectionState ReprotectStatesEnd { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProtectionState UnplannedFailoverCompleted { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProtectionState UnplannedFailoverCompleting { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProtectionState UnplannedFailoverCompletionFailed { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProtectionState UnplannedFailoverFailed { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProtectionState UnplannedFailoverInitiated { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProtectionState UnplannedFailoverTransitionStatesBegin { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProtectionState UnplannedFailoverTransitionStatesEnd { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProtectionState UnprotectedStatesBegin { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProtectionState UnprotectedStatesEnd { get { throw null; } } + public bool Equals(Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProtectionState other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProtectionState left, Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProtectionState right) { throw null; } + public static implicit operator Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProtectionState (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProtectionState left, Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProtectionState right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct ProvisioningState : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public ProvisioningState(string value) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProvisioningState Canceled { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProvisioningState Creating { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProvisioningState Deleted { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProvisioningState Deleting { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProvisioningState Failed { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProvisioningState Succeeded { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProvisioningState Updating { get { throw null; } } + public bool Equals(Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProvisioningState other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProvisioningState left, Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProvisioningState right) { throw null; } + public static implicit operator Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProvisioningState (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProvisioningState left, Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProvisioningState right) { throw null; } + public override string ToString() { throw null; } + } + public abstract partial class RecoveryPointModelCustomProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + protected RecoveryPointModelCustomProperties() { } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.RecoveryPointModelCustomProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.RecoveryPointModelCustomProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class RecoveryPointModelProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal RecoveryPointModelProperties() { } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.RecoveryPointModelCustomProperties CustomProperties { get { throw null; } } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProvisioningState? ProvisioningState { get { throw null; } } + public System.DateTimeOffset RecoveryPointOn { get { throw null; } } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.RecoveryPointType RecoveryPointType { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.RecoveryPointModelProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.RecoveryPointModelProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct RecoveryPointType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public RecoveryPointType(string value) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.RecoveryPointType ApplicationConsistent { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.RecoveryPointType CrashConsistent { get { throw null; } } + public bool Equals(Azure.ResourceManager.RecoveryServicesDataReplication.Models.RecoveryPointType other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.RecoveryServicesDataReplication.Models.RecoveryPointType left, Azure.ResourceManager.RecoveryServicesDataReplication.Models.RecoveryPointType right) { throw null; } + public static implicit operator Azure.ResourceManager.RecoveryServicesDataReplication.Models.RecoveryPointType (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.RecoveryServicesDataReplication.Models.RecoveryPointType left, Azure.ResourceManager.RecoveryServicesDataReplication.Models.RecoveryPointType right) { throw null; } + public override string ToString() { throw null; } + } + public partial class RecoveryServicesDataReplicationPrivateLinkResourceProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal RecoveryServicesDataReplicationPrivateLinkResourceProperties() { } + public string GroupId { get { throw null; } } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProvisioningState? ProvisioningState { get { throw null; } } + public System.Collections.Generic.IReadOnlyList RequiredMembers { get { throw null; } } + public System.Collections.Generic.IReadOnlyList RequiredZoneNames { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.RecoveryServicesDataReplicationPrivateLinkResourceProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.RecoveryServicesDataReplicationPrivateLinkResourceProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class RecoveryServicesDataReplicationPrivateLinkServiceConnectionState : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public RecoveryServicesDataReplicationPrivateLinkServiceConnectionState() { } + public string ActionsRequired { get { throw null; } set { } } + public string Description { get { throw null; } set { } } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.PrivateEndpointConnectionStatus? Status { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.RecoveryServicesDataReplicationPrivateLinkServiceConnectionState System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.RecoveryServicesDataReplicationPrivateLinkServiceConnectionState System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class RemotePrivateEndpoint : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public RemotePrivateEndpoint(string id) { } + public System.Collections.Generic.IList ConnectionDetails { get { throw null; } } + public string Id { get { throw null; } set { } } + public System.Collections.Generic.IList ManualPrivateLinkServiceConnections { get { throw null; } } + public System.Collections.Generic.IList PrivateLinkServiceConnections { get { throw null; } } + public System.Collections.Generic.IList PrivateLinkServiceProxies { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.RemotePrivateEndpoint System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.RemotePrivateEndpoint System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public abstract partial class ReplicationExtensionModelCustomProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + protected ReplicationExtensionModelCustomProperties() { } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.ReplicationExtensionModelCustomProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.ReplicationExtensionModelCustomProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ReplicationExtensionModelProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ReplicationExtensionModelProperties(Azure.ResourceManager.RecoveryServicesDataReplication.Models.ReplicationExtensionModelCustomProperties customProperties) { } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.ReplicationExtensionModelCustomProperties CustomProperties { get { throw null; } set { } } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProvisioningState? ProvisioningState { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.ReplicationExtensionModelProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.ReplicationExtensionModelProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct ReplicationVaultType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public ReplicationVaultType(string value) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.ReplicationVaultType DisasterRecovery { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.ReplicationVaultType Migrate { get { throw null; } } + public bool Equals(Azure.ResourceManager.RecoveryServicesDataReplication.Models.ReplicationVaultType other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.RecoveryServicesDataReplication.Models.ReplicationVaultType left, Azure.ResourceManager.RecoveryServicesDataReplication.Models.ReplicationVaultType right) { throw null; } + public static implicit operator Azure.ResourceManager.RecoveryServicesDataReplication.Models.ReplicationVaultType (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.RecoveryServicesDataReplication.Models.ReplicationVaultType left, Azure.ResourceManager.RecoveryServicesDataReplication.Models.ReplicationVaultType right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct ResynchronizationState : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public ResynchronizationState(string value) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.ResynchronizationState None { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.ResynchronizationState ResynchronizationCompleted { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.ResynchronizationState ResynchronizationFailed { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.ResynchronizationState ResynchronizationInitiated { get { throw null; } } + public bool Equals(Azure.ResourceManager.RecoveryServicesDataReplication.Models.ResynchronizationState other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.RecoveryServicesDataReplication.Models.ResynchronizationState left, Azure.ResourceManager.RecoveryServicesDataReplication.Models.ResynchronizationState right) { throw null; } + public static implicit operator Azure.ResourceManager.RecoveryServicesDataReplication.Models.ResynchronizationState (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.RecoveryServicesDataReplication.Models.ResynchronizationState left, Azure.ResourceManager.RecoveryServicesDataReplication.Models.ResynchronizationState right) { throw null; } + public override string ToString() { throw null; } + } + public partial class StorageContainerProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public StorageContainerProperties(string name, string clusterSharedVolumePath) { } + public string ClusterSharedVolumePath { get { throw null; } set { } } + public string Name { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.StorageContainerProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.StorageContainerProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class TaskModel : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal TaskModel() { } + public System.Collections.Generic.IReadOnlyList ChildrenJobs { get { throw null; } } + public string CustomInstanceType { get { throw null; } } + public System.DateTimeOffset? EndOn { get { throw null; } } + public System.DateTimeOffset? StartOn { get { throw null; } } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.TaskState? State { get { throw null; } } + public string TaskName { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.TaskModel System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.TaskModel System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct TaskState : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public TaskState(string value) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.TaskState Cancelled { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.TaskState Failed { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.TaskState Pending { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.TaskState Skipped { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.TaskState Started { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.TaskState Succeeded { get { throw null; } } + public bool Equals(Azure.ResourceManager.RecoveryServicesDataReplication.Models.TaskState other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.RecoveryServicesDataReplication.Models.TaskState left, Azure.ResourceManager.RecoveryServicesDataReplication.Models.TaskState right) { throw null; } + public static implicit operator Azure.ResourceManager.RecoveryServicesDataReplication.Models.TaskState (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.RecoveryServicesDataReplication.Models.TaskState left, Azure.ResourceManager.RecoveryServicesDataReplication.Models.TaskState right) { throw null; } + public override string ToString() { throw null; } + } + public partial class TestFailoverCleanupJobModelCustomProperties : Azure.ResourceManager.RecoveryServicesDataReplication.Models.JobModelCustomProperties, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal TestFailoverCleanupJobModelCustomProperties() { } + public string Comments { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.TestFailoverCleanupJobModelCustomProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.TestFailoverCleanupJobModelCustomProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class TestFailoverJobModelCustomProperties : Azure.ResourceManager.RecoveryServicesDataReplication.Models.JobModelCustomProperties, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal TestFailoverJobModelCustomProperties() { } + public System.Collections.Generic.IReadOnlyList ProtectedItemDetails { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.TestFailoverJobModelCustomProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.TestFailoverJobModelCustomProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct TestFailoverState : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public TestFailoverState(string value) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.TestFailoverState MarkedForDeletion { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.TestFailoverState None { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.TestFailoverState TestFailoverCleanupCompleting { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.TestFailoverState TestFailoverCleanupInitiated { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.TestFailoverState TestFailoverCompleted { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.TestFailoverState TestFailoverCompleting { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.TestFailoverState TestFailoverCompletionFailed { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.TestFailoverState TestFailoverFailed { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.TestFailoverState TestFailoverInitiated { get { throw null; } } + public bool Equals(Azure.ResourceManager.RecoveryServicesDataReplication.Models.TestFailoverState other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.RecoveryServicesDataReplication.Models.TestFailoverState left, Azure.ResourceManager.RecoveryServicesDataReplication.Models.TestFailoverState right) { throw null; } + public static implicit operator Azure.ResourceManager.RecoveryServicesDataReplication.Models.TestFailoverState (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.RecoveryServicesDataReplication.Models.TestFailoverState left, Azure.ResourceManager.RecoveryServicesDataReplication.Models.TestFailoverState right) { throw null; } + public override string ToString() { throw null; } + } + public partial class VaultModelPatch : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public VaultModelPatch() { } + public Azure.ResourceManager.Models.ManagedServiceIdentity Identity { get { throw null; } set { } } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.VaultModelProperties Properties { get { throw null; } set { } } + public System.Collections.Generic.IDictionary Tags { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.VaultModelPatch System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.VaultModelPatch System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class VaultModelProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public VaultModelProperties() { } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProvisioningState? ProvisioningState { get { throw null; } } + public string ServiceResourceId { get { throw null; } } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.ReplicationVaultType? VaultType { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.VaultModelProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.VaultModelProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct VmNicSelection : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public VmNicSelection(string value) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.VmNicSelection NotSelected { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.VmNicSelection SelectedByDefault { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.VmNicSelection SelectedByUser { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.VmNicSelection SelectedByUserOverride { get { throw null; } } + public bool Equals(Azure.ResourceManager.RecoveryServicesDataReplication.Models.VmNicSelection other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.RecoveryServicesDataReplication.Models.VmNicSelection left, Azure.ResourceManager.RecoveryServicesDataReplication.Models.VmNicSelection right) { throw null; } + public static implicit operator Azure.ResourceManager.RecoveryServicesDataReplication.Models.VmNicSelection (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.RecoveryServicesDataReplication.Models.VmNicSelection left, Azure.ResourceManager.RecoveryServicesDataReplication.Models.VmNicSelection right) { throw null; } + public override string ToString() { throw null; } + } + public partial class VMwareFabricAgentModelCustomProperties : Azure.ResourceManager.RecoveryServicesDataReplication.Models.FabricAgentModelCustomProperties, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public VMwareFabricAgentModelCustomProperties(string biosId, Azure.ResourceManager.RecoveryServicesDataReplication.Models.IdentityModel marsAuthenticationIdentity) { } + public string BiosId { get { throw null; } set { } } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.IdentityModel MarsAuthenticationIdentity { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.VMwareFabricAgentModelCustomProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.VMwareFabricAgentModelCustomProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class VMwareMigrateFabricModelCustomProperties : Azure.ResourceManager.RecoveryServicesDataReplication.Models.FabricModelCustomProperties, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public VMwareMigrateFabricModelCustomProperties(string vmwareSiteId, string migrationSolutionId) { } + public string MigrationSolutionId { get { throw null; } set { } } + public string VmwareSiteId { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.VMwareMigrateFabricModelCustomProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.VMwareMigrateFabricModelCustomProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class VMwareToAzStackHCIDiskInput : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public VMwareToAzStackHCIDiskInput(string diskId, long diskSizeGB, string diskFileFormat, bool isOSDisk) { } + public long? DiskBlockSize { get { throw null; } set { } } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.DiskControllerInputs DiskController { get { throw null; } set { } } + public string DiskFileFormat { get { throw null; } set { } } + public string DiskId { get { throw null; } set { } } + public string DiskIdentifier { get { throw null; } set { } } + public long? DiskLogicalSectorSize { get { throw null; } set { } } + public long? DiskPhysicalSectorSize { get { throw null; } set { } } + public long DiskSizeGB { get { throw null; } set { } } + public bool? IsDynamic { get { throw null; } set { } } + public bool IsOSDisk { get { throw null; } set { } } + public string StorageContainerId { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.VMwareToAzStackHCIDiskInput System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.VMwareToAzStackHCIDiskInput System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class VMwareToAzStackHCIEventModelCustomProperties : Azure.ResourceManager.RecoveryServicesDataReplication.Models.EventModelCustomProperties, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal VMwareToAzStackHCIEventModelCustomProperties() { } + public string EventSourceFriendlyName { get { throw null; } } + public string ProtectedItemFriendlyName { get { throw null; } } + public string ServerType { get { throw null; } } + public string SourceApplianceName { get { throw null; } } + public string TargetApplianceName { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.VMwareToAzStackHCIEventModelCustomProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.VMwareToAzStackHCIEventModelCustomProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class VMwareToAzStackHCINicInput : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public VMwareToAzStackHCINicInput(string nicId, string label, Azure.ResourceManager.RecoveryServicesDataReplication.Models.VmNicSelection selectionTypeForFailover) { } + public bool? IsMacMigrationEnabled { get { throw null; } set { } } + public bool? IsStaticIPMigrationEnabled { get { throw null; } set { } } + public string Label { get { throw null; } set { } } + public string NetworkName { get { throw null; } } + public string NicId { get { throw null; } set { } } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.VmNicSelection SelectionTypeForFailover { get { throw null; } set { } } + public string TargetNetworkId { get { throw null; } set { } } + public string TestNetworkId { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.VMwareToAzStackHCINicInput System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.VMwareToAzStackHCINicInput System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class VMwareToAzStackHCIPlannedFailoverModelCustomProperties : Azure.ResourceManager.RecoveryServicesDataReplication.Models.PlannedFailoverModelCustomProperties, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public VMwareToAzStackHCIPlannedFailoverModelCustomProperties(bool shutdownSourceVm) { } + public bool ShutdownSourceVm { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.VMwareToAzStackHCIPlannedFailoverModelCustomProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.VMwareToAzStackHCIPlannedFailoverModelCustomProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class VMwareToAzStackHCIPolicyModelCustomProperties : Azure.ResourceManager.RecoveryServicesDataReplication.Models.PolicyModelCustomProperties, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public VMwareToAzStackHCIPolicyModelCustomProperties(int recoveryPointHistoryInMinutes, int crashConsistentFrequencyInMinutes, int appConsistentFrequencyInMinutes) { } + public int AppConsistentFrequencyInMinutes { get { throw null; } set { } } + public int CrashConsistentFrequencyInMinutes { get { throw null; } set { } } + public int RecoveryPointHistoryInMinutes { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.VMwareToAzStackHCIPolicyModelCustomProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.VMwareToAzStackHCIPolicyModelCustomProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class VMwareToAzStackHCIProtectedDiskProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal VMwareToAzStackHCIProtectedDiskProperties() { } + public long? CapacityInBytes { get { throw null; } } + public long? DiskBlockSize { get { throw null; } } + public long? DiskLogicalSectorSize { get { throw null; } } + public long? DiskPhysicalSectorSize { get { throw null; } } + public string DiskType { get { throw null; } } + public bool? IsDynamic { get { throw null; } } + public bool? IsOSDisk { get { throw null; } } + public string MigrateDiskName { get { throw null; } } + public string SeedDiskName { get { throw null; } } + public string SourceDiskId { get { throw null; } } + public string SourceDiskName { get { throw null; } } + public string StorageContainerId { get { throw null; } } + public string StorageContainerLocalPath { get { throw null; } } + public string TestMigrateDiskName { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.VMwareToAzStackHCIProtectedDiskProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.VMwareToAzStackHCIProtectedDiskProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class VMwareToAzStackHCIProtectedItemModelCustomProperties : Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProtectedItemModelCustomProperties, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public VMwareToAzStackHCIProtectedItemModelCustomProperties(string targetHciClusterId, string targetArcClusterCustomLocationId, string storageContainerId, string targetResourceGroupId, string customLocationRegion, System.Collections.Generic.IEnumerable disksToInclude, System.Collections.Generic.IEnumerable nicsToInclude, string hyperVGeneration, string fabricDiscoveryMachineId, string runAsAccountId, string sourceFabricAgentName, string targetFabricAgentName) { } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProtectedItemActiveLocation? ActiveLocation { get { throw null; } } + public string CustomLocationRegion { get { throw null; } set { } } + public System.Collections.Generic.IList DisksToInclude { get { throw null; } } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProtectedItemDynamicMemoryConfig DynamicMemoryConfig { get { throw null; } set { } } + public string FabricDiscoveryMachineId { get { throw null; } set { } } + public string FailoverRecoveryPointId { get { throw null; } } + public string FirmwareType { get { throw null; } } + public string HyperVGeneration { get { throw null; } set { } } + public int? InitialReplicationProgressPercentage { get { throw null; } } + public bool? IsDynamicRam { get { throw null; } set { } } + public string LastRecoveryPointId { get { throw null; } } + public System.DateTimeOffset? LastRecoveryPointReceived { get { throw null; } } + public System.DateTimeOffset? LastReplicationUpdateOn { get { throw null; } } + public int? MigrationProgressPercentage { get { throw null; } } + public System.Collections.Generic.IList NicsToInclude { get { throw null; } } + public string OSName { get { throw null; } } + public string OSType { get { throw null; } } + public bool? PerformAutoResync { get { throw null; } set { } } + public System.Collections.Generic.IReadOnlyList ProtectedDisks { get { throw null; } } + public System.Collections.Generic.IReadOnlyList ProtectedNics { get { throw null; } } + public int? ResumeProgressPercentage { get { throw null; } } + public long? ResumeRetryCount { get { throw null; } } + public int? ResyncProgressPercentage { get { throw null; } } + public bool? ResyncRequired { get { throw null; } } + public long? ResyncRetryCount { get { throw null; } } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.VMwareToAzureMigrateResyncState? ResyncState { get { throw null; } } + public string RunAsAccountId { get { throw null; } set { } } + public string SourceApplianceName { get { throw null; } } + public int? SourceCpuCores { get { throw null; } } + public string SourceFabricAgentName { get { throw null; } set { } } + public double? SourceMemoryInMegaBytes { get { throw null; } } + public string SourceVmName { get { throw null; } } + public string StorageContainerId { get { throw null; } set { } } + public string TargetApplianceName { get { throw null; } } + public string TargetArcClusterCustomLocationId { get { throw null; } set { } } + public string TargetAzStackHciClusterName { get { throw null; } } + public int? TargetCpuCores { get { throw null; } set { } } + public string TargetFabricAgentName { get { throw null; } set { } } + public string TargetHciClusterId { get { throw null; } set { } } + public string TargetLocation { get { throw null; } } + public int? TargetMemoryInMegaBytes { get { throw null; } set { } } + public string TargetNetworkId { get { throw null; } set { } } + public string TargetResourceGroupId { get { throw null; } set { } } + public string TargetVmBiosId { get { throw null; } } + public string TargetVmName { get { throw null; } set { } } + public string TestNetworkId { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.VMwareToAzStackHCIProtectedItemModelCustomProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.VMwareToAzStackHCIProtectedItemModelCustomProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class VMwareToAzStackHCIProtectedItemModelCustomPropertiesUpdate : Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProtectedItemModelCustomPropertiesUpdate, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public VMwareToAzStackHCIProtectedItemModelCustomPropertiesUpdate() { } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProtectedItemDynamicMemoryConfig DynamicMemoryConfig { get { throw null; } set { } } + public bool? IsDynamicRam { get { throw null; } set { } } + public System.Collections.Generic.IList NicsToInclude { get { throw null; } } + public string OSType { get { throw null; } set { } } + public int? TargetCpuCores { get { throw null; } set { } } + public int? TargetMemoryInMegaBytes { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.VMwareToAzStackHCIProtectedItemModelCustomPropertiesUpdate System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.VMwareToAzStackHCIProtectedItemModelCustomPropertiesUpdate System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class VMwareToAzStackHCIProtectedNicProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal VMwareToAzStackHCIProtectedNicProperties() { } + public bool? IsPrimaryNic { get { throw null; } } + public string Label { get { throw null; } } + public string MacAddress { get { throw null; } } + public string NetworkName { get { throw null; } } + public string NicId { get { throw null; } } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.VmNicSelection? SelectionTypeForFailover { get { throw null; } } + public string TargetNetworkId { get { throw null; } } + public string TestNetworkId { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.VMwareToAzStackHCIProtectedNicProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.VMwareToAzStackHCIProtectedNicProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class VMwareToAzStackHCIRecoveryPointModelCustomProperties : Azure.ResourceManager.RecoveryServicesDataReplication.Models.RecoveryPointModelCustomProperties, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal VMwareToAzStackHCIRecoveryPointModelCustomProperties() { } + public System.Collections.Generic.IReadOnlyList DiskIds { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.VMwareToAzStackHCIRecoveryPointModelCustomProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.VMwareToAzStackHCIRecoveryPointModelCustomProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class VMwareToAzStackHCIReplicationExtensionModelCustomProperties : Azure.ResourceManager.RecoveryServicesDataReplication.Models.ReplicationExtensionModelCustomProperties, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public VMwareToAzStackHCIReplicationExtensionModelCustomProperties(string vmwareFabricArmId, string azStackHciFabricArmId) { } + public string AsrServiceUri { get { throw null; } } + public string AzStackHciFabricArmId { get { throw null; } set { } } + public string AzStackHciSiteId { get { throw null; } } + public string GatewayServiceUri { get { throw null; } } + public string RcmServiceUri { get { throw null; } } + public string ResourceGroup { get { throw null; } } + public string ResourceLocation { get { throw null; } } + public string SourceGatewayServiceId { get { throw null; } } + public string SourceStorageContainerName { get { throw null; } } + public string StorageAccountId { get { throw null; } set { } } + public string StorageAccountSasSecretName { get { throw null; } set { } } + public string SubscriptionId { get { throw null; } } + public string TargetGatewayServiceId { get { throw null; } } + public string TargetStorageContainerName { get { throw null; } } + public string VmwareFabricArmId { get { throw null; } set { } } + public string VmwareSiteId { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.VMwareToAzStackHCIReplicationExtensionModelCustomProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.VMwareToAzStackHCIReplicationExtensionModelCustomProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct VMwareToAzureMigrateResyncState : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public VMwareToAzureMigrateResyncState(string value) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.VMwareToAzureMigrateResyncState None { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.VMwareToAzureMigrateResyncState PreparedForResynchronization { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.VMwareToAzureMigrateResyncState StartedResynchronization { get { throw null; } } + public bool Equals(Azure.ResourceManager.RecoveryServicesDataReplication.Models.VMwareToAzureMigrateResyncState other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.RecoveryServicesDataReplication.Models.VMwareToAzureMigrateResyncState left, Azure.ResourceManager.RecoveryServicesDataReplication.Models.VMwareToAzureMigrateResyncState right) { throw null; } + public static implicit operator Azure.ResourceManager.RecoveryServicesDataReplication.Models.VMwareToAzureMigrateResyncState (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.RecoveryServicesDataReplication.Models.VMwareToAzureMigrateResyncState left, Azure.ResourceManager.RecoveryServicesDataReplication.Models.VMwareToAzureMigrateResyncState right) { throw null; } + public override string ToString() { throw null; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/assets.json b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/assets.json new file mode 100644 index 000000000000..f70a74c582ba --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/assets.json @@ -0,0 +1,7 @@ + +{ + "AssetsRepo": "Azure/azure-sdk-assets", + "AssetsRepoPrefixPath": "net", + "TagPrefix": "net/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication", + "Tag": "" +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/samples/Azure.ResourceManager.RecoveryServicesDataReplication.Samples.csproj b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/samples/Azure.ResourceManager.RecoveryServicesDataReplication.Samples.csproj new file mode 100644 index 000000000000..cebebad85cc8 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/samples/Azure.ResourceManager.RecoveryServicesDataReplication.Samples.csproj @@ -0,0 +1,13 @@ + + + + + + + + + + + + + diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/samples/Generated/Samples/Sample_EmailConfigurationModelCollection.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/samples/Generated/Samples/Sample_EmailConfigurationModelCollection.cs new file mode 100644 index 000000000000..81a36c05be83 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/samples/Generated/Samples/Sample_EmailConfigurationModelCollection.cs @@ -0,0 +1,204 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.RecoveryServicesDataReplication.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Samples +{ + public partial class Sample_EmailConfigurationModelCollection + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task CreateOrUpdate_CreatesEmailConfigurationSettings() + { + // Generated from example definition: 2024-09-01/EmailConfiguration_Create.json + // this example is just showing the usage of "EmailConfigurationModel_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 VaultModelResource created on azure + // for more information of creating VaultModelResource, please refer to the document of VaultModelResource + string subscriptionId = "930CEC23-4430-4513-B855-DBA237E2F3BF"; + string resourceGroupName = "rgswagger_2024-09-01"; + string vaultName = "4"; + ResourceIdentifier vaultModelResourceId = VaultModelResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, vaultName); + VaultModelResource vaultModel = client.GetVaultModelResource(vaultModelResourceId); + + // get the collection of this EmailConfigurationModelResource + EmailConfigurationModelCollection collection = vaultModel.GetEmailConfigurationModels(); + + // invoke the operation + string emailConfigurationName = "0"; + EmailConfigurationModelData data = new EmailConfigurationModelData + { + Properties = new EmailConfigurationModelProperties(true) + { + CustomEmailAddresses = { "ketvbducyailcny" }, + Locale = "vpnjxjvdqtebnucyxiyrjiko", + }, + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, emailConfigurationName, data); + EmailConfigurationModelResource 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 + EmailConfigurationModelData 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_GetsTheEmailConfigurationSetting() + { + // Generated from example definition: 2024-09-01/EmailConfiguration_Get.json + // this example is just showing the usage of "EmailConfigurationModel_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 VaultModelResource created on azure + // for more information of creating VaultModelResource, please refer to the document of VaultModelResource + string subscriptionId = "930CEC23-4430-4513-B855-DBA237E2F3BF"; + string resourceGroupName = "rgswagger_2024-09-01"; + string vaultName = "4"; + ResourceIdentifier vaultModelResourceId = VaultModelResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, vaultName); + VaultModelResource vaultModel = client.GetVaultModelResource(vaultModelResourceId); + + // get the collection of this EmailConfigurationModelResource + EmailConfigurationModelCollection collection = vaultModel.GetEmailConfigurationModels(); + + // invoke the operation + string emailConfigurationName = "0"; + EmailConfigurationModelResource result = await collection.GetAsync(emailConfigurationName); + + // 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 + EmailConfigurationModelData 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_ListsTheEmailConfigurationSettings() + { + // Generated from example definition: 2024-09-01/EmailConfiguration_List.json + // this example is just showing the usage of "EmailConfigurationModel_List" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this VaultModelResource created on azure + // for more information of creating VaultModelResource, please refer to the document of VaultModelResource + string subscriptionId = "930CEC23-4430-4513-B855-DBA237E2F3BF"; + string resourceGroupName = "rgswagger_2024-09-01"; + string vaultName = "4"; + ResourceIdentifier vaultModelResourceId = VaultModelResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, vaultName); + VaultModelResource vaultModel = client.GetVaultModelResource(vaultModelResourceId); + + // get the collection of this EmailConfigurationModelResource + EmailConfigurationModelCollection collection = vaultModel.GetEmailConfigurationModels(); + + // invoke the operation and iterate over the result + await foreach (EmailConfigurationModelResource 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 + EmailConfigurationModelData 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_GetsTheEmailConfigurationSetting() + { + // Generated from example definition: 2024-09-01/EmailConfiguration_Get.json + // this example is just showing the usage of "EmailConfigurationModel_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 VaultModelResource created on azure + // for more information of creating VaultModelResource, please refer to the document of VaultModelResource + string subscriptionId = "930CEC23-4430-4513-B855-DBA237E2F3BF"; + string resourceGroupName = "rgswagger_2024-09-01"; + string vaultName = "4"; + ResourceIdentifier vaultModelResourceId = VaultModelResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, vaultName); + VaultModelResource vaultModel = client.GetVaultModelResource(vaultModelResourceId); + + // get the collection of this EmailConfigurationModelResource + EmailConfigurationModelCollection collection = vaultModel.GetEmailConfigurationModels(); + + // invoke the operation + string emailConfigurationName = "0"; + bool result = await collection.ExistsAsync(emailConfigurationName); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetIfExists_GetsTheEmailConfigurationSetting() + { + // Generated from example definition: 2024-09-01/EmailConfiguration_Get.json + // this example is just showing the usage of "EmailConfigurationModel_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 VaultModelResource created on azure + // for more information of creating VaultModelResource, please refer to the document of VaultModelResource + string subscriptionId = "930CEC23-4430-4513-B855-DBA237E2F3BF"; + string resourceGroupName = "rgswagger_2024-09-01"; + string vaultName = "4"; + ResourceIdentifier vaultModelResourceId = VaultModelResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, vaultName); + VaultModelResource vaultModel = client.GetVaultModelResource(vaultModelResourceId); + + // get the collection of this EmailConfigurationModelResource + EmailConfigurationModelCollection collection = vaultModel.GetEmailConfigurationModels(); + + // invoke the operation + string emailConfigurationName = "0"; + NullableResponse response = await collection.GetIfExistsAsync(emailConfigurationName); + EmailConfigurationModelResource 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 + EmailConfigurationModelData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/samples/Generated/Samples/Sample_EmailConfigurationModelResource.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/samples/Generated/Samples/Sample_EmailConfigurationModelResource.cs new file mode 100644 index 000000000000..b5efb94707ba --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/samples/Generated/Samples/Sample_EmailConfigurationModelResource.cs @@ -0,0 +1,90 @@ +// 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.RecoveryServicesDataReplication.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Samples +{ + public partial class Sample_EmailConfigurationModelResource + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_GetsTheEmailConfigurationSetting() + { + // Generated from example definition: 2024-09-01/EmailConfiguration_Get.json + // this example is just showing the usage of "EmailConfigurationModel_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 EmailConfigurationModelResource created on azure + // for more information of creating EmailConfigurationModelResource, please refer to the document of EmailConfigurationModelResource + string subscriptionId = "930CEC23-4430-4513-B855-DBA237E2F3BF"; + string resourceGroupName = "rgswagger_2024-09-01"; + string vaultName = "4"; + string emailConfigurationName = "0"; + ResourceIdentifier emailConfigurationModelResourceId = EmailConfigurationModelResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, vaultName, emailConfigurationName); + EmailConfigurationModelResource emailConfigurationModel = client.GetEmailConfigurationModelResource(emailConfigurationModelResourceId); + + // invoke the operation + EmailConfigurationModelResource result = await emailConfigurationModel.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 + EmailConfigurationModelData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Update_CreatesEmailConfigurationSettings() + { + // Generated from example definition: 2024-09-01/EmailConfiguration_Create.json + // this example is just showing the usage of "EmailConfigurationModel_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 EmailConfigurationModelResource created on azure + // for more information of creating EmailConfigurationModelResource, please refer to the document of EmailConfigurationModelResource + string subscriptionId = "930CEC23-4430-4513-B855-DBA237E2F3BF"; + string resourceGroupName = "rgswagger_2024-09-01"; + string vaultName = "4"; + string emailConfigurationName = "0"; + ResourceIdentifier emailConfigurationModelResourceId = EmailConfigurationModelResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, vaultName, emailConfigurationName); + EmailConfigurationModelResource emailConfigurationModel = client.GetEmailConfigurationModelResource(emailConfigurationModelResourceId); + + // invoke the operation + EmailConfigurationModelData data = new EmailConfigurationModelData + { + Properties = new EmailConfigurationModelProperties(true) + { + CustomEmailAddresses = { "ketvbducyailcny" }, + Locale = "vpnjxjvdqtebnucyxiyrjiko", + }, + }; + ArmOperation lro = await emailConfigurationModel.UpdateAsync(WaitUntil.Completed, data); + EmailConfigurationModelResource 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 + EmailConfigurationModelData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/samples/Generated/Samples/Sample_EventModelCollection.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/samples/Generated/Samples/Sample_EventModelCollection.cs new file mode 100644 index 000000000000..568e2a30f49a --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/samples/Generated/Samples/Sample_EventModelCollection.cs @@ -0,0 +1,161 @@ +// 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 NUnit.Framework; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Samples +{ + public partial class Sample_EventModelCollection + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_GetsTheEvent() + { + // Generated from example definition: 2024-09-01/Event_Get.json + // this example is just showing the usage of "EventModel_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 VaultModelResource created on azure + // for more information of creating VaultModelResource, please refer to the document of VaultModelResource + string subscriptionId = "930CEC23-4430-4513-B855-DBA237E2F3BF"; + string resourceGroupName = "rgswagger_2024-09-01"; + string vaultName = "4"; + ResourceIdentifier vaultModelResourceId = VaultModelResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, vaultName); + VaultModelResource vaultModel = client.GetVaultModelResource(vaultModelResourceId); + + // get the collection of this EventModelResource + EventModelCollection collection = vaultModel.GetEventModels(); + + // invoke the operation + string eventName = "231CIG"; + EventModelResource result = await collection.GetAsync(eventName); + + // 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 + EventModelData 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_ListsTheEvents() + { + // Generated from example definition: 2024-09-01/Event_List.json + // this example is just showing the usage of "EventModel_List" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this VaultModelResource created on azure + // for more information of creating VaultModelResource, please refer to the document of VaultModelResource + string subscriptionId = "930CEC23-4430-4513-B855-DBA237E2F3BF"; + string resourceGroupName = "rgswagger_2024-09-01"; + string vaultName = "4"; + ResourceIdentifier vaultModelResourceId = VaultModelResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, vaultName); + VaultModelResource vaultModel = client.GetVaultModelResource(vaultModelResourceId); + + // get the collection of this EventModelResource + EventModelCollection collection = vaultModel.GetEventModels(); + + // invoke the operation and iterate over the result + string continuationToken = "gabpzsxrifposvleqqcjnvofz"; + await foreach (EventModelResource item in collection.GetAllAsync(continuationToken: continuationToken)) + { + // 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 + EventModelData 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_GetsTheEvent() + { + // Generated from example definition: 2024-09-01/Event_Get.json + // this example is just showing the usage of "EventModel_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 VaultModelResource created on azure + // for more information of creating VaultModelResource, please refer to the document of VaultModelResource + string subscriptionId = "930CEC23-4430-4513-B855-DBA237E2F3BF"; + string resourceGroupName = "rgswagger_2024-09-01"; + string vaultName = "4"; + ResourceIdentifier vaultModelResourceId = VaultModelResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, vaultName); + VaultModelResource vaultModel = client.GetVaultModelResource(vaultModelResourceId); + + // get the collection of this EventModelResource + EventModelCollection collection = vaultModel.GetEventModels(); + + // invoke the operation + string eventName = "231CIG"; + bool result = await collection.ExistsAsync(eventName); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetIfExists_GetsTheEvent() + { + // Generated from example definition: 2024-09-01/Event_Get.json + // this example is just showing the usage of "EventModel_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 VaultModelResource created on azure + // for more information of creating VaultModelResource, please refer to the document of VaultModelResource + string subscriptionId = "930CEC23-4430-4513-B855-DBA237E2F3BF"; + string resourceGroupName = "rgswagger_2024-09-01"; + string vaultName = "4"; + ResourceIdentifier vaultModelResourceId = VaultModelResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, vaultName); + VaultModelResource vaultModel = client.GetVaultModelResource(vaultModelResourceId); + + // get the collection of this EventModelResource + EventModelCollection collection = vaultModel.GetEventModels(); + + // invoke the operation + string eventName = "231CIG"; + NullableResponse response = await collection.GetIfExistsAsync(eventName); + EventModelResource 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 + EventModelData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/samples/Generated/Samples/Sample_EventModelResource.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/samples/Generated/Samples/Sample_EventModelResource.cs new file mode 100644 index 000000000000..47acf03cf351 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/samples/Generated/Samples/Sample_EventModelResource.cs @@ -0,0 +1,49 @@ +// 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 NUnit.Framework; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Samples +{ + public partial class Sample_EventModelResource + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_GetsTheEvent() + { + // Generated from example definition: 2024-09-01/Event_Get.json + // this example is just showing the usage of "EventModel_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 EventModelResource created on azure + // for more information of creating EventModelResource, please refer to the document of EventModelResource + string subscriptionId = "930CEC23-4430-4513-B855-DBA237E2F3BF"; + string resourceGroupName = "rgswagger_2024-09-01"; + string vaultName = "4"; + string eventName = "231CIG"; + ResourceIdentifier eventModelResourceId = EventModelResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, vaultName, eventName); + EventModelResource eventModel = client.GetEventModelResource(eventModelResourceId); + + // invoke the operation + EventModelResource result = await eventModel.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 + EventModelData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/samples/Generated/Samples/Sample_FabricAgentModelCollection.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/samples/Generated/Samples/Sample_FabricAgentModelCollection.cs new file mode 100644 index 000000000000..be28e5029ae2 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/samples/Generated/Samples/Sample_FabricAgentModelCollection.cs @@ -0,0 +1,200 @@ +// 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.RecoveryServicesDataReplication.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Samples +{ + public partial class Sample_FabricAgentModelCollection + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task CreateOrUpdate_PutsTheFabricAgent() + { + // Generated from example definition: 2024-09-01/FabricAgent_Create.json + // this example is just showing the usage of "FabricAgentModel_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 FabricModelResource created on azure + // for more information of creating FabricModelResource, please refer to the document of FabricModelResource + string subscriptionId = "930CEC23-4430-4513-B855-DBA237E2F3BF"; + string resourceGroupName = "rgswagger_2024-09-01"; + string fabricName = "wPR"; + ResourceIdentifier fabricModelResourceId = FabricModelResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fabricName); + FabricModelResource fabricModel = client.GetFabricModelResource(fabricModelResourceId); + + // get the collection of this FabricAgentModelResource + FabricAgentModelCollection collection = fabricModel.GetFabricAgentModels(); + + // invoke the operation + string fabricAgentName = "M"; + FabricAgentModelData data = new FabricAgentModelData + { + Properties = new FabricAgentModelProperties("envzcoijbqhtrpncbjbhk", "y", new IdentityModel("joclkkdovixwapephhxaqtefubhhmq", "cwktzrwajuvfyyymfstpey", "khsiaqfbpuhp", "dkjobanyqgzenivyxhvavottpc", "bubwwbowfhdmujrt"), new IdentityModel("joclkkdovixwapephhxaqtefubhhmq", "cwktzrwajuvfyyymfstpey", "khsiaqfbpuhp", "dkjobanyqgzenivyxhvavottpc", "bubwwbowfhdmujrt"), null), + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, fabricAgentName, data); + FabricAgentModelResource 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 + FabricAgentModelData 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_GetsTheFabricAgent() + { + // Generated from example definition: 2024-09-01/FabricAgent_Get.json + // this example is just showing the usage of "FabricAgentModel_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 FabricModelResource created on azure + // for more information of creating FabricModelResource, please refer to the document of FabricModelResource + string subscriptionId = "930CEC23-4430-4513-B855-DBA237E2F3BF"; + string resourceGroupName = "rgrecoveryservicesdatareplication"; + string fabricName = "wPR"; + ResourceIdentifier fabricModelResourceId = FabricModelResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fabricName); + FabricModelResource fabricModel = client.GetFabricModelResource(fabricModelResourceId); + + // get the collection of this FabricAgentModelResource + FabricAgentModelCollection collection = fabricModel.GetFabricAgentModels(); + + // invoke the operation + string fabricAgentName = "M"; + FabricAgentModelResource result = await collection.GetAsync(fabricAgentName); + + // 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 + FabricAgentModelData 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_ListsTheFabricAgents() + { + // Generated from example definition: 2024-09-01/FabricAgent_List.json + // this example is just showing the usage of "FabricAgentModel_List" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this FabricModelResource created on azure + // for more information of creating FabricModelResource, please refer to the document of FabricModelResource + string subscriptionId = "930CEC23-4430-4513-B855-DBA237E2F3BF"; + string resourceGroupName = "rgswagger_2024-09-01"; + string fabricName = "wPR"; + ResourceIdentifier fabricModelResourceId = FabricModelResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fabricName); + FabricModelResource fabricModel = client.GetFabricModelResource(fabricModelResourceId); + + // get the collection of this FabricAgentModelResource + FabricAgentModelCollection collection = fabricModel.GetFabricAgentModels(); + + // invoke the operation and iterate over the result + await foreach (FabricAgentModelResource 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 + FabricAgentModelData 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_GetsTheFabricAgent() + { + // Generated from example definition: 2024-09-01/FabricAgent_Get.json + // this example is just showing the usage of "FabricAgentModel_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 FabricModelResource created on azure + // for more information of creating FabricModelResource, please refer to the document of FabricModelResource + string subscriptionId = "930CEC23-4430-4513-B855-DBA237E2F3BF"; + string resourceGroupName = "rgrecoveryservicesdatareplication"; + string fabricName = "wPR"; + ResourceIdentifier fabricModelResourceId = FabricModelResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fabricName); + FabricModelResource fabricModel = client.GetFabricModelResource(fabricModelResourceId); + + // get the collection of this FabricAgentModelResource + FabricAgentModelCollection collection = fabricModel.GetFabricAgentModels(); + + // invoke the operation + string fabricAgentName = "M"; + bool result = await collection.ExistsAsync(fabricAgentName); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetIfExists_GetsTheFabricAgent() + { + // Generated from example definition: 2024-09-01/FabricAgent_Get.json + // this example is just showing the usage of "FabricAgentModel_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 FabricModelResource created on azure + // for more information of creating FabricModelResource, please refer to the document of FabricModelResource + string subscriptionId = "930CEC23-4430-4513-B855-DBA237E2F3BF"; + string resourceGroupName = "rgrecoveryservicesdatareplication"; + string fabricName = "wPR"; + ResourceIdentifier fabricModelResourceId = FabricModelResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fabricName); + FabricModelResource fabricModel = client.GetFabricModelResource(fabricModelResourceId); + + // get the collection of this FabricAgentModelResource + FabricAgentModelCollection collection = fabricModel.GetFabricAgentModels(); + + // invoke the operation + string fabricAgentName = "M"; + NullableResponse response = await collection.GetIfExistsAsync(fabricAgentName); + FabricAgentModelResource 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 + FabricAgentModelData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/samples/Generated/Samples/Sample_FabricAgentModelResource.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/samples/Generated/Samples/Sample_FabricAgentModelResource.cs new file mode 100644 index 000000000000..31b2eccd31ff --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/samples/Generated/Samples/Sample_FabricAgentModelResource.cs @@ -0,0 +1,113 @@ +// 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.RecoveryServicesDataReplication.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Samples +{ + public partial class Sample_FabricAgentModelResource + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_GetsTheFabricAgent() + { + // Generated from example definition: 2024-09-01/FabricAgent_Get.json + // this example is just showing the usage of "FabricAgentModel_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 FabricAgentModelResource created on azure + // for more information of creating FabricAgentModelResource, please refer to the document of FabricAgentModelResource + string subscriptionId = "930CEC23-4430-4513-B855-DBA237E2F3BF"; + string resourceGroupName = "rgrecoveryservicesdatareplication"; + string fabricName = "wPR"; + string fabricAgentName = "M"; + ResourceIdentifier fabricAgentModelResourceId = FabricAgentModelResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fabricName, fabricAgentName); + FabricAgentModelResource fabricAgentModel = client.GetFabricAgentModelResource(fabricAgentModelResourceId); + + // invoke the operation + FabricAgentModelResource result = await fabricAgentModel.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 + FabricAgentModelData 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_DeletesTheFabricAgent() + { + // Generated from example definition: 2024-09-01/FabricAgent_Delete.json + // this example is just showing the usage of "FabricAgentModel_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 FabricAgentModelResource created on azure + // for more information of creating FabricAgentModelResource, please refer to the document of FabricAgentModelResource + string subscriptionId = "930CEC23-4430-4513-B855-DBA237E2F3BF"; + string resourceGroupName = "rgswagger_2024-09-01"; + string fabricName = "wPR"; + string fabricAgentName = "M"; + ResourceIdentifier fabricAgentModelResourceId = FabricAgentModelResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fabricName, fabricAgentName); + FabricAgentModelResource fabricAgentModel = client.GetFabricAgentModelResource(fabricAgentModelResourceId); + + // invoke the operation + await fabricAgentModel.DeleteAsync(WaitUntil.Completed); + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Update_PutsTheFabricAgent() + { + // Generated from example definition: 2024-09-01/FabricAgent_Create.json + // this example is just showing the usage of "FabricAgentModel_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 FabricAgentModelResource created on azure + // for more information of creating FabricAgentModelResource, please refer to the document of FabricAgentModelResource + string subscriptionId = "930CEC23-4430-4513-B855-DBA237E2F3BF"; + string resourceGroupName = "rgswagger_2024-09-01"; + string fabricName = "wPR"; + string fabricAgentName = "M"; + ResourceIdentifier fabricAgentModelResourceId = FabricAgentModelResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fabricName, fabricAgentName); + FabricAgentModelResource fabricAgentModel = client.GetFabricAgentModelResource(fabricAgentModelResourceId); + + // invoke the operation + FabricAgentModelData data = new FabricAgentModelData + { + Properties = new FabricAgentModelProperties("envzcoijbqhtrpncbjbhk", "y", new IdentityModel("joclkkdovixwapephhxaqtefubhhmq", "cwktzrwajuvfyyymfstpey", "khsiaqfbpuhp", "dkjobanyqgzenivyxhvavottpc", "bubwwbowfhdmujrt"), new IdentityModel("joclkkdovixwapephhxaqtefubhhmq", "cwktzrwajuvfyyymfstpey", "khsiaqfbpuhp", "dkjobanyqgzenivyxhvavottpc", "bubwwbowfhdmujrt"), null), + }; + ArmOperation lro = await fabricAgentModel.UpdateAsync(WaitUntil.Completed, data); + FabricAgentModelResource 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 + FabricAgentModelData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/samples/Generated/Samples/Sample_FabricModelCollection.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/samples/Generated/Samples/Sample_FabricModelCollection.cs new file mode 100644 index 000000000000..d7e08f7b2ced --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/samples/Generated/Samples/Sample_FabricModelCollection.cs @@ -0,0 +1,197 @@ +// 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.RecoveryServicesDataReplication.Models; +using Azure.ResourceManager.Resources; +using NUnit.Framework; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Samples +{ + public partial class Sample_FabricModelCollection + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task CreateOrUpdate_PutsTheFabric() + { + // Generated from example definition: 2024-09-01/Fabric_Create.json + // this example is just showing the usage of "FabricModel_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 = "930CEC23-4430-4513-B855-DBA237E2F3BF"; + string resourceGroupName = "rgswagger_2024-09-01"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this FabricModelResource + FabricModelCollection collection = resourceGroupResource.GetFabricModels(); + + // invoke the operation + string fabricName = "wPR"; + FabricModelData data = new FabricModelData(new AzureLocation("tqygutlpob")) + { + Properties = new FabricModelProperties(null), + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, fabricName, data); + FabricModelResource 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 + FabricModelData 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_GetsTheFabric() + { + // Generated from example definition: 2024-09-01/Fabric_Get.json + // this example is just showing the usage of "FabricModel_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 = "930CEC23-4430-4513-B855-DBA237E2F3BF"; + string resourceGroupName = "rgrecoveryservicesdatareplication"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this FabricModelResource + FabricModelCollection collection = resourceGroupResource.GetFabricModels(); + + // invoke the operation + string fabricName = "wPR"; + FabricModelResource result = await collection.GetAsync(fabricName); + + // 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 + FabricModelData 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_ListsTheFabrics() + { + // Generated from example definition: 2024-09-01/Fabric_List.json + // this example is just showing the usage of "FabricModel_List" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "930CEC23-4430-4513-B855-DBA237E2F3BF"; + string resourceGroupName = "rgswagger_2024-09-01"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this FabricModelResource + FabricModelCollection collection = resourceGroupResource.GetFabricModels(); + + // invoke the operation and iterate over the result + string continuationToken = "jw"; + await foreach (FabricModelResource item in collection.GetAllAsync(continuationToken: continuationToken)) + { + // 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 + FabricModelData 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_GetsTheFabric() + { + // Generated from example definition: 2024-09-01/Fabric_Get.json + // this example is just showing the usage of "FabricModel_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 = "930CEC23-4430-4513-B855-DBA237E2F3BF"; + string resourceGroupName = "rgrecoveryservicesdatareplication"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this FabricModelResource + FabricModelCollection collection = resourceGroupResource.GetFabricModels(); + + // invoke the operation + string fabricName = "wPR"; + bool result = await collection.ExistsAsync(fabricName); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetIfExists_GetsTheFabric() + { + // Generated from example definition: 2024-09-01/Fabric_Get.json + // this example is just showing the usage of "FabricModel_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 = "930CEC23-4430-4513-B855-DBA237E2F3BF"; + string resourceGroupName = "rgrecoveryservicesdatareplication"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this FabricModelResource + FabricModelCollection collection = resourceGroupResource.GetFabricModels(); + + // invoke the operation + string fabricName = "wPR"; + NullableResponse response = await collection.GetIfExistsAsync(fabricName); + FabricModelResource 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 + FabricModelData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/samples/Generated/Samples/Sample_FabricModelResource.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/samples/Generated/Samples/Sample_FabricModelResource.cs new file mode 100644 index 000000000000..7eb48a54b062 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/samples/Generated/Samples/Sample_FabricModelResource.cs @@ -0,0 +1,111 @@ +// 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.RecoveryServicesDataReplication.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Samples +{ + public partial class Sample_FabricModelResource + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_GetsTheFabric() + { + // Generated from example definition: 2024-09-01/Fabric_Get.json + // this example is just showing the usage of "FabricModel_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 FabricModelResource created on azure + // for more information of creating FabricModelResource, please refer to the document of FabricModelResource + string subscriptionId = "930CEC23-4430-4513-B855-DBA237E2F3BF"; + string resourceGroupName = "rgrecoveryservicesdatareplication"; + string fabricName = "wPR"; + ResourceIdentifier fabricModelResourceId = FabricModelResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fabricName); + FabricModelResource fabricModel = client.GetFabricModelResource(fabricModelResourceId); + + // invoke the operation + FabricModelResource result = await fabricModel.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 + FabricModelData 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_DeletesTheFabric() + { + // Generated from example definition: 2024-09-01/Fabric_Delete.json + // this example is just showing the usage of "FabricModel_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 FabricModelResource created on azure + // for more information of creating FabricModelResource, please refer to the document of FabricModelResource + string subscriptionId = "930CEC23-4430-4513-B855-DBA237E2F3BF"; + string resourceGroupName = "rgrecoveryservicesdatareplication"; + string fabricName = "wPR"; + ResourceIdentifier fabricModelResourceId = FabricModelResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fabricName); + FabricModelResource fabricModel = client.GetFabricModelResource(fabricModelResourceId); + + // invoke the operation + await fabricModel.DeleteAsync(WaitUntil.Completed); + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Update_UpdatesTheFabric() + { + // Generated from example definition: 2024-09-01/Fabric_Update.json + // this example is just showing the usage of "FabricModel_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 FabricModelResource created on azure + // for more information of creating FabricModelResource, please refer to the document of FabricModelResource + string subscriptionId = "930CEC23-4430-4513-B855-DBA237E2F3BF"; + string resourceGroupName = "rgswagger_2024-09-01"; + string fabricName = "wPR"; + ResourceIdentifier fabricModelResourceId = FabricModelResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fabricName); + FabricModelResource fabricModel = client.GetFabricModelResource(fabricModelResourceId); + + // invoke the operation + FabricModelPatch patch = new FabricModelPatch + { + Tags = { }, + Properties = new FabricModelProperties(null), + }; + ArmOperation lro = await fabricModel.UpdateAsync(WaitUntil.Completed, patch); + FabricModelResource 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 + FabricModelData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/samples/Generated/Samples/Sample_JobModelCollection.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/samples/Generated/Samples/Sample_JobModelCollection.cs new file mode 100644 index 000000000000..f98eb75d2b2f --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/samples/Generated/Samples/Sample_JobModelCollection.cs @@ -0,0 +1,161 @@ +// 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 NUnit.Framework; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Samples +{ + public partial class Sample_JobModelCollection + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_GetsTheJob() + { + // Generated from example definition: 2024-09-01/Job_Get.json + // this example is just showing the usage of "JobModel_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 VaultModelResource created on azure + // for more information of creating VaultModelResource, please refer to the document of VaultModelResource + string subscriptionId = "930CEC23-4430-4513-B855-DBA237E2F3BF"; + string resourceGroupName = "rgrecoveryservicesdatareplication"; + string vaultName = "4"; + ResourceIdentifier vaultModelResourceId = VaultModelResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, vaultName); + VaultModelResource vaultModel = client.GetVaultModelResource(vaultModelResourceId); + + // get the collection of this JobModelResource + JobModelCollection collection = vaultModel.GetJobModels(); + + // invoke the operation + string jobName = "ZGH4y"; + JobModelResource result = await collection.GetAsync(jobName); + + // 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 + JobModelData 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_ListsTheJobs() + { + // Generated from example definition: 2024-09-01/Job_List.json + // this example is just showing the usage of "JobModel_List" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this VaultModelResource created on azure + // for more information of creating VaultModelResource, please refer to the document of VaultModelResource + string subscriptionId = "930CEC23-4430-4513-B855-DBA237E2F3BF"; + string resourceGroupName = "rgrecoveryservicesdatareplication"; + string vaultName = "4"; + ResourceIdentifier vaultModelResourceId = VaultModelResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, vaultName); + VaultModelResource vaultModel = client.GetVaultModelResource(vaultModelResourceId); + + // get the collection of this JobModelResource + JobModelCollection collection = vaultModel.GetJobModels(); + + // invoke the operation and iterate over the result + string continuationToken = "rdavrzbethhslmkqgajontnxsue"; + await foreach (JobModelResource item in collection.GetAllAsync(continuationToken: continuationToken)) + { + // 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 + JobModelData 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_GetsTheJob() + { + // Generated from example definition: 2024-09-01/Job_Get.json + // this example is just showing the usage of "JobModel_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 VaultModelResource created on azure + // for more information of creating VaultModelResource, please refer to the document of VaultModelResource + string subscriptionId = "930CEC23-4430-4513-B855-DBA237E2F3BF"; + string resourceGroupName = "rgrecoveryservicesdatareplication"; + string vaultName = "4"; + ResourceIdentifier vaultModelResourceId = VaultModelResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, vaultName); + VaultModelResource vaultModel = client.GetVaultModelResource(vaultModelResourceId); + + // get the collection of this JobModelResource + JobModelCollection collection = vaultModel.GetJobModels(); + + // invoke the operation + string jobName = "ZGH4y"; + bool result = await collection.ExistsAsync(jobName); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetIfExists_GetsTheJob() + { + // Generated from example definition: 2024-09-01/Job_Get.json + // this example is just showing the usage of "JobModel_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 VaultModelResource created on azure + // for more information of creating VaultModelResource, please refer to the document of VaultModelResource + string subscriptionId = "930CEC23-4430-4513-B855-DBA237E2F3BF"; + string resourceGroupName = "rgrecoveryservicesdatareplication"; + string vaultName = "4"; + ResourceIdentifier vaultModelResourceId = VaultModelResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, vaultName); + VaultModelResource vaultModel = client.GetVaultModelResource(vaultModelResourceId); + + // get the collection of this JobModelResource + JobModelCollection collection = vaultModel.GetJobModels(); + + // invoke the operation + string jobName = "ZGH4y"; + NullableResponse response = await collection.GetIfExistsAsync(jobName); + JobModelResource 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 + JobModelData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/samples/Generated/Samples/Sample_JobModelResource.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/samples/Generated/Samples/Sample_JobModelResource.cs new file mode 100644 index 000000000000..828a9bb73eaa --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/samples/Generated/Samples/Sample_JobModelResource.cs @@ -0,0 +1,49 @@ +// 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 NUnit.Framework; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Samples +{ + public partial class Sample_JobModelResource + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_GetsTheJob() + { + // Generated from example definition: 2024-09-01/Job_Get.json + // this example is just showing the usage of "JobModel_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 JobModelResource created on azure + // for more information of creating JobModelResource, please refer to the document of JobModelResource + string subscriptionId = "930CEC23-4430-4513-B855-DBA237E2F3BF"; + string resourceGroupName = "rgrecoveryservicesdatareplication"; + string vaultName = "4"; + string jobName = "ZGH4y"; + ResourceIdentifier jobModelResourceId = JobModelResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, vaultName, jobName); + JobModelResource jobModel = client.GetJobModelResource(jobModelResourceId); + + // invoke the operation + JobModelResource result = await jobModel.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 + JobModelData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/samples/Generated/Samples/Sample_PolicyModelCollection.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/samples/Generated/Samples/Sample_PolicyModelCollection.cs new file mode 100644 index 000000000000..272b26adb206 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/samples/Generated/Samples/Sample_PolicyModelCollection.cs @@ -0,0 +1,200 @@ +// 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.RecoveryServicesDataReplication.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Samples +{ + public partial class Sample_PolicyModelCollection + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task CreateOrUpdate_PutsThePolicy() + { + // Generated from example definition: 2024-09-01/Policy_Create.json + // this example is just showing the usage of "PolicyModel_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 VaultModelResource created on azure + // for more information of creating VaultModelResource, please refer to the document of VaultModelResource + string subscriptionId = "930CEC23-4430-4513-B855-DBA237E2F3BF"; + string resourceGroupName = "rgrecoveryservicesdatareplication"; + string vaultName = "4"; + ResourceIdentifier vaultModelResourceId = VaultModelResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, vaultName); + VaultModelResource vaultModel = client.GetVaultModelResource(vaultModelResourceId); + + // get the collection of this PolicyModelResource + PolicyModelCollection collection = vaultModel.GetPolicyModels(); + + // invoke the operation + string policyName = "fafqwc"; + PolicyModelData data = new PolicyModelData + { + Properties = new PolicyModelProperties(null), + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, policyName, data); + PolicyModelResource 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 + PolicyModelData 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_GetsThePolicy() + { + // Generated from example definition: 2024-09-01/Policy_Get.json + // this example is just showing the usage of "PolicyModel_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 VaultModelResource created on azure + // for more information of creating VaultModelResource, please refer to the document of VaultModelResource + string subscriptionId = "930CEC23-4430-4513-B855-DBA237E2F3BF"; + string resourceGroupName = "rgrecoveryservicesdatareplication"; + string vaultName = "4"; + ResourceIdentifier vaultModelResourceId = VaultModelResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, vaultName); + VaultModelResource vaultModel = client.GetVaultModelResource(vaultModelResourceId); + + // get the collection of this PolicyModelResource + PolicyModelCollection collection = vaultModel.GetPolicyModels(); + + // invoke the operation + string policyName = "wdqsacasc"; + PolicyModelResource result = await collection.GetAsync(policyName); + + // 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 + PolicyModelData 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_ListsThePolicies() + { + // Generated from example definition: 2024-09-01/Policy_List.json + // this example is just showing the usage of "PolicyModel_List" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this VaultModelResource created on azure + // for more information of creating VaultModelResource, please refer to the document of VaultModelResource + string subscriptionId = "930CEC23-4430-4513-B855-DBA237E2F3BF"; + string resourceGroupName = "rgrecoveryservicesdatareplication"; + string vaultName = "4"; + ResourceIdentifier vaultModelResourceId = VaultModelResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, vaultName); + VaultModelResource vaultModel = client.GetVaultModelResource(vaultModelResourceId); + + // get the collection of this PolicyModelResource + PolicyModelCollection collection = vaultModel.GetPolicyModels(); + + // invoke the operation and iterate over the result + await foreach (PolicyModelResource 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 + PolicyModelData 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_GetsThePolicy() + { + // Generated from example definition: 2024-09-01/Policy_Get.json + // this example is just showing the usage of "PolicyModel_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 VaultModelResource created on azure + // for more information of creating VaultModelResource, please refer to the document of VaultModelResource + string subscriptionId = "930CEC23-4430-4513-B855-DBA237E2F3BF"; + string resourceGroupName = "rgrecoveryservicesdatareplication"; + string vaultName = "4"; + ResourceIdentifier vaultModelResourceId = VaultModelResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, vaultName); + VaultModelResource vaultModel = client.GetVaultModelResource(vaultModelResourceId); + + // get the collection of this PolicyModelResource + PolicyModelCollection collection = vaultModel.GetPolicyModels(); + + // invoke the operation + string policyName = "wdqsacasc"; + bool result = await collection.ExistsAsync(policyName); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetIfExists_GetsThePolicy() + { + // Generated from example definition: 2024-09-01/Policy_Get.json + // this example is just showing the usage of "PolicyModel_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 VaultModelResource created on azure + // for more information of creating VaultModelResource, please refer to the document of VaultModelResource + string subscriptionId = "930CEC23-4430-4513-B855-DBA237E2F3BF"; + string resourceGroupName = "rgrecoveryservicesdatareplication"; + string vaultName = "4"; + ResourceIdentifier vaultModelResourceId = VaultModelResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, vaultName); + VaultModelResource vaultModel = client.GetVaultModelResource(vaultModelResourceId); + + // get the collection of this PolicyModelResource + PolicyModelCollection collection = vaultModel.GetPolicyModels(); + + // invoke the operation + string policyName = "wdqsacasc"; + NullableResponse response = await collection.GetIfExistsAsync(policyName); + PolicyModelResource 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 + PolicyModelData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/samples/Generated/Samples/Sample_PolicyModelResource.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/samples/Generated/Samples/Sample_PolicyModelResource.cs new file mode 100644 index 000000000000..c39c4bebffe0 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/samples/Generated/Samples/Sample_PolicyModelResource.cs @@ -0,0 +1,113 @@ +// 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.RecoveryServicesDataReplication.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Samples +{ + public partial class Sample_PolicyModelResource + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_GetsThePolicy() + { + // Generated from example definition: 2024-09-01/Policy_Get.json + // this example is just showing the usage of "PolicyModel_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 PolicyModelResource created on azure + // for more information of creating PolicyModelResource, please refer to the document of PolicyModelResource + string subscriptionId = "930CEC23-4430-4513-B855-DBA237E2F3BF"; + string resourceGroupName = "rgrecoveryservicesdatareplication"; + string vaultName = "4"; + string policyName = "wdqsacasc"; + ResourceIdentifier policyModelResourceId = PolicyModelResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, vaultName, policyName); + PolicyModelResource policyModel = client.GetPolicyModelResource(policyModelResourceId); + + // invoke the operation + PolicyModelResource result = await policyModel.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 + PolicyModelData 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_DeletesThePolicy() + { + // Generated from example definition: 2024-09-01/Policy_Delete.json + // this example is just showing the usage of "PolicyModel_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 PolicyModelResource created on azure + // for more information of creating PolicyModelResource, please refer to the document of PolicyModelResource + string subscriptionId = "930CEC23-4430-4513-B855-DBA237E2F3BF"; + string resourceGroupName = "rgrecoveryservicesdatareplication"; + string vaultName = "4"; + string policyName = "wqfscsdv"; + ResourceIdentifier policyModelResourceId = PolicyModelResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, vaultName, policyName); + PolicyModelResource policyModel = client.GetPolicyModelResource(policyModelResourceId); + + // invoke the operation + await policyModel.DeleteAsync(WaitUntil.Completed); + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Update_PutsThePolicy() + { + // Generated from example definition: 2024-09-01/Policy_Create.json + // this example is just showing the usage of "PolicyModel_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 PolicyModelResource created on azure + // for more information of creating PolicyModelResource, please refer to the document of PolicyModelResource + string subscriptionId = "930CEC23-4430-4513-B855-DBA237E2F3BF"; + string resourceGroupName = "rgrecoveryservicesdatareplication"; + string vaultName = "4"; + string policyName = "fafqwc"; + ResourceIdentifier policyModelResourceId = PolicyModelResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, vaultName, policyName); + PolicyModelResource policyModel = client.GetPolicyModelResource(policyModelResourceId); + + // invoke the operation + PolicyModelData data = new PolicyModelData + { + Properties = new PolicyModelProperties(null), + }; + ArmOperation lro = await policyModel.UpdateAsync(WaitUntil.Completed, data); + PolicyModelResource 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 + PolicyModelData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/samples/Generated/Samples/Sample_PrivateEndpointConnectionProxyCollection.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/samples/Generated/Samples/Sample_PrivateEndpointConnectionProxyCollection.cs new file mode 100644 index 000000000000..ac4f0c70f2b8 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/samples/Generated/Samples/Sample_PrivateEndpointConnectionProxyCollection.cs @@ -0,0 +1,246 @@ +// 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.RecoveryServicesDataReplication.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Samples +{ + public partial class Sample_PrivateEndpointConnectionProxyCollection + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task CreateOrUpdate_CreatesThePrivateEndpointConnectionProxy() + { + // Generated from example definition: 2024-09-01/PrivateEndpointConnectionProxy_Create.json + // this example is just showing the usage of "PrivateEndpointConnectionProxy_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 VaultModelResource created on azure + // for more information of creating VaultModelResource, please refer to the document of VaultModelResource + string subscriptionId = "930CEC23-4430-4513-B855-DBA237E2F3BF"; + string resourceGroupName = "rgswagger_2024-09-01"; + string vaultName = "4"; + ResourceIdentifier vaultModelResourceId = VaultModelResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, vaultName); + VaultModelResource vaultModel = client.GetVaultModelResource(vaultModelResourceId); + + // get the collection of this PrivateEndpointConnectionProxyResource + PrivateEndpointConnectionProxyCollection collection = vaultModel.GetPrivateEndpointConnectionProxies(); + + // invoke the operation + string privateEndpointConnectionProxyName = "d"; + PrivateEndpointConnectionProxyData data = new PrivateEndpointConnectionProxyData + { + Properties = new PrivateEndpointConnectionProxyProperties + { + RemotePrivateEndpoint = new RemotePrivateEndpoint("yipalno") + { + PrivateLinkServiceConnections = {new PrivateLinkServiceConnection +{ +Name = "jqwntlzfsksl", +GroupIds = {"hvejynjktikteipnioyeja"}, +RequestMessage = "bukgzpkvcvfbmcdmpcbiigbvugicqa", +}}, + ManualPrivateLinkServiceConnections = {new PrivateLinkServiceConnection +{ +Name = "jqwntlzfsksl", +GroupIds = {"hvejynjktikteipnioyeja"}, +RequestMessage = "bukgzpkvcvfbmcdmpcbiigbvugicqa", +}}, + PrivateLinkServiceProxies = {new PrivateLinkServiceProxy +{ +Id = "nzqxevuyqeedrqnkbnlcyrrrbzxvl", +RemotePrivateLinkServiceConnectionState = new RecoveryServicesDataReplicationPrivateLinkServiceConnectionState +{ +Status = PrivateEndpointConnectionStatus.Approved, +Description = "y", +ActionsRequired = "afwbq", +}, +RemotePrivateEndpointConnectionId = new ResourceIdentifier("ocunsgawjsqohkrcyxiv"), +GroupConnectivityInformation = {new GroupConnectivityInformation +{ +GroupId = "per", +MemberName = "ybptuypgdqoxkuwqx", +CustomerVisibleFqdns = {"vedcg"}, +InternalFqdn = "maqavwhxwzzhbzjbryyquvitmup", +RedirectMapId = "pezncxcq", +PrivateLinkServiceArmRegion = "rerkqqxinteevmlbrdkktaqhcch", +}}, +}}, + ConnectionDetails = {new ConnectionDetails +{ +Id = "lenqkogzkes", +PrivateIPAddress = "cyiacdzzyqmxjpijjbwgasegehtqe", +LinkIdentifier = "ravfufhkdowufd", +GroupId = "pjrlygpadir", +MemberName = "ybuysjrlfupewxe", +}}, + }, + }, + ETag = "hruibxrezstxroxrxweh", + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, privateEndpointConnectionProxyName, data); + PrivateEndpointConnectionProxyResource 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 + PrivateEndpointConnectionProxyData 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_GetPrivateEndpointConnectionProxy() + { + // Generated from example definition: 2024-09-01/PrivateEndpointConnectionProxy_Get.json + // this example is just showing the usage of "PrivateEndpointConnectionProxy_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 VaultModelResource created on azure + // for more information of creating VaultModelResource, please refer to the document of VaultModelResource + string subscriptionId = "930CEC23-4430-4513-B855-DBA237E2F3BF"; + string resourceGroupName = "rgswagger_2024-09-01"; + string vaultName = "4"; + ResourceIdentifier vaultModelResourceId = VaultModelResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, vaultName); + VaultModelResource vaultModel = client.GetVaultModelResource(vaultModelResourceId); + + // get the collection of this PrivateEndpointConnectionProxyResource + PrivateEndpointConnectionProxyCollection collection = vaultModel.GetPrivateEndpointConnectionProxies(); + + // invoke the operation + string privateEndpointConnectionProxyName = "d"; + PrivateEndpointConnectionProxyResource result = await collection.GetAsync(privateEndpointConnectionProxyName); + + // 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 + PrivateEndpointConnectionProxyData 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_ListsThePrivateEndpointConnectionProxy() + { + // Generated from example definition: 2024-09-01/PrivateEndpointConnectionProxy_List.json + // this example is just showing the usage of "PrivateEndpointConnectionProxy_List" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this VaultModelResource created on azure + // for more information of creating VaultModelResource, please refer to the document of VaultModelResource + string subscriptionId = "930CEC23-4430-4513-B855-DBA237E2F3BF"; + string resourceGroupName = "rgswagger_2024-09-01"; + string vaultName = "4"; + ResourceIdentifier vaultModelResourceId = VaultModelResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, vaultName); + VaultModelResource vaultModel = client.GetVaultModelResource(vaultModelResourceId); + + // get the collection of this PrivateEndpointConnectionProxyResource + PrivateEndpointConnectionProxyCollection collection = vaultModel.GetPrivateEndpointConnectionProxies(); + + // invoke the operation and iterate over the result + await foreach (PrivateEndpointConnectionProxyResource 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 + PrivateEndpointConnectionProxyData 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_GetPrivateEndpointConnectionProxy() + { + // Generated from example definition: 2024-09-01/PrivateEndpointConnectionProxy_Get.json + // this example is just showing the usage of "PrivateEndpointConnectionProxy_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 VaultModelResource created on azure + // for more information of creating VaultModelResource, please refer to the document of VaultModelResource + string subscriptionId = "930CEC23-4430-4513-B855-DBA237E2F3BF"; + string resourceGroupName = "rgswagger_2024-09-01"; + string vaultName = "4"; + ResourceIdentifier vaultModelResourceId = VaultModelResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, vaultName); + VaultModelResource vaultModel = client.GetVaultModelResource(vaultModelResourceId); + + // get the collection of this PrivateEndpointConnectionProxyResource + PrivateEndpointConnectionProxyCollection collection = vaultModel.GetPrivateEndpointConnectionProxies(); + + // invoke the operation + string privateEndpointConnectionProxyName = "d"; + bool result = await collection.ExistsAsync(privateEndpointConnectionProxyName); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetIfExists_GetPrivateEndpointConnectionProxy() + { + // Generated from example definition: 2024-09-01/PrivateEndpointConnectionProxy_Get.json + // this example is just showing the usage of "PrivateEndpointConnectionProxy_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 VaultModelResource created on azure + // for more information of creating VaultModelResource, please refer to the document of VaultModelResource + string subscriptionId = "930CEC23-4430-4513-B855-DBA237E2F3BF"; + string resourceGroupName = "rgswagger_2024-09-01"; + string vaultName = "4"; + ResourceIdentifier vaultModelResourceId = VaultModelResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, vaultName); + VaultModelResource vaultModel = client.GetVaultModelResource(vaultModelResourceId); + + // get the collection of this PrivateEndpointConnectionProxyResource + PrivateEndpointConnectionProxyCollection collection = vaultModel.GetPrivateEndpointConnectionProxies(); + + // invoke the operation + string privateEndpointConnectionProxyName = "d"; + NullableResponse response = await collection.GetIfExistsAsync(privateEndpointConnectionProxyName); + PrivateEndpointConnectionProxyResource 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 + PrivateEndpointConnectionProxyData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/samples/Generated/Samples/Sample_PrivateEndpointConnectionProxyResource.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/samples/Generated/Samples/Sample_PrivateEndpointConnectionProxyResource.cs new file mode 100644 index 000000000000..427fbc79c551 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/samples/Generated/Samples/Sample_PrivateEndpointConnectionProxyResource.cs @@ -0,0 +1,240 @@ +// 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.RecoveryServicesDataReplication.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Samples +{ + public partial class Sample_PrivateEndpointConnectionProxyResource + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_GetPrivateEndpointConnectionProxy() + { + // Generated from example definition: 2024-09-01/PrivateEndpointConnectionProxy_Get.json + // this example is just showing the usage of "PrivateEndpointConnectionProxy_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 PrivateEndpointConnectionProxyResource created on azure + // for more information of creating PrivateEndpointConnectionProxyResource, please refer to the document of PrivateEndpointConnectionProxyResource + string subscriptionId = "930CEC23-4430-4513-B855-DBA237E2F3BF"; + string resourceGroupName = "rgswagger_2024-09-01"; + string vaultName = "4"; + string privateEndpointConnectionProxyName = "d"; + ResourceIdentifier privateEndpointConnectionProxyResourceId = PrivateEndpointConnectionProxyResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, vaultName, privateEndpointConnectionProxyName); + PrivateEndpointConnectionProxyResource privateEndpointConnectionProxy = client.GetPrivateEndpointConnectionProxyResource(privateEndpointConnectionProxyResourceId); + + // invoke the operation + PrivateEndpointConnectionProxyResource result = await privateEndpointConnectionProxy.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 + PrivateEndpointConnectionProxyData 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_DeletesThePrivateEndpointProxyConnection() + { + // Generated from example definition: 2024-09-01/PrivateEndpointConnectionProxy_Delete.json + // this example is just showing the usage of "PrivateEndpointConnectionProxy_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 PrivateEndpointConnectionProxyResource created on azure + // for more information of creating PrivateEndpointConnectionProxyResource, please refer to the document of PrivateEndpointConnectionProxyResource + string subscriptionId = "930CEC23-4430-4513-B855-DBA237E2F3BF"; + string resourceGroupName = "rgswagger_2024-09-01"; + string vaultName = "4"; + string privateEndpointConnectionProxyName = "d"; + ResourceIdentifier privateEndpointConnectionProxyResourceId = PrivateEndpointConnectionProxyResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, vaultName, privateEndpointConnectionProxyName); + PrivateEndpointConnectionProxyResource privateEndpointConnectionProxy = client.GetPrivateEndpointConnectionProxyResource(privateEndpointConnectionProxyResourceId); + + // invoke the operation + await privateEndpointConnectionProxy.DeleteAsync(WaitUntil.Completed); + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Update_CreatesThePrivateEndpointConnectionProxy() + { + // Generated from example definition: 2024-09-01/PrivateEndpointConnectionProxy_Create.json + // this example is just showing the usage of "PrivateEndpointConnectionProxy_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 PrivateEndpointConnectionProxyResource created on azure + // for more information of creating PrivateEndpointConnectionProxyResource, please refer to the document of PrivateEndpointConnectionProxyResource + string subscriptionId = "930CEC23-4430-4513-B855-DBA237E2F3BF"; + string resourceGroupName = "rgswagger_2024-09-01"; + string vaultName = "4"; + string privateEndpointConnectionProxyName = "d"; + ResourceIdentifier privateEndpointConnectionProxyResourceId = PrivateEndpointConnectionProxyResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, vaultName, privateEndpointConnectionProxyName); + PrivateEndpointConnectionProxyResource privateEndpointConnectionProxy = client.GetPrivateEndpointConnectionProxyResource(privateEndpointConnectionProxyResourceId); + + // invoke the operation + PrivateEndpointConnectionProxyData data = new PrivateEndpointConnectionProxyData + { + Properties = new PrivateEndpointConnectionProxyProperties + { + RemotePrivateEndpoint = new RemotePrivateEndpoint("yipalno") + { + PrivateLinkServiceConnections = {new PrivateLinkServiceConnection +{ +Name = "jqwntlzfsksl", +GroupIds = {"hvejynjktikteipnioyeja"}, +RequestMessage = "bukgzpkvcvfbmcdmpcbiigbvugicqa", +}}, + ManualPrivateLinkServiceConnections = {new PrivateLinkServiceConnection +{ +Name = "jqwntlzfsksl", +GroupIds = {"hvejynjktikteipnioyeja"}, +RequestMessage = "bukgzpkvcvfbmcdmpcbiigbvugicqa", +}}, + PrivateLinkServiceProxies = {new PrivateLinkServiceProxy +{ +Id = "nzqxevuyqeedrqnkbnlcyrrrbzxvl", +RemotePrivateLinkServiceConnectionState = new RecoveryServicesDataReplicationPrivateLinkServiceConnectionState +{ +Status = PrivateEndpointConnectionStatus.Approved, +Description = "y", +ActionsRequired = "afwbq", +}, +RemotePrivateEndpointConnectionId = new ResourceIdentifier("ocunsgawjsqohkrcyxiv"), +GroupConnectivityInformation = {new GroupConnectivityInformation +{ +GroupId = "per", +MemberName = "ybptuypgdqoxkuwqx", +CustomerVisibleFqdns = {"vedcg"}, +InternalFqdn = "maqavwhxwzzhbzjbryyquvitmup", +RedirectMapId = "pezncxcq", +PrivateLinkServiceArmRegion = "rerkqqxinteevmlbrdkktaqhcch", +}}, +}}, + ConnectionDetails = {new ConnectionDetails +{ +Id = "lenqkogzkes", +PrivateIPAddress = "cyiacdzzyqmxjpijjbwgasegehtqe", +LinkIdentifier = "ravfufhkdowufd", +GroupId = "pjrlygpadir", +MemberName = "ybuysjrlfupewxe", +}}, + }, + }, + ETag = "hruibxrezstxroxrxweh", + }; + ArmOperation lro = await privateEndpointConnectionProxy.UpdateAsync(WaitUntil.Completed, data); + PrivateEndpointConnectionProxyResource 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 + PrivateEndpointConnectionProxyData 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 Validate_ValidatesThePrivateEndpointConnectionProxy() + { + // Generated from example definition: 2024-09-01/PrivateEndpointConnectionProxy_Validate.json + // this example is just showing the usage of "PrivateEndpointConnectionProxies_Validate" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details 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 PrivateEndpointConnectionProxyResource created on azure + // for more information of creating PrivateEndpointConnectionProxyResource, please refer to the document of PrivateEndpointConnectionProxyResource + string subscriptionId = "930CEC23-4430-4513-B855-DBA237E2F3BF"; + string resourceGroupName = "rgswagger_2024-09-01"; + string vaultName = "4"; + string privateEndpointConnectionProxyName = "d"; + ResourceIdentifier privateEndpointConnectionProxyResourceId = PrivateEndpointConnectionProxyResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, vaultName, privateEndpointConnectionProxyName); + PrivateEndpointConnectionProxyResource privateEndpointConnectionProxy = client.GetPrivateEndpointConnectionProxyResource(privateEndpointConnectionProxyResourceId); + + // invoke the operation + PrivateEndpointConnectionProxyData data = new PrivateEndpointConnectionProxyData + { + Properties = new PrivateEndpointConnectionProxyProperties + { + RemotePrivateEndpoint = new RemotePrivateEndpoint("yipalno") + { + PrivateLinkServiceConnections = {new PrivateLinkServiceConnection +{ +Name = "jqwntlzfsksl", +GroupIds = {"hvejynjktikteipnioyeja"}, +RequestMessage = "bukgzpkvcvfbmcdmpcbiigbvugicqa", +}}, + ManualPrivateLinkServiceConnections = {new PrivateLinkServiceConnection +{ +Name = "jqwntlzfsksl", +GroupIds = {"hvejynjktikteipnioyeja"}, +RequestMessage = "bukgzpkvcvfbmcdmpcbiigbvugicqa", +}}, + PrivateLinkServiceProxies = {new PrivateLinkServiceProxy +{ +Id = "nzqxevuyqeedrqnkbnlcyrrrbzxvl", +RemotePrivateLinkServiceConnectionState = new RecoveryServicesDataReplicationPrivateLinkServiceConnectionState +{ +Status = PrivateEndpointConnectionStatus.Approved, +Description = "y", +ActionsRequired = "afwbq", +}, +RemotePrivateEndpointConnectionId = new ResourceIdentifier("ocunsgawjsqohkrcyxiv"), +GroupConnectivityInformation = {new GroupConnectivityInformation +{ +GroupId = "per", +MemberName = "ybptuypgdqoxkuwqx", +CustomerVisibleFqdns = {"vedcg"}, +InternalFqdn = "maqavwhxwzzhbzjbryyquvitmup", +RedirectMapId = "pezncxcq", +PrivateLinkServiceArmRegion = "rerkqqxinteevmlbrdkktaqhcch", +}}, +}}, + ConnectionDetails = {new ConnectionDetails +{ +Id = "lenqkogzkes", +PrivateIPAddress = "cyiacdzzyqmxjpijjbwgasegehtqe", +LinkIdentifier = "ravfufhkdowufd", +GroupId = "pjrlygpadir", +MemberName = "ybuysjrlfupewxe", +}}, + }, + }, + ETag = "hruibxrezstxroxrxweh", + }; + PrivateEndpointConnectionProxyResource result = await privateEndpointConnectionProxy.ValidateAsync(data); + + // 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 + PrivateEndpointConnectionProxyData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/samples/Generated/Samples/Sample_ProtectedItemModelCollection.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/samples/Generated/Samples/Sample_ProtectedItemModelCollection.cs new file mode 100644 index 000000000000..8289e2a1c8fe --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/samples/Generated/Samples/Sample_ProtectedItemModelCollection.cs @@ -0,0 +1,200 @@ +// 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.RecoveryServicesDataReplication.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Samples +{ + public partial class Sample_ProtectedItemModelCollection + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task CreateOrUpdate_PutsTheProtectedItem() + { + // Generated from example definition: 2024-09-01/ProtectedItem_Create.json + // this example is just showing the usage of "ProtectedItemModel_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 VaultModelResource created on azure + // for more information of creating VaultModelResource, please refer to the document of VaultModelResource + string subscriptionId = "930CEC23-4430-4513-B855-DBA237E2F3BF"; + string resourceGroupName = "rgrecoveryservicesdatareplication"; + string vaultName = "4"; + ResourceIdentifier vaultModelResourceId = VaultModelResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, vaultName); + VaultModelResource vaultModel = client.GetVaultModelResource(vaultModelResourceId); + + // get the collection of this ProtectedItemModelResource + ProtectedItemModelCollection collection = vaultModel.GetProtectedItemModels(); + + // invoke the operation + string protectedItemName = "d"; + ProtectedItemModelData data = new ProtectedItemModelData + { + Properties = new ProtectedItemModelProperties("tjoeiynplt", "jwxdo", null), + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, protectedItemName, data); + ProtectedItemModelResource 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 + ProtectedItemModelData 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_GetsTheProtectedItem() + { + // Generated from example definition: 2024-09-01/ProtectedItem_Get.json + // this example is just showing the usage of "ProtectedItemModel_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 VaultModelResource created on azure + // for more information of creating VaultModelResource, please refer to the document of VaultModelResource + string subscriptionId = "930CEC23-4430-4513-B855-DBA237E2F3BF"; + string resourceGroupName = "rgrecoveryservicesdatareplication"; + string vaultName = "4"; + ResourceIdentifier vaultModelResourceId = VaultModelResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, vaultName); + VaultModelResource vaultModel = client.GetVaultModelResource(vaultModelResourceId); + + // get the collection of this ProtectedItemModelResource + ProtectedItemModelCollection collection = vaultModel.GetProtectedItemModels(); + + // invoke the operation + string protectedItemName = "d"; + ProtectedItemModelResource result = await collection.GetAsync(protectedItemName); + + // 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 + ProtectedItemModelData 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_ListsTheProtectedItems() + { + // Generated from example definition: 2024-09-01/ProtectedItem_List.json + // this example is just showing the usage of "ProtectedItemModel_List" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this VaultModelResource created on azure + // for more information of creating VaultModelResource, please refer to the document of VaultModelResource + string subscriptionId = "930CEC23-4430-4513-B855-DBA237E2F3BF"; + string resourceGroupName = "rgrecoveryservicesdatareplication"; + string vaultName = "4"; + ResourceIdentifier vaultModelResourceId = VaultModelResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, vaultName); + VaultModelResource vaultModel = client.GetVaultModelResource(vaultModelResourceId); + + // get the collection of this ProtectedItemModelResource + ProtectedItemModelCollection collection = vaultModel.GetProtectedItemModels(); + + // invoke the operation and iterate over the result + await foreach (ProtectedItemModelResource 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 + ProtectedItemModelData 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_GetsTheProtectedItem() + { + // Generated from example definition: 2024-09-01/ProtectedItem_Get.json + // this example is just showing the usage of "ProtectedItemModel_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 VaultModelResource created on azure + // for more information of creating VaultModelResource, please refer to the document of VaultModelResource + string subscriptionId = "930CEC23-4430-4513-B855-DBA237E2F3BF"; + string resourceGroupName = "rgrecoveryservicesdatareplication"; + string vaultName = "4"; + ResourceIdentifier vaultModelResourceId = VaultModelResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, vaultName); + VaultModelResource vaultModel = client.GetVaultModelResource(vaultModelResourceId); + + // get the collection of this ProtectedItemModelResource + ProtectedItemModelCollection collection = vaultModel.GetProtectedItemModels(); + + // invoke the operation + string protectedItemName = "d"; + bool result = await collection.ExistsAsync(protectedItemName); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetIfExists_GetsTheProtectedItem() + { + // Generated from example definition: 2024-09-01/ProtectedItem_Get.json + // this example is just showing the usage of "ProtectedItemModel_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 VaultModelResource created on azure + // for more information of creating VaultModelResource, please refer to the document of VaultModelResource + string subscriptionId = "930CEC23-4430-4513-B855-DBA237E2F3BF"; + string resourceGroupName = "rgrecoveryservicesdatareplication"; + string vaultName = "4"; + ResourceIdentifier vaultModelResourceId = VaultModelResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, vaultName); + VaultModelResource vaultModel = client.GetVaultModelResource(vaultModelResourceId); + + // get the collection of this ProtectedItemModelResource + ProtectedItemModelCollection collection = vaultModel.GetProtectedItemModels(); + + // invoke the operation + string protectedItemName = "d"; + NullableResponse response = await collection.GetIfExistsAsync(protectedItemName); + ProtectedItemModelResource 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 + ProtectedItemModelData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/samples/Generated/Samples/Sample_ProtectedItemModelResource.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/samples/Generated/Samples/Sample_ProtectedItemModelResource.cs new file mode 100644 index 000000000000..f8949871c6fe --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/samples/Generated/Samples/Sample_ProtectedItemModelResource.cs @@ -0,0 +1,140 @@ +// 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.RecoveryServicesDataReplication.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Samples +{ + public partial class Sample_ProtectedItemModelResource + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_GetsTheProtectedItem() + { + // Generated from example definition: 2024-09-01/ProtectedItem_Get.json + // this example is just showing the usage of "ProtectedItemModel_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 ProtectedItemModelResource created on azure + // for more information of creating ProtectedItemModelResource, please refer to the document of ProtectedItemModelResource + string subscriptionId = "930CEC23-4430-4513-B855-DBA237E2F3BF"; + string resourceGroupName = "rgrecoveryservicesdatareplication"; + string vaultName = "4"; + string protectedItemName = "d"; + ResourceIdentifier protectedItemModelResourceId = ProtectedItemModelResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, vaultName, protectedItemName); + ProtectedItemModelResource protectedItemModel = client.GetProtectedItemModelResource(protectedItemModelResourceId); + + // invoke the operation + ProtectedItemModelResource result = await protectedItemModel.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 + ProtectedItemModelData 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_DeletesTheProtectedItem() + { + // Generated from example definition: 2024-09-01/ProtectedItem_Delete.json + // this example is just showing the usage of "ProtectedItemModel_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 ProtectedItemModelResource created on azure + // for more information of creating ProtectedItemModelResource, please refer to the document of ProtectedItemModelResource + string subscriptionId = "930CEC23-4430-4513-B855-DBA237E2F3BF"; + string resourceGroupName = "rgrecoveryservicesdatareplication"; + string vaultName = "4"; + string protectedItemName = "d"; + ResourceIdentifier protectedItemModelResourceId = ProtectedItemModelResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, vaultName, protectedItemName); + ProtectedItemModelResource protectedItemModel = client.GetProtectedItemModelResource(protectedItemModelResourceId); + + // invoke the operation + bool? forceDelete = true; + await protectedItemModel.DeleteAsync(WaitUntil.Completed, forceDelete: forceDelete); + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Update_UpdateProtectedItem() + { + // Generated from example definition: 2024-09-01/ProtectedItem_Update.json + // this example is just showing the usage of "ProtectedItemModel_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 ProtectedItemModelResource created on azure + // for more information of creating ProtectedItemModelResource, please refer to the document of ProtectedItemModelResource + string subscriptionId = "930CEC23-4430-4513-B855-DBA237E2F3BF"; + string resourceGroupName = "rgswagger_2024-09-01"; + string vaultName = "4"; + string protectedItemName = "d"; + ResourceIdentifier protectedItemModelResourceId = ProtectedItemModelResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, vaultName, protectedItemName); + ProtectedItemModelResource protectedItemModel = client.GetProtectedItemModelResource(protectedItemModelResourceId); + + // invoke the operation + ProtectedItemModelPatch patch = new ProtectedItemModelPatch(); + ArmOperation lro = await protectedItemModel.UpdateAsync(WaitUntil.Completed, patch); + ProtectedItemModelResource 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 + ProtectedItemModelData 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 PlannedFailover_PerformsPlannedFailover() + { + // Generated from example definition: 2024-09-01/ProtectedItem_PlannedFailover.json + // this example is just showing the usage of "ProtectedItem_PlannedFailover" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details 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 ProtectedItemModelResource created on azure + // for more information of creating ProtectedItemModelResource, please refer to the document of ProtectedItemModelResource + string subscriptionId = "930CEC23-4430-4513-B855-DBA237E2F3BF"; + string resourceGroupName = "rgrecoveryservicesdatareplication"; + string vaultName = "4"; + string protectedItemName = "d"; + ResourceIdentifier protectedItemModelResourceId = ProtectedItemModelResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, vaultName, protectedItemName); + ProtectedItemModelResource protectedItemModel = client.GetProtectedItemModelResource(protectedItemModelResourceId); + + // invoke the operation + PlannedFailoverModel body = new PlannedFailoverModel(new PlannedFailoverModelProperties(null)); + ArmOperation lro = await protectedItemModel.PlannedFailoverAsync(WaitUntil.Completed, body); + PlannedFailoverModel result = lro.Value; + + Console.WriteLine($"Succeeded: {result}"); + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/samples/Generated/Samples/Sample_RecoveryPointModelCollection.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/samples/Generated/Samples/Sample_RecoveryPointModelCollection.cs new file mode 100644 index 000000000000..e66c7014adec --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/samples/Generated/Samples/Sample_RecoveryPointModelCollection.cs @@ -0,0 +1,164 @@ +// 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 NUnit.Framework; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Samples +{ + public partial class Sample_RecoveryPointModelCollection + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_GetsTheRecoveryPoint() + { + // Generated from example definition: 2024-09-01/RecoveryPoints_Get.json + // this example is just showing the usage of "RecoveryPointModel_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 ProtectedItemModelResource created on azure + // for more information of creating ProtectedItemModelResource, please refer to the document of ProtectedItemModelResource + string subscriptionId = "930CEC23-4430-4513-B855-DBA237E2F3BF"; + string resourceGroupName = "rgrecoveryservicesdatareplication"; + string vaultName = "4"; + string protectedItemName = "d"; + ResourceIdentifier protectedItemModelResourceId = ProtectedItemModelResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, vaultName, protectedItemName); + ProtectedItemModelResource protectedItemModel = client.GetProtectedItemModelResource(protectedItemModelResourceId); + + // get the collection of this RecoveryPointModelResource + RecoveryPointModelCollection collection = protectedItemModel.GetRecoveryPointModels(); + + // invoke the operation + string recoveryPointName = "1X"; + RecoveryPointModelResource result = await collection.GetAsync(recoveryPointName); + + // 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 + RecoveryPointModelData 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_ListsTheRecoveryPoints() + { + // Generated from example definition: 2024-09-01/RecoveryPoints_List.json + // this example is just showing the usage of "RecoveryPointModel_List" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ProtectedItemModelResource created on azure + // for more information of creating ProtectedItemModelResource, please refer to the document of ProtectedItemModelResource + string subscriptionId = "930CEC23-4430-4513-B855-DBA237E2F3BF"; + string resourceGroupName = "rgrecoveryservicesdatareplication"; + string vaultName = "4"; + string protectedItemName = "d"; + ResourceIdentifier protectedItemModelResourceId = ProtectedItemModelResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, vaultName, protectedItemName); + ProtectedItemModelResource protectedItemModel = client.GetProtectedItemModelResource(protectedItemModelResourceId); + + // get the collection of this RecoveryPointModelResource + RecoveryPointModelCollection collection = protectedItemModel.GetRecoveryPointModels(); + + // invoke the operation and iterate over the result + await foreach (RecoveryPointModelResource 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 + RecoveryPointModelData 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_GetsTheRecoveryPoint() + { + // Generated from example definition: 2024-09-01/RecoveryPoints_Get.json + // this example is just showing the usage of "RecoveryPointModel_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 ProtectedItemModelResource created on azure + // for more information of creating ProtectedItemModelResource, please refer to the document of ProtectedItemModelResource + string subscriptionId = "930CEC23-4430-4513-B855-DBA237E2F3BF"; + string resourceGroupName = "rgrecoveryservicesdatareplication"; + string vaultName = "4"; + string protectedItemName = "d"; + ResourceIdentifier protectedItemModelResourceId = ProtectedItemModelResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, vaultName, protectedItemName); + ProtectedItemModelResource protectedItemModel = client.GetProtectedItemModelResource(protectedItemModelResourceId); + + // get the collection of this RecoveryPointModelResource + RecoveryPointModelCollection collection = protectedItemModel.GetRecoveryPointModels(); + + // invoke the operation + string recoveryPointName = "1X"; + bool result = await collection.ExistsAsync(recoveryPointName); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetIfExists_GetsTheRecoveryPoint() + { + // Generated from example definition: 2024-09-01/RecoveryPoints_Get.json + // this example is just showing the usage of "RecoveryPointModel_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 ProtectedItemModelResource created on azure + // for more information of creating ProtectedItemModelResource, please refer to the document of ProtectedItemModelResource + string subscriptionId = "930CEC23-4430-4513-B855-DBA237E2F3BF"; + string resourceGroupName = "rgrecoveryservicesdatareplication"; + string vaultName = "4"; + string protectedItemName = "d"; + ResourceIdentifier protectedItemModelResourceId = ProtectedItemModelResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, vaultName, protectedItemName); + ProtectedItemModelResource protectedItemModel = client.GetProtectedItemModelResource(protectedItemModelResourceId); + + // get the collection of this RecoveryPointModelResource + RecoveryPointModelCollection collection = protectedItemModel.GetRecoveryPointModels(); + + // invoke the operation + string recoveryPointName = "1X"; + NullableResponse response = await collection.GetIfExistsAsync(recoveryPointName); + RecoveryPointModelResource 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 + RecoveryPointModelData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/samples/Generated/Samples/Sample_RecoveryPointModelResource.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/samples/Generated/Samples/Sample_RecoveryPointModelResource.cs new file mode 100644 index 000000000000..7ed4ca2b6adb --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/samples/Generated/Samples/Sample_RecoveryPointModelResource.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 NUnit.Framework; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Samples +{ + public partial class Sample_RecoveryPointModelResource + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_GetsTheRecoveryPoint() + { + // Generated from example definition: 2024-09-01/RecoveryPoints_Get.json + // this example is just showing the usage of "RecoveryPointModel_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 RecoveryPointModelResource created on azure + // for more information of creating RecoveryPointModelResource, please refer to the document of RecoveryPointModelResource + string subscriptionId = "930CEC23-4430-4513-B855-DBA237E2F3BF"; + string resourceGroupName = "rgrecoveryservicesdatareplication"; + string vaultName = "4"; + string protectedItemName = "d"; + string recoveryPointName = "1X"; + ResourceIdentifier recoveryPointModelResourceId = RecoveryPointModelResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, vaultName, protectedItemName, recoveryPointName); + RecoveryPointModelResource recoveryPointModel = client.GetRecoveryPointModelResource(recoveryPointModelResourceId); + + // invoke the operation + RecoveryPointModelResource result = await recoveryPointModel.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 + RecoveryPointModelData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/samples/Generated/Samples/Sample_RecoveryServicesDataReplicationPrivateEndpointConnectionCollection.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/samples/Generated/Samples/Sample_RecoveryServicesDataReplicationPrivateEndpointConnectionCollection.cs new file mode 100644 index 000000000000..da9deec64e90 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/samples/Generated/Samples/Sample_RecoveryServicesDataReplicationPrivateEndpointConnectionCollection.cs @@ -0,0 +1,209 @@ +// 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.RecoveryServicesDataReplication.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Samples +{ + public partial class Sample_RecoveryServicesDataReplicationPrivateEndpointConnectionCollection + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task CreateOrUpdate_UpdatesThePrivateEndpointConnection() + { + // Generated from example definition: 2024-09-01/PrivateEndpointConnection_Update.json + // this example is just showing the usage of "PrivateEndpointConnection_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 VaultModelResource created on azure + // for more information of creating VaultModelResource, please refer to the document of VaultModelResource + string subscriptionId = "930CEC23-4430-4513-B855-DBA237E2F3BF"; + string resourceGroupName = "rgswagger_2024-09-01"; + string vaultName = "4"; + ResourceIdentifier vaultModelResourceId = VaultModelResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, vaultName); + VaultModelResource vaultModel = client.GetVaultModelResource(vaultModelResourceId); + + // get the collection of this RecoveryServicesDataReplicationPrivateEndpointConnectionResource + RecoveryServicesDataReplicationPrivateEndpointConnectionCollection collection = vaultModel.GetRecoveryServicesDataReplicationPrivateEndpointConnections(); + + // invoke the operation + string privateEndpointConnectionName = "jitf"; + RecoveryServicesDataReplicationPrivateEndpointConnectionData data = new RecoveryServicesDataReplicationPrivateEndpointConnectionData + { + Properties = new PrivateEndpointConnectionResponseProperties + { + PrivateEndpointId = new ResourceIdentifier("cwcdqoynostmqwdwy"), + PrivateLinkServiceConnectionState = new RecoveryServicesDataReplicationPrivateLinkServiceConnectionState + { + Status = PrivateEndpointConnectionStatus.Approved, + Description = "y", + ActionsRequired = "afwbq", + }, + }, + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, privateEndpointConnectionName, data); + RecoveryServicesDataReplicationPrivateEndpointConnectionResource 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 + RecoveryServicesDataReplicationPrivateEndpointConnectionData 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_GetsThePrivateEndpointConnection() + { + // Generated from example definition: 2024-09-01/PrivateEndpointConnection_Get.json + // this example is just showing the usage of "PrivateEndpointConnection_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 VaultModelResource created on azure + // for more information of creating VaultModelResource, please refer to the document of VaultModelResource + string subscriptionId = "930CEC23-4430-4513-B855-DBA237E2F3BF"; + string resourceGroupName = "rgswagger_2024-09-01"; + string vaultName = "4"; + ResourceIdentifier vaultModelResourceId = VaultModelResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, vaultName); + VaultModelResource vaultModel = client.GetVaultModelResource(vaultModelResourceId); + + // get the collection of this RecoveryServicesDataReplicationPrivateEndpointConnectionResource + RecoveryServicesDataReplicationPrivateEndpointConnectionCollection collection = vaultModel.GetRecoveryServicesDataReplicationPrivateEndpointConnections(); + + // invoke the operation + string privateEndpointConnectionName = "vbkm"; + RecoveryServicesDataReplicationPrivateEndpointConnectionResource result = await collection.GetAsync(privateEndpointConnectionName); + + // 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 + RecoveryServicesDataReplicationPrivateEndpointConnectionData 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_ListsThePrivateEndpointConnections() + { + // Generated from example definition: 2024-09-01/PrivateEndpointConnection_List.json + // this example is just showing the usage of "PrivateEndpointConnection_List" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this VaultModelResource created on azure + // for more information of creating VaultModelResource, please refer to the document of VaultModelResource + string subscriptionId = "930CEC23-4430-4513-B855-DBA237E2F3BF"; + string resourceGroupName = "rgswagger_2024-09-01"; + string vaultName = "4"; + ResourceIdentifier vaultModelResourceId = VaultModelResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, vaultName); + VaultModelResource vaultModel = client.GetVaultModelResource(vaultModelResourceId); + + // get the collection of this RecoveryServicesDataReplicationPrivateEndpointConnectionResource + RecoveryServicesDataReplicationPrivateEndpointConnectionCollection collection = vaultModel.GetRecoveryServicesDataReplicationPrivateEndpointConnections(); + + // invoke the operation and iterate over the result + await foreach (RecoveryServicesDataReplicationPrivateEndpointConnectionResource 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 + RecoveryServicesDataReplicationPrivateEndpointConnectionData 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_GetsThePrivateEndpointConnection() + { + // Generated from example definition: 2024-09-01/PrivateEndpointConnection_Get.json + // this example is just showing the usage of "PrivateEndpointConnection_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 VaultModelResource created on azure + // for more information of creating VaultModelResource, please refer to the document of VaultModelResource + string subscriptionId = "930CEC23-4430-4513-B855-DBA237E2F3BF"; + string resourceGroupName = "rgswagger_2024-09-01"; + string vaultName = "4"; + ResourceIdentifier vaultModelResourceId = VaultModelResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, vaultName); + VaultModelResource vaultModel = client.GetVaultModelResource(vaultModelResourceId); + + // get the collection of this RecoveryServicesDataReplicationPrivateEndpointConnectionResource + RecoveryServicesDataReplicationPrivateEndpointConnectionCollection collection = vaultModel.GetRecoveryServicesDataReplicationPrivateEndpointConnections(); + + // invoke the operation + string privateEndpointConnectionName = "vbkm"; + bool result = await collection.ExistsAsync(privateEndpointConnectionName); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetIfExists_GetsThePrivateEndpointConnection() + { + // Generated from example definition: 2024-09-01/PrivateEndpointConnection_Get.json + // this example is just showing the usage of "PrivateEndpointConnection_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 VaultModelResource created on azure + // for more information of creating VaultModelResource, please refer to the document of VaultModelResource + string subscriptionId = "930CEC23-4430-4513-B855-DBA237E2F3BF"; + string resourceGroupName = "rgswagger_2024-09-01"; + string vaultName = "4"; + ResourceIdentifier vaultModelResourceId = VaultModelResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, vaultName); + VaultModelResource vaultModel = client.GetVaultModelResource(vaultModelResourceId); + + // get the collection of this RecoveryServicesDataReplicationPrivateEndpointConnectionResource + RecoveryServicesDataReplicationPrivateEndpointConnectionCollection collection = vaultModel.GetRecoveryServicesDataReplicationPrivateEndpointConnections(); + + // invoke the operation + string privateEndpointConnectionName = "vbkm"; + NullableResponse response = await collection.GetIfExistsAsync(privateEndpointConnectionName); + RecoveryServicesDataReplicationPrivateEndpointConnectionResource 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 + RecoveryServicesDataReplicationPrivateEndpointConnectionData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/samples/Generated/Samples/Sample_RecoveryServicesDataReplicationPrivateEndpointConnectionResource.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/samples/Generated/Samples/Sample_RecoveryServicesDataReplicationPrivateEndpointConnectionResource.cs new file mode 100644 index 000000000000..219fdc73bbac --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/samples/Generated/Samples/Sample_RecoveryServicesDataReplicationPrivateEndpointConnectionResource.cs @@ -0,0 +1,122 @@ +// 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.RecoveryServicesDataReplication.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Samples +{ + public partial class Sample_RecoveryServicesDataReplicationPrivateEndpointConnectionResource + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_GetsThePrivateEndpointConnection() + { + // Generated from example definition: 2024-09-01/PrivateEndpointConnection_Get.json + // this example is just showing the usage of "PrivateEndpointConnection_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 RecoveryServicesDataReplicationPrivateEndpointConnectionResource created on azure + // for more information of creating RecoveryServicesDataReplicationPrivateEndpointConnectionResource, please refer to the document of RecoveryServicesDataReplicationPrivateEndpointConnectionResource + string subscriptionId = "930CEC23-4430-4513-B855-DBA237E2F3BF"; + string resourceGroupName = "rgswagger_2024-09-01"; + string vaultName = "4"; + string privateEndpointConnectionName = "vbkm"; + ResourceIdentifier recoveryServicesDataReplicationPrivateEndpointConnectionResourceId = RecoveryServicesDataReplicationPrivateEndpointConnectionResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, vaultName, privateEndpointConnectionName); + RecoveryServicesDataReplicationPrivateEndpointConnectionResource recoveryServicesDataReplicationPrivateEndpointConnection = client.GetRecoveryServicesDataReplicationPrivateEndpointConnectionResource(recoveryServicesDataReplicationPrivateEndpointConnectionResourceId); + + // invoke the operation + RecoveryServicesDataReplicationPrivateEndpointConnectionResource result = await recoveryServicesDataReplicationPrivateEndpointConnection.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 + RecoveryServicesDataReplicationPrivateEndpointConnectionData 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_DeletesThePrivateEndpointConnection() + { + // Generated from example definition: 2024-09-01/PrivateEndpointConnection_Delete.json + // this example is just showing the usage of "PrivateEndpointConnection_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 RecoveryServicesDataReplicationPrivateEndpointConnectionResource created on azure + // for more information of creating RecoveryServicesDataReplicationPrivateEndpointConnectionResource, please refer to the document of RecoveryServicesDataReplicationPrivateEndpointConnectionResource + string subscriptionId = "930CEC23-4430-4513-B855-DBA237E2F3BF"; + string resourceGroupName = "rgswagger_2024-09-01"; + string vaultName = "4"; + string privateEndpointConnectionName = "sdwqtfhigjirrzhpbmqtzgs"; + ResourceIdentifier recoveryServicesDataReplicationPrivateEndpointConnectionResourceId = RecoveryServicesDataReplicationPrivateEndpointConnectionResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, vaultName, privateEndpointConnectionName); + RecoveryServicesDataReplicationPrivateEndpointConnectionResource recoveryServicesDataReplicationPrivateEndpointConnection = client.GetRecoveryServicesDataReplicationPrivateEndpointConnectionResource(recoveryServicesDataReplicationPrivateEndpointConnectionResourceId); + + // invoke the operation + await recoveryServicesDataReplicationPrivateEndpointConnection.DeleteAsync(WaitUntil.Completed); + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Update_UpdatesThePrivateEndpointConnection() + { + // Generated from example definition: 2024-09-01/PrivateEndpointConnection_Update.json + // this example is just showing the usage of "PrivateEndpointConnection_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 RecoveryServicesDataReplicationPrivateEndpointConnectionResource created on azure + // for more information of creating RecoveryServicesDataReplicationPrivateEndpointConnectionResource, please refer to the document of RecoveryServicesDataReplicationPrivateEndpointConnectionResource + string subscriptionId = "930CEC23-4430-4513-B855-DBA237E2F3BF"; + string resourceGroupName = "rgswagger_2024-09-01"; + string vaultName = "4"; + string privateEndpointConnectionName = "jitf"; + ResourceIdentifier recoveryServicesDataReplicationPrivateEndpointConnectionResourceId = RecoveryServicesDataReplicationPrivateEndpointConnectionResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, vaultName, privateEndpointConnectionName); + RecoveryServicesDataReplicationPrivateEndpointConnectionResource recoveryServicesDataReplicationPrivateEndpointConnection = client.GetRecoveryServicesDataReplicationPrivateEndpointConnectionResource(recoveryServicesDataReplicationPrivateEndpointConnectionResourceId); + + // invoke the operation + RecoveryServicesDataReplicationPrivateEndpointConnectionData data = new RecoveryServicesDataReplicationPrivateEndpointConnectionData + { + Properties = new PrivateEndpointConnectionResponseProperties + { + PrivateEndpointId = new ResourceIdentifier("cwcdqoynostmqwdwy"), + PrivateLinkServiceConnectionState = new RecoveryServicesDataReplicationPrivateLinkServiceConnectionState + { + Status = PrivateEndpointConnectionStatus.Approved, + Description = "y", + ActionsRequired = "afwbq", + }, + }, + }; + ArmOperation lro = await recoveryServicesDataReplicationPrivateEndpointConnection.UpdateAsync(WaitUntil.Completed, data); + RecoveryServicesDataReplicationPrivateEndpointConnectionResource 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 + RecoveryServicesDataReplicationPrivateEndpointConnectionData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/samples/Generated/Samples/Sample_RecoveryServicesDataReplicationPrivateLinkResourceDataCollection.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/samples/Generated/Samples/Sample_RecoveryServicesDataReplicationPrivateLinkResourceDataCollection.cs new file mode 100644 index 000000000000..dd9f003bdfa5 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/samples/Generated/Samples/Sample_RecoveryServicesDataReplicationPrivateLinkResourceDataCollection.cs @@ -0,0 +1,160 @@ +// 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 NUnit.Framework; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Samples +{ + public partial class Sample_RecoveryServicesDataReplicationPrivateLinkResourceDataCollection + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_GetPrivateLinkResource() + { + // Generated from example definition: 2024-09-01/PrivateLinkResource_Get.json + // this example is just showing the usage of "PrivateLinkResource_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 VaultModelResource created on azure + // for more information of creating VaultModelResource, please refer to the document of VaultModelResource + string subscriptionId = "930CEC23-4430-4513-B855-DBA237E2F3BF"; + string resourceGroupName = "rgswagger_2024-09-01"; + string vaultName = "4"; + ResourceIdentifier vaultModelResourceId = VaultModelResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, vaultName); + VaultModelResource vaultModel = client.GetVaultModelResource(vaultModelResourceId); + + // get the collection of this RecoveryServicesDataReplicationPrivateLinkResourceDataResource + RecoveryServicesDataReplicationPrivateLinkResourceDataCollection collection = vaultModel.GetAllRecoveryServicesDataReplicationPrivateLinkResourceData(); + + // invoke the operation + string privateLinkResourceName = "d"; + RecoveryServicesDataReplicationPrivateLinkResourceDataResource result = await collection.GetAsync(privateLinkResourceName); + + // 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 + RecoveryServicesDataReplicationPrivateLinkResourceDataData 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_PrivateLinkResourceListGeneratedByMaximumSetRule() + { + // Generated from example definition: 2024-09-01/PrivateLinkResource_List.json + // this example is just showing the usage of "PrivateLinkResource_List" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this VaultModelResource created on azure + // for more information of creating VaultModelResource, please refer to the document of VaultModelResource + string subscriptionId = "930CEC23-4430-4513-B855-DBA237E2F3BF"; + string resourceGroupName = "rgswagger_2024-09-01"; + string vaultName = "4"; + ResourceIdentifier vaultModelResourceId = VaultModelResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, vaultName); + VaultModelResource vaultModel = client.GetVaultModelResource(vaultModelResourceId); + + // get the collection of this RecoveryServicesDataReplicationPrivateLinkResourceDataResource + RecoveryServicesDataReplicationPrivateLinkResourceDataCollection collection = vaultModel.GetAllRecoveryServicesDataReplicationPrivateLinkResourceData(); + + // invoke the operation and iterate over the result + await foreach (RecoveryServicesDataReplicationPrivateLinkResourceDataResource 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 + RecoveryServicesDataReplicationPrivateLinkResourceDataData 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_GetPrivateLinkResource() + { + // Generated from example definition: 2024-09-01/PrivateLinkResource_Get.json + // this example is just showing the usage of "PrivateLinkResource_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 VaultModelResource created on azure + // for more information of creating VaultModelResource, please refer to the document of VaultModelResource + string subscriptionId = "930CEC23-4430-4513-B855-DBA237E2F3BF"; + string resourceGroupName = "rgswagger_2024-09-01"; + string vaultName = "4"; + ResourceIdentifier vaultModelResourceId = VaultModelResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, vaultName); + VaultModelResource vaultModel = client.GetVaultModelResource(vaultModelResourceId); + + // get the collection of this RecoveryServicesDataReplicationPrivateLinkResourceDataResource + RecoveryServicesDataReplicationPrivateLinkResourceDataCollection collection = vaultModel.GetAllRecoveryServicesDataReplicationPrivateLinkResourceData(); + + // invoke the operation + string privateLinkResourceName = "d"; + bool result = await collection.ExistsAsync(privateLinkResourceName); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetIfExists_GetPrivateLinkResource() + { + // Generated from example definition: 2024-09-01/PrivateLinkResource_Get.json + // this example is just showing the usage of "PrivateLinkResource_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 VaultModelResource created on azure + // for more information of creating VaultModelResource, please refer to the document of VaultModelResource + string subscriptionId = "930CEC23-4430-4513-B855-DBA237E2F3BF"; + string resourceGroupName = "rgswagger_2024-09-01"; + string vaultName = "4"; + ResourceIdentifier vaultModelResourceId = VaultModelResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, vaultName); + VaultModelResource vaultModel = client.GetVaultModelResource(vaultModelResourceId); + + // get the collection of this RecoveryServicesDataReplicationPrivateLinkResourceDataResource + RecoveryServicesDataReplicationPrivateLinkResourceDataCollection collection = vaultModel.GetAllRecoveryServicesDataReplicationPrivateLinkResourceData(); + + // invoke the operation + string privateLinkResourceName = "d"; + NullableResponse response = await collection.GetIfExistsAsync(privateLinkResourceName); + RecoveryServicesDataReplicationPrivateLinkResourceDataResource 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 + RecoveryServicesDataReplicationPrivateLinkResourceDataData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/samples/Generated/Samples/Sample_RecoveryServicesDataReplicationPrivateLinkResourceDataResource.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/samples/Generated/Samples/Sample_RecoveryServicesDataReplicationPrivateLinkResourceDataResource.cs new file mode 100644 index 000000000000..13ba7f736647 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/samples/Generated/Samples/Sample_RecoveryServicesDataReplicationPrivateLinkResourceDataResource.cs @@ -0,0 +1,49 @@ +// 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 NUnit.Framework; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Samples +{ + public partial class Sample_RecoveryServicesDataReplicationPrivateLinkResourceDataResource + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_GetPrivateLinkResource() + { + // Generated from example definition: 2024-09-01/PrivateLinkResource_Get.json + // this example is just showing the usage of "PrivateLinkResource_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 RecoveryServicesDataReplicationPrivateLinkResourceDataResource created on azure + // for more information of creating RecoveryServicesDataReplicationPrivateLinkResourceDataResource, please refer to the document of RecoveryServicesDataReplicationPrivateLinkResourceDataResource + string subscriptionId = "930CEC23-4430-4513-B855-DBA237E2F3BF"; + string resourceGroupName = "rgswagger_2024-09-01"; + string vaultName = "4"; + string privateLinkResourceName = "d"; + ResourceIdentifier recoveryServicesDataReplicationPrivateLinkResourceDataResourceId = RecoveryServicesDataReplicationPrivateLinkResourceDataResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, vaultName, privateLinkResourceName); + RecoveryServicesDataReplicationPrivateLinkResourceDataResource recoveryServicesDataReplicationPrivateLinkResourceData = client.GetRecoveryServicesDataReplicationPrivateLinkResourceDataResource(recoveryServicesDataReplicationPrivateLinkResourceDataResourceId); + + // invoke the operation + RecoveryServicesDataReplicationPrivateLinkResourceDataResource result = await recoveryServicesDataReplicationPrivateLinkResourceData.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 + RecoveryServicesDataReplicationPrivateLinkResourceDataData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/samples/Generated/Samples/Sample_ReplicationExtensionModelCollection.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/samples/Generated/Samples/Sample_ReplicationExtensionModelCollection.cs new file mode 100644 index 000000000000..6fe613d6f723 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/samples/Generated/Samples/Sample_ReplicationExtensionModelCollection.cs @@ -0,0 +1,200 @@ +// 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.RecoveryServicesDataReplication.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Samples +{ + public partial class Sample_ReplicationExtensionModelCollection + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task CreateOrUpdate_PutsTheReplicationExtension() + { + // Generated from example definition: 2024-09-01/ReplicationExtension_Create.json + // this example is just showing the usage of "ReplicationExtensionModel_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 VaultModelResource created on azure + // for more information of creating VaultModelResource, please refer to the document of VaultModelResource + string subscriptionId = "930CEC23-4430-4513-B855-DBA237E2F3BF"; + string resourceGroupName = "rgrecoveryservicesdatareplication"; + string vaultName = "4"; + ResourceIdentifier vaultModelResourceId = VaultModelResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, vaultName); + VaultModelResource vaultModel = client.GetVaultModelResource(vaultModelResourceId); + + // get the collection of this ReplicationExtensionModelResource + ReplicationExtensionModelCollection collection = vaultModel.GetReplicationExtensionModels(); + + // invoke the operation + string replicationExtensionName = "g16yjJ"; + ReplicationExtensionModelData data = new ReplicationExtensionModelData + { + Properties = new ReplicationExtensionModelProperties(null), + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, replicationExtensionName, data); + ReplicationExtensionModelResource 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 + ReplicationExtensionModelData 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_GetsTheReplicationExtension() + { + // Generated from example definition: 2024-09-01/ReplicationExtension_Get.json + // this example is just showing the usage of "ReplicationExtensionModel_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 VaultModelResource created on azure + // for more information of creating VaultModelResource, please refer to the document of VaultModelResource + string subscriptionId = "930CEC23-4430-4513-B855-DBA237E2F3BF"; + string resourceGroupName = "rgrecoveryservicesdatareplication"; + string vaultName = "4"; + ResourceIdentifier vaultModelResourceId = VaultModelResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, vaultName); + VaultModelResource vaultModel = client.GetVaultModelResource(vaultModelResourceId); + + // get the collection of this ReplicationExtensionModelResource + ReplicationExtensionModelCollection collection = vaultModel.GetReplicationExtensionModels(); + + // invoke the operation + string replicationExtensionName = "g16yjJ"; + ReplicationExtensionModelResource result = await collection.GetAsync(replicationExtensionName); + + // 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 + ReplicationExtensionModelData 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_ListsTheReplicationExtensions() + { + // Generated from example definition: 2024-09-01/ReplicationExtension_List.json + // this example is just showing the usage of "ReplicationExtensionModel_List" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this VaultModelResource created on azure + // for more information of creating VaultModelResource, please refer to the document of VaultModelResource + string subscriptionId = "930CEC23-4430-4513-B855-DBA237E2F3BF"; + string resourceGroupName = "rgrecoveryservicesdatareplication"; + string vaultName = "4"; + ResourceIdentifier vaultModelResourceId = VaultModelResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, vaultName); + VaultModelResource vaultModel = client.GetVaultModelResource(vaultModelResourceId); + + // get the collection of this ReplicationExtensionModelResource + ReplicationExtensionModelCollection collection = vaultModel.GetReplicationExtensionModels(); + + // invoke the operation and iterate over the result + await foreach (ReplicationExtensionModelResource 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 + ReplicationExtensionModelData 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_GetsTheReplicationExtension() + { + // Generated from example definition: 2024-09-01/ReplicationExtension_Get.json + // this example is just showing the usage of "ReplicationExtensionModel_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 VaultModelResource created on azure + // for more information of creating VaultModelResource, please refer to the document of VaultModelResource + string subscriptionId = "930CEC23-4430-4513-B855-DBA237E2F3BF"; + string resourceGroupName = "rgrecoveryservicesdatareplication"; + string vaultName = "4"; + ResourceIdentifier vaultModelResourceId = VaultModelResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, vaultName); + VaultModelResource vaultModel = client.GetVaultModelResource(vaultModelResourceId); + + // get the collection of this ReplicationExtensionModelResource + ReplicationExtensionModelCollection collection = vaultModel.GetReplicationExtensionModels(); + + // invoke the operation + string replicationExtensionName = "g16yjJ"; + bool result = await collection.ExistsAsync(replicationExtensionName); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetIfExists_GetsTheReplicationExtension() + { + // Generated from example definition: 2024-09-01/ReplicationExtension_Get.json + // this example is just showing the usage of "ReplicationExtensionModel_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 VaultModelResource created on azure + // for more information of creating VaultModelResource, please refer to the document of VaultModelResource + string subscriptionId = "930CEC23-4430-4513-B855-DBA237E2F3BF"; + string resourceGroupName = "rgrecoveryservicesdatareplication"; + string vaultName = "4"; + ResourceIdentifier vaultModelResourceId = VaultModelResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, vaultName); + VaultModelResource vaultModel = client.GetVaultModelResource(vaultModelResourceId); + + // get the collection of this ReplicationExtensionModelResource + ReplicationExtensionModelCollection collection = vaultModel.GetReplicationExtensionModels(); + + // invoke the operation + string replicationExtensionName = "g16yjJ"; + NullableResponse response = await collection.GetIfExistsAsync(replicationExtensionName); + ReplicationExtensionModelResource 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 + ReplicationExtensionModelData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/samples/Generated/Samples/Sample_ReplicationExtensionModelResource.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/samples/Generated/Samples/Sample_ReplicationExtensionModelResource.cs new file mode 100644 index 000000000000..4fc755cb9e70 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/samples/Generated/Samples/Sample_ReplicationExtensionModelResource.cs @@ -0,0 +1,113 @@ +// 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.RecoveryServicesDataReplication.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Samples +{ + public partial class Sample_ReplicationExtensionModelResource + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_GetsTheReplicationExtension() + { + // Generated from example definition: 2024-09-01/ReplicationExtension_Get.json + // this example is just showing the usage of "ReplicationExtensionModel_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 ReplicationExtensionModelResource created on azure + // for more information of creating ReplicationExtensionModelResource, please refer to the document of ReplicationExtensionModelResource + string subscriptionId = "930CEC23-4430-4513-B855-DBA237E2F3BF"; + string resourceGroupName = "rgrecoveryservicesdatareplication"; + string vaultName = "4"; + string replicationExtensionName = "g16yjJ"; + ResourceIdentifier replicationExtensionModelResourceId = ReplicationExtensionModelResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, vaultName, replicationExtensionName); + ReplicationExtensionModelResource replicationExtensionModel = client.GetReplicationExtensionModelResource(replicationExtensionModelResourceId); + + // invoke the operation + ReplicationExtensionModelResource result = await replicationExtensionModel.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 + ReplicationExtensionModelData 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_DeletesTheReplicationExtension() + { + // Generated from example definition: 2024-09-01/ReplicationExtension_Delete.json + // this example is just showing the usage of "ReplicationExtensionModel_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 ReplicationExtensionModelResource created on azure + // for more information of creating ReplicationExtensionModelResource, please refer to the document of ReplicationExtensionModelResource + string subscriptionId = "930CEC23-4430-4513-B855-DBA237E2F3BF"; + string resourceGroupName = "rgrecoveryservicesdatareplication"; + string vaultName = "4"; + string replicationExtensionName = "g16yjJ"; + ResourceIdentifier replicationExtensionModelResourceId = ReplicationExtensionModelResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, vaultName, replicationExtensionName); + ReplicationExtensionModelResource replicationExtensionModel = client.GetReplicationExtensionModelResource(replicationExtensionModelResourceId); + + // invoke the operation + await replicationExtensionModel.DeleteAsync(WaitUntil.Completed); + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Update_PutsTheReplicationExtension() + { + // Generated from example definition: 2024-09-01/ReplicationExtension_Create.json + // this example is just showing the usage of "ReplicationExtensionModel_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 ReplicationExtensionModelResource created on azure + // for more information of creating ReplicationExtensionModelResource, please refer to the document of ReplicationExtensionModelResource + string subscriptionId = "930CEC23-4430-4513-B855-DBA237E2F3BF"; + string resourceGroupName = "rgrecoveryservicesdatareplication"; + string vaultName = "4"; + string replicationExtensionName = "g16yjJ"; + ResourceIdentifier replicationExtensionModelResourceId = ReplicationExtensionModelResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, vaultName, replicationExtensionName); + ReplicationExtensionModelResource replicationExtensionModel = client.GetReplicationExtensionModelResource(replicationExtensionModelResourceId); + + // invoke the operation + ReplicationExtensionModelData data = new ReplicationExtensionModelData + { + Properties = new ReplicationExtensionModelProperties(null), + }; + ArmOperation lro = await replicationExtensionModel.UpdateAsync(WaitUntil.Completed, data); + ReplicationExtensionModelResource 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 + ReplicationExtensionModelData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/samples/Generated/Samples/Sample_ResourceGroupResourceExtensions.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/samples/Generated/Samples/Sample_ResourceGroupResourceExtensions.cs new file mode 100644 index 000000000000..988183e977d1 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/samples/Generated/Samples/Sample_ResourceGroupResourceExtensions.cs @@ -0,0 +1,82 @@ +// 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.RecoveryServicesDataReplication.Models; +using Azure.ResourceManager.Resources; +using NUnit.Framework; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Samples +{ + public partial class Sample_ResourceGroupResourceExtensions + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task PostDeploymentPreflight_PerformsResourceDeploymentValidation() + { + // Generated from example definition: 2024-09-01/DeploymentPreflight_Post.json + // this example is just showing the usage of "DeploymentPreflight_Post" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details 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 = "930CEC23-4430-4513-B855-DBA237E2F3BF"; + string resourceGroupName = "rgswagger_2024-09-01"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // invoke the operation + string deploymentId = "lnfcwsmlowbwkndkztzvaj"; + DeploymentPreflightModel body = new DeploymentPreflightModel + { + Resources = {new DeploymentPreflightResource +{ +Name = "xtgugoflfc", +Type = "nsnaptduolqcxsikrewvgjbxqpt", +Location = "cbsgtxkjdzwbyp", +ApiVersion = "otihymhvzblycdoxo", +}}, + }; + DeploymentPreflightModel result = await resourceGroupResource.PostDeploymentPreflightAsync(deploymentId, body: body); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetOperationResult_GetsTheOperationResults() + { + // Generated from example definition: 2024-09-01/OperationResults_Get.json + // this example is just showing the usage of "ArmResponse_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 = "930CEC23-4430-4513-B855-DBA237E2F3BF"; + string resourceGroupName = "rgswagger_2024-09-01"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // invoke the operation + string operationId = "lghle"; + OperationStatus result = await resourceGroupResource.GetOperationResultAsync(operationId); + + Console.WriteLine($"Succeeded: {result}"); + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/samples/Generated/Samples/Sample_SubscriptionResourceExtensions.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/samples/Generated/Samples/Sample_SubscriptionResourceExtensions.cs new file mode 100644 index 000000000000..033c2cff6b94 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/samples/Generated/Samples/Sample_SubscriptionResourceExtensions.cs @@ -0,0 +1,112 @@ +// 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.RecoveryServicesDataReplication.Models; +using Azure.ResourceManager.Resources; +using NUnit.Framework; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Samples +{ + public partial class Sample_SubscriptionResourceExtensions + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetVaultModels_ListsTheVaultsBySubscription() + { + // Generated from example definition: 2024-09-01/Vault_ListBySubscription.json + // this example is just showing the usage of "VaultModel_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 = "930CEC23-4430-4513-B855-DBA237E2F3BF"; + ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(subscriptionId); + SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId); + + // invoke the operation and iterate over the result + await foreach (VaultModelResource item in subscriptionResource.GetVaultModelsAsync()) + { + // 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 + VaultModelData 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 GetFabricModels_ListsTheFabricsBySubscription() + { + // Generated from example definition: 2024-09-01/Fabric_ListBySubscription.json + // this example is just showing the usage of "FabricModel_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 = "930CEC23-4430-4513-B855-DBA237E2F3BF"; + ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(subscriptionId); + SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId); + + // invoke the operation and iterate over the result + await foreach (FabricModelResource item in subscriptionResource.GetFabricModelsAsync()) + { + // 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 + FabricModelData 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 PostCheckNameAvailability_PerformsTheResourceNameAvailabilityCheck() + { + // Generated from example definition: 2024-09-01/CheckNameAvailability_Post.json + // this example is just showing the usage of "CheckNameAvailability_Post" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details 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 = "930CEC23-4430-4513-B855-DBA237E2F3BF"; + ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(subscriptionId); + SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId); + + // invoke the operation + AzureLocation location = new AzureLocation("trfqtbtmusswpibw"); + CheckNameAvailabilityModel body = new CheckNameAvailabilityModel + { + Name = "updkdcixs", + Type = "gngmcancdauwhdixjjvqnfkvqc", + }; + CheckNameAvailabilityResponseModel result = await subscriptionResource.PostCheckNameAvailabilityAsync(location, body: body); + + Console.WriteLine($"Succeeded: {result}"); + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/samples/Generated/Samples/Sample_VaultModelCollection.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/samples/Generated/Samples/Sample_VaultModelCollection.cs new file mode 100644 index 000000000000..623b86b9f6ac --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/samples/Generated/Samples/Sample_VaultModelCollection.cs @@ -0,0 +1,204 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.RecoveryServicesDataReplication.Models; +using Azure.ResourceManager.Resources; +using NUnit.Framework; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Samples +{ + public partial class Sample_VaultModelCollection + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task CreateOrUpdate_PutsTheVault() + { + // Generated from example definition: 2024-09-01/Vault_Create.json + // this example is just showing the usage of "VaultModel_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 = "930CEC23-4430-4513-B855-DBA237E2F3BF"; + string resourceGroupName = "rgrecoveryservicesdatareplication"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this VaultModelResource + VaultModelCollection collection = resourceGroupResource.GetVaultModels(); + + // invoke the operation + string vaultName = "4"; + VaultModelData data = new VaultModelData(new AzureLocation("eck")) + { + Properties = new VaultModelProperties + { + VaultType = ReplicationVaultType.DisasterRecovery, + }, + Tags = +{ +["key5359"] = "ljfilxolxzuxrauopwtyxghrp" +}, + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, vaultName, data); + VaultModelResource 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 + VaultModelData 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_GetsTheVault() + { + // Generated from example definition: 2024-09-01/Vault_Get.json + // this example is just showing the usage of "VaultModel_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 = "930CEC23-4430-4513-B855-DBA237E2F3BF"; + string resourceGroupName = "rgrecoveryservicesdatareplication"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this VaultModelResource + VaultModelCollection collection = resourceGroupResource.GetVaultModels(); + + // invoke the operation + string vaultName = "4"; + VaultModelResource result = await collection.GetAsync(vaultName); + + // 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 + VaultModelData 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_ListsTheVaults() + { + // Generated from example definition: 2024-09-01/Vault_List.json + // this example is just showing the usage of "VaultModel_List" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "930CEC23-4430-4513-B855-DBA237E2F3BF"; + string resourceGroupName = "rgrecoveryservicesdatareplication"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this VaultModelResource + VaultModelCollection collection = resourceGroupResource.GetVaultModels(); + + // invoke the operation and iterate over the result + string continuationToken = "mwculdaqndp"; + await foreach (VaultModelResource item in collection.GetAllAsync(continuationToken: continuationToken)) + { + // 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 + VaultModelData 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_GetsTheVault() + { + // Generated from example definition: 2024-09-01/Vault_Get.json + // this example is just showing the usage of "VaultModel_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 = "930CEC23-4430-4513-B855-DBA237E2F3BF"; + string resourceGroupName = "rgrecoveryservicesdatareplication"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this VaultModelResource + VaultModelCollection collection = resourceGroupResource.GetVaultModels(); + + // invoke the operation + string vaultName = "4"; + bool result = await collection.ExistsAsync(vaultName); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetIfExists_GetsTheVault() + { + // Generated from example definition: 2024-09-01/Vault_Get.json + // this example is just showing the usage of "VaultModel_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 = "930CEC23-4430-4513-B855-DBA237E2F3BF"; + string resourceGroupName = "rgrecoveryservicesdatareplication"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this VaultModelResource + VaultModelCollection collection = resourceGroupResource.GetVaultModels(); + + // invoke the operation + string vaultName = "4"; + NullableResponse response = await collection.GetIfExistsAsync(vaultName); + VaultModelResource 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 + VaultModelData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/samples/Generated/Samples/Sample_VaultModelResource.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/samples/Generated/Samples/Sample_VaultModelResource.cs new file mode 100644 index 000000000000..2d7561141931 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/samples/Generated/Samples/Sample_VaultModelResource.cs @@ -0,0 +1,117 @@ +// 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.RecoveryServicesDataReplication.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Samples +{ + public partial class Sample_VaultModelResource + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_GetsTheVault() + { + // Generated from example definition: 2024-09-01/Vault_Get.json + // this example is just showing the usage of "VaultModel_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 VaultModelResource created on azure + // for more information of creating VaultModelResource, please refer to the document of VaultModelResource + string subscriptionId = "930CEC23-4430-4513-B855-DBA237E2F3BF"; + string resourceGroupName = "rgrecoveryservicesdatareplication"; + string vaultName = "4"; + ResourceIdentifier vaultModelResourceId = VaultModelResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, vaultName); + VaultModelResource vaultModel = client.GetVaultModelResource(vaultModelResourceId); + + // invoke the operation + VaultModelResource result = await vaultModel.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 + VaultModelData 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_DeletesTheVault() + { + // Generated from example definition: 2024-09-01/Vault_Delete.json + // this example is just showing the usage of "VaultModel_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 VaultModelResource created on azure + // for more information of creating VaultModelResource, please refer to the document of VaultModelResource + string subscriptionId = "930CEC23-4430-4513-B855-DBA237E2F3BF"; + string resourceGroupName = "rgrecoveryservicesdatareplication"; + string vaultName = "4"; + ResourceIdentifier vaultModelResourceId = VaultModelResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, vaultName); + VaultModelResource vaultModel = client.GetVaultModelResource(vaultModelResourceId); + + // invoke the operation + await vaultModel.DeleteAsync(WaitUntil.Completed); + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Update_UpdatesTheVault() + { + // Generated from example definition: 2024-09-01/Vault_Update.json + // this example is just showing the usage of "VaultModel_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 VaultModelResource created on azure + // for more information of creating VaultModelResource, please refer to the document of VaultModelResource + string subscriptionId = "930CEC23-4430-4513-B855-DBA237E2F3BF"; + string resourceGroupName = "rgrecoveryservicesdatareplication"; + string vaultName = "4"; + ResourceIdentifier vaultModelResourceId = VaultModelResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, vaultName); + VaultModelResource vaultModel = client.GetVaultModelResource(vaultModelResourceId); + + // invoke the operation + VaultModelPatch patch = new VaultModelPatch + { + Tags = +{ +["key8872"] = "pvtc" +}, + Properties = new VaultModelProperties + { + VaultType = ReplicationVaultType.DisasterRecovery, + }, + }; + ArmOperation lro = await vaultModel.UpdateAsync(WaitUntil.Completed, patch); + VaultModelResource 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 + VaultModelData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Azure.ResourceManager.RecoveryServicesDataReplication.csproj b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Azure.ResourceManager.RecoveryServicesDataReplication.csproj new file mode 100644 index 000000000000..ded5f53eb128 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Azure.ResourceManager.RecoveryServicesDataReplication.csproj @@ -0,0 +1,8 @@ + + + Azure Resource Manager client SDK for Azure resource provider RecoveryServicesDataReplication. + 1.0.0-beta.1 + azure;management;arm;resource manager;recoveryservicesdatareplication + Azure.ResourceManager.RecoveryServicesDataReplication + + diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/ArmRecoveryServicesDataReplicationModelFactory.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/ArmRecoveryServicesDataReplicationModelFactory.cs new file mode 100644 index 000000000000..a53b38ead0ad --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/ArmRecoveryServicesDataReplicationModelFactory.cs @@ -0,0 +1,1431 @@ +// 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.RecoveryServicesDataReplication.Models +{ + /// Model factory for models. + public static partial class ArmRecoveryServicesDataReplicationModelFactory + { + /// Initializes a new instance of . + /// Gets or sets the Id. + /// Gets or sets the operation name. + /// Gets or sets the status of the operation. ARM expects the terminal status to be one of Succeeded/ Failed/ Canceled. All other values imply that the operation is still running. + /// Gets or sets the start time. + /// Gets or sets the end time. + /// A new instance for mocking. + public static OperationStatus OperationStatus(string id = null, string name = null, string status = null, string startTime = null, string endTime = null) + { + return new OperationStatus( + id, + name, + status, + startTime, + endTime, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Gets or sets a value indicating whether resource name is available or not. + /// Gets or sets the reason for resource name unavailability. + /// Gets or sets the message for resource name unavailability. + /// A new instance for mocking. + public static CheckNameAvailabilityResponseModel CheckNameAvailabilityResponseModel(bool? nameAvailable = null, string reason = null, string message = null) + { + return new CheckNameAvailabilityResponseModel(nameAvailable, reason, message, 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 ReplicationExtensionModelData ReplicationExtensionModelData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, ReplicationExtensionModelProperties properties = null) + { + return new ReplicationExtensionModelData( + id, + name, + resourceType, + systemData, + properties, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Gets or sets the provisioning state of the replication extension. + /// + /// Replication extension model custom properties. + /// 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 ReplicationExtensionModelProperties ReplicationExtensionModelProperties(ProvisioningState? provisioningState = null, ReplicationExtensionModelCustomProperties customProperties = null) + { + return new ReplicationExtensionModelProperties(provisioningState, customProperties, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Gets or sets the ARM Id of the source HyperV fabric. + /// Gets or sets the ARM Id of the HyperV site. + /// Gets or sets the ARM Id of the target AzStackHCI fabric. + /// Gets or sets the ARM Id of the AzStackHCI site. + /// Gets or sets the storage account Id. + /// Gets or sets the Sas Secret of storage account. + /// Gets or sets the Uri of ASR. + /// Gets or sets the Uri of Rcm. + /// Gets or sets the Uri of Gateway. + /// Gets or sets the gateway service Id of source. + /// Gets or sets the gateway service Id of target. + /// Gets or sets the source storage container name. + /// Gets or sets the target storage container name. + /// Gets or sets the resource location. + /// Gets or sets the subscription. + /// Gets or sets the resource group. + /// A new instance for mocking. + public static HyperVToAzStackHCIReplicationExtensionModelCustomProperties HyperVToAzStackHCIReplicationExtensionModelCustomProperties(string hyperVFabricArmId = null, string hyperVSiteId = null, string azStackHciFabricArmId = null, string azStackHciSiteId = null, string storageAccountId = null, string storageAccountSasSecretName = null, string asrServiceUri = null, string rcmServiceUri = null, string gatewayServiceUri = null, string sourceGatewayServiceId = null, string targetGatewayServiceId = null, string sourceStorageContainerName = null, string targetStorageContainerName = null, string resourceLocation = null, string subscriptionId = null, string resourceGroup = null) + { + return new HyperVToAzStackHCIReplicationExtensionModelCustomProperties( + "HyperVToAzStackHCI", + serializedAdditionalRawData: null, + hyperVFabricArmId, + hyperVSiteId, + azStackHciFabricArmId, + azStackHciSiteId, + storageAccountId, + storageAccountSasSecretName, + asrServiceUri, + rcmServiceUri, + gatewayServiceUri, + sourceGatewayServiceId, + targetGatewayServiceId, + sourceStorageContainerName, + targetStorageContainerName, + resourceLocation, + subscriptionId, + resourceGroup); + } + + /// Initializes a new instance of . + /// Gets or sets the ARM Id of the source VMware fabric. + /// Gets or sets the ARM Id of the VMware site. + /// Gets or sets the ARM Id of the target AzStackHCI fabric. + /// Gets or sets the ARM Id of the AzStackHCI site. + /// Gets or sets the storage account Id. + /// Gets or sets the Sas Secret of storage account. + /// Gets or sets the Uri of ASR. + /// Gets or sets the Uri of Rcm. + /// Gets or sets the Uri of Gateway. + /// Gets or sets the gateway service Id of source. + /// Gets or sets the gateway service Id of target. + /// Gets or sets the source storage container name. + /// Gets or sets the target storage container name. + /// Gets or sets the resource location. + /// Gets or sets the subscription. + /// Gets or sets the resource group. + /// A new instance for mocking. + public static VMwareToAzStackHCIReplicationExtensionModelCustomProperties VMwareToAzStackHCIReplicationExtensionModelCustomProperties(string vmwareFabricArmId = null, string vmwareSiteId = null, string azStackHciFabricArmId = null, string azStackHciSiteId = null, string storageAccountId = null, string storageAccountSasSecretName = null, string asrServiceUri = null, string rcmServiceUri = null, string gatewayServiceUri = null, string sourceGatewayServiceId = null, string targetGatewayServiceId = null, string sourceStorageContainerName = null, string targetStorageContainerName = null, string resourceLocation = null, string subscriptionId = null, string resourceGroup = null) + { + return new VMwareToAzStackHCIReplicationExtensionModelCustomProperties( + "VMwareToAzStackHCI", + serializedAdditionalRawData: null, + vmwareFabricArmId, + vmwareSiteId, + azStackHciFabricArmId, + azStackHciSiteId, + storageAccountId, + storageAccountSasSecretName, + asrServiceUri, + rcmServiceUri, + gatewayServiceUri, + sourceGatewayServiceId, + targetGatewayServiceId, + sourceStorageContainerName, + targetStorageContainerName, + resourceLocation, + subscriptionId, + resourceGroup); + } + + /// 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 RecoveryPointModelData RecoveryPointModelData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, RecoveryPointModelProperties properties = null) + { + return new RecoveryPointModelData( + id, + name, + resourceType, + systemData, + properties, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Gets or sets the recovery point time. + /// Gets or sets the recovery point type. + /// + /// Recovery point model custom properties. + /// 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 . + /// + /// Gets or sets the provisioning state of the recovery point item. + /// A new instance for mocking. + public static RecoveryPointModelProperties RecoveryPointModelProperties(DateTimeOffset recoveryPointOn = default, RecoveryPointType recoveryPointType = default, RecoveryPointModelCustomProperties customProperties = null, ProvisioningState? provisioningState = null) + { + return new RecoveryPointModelProperties(recoveryPointOn, recoveryPointType, customProperties, provisioningState, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Gets or sets the list of the disk Ids. + /// A new instance for mocking. + public static HyperVToAzStackHCIRecoveryPointModelCustomProperties HyperVToAzStackHCIRecoveryPointModelCustomProperties(IEnumerable diskIds = null) + { + diskIds ??= new List(); + + return new HyperVToAzStackHCIRecoveryPointModelCustomProperties("HyperVToAzStackHCI", serializedAdditionalRawData: null, diskIds?.ToList()); + } + + /// Initializes a new instance of . + /// Gets or sets the list of the disk Ids. + /// A new instance for mocking. + public static VMwareToAzStackHCIRecoveryPointModelCustomProperties VMwareToAzStackHCIRecoveryPointModelCustomProperties(IEnumerable diskIds = null) + { + diskIds ??= new List(); + + return new VMwareToAzStackHCIRecoveryPointModelCustomProperties("VMwareToAzStackHCIRecoveryPointModelCustomProperties", serializedAdditionalRawData: null, diskIds?.ToList()); + } + + /// 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 ProtectedItemModelData ProtectedItemModelData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, ProtectedItemModelProperties properties = null) + { + return new ProtectedItemModelData( + id, + name, + resourceType, + systemData, + properties, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Gets or sets the policy name. + /// Gets or sets the replication extension name. + /// Gets or sets the protected item correlation Id. + /// Gets or sets the provisioning state of the fabric agent. + /// Gets or sets the protection state. + /// Gets or sets the protection state description. + /// Gets or sets the test failover state. + /// Gets or sets the Test failover state description. + /// Gets or sets the resynchronization state. + /// Gets or sets the fabric object Id. + /// Gets or sets the fabric object name. + /// Gets or sets the source fabric provider Id. + /// Gets or sets the target fabric provider Id. + /// Gets or sets the fabric Id. + /// Gets or sets the target fabric Id. + /// Gets or sets the fabric agent Id. + /// Gets or sets the target fabric agent Id. + /// Gets or sets a value indicating whether resynchronization is required or not. + /// Gets or sets the Last successful planned failover time. + /// Gets or sets the Last successful unplanned failover time. + /// Gets or sets the Last successful test failover time. + /// Gets or sets the current scenario. + /// Gets or sets the allowed scenarios on the protected item. + /// Gets or sets the last failed enabled protection job. + /// Gets or sets the last failed planned failover job. + /// Gets or sets the last test failover job. + /// Gets or sets protected item replication health. + /// Gets or sets the list of health errors. + /// + /// Protected item model custom properties. + /// 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 ProtectedItemModelProperties ProtectedItemModelProperties(string policyName = null, string replicationExtensionName = null, string correlationId = null, ProvisioningState? provisioningState = null, ProtectionState? protectionState = null, string protectionStateDescription = null, TestFailoverState? testFailoverState = null, string testFailoverStateDescription = null, ResynchronizationState? resynchronizationState = null, string fabricObjectId = null, string fabricObjectName = null, string sourceFabricProviderId = null, string targetFabricProviderId = null, string fabricId = null, string targetFabricId = null, string fabricAgentId = null, string targetFabricAgentId = null, bool? resyncRequired = null, DateTimeOffset? lastSuccessfulPlannedFailoverOn = null, DateTimeOffset? lastSuccessfulUnplannedFailoverOn = null, DateTimeOffset? lastSuccessfulTestFailoverOn = null, ProtectedItemJobProperties currentJob = null, IEnumerable allowedJobs = null, ProtectedItemJobProperties lastFailedEnableProtectionJob = null, ProtectedItemJobProperties lastFailedPlannedFailoverJob = null, ProtectedItemJobProperties lastTestFailoverJob = null, HealthStatus? replicationHealth = null, IEnumerable healthErrors = null, ProtectedItemModelCustomProperties customProperties = null) + { + allowedJobs ??= new List(); + healthErrors ??= new List(); + + return new ProtectedItemModelProperties( + policyName, + replicationExtensionName, + correlationId, + provisioningState, + protectionState, + protectionStateDescription, + testFailoverState, + testFailoverStateDescription, + resynchronizationState, + fabricObjectId, + fabricObjectName, + sourceFabricProviderId, + targetFabricProviderId, + fabricId, + targetFabricId, + fabricAgentId, + targetFabricAgentId, + resyncRequired, + lastSuccessfulPlannedFailoverOn, + lastSuccessfulUnplannedFailoverOn, + lastSuccessfulTestFailoverOn, + currentJob, + allowedJobs?.ToList(), + lastFailedEnableProtectionJob, + lastFailedPlannedFailoverJob, + lastTestFailoverJob, + replicationHealth, + healthErrors?.ToList(), + customProperties, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Gets or sets protection scenario name. + /// Gets or sets job Id. + /// Gets or sets job name. + /// Gets or sets the job friendly display name. + /// Gets or sets job state. + /// Gets or sets start time of the job. + /// Gets or sets end time of the job. + /// A new instance for mocking. + public static ProtectedItemJobProperties ProtectedItemJobProperties(string scenarioName = null, string id = null, string name = null, string displayName = null, string state = null, DateTimeOffset? startOn = null, DateTimeOffset? endOn = null) + { + return new ProtectedItemJobProperties( + scenarioName, + id, + name, + displayName, + state, + startOn, + endOn, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Gets or sets the type of affected resource type. + /// Gets or sets the list of affected resource correlation Ids. This can be used to uniquely identify the count of items affected by a specific category and severity as well as count of item affected by an specific issue. + /// Gets or sets a list of child health errors associated with this error. + /// Gets or sets the error code. + /// Gets or sets the health category. + /// Gets or sets the error category. + /// Gets or sets the error severity. + /// Gets or sets the error source. + /// Gets or sets the error creation time. + /// Gets or sets a value indicating whether the error is customer resolvable. + /// Gets or sets the error summary. + /// Gets or sets the error message. + /// Gets or sets possible causes of the error. + /// Gets or sets recommended action to resolve the error. + /// A new instance for mocking. + public static HealthErrorModel HealthErrorModel(string affectedResourceType = null, IEnumerable affectedResourceCorrelationIds = null, IEnumerable childErrors = null, string code = null, string healthCategory = null, string category = null, string severity = null, string source = null, DateTimeOffset? createdOn = null, bool? isCustomerResolvable = null, string summary = null, string message = null, string causes = null, string recommendation = null) + { + affectedResourceCorrelationIds ??= new List(); + childErrors ??= new List(); + + return new HealthErrorModel( + affectedResourceType, + affectedResourceCorrelationIds?.ToList(), + childErrors?.ToList(), + code, + healthCategory, + category, + severity, + source, + createdOn, + isCustomerResolvable, + summary, + message, + causes, + recommendation, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Gets or sets the error code. + /// Gets or sets the health category. + /// Gets or sets the error category. + /// Gets or sets the error severity. + /// Gets or sets the error source. + /// Gets or sets the error creation time. + /// Gets or sets a value indicating whether the error is customer resolvable. + /// Gets or sets the error summary. + /// Gets or sets the error message. + /// Gets or sets possible causes of the error. + /// Gets or sets recommended action to resolve the error. + /// A new instance for mocking. + public static InnerHealthErrorModel InnerHealthErrorModel(string code = null, string healthCategory = null, string category = null, string severity = null, string source = null, DateTimeOffset? createdOn = null, bool? isCustomerResolvable = null, string summary = null, string message = null, string causes = null, string recommendation = null) + { + return new InnerHealthErrorModel( + code, + healthCategory, + category, + severity, + source, + createdOn, + isCustomerResolvable, + summary, + message, + causes, + recommendation, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Gets or sets the location of the protected item. + /// Gets or sets the Target HCI Cluster ARM Id. + /// Gets or sets the Target Arc Cluster Custom Location ARM Id. + /// Gets or sets the Target AzStackHCI cluster name. + /// Gets or sets the ARM Id of the discovered machine. + /// Gets or sets the list of disks to replicate. + /// Gets or sets the list of VM NIC to replicate. + /// Gets or sets the source VM display name. + /// Gets or sets the source VM CPU cores. + /// Gets or sets the source VM ram memory size in megabytes. + /// Gets or sets the target VM display name. + /// Gets or sets the target resource group ARM Id. + /// Gets or sets the target storage container ARM Id. + /// Gets or sets the hypervisor generation of the virtual machine. + /// Gets or sets the target network Id within AzStackHCI Cluster. + /// Gets or sets the target test network Id within AzStackHCI Cluster. + /// Gets or sets the target CPU cores. + /// Gets or sets a value indicating whether memory is dynamical. + /// Protected item dynamic memory config. + /// Gets or sets the target memory in mega-bytes. + /// Gets or sets the Run As account Id. + /// Gets or sets the source fabric agent name. + /// Gets or sets the target fabric agent name. + /// Gets or sets the source appliance name. + /// Gets or sets the target appliance name. + /// Gets or sets the type of the OS. + /// Gets or sets the name of the OS. + /// Gets or sets the firmware type. + /// Gets or sets the target location. + /// Gets or sets the location of Azure Arc HCI custom location resource. + /// Gets or sets the recovery point Id to which the VM was failed over. + /// Gets or sets the last recovery point received time. + /// Gets or sets the last recovery point Id. + /// Gets or sets the initial replication progress percentage. This is calculated based on total bytes processed for all disks in the source VM. + /// Gets or sets the resync progress percentage. This is calculated based on total bytes processed for all disks in the source VM. + /// Gets or sets the list of protected disks. + /// Gets or sets the VM NIC details. + /// Gets or sets the BIOS Id of the target AzStackHCI VM. + /// Gets or sets the latest timestamp that replication status is updated. + /// A new instance for mocking. + public static HyperVToAzStackHCIProtectedItemModelCustomProperties HyperVToAzStackHCIProtectedItemModelCustomProperties(ProtectedItemActiveLocation? activeLocation = null, string targetHciClusterId = null, string targetArcClusterCustomLocationId = null, string targetAzStackHciClusterName = null, string fabricDiscoveryMachineId = null, IEnumerable disksToInclude = null, IEnumerable nicsToInclude = null, string sourceVmName = null, int? sourceCpuCores = null, double? sourceMemoryInMegaBytes = null, string targetVmName = null, string targetResourceGroupId = null, string storageContainerId = null, string hyperVGeneration = null, string targetNetworkId = null, string testNetworkId = null, int? targetCpuCores = null, bool? isDynamicRam = null, ProtectedItemDynamicMemoryConfig dynamicMemoryConfig = null, int? targetMemoryInMegaBytes = null, string runAsAccountId = null, string sourceFabricAgentName = null, string targetFabricAgentName = null, string sourceApplianceName = null, string targetApplianceName = null, string osType = null, string osName = null, string firmwareType = null, string targetLocation = null, string customLocationRegion = null, string failoverRecoveryPointId = null, DateTimeOffset? lastRecoveryPointReceived = null, string lastRecoveryPointId = null, int? initialReplicationProgressPercentage = null, int? resyncProgressPercentage = null, IEnumerable protectedDisks = null, IEnumerable protectedNics = null, string targetVmBiosId = null, DateTimeOffset? lastReplicationUpdateOn = null) + { + disksToInclude ??= new List(); + nicsToInclude ??= new List(); + protectedDisks ??= new List(); + protectedNics ??= new List(); + + return new HyperVToAzStackHCIProtectedItemModelCustomProperties( + "HyperVToAzStackHCI", + serializedAdditionalRawData: null, + activeLocation, + targetHciClusterId, + targetArcClusterCustomLocationId, + targetAzStackHciClusterName, + fabricDiscoveryMachineId, + disksToInclude?.ToList(), + nicsToInclude?.ToList(), + sourceVmName, + sourceCpuCores, + sourceMemoryInMegaBytes, + targetVmName, + targetResourceGroupId, + storageContainerId, + hyperVGeneration, + targetNetworkId, + testNetworkId, + targetCpuCores, + isDynamicRam, + dynamicMemoryConfig, + targetMemoryInMegaBytes, + runAsAccountId, + sourceFabricAgentName, + targetFabricAgentName, + sourceApplianceName, + targetApplianceName, + osType, + osName, + firmwareType, + targetLocation, + customLocationRegion, + failoverRecoveryPointId, + lastRecoveryPointReceived, + lastRecoveryPointId, + initialReplicationProgressPercentage, + resyncProgressPercentage, + protectedDisks?.ToList(), + protectedNics?.ToList(), + targetVmBiosId, + lastReplicationUpdateOn); + } + + /// Initializes a new instance of . + /// Gets or sets the NIC Id. + /// Gets or sets the network name. + /// Gets or sets the target network Id within AzStackHCI Cluster. + /// Gets or sets the target test network Id within AzStackHCI Cluster. + /// Gets or sets the selection type of the NIC. + /// Gets or sets a value indicating whether static ip migration is enabled. + /// Gets or sets a value indicating whether mac address migration is enabled. + /// A new instance for mocking. + public static HyperVToAzStackHCINicInput HyperVToAzStackHCINicInput(string nicId = null, string networkName = null, string targetNetworkId = null, string testNetworkId = null, VmNicSelection selectionTypeForFailover = default, bool? isStaticIPMigrationEnabled = null, bool? isMacMigrationEnabled = null) + { + return new HyperVToAzStackHCINicInput( + nicId, + networkName, + targetNetworkId, + testNetworkId, + selectionTypeForFailover, + isStaticIPMigrationEnabled, + isMacMigrationEnabled, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Gets or sets the ARM Id of the storage container. + /// Gets or sets the local path of the storage container. + /// Gets or sets the source disk Id. + /// Gets or sets the source disk Name. + /// Gets or sets the seed disk name. + /// Gets or sets the test failover clone disk. + /// Gets or sets the failover clone disk. + /// Gets or sets a value indicating whether the disk is the OS disk. + /// Gets or sets the disk capacity in bytes. + /// Gets or sets a value indicating whether dynamic sizing is enabled on the virtual hard disk. + /// Gets or sets the disk type. + /// Gets or sets a value of disk block size. + /// Gets or sets a value of disk logical sector size. + /// Gets or sets a value of disk physical sector size. + /// A new instance for mocking. + public static HyperVToAzStackHCIProtectedDiskProperties HyperVToAzStackHCIProtectedDiskProperties(string storageContainerId = null, string storageContainerLocalPath = null, string sourceDiskId = null, string sourceDiskName = null, string seedDiskName = null, string testMigrateDiskName = null, string migrateDiskName = null, bool? isOSDisk = null, long? capacityInBytes = null, bool? isDynamic = null, string diskType = null, long? diskBlockSize = null, long? diskLogicalSectorSize = null, long? diskPhysicalSectorSize = null) + { + return new HyperVToAzStackHCIProtectedDiskProperties( + storageContainerId, + storageContainerLocalPath, + sourceDiskId, + sourceDiskName, + seedDiskName, + testMigrateDiskName, + migrateDiskName, + isOSDisk, + capacityInBytes, + isDynamic, + diskType, + diskBlockSize, + diskLogicalSectorSize, + diskPhysicalSectorSize, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Gets or sets the NIC Id. + /// Gets or sets the NIC mac address. + /// Gets or sets the network name. + /// Gets or sets the target network Id within AzStackHCI Cluster. + /// Gets or sets the target test network Id within AzStackHCI Cluster. + /// Gets or sets the selection type of the NIC. + /// A new instance for mocking. + public static HyperVToAzStackHCIProtectedNicProperties HyperVToAzStackHCIProtectedNicProperties(string nicId = null, string macAddress = null, string networkName = null, string targetNetworkId = null, string testNetworkId = null, VmNicSelection? selectionTypeForFailover = null) + { + return new HyperVToAzStackHCIProtectedNicProperties( + nicId, + macAddress, + networkName, + targetNetworkId, + testNetworkId, + selectionTypeForFailover, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Gets or sets the location of the protected item. + /// Gets or sets the Target HCI Cluster ARM Id. + /// Gets or sets the Target Arc Cluster Custom Location ARM Id. + /// Gets or sets the Target AzStackHCI cluster name. + /// Gets or sets the target storage container ARM Id. + /// Gets or sets the target resource group ARM Id. + /// Gets or sets the target location. + /// Gets or sets the location of Azure Arc HCI custom location resource. + /// Gets or sets the list of disks to replicate. + /// Gets or sets the list of VM NIC to replicate. + /// Gets or sets the list of protected disks. + /// Gets or sets the VM NIC details. + /// Gets or sets the BIOS Id of the target AzStackHCI VM. + /// Gets or sets the target VM display name. + /// Gets or sets the hypervisor generation of the virtual machine possible values are 1,2. + /// Gets or sets the target network Id within AzStackHCI Cluster. + /// Gets or sets the target test network Id within AzStackHCI Cluster. + /// Gets or sets the target CPU cores. + /// Gets or sets a value indicating whether memory is dynamical. + /// Protected item dynamic memory config. + /// Gets or sets the target memory in mega-bytes. + /// Gets or sets the type of the OS. + /// Gets or sets the name of the OS. + /// Gets or sets the firmware type. + /// Gets or sets the ARM Id of the discovered machine. + /// Gets or sets the source VM display name. + /// Gets or sets the source VM CPU cores. + /// Gets or sets the source VM ram memory size in megabytes. + /// Gets or sets the run as account Id. + /// Gets or sets the source fabric agent name. + /// Gets or sets the target fabric agent name. + /// Gets or sets the source appliance name. + /// Gets or sets the target appliance name. + /// Gets or sets the recovery point Id to which the VM was failed over. + /// Gets or sets the last recovery point received time. + /// Gets or sets the last recovery point Id. + /// Gets or sets the initial replication progress percentage. This is calculated based on total bytes processed for all disks in the source VM. + /// Gets or sets the migration progress percentage. + /// Gets or sets the resume progress percentage. + /// Gets or sets the resync progress percentage. This is calculated based on total bytes processed for all disks in the source VM. + /// Gets or sets the resync retry count. + /// Gets or sets a value indicating whether resync is required. + /// Gets or sets the resync state. + /// Gets or sets a value indicating whether auto resync is to be done. + /// Gets or sets the resume retry count. + /// Gets or sets the latest timestamp that replication status is updated. + /// A new instance for mocking. + public static VMwareToAzStackHCIProtectedItemModelCustomProperties VMwareToAzStackHCIProtectedItemModelCustomProperties(ProtectedItemActiveLocation? activeLocation = null, string targetHciClusterId = null, string targetArcClusterCustomLocationId = null, string targetAzStackHciClusterName = null, string storageContainerId = null, string targetResourceGroupId = null, string targetLocation = null, string customLocationRegion = null, IEnumerable disksToInclude = null, IEnumerable nicsToInclude = null, IEnumerable protectedDisks = null, IEnumerable protectedNics = null, string targetVmBiosId = null, string targetVmName = null, string hyperVGeneration = null, string targetNetworkId = null, string testNetworkId = null, int? targetCpuCores = null, bool? isDynamicRam = null, ProtectedItemDynamicMemoryConfig dynamicMemoryConfig = null, int? targetMemoryInMegaBytes = null, string osType = null, string osName = null, string firmwareType = null, string fabricDiscoveryMachineId = null, string sourceVmName = null, int? sourceCpuCores = null, double? sourceMemoryInMegaBytes = null, string runAsAccountId = null, string sourceFabricAgentName = null, string targetFabricAgentName = null, string sourceApplianceName = null, string targetApplianceName = null, string failoverRecoveryPointId = null, DateTimeOffset? lastRecoveryPointReceived = null, string lastRecoveryPointId = null, int? initialReplicationProgressPercentage = null, int? migrationProgressPercentage = null, int? resumeProgressPercentage = null, int? resyncProgressPercentage = null, long? resyncRetryCount = null, bool? resyncRequired = null, VMwareToAzureMigrateResyncState? resyncState = null, bool? performAutoResync = null, long? resumeRetryCount = null, DateTimeOffset? lastReplicationUpdateOn = null) + { + disksToInclude ??= new List(); + nicsToInclude ??= new List(); + protectedDisks ??= new List(); + protectedNics ??= new List(); + + return new VMwareToAzStackHCIProtectedItemModelCustomProperties( + "VMwareToAzStackHCI", + serializedAdditionalRawData: null, + activeLocation, + targetHciClusterId, + targetArcClusterCustomLocationId, + targetAzStackHciClusterName, + storageContainerId, + targetResourceGroupId, + targetLocation, + customLocationRegion, + disksToInclude?.ToList(), + nicsToInclude?.ToList(), + protectedDisks?.ToList(), + protectedNics?.ToList(), + targetVmBiosId, + targetVmName, + hyperVGeneration, + targetNetworkId, + testNetworkId, + targetCpuCores, + isDynamicRam, + dynamicMemoryConfig, + targetMemoryInMegaBytes, + osType, + osName, + firmwareType, + fabricDiscoveryMachineId, + sourceVmName, + sourceCpuCores, + sourceMemoryInMegaBytes, + runAsAccountId, + sourceFabricAgentName, + targetFabricAgentName, + sourceApplianceName, + targetApplianceName, + failoverRecoveryPointId, + lastRecoveryPointReceived, + lastRecoveryPointId, + initialReplicationProgressPercentage, + migrationProgressPercentage, + resumeProgressPercentage, + resyncProgressPercentage, + resyncRetryCount, + resyncRequired, + resyncState, + performAutoResync, + resumeRetryCount, + lastReplicationUpdateOn); + } + + /// Initializes a new instance of . + /// Gets or sets the NIC Id. + /// Gets or sets the NIC label. + /// Gets or sets the network name. + /// Gets or sets the target network Id within AzStackHCI Cluster. + /// Gets or sets the target test network Id within AzStackHCI Cluster. + /// Gets or sets the selection type of the NIC. + /// Gets or sets a value indicating whether static ip migration is enabled. + /// Gets or sets a value indicating whether mac address migration is enabled. + /// A new instance for mocking. + public static VMwareToAzStackHCINicInput VMwareToAzStackHCINicInput(string nicId = null, string label = null, string networkName = null, string targetNetworkId = null, string testNetworkId = null, VmNicSelection selectionTypeForFailover = default, bool? isStaticIPMigrationEnabled = null, bool? isMacMigrationEnabled = null) + { + return new VMwareToAzStackHCINicInput( + nicId, + label, + networkName, + targetNetworkId, + testNetworkId, + selectionTypeForFailover, + isStaticIPMigrationEnabled, + isMacMigrationEnabled, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Gets or sets the ARM Id of the storage container. + /// Gets or sets the local path of the storage container. + /// Gets or sets the source disk Id. + /// Gets or sets the source disk Name. + /// Gets or sets the seed disk name. + /// Gets or sets the test failover clone disk. + /// Gets or sets the failover clone disk. + /// Gets or sets a value indicating whether the disk is the OS disk. + /// Gets or sets the disk capacity in bytes. + /// Gets or sets a value indicating whether dynamic sizing is enabled on the virtual hard disk. + /// Gets or sets the disk type. + /// Gets or sets a value of disk block size. + /// Gets or sets a value of disk logical sector size. + /// Gets or sets a value of disk physical sector size. + /// A new instance for mocking. + public static VMwareToAzStackHCIProtectedDiskProperties VMwareToAzStackHCIProtectedDiskProperties(string storageContainerId = null, string storageContainerLocalPath = null, string sourceDiskId = null, string sourceDiskName = null, string seedDiskName = null, string testMigrateDiskName = null, string migrateDiskName = null, bool? isOSDisk = null, long? capacityInBytes = null, bool? isDynamic = null, string diskType = null, long? diskBlockSize = null, long? diskLogicalSectorSize = null, long? diskPhysicalSectorSize = null) + { + return new VMwareToAzStackHCIProtectedDiskProperties( + storageContainerId, + storageContainerLocalPath, + sourceDiskId, + sourceDiskName, + seedDiskName, + testMigrateDiskName, + migrateDiskName, + isOSDisk, + capacityInBytes, + isDynamic, + diskType, + diskBlockSize, + diskLogicalSectorSize, + diskPhysicalSectorSize, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Gets or sets the NIC Id. + /// Gets or sets the NIC mac address. + /// Gets or sets the NIC label. + /// Gets or sets a value indicating whether this is the primary NIC. + /// Gets or sets the network name. + /// Gets or sets the target network Id within AzStackHCI Cluster. + /// Gets or sets the target test network Id within AzStackHCI Cluster. + /// Gets or sets the selection type of the NIC. + /// A new instance for mocking. + public static VMwareToAzStackHCIProtectedNicProperties VMwareToAzStackHCIProtectedNicProperties(string nicId = null, string macAddress = null, string label = null, bool? isPrimaryNic = null, string networkName = null, string targetNetworkId = null, string testNetworkId = null, VmNicSelection? selectionTypeForFailover = null) + { + return new VMwareToAzStackHCIProtectedNicProperties( + nicId, + macAddress, + label, + isPrimaryNic, + networkName, + targetNetworkId, + testNetworkId, + selectionTypeForFailover, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// Protected item model properties. + /// A new instance for mocking. + public static ProtectedItemModelPatch ProtectedItemModelPatch(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, ProtectedItemModelCustomPropertiesUpdate customProperties = null) + { + return new ProtectedItemModelPatch( + id, + name, + resourceType, + systemData, + customProperties != null ? new ProtectedItemModelPropertiesUpdate(customProperties, serializedAdditionalRawData: null) : null, + 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 RecoveryServicesDataReplicationPrivateLinkResourceDataData RecoveryServicesDataReplicationPrivateLinkResourceDataData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, RecoveryServicesDataReplicationPrivateLinkResourceProperties properties = null) + { + return new RecoveryServicesDataReplicationPrivateLinkResourceDataData( + id, + name, + resourceType, + systemData, + properties, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Gets or sets the group id. + /// Gets or sets the required member. This translates to how many Private IPs should be created for each privately linkable resource. + /// Gets or sets the private DNS zone names. + /// Gets or sets the provisioning state of the private link resource. + /// A new instance for mocking. + public static RecoveryServicesDataReplicationPrivateLinkResourceProperties RecoveryServicesDataReplicationPrivateLinkResourceProperties(string groupId = null, IEnumerable requiredMembers = null, IEnumerable requiredZoneNames = null, ProvisioningState? provisioningState = null) + { + requiredMembers ??= new List(); + requiredZoneNames ??= new List(); + + return new RecoveryServicesDataReplicationPrivateLinkResourceProperties(groupId, requiredMembers?.ToList(), requiredZoneNames?.ToList(), provisioningState, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The resource-specific properties for this resource. + /// Gets or sets ETag. + /// A new instance for mocking. + public static PrivateEndpointConnectionProxyData PrivateEndpointConnectionProxyData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, PrivateEndpointConnectionProxyProperties properties = null, string etag = null) + { + return new PrivateEndpointConnectionProxyData( + id, + name, + resourceType, + systemData, + properties, + etag, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Gets or sets the provisioning state of the private endpoint connection proxy. + /// Represent remote private endpoint information for the private endpoint connection proxy. + /// A new instance for mocking. + public static PrivateEndpointConnectionProxyProperties PrivateEndpointConnectionProxyProperties(ProvisioningState? provisioningState = null, RemotePrivateEndpoint remotePrivateEndpoint = null) + { + return new PrivateEndpointConnectionProxyProperties(provisioningState, remotePrivateEndpoint, 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 RecoveryServicesDataReplicationPrivateEndpointConnectionData RecoveryServicesDataReplicationPrivateEndpointConnectionData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, PrivateEndpointConnectionResponseProperties properties = null) + { + return new RecoveryServicesDataReplicationPrivateEndpointConnectionData( + id, + name, + resourceType, + systemData, + properties, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Gets or sets provisioning state of the private endpoint connection. + /// Represent private Endpoint network resource that is linked to the Private Endpoint connection. + /// Represents Private link service connection state. + /// A new instance for mocking. + public static PrivateEndpointConnectionResponseProperties PrivateEndpointConnectionResponseProperties(ProvisioningState? provisioningState = null, ResourceIdentifier privateEndpointId = null, RecoveryServicesDataReplicationPrivateLinkServiceConnectionState privateLinkServiceConnectionState = null) + { + return new PrivateEndpointConnectionResponseProperties(provisioningState, privateEndpointId != null ? ResourceManagerModelFactory.WritableSubResource(privateEndpointId) : null, privateLinkServiceConnectionState, 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 PolicyModelData PolicyModelData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, PolicyModelProperties properties = null) + { + return new PolicyModelData( + id, + name, + resourceType, + systemData, + properties, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Gets or sets the provisioning state of the policy. + /// + /// Policy model custom properties. + /// 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 PolicyModelProperties PolicyModelProperties(ProvisioningState? provisioningState = null, PolicyModelCustomProperties customProperties = null) + { + return new PolicyModelProperties(provisioningState, customProperties, 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 JobModelData JobModelData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, JobModelProperties properties = null) + { + return new JobModelData( + id, + name, + resourceType, + systemData, + properties, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Gets or sets the friendly display name. + /// Gets or sets the job state. + /// Gets or sets the start time. + /// Gets or sets the end time. + /// Gets or sets the affected object Id. + /// Gets or sets the affected object name. + /// Gets or sets the affected object internal Id. + /// Gets or sets the affected object internal name. + /// Gets or sets the object type. + /// Gets or sets the replication provider. + /// Gets or sets the source fabric provider. + /// Gets or sets the target fabric provider. + /// Gets or sets the list of allowed actions on the job. + /// Gets or sets the job activity id. + /// Gets or sets the list of tasks. + /// Gets or sets the list of errors. + /// + /// Job model custom properties. + /// 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 . + /// + /// Gets or sets the provisioning state of the job. + /// A new instance for mocking. + public static JobModelProperties JobModelProperties(string displayName = null, JobState? state = null, DateTimeOffset? startOn = null, DateTimeOffset? endOn = null, string objectId = null, string objectName = null, string objectInternalId = null, string objectInternalName = null, JobObjectType? objectType = null, string replicationProviderId = null, string sourceFabricProviderId = null, string targetFabricProviderId = null, IEnumerable allowedActions = null, string activityId = null, IEnumerable tasks = null, IEnumerable errors = null, JobModelCustomProperties customProperties = null, ProvisioningState? provisioningState = null) + { + allowedActions ??= new List(); + tasks ??= new List(); + errors ??= new List(); + + return new JobModelProperties( + displayName, + state, + startOn, + endOn, + objectId, + objectName, + objectInternalId, + objectInternalName, + objectType, + replicationProviderId, + sourceFabricProviderId, + targetFabricProviderId, + allowedActions?.ToList(), + activityId, + tasks?.ToList(), + errors?.ToList(), + customProperties, + provisioningState, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Gets or sets the task name. + /// Gets or sets the task state. + /// Gets or sets the start time. + /// Gets or sets the end time. + /// Task model custom properties. + /// Gets or sets the list of children job models. + /// A new instance for mocking. + public static TaskModel TaskModel(string taskName = null, TaskState? state = null, DateTimeOffset? startOn = null, DateTimeOffset? endOn = null, string customInstanceType = null, IEnumerable childrenJobs = null) + { + childrenJobs ??= new List(); + + return new TaskModel( + taskName, + state, + startOn, + endOn, + customInstanceType != null ? new TaskModelCustomProperties(customInstanceType, serializedAdditionalRawData: null) : null, + childrenJobs?.ToList(), + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Gets or sets the error code. + /// Gets or sets the error type. + /// Gets or sets the error severity. + /// Gets or sets the creation time of error. + /// Gets or sets the error message. + /// Gets or sets the possible causes of error. + /// Gets or sets the recommended action to resolve error. + /// A new instance for mocking. + public static ErrorModel ErrorModel(string code = null, string type = null, string severity = null, DateTimeOffset? createdOn = null, string message = null, string causes = null, string recommendation = null) + { + return new ErrorModel( + code, + type, + severity, + createdOn, + message, + causes, + recommendation, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Discriminator property for JobModelCustomProperties. + /// Gets or sets any custom properties of the affected object. + /// A new instance for mocking. + public static JobModelCustomProperties JobModelCustomProperties(string instanceType = null, JobModelCustomPropertiesAffectedObjectDetails affectedObjectDetails = null) + { + return new UnknownJobModelCustomProperties(instanceType, affectedObjectDetails, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// + /// + /// A new instance for mocking. + public static JobModelCustomPropertiesAffectedObjectDetails JobModelCustomPropertiesAffectedObjectDetails(string description = null, JobModelCustomPropertiesAffectedObjectDetailsType? type = null) + { + return new JobModelCustomPropertiesAffectedObjectDetails(description, type, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Gets or sets any custom properties of the affected object. + /// Gets or sets the failed over protected item details. + /// A new instance for mocking. + public static FailoverJobModelCustomProperties FailoverJobModelCustomProperties(JobModelCustomPropertiesAffectedObjectDetails affectedObjectDetails = null, IEnumerable protectedItemDetails = null) + { + protectedItemDetails ??= new List(); + + return new FailoverJobModelCustomProperties("FailoverJobDetails", affectedObjectDetails, serializedAdditionalRawData: null, protectedItemDetails?.ToList()); + } + + /// Initializes a new instance of . + /// Gets or sets the protected item name. + /// Gets or sets the VM name. + /// Gets or sets the test VM name. + /// Gets or sets the recovery point Id. + /// Gets or sets the recovery point time. + /// Gets or sets the network name. + /// Gets or sets the network subnet. + /// A new instance for mocking. + public static FailoverProtectedItemProperties FailoverProtectedItemProperties(string protectedItemName = null, string vmName = null, string testVmName = null, string recoveryPointId = null, DateTimeOffset? recoveryPointOn = null, string networkName = null, string subnet = null) + { + return new FailoverProtectedItemProperties( + protectedItemName, + vmName, + testVmName, + recoveryPointId, + recoveryPointOn, + networkName, + subnet, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Gets or sets any custom properties of the affected object. + /// Gets or sets the test failover cleanup comments. + /// A new instance for mocking. + public static TestFailoverCleanupJobModelCustomProperties TestFailoverCleanupJobModelCustomProperties(JobModelCustomPropertiesAffectedObjectDetails affectedObjectDetails = null, string comments = null) + { + return new TestFailoverCleanupJobModelCustomProperties("TestFailoverCleanupJobDetails", affectedObjectDetails, serializedAdditionalRawData: null, comments); + } + + /// Initializes a new instance of . + /// Gets or sets any custom properties of the affected object. + /// Gets or sets the test VM details. + /// A new instance for mocking. + public static TestFailoverJobModelCustomProperties TestFailoverJobModelCustomProperties(JobModelCustomPropertiesAffectedObjectDetails affectedObjectDetails = null, IEnumerable protectedItemDetails = null) + { + protectedItemDetails ??= new List(); + + return new TestFailoverJobModelCustomProperties("TestFailoverJobDetails", affectedObjectDetails, serializedAdditionalRawData: null, protectedItemDetails?.ToList()); + } + + /// 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 FabricAgentModelData FabricAgentModelData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, FabricAgentModelProperties properties = null) + { + return new FabricAgentModelData( + id, + name, + resourceType, + systemData, + properties, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Gets or sets the fabric agent correlation Id. + /// Gets or sets the machine Id where fabric agent is running. + /// Gets or sets the machine name where fabric agent is running. + /// Identity model. + /// Identity model. + /// Gets or sets a value indicating whether the fabric agent is responsive. + /// Gets or sets the time when last heartbeat was sent by the fabric agent. + /// Gets or sets the fabric agent version. + /// Gets or sets the provisioning state of the fabric agent. + /// Gets or sets the list of health errors. + /// + /// Fabric agent model custom properties. + /// 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 FabricAgentModelProperties FabricAgentModelProperties(string correlationId = null, string machineId = null, string machineName = null, IdentityModel authenticationIdentity = null, IdentityModel resourceAccessIdentity = null, bool? isResponsive = null, DateTimeOffset? lastHeartbeat = null, string versionNumber = null, ProvisioningState? provisioningState = null, IEnumerable healthErrors = null, FabricAgentModelCustomProperties customProperties = null) + { + healthErrors ??= new List(); + + return new FabricAgentModelProperties( + correlationId, + machineId, + machineName, + authenticationIdentity, + resourceAccessIdentity, + isResponsive, + lastHeartbeat, + versionNumber, + provisioningState, + healthErrors?.ToList(), + customProperties, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The tags. + /// The location. + /// The resource-specific properties for this resource. + /// A new instance for mocking. + public static FabricModelData FabricModelData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, FabricModelProperties properties = null) + { + tags ??= new Dictionary(); + + return new FabricModelData( + id, + name, + resourceType, + systemData, + tags, + location, + properties, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Gets or sets the provisioning state of the fabric. + /// Gets or sets the service endpoint. + /// Gets or sets the service resource Id. + /// Gets or sets the fabric health. + /// Gets or sets the list of health errors. + /// + /// Fabric model custom properties. + /// 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 FabricModelProperties FabricModelProperties(ProvisioningState? provisioningState = null, string serviceEndpoint = null, string serviceResourceId = null, HealthStatus? health = null, IEnumerable healthErrors = null, FabricModelCustomProperties customProperties = null) + { + healthErrors ??= new List(); + + return new FabricModelProperties( + provisioningState, + serviceEndpoint, + serviceResourceId, + health, + healthErrors?.ToList(), + customProperties, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Gets or sets the ARM Id of the AzStackHCI site. + /// Gets or sets the Appliance name. + /// AzStackHCI cluster properties. + /// Gets or sets the fabric resource Id. + /// Gets or sets the fabric container Id. + /// Gets or sets the Migration solution ARM Id. + /// Gets or sets the migration hub Uri. + /// A new instance for mocking. + public static AzStackHCIFabricModelCustomProperties AzStackHCIFabricModelCustomProperties(string azStackHciSiteId = null, IEnumerable applianceName = null, AzStackHCIClusterProperties cluster = null, string fabricResourceId = null, string fabricContainerId = null, string migrationSolutionId = null, string migrationHubUri = null) + { + applianceName ??= new List(); + + return new AzStackHCIFabricModelCustomProperties( + "AzStackHCI", + serializedAdditionalRawData: null, + azStackHciSiteId, + applianceName?.ToList(), + cluster, + fabricResourceId, + fabricContainerId, + migrationSolutionId, + migrationHubUri); + } + + /// Initializes a new instance of . + /// Gets or sets the ARM Id of the HyperV site. + /// Gets or sets the fabric resource Id. + /// Gets or sets the fabric container Id. + /// Gets or sets the migration solution ARM Id. + /// Gets or sets the migration hub Uri. + /// A new instance for mocking. + public static HyperVMigrateFabricModelCustomProperties HyperVMigrateFabricModelCustomProperties(string hyperVSiteId = null, string fabricResourceId = null, string fabricContainerId = null, string migrationSolutionId = null, string migrationHubUri = null) + { + return new HyperVMigrateFabricModelCustomProperties( + "HyperVMigrate", + serializedAdditionalRawData: null, + hyperVSiteId, + fabricResourceId, + fabricContainerId, + migrationSolutionId, + migrationHubUri); + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// Gets or sets the resource tags. + /// Fabric model properties. + /// A new instance for mocking. + public static FabricModelPatch FabricModelPatch(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, FabricModelProperties properties = null) + { + tags ??= new Dictionary(); + + return new FabricModelPatch( + id, + name, + resourceType, + systemData, + tags, + properties, + 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 EventModelData EventModelData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, EventModelProperties properties = null) + { + return new EventModelData( + id, + name, + resourceType, + systemData, + properties, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Gets or sets the resource type. + /// Gets or sets the resource name. + /// Gets or sets the event type. + /// Gets or sets the event name. + /// Gets or sets the time at which the event occurred at source. + /// Gets or sets the event severity. + /// Gets or sets the event description. + /// Gets or sets the event correlation Id. + /// Gets or sets the errors associated with this event. + /// + /// Event model custom properties. + /// 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 . + /// + /// Gets or sets the provisioning state of the event. + /// A new instance for mocking. + public static EventModelProperties EventModelProperties(string resourceType = null, string resourceName = null, string eventType = null, string eventName = null, DateTimeOffset? timeOfOccurrence = null, string severity = null, string description = null, string correlationId = null, IEnumerable healthErrors = null, EventModelCustomProperties customProperties = null, ProvisioningState? provisioningState = null) + { + healthErrors ??= new List(); + + return new EventModelProperties( + resourceType, + resourceName, + eventType, + eventName, + timeOfOccurrence, + severity, + description, + correlationId, + healthErrors?.ToList(), + customProperties, + provisioningState, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Gets or sets the friendly name of the source which has raised this health event. + /// Gets or sets the protected item friendly name. + /// Gets or sets the source appliance name. + /// Gets or sets the source target name. + /// Gets or sets the server type. + /// A new instance for mocking. + public static HyperVToAzStackHCIEventModelCustomProperties HyperVToAzStackHCIEventModelCustomProperties(string eventSourceFriendlyName = null, string protectedItemFriendlyName = null, string sourceApplianceName = null, string targetApplianceName = null, string serverType = null) + { + return new HyperVToAzStackHCIEventModelCustomProperties( + "HyperVToAzStackHCI", + serializedAdditionalRawData: null, + eventSourceFriendlyName, + protectedItemFriendlyName, + sourceApplianceName, + targetApplianceName, + serverType); + } + + /// Initializes a new instance of . + /// Gets or sets the friendly name of the source which has raised this health event. + /// Gets or sets the protected item friendly name. + /// Gets or sets the source appliance name. + /// Gets or sets the source target name. + /// Gets or sets the server type. + /// A new instance for mocking. + public static VMwareToAzStackHCIEventModelCustomProperties VMwareToAzStackHCIEventModelCustomProperties(string eventSourceFriendlyName = null, string protectedItemFriendlyName = null, string sourceApplianceName = null, string targetApplianceName = null, string serverType = null) + { + return new VMwareToAzStackHCIEventModelCustomProperties( + "VMwareToAzStackHCI", + serializedAdditionalRawData: null, + eventSourceFriendlyName, + protectedItemFriendlyName, + sourceApplianceName, + targetApplianceName, + serverType); + } + + /// 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 VaultModelData VaultModelData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, VaultModelProperties properties = null, ManagedServiceIdentity identity = null) + { + tags ??= new Dictionary(); + + return new VaultModelData( + id, + name, + resourceType, + systemData, + tags, + location, + properties, + identity, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Gets or sets the provisioning state of the vault. + /// Gets or sets the service resource Id. + /// Gets or sets the type of vault. + /// A new instance for mocking. + public static VaultModelProperties VaultModelProperties(ProvisioningState? provisioningState = null, string serviceResourceId = null, ReplicationVaultType? vaultType = null) + { + return new VaultModelProperties(provisioningState, serviceResourceId, vaultType, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// Gets or sets the resource tags. + /// Vault properties. + /// Vault identity. Current supported identity types: None, SystemAssigned, UserAssigned. + /// A new instance for mocking. + public static VaultModelPatch VaultModelPatch(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, VaultModelProperties properties = null, ManagedServiceIdentity identity = null) + { + tags ??= new Dictionary(); + + return new VaultModelPatch( + id, + name, + resourceType, + systemData, + tags, + properties, + identity, + 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 EmailConfigurationModelData EmailConfigurationModelData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, EmailConfigurationModelProperties properties = null) + { + return new EmailConfigurationModelData( + id, + name, + resourceType, + systemData, + properties, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Gets or sets a value indicating whether to send email to subscription administrator. + /// Gets or sets the custom email address for sending emails. + /// Gets or sets the locale for the email notification. + /// Gets or sets the provisioning state of the email configuration. + /// A new instance for mocking. + public static EmailConfigurationModelProperties EmailConfigurationModelProperties(bool sendToOwners = default, IEnumerable customEmailAddresses = null, string locale = null, ProvisioningState? provisioningState = null) + { + customEmailAddresses ??= new List(); + + return new EmailConfigurationModelProperties(sendToOwners, customEmailAddresses?.ToList(), locale, provisioningState, serializedAdditionalRawData: null); + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/EmailConfigurationModelCollection.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/EmailConfigurationModelCollection.cs new file mode 100644 index 000000000000..e665ecd12dce --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/EmailConfigurationModelCollection.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.RecoveryServicesDataReplication +{ + /// + /// 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 GetEmailConfigurationModels method from an instance of . + /// + public partial class EmailConfigurationModelCollection : ArmCollection, IEnumerable, IAsyncEnumerable + { + private readonly ClientDiagnostics _emailConfigurationModelEmailConfigurationClientDiagnostics; + private readonly EmailConfigurationRestOperations _emailConfigurationModelEmailConfigurationRestClient; + + /// Initializes a new instance of the class for mocking. + protected EmailConfigurationModelCollection() + { + } + + /// 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 EmailConfigurationModelCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _emailConfigurationModelEmailConfigurationClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.RecoveryServicesDataReplication", EmailConfigurationModelResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(EmailConfigurationModelResource.ResourceType, out string emailConfigurationModelEmailConfigurationApiVersion); + _emailConfigurationModelEmailConfigurationRestClient = new EmailConfigurationRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, emailConfigurationModelEmailConfigurationApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != VaultModelResource.ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, VaultModelResource.ResourceType), nameof(id)); + } + + /// + /// Creates an alert configuration setting for the given vault. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/alertSettings/{emailConfigurationName} + /// + /// + /// Operation Id + /// EmailConfigurationModel_Create + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// 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 email configuration name. + /// EmailConfiguration model. + /// 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 emailConfigurationName, EmailConfigurationModelData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(emailConfigurationName, nameof(emailConfigurationName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _emailConfigurationModelEmailConfigurationClientDiagnostics.CreateScope("EmailConfigurationModelCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = await _emailConfigurationModelEmailConfigurationRestClient.CreateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, emailConfigurationName, data, cancellationToken).ConfigureAwait(false); + var uri = _emailConfigurationModelEmailConfigurationRestClient.CreateCreateRequestUri(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, emailConfigurationName, data); + var rehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(RequestMethod.Put, uri.ToUri(), uri.ToString(), "None", null, OperationFinalStateVia.OriginalUri.ToString()); + var operation = new RecoveryServicesDataReplicationArmOperation(Response.FromValue(new EmailConfigurationModelResource(Client, response), response.GetRawResponse()), rehydrationToken); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Creates an alert configuration setting for the given vault. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/alertSettings/{emailConfigurationName} + /// + /// + /// Operation Id + /// EmailConfigurationModel_Create + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// 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 email configuration name. + /// EmailConfiguration model. + /// 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 emailConfigurationName, EmailConfigurationModelData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(emailConfigurationName, nameof(emailConfigurationName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _emailConfigurationModelEmailConfigurationClientDiagnostics.CreateScope("EmailConfigurationModelCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = _emailConfigurationModelEmailConfigurationRestClient.Create(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, emailConfigurationName, data, cancellationToken); + var uri = _emailConfigurationModelEmailConfigurationRestClient.CreateCreateRequestUri(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, emailConfigurationName, data); + var rehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(RequestMethod.Put, uri.ToUri(), uri.ToString(), "None", null, OperationFinalStateVia.OriginalUri.ToString()); + var operation = new RecoveryServicesDataReplicationArmOperation(Response.FromValue(new EmailConfigurationModelResource(Client, response), response.GetRawResponse()), rehydrationToken); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets the details of the alert configuration setting. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/alertSettings/{emailConfigurationName} + /// + /// + /// Operation Id + /// EmailConfigurationModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The email configuration name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetAsync(string emailConfigurationName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(emailConfigurationName, nameof(emailConfigurationName)); + + using var scope = _emailConfigurationModelEmailConfigurationClientDiagnostics.CreateScope("EmailConfigurationModelCollection.Get"); + scope.Start(); + try + { + var response = await _emailConfigurationModelEmailConfigurationRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, emailConfigurationName, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new EmailConfigurationModelResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets the details of the alert configuration setting. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/alertSettings/{emailConfigurationName} + /// + /// + /// Operation Id + /// EmailConfigurationModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The email configuration name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Get(string emailConfigurationName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(emailConfigurationName, nameof(emailConfigurationName)); + + using var scope = _emailConfigurationModelEmailConfigurationClientDiagnostics.CreateScope("EmailConfigurationModelCollection.Get"); + scope.Start(); + try + { + var response = _emailConfigurationModelEmailConfigurationRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, emailConfigurationName, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new EmailConfigurationModelResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets the list of alert configuration settings for the given vault. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/alertSettings + /// + /// + /// Operation Id + /// EmailConfigurationModel_List + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// 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) => _emailConfigurationModelEmailConfigurationRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _emailConfigurationModelEmailConfigurationRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new EmailConfigurationModelResource(Client, EmailConfigurationModelData.DeserializeEmailConfigurationModelData(e)), _emailConfigurationModelEmailConfigurationClientDiagnostics, Pipeline, "EmailConfigurationModelCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Gets the list of alert configuration settings for the given vault. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/alertSettings + /// + /// + /// Operation Id + /// EmailConfigurationModel_List + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// 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) => _emailConfigurationModelEmailConfigurationRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _emailConfigurationModelEmailConfigurationRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new EmailConfigurationModelResource(Client, EmailConfigurationModelData.DeserializeEmailConfigurationModelData(e)), _emailConfigurationModelEmailConfigurationClientDiagnostics, Pipeline, "EmailConfigurationModelCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/alertSettings/{emailConfigurationName} + /// + /// + /// Operation Id + /// EmailConfigurationModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The email configuration name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> ExistsAsync(string emailConfigurationName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(emailConfigurationName, nameof(emailConfigurationName)); + + using var scope = _emailConfigurationModelEmailConfigurationClientDiagnostics.CreateScope("EmailConfigurationModelCollection.Exists"); + scope.Start(); + try + { + var response = await _emailConfigurationModelEmailConfigurationRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, emailConfigurationName, 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.DataReplication/replicationVaults/{vaultName}/alertSettings/{emailConfigurationName} + /// + /// + /// Operation Id + /// EmailConfigurationModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The email configuration name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Exists(string emailConfigurationName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(emailConfigurationName, nameof(emailConfigurationName)); + + using var scope = _emailConfigurationModelEmailConfigurationClientDiagnostics.CreateScope("EmailConfigurationModelCollection.Exists"); + scope.Start(); + try + { + var response = _emailConfigurationModelEmailConfigurationRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, emailConfigurationName, 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.DataReplication/replicationVaults/{vaultName}/alertSettings/{emailConfigurationName} + /// + /// + /// Operation Id + /// EmailConfigurationModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The email configuration name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetIfExistsAsync(string emailConfigurationName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(emailConfigurationName, nameof(emailConfigurationName)); + + using var scope = _emailConfigurationModelEmailConfigurationClientDiagnostics.CreateScope("EmailConfigurationModelCollection.GetIfExists"); + scope.Start(); + try + { + var response = await _emailConfigurationModelEmailConfigurationRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, emailConfigurationName, cancellationToken: cancellationToken).ConfigureAwait(false); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new EmailConfigurationModelResource(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.DataReplication/replicationVaults/{vaultName}/alertSettings/{emailConfigurationName} + /// + /// + /// Operation Id + /// EmailConfigurationModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The email configuration name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual NullableResponse GetIfExists(string emailConfigurationName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(emailConfigurationName, nameof(emailConfigurationName)); + + using var scope = _emailConfigurationModelEmailConfigurationClientDiagnostics.CreateScope("EmailConfigurationModelCollection.GetIfExists"); + scope.Start(); + try + { + var response = _emailConfigurationModelEmailConfigurationRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, emailConfigurationName, cancellationToken: cancellationToken); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new EmailConfigurationModelResource(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/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/EmailConfigurationModelData.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/EmailConfigurationModelData.Serialization.cs new file mode 100644 index 000000000000..634944853fa0 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/EmailConfigurationModelData.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.Models; +using Azure.ResourceManager.RecoveryServicesDataReplication.Models; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication +{ + public partial class EmailConfigurationModelData : 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(EmailConfigurationModelData)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (Optional.IsDefined(Properties)) + { + writer.WritePropertyName("properties"u8); + writer.WriteObjectValue(Properties, options); + } + } + + EmailConfigurationModelData 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(EmailConfigurationModelData)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeEmailConfigurationModelData(document.RootElement, options); + } + + internal static EmailConfigurationModelData DeserializeEmailConfigurationModelData(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + EmailConfigurationModelProperties 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 = EmailConfigurationModelProperties.DeserializeEmailConfigurationModelProperties(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 EmailConfigurationModelData( + 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(EmailConfigurationModelData)} does not support writing '{options.Format}' format."); + } + } + + EmailConfigurationModelData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeEmailConfigurationModelData(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(EmailConfigurationModelData)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/EmailConfigurationModelData.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/EmailConfigurationModelData.cs new file mode 100644 index 000000000000..520a2b3a800e --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/EmailConfigurationModelData.cs @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; +using Azure.ResourceManager.Models; +using Azure.ResourceManager.RecoveryServicesDataReplication.Models; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication +{ + /// + /// A class representing the EmailConfigurationModel data model. + /// Email configuration model. + /// + public partial class EmailConfigurationModelData : 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 EmailConfigurationModelData() + { + } + + /// 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 EmailConfigurationModelData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, EmailConfigurationModelProperties properties, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) + { + Properties = properties; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The resource-specific properties for this resource. + public EmailConfigurationModelProperties Properties { get; set; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/EmailConfigurationModelResource.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/EmailConfigurationModelResource.Serialization.cs new file mode 100644 index 000000000000..f71b8816a288 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/EmailConfigurationModelResource.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.RecoveryServicesDataReplication +{ + public partial class EmailConfigurationModelResource : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); + + EmailConfigurationModelData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options); + + EmailConfigurationModelData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options); + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/EmailConfigurationModelResource.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/EmailConfigurationModelResource.cs new file mode 100644 index 000000000000..d7cba011b5d5 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/EmailConfigurationModelResource.cs @@ -0,0 +1,267 @@ +// 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.RecoveryServicesDataReplication +{ + /// + /// A Class representing an EmailConfigurationModel 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 GetEmailConfigurationModelResource method. + /// Otherwise you can get one from its parent resource using the GetEmailConfigurationModel method. + /// + public partial class EmailConfigurationModelResource : ArmResource + { + /// Generate the resource identifier of a instance. + /// The subscriptionId. + /// The resourceGroupName. + /// The vaultName. + /// The emailConfigurationName. + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string vaultName, string emailConfigurationName) + { + var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/alertSettings/{emailConfigurationName}"; + return new ResourceIdentifier(resourceId); + } + + private readonly ClientDiagnostics _emailConfigurationModelEmailConfigurationClientDiagnostics; + private readonly EmailConfigurationRestOperations _emailConfigurationModelEmailConfigurationRestClient; + private readonly EmailConfigurationModelData _data; + + /// Gets the resource type for the operations. + public static readonly ResourceType ResourceType = "Microsoft.DataReplication/replicationVaults/alertSettings"; + + /// Initializes a new instance of the class for mocking. + protected EmailConfigurationModelResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal EmailConfigurationModelResource(ArmClient client, EmailConfigurationModelData 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 EmailConfigurationModelResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _emailConfigurationModelEmailConfigurationClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.RecoveryServicesDataReplication", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string emailConfigurationModelEmailConfigurationApiVersion); + _emailConfigurationModelEmailConfigurationRestClient = new EmailConfigurationRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, emailConfigurationModelEmailConfigurationApiVersion); +#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 EmailConfigurationModelData 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)); + } + + /// + /// Gets the details of the alert configuration setting. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/alertSettings/{emailConfigurationName} + /// + /// + /// Operation Id + /// EmailConfigurationModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _emailConfigurationModelEmailConfigurationClientDiagnostics.CreateScope("EmailConfigurationModelResource.Get"); + scope.Start(); + try + { + var response = await _emailConfigurationModelEmailConfigurationRestClient.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 EmailConfigurationModelResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets the details of the alert configuration setting. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/alertSettings/{emailConfigurationName} + /// + /// + /// Operation Id + /// EmailConfigurationModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _emailConfigurationModelEmailConfigurationClientDiagnostics.CreateScope("EmailConfigurationModelResource.Get"); + scope.Start(); + try + { + var response = _emailConfigurationModelEmailConfigurationRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new EmailConfigurationModelResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Creates an alert configuration setting for the given vault. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/alertSettings/{emailConfigurationName} + /// + /// + /// Operation Id + /// EmailConfigurationModel_Create + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// 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. + /// EmailConfiguration model. + /// The cancellation token to use. + /// is null. + public virtual async Task> UpdateAsync(WaitUntil waitUntil, EmailConfigurationModelData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _emailConfigurationModelEmailConfigurationClientDiagnostics.CreateScope("EmailConfigurationModelResource.Update"); + scope.Start(); + try + { + var response = await _emailConfigurationModelEmailConfigurationRestClient.CreateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, cancellationToken).ConfigureAwait(false); + var uri = _emailConfigurationModelEmailConfigurationRestClient.CreateCreateRequestUri(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 RecoveryServicesDataReplicationArmOperation(Response.FromValue(new EmailConfigurationModelResource(Client, response), response.GetRawResponse()), rehydrationToken); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Creates an alert configuration setting for the given vault. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/alertSettings/{emailConfigurationName} + /// + /// + /// Operation Id + /// EmailConfigurationModel_Create + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// 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. + /// EmailConfiguration model. + /// The cancellation token to use. + /// is null. + public virtual ArmOperation Update(WaitUntil waitUntil, EmailConfigurationModelData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _emailConfigurationModelEmailConfigurationClientDiagnostics.CreateScope("EmailConfigurationModelResource.Update"); + scope.Start(); + try + { + var response = _emailConfigurationModelEmailConfigurationRestClient.Create(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, cancellationToken); + var uri = _emailConfigurationModelEmailConfigurationRestClient.CreateCreateRequestUri(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 RecoveryServicesDataReplicationArmOperation(Response.FromValue(new EmailConfigurationModelResource(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/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/EventModelCollection.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/EventModelCollection.cs new file mode 100644 index 000000000000..49e02aeb83ef --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/EventModelCollection.cs @@ -0,0 +1,401 @@ +// 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.RecoveryServicesDataReplication +{ + /// + /// 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 GetEventModels method from an instance of . + /// + public partial class EventModelCollection : ArmCollection, IEnumerable, IAsyncEnumerable + { + private readonly ClientDiagnostics _eventModelEventClientDiagnostics; + private readonly EventRestOperations _eventModelEventRestClient; + + /// Initializes a new instance of the class for mocking. + protected EventModelCollection() + { + } + + /// 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 EventModelCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _eventModelEventClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.RecoveryServicesDataReplication", EventModelResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(EventModelResource.ResourceType, out string eventModelEventApiVersion); + _eventModelEventRestClient = new EventRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, eventModelEventApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != VaultModelResource.ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, VaultModelResource.ResourceType), nameof(id)); + } + + /// + /// Gets the details of the event. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/events/{eventName} + /// + /// + /// Operation Id + /// EventModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The event name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetAsync(string eventName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(eventName, nameof(eventName)); + + using var scope = _eventModelEventClientDiagnostics.CreateScope("EventModelCollection.Get"); + scope.Start(); + try + { + var response = await _eventModelEventRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, eventName, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new EventModelResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets the details of the event. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/events/{eventName} + /// + /// + /// Operation Id + /// EventModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The event name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Get(string eventName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(eventName, nameof(eventName)); + + using var scope = _eventModelEventClientDiagnostics.CreateScope("EventModelCollection.Get"); + scope.Start(); + try + { + var response = _eventModelEventRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, eventName, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new EventModelResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets the list of events in the given vault. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/events + /// + /// + /// Operation Id + /// EventModel_List + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// OData options. + /// Continuation token. + /// Page size. + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetAllAsync(string odataOptions = null, string continuationToken = null, int? pageSize = null, CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _eventModelEventRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, odataOptions, continuationToken, pageSizeHint); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _eventModelEventRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name, odataOptions, continuationToken, pageSizeHint); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new EventModelResource(Client, EventModelData.DeserializeEventModelData(e)), _eventModelEventClientDiagnostics, Pipeline, "EventModelCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Gets the list of events in the given vault. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/events + /// + /// + /// Operation Id + /// EventModel_List + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// OData options. + /// Continuation token. + /// Page size. + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetAll(string odataOptions = null, string continuationToken = null, int? pageSize = null, CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _eventModelEventRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, odataOptions, continuationToken, pageSizeHint); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _eventModelEventRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name, odataOptions, continuationToken, pageSizeHint); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new EventModelResource(Client, EventModelData.DeserializeEventModelData(e)), _eventModelEventClientDiagnostics, Pipeline, "EventModelCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/events/{eventName} + /// + /// + /// Operation Id + /// EventModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The event name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> ExistsAsync(string eventName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(eventName, nameof(eventName)); + + using var scope = _eventModelEventClientDiagnostics.CreateScope("EventModelCollection.Exists"); + scope.Start(); + try + { + var response = await _eventModelEventRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, eventName, 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.DataReplication/replicationVaults/{vaultName}/events/{eventName} + /// + /// + /// Operation Id + /// EventModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The event name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Exists(string eventName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(eventName, nameof(eventName)); + + using var scope = _eventModelEventClientDiagnostics.CreateScope("EventModelCollection.Exists"); + scope.Start(); + try + { + var response = _eventModelEventRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, eventName, 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.DataReplication/replicationVaults/{vaultName}/events/{eventName} + /// + /// + /// Operation Id + /// EventModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The event name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetIfExistsAsync(string eventName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(eventName, nameof(eventName)); + + using var scope = _eventModelEventClientDiagnostics.CreateScope("EventModelCollection.GetIfExists"); + scope.Start(); + try + { + var response = await _eventModelEventRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, eventName, cancellationToken: cancellationToken).ConfigureAwait(false); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new EventModelResource(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.DataReplication/replicationVaults/{vaultName}/events/{eventName} + /// + /// + /// Operation Id + /// EventModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The event name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual NullableResponse GetIfExists(string eventName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(eventName, nameof(eventName)); + + using var scope = _eventModelEventClientDiagnostics.CreateScope("EventModelCollection.GetIfExists"); + scope.Start(); + try + { + var response = _eventModelEventRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, eventName, cancellationToken: cancellationToken); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new EventModelResource(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/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/EventModelData.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/EventModelData.Serialization.cs new file mode 100644 index 000000000000..cc7a8edcd068 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/EventModelData.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.Models; +using Azure.ResourceManager.RecoveryServicesDataReplication.Models; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication +{ + public partial class EventModelData : 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(EventModelData)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (Optional.IsDefined(Properties)) + { + writer.WritePropertyName("properties"u8); + writer.WriteObjectValue(Properties, options); + } + } + + EventModelData 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(EventModelData)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeEventModelData(document.RootElement, options); + } + + internal static EventModelData DeserializeEventModelData(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + EventModelProperties 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 = EventModelProperties.DeserializeEventModelProperties(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 EventModelData( + 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(EventModelData)} does not support writing '{options.Format}' format."); + } + } + + EventModelData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeEventModelData(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(EventModelData)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/EventModelData.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/EventModelData.cs new file mode 100644 index 000000000000..43942d81bfa6 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/EventModelData.cs @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; +using Azure.ResourceManager.Models; +using Azure.ResourceManager.RecoveryServicesDataReplication.Models; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication +{ + /// + /// A class representing the EventModel data model. + /// Event model. + /// + public partial class EventModelData : 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 . + internal EventModelData() + { + } + + /// 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 EventModelData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, EventModelProperties properties, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) + { + Properties = properties; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The resource-specific properties for this resource. + public EventModelProperties Properties { get; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/EventModelResource.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/EventModelResource.Serialization.cs new file mode 100644 index 000000000000..4efb1bf89625 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/EventModelResource.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.RecoveryServicesDataReplication +{ + public partial class EventModelResource : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); + + EventModelData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options); + + EventModelData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options); + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/EventModelResource.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/EventModelResource.cs new file mode 100644 index 000000000000..5440f831a153 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/EventModelResource.cs @@ -0,0 +1,171 @@ +// 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.RecoveryServicesDataReplication +{ + /// + /// A Class representing an EventModel 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 GetEventModelResource method. + /// Otherwise you can get one from its parent resource using the GetEventModel method. + /// + public partial class EventModelResource : ArmResource + { + /// Generate the resource identifier of a instance. + /// The subscriptionId. + /// The resourceGroupName. + /// The vaultName. + /// The eventName. + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string vaultName, string eventName) + { + var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/events/{eventName}"; + return new ResourceIdentifier(resourceId); + } + + private readonly ClientDiagnostics _eventModelEventClientDiagnostics; + private readonly EventRestOperations _eventModelEventRestClient; + private readonly EventModelData _data; + + /// Gets the resource type for the operations. + public static readonly ResourceType ResourceType = "Microsoft.DataReplication/replicationVaults/events"; + + /// Initializes a new instance of the class for mocking. + protected EventModelResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal EventModelResource(ArmClient client, EventModelData 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 EventModelResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _eventModelEventClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.RecoveryServicesDataReplication", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string eventModelEventApiVersion); + _eventModelEventRestClient = new EventRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, eventModelEventApiVersion); +#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 EventModelData 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)); + } + + /// + /// Gets the details of the event. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/events/{eventName} + /// + /// + /// Operation Id + /// EventModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _eventModelEventClientDiagnostics.CreateScope("EventModelResource.Get"); + scope.Start(); + try + { + var response = await _eventModelEventRestClient.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 EventModelResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets the details of the event. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/events/{eventName} + /// + /// + /// Operation Id + /// EventModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _eventModelEventClientDiagnostics.CreateScope("EventModelResource.Get"); + scope.Start(); + try + { + var response = _eventModelEventRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new EventModelResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Extensions/MockableRecoveryServicesDataReplicationArmClient.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Extensions/MockableRecoveryServicesDataReplicationArmClient.cs new file mode 100644 index 000000000000..1b7713b8011f --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Extensions/MockableRecoveryServicesDataReplicationArmClient.cs @@ -0,0 +1,193 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Mocking +{ + /// A class to add extension methods to ArmClient. + public partial class MockableRecoveryServicesDataReplicationArmClient : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected MockableRecoveryServicesDataReplicationArmClient() + { + } + + /// 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 MockableRecoveryServicesDataReplicationArmClient(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + internal MockableRecoveryServicesDataReplicationArmClient(ArmClient client) : this(client, ResourceIdentifier.Root) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// + /// 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 EmailConfigurationModelResource GetEmailConfigurationModelResource(ResourceIdentifier id) + { + EmailConfigurationModelResource.ValidateResourceId(id); + return new EmailConfigurationModelResource(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 VaultModelResource GetVaultModelResource(ResourceIdentifier id) + { + VaultModelResource.ValidateResourceId(id); + return new VaultModelResource(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 EventModelResource GetEventModelResource(ResourceIdentifier id) + { + EventModelResource.ValidateResourceId(id); + return new EventModelResource(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 FabricModelResource GetFabricModelResource(ResourceIdentifier id) + { + FabricModelResource.ValidateResourceId(id); + return new FabricModelResource(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 FabricAgentModelResource GetFabricAgentModelResource(ResourceIdentifier id) + { + FabricAgentModelResource.ValidateResourceId(id); + return new FabricAgentModelResource(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 JobModelResource GetJobModelResource(ResourceIdentifier id) + { + JobModelResource.ValidateResourceId(id); + return new JobModelResource(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 PolicyModelResource GetPolicyModelResource(ResourceIdentifier id) + { + PolicyModelResource.ValidateResourceId(id); + return new PolicyModelResource(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 RecoveryServicesDataReplicationPrivateEndpointConnectionResource GetRecoveryServicesDataReplicationPrivateEndpointConnectionResource(ResourceIdentifier id) + { + RecoveryServicesDataReplicationPrivateEndpointConnectionResource.ValidateResourceId(id); + return new RecoveryServicesDataReplicationPrivateEndpointConnectionResource(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 PrivateEndpointConnectionProxyResource GetPrivateEndpointConnectionProxyResource(ResourceIdentifier id) + { + PrivateEndpointConnectionProxyResource.ValidateResourceId(id); + return new PrivateEndpointConnectionProxyResource(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 RecoveryServicesDataReplicationPrivateLinkResourceDataResource GetRecoveryServicesDataReplicationPrivateLinkResourceDataResource(ResourceIdentifier id) + { + RecoveryServicesDataReplicationPrivateLinkResourceDataResource.ValidateResourceId(id); + return new RecoveryServicesDataReplicationPrivateLinkResourceDataResource(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 ProtectedItemModelResource GetProtectedItemModelResource(ResourceIdentifier id) + { + ProtectedItemModelResource.ValidateResourceId(id); + return new ProtectedItemModelResource(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 RecoveryPointModelResource GetRecoveryPointModelResource(ResourceIdentifier id) + { + RecoveryPointModelResource.ValidateResourceId(id); + return new RecoveryPointModelResource(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 ReplicationExtensionModelResource GetReplicationExtensionModelResource(ResourceIdentifier id) + { + ReplicationExtensionModelResource.ValidateResourceId(id); + return new ReplicationExtensionModelResource(Client, id); + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Extensions/MockableRecoveryServicesDataReplicationResourceGroupResource.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Extensions/MockableRecoveryServicesDataReplicationResourceGroupResource.cs new file mode 100644 index 000000000000..1ae0ea9e8f70 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Extensions/MockableRecoveryServicesDataReplicationResourceGroupResource.cs @@ -0,0 +1,344 @@ +// 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.Core.Pipeline; +using Azure.ResourceManager.RecoveryServicesDataReplication.Models; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Mocking +{ + /// A class to add extension methods to ResourceGroupResource. + public partial class MockableRecoveryServicesDataReplicationResourceGroupResource : ArmResource + { + private ClientDiagnostics _deploymentPreflightClientDiagnostics; + private DeploymentPreflightRestOperations _deploymentPreflightRestClient; + private ClientDiagnostics _operationResultsClientDiagnostics; + private OperationResultsRestOperations _operationResultsRestClient; + + /// Initializes a new instance of the class for mocking. + protected MockableRecoveryServicesDataReplicationResourceGroupResource() + { + } + + /// 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 MockableRecoveryServicesDataReplicationResourceGroupResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + private ClientDiagnostics DeploymentPreflightClientDiagnostics => _deploymentPreflightClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.RecoveryServicesDataReplication", ProviderConstants.DefaultProviderNamespace, Diagnostics); + private DeploymentPreflightRestOperations DeploymentPreflightRestClient => _deploymentPreflightRestClient ??= new DeploymentPreflightRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint); + private ClientDiagnostics OperationResultsClientDiagnostics => _operationResultsClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.RecoveryServicesDataReplication", ProviderConstants.DefaultProviderNamespace, Diagnostics); + private OperationResultsRestOperations OperationResultsRestClient => _operationResultsRestClient ??= new OperationResultsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint); + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// Gets a collection of VaultModelResources in the ResourceGroupResource. + /// An object representing collection of VaultModelResources and their operations over a VaultModelResource. + public virtual VaultModelCollection GetVaultModels() + { + return GetCachedClient(client => new VaultModelCollection(client, Id)); + } + + /// + /// Gets the details of the vault. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName} + /// + /// + /// Operation Id + /// VaultModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The vault name. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetVaultModelAsync(string vaultName, CancellationToken cancellationToken = default) + { + return await GetVaultModels().GetAsync(vaultName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets the details of the vault. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName} + /// + /// + /// Operation Id + /// VaultModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The vault name. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetVaultModel(string vaultName, CancellationToken cancellationToken = default) + { + return GetVaultModels().Get(vaultName, cancellationToken); + } + + /// Gets a collection of FabricModelResources in the ResourceGroupResource. + /// An object representing collection of FabricModelResources and their operations over a FabricModelResource. + public virtual FabricModelCollection GetFabricModels() + { + return GetCachedClient(client => new FabricModelCollection(client, Id)); + } + + /// + /// Gets the details of the fabric. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationFabrics/{fabricName} + /// + /// + /// Operation Id + /// FabricModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The fabric name. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetFabricModelAsync(string fabricName, CancellationToken cancellationToken = default) + { + return await GetFabricModels().GetAsync(fabricName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets the details of the fabric. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationFabrics/{fabricName} + /// + /// + /// Operation Id + /// FabricModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The fabric name. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetFabricModel(string fabricName, CancellationToken cancellationToken = default) + { + return GetFabricModels().Get(fabricName, cancellationToken); + } + + /// + /// Performs resource deployment preflight validation. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/deployments/{deploymentId}/preflight + /// + /// + /// Operation Id + /// DeploymentPreflight_Post + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// + /// Deployment Id. + /// Deployment preflight model. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> PostDeploymentPreflightAsync(string deploymentId, DeploymentPreflightModel body = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(deploymentId, nameof(deploymentId)); + + using var scope = DeploymentPreflightClientDiagnostics.CreateScope("MockableRecoveryServicesDataReplicationResourceGroupResource.PostDeploymentPreflight"); + scope.Start(); + try + { + var response = await DeploymentPreflightRestClient.PostAsync(Id.SubscriptionId, Id.ResourceGroupName, deploymentId, body, cancellationToken).ConfigureAwait(false); + return response; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Performs resource deployment preflight validation. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/deployments/{deploymentId}/preflight + /// + /// + /// Operation Id + /// DeploymentPreflight_Post + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// + /// Deployment Id. + /// Deployment preflight model. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response PostDeploymentPreflight(string deploymentId, DeploymentPreflightModel body = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(deploymentId, nameof(deploymentId)); + + using var scope = DeploymentPreflightClientDiagnostics.CreateScope("MockableRecoveryServicesDataReplicationResourceGroupResource.PostDeploymentPreflight"); + scope.Start(); + try + { + var response = DeploymentPreflightRestClient.Post(Id.SubscriptionId, Id.ResourceGroupName, deploymentId, body, cancellationToken); + return response; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets the operations. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/operationResults/{operationId}/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/{operationId} + /// + /// + /// Operation Id + /// ArmResponse_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// + /// The ID of an ongoing async operation. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetOperationResultAsync(string operationId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(operationId, nameof(operationId)); + + using var scope = OperationResultsClientDiagnostics.CreateScope("MockableRecoveryServicesDataReplicationResourceGroupResource.GetOperationResult"); + scope.Start(); + try + { + var response = await OperationResultsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, operationId, cancellationToken).ConfigureAwait(false); + return response; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets the operations. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/operationResults/{operationId}/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/{operationId} + /// + /// + /// Operation Id + /// ArmResponse_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// + /// The ID of an ongoing async operation. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response GetOperationResult(string operationId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(operationId, nameof(operationId)); + + using var scope = OperationResultsClientDiagnostics.CreateScope("MockableRecoveryServicesDataReplicationResourceGroupResource.GetOperationResult"); + scope.Start(); + try + { + var response = OperationResultsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, operationId, cancellationToken); + return response; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Extensions/MockableRecoveryServicesDataReplicationSubscriptionResource.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Extensions/MockableRecoveryServicesDataReplicationSubscriptionResource.cs new file mode 100644 index 000000000000..505b3ec49f0b --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Extensions/MockableRecoveryServicesDataReplicationSubscriptionResource.cs @@ -0,0 +1,245 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading; +using System.Threading.Tasks; +using Autorest.CSharp.Core; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.RecoveryServicesDataReplication.Models; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Mocking +{ + /// A class to add extension methods to SubscriptionResource. + public partial class MockableRecoveryServicesDataReplicationSubscriptionResource : ArmResource + { + private ClientDiagnostics _vaultModelVaultClientDiagnostics; + private VaultRestOperations _vaultModelVaultRestClient; + private ClientDiagnostics _fabricModelFabricClientDiagnostics; + private FabricRestOperations _fabricModelFabricRestClient; + private ClientDiagnostics _checkNameAvailabilityClientDiagnostics; + private CheckNameAvailabilityRestOperations _checkNameAvailabilityRestClient; + + /// Initializes a new instance of the class for mocking. + protected MockableRecoveryServicesDataReplicationSubscriptionResource() + { + } + + /// 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 MockableRecoveryServicesDataReplicationSubscriptionResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + private ClientDiagnostics VaultModelVaultClientDiagnostics => _vaultModelVaultClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.RecoveryServicesDataReplication", VaultModelResource.ResourceType.Namespace, Diagnostics); + private VaultRestOperations VaultModelVaultRestClient => _vaultModelVaultRestClient ??= new VaultRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, GetApiVersionOrNull(VaultModelResource.ResourceType)); + private ClientDiagnostics FabricModelFabricClientDiagnostics => _fabricModelFabricClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.RecoveryServicesDataReplication", FabricModelResource.ResourceType.Namespace, Diagnostics); + private FabricRestOperations FabricModelFabricRestClient => _fabricModelFabricRestClient ??= new FabricRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, GetApiVersionOrNull(FabricModelResource.ResourceType)); + private ClientDiagnostics CheckNameAvailabilityClientDiagnostics => _checkNameAvailabilityClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.RecoveryServicesDataReplication", ProviderConstants.DefaultProviderNamespace, Diagnostics); + private CheckNameAvailabilityRestOperations CheckNameAvailabilityRestClient => _checkNameAvailabilityRestClient ??= new CheckNameAvailabilityRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint); + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// + /// Gets the list of vaults in the given subscription. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.DataReplication/replicationVaults + /// + /// + /// Operation Id + /// VaultModel_ListBySubscription + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetVaultModelsAsync(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => VaultModelVaultRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => VaultModelVaultRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new VaultModelResource(Client, VaultModelData.DeserializeVaultModelData(e)), VaultModelVaultClientDiagnostics, Pipeline, "MockableRecoveryServicesDataReplicationSubscriptionResource.GetVaultModels", "value", "nextLink", cancellationToken); + } + + /// + /// Gets the list of vaults in the given subscription. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.DataReplication/replicationVaults + /// + /// + /// Operation Id + /// VaultModel_ListBySubscription + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetVaultModels(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => VaultModelVaultRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => VaultModelVaultRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new VaultModelResource(Client, VaultModelData.DeserializeVaultModelData(e)), VaultModelVaultClientDiagnostics, Pipeline, "MockableRecoveryServicesDataReplicationSubscriptionResource.GetVaultModels", "value", "nextLink", cancellationToken); + } + + /// + /// Gets the list of fabrics in the given subscription. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.DataReplication/replicationFabrics + /// + /// + /// Operation Id + /// FabricModel_ListBySubscription + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetFabricModelsAsync(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => FabricModelFabricRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => FabricModelFabricRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new FabricModelResource(Client, FabricModelData.DeserializeFabricModelData(e)), FabricModelFabricClientDiagnostics, Pipeline, "MockableRecoveryServicesDataReplicationSubscriptionResource.GetFabricModels", "value", "nextLink", cancellationToken); + } + + /// + /// Gets the list of fabrics in the given subscription. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.DataReplication/replicationFabrics + /// + /// + /// Operation Id + /// FabricModel_ListBySubscription + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetFabricModels(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => FabricModelFabricRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => FabricModelFabricRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new FabricModelResource(Client, FabricModelData.DeserializeFabricModelData(e)), FabricModelFabricClientDiagnostics, Pipeline, "MockableRecoveryServicesDataReplicationSubscriptionResource.GetFabricModels", "value", "nextLink", cancellationToken); + } + + /// + /// Checks the resource name availability. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.DataReplication/locations/{location}/checkNameAvailability + /// + /// + /// Operation Id + /// CheckNameAvailability_Post + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// + /// The name of the Azure region. + /// Resource details. + /// The cancellation token to use. + public virtual async Task> PostCheckNameAvailabilityAsync(AzureLocation location, CheckNameAvailabilityModel body = null, CancellationToken cancellationToken = default) + { + using var scope = CheckNameAvailabilityClientDiagnostics.CreateScope("MockableRecoveryServicesDataReplicationSubscriptionResource.PostCheckNameAvailability"); + scope.Start(); + try + { + var response = await CheckNameAvailabilityRestClient.PostAsync(Id.SubscriptionId, location, body, cancellationToken).ConfigureAwait(false); + return response; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Checks the resource name availability. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.DataReplication/locations/{location}/checkNameAvailability + /// + /// + /// Operation Id + /// CheckNameAvailability_Post + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// + /// The name of the Azure region. + /// Resource details. + /// The cancellation token to use. + public virtual Response PostCheckNameAvailability(AzureLocation location, CheckNameAvailabilityModel body = null, CancellationToken cancellationToken = default) + { + using var scope = CheckNameAvailabilityClientDiagnostics.CreateScope("MockableRecoveryServicesDataReplicationSubscriptionResource.PostCheckNameAvailability"); + scope.Start(); + try + { + var response = CheckNameAvailabilityRestClient.Post(Id.SubscriptionId, location, body, cancellationToken); + return response; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Extensions/RecoveryServicesDataReplicationExtensions.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Extensions/RecoveryServicesDataReplicationExtensions.cs new file mode 100644 index 000000000000..f8d5960e0261 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Extensions/RecoveryServicesDataReplicationExtensions.cs @@ -0,0 +1,813 @@ +// 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.RecoveryServicesDataReplication.Mocking; +using Azure.ResourceManager.RecoveryServicesDataReplication.Models; +using Azure.ResourceManager.Resources; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication +{ + /// A class to add extension methods to Azure.ResourceManager.RecoveryServicesDataReplication. + public static partial class RecoveryServicesDataReplicationExtensions + { + private static MockableRecoveryServicesDataReplicationArmClient GetMockableRecoveryServicesDataReplicationArmClient(ArmClient client) + { + return client.GetCachedClient(client0 => new MockableRecoveryServicesDataReplicationArmClient(client0)); + } + + private static MockableRecoveryServicesDataReplicationResourceGroupResource GetMockableRecoveryServicesDataReplicationResourceGroupResource(ArmResource resource) + { + return resource.GetCachedClient(client => new MockableRecoveryServicesDataReplicationResourceGroupResource(client, resource.Id)); + } + + private static MockableRecoveryServicesDataReplicationSubscriptionResource GetMockableRecoveryServicesDataReplicationSubscriptionResource(ArmResource resource) + { + return resource.GetCachedClient(client => new MockableRecoveryServicesDataReplicationSubscriptionResource(client, resource.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 EmailConfigurationModelResource GetEmailConfigurationModelResource(this ArmClient client, ResourceIdentifier id) + { + Argument.AssertNotNull(client, nameof(client)); + + return GetMockableRecoveryServicesDataReplicationArmClient(client).GetEmailConfigurationModelResource(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 VaultModelResource GetVaultModelResource(this ArmClient client, ResourceIdentifier id) + { + Argument.AssertNotNull(client, nameof(client)); + + return GetMockableRecoveryServicesDataReplicationArmClient(client).GetVaultModelResource(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 EventModelResource GetEventModelResource(this ArmClient client, ResourceIdentifier id) + { + Argument.AssertNotNull(client, nameof(client)); + + return GetMockableRecoveryServicesDataReplicationArmClient(client).GetEventModelResource(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 FabricModelResource GetFabricModelResource(this ArmClient client, ResourceIdentifier id) + { + Argument.AssertNotNull(client, nameof(client)); + + return GetMockableRecoveryServicesDataReplicationArmClient(client).GetFabricModelResource(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 FabricAgentModelResource GetFabricAgentModelResource(this ArmClient client, ResourceIdentifier id) + { + Argument.AssertNotNull(client, nameof(client)); + + return GetMockableRecoveryServicesDataReplicationArmClient(client).GetFabricAgentModelResource(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 JobModelResource GetJobModelResource(this ArmClient client, ResourceIdentifier id) + { + Argument.AssertNotNull(client, nameof(client)); + + return GetMockableRecoveryServicesDataReplicationArmClient(client).GetJobModelResource(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 PolicyModelResource GetPolicyModelResource(this ArmClient client, ResourceIdentifier id) + { + Argument.AssertNotNull(client, nameof(client)); + + return GetMockableRecoveryServicesDataReplicationArmClient(client).GetPolicyModelResource(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 RecoveryServicesDataReplicationPrivateEndpointConnectionResource GetRecoveryServicesDataReplicationPrivateEndpointConnectionResource(this ArmClient client, ResourceIdentifier id) + { + Argument.AssertNotNull(client, nameof(client)); + + return GetMockableRecoveryServicesDataReplicationArmClient(client).GetRecoveryServicesDataReplicationPrivateEndpointConnectionResource(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 PrivateEndpointConnectionProxyResource GetPrivateEndpointConnectionProxyResource(this ArmClient client, ResourceIdentifier id) + { + Argument.AssertNotNull(client, nameof(client)); + + return GetMockableRecoveryServicesDataReplicationArmClient(client).GetPrivateEndpointConnectionProxyResource(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 RecoveryServicesDataReplicationPrivateLinkResourceDataResource GetRecoveryServicesDataReplicationPrivateLinkResourceDataResource(this ArmClient client, ResourceIdentifier id) + { + Argument.AssertNotNull(client, nameof(client)); + + return GetMockableRecoveryServicesDataReplicationArmClient(client).GetRecoveryServicesDataReplicationPrivateLinkResourceDataResource(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 ProtectedItemModelResource GetProtectedItemModelResource(this ArmClient client, ResourceIdentifier id) + { + Argument.AssertNotNull(client, nameof(client)); + + return GetMockableRecoveryServicesDataReplicationArmClient(client).GetProtectedItemModelResource(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 RecoveryPointModelResource GetRecoveryPointModelResource(this ArmClient client, ResourceIdentifier id) + { + Argument.AssertNotNull(client, nameof(client)); + + return GetMockableRecoveryServicesDataReplicationArmClient(client).GetRecoveryPointModelResource(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 ReplicationExtensionModelResource GetReplicationExtensionModelResource(this ArmClient client, ResourceIdentifier id) + { + Argument.AssertNotNull(client, nameof(client)); + + return GetMockableRecoveryServicesDataReplicationArmClient(client).GetReplicationExtensionModelResource(id); + } + + /// + /// Gets a collection of VaultModelResources 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 VaultModelResources and their operations over a VaultModelResource. + public static VaultModelCollection GetVaultModels(this ResourceGroupResource resourceGroupResource) + { + Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource)); + + return GetMockableRecoveryServicesDataReplicationResourceGroupResource(resourceGroupResource).GetVaultModels(); + } + + /// + /// Gets the details of the vault. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName} + /// + /// + /// Operation Id + /// VaultModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The vault name. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public static async Task> GetVaultModelAsync(this ResourceGroupResource resourceGroupResource, string vaultName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource)); + + return await GetMockableRecoveryServicesDataReplicationResourceGroupResource(resourceGroupResource).GetVaultModelAsync(vaultName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets the details of the vault. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName} + /// + /// + /// Operation Id + /// VaultModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The vault name. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public static Response GetVaultModel(this ResourceGroupResource resourceGroupResource, string vaultName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource)); + + return GetMockableRecoveryServicesDataReplicationResourceGroupResource(resourceGroupResource).GetVaultModel(vaultName, cancellationToken); + } + + /// + /// Gets a collection of FabricModelResources 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 FabricModelResources and their operations over a FabricModelResource. + public static FabricModelCollection GetFabricModels(this ResourceGroupResource resourceGroupResource) + { + Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource)); + + return GetMockableRecoveryServicesDataReplicationResourceGroupResource(resourceGroupResource).GetFabricModels(); + } + + /// + /// Gets the details of the fabric. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationFabrics/{fabricName} + /// + /// + /// Operation Id + /// FabricModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The fabric name. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public static async Task> GetFabricModelAsync(this ResourceGroupResource resourceGroupResource, string fabricName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource)); + + return await GetMockableRecoveryServicesDataReplicationResourceGroupResource(resourceGroupResource).GetFabricModelAsync(fabricName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets the details of the fabric. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationFabrics/{fabricName} + /// + /// + /// Operation Id + /// FabricModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The fabric name. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public static Response GetFabricModel(this ResourceGroupResource resourceGroupResource, string fabricName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource)); + + return GetMockableRecoveryServicesDataReplicationResourceGroupResource(resourceGroupResource).GetFabricModel(fabricName, cancellationToken); + } + + /// + /// Performs resource deployment preflight validation. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/deployments/{deploymentId}/preflight + /// + /// + /// Operation Id + /// DeploymentPreflight_Post + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// Deployment Id. + /// Deployment preflight model. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. + public static async Task> PostDeploymentPreflightAsync(this ResourceGroupResource resourceGroupResource, string deploymentId, DeploymentPreflightModel body = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource)); + + return await GetMockableRecoveryServicesDataReplicationResourceGroupResource(resourceGroupResource).PostDeploymentPreflightAsync(deploymentId, body, cancellationToken).ConfigureAwait(false); + } + + /// + /// Performs resource deployment preflight validation. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/deployments/{deploymentId}/preflight + /// + /// + /// Operation Id + /// DeploymentPreflight_Post + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// Deployment Id. + /// Deployment preflight model. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. + public static Response PostDeploymentPreflight(this ResourceGroupResource resourceGroupResource, string deploymentId, DeploymentPreflightModel body = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource)); + + return GetMockableRecoveryServicesDataReplicationResourceGroupResource(resourceGroupResource).PostDeploymentPreflight(deploymentId, body, cancellationToken); + } + + /// + /// Gets the operations. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/operationResults/{operationId}/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/{operationId} + /// + /// + /// Operation Id + /// ArmResponse_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The ID of an ongoing async operation. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. + public static async Task> GetOperationResultAsync(this ResourceGroupResource resourceGroupResource, string operationId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource)); + + return await GetMockableRecoveryServicesDataReplicationResourceGroupResource(resourceGroupResource).GetOperationResultAsync(operationId, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets the operations. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/operationResults/{operationId}/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/{operationId} + /// + /// + /// Operation Id + /// ArmResponse_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The ID of an ongoing async operation. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. + public static Response GetOperationResult(this ResourceGroupResource resourceGroupResource, string operationId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource)); + + return GetMockableRecoveryServicesDataReplicationResourceGroupResource(resourceGroupResource).GetOperationResult(operationId, cancellationToken); + } + + /// + /// Gets the list of vaults in the given subscription. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.DataReplication/replicationVaults + /// + /// + /// Operation Id + /// VaultModel_ListBySubscription + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// 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 GetVaultModelsAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); + + return GetMockableRecoveryServicesDataReplicationSubscriptionResource(subscriptionResource).GetVaultModelsAsync(cancellationToken); + } + + /// + /// Gets the list of vaults in the given subscription. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.DataReplication/replicationVaults + /// + /// + /// Operation Id + /// VaultModel_ListBySubscription + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// 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 GetVaultModels(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); + + return GetMockableRecoveryServicesDataReplicationSubscriptionResource(subscriptionResource).GetVaultModels(cancellationToken); + } + + /// + /// Gets the list of fabrics in the given subscription. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.DataReplication/replicationFabrics + /// + /// + /// Operation Id + /// FabricModel_ListBySubscription + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// 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 GetFabricModelsAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); + + return GetMockableRecoveryServicesDataReplicationSubscriptionResource(subscriptionResource).GetFabricModelsAsync(cancellationToken); + } + + /// + /// Gets the list of fabrics in the given subscription. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.DataReplication/replicationFabrics + /// + /// + /// Operation Id + /// FabricModel_ListBySubscription + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// 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 GetFabricModels(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); + + return GetMockableRecoveryServicesDataReplicationSubscriptionResource(subscriptionResource).GetFabricModels(cancellationToken); + } + + /// + /// Checks the resource name availability. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.DataReplication/locations/{location}/checkNameAvailability + /// + /// + /// Operation Id + /// CheckNameAvailability_Post + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The name of the Azure region. + /// Resource details. + /// The cancellation token to use. + /// is null. + public static async Task> PostCheckNameAvailabilityAsync(this SubscriptionResource subscriptionResource, AzureLocation location, CheckNameAvailabilityModel body = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); + + return await GetMockableRecoveryServicesDataReplicationSubscriptionResource(subscriptionResource).PostCheckNameAvailabilityAsync(location, body, cancellationToken).ConfigureAwait(false); + } + + /// + /// Checks the resource name availability. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.DataReplication/locations/{location}/checkNameAvailability + /// + /// + /// Operation Id + /// CheckNameAvailability_Post + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The name of the Azure region. + /// Resource details. + /// The cancellation token to use. + /// is null. + public static Response PostCheckNameAvailability(this SubscriptionResource subscriptionResource, AzureLocation location, CheckNameAvailabilityModel body = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); + + return GetMockableRecoveryServicesDataReplicationSubscriptionResource(subscriptionResource).PostCheckNameAvailability(location, body, cancellationToken); + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/FabricAgentModelCollection.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/FabricAgentModelCollection.cs new file mode 100644 index 000000000000..419720b70669 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/FabricAgentModelCollection.cs @@ -0,0 +1,493 @@ +// 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.RecoveryServicesDataReplication +{ + /// + /// 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 GetFabricAgentModels method from an instance of . + /// + public partial class FabricAgentModelCollection : ArmCollection, IEnumerable, IAsyncEnumerable + { + private readonly ClientDiagnostics _fabricAgentModelFabricAgentClientDiagnostics; + private readonly FabricAgentRestOperations _fabricAgentModelFabricAgentRestClient; + + /// Initializes a new instance of the class for mocking. + protected FabricAgentModelCollection() + { + } + + /// 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 FabricAgentModelCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _fabricAgentModelFabricAgentClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.RecoveryServicesDataReplication", FabricAgentModelResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(FabricAgentModelResource.ResourceType, out string fabricAgentModelFabricAgentApiVersion); + _fabricAgentModelFabricAgentRestClient = new FabricAgentRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, fabricAgentModelFabricAgentApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != FabricModelResource.ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, FabricModelResource.ResourceType), nameof(id)); + } + + /// + /// Creates the fabric agent. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationFabrics/{fabricName}/fabricAgents/{fabricAgentName} + /// + /// + /// Operation Id + /// FabricAgentModel_Create + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// 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 fabric agent name. + /// Fabric agent model. + /// 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 fabricAgentName, FabricAgentModelData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(fabricAgentName, nameof(fabricAgentName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _fabricAgentModelFabricAgentClientDiagnostics.CreateScope("FabricAgentModelCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = await _fabricAgentModelFabricAgentRestClient.CreateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, fabricAgentName, data, cancellationToken).ConfigureAwait(false); + var operation = new RecoveryServicesDataReplicationArmOperation(new FabricAgentModelOperationSource(Client), _fabricAgentModelFabricAgentClientDiagnostics, Pipeline, _fabricAgentModelFabricAgentRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, fabricAgentName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Creates the fabric agent. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationFabrics/{fabricName}/fabricAgents/{fabricAgentName} + /// + /// + /// Operation Id + /// FabricAgentModel_Create + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// 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 fabric agent name. + /// Fabric agent model. + /// 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 fabricAgentName, FabricAgentModelData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(fabricAgentName, nameof(fabricAgentName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _fabricAgentModelFabricAgentClientDiagnostics.CreateScope("FabricAgentModelCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = _fabricAgentModelFabricAgentRestClient.Create(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, fabricAgentName, data, cancellationToken); + var operation = new RecoveryServicesDataReplicationArmOperation(new FabricAgentModelOperationSource(Client), _fabricAgentModelFabricAgentClientDiagnostics, Pipeline, _fabricAgentModelFabricAgentRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, fabricAgentName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets the details of the fabric agent. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationFabrics/{fabricName}/fabricAgents/{fabricAgentName} + /// + /// + /// Operation Id + /// FabricAgentModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The fabric agent name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetAsync(string fabricAgentName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(fabricAgentName, nameof(fabricAgentName)); + + using var scope = _fabricAgentModelFabricAgentClientDiagnostics.CreateScope("FabricAgentModelCollection.Get"); + scope.Start(); + try + { + var response = await _fabricAgentModelFabricAgentRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, fabricAgentName, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new FabricAgentModelResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets the details of the fabric agent. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationFabrics/{fabricName}/fabricAgents/{fabricAgentName} + /// + /// + /// Operation Id + /// FabricAgentModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The fabric agent name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Get(string fabricAgentName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(fabricAgentName, nameof(fabricAgentName)); + + using var scope = _fabricAgentModelFabricAgentClientDiagnostics.CreateScope("FabricAgentModelCollection.Get"); + scope.Start(); + try + { + var response = _fabricAgentModelFabricAgentRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, fabricAgentName, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new FabricAgentModelResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets the list of fabric agents in the given fabric. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationFabrics/{fabricName}/fabricAgents + /// + /// + /// Operation Id + /// FabricAgentModel_List + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// 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) => _fabricAgentModelFabricAgentRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _fabricAgentModelFabricAgentRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new FabricAgentModelResource(Client, FabricAgentModelData.DeserializeFabricAgentModelData(e)), _fabricAgentModelFabricAgentClientDiagnostics, Pipeline, "FabricAgentModelCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Gets the list of fabric agents in the given fabric. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationFabrics/{fabricName}/fabricAgents + /// + /// + /// Operation Id + /// FabricAgentModel_List + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// 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) => _fabricAgentModelFabricAgentRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _fabricAgentModelFabricAgentRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new FabricAgentModelResource(Client, FabricAgentModelData.DeserializeFabricAgentModelData(e)), _fabricAgentModelFabricAgentClientDiagnostics, Pipeline, "FabricAgentModelCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationFabrics/{fabricName}/fabricAgents/{fabricAgentName} + /// + /// + /// Operation Id + /// FabricAgentModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The fabric agent name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> ExistsAsync(string fabricAgentName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(fabricAgentName, nameof(fabricAgentName)); + + using var scope = _fabricAgentModelFabricAgentClientDiagnostics.CreateScope("FabricAgentModelCollection.Exists"); + scope.Start(); + try + { + var response = await _fabricAgentModelFabricAgentRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, fabricAgentName, 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.DataReplication/replicationFabrics/{fabricName}/fabricAgents/{fabricAgentName} + /// + /// + /// Operation Id + /// FabricAgentModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The fabric agent name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Exists(string fabricAgentName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(fabricAgentName, nameof(fabricAgentName)); + + using var scope = _fabricAgentModelFabricAgentClientDiagnostics.CreateScope("FabricAgentModelCollection.Exists"); + scope.Start(); + try + { + var response = _fabricAgentModelFabricAgentRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, fabricAgentName, 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.DataReplication/replicationFabrics/{fabricName}/fabricAgents/{fabricAgentName} + /// + /// + /// Operation Id + /// FabricAgentModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The fabric agent name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetIfExistsAsync(string fabricAgentName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(fabricAgentName, nameof(fabricAgentName)); + + using var scope = _fabricAgentModelFabricAgentClientDiagnostics.CreateScope("FabricAgentModelCollection.GetIfExists"); + scope.Start(); + try + { + var response = await _fabricAgentModelFabricAgentRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, fabricAgentName, cancellationToken: cancellationToken).ConfigureAwait(false); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new FabricAgentModelResource(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.DataReplication/replicationFabrics/{fabricName}/fabricAgents/{fabricAgentName} + /// + /// + /// Operation Id + /// FabricAgentModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The fabric agent name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual NullableResponse GetIfExists(string fabricAgentName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(fabricAgentName, nameof(fabricAgentName)); + + using var scope = _fabricAgentModelFabricAgentClientDiagnostics.CreateScope("FabricAgentModelCollection.GetIfExists"); + scope.Start(); + try + { + var response = _fabricAgentModelFabricAgentRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, fabricAgentName, cancellationToken: cancellationToken); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new FabricAgentModelResource(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/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/FabricAgentModelData.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/FabricAgentModelData.Serialization.cs new file mode 100644 index 000000000000..6414e69027ec --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/FabricAgentModelData.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.Models; +using Azure.ResourceManager.RecoveryServicesDataReplication.Models; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication +{ + public partial class FabricAgentModelData : 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(FabricAgentModelData)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (Optional.IsDefined(Properties)) + { + writer.WritePropertyName("properties"u8); + writer.WriteObjectValue(Properties, options); + } + } + + FabricAgentModelData 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(FabricAgentModelData)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeFabricAgentModelData(document.RootElement, options); + } + + internal static FabricAgentModelData DeserializeFabricAgentModelData(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + FabricAgentModelProperties 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 = FabricAgentModelProperties.DeserializeFabricAgentModelProperties(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 FabricAgentModelData( + 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(FabricAgentModelData)} does not support writing '{options.Format}' format."); + } + } + + FabricAgentModelData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeFabricAgentModelData(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(FabricAgentModelData)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/FabricAgentModelData.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/FabricAgentModelData.cs new file mode 100644 index 000000000000..0ee206409d5f --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/FabricAgentModelData.cs @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; +using Azure.ResourceManager.Models; +using Azure.ResourceManager.RecoveryServicesDataReplication.Models; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication +{ + /// + /// A class representing the FabricAgentModel data model. + /// Fabric agent model. + /// + public partial class FabricAgentModelData : 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 FabricAgentModelData() + { + } + + /// 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 FabricAgentModelData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, FabricAgentModelProperties properties, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) + { + Properties = properties; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The resource-specific properties for this resource. + public FabricAgentModelProperties Properties { get; set; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/FabricAgentModelResource.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/FabricAgentModelResource.Serialization.cs new file mode 100644 index 000000000000..57277d9293ad --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/FabricAgentModelResource.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.RecoveryServicesDataReplication +{ + public partial class FabricAgentModelResource : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); + + FabricAgentModelData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options); + + FabricAgentModelData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options); + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/FabricAgentModelResource.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/FabricAgentModelResource.cs new file mode 100644 index 000000000000..3236fb599d1e --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/FabricAgentModelResource.cs @@ -0,0 +1,347 @@ +// 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.RecoveryServicesDataReplication +{ + /// + /// A Class representing a FabricAgentModel 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 GetFabricAgentModelResource method. + /// Otherwise you can get one from its parent resource using the GetFabricAgentModel method. + /// + public partial class FabricAgentModelResource : ArmResource + { + /// Generate the resource identifier of a instance. + /// The subscriptionId. + /// The resourceGroupName. + /// The fabricName. + /// The fabricAgentName. + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string fabricName, string fabricAgentName) + { + var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationFabrics/{fabricName}/fabricAgents/{fabricAgentName}"; + return new ResourceIdentifier(resourceId); + } + + private readonly ClientDiagnostics _fabricAgentModelFabricAgentClientDiagnostics; + private readonly FabricAgentRestOperations _fabricAgentModelFabricAgentRestClient; + private readonly FabricAgentModelData _data; + + /// Gets the resource type for the operations. + public static readonly ResourceType ResourceType = "Microsoft.DataReplication/replicationFabrics/fabricAgents"; + + /// Initializes a new instance of the class for mocking. + protected FabricAgentModelResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal FabricAgentModelResource(ArmClient client, FabricAgentModelData 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 FabricAgentModelResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _fabricAgentModelFabricAgentClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.RecoveryServicesDataReplication", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string fabricAgentModelFabricAgentApiVersion); + _fabricAgentModelFabricAgentRestClient = new FabricAgentRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, fabricAgentModelFabricAgentApiVersion); +#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 FabricAgentModelData 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)); + } + + /// + /// Gets the details of the fabric agent. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationFabrics/{fabricName}/fabricAgents/{fabricAgentName} + /// + /// + /// Operation Id + /// FabricAgentModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _fabricAgentModelFabricAgentClientDiagnostics.CreateScope("FabricAgentModelResource.Get"); + scope.Start(); + try + { + var response = await _fabricAgentModelFabricAgentRestClient.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 FabricAgentModelResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets the details of the fabric agent. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationFabrics/{fabricName}/fabricAgents/{fabricAgentName} + /// + /// + /// Operation Id + /// FabricAgentModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _fabricAgentModelFabricAgentClientDiagnostics.CreateScope("FabricAgentModelResource.Get"); + scope.Start(); + try + { + var response = _fabricAgentModelFabricAgentRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new FabricAgentModelResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Deletes fabric agent. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationFabrics/{fabricName}/fabricAgents/{fabricAgentName} + /// + /// + /// Operation Id + /// FabricAgentModel_Delete + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// 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 = _fabricAgentModelFabricAgentClientDiagnostics.CreateScope("FabricAgentModelResource.Delete"); + scope.Start(); + try + { + var response = await _fabricAgentModelFabricAgentRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + var operation = new RecoveryServicesDataReplicationArmOperation(_fabricAgentModelFabricAgentClientDiagnostics, Pipeline, _fabricAgentModelFabricAgentRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Deletes fabric agent. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationFabrics/{fabricName}/fabricAgents/{fabricAgentName} + /// + /// + /// Operation Id + /// FabricAgentModel_Delete + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// 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 = _fabricAgentModelFabricAgentClientDiagnostics.CreateScope("FabricAgentModelResource.Delete"); + scope.Start(); + try + { + var response = _fabricAgentModelFabricAgentRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + var operation = new RecoveryServicesDataReplicationArmOperation(_fabricAgentModelFabricAgentClientDiagnostics, Pipeline, _fabricAgentModelFabricAgentRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletionResponse(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Creates the fabric agent. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationFabrics/{fabricName}/fabricAgents/{fabricAgentName} + /// + /// + /// Operation Id + /// FabricAgentModel_Create + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// 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. + /// Fabric agent model. + /// The cancellation token to use. + /// is null. + public virtual async Task> UpdateAsync(WaitUntil waitUntil, FabricAgentModelData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _fabricAgentModelFabricAgentClientDiagnostics.CreateScope("FabricAgentModelResource.Update"); + scope.Start(); + try + { + var response = await _fabricAgentModelFabricAgentRestClient.CreateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, cancellationToken).ConfigureAwait(false); + var operation = new RecoveryServicesDataReplicationArmOperation(new FabricAgentModelOperationSource(Client), _fabricAgentModelFabricAgentClientDiagnostics, Pipeline, _fabricAgentModelFabricAgentRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Creates the fabric agent. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationFabrics/{fabricName}/fabricAgents/{fabricAgentName} + /// + /// + /// Operation Id + /// FabricAgentModel_Create + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// 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. + /// Fabric agent model. + /// The cancellation token to use. + /// is null. + public virtual ArmOperation Update(WaitUntil waitUntil, FabricAgentModelData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _fabricAgentModelFabricAgentClientDiagnostics.CreateScope("FabricAgentModelResource.Update"); + scope.Start(); + try + { + var response = _fabricAgentModelFabricAgentRestClient.Create(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, cancellationToken); + var operation = new RecoveryServicesDataReplicationArmOperation(new FabricAgentModelOperationSource(Client), _fabricAgentModelFabricAgentClientDiagnostics, Pipeline, _fabricAgentModelFabricAgentRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/FabricModelCollection.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/FabricModelCollection.cs new file mode 100644 index 000000000000..dd605aeb6a7e --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/FabricModelCollection.cs @@ -0,0 +1,496 @@ +// 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.RecoveryServicesDataReplication +{ + /// + /// 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 GetFabricModels method from an instance of . + /// + public partial class FabricModelCollection : ArmCollection, IEnumerable, IAsyncEnumerable + { + private readonly ClientDiagnostics _fabricModelFabricClientDiagnostics; + private readonly FabricRestOperations _fabricModelFabricRestClient; + + /// Initializes a new instance of the class for mocking. + protected FabricModelCollection() + { + } + + /// 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 FabricModelCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _fabricModelFabricClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.RecoveryServicesDataReplication", FabricModelResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(FabricModelResource.ResourceType, out string fabricModelFabricApiVersion); + _fabricModelFabricRestClient = new FabricRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, fabricModelFabricApiVersion); +#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)); + } + + /// + /// Creates the fabric. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationFabrics/{fabricName} + /// + /// + /// Operation Id + /// FabricModel_Create + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// 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 fabric name. + /// Fabric properties. + /// 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 fabricName, FabricModelData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(fabricName, nameof(fabricName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _fabricModelFabricClientDiagnostics.CreateScope("FabricModelCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = await _fabricModelFabricRestClient.CreateAsync(Id.SubscriptionId, Id.ResourceGroupName, fabricName, data, cancellationToken).ConfigureAwait(false); + var operation = new RecoveryServicesDataReplicationArmOperation(new FabricModelOperationSource(Client), _fabricModelFabricClientDiagnostics, Pipeline, _fabricModelFabricRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, fabricName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Creates the fabric. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationFabrics/{fabricName} + /// + /// + /// Operation Id + /// FabricModel_Create + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// 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 fabric name. + /// Fabric properties. + /// 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 fabricName, FabricModelData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(fabricName, nameof(fabricName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _fabricModelFabricClientDiagnostics.CreateScope("FabricModelCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = _fabricModelFabricRestClient.Create(Id.SubscriptionId, Id.ResourceGroupName, fabricName, data, cancellationToken); + var operation = new RecoveryServicesDataReplicationArmOperation(new FabricModelOperationSource(Client), _fabricModelFabricClientDiagnostics, Pipeline, _fabricModelFabricRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, fabricName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets the details of the fabric. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationFabrics/{fabricName} + /// + /// + /// Operation Id + /// FabricModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The fabric name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetAsync(string fabricName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(fabricName, nameof(fabricName)); + + using var scope = _fabricModelFabricClientDiagnostics.CreateScope("FabricModelCollection.Get"); + scope.Start(); + try + { + var response = await _fabricModelFabricRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, fabricName, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new FabricModelResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets the details of the fabric. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationFabrics/{fabricName} + /// + /// + /// Operation Id + /// FabricModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The fabric name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Get(string fabricName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(fabricName, nameof(fabricName)); + + using var scope = _fabricModelFabricClientDiagnostics.CreateScope("FabricModelCollection.Get"); + scope.Start(); + try + { + var response = _fabricModelFabricRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, fabricName, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new FabricModelResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets the list of fabrics in the given subscription and resource group. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationFabrics + /// + /// + /// Operation Id + /// FabricModel_List + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Continuation token from the previous call. + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetAllAsync(string continuationToken = null, CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _fabricModelFabricRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, continuationToken); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _fabricModelFabricRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, continuationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new FabricModelResource(Client, FabricModelData.DeserializeFabricModelData(e)), _fabricModelFabricClientDiagnostics, Pipeline, "FabricModelCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Gets the list of fabrics in the given subscription and resource group. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationFabrics + /// + /// + /// Operation Id + /// FabricModel_List + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Continuation token from the previous call. + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetAll(string continuationToken = null, CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _fabricModelFabricRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, continuationToken); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _fabricModelFabricRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, continuationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new FabricModelResource(Client, FabricModelData.DeserializeFabricModelData(e)), _fabricModelFabricClientDiagnostics, Pipeline, "FabricModelCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationFabrics/{fabricName} + /// + /// + /// Operation Id + /// FabricModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The fabric name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> ExistsAsync(string fabricName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(fabricName, nameof(fabricName)); + + using var scope = _fabricModelFabricClientDiagnostics.CreateScope("FabricModelCollection.Exists"); + scope.Start(); + try + { + var response = await _fabricModelFabricRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, fabricName, 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.DataReplication/replicationFabrics/{fabricName} + /// + /// + /// Operation Id + /// FabricModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The fabric name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Exists(string fabricName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(fabricName, nameof(fabricName)); + + using var scope = _fabricModelFabricClientDiagnostics.CreateScope("FabricModelCollection.Exists"); + scope.Start(); + try + { + var response = _fabricModelFabricRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, fabricName, 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.DataReplication/replicationFabrics/{fabricName} + /// + /// + /// Operation Id + /// FabricModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The fabric name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetIfExistsAsync(string fabricName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(fabricName, nameof(fabricName)); + + using var scope = _fabricModelFabricClientDiagnostics.CreateScope("FabricModelCollection.GetIfExists"); + scope.Start(); + try + { + var response = await _fabricModelFabricRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, fabricName, cancellationToken: cancellationToken).ConfigureAwait(false); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new FabricModelResource(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.DataReplication/replicationFabrics/{fabricName} + /// + /// + /// Operation Id + /// FabricModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The fabric name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual NullableResponse GetIfExists(string fabricName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(fabricName, nameof(fabricName)); + + using var scope = _fabricModelFabricClientDiagnostics.CreateScope("FabricModelCollection.GetIfExists"); + scope.Start(); + try + { + var response = _fabricModelFabricRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, fabricName, cancellationToken: cancellationToken); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new FabricModelResource(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/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/FabricModelData.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/FabricModelData.Serialization.cs new file mode 100644 index 000000000000..fca97891b554 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/FabricModelData.Serialization.cs @@ -0,0 +1,178 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.Models; +using Azure.ResourceManager.RecoveryServicesDataReplication.Models; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication +{ + public partial class FabricModelData : 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(FabricModelData)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (Optional.IsDefined(Properties)) + { + writer.WritePropertyName("properties"u8); + writer.WriteObjectValue(Properties, options); + } + } + + FabricModelData 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(FabricModelData)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeFabricModelData(document.RootElement, options); + } + + internal static FabricModelData DeserializeFabricModelData(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + FabricModelProperties properties = 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 = FabricModelProperties.DeserializeFabricModelProperties(property.Value, options); + 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 FabricModelData( + id, + name, + type, + systemData, + tags ?? new ChangeTrackingDictionary(), + location, + 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(FabricModelData)} does not support writing '{options.Format}' format."); + } + } + + FabricModelData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeFabricModelData(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(FabricModelData)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/FabricModelData.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/FabricModelData.cs new file mode 100644 index 000000000000..9c98ce21c0c2 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/FabricModelData.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.Models; +using Azure.ResourceManager.RecoveryServicesDataReplication.Models; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication +{ + /// + /// A class representing the FabricModel data model. + /// Fabric model. + /// + public partial class FabricModelData : 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 FabricModelData(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. + /// Keeps track of any properties unknown to the library. + internal FabricModelData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, FabricModelProperties properties, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) + { + Properties = properties; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal FabricModelData() + { + } + + /// The resource-specific properties for this resource. + public FabricModelProperties Properties { get; set; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/FabricModelResource.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/FabricModelResource.Serialization.cs new file mode 100644 index 000000000000..88c27cd52743 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/FabricModelResource.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.RecoveryServicesDataReplication +{ + public partial class FabricModelResource : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); + + FabricModelData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options); + + FabricModelData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options); + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/FabricModelResource.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/FabricModelResource.cs new file mode 100644 index 000000000000..63189546b349 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/FabricModelResource.cs @@ -0,0 +1,776 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.RecoveryServicesDataReplication.Models; +using Azure.ResourceManager.Resources; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication +{ + /// + /// A Class representing a FabricModel 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 GetFabricModelResource method. + /// Otherwise you can get one from its parent resource using the GetFabricModel method. + /// + public partial class FabricModelResource : ArmResource + { + /// Generate the resource identifier of a instance. + /// The subscriptionId. + /// The resourceGroupName. + /// The fabricName. + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string fabricName) + { + var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationFabrics/{fabricName}"; + return new ResourceIdentifier(resourceId); + } + + private readonly ClientDiagnostics _fabricModelFabricClientDiagnostics; + private readonly FabricRestOperations _fabricModelFabricRestClient; + private readonly FabricModelData _data; + + /// Gets the resource type for the operations. + public static readonly ResourceType ResourceType = "Microsoft.DataReplication/replicationFabrics"; + + /// Initializes a new instance of the class for mocking. + protected FabricModelResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal FabricModelResource(ArmClient client, FabricModelData 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 FabricModelResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _fabricModelFabricClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.RecoveryServicesDataReplication", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string fabricModelFabricApiVersion); + _fabricModelFabricRestClient = new FabricRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, fabricModelFabricApiVersion); +#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 FabricModelData 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)); + } + + /// Gets a collection of FabricAgentModelResources in the FabricModel. + /// An object representing collection of FabricAgentModelResources and their operations over a FabricAgentModelResource. + public virtual FabricAgentModelCollection GetFabricAgentModels() + { + return GetCachedClient(client => new FabricAgentModelCollection(client, Id)); + } + + /// + /// Gets the details of the fabric agent. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationFabrics/{fabricName}/fabricAgents/{fabricAgentName} + /// + /// + /// Operation Id + /// FabricAgentModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The fabric agent name. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetFabricAgentModelAsync(string fabricAgentName, CancellationToken cancellationToken = default) + { + return await GetFabricAgentModels().GetAsync(fabricAgentName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets the details of the fabric agent. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationFabrics/{fabricName}/fabricAgents/{fabricAgentName} + /// + /// + /// Operation Id + /// FabricAgentModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The fabric agent name. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetFabricAgentModel(string fabricAgentName, CancellationToken cancellationToken = default) + { + return GetFabricAgentModels().Get(fabricAgentName, cancellationToken); + } + + /// + /// Gets the details of the fabric. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationFabrics/{fabricName} + /// + /// + /// Operation Id + /// FabricModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _fabricModelFabricClientDiagnostics.CreateScope("FabricModelResource.Get"); + scope.Start(); + try + { + var response = await _fabricModelFabricRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new FabricModelResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets the details of the fabric. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationFabrics/{fabricName} + /// + /// + /// Operation Id + /// FabricModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _fabricModelFabricClientDiagnostics.CreateScope("FabricModelResource.Get"); + scope.Start(); + try + { + var response = _fabricModelFabricRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new FabricModelResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Removes the fabric. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationFabrics/{fabricName} + /// + /// + /// Operation Id + /// FabricModel_Delete + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// 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 = _fabricModelFabricClientDiagnostics.CreateScope("FabricModelResource.Delete"); + scope.Start(); + try + { + var response = await _fabricModelFabricRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + var operation = new RecoveryServicesDataReplicationArmOperation(_fabricModelFabricClientDiagnostics, Pipeline, _fabricModelFabricRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Removes the fabric. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationFabrics/{fabricName} + /// + /// + /// Operation Id + /// FabricModel_Delete + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// 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 = _fabricModelFabricClientDiagnostics.CreateScope("FabricModelResource.Delete"); + scope.Start(); + try + { + var response = _fabricModelFabricRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + var operation = new RecoveryServicesDataReplicationArmOperation(_fabricModelFabricClientDiagnostics, Pipeline, _fabricModelFabricRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletionResponse(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Performs update on the fabric. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationFabrics/{fabricName} + /// + /// + /// Operation Id + /// FabricModel_Update + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// 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. + /// Fabric properties. + /// The cancellation token to use. + /// is null. + public virtual async Task> UpdateAsync(WaitUntil waitUntil, FabricModelPatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(patch, nameof(patch)); + + using var scope = _fabricModelFabricClientDiagnostics.CreateScope("FabricModelResource.Update"); + scope.Start(); + try + { + var response = await _fabricModelFabricRestClient.UpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch, cancellationToken).ConfigureAwait(false); + var operation = new RecoveryServicesDataReplicationArmOperation(new FabricModelOperationSource(Client), _fabricModelFabricClientDiagnostics, Pipeline, _fabricModelFabricRestClient.CreateUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Performs update on the fabric. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationFabrics/{fabricName} + /// + /// + /// Operation Id + /// FabricModel_Update + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// 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. + /// Fabric properties. + /// The cancellation token to use. + /// is null. + public virtual ArmOperation Update(WaitUntil waitUntil, FabricModelPatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(patch, nameof(patch)); + + using var scope = _fabricModelFabricClientDiagnostics.CreateScope("FabricModelResource.Update"); + scope.Start(); + try + { + var response = _fabricModelFabricRestClient.Update(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch, cancellationToken); + var operation = new RecoveryServicesDataReplicationArmOperation(new FabricModelOperationSource(Client), _fabricModelFabricClientDiagnostics, Pipeline, _fabricModelFabricRestClient.CreateUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Add a tag to the current resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationFabrics/{fabricName} + /// + /// + /// Operation Id + /// FabricModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The key for the tag. + /// The value for the tag. + /// The cancellation token to use. + /// or is null. + public virtual async Task> AddTagAsync(string key, string value, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(key, nameof(key)); + Argument.AssertNotNull(value, nameof(value)); + + using var scope = _fabricModelFabricClientDiagnostics.CreateScope("FabricModelResource.AddTag"); + scope.Start(); + try + { + if (await CanUseTagResourceAsync(cancellationToken: cancellationToken).ConfigureAwait(false)) + { + var originalTags = await GetTagResource().GetAsync(cancellationToken).ConfigureAwait(false); + originalTags.Value.Data.TagValues[key] = value; + await GetTagResource().CreateOrUpdateAsync(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken).ConfigureAwait(false); + var originalResponse = await _fabricModelFabricRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new FabricModelResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; + var patch = new FabricModelPatch(); + foreach (var tag in current.Tags) + { + patch.Tags.Add(tag); + } + patch.Tags[key] = value; + var result = await UpdateAsync(WaitUntil.Completed, patch, cancellationToken: cancellationToken).ConfigureAwait(false); + return Response.FromValue(result.Value, result.GetRawResponse()); + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Add a tag to the current resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationFabrics/{fabricName} + /// + /// + /// Operation Id + /// FabricModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The key for the tag. + /// The value for the tag. + /// The cancellation token to use. + /// or is null. + public virtual Response AddTag(string key, string value, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(key, nameof(key)); + Argument.AssertNotNull(value, nameof(value)); + + using var scope = _fabricModelFabricClientDiagnostics.CreateScope("FabricModelResource.AddTag"); + scope.Start(); + try + { + if (CanUseTagResource(cancellationToken: cancellationToken)) + { + var originalTags = GetTagResource().Get(cancellationToken); + originalTags.Value.Data.TagValues[key] = value; + GetTagResource().CreateOrUpdate(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken); + var originalResponse = _fabricModelFabricRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + return Response.FromValue(new FabricModelResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = Get(cancellationToken: cancellationToken).Value.Data; + var patch = new FabricModelPatch(); + foreach (var tag in current.Tags) + { + patch.Tags.Add(tag); + } + patch.Tags[key] = value; + var result = Update(WaitUntil.Completed, patch, cancellationToken: cancellationToken); + return Response.FromValue(result.Value, result.GetRawResponse()); + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Replace the tags on the resource with the given set. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationFabrics/{fabricName} + /// + /// + /// Operation Id + /// FabricModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The set of tags to use as replacement. + /// The cancellation token to use. + /// is null. + public virtual async Task> SetTagsAsync(IDictionary tags, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(tags, nameof(tags)); + + using var scope = _fabricModelFabricClientDiagnostics.CreateScope("FabricModelResource.SetTags"); + scope.Start(); + try + { + if (await CanUseTagResourceAsync(cancellationToken: cancellationToken).ConfigureAwait(false)) + { + await GetTagResource().DeleteAsync(WaitUntil.Completed, cancellationToken: cancellationToken).ConfigureAwait(false); + var originalTags = await GetTagResource().GetAsync(cancellationToken).ConfigureAwait(false); + originalTags.Value.Data.TagValues.ReplaceWith(tags); + await GetTagResource().CreateOrUpdateAsync(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken).ConfigureAwait(false); + var originalResponse = await _fabricModelFabricRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new FabricModelResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; + var patch = new FabricModelPatch(); + patch.Tags.ReplaceWith(tags); + var result = await UpdateAsync(WaitUntil.Completed, patch, cancellationToken: cancellationToken).ConfigureAwait(false); + return Response.FromValue(result.Value, result.GetRawResponse()); + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Replace the tags on the resource with the given set. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationFabrics/{fabricName} + /// + /// + /// Operation Id + /// FabricModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The set of tags to use as replacement. + /// The cancellation token to use. + /// is null. + public virtual Response SetTags(IDictionary tags, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(tags, nameof(tags)); + + using var scope = _fabricModelFabricClientDiagnostics.CreateScope("FabricModelResource.SetTags"); + scope.Start(); + try + { + if (CanUseTagResource(cancellationToken: cancellationToken)) + { + GetTagResource().Delete(WaitUntil.Completed, cancellationToken: cancellationToken); + var originalTags = GetTagResource().Get(cancellationToken); + originalTags.Value.Data.TagValues.ReplaceWith(tags); + GetTagResource().CreateOrUpdate(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken); + var originalResponse = _fabricModelFabricRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + return Response.FromValue(new FabricModelResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = Get(cancellationToken: cancellationToken).Value.Data; + var patch = new FabricModelPatch(); + patch.Tags.ReplaceWith(tags); + var result = Update(WaitUntil.Completed, patch, cancellationToken: cancellationToken); + return Response.FromValue(result.Value, result.GetRawResponse()); + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Removes a tag by key from the resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationFabrics/{fabricName} + /// + /// + /// Operation Id + /// FabricModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The key for the tag. + /// The cancellation token to use. + /// is null. + public virtual async Task> RemoveTagAsync(string key, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(key, nameof(key)); + + using var scope = _fabricModelFabricClientDiagnostics.CreateScope("FabricModelResource.RemoveTag"); + scope.Start(); + try + { + if (await CanUseTagResourceAsync(cancellationToken: cancellationToken).ConfigureAwait(false)) + { + var originalTags = await GetTagResource().GetAsync(cancellationToken).ConfigureAwait(false); + originalTags.Value.Data.TagValues.Remove(key); + await GetTagResource().CreateOrUpdateAsync(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken).ConfigureAwait(false); + var originalResponse = await _fabricModelFabricRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new FabricModelResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; + var patch = new FabricModelPatch(); + foreach (var tag in current.Tags) + { + patch.Tags.Add(tag); + } + patch.Tags.Remove(key); + var result = await UpdateAsync(WaitUntil.Completed, patch, cancellationToken: cancellationToken).ConfigureAwait(false); + return Response.FromValue(result.Value, result.GetRawResponse()); + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Removes a tag by key from the resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationFabrics/{fabricName} + /// + /// + /// Operation Id + /// FabricModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The key for the tag. + /// The cancellation token to use. + /// is null. + public virtual Response RemoveTag(string key, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(key, nameof(key)); + + using var scope = _fabricModelFabricClientDiagnostics.CreateScope("FabricModelResource.RemoveTag"); + scope.Start(); + try + { + if (CanUseTagResource(cancellationToken: cancellationToken)) + { + var originalTags = GetTagResource().Get(cancellationToken); + originalTags.Value.Data.TagValues.Remove(key); + GetTagResource().CreateOrUpdate(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken); + var originalResponse = _fabricModelFabricRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + return Response.FromValue(new FabricModelResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = Get(cancellationToken: cancellationToken).Value.Data; + var patch = new FabricModelPatch(); + foreach (var tag in current.Tags) + { + patch.Tags.Add(tag); + } + patch.Tags.Remove(key); + var result = Update(WaitUntil.Completed, patch, cancellationToken: cancellationToken); + return Response.FromValue(result.Value, result.GetRawResponse()); + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Internal/Argument.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Internal/Argument.cs new file mode 100644 index 000000000000..9c62a091425c --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Internal/Argument.cs @@ -0,0 +1,129 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections; +using System.Collections.Generic; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication +{ + internal static class Argument + { + public static void AssertNotNull(T value, string name) + { + if (value is null) + { + throw new ArgumentNullException(name); + } + } + + public static void AssertNotNull(T? value, string name) + where T : struct + { + if (!value.HasValue) + { + throw new ArgumentNullException(name); + } + } + + public static void AssertNotNullOrEmpty(IEnumerable value, string name) + { + if (value is null) + { + throw new ArgumentNullException(name); + } + if (value is ICollection collectionOfT && collectionOfT.Count == 0) + { + throw new ArgumentException("Value cannot be an empty collection.", name); + } + if (value is ICollection collection && collection.Count == 0) + { + throw new ArgumentException("Value cannot be an empty collection.", name); + } + using IEnumerator e = value.GetEnumerator(); + if (!e.MoveNext()) + { + throw new ArgumentException("Value cannot be an empty collection.", name); + } + } + + public static void AssertNotNullOrEmpty(string value, string name) + { + if (value is null) + { + throw new ArgumentNullException(name); + } + if (value.Length == 0) + { + throw new ArgumentException("Value cannot be an empty string.", name); + } + } + + public static void AssertNotNullOrWhiteSpace(string value, string name) + { + if (value is null) + { + throw new ArgumentNullException(name); + } + if (string.IsNullOrWhiteSpace(value)) + { + throw new ArgumentException("Value cannot be empty or contain only white-space characters.", name); + } + } + + public static void AssertNotDefault(ref T value, string name) + where T : struct, IEquatable + { + if (value.Equals(default)) + { + throw new ArgumentException("Value cannot be empty.", name); + } + } + + public static void AssertInRange(T value, T minimum, T maximum, string name) + where T : notnull, IComparable + { + if (minimum.CompareTo(value) > 0) + { + throw new ArgumentOutOfRangeException(name, "Value is less than the minimum allowed."); + } + if (maximum.CompareTo(value) < 0) + { + throw new ArgumentOutOfRangeException(name, "Value is greater than the maximum allowed."); + } + } + + public static void AssertEnumDefined(Type enumType, object value, string name) + { + if (!Enum.IsDefined(enumType, value)) + { + throw new ArgumentException($"Value not defined for {enumType.FullName}.", name); + } + } + + public static T CheckNotNull(T value, string name) + where T : class + { + AssertNotNull(value, name); + return value; + } + + public static string CheckNotNullOrEmpty(string value, string name) + { + AssertNotNullOrEmpty(value, name); + return value; + } + + public static void AssertNull(T value, string name, string message = null) + { + if (value != null) + { + throw new ArgumentException(message ?? "Value must be null.", name); + } + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Internal/ChangeTrackingDictionary.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Internal/ChangeTrackingDictionary.cs new file mode 100644 index 000000000000..c13f7c82b016 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Internal/ChangeTrackingDictionary.cs @@ -0,0 +1,167 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections; +using System.Collections.Generic; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication +{ + internal class ChangeTrackingDictionary : IDictionary, IReadOnlyDictionary where TKey : notnull + { + private IDictionary _innerDictionary; + + public ChangeTrackingDictionary() + { + } + + public ChangeTrackingDictionary(IDictionary dictionary) + { + if (dictionary == null) + { + return; + } + _innerDictionary = new Dictionary(dictionary); + } + + public ChangeTrackingDictionary(IReadOnlyDictionary dictionary) + { + if (dictionary == null) + { + return; + } + _innerDictionary = new Dictionary(); + foreach (var pair in dictionary) + { + _innerDictionary.Add(pair); + } + } + + public bool IsUndefined => _innerDictionary == null; + + public int Count => IsUndefined ? 0 : EnsureDictionary().Count; + + public bool IsReadOnly => IsUndefined ? false : EnsureDictionary().IsReadOnly; + + public ICollection Keys => IsUndefined ? Array.Empty() : EnsureDictionary().Keys; + + public ICollection Values => IsUndefined ? Array.Empty() : EnsureDictionary().Values; + + public TValue this[TKey key] + { + get + { + if (IsUndefined) + { + throw new KeyNotFoundException(nameof(key)); + } + return EnsureDictionary()[key]; + } + set + { + EnsureDictionary()[key] = value; + } + } + + IEnumerable IReadOnlyDictionary.Keys => Keys; + + IEnumerable IReadOnlyDictionary.Values => Values; + + public IEnumerator> GetEnumerator() + { + if (IsUndefined) + { + IEnumerator> enumerateEmpty() + { + yield break; + } + return enumerateEmpty(); + } + return EnsureDictionary().GetEnumerator(); + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetEnumerator(); + } + + public void Add(KeyValuePair item) + { + EnsureDictionary().Add(item); + } + + public void Clear() + { + EnsureDictionary().Clear(); + } + + public bool Contains(KeyValuePair item) + { + if (IsUndefined) + { + return false; + } + return EnsureDictionary().Contains(item); + } + + public void CopyTo(KeyValuePair[] array, int index) + { + if (IsUndefined) + { + return; + } + EnsureDictionary().CopyTo(array, index); + } + + public bool Remove(KeyValuePair item) + { + if (IsUndefined) + { + return false; + } + return EnsureDictionary().Remove(item); + } + + public void Add(TKey key, TValue value) + { + EnsureDictionary().Add(key, value); + } + + public bool ContainsKey(TKey key) + { + if (IsUndefined) + { + return false; + } + return EnsureDictionary().ContainsKey(key); + } + + public bool Remove(TKey key) + { + if (IsUndefined) + { + return false; + } + return EnsureDictionary().Remove(key); + } + + public bool TryGetValue(TKey key, out TValue value) + { + if (IsUndefined) + { + value = default; + return false; + } + return EnsureDictionary().TryGetValue(key, out value); + } + + public IDictionary EnsureDictionary() + { + return _innerDictionary ??= new Dictionary(); + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Internal/ChangeTrackingList.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Internal/ChangeTrackingList.cs new file mode 100644 index 000000000000..e0c7e0652299 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Internal/ChangeTrackingList.cs @@ -0,0 +1,153 @@ +// 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.Linq; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication +{ + internal class ChangeTrackingList : IList, IReadOnlyList + { + private IList _innerList; + + public ChangeTrackingList() + { + } + + public ChangeTrackingList(IList innerList) + { + if (innerList != null) + { + _innerList = innerList; + } + } + + public ChangeTrackingList(IReadOnlyList innerList) + { + if (innerList != null) + { + _innerList = innerList.ToList(); + } + } + + public bool IsUndefined => _innerList == null; + + public int Count => IsUndefined ? 0 : EnsureList().Count; + + public bool IsReadOnly => IsUndefined ? false : EnsureList().IsReadOnly; + + public T this[int index] + { + get + { + if (IsUndefined) + { + throw new ArgumentOutOfRangeException(nameof(index)); + } + return EnsureList()[index]; + } + set + { + if (IsUndefined) + { + throw new ArgumentOutOfRangeException(nameof(index)); + } + EnsureList()[index] = value; + } + } + + public void Reset() + { + _innerList = null; + } + + public IEnumerator GetEnumerator() + { + if (IsUndefined) + { + IEnumerator enumerateEmpty() + { + yield break; + } + return enumerateEmpty(); + } + return EnsureList().GetEnumerator(); + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetEnumerator(); + } + + public void Add(T item) + { + EnsureList().Add(item); + } + + public void Clear() + { + EnsureList().Clear(); + } + + public bool Contains(T item) + { + if (IsUndefined) + { + return false; + } + return EnsureList().Contains(item); + } + + public void CopyTo(T[] array, int arrayIndex) + { + if (IsUndefined) + { + return; + } + EnsureList().CopyTo(array, arrayIndex); + } + + public bool Remove(T item) + { + if (IsUndefined) + { + return false; + } + return EnsureList().Remove(item); + } + + public int IndexOf(T item) + { + if (IsUndefined) + { + return -1; + } + return EnsureList().IndexOf(item); + } + + public void Insert(int index, T item) + { + EnsureList().Insert(index, item); + } + + public void RemoveAt(int index) + { + if (IsUndefined) + { + throw new ArgumentOutOfRangeException(nameof(index)); + } + EnsureList().RemoveAt(index); + } + + public IList EnsureList() + { + return _innerList ??= new List(); + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Internal/ModelSerializationExtensions.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Internal/ModelSerializationExtensions.cs new file mode 100644 index 000000000000..0228b044553f --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Internal/ModelSerializationExtensions.cs @@ -0,0 +1,398 @@ +// 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.Diagnostics; +using System.Globalization; +using System.Text.Json; +using System.Xml; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication +{ + internal static class ModelSerializationExtensions + { + internal static readonly ModelReaderWriterOptions WireOptions = new ModelReaderWriterOptions("W"); + + public static object GetObject(this JsonElement element) + { + switch (element.ValueKind) + { + case JsonValueKind.String: + return element.GetString(); + case JsonValueKind.Number: + if (element.TryGetInt32(out int intValue)) + { + return intValue; + } + if (element.TryGetInt64(out long longValue)) + { + return longValue; + } + return element.GetDouble(); + case JsonValueKind.True: + return true; + case JsonValueKind.False: + return false; + case JsonValueKind.Undefined: + case JsonValueKind.Null: + return null; + case JsonValueKind.Object: + var dictionary = new Dictionary(); + foreach (var jsonProperty in element.EnumerateObject()) + { + dictionary.Add(jsonProperty.Name, jsonProperty.Value.GetObject()); + } + return dictionary; + case JsonValueKind.Array: + var list = new List(); + foreach (var item in element.EnumerateArray()) + { + list.Add(item.GetObject()); + } + return list.ToArray(); + default: + throw new NotSupportedException($"Not supported value kind {element.ValueKind}"); + } + } + + public static byte[] GetBytesFromBase64(this JsonElement element, string format) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + + return format switch + { + "U" => TypeFormatters.FromBase64UrlString(element.GetRequiredString()), + "D" => element.GetBytesFromBase64(), + _ => throw new ArgumentException($"Format is not supported: '{format}'", nameof(format)) + }; + } + + public static DateTimeOffset GetDateTimeOffset(this JsonElement element, string format) => format switch + { + "U" when element.ValueKind == JsonValueKind.Number => DateTimeOffset.FromUnixTimeSeconds(element.GetInt64()), + _ => TypeFormatters.ParseDateTimeOffset(element.GetString(), format) + }; + + public static TimeSpan GetTimeSpan(this JsonElement element, string format) => TypeFormatters.ParseTimeSpan(element.GetString(), format); + + public static char GetChar(this JsonElement element) + { + if (element.ValueKind == JsonValueKind.String) + { + var text = element.GetString(); + if (text == null || text.Length != 1) + { + throw new NotSupportedException($"Cannot convert \"{text}\" to a char"); + } + return text[0]; + } + else + { + throw new NotSupportedException($"Cannot convert {element.ValueKind} to a char"); + } + } + + [Conditional("DEBUG")] + public static void ThrowNonNullablePropertyIsNull(this JsonProperty property) + { + throw new JsonException($"A property '{property.Name}' defined as non-nullable but received as null from the service. This exception only happens in DEBUG builds of the library and would be ignored in the release build"); + } + + public static string GetRequiredString(this JsonElement element) + { + var value = element.GetString(); + if (value == null) + { + throw new InvalidOperationException($"The requested operation requires an element of type 'String', but the target element has type '{element.ValueKind}'."); + } + return value; + } + + public static void WriteStringValue(this Utf8JsonWriter writer, DateTimeOffset value, string format) + { + writer.WriteStringValue(TypeFormatters.ToString(value, format)); + } + + public static void WriteStringValue(this Utf8JsonWriter writer, DateTime value, string format) + { + writer.WriteStringValue(TypeFormatters.ToString(value, format)); + } + + public static void WriteStringValue(this Utf8JsonWriter writer, TimeSpan value, string format) + { + writer.WriteStringValue(TypeFormatters.ToString(value, format)); + } + + public static void WriteStringValue(this Utf8JsonWriter writer, char value) + { + writer.WriteStringValue(value.ToString(CultureInfo.InvariantCulture)); + } + + public static void WriteBase64StringValue(this Utf8JsonWriter writer, byte[] value, string format) + { + if (value == null) + { + writer.WriteNullValue(); + return; + } + switch (format) + { + case "U": + writer.WriteStringValue(TypeFormatters.ToBase64UrlString(value)); + break; + case "D": + writer.WriteBase64StringValue(value); + break; + default: + throw new ArgumentException($"Format is not supported: '{format}'", nameof(format)); + } + } + + public static void WriteNumberValue(this Utf8JsonWriter writer, DateTimeOffset value, string format) + { + if (format != "U") + { + throw new ArgumentOutOfRangeException(nameof(format), "Only 'U' format is supported when writing a DateTimeOffset as a Number."); + } + writer.WriteNumberValue(value.ToUnixTimeSeconds()); + } + + public static void WriteObjectValue(this Utf8JsonWriter writer, T value, ModelReaderWriterOptions options = null) + { + switch (value) + { + case null: + writer.WriteNullValue(); + break; + case IJsonModel jsonModel: + jsonModel.Write(writer, options ?? WireOptions); + break; + case IUtf8JsonSerializable serializable: + serializable.Write(writer); + break; + case byte[] bytes: + writer.WriteBase64StringValue(bytes); + break; + case BinaryData bytes0: + writer.WriteBase64StringValue(bytes0); + break; + case JsonElement json: + json.WriteTo(writer); + break; + case int i: + writer.WriteNumberValue(i); + break; + case decimal d: + writer.WriteNumberValue(d); + break; + case double d0: + if (double.IsNaN(d0)) + { + writer.WriteStringValue("NaN"); + } + else + { + writer.WriteNumberValue(d0); + } + break; + case float f: + writer.WriteNumberValue(f); + break; + case long l: + writer.WriteNumberValue(l); + break; + case string s: + writer.WriteStringValue(s); + break; + case bool b: + writer.WriteBooleanValue(b); + break; + case Guid g: + writer.WriteStringValue(g); + break; + case DateTimeOffset dateTimeOffset: + writer.WriteStringValue(dateTimeOffset, "O"); + break; + case DateTime dateTime: + writer.WriteStringValue(dateTime, "O"); + break; + case IEnumerable> enumerable: + writer.WriteStartObject(); + foreach (var pair in enumerable) + { + writer.WritePropertyName(pair.Key); + writer.WriteObjectValue(pair.Value, options); + } + writer.WriteEndObject(); + break; + case IEnumerable objectEnumerable: + writer.WriteStartArray(); + foreach (var item in objectEnumerable) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + break; + case TimeSpan timeSpan: + writer.WriteStringValue(timeSpan, "P"); + break; + default: + throw new NotSupportedException($"Not supported type {value.GetType()}"); + } + } + + public static void WriteObjectValue(this Utf8JsonWriter writer, object value, ModelReaderWriterOptions options = null) + { + writer.WriteObjectValue(value, options); + } + + internal static class TypeFormatters + { + private const string RoundtripZFormat = "yyyy-MM-ddTHH:mm:ss.fffffffZ"; + public const string DefaultNumberFormat = "G"; + + public static string ToString(bool value) => value ? "true" : "false"; + + public static string ToString(DateTime value, string format) => value.Kind switch + { + DateTimeKind.Utc => ToString((DateTimeOffset)value, format), + _ => throw new NotSupportedException($"DateTime {value} has a Kind of {value.Kind}. Azure SDK requires it to be UTC. You can call DateTime.SpecifyKind to change Kind property value to DateTimeKind.Utc.") + }; + + public static string ToString(DateTimeOffset value, string format) => format switch + { + "D" => value.ToString("yyyy-MM-dd", CultureInfo.InvariantCulture), + "U" => value.ToUnixTimeSeconds().ToString(CultureInfo.InvariantCulture), + "O" => value.ToUniversalTime().ToString(RoundtripZFormat, CultureInfo.InvariantCulture), + "o" => value.ToUniversalTime().ToString(RoundtripZFormat, CultureInfo.InvariantCulture), + "R" => value.ToString("r", CultureInfo.InvariantCulture), + _ => value.ToString(format, CultureInfo.InvariantCulture) + }; + + public static string ToString(TimeSpan value, string format) => format switch + { + "P" => XmlConvert.ToString(value), + _ => value.ToString(format, CultureInfo.InvariantCulture) + }; + + public static string ToString(byte[] value, string format) => format switch + { + "U" => ToBase64UrlString(value), + "D" => Convert.ToBase64String(value), + _ => throw new ArgumentException($"Format is not supported: '{format}'", nameof(format)) + }; + + public static string ToBase64UrlString(byte[] value) + { + int numWholeOrPartialInputBlocks = checked(value.Length + 2) / 3; + int size = checked(numWholeOrPartialInputBlocks * 4); + char[] output = new char[size]; + + int numBase64Chars = Convert.ToBase64CharArray(value, 0, value.Length, output, 0); + + int i = 0; + for (; i < numBase64Chars; i++) + { + char ch = output[i]; + if (ch == '+') + { + output[i] = '-'; + } + else + { + if (ch == '/') + { + output[i] = '_'; + } + else + { + if (ch == '=') + { + break; + } + } + } + } + + return new string(output, 0, i); + } + + public static byte[] FromBase64UrlString(string value) + { + int paddingCharsToAdd = (value.Length % 4) switch + { + 0 => 0, + 2 => 2, + 3 => 1, + _ => throw new InvalidOperationException("Malformed input") + }; + char[] output = new char[(value.Length + paddingCharsToAdd)]; + int i = 0; + for (; i < value.Length; i++) + { + char ch = value[i]; + if (ch == '-') + { + output[i] = '+'; + } + else + { + if (ch == '_') + { + output[i] = '/'; + } + else + { + output[i] = ch; + } + } + } + + for (; i < output.Length; i++) + { + output[i] = '='; + } + + return Convert.FromBase64CharArray(output, 0, output.Length); + } + + public static DateTimeOffset ParseDateTimeOffset(string value, string format) => format switch + { + "U" => DateTimeOffset.FromUnixTimeSeconds(long.Parse(value, CultureInfo.InvariantCulture)), + _ => DateTimeOffset.Parse(value, CultureInfo.InvariantCulture, DateTimeStyles.AssumeUniversal) + }; + + public static TimeSpan ParseTimeSpan(string value, string format) => format switch + { + "P" => XmlConvert.ToTimeSpan(value), + _ => TimeSpan.ParseExact(value, format, CultureInfo.InvariantCulture) + }; + + public static string ConvertToString(object value, string format = null) => value switch + { + null => "null", + string s => s, + bool b => ToString(b), + int or float or double or long or decimal => ((IFormattable)value).ToString(DefaultNumberFormat, CultureInfo.InvariantCulture), + byte[] b0 when format != null => ToString(b0, format), + IEnumerable s0 => string.Join(",", s0), + DateTimeOffset dateTime when format != null => ToString(dateTime, format), + TimeSpan timeSpan when format != null => ToString(timeSpan, format), + TimeSpan timeSpan0 => XmlConvert.ToString(timeSpan0), + Guid guid => guid.ToString(), + BinaryData binaryData => ConvertToString(binaryData.ToArray(), format), + _ => value.ToString() + }; + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Internal/Optional.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Internal/Optional.cs new file mode 100644 index 000000000000..9843364940f5 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Internal/Optional.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication +{ + internal static class Optional + { + public static bool IsCollectionDefined(IEnumerable collection) + { + return !(collection is ChangeTrackingList changeTrackingList && changeTrackingList.IsUndefined); + } + + public static bool IsCollectionDefined(IDictionary collection) + { + return !(collection is ChangeTrackingDictionary changeTrackingDictionary && changeTrackingDictionary.IsUndefined); + } + + public static bool IsCollectionDefined(IReadOnlyDictionary collection) + { + return !(collection is ChangeTrackingDictionary changeTrackingDictionary && changeTrackingDictionary.IsUndefined); + } + + public static bool IsDefined(T? value) + where T : struct + { + return value.HasValue; + } + + public static bool IsDefined(object value) + { + return value != null; + } + + public static bool IsDefined(JsonElement value) + { + return value.ValueKind != JsonValueKind.Undefined; + } + + public static bool IsDefined(string value) + { + return value != null; + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Internal/Utf8JsonRequestContent.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Internal/Utf8JsonRequestContent.cs new file mode 100644 index 000000000000..97644ff6907d --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Internal/Utf8JsonRequestContent.cs @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.IO; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication +{ + internal class Utf8JsonRequestContent : RequestContent + { + private readonly MemoryStream _stream; + private readonly RequestContent _content; + + public Utf8JsonRequestContent() + { + _stream = new MemoryStream(); + _content = Create(_stream); + JsonWriter = new Utf8JsonWriter(_stream); + } + + public Utf8JsonWriter JsonWriter { get; } + + public override async Task WriteToAsync(Stream stream, CancellationToken cancellationToken = default) + { + await JsonWriter.FlushAsync().ConfigureAwait(false); + await _content.WriteToAsync(stream, cancellationToken).ConfigureAwait(false); + } + + public override void WriteTo(Stream stream, CancellationToken cancellationToken = default) + { + JsonWriter.Flush(); + _content.WriteTo(stream, cancellationToken); + } + + public override bool TryComputeLength(out long length) + { + length = JsonWriter.BytesCommitted + JsonWriter.BytesPending; + return true; + } + + public override void Dispose() + { + JsonWriter.Dispose(); + _content.Dispose(); + _stream.Dispose(); + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/JobModelCollection.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/JobModelCollection.cs new file mode 100644 index 000000000000..3e1eaa4ab2d8 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/JobModelCollection.cs @@ -0,0 +1,401 @@ +// 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.RecoveryServicesDataReplication +{ + /// + /// 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 GetJobModels method from an instance of . + /// + public partial class JobModelCollection : ArmCollection, IEnumerable, IAsyncEnumerable + { + private readonly ClientDiagnostics _jobModelJobClientDiagnostics; + private readonly JobRestOperations _jobModelJobRestClient; + + /// Initializes a new instance of the class for mocking. + protected JobModelCollection() + { + } + + /// 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 JobModelCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _jobModelJobClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.RecoveryServicesDataReplication", JobModelResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(JobModelResource.ResourceType, out string jobModelJobApiVersion); + _jobModelJobRestClient = new JobRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, jobModelJobApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != VaultModelResource.ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, VaultModelResource.ResourceType), nameof(id)); + } + + /// + /// Gets the details of the job. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/jobs/{jobName} + /// + /// + /// Operation Id + /// JobModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The job name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetAsync(string jobName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(jobName, nameof(jobName)); + + using var scope = _jobModelJobClientDiagnostics.CreateScope("JobModelCollection.Get"); + scope.Start(); + try + { + var response = await _jobModelJobRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, jobName, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new JobModelResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets the details of the job. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/jobs/{jobName} + /// + /// + /// Operation Id + /// JobModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The job name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Get(string jobName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(jobName, nameof(jobName)); + + using var scope = _jobModelJobClientDiagnostics.CreateScope("JobModelCollection.Get"); + scope.Start(); + try + { + var response = _jobModelJobRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, jobName, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new JobModelResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets the list of jobs in the given vault. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/jobs + /// + /// + /// Operation Id + /// JobModel_List + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// OData options. + /// Continuation token. + /// Page size. + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetAllAsync(string odataOptions = null, string continuationToken = null, int? pageSize = null, CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _jobModelJobRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, odataOptions, continuationToken, pageSizeHint); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _jobModelJobRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name, odataOptions, continuationToken, pageSizeHint); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new JobModelResource(Client, JobModelData.DeserializeJobModelData(e)), _jobModelJobClientDiagnostics, Pipeline, "JobModelCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Gets the list of jobs in the given vault. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/jobs + /// + /// + /// Operation Id + /// JobModel_List + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// OData options. + /// Continuation token. + /// Page size. + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetAll(string odataOptions = null, string continuationToken = null, int? pageSize = null, CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _jobModelJobRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, odataOptions, continuationToken, pageSizeHint); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _jobModelJobRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name, odataOptions, continuationToken, pageSizeHint); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new JobModelResource(Client, JobModelData.DeserializeJobModelData(e)), _jobModelJobClientDiagnostics, Pipeline, "JobModelCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/jobs/{jobName} + /// + /// + /// Operation Id + /// JobModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The job name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> ExistsAsync(string jobName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(jobName, nameof(jobName)); + + using var scope = _jobModelJobClientDiagnostics.CreateScope("JobModelCollection.Exists"); + scope.Start(); + try + { + var response = await _jobModelJobRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, jobName, 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.DataReplication/replicationVaults/{vaultName}/jobs/{jobName} + /// + /// + /// Operation Id + /// JobModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The job name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Exists(string jobName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(jobName, nameof(jobName)); + + using var scope = _jobModelJobClientDiagnostics.CreateScope("JobModelCollection.Exists"); + scope.Start(); + try + { + var response = _jobModelJobRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, jobName, 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.DataReplication/replicationVaults/{vaultName}/jobs/{jobName} + /// + /// + /// Operation Id + /// JobModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The job name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetIfExistsAsync(string jobName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(jobName, nameof(jobName)); + + using var scope = _jobModelJobClientDiagnostics.CreateScope("JobModelCollection.GetIfExists"); + scope.Start(); + try + { + var response = await _jobModelJobRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, jobName, cancellationToken: cancellationToken).ConfigureAwait(false); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new JobModelResource(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.DataReplication/replicationVaults/{vaultName}/jobs/{jobName} + /// + /// + /// Operation Id + /// JobModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The job name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual NullableResponse GetIfExists(string jobName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(jobName, nameof(jobName)); + + using var scope = _jobModelJobClientDiagnostics.CreateScope("JobModelCollection.GetIfExists"); + scope.Start(); + try + { + var response = _jobModelJobRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, jobName, cancellationToken: cancellationToken); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new JobModelResource(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/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/JobModelData.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/JobModelData.Serialization.cs new file mode 100644 index 000000000000..065eaa91a275 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/JobModelData.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.Models; +using Azure.ResourceManager.RecoveryServicesDataReplication.Models; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication +{ + public partial class JobModelData : 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(JobModelData)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (Optional.IsDefined(Properties)) + { + writer.WritePropertyName("properties"u8); + writer.WriteObjectValue(Properties, options); + } + } + + JobModelData 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(JobModelData)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeJobModelData(document.RootElement, options); + } + + internal static JobModelData DeserializeJobModelData(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + JobModelProperties 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 = JobModelProperties.DeserializeJobModelProperties(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 JobModelData( + 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(JobModelData)} does not support writing '{options.Format}' format."); + } + } + + JobModelData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeJobModelData(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(JobModelData)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/JobModelData.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/JobModelData.cs new file mode 100644 index 000000000000..dedcc770ceb4 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/JobModelData.cs @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; +using Azure.ResourceManager.Models; +using Azure.ResourceManager.RecoveryServicesDataReplication.Models; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication +{ + /// + /// A class representing the JobModel data model. + /// Job model. + /// + public partial class JobModelData : 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 . + internal JobModelData() + { + } + + /// 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 JobModelData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, JobModelProperties properties, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) + { + Properties = properties; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The resource-specific properties for this resource. + public JobModelProperties Properties { get; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/JobModelResource.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/JobModelResource.Serialization.cs new file mode 100644 index 000000000000..353c47d9814b --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/JobModelResource.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.RecoveryServicesDataReplication +{ + public partial class JobModelResource : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); + + JobModelData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options); + + JobModelData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options); + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/JobModelResource.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/JobModelResource.cs new file mode 100644 index 000000000000..55beb439dc5c --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/JobModelResource.cs @@ -0,0 +1,171 @@ +// 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.RecoveryServicesDataReplication +{ + /// + /// A Class representing a JobModel 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 GetJobModelResource method. + /// Otherwise you can get one from its parent resource using the GetJobModel method. + /// + public partial class JobModelResource : ArmResource + { + /// Generate the resource identifier of a instance. + /// The subscriptionId. + /// The resourceGroupName. + /// The vaultName. + /// The jobName. + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string vaultName, string jobName) + { + var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/jobs/{jobName}"; + return new ResourceIdentifier(resourceId); + } + + private readonly ClientDiagnostics _jobModelJobClientDiagnostics; + private readonly JobRestOperations _jobModelJobRestClient; + private readonly JobModelData _data; + + /// Gets the resource type for the operations. + public static readonly ResourceType ResourceType = "Microsoft.DataReplication/replicationVaults/jobs"; + + /// Initializes a new instance of the class for mocking. + protected JobModelResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal JobModelResource(ArmClient client, JobModelData 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 JobModelResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _jobModelJobClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.RecoveryServicesDataReplication", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string jobModelJobApiVersion); + _jobModelJobRestClient = new JobRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, jobModelJobApiVersion); +#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 JobModelData 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)); + } + + /// + /// Gets the details of the job. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/jobs/{jobName} + /// + /// + /// Operation Id + /// JobModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _jobModelJobClientDiagnostics.CreateScope("JobModelResource.Get"); + scope.Start(); + try + { + var response = await _jobModelJobRestClient.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 JobModelResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets the details of the job. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/jobs/{jobName} + /// + /// + /// Operation Id + /// JobModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _jobModelJobClientDiagnostics.CreateScope("JobModelResource.Get"); + scope.Start(); + try + { + var response = _jobModelJobRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new JobModelResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/LongRunningOperation/FabricAgentModelOperationSource.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/LongRunningOperation/FabricAgentModelOperationSource.cs new file mode 100644 index 000000000000..f91276fd68bf --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/LongRunningOperation/FabricAgentModelOperationSource.cs @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication +{ + internal class FabricAgentModelOperationSource : IOperationSource + { + private readonly ArmClient _client; + + internal FabricAgentModelOperationSource(ArmClient client) + { + _client = client; + } + + FabricAgentModelResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) + { + using var document = JsonDocument.Parse(response.ContentStream); + var data = FabricAgentModelData.DeserializeFabricAgentModelData(document.RootElement); + return new FabricAgentModelResource(_client, data); + } + + async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) + { + using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false); + var data = FabricAgentModelData.DeserializeFabricAgentModelData(document.RootElement); + return new FabricAgentModelResource(_client, data); + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/LongRunningOperation/FabricModelOperationSource.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/LongRunningOperation/FabricModelOperationSource.cs new file mode 100644 index 000000000000..53cb624846b2 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/LongRunningOperation/FabricModelOperationSource.cs @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication +{ + internal class FabricModelOperationSource : IOperationSource + { + private readonly ArmClient _client; + + internal FabricModelOperationSource(ArmClient client) + { + _client = client; + } + + FabricModelResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) + { + using var document = JsonDocument.Parse(response.ContentStream); + var data = FabricModelData.DeserializeFabricModelData(document.RootElement); + return new FabricModelResource(_client, data); + } + + async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) + { + using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false); + var data = FabricModelData.DeserializeFabricModelData(document.RootElement); + return new FabricModelResource(_client, data); + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/LongRunningOperation/PlannedFailoverModelOperationSource.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/LongRunningOperation/PlannedFailoverModelOperationSource.cs new file mode 100644 index 000000000000..d2a8162b71e3 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/LongRunningOperation/PlannedFailoverModelOperationSource.cs @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.ResourceManager.RecoveryServicesDataReplication.Models; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication +{ + internal class PlannedFailoverModelOperationSource : IOperationSource + { + PlannedFailoverModel IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) + { + using var document = JsonDocument.Parse(response.ContentStream); + return PlannedFailoverModel.DeserializePlannedFailoverModel(document.RootElement); + } + + async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) + { + using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false); + return PlannedFailoverModel.DeserializePlannedFailoverModel(document.RootElement); + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/LongRunningOperation/PolicyModelOperationSource.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/LongRunningOperation/PolicyModelOperationSource.cs new file mode 100644 index 000000000000..f41268bf2bc9 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/LongRunningOperation/PolicyModelOperationSource.cs @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication +{ + internal class PolicyModelOperationSource : IOperationSource + { + private readonly ArmClient _client; + + internal PolicyModelOperationSource(ArmClient client) + { + _client = client; + } + + PolicyModelResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) + { + using var document = JsonDocument.Parse(response.ContentStream); + var data = PolicyModelData.DeserializePolicyModelData(document.RootElement); + return new PolicyModelResource(_client, data); + } + + async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) + { + using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false); + var data = PolicyModelData.DeserializePolicyModelData(document.RootElement); + return new PolicyModelResource(_client, data); + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/LongRunningOperation/ProtectedItemModelOperationSource.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/LongRunningOperation/ProtectedItemModelOperationSource.cs new file mode 100644 index 000000000000..98542175ac55 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/LongRunningOperation/ProtectedItemModelOperationSource.cs @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication +{ + internal class ProtectedItemModelOperationSource : IOperationSource + { + private readonly ArmClient _client; + + internal ProtectedItemModelOperationSource(ArmClient client) + { + _client = client; + } + + ProtectedItemModelResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) + { + using var document = JsonDocument.Parse(response.ContentStream); + var data = ProtectedItemModelData.DeserializeProtectedItemModelData(document.RootElement); + return new ProtectedItemModelResource(_client, data); + } + + async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) + { + using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false); + var data = ProtectedItemModelData.DeserializeProtectedItemModelData(document.RootElement); + return new ProtectedItemModelResource(_client, data); + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/LongRunningOperation/RecoveryServicesDataReplicationArmOperation.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/LongRunningOperation/RecoveryServicesDataReplicationArmOperation.cs new file mode 100644 index 000000000000..eb2854f60f25 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/LongRunningOperation/RecoveryServicesDataReplicationArmOperation.cs @@ -0,0 +1,94 @@ +// 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.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication +{ +#pragma warning disable SA1649 // File name should match first type name + internal class RecoveryServicesDataReplicationArmOperation : ArmOperation +#pragma warning restore SA1649 // File name should match first type name + { + private readonly OperationInternal _operation; + private readonly RehydrationToken? _completeRehydrationToken; + private readonly NextLinkOperationImplementation _nextLinkOperation; + private readonly string _operationId; + + /// Initializes a new instance of RecoveryServicesDataReplicationArmOperation for mocking. + protected RecoveryServicesDataReplicationArmOperation() + { + } + + internal RecoveryServicesDataReplicationArmOperation(Response response, RehydrationToken? rehydrationToken = null) + { + _operation = OperationInternal.Succeeded(response); + _completeRehydrationToken = rehydrationToken; + _operationId = GetOperationId(rehydrationToken); + } + + internal RecoveryServicesDataReplicationArmOperation(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, Request request, Response response, OperationFinalStateVia finalStateVia, bool skipApiVersionOverride = false, string apiVersionOverrideValue = null) + { + var nextLinkOperation = NextLinkOperationImplementation.Create(pipeline, request.Method, request.Uri.ToUri(), response, finalStateVia, skipApiVersionOverride, apiVersionOverrideValue); + if (nextLinkOperation is NextLinkOperationImplementation nextLinkOperationValue) + { + _nextLinkOperation = nextLinkOperationValue; + _operationId = _nextLinkOperation.OperationId; + } + else + { + _completeRehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(request.Method, request.Uri.ToUri(), response, finalStateVia); + _operationId = GetOperationId(_completeRehydrationToken); + } + _operation = new OperationInternal(nextLinkOperation, clientDiagnostics, response, "RecoveryServicesDataReplicationArmOperation", fallbackStrategy: new SequentialDelayStrategy()); + } + + private string GetOperationId(RehydrationToken? rehydrationToken) + { + if (rehydrationToken is null) + { + return null; + } + var lroDetails = ModelReaderWriter.Write(rehydrationToken, ModelReaderWriterOptions.Json).ToObjectFromJson>(); + return lroDetails["id"]; + } + /// + public override string Id => _operationId ?? NextLinkOperationImplementation.NotSet; + + /// + public override RehydrationToken? GetRehydrationToken() => _nextLinkOperation?.GetRehydrationToken() ?? _completeRehydrationToken; + + /// + public override bool HasCompleted => _operation.HasCompleted; + + /// + public override Response GetRawResponse() => _operation.RawResponse; + + /// + public override Response UpdateStatus(CancellationToken cancellationToken = default) => _operation.UpdateStatus(cancellationToken); + + /// + public override ValueTask UpdateStatusAsync(CancellationToken cancellationToken = default) => _operation.UpdateStatusAsync(cancellationToken); + + /// + public override Response WaitForCompletionResponse(CancellationToken cancellationToken = default) => _operation.WaitForCompletionResponse(cancellationToken); + + /// + public override Response WaitForCompletionResponse(TimeSpan pollingInterval, CancellationToken cancellationToken = default) => _operation.WaitForCompletionResponse(pollingInterval, cancellationToken); + + /// + public override ValueTask WaitForCompletionResponseAsync(CancellationToken cancellationToken = default) => _operation.WaitForCompletionResponseAsync(cancellationToken); + + /// + public override ValueTask WaitForCompletionResponseAsync(TimeSpan pollingInterval, CancellationToken cancellationToken = default) => _operation.WaitForCompletionResponseAsync(pollingInterval, cancellationToken); + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/LongRunningOperation/RecoveryServicesDataReplicationArmOperationOfT.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/LongRunningOperation/RecoveryServicesDataReplicationArmOperationOfT.cs new file mode 100644 index 000000000000..55ab427e9eb1 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/LongRunningOperation/RecoveryServicesDataReplicationArmOperationOfT.cs @@ -0,0 +1,100 @@ +// 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.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication +{ +#pragma warning disable SA1649 // File name should match first type name + internal class RecoveryServicesDataReplicationArmOperation : ArmOperation +#pragma warning restore SA1649 // File name should match first type name + { + private readonly OperationInternal _operation; + private readonly RehydrationToken? _completeRehydrationToken; + private readonly NextLinkOperationImplementation _nextLinkOperation; + private readonly string _operationId; + + /// Initializes a new instance of RecoveryServicesDataReplicationArmOperation for mocking. + protected RecoveryServicesDataReplicationArmOperation() + { + } + + internal RecoveryServicesDataReplicationArmOperation(Response response, RehydrationToken? rehydrationToken = null) + { + _operation = OperationInternal.Succeeded(response.GetRawResponse(), response.Value); + _completeRehydrationToken = rehydrationToken; + _operationId = GetOperationId(rehydrationToken); + } + + internal RecoveryServicesDataReplicationArmOperation(IOperationSource source, ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, Request request, Response response, OperationFinalStateVia finalStateVia, bool skipApiVersionOverride = false, string apiVersionOverrideValue = null) + { + var nextLinkOperation = NextLinkOperationImplementation.Create(pipeline, request.Method, request.Uri.ToUri(), response, finalStateVia, skipApiVersionOverride, apiVersionOverrideValue); + if (nextLinkOperation is NextLinkOperationImplementation nextLinkOperationValue) + { + _nextLinkOperation = nextLinkOperationValue; + _operationId = _nextLinkOperation.OperationId; + } + else + { + _completeRehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(request.Method, request.Uri.ToUri(), response, finalStateVia); + _operationId = GetOperationId(_completeRehydrationToken); + } + _operation = new OperationInternal(NextLinkOperationImplementation.Create(source, nextLinkOperation), clientDiagnostics, response, "RecoveryServicesDataReplicationArmOperation", fallbackStrategy: new SequentialDelayStrategy()); + } + + private string GetOperationId(RehydrationToken? rehydrationToken) + { + if (rehydrationToken is null) + { + return null; + } + var lroDetails = ModelReaderWriter.Write(rehydrationToken, ModelReaderWriterOptions.Json).ToObjectFromJson>(); + return lroDetails["id"]; + } + /// + public override string Id => _operationId ?? NextLinkOperationImplementation.NotSet; + + /// + public override RehydrationToken? GetRehydrationToken() => _nextLinkOperation?.GetRehydrationToken() ?? _completeRehydrationToken; + + /// + public override T Value => _operation.Value; + + /// + public override bool HasValue => _operation.HasValue; + + /// + public override bool HasCompleted => _operation.HasCompleted; + + /// + public override Response GetRawResponse() => _operation.RawResponse; + + /// + public override Response UpdateStatus(CancellationToken cancellationToken = default) => _operation.UpdateStatus(cancellationToken); + + /// + public override ValueTask UpdateStatusAsync(CancellationToken cancellationToken = default) => _operation.UpdateStatusAsync(cancellationToken); + + /// + public override Response WaitForCompletion(CancellationToken cancellationToken = default) => _operation.WaitForCompletion(cancellationToken); + + /// + public override Response WaitForCompletion(TimeSpan pollingInterval, CancellationToken cancellationToken = default) => _operation.WaitForCompletion(pollingInterval, cancellationToken); + + /// + public override ValueTask> WaitForCompletionAsync(CancellationToken cancellationToken = default) => _operation.WaitForCompletionAsync(cancellationToken); + + /// + public override ValueTask> WaitForCompletionAsync(TimeSpan pollingInterval, CancellationToken cancellationToken = default) => _operation.WaitForCompletionAsync(pollingInterval, cancellationToken); + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/LongRunningOperation/ReplicationExtensionModelOperationSource.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/LongRunningOperation/ReplicationExtensionModelOperationSource.cs new file mode 100644 index 000000000000..816b2fd1ca65 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/LongRunningOperation/ReplicationExtensionModelOperationSource.cs @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication +{ + internal class ReplicationExtensionModelOperationSource : IOperationSource + { + private readonly ArmClient _client; + + internal ReplicationExtensionModelOperationSource(ArmClient client) + { + _client = client; + } + + ReplicationExtensionModelResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) + { + using var document = JsonDocument.Parse(response.ContentStream); + var data = ReplicationExtensionModelData.DeserializeReplicationExtensionModelData(document.RootElement); + return new ReplicationExtensionModelResource(_client, data); + } + + async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) + { + using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false); + var data = ReplicationExtensionModelData.DeserializeReplicationExtensionModelData(document.RootElement); + return new ReplicationExtensionModelResource(_client, data); + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/LongRunningOperation/VaultModelOperationSource.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/LongRunningOperation/VaultModelOperationSource.cs new file mode 100644 index 000000000000..504d686ad5c2 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/LongRunningOperation/VaultModelOperationSource.cs @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication +{ + internal class VaultModelOperationSource : IOperationSource + { + private readonly ArmClient _client; + + internal VaultModelOperationSource(ArmClient client) + { + _client = client; + } + + VaultModelResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) + { + using var document = JsonDocument.Parse(response.ContentStream); + var data = VaultModelData.DeserializeVaultModelData(document.RootElement); + return new VaultModelResource(_client, data); + } + + async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) + { + using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false); + var data = VaultModelData.DeserializeVaultModelData(document.RootElement); + return new VaultModelResource(_client, data); + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/AzStackHCIClusterProperties.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/AzStackHCIClusterProperties.Serialization.cs new file mode 100644 index 000000000000..d07adfdb7121 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/AzStackHCIClusterProperties.Serialization.cs @@ -0,0 +1,160 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + public partial class AzStackHCIClusterProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AzStackHCIClusterProperties)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("clusterName"u8); + writer.WriteStringValue(ClusterName); + writer.WritePropertyName("resourceName"u8); + writer.WriteStringValue(ResourceName); + writer.WritePropertyName("storageAccountName"u8); + writer.WriteStringValue(StorageAccountName); + writer.WritePropertyName("storageContainers"u8); + writer.WriteStartArray(); + foreach (var item in StorageContainers) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + AzStackHCIClusterProperties 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(AzStackHCIClusterProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAzStackHCIClusterProperties(document.RootElement, options); + } + + internal static AzStackHCIClusterProperties DeserializeAzStackHCIClusterProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string clusterName = default; + string resourceName = default; + string storageAccountName = default; + IList storageContainers = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("clusterName"u8)) + { + clusterName = property.Value.GetString(); + continue; + } + if (property.NameEquals("resourceName"u8)) + { + resourceName = property.Value.GetString(); + continue; + } + if (property.NameEquals("storageAccountName"u8)) + { + storageAccountName = property.Value.GetString(); + continue; + } + if (property.NameEquals("storageContainers"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(StorageContainerProperties.DeserializeStorageContainerProperties(item, options)); + } + storageContainers = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new AzStackHCIClusterProperties(clusterName, resourceName, storageAccountName, storageContainers, 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(AzStackHCIClusterProperties)} does not support writing '{options.Format}' format."); + } + } + + AzStackHCIClusterProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeAzStackHCIClusterProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(AzStackHCIClusterProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/AzStackHCIClusterProperties.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/AzStackHCIClusterProperties.cs new file mode 100644 index 000000000000..341955371625 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/AzStackHCIClusterProperties.cs @@ -0,0 +1,97 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + /// AzStackHCI cluster properties. + public partial class AzStackHCIClusterProperties + { + /// + /// 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 . + /// Gets or sets the AzStackHCICluster FQDN name. + /// Gets or sets the AzStackHCICluster resource name. + /// Gets or sets the Storage account name. + /// Gets or sets the list of AzStackHCICluster Storage Container. + /// , , or is null. + public AzStackHCIClusterProperties(string clusterName, string resourceName, string storageAccountName, IEnumerable storageContainers) + { + Argument.AssertNotNull(clusterName, nameof(clusterName)); + Argument.AssertNotNull(resourceName, nameof(resourceName)); + Argument.AssertNotNull(storageAccountName, nameof(storageAccountName)); + Argument.AssertNotNull(storageContainers, nameof(storageContainers)); + + ClusterName = clusterName; + ResourceName = resourceName; + StorageAccountName = storageAccountName; + StorageContainers = storageContainers.ToList(); + } + + /// Initializes a new instance of . + /// Gets or sets the AzStackHCICluster FQDN name. + /// Gets or sets the AzStackHCICluster resource name. + /// Gets or sets the Storage account name. + /// Gets or sets the list of AzStackHCICluster Storage Container. + /// Keeps track of any properties unknown to the library. + internal AzStackHCIClusterProperties(string clusterName, string resourceName, string storageAccountName, IList storageContainers, IDictionary serializedAdditionalRawData) + { + ClusterName = clusterName; + ResourceName = resourceName; + StorageAccountName = storageAccountName; + StorageContainers = storageContainers; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal AzStackHCIClusterProperties() + { + } + + /// Gets or sets the AzStackHCICluster FQDN name. + public string ClusterName { get; set; } + /// Gets or sets the AzStackHCICluster resource name. + public string ResourceName { get; set; } + /// Gets or sets the Storage account name. + public string StorageAccountName { get; set; } + /// Gets or sets the list of AzStackHCICluster Storage Container. + public IList StorageContainers { get; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/AzStackHCIFabricModelCustomProperties.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/AzStackHCIFabricModelCustomProperties.Serialization.cs new file mode 100644 index 000000000000..37286aa0bee1 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/AzStackHCIFabricModelCustomProperties.Serialization.cs @@ -0,0 +1,201 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + public partial class AzStackHCIFabricModelCustomProperties : 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(AzStackHCIFabricModelCustomProperties)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + writer.WritePropertyName("azStackHciSiteId"u8); + writer.WriteStringValue(AzStackHciSiteId); + if (options.Format != "W" && Optional.IsCollectionDefined(ApplianceName)) + { + writer.WritePropertyName("applianceName"u8); + writer.WriteStartArray(); + foreach (var item in ApplianceName) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + writer.WritePropertyName("cluster"u8); + writer.WriteObjectValue(Cluster, options); + if (options.Format != "W" && Optional.IsDefined(FabricResourceId)) + { + writer.WritePropertyName("fabricResourceId"u8); + writer.WriteStringValue(FabricResourceId); + } + if (options.Format != "W" && Optional.IsDefined(FabricContainerId)) + { + writer.WritePropertyName("fabricContainerId"u8); + writer.WriteStringValue(FabricContainerId); + } + writer.WritePropertyName("migrationSolutionId"u8); + writer.WriteStringValue(MigrationSolutionId); + if (options.Format != "W" && Optional.IsDefined(MigrationHubUri)) + { + writer.WritePropertyName("migrationHubUri"u8); + writer.WriteStringValue(MigrationHubUri); + } + } + + AzStackHCIFabricModelCustomProperties 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(AzStackHCIFabricModelCustomProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAzStackHCIFabricModelCustomProperties(document.RootElement, options); + } + + internal static AzStackHCIFabricModelCustomProperties DeserializeAzStackHCIFabricModelCustomProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string azStackHciSiteId = default; + IReadOnlyList applianceName = default; + AzStackHCIClusterProperties cluster = default; + string fabricResourceId = default; + string fabricContainerId = default; + string migrationSolutionId = default; + string migrationHubUri = default; + string instanceType = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("azStackHciSiteId"u8)) + { + azStackHciSiteId = property.Value.GetString(); + continue; + } + if (property.NameEquals("applianceName"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + applianceName = array; + continue; + } + if (property.NameEquals("cluster"u8)) + { + cluster = AzStackHCIClusterProperties.DeserializeAzStackHCIClusterProperties(property.Value, options); + continue; + } + if (property.NameEquals("fabricResourceId"u8)) + { + fabricResourceId = property.Value.GetString(); + continue; + } + if (property.NameEquals("fabricContainerId"u8)) + { + fabricContainerId = property.Value.GetString(); + continue; + } + if (property.NameEquals("migrationSolutionId"u8)) + { + migrationSolutionId = property.Value.GetString(); + continue; + } + if (property.NameEquals("migrationHubUri"u8)) + { + migrationHubUri = property.Value.GetString(); + continue; + } + if (property.NameEquals("instanceType"u8)) + { + instanceType = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new AzStackHCIFabricModelCustomProperties( + instanceType, + serializedAdditionalRawData, + azStackHciSiteId, + applianceName ?? new ChangeTrackingList(), + cluster, + fabricResourceId, + fabricContainerId, + migrationSolutionId, + migrationHubUri); + } + + 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(AzStackHCIFabricModelCustomProperties)} does not support writing '{options.Format}' format."); + } + } + + AzStackHCIFabricModelCustomProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeAzStackHCIFabricModelCustomProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(AzStackHCIFabricModelCustomProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/AzStackHCIFabricModelCustomProperties.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/AzStackHCIFabricModelCustomProperties.cs new file mode 100644 index 000000000000..d67aa63fd86b --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/AzStackHCIFabricModelCustomProperties.cs @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + /// AzStackHCI fabric model custom properties. + public partial class AzStackHCIFabricModelCustomProperties : FabricModelCustomProperties + { + /// Initializes a new instance of . + /// Gets or sets the ARM Id of the AzStackHCI site. + /// AzStackHCI cluster properties. + /// Gets or sets the Migration solution ARM Id. + /// , or is null. + public AzStackHCIFabricModelCustomProperties(string azStackHciSiteId, AzStackHCIClusterProperties cluster, string migrationSolutionId) + { + Argument.AssertNotNull(azStackHciSiteId, nameof(azStackHciSiteId)); + Argument.AssertNotNull(cluster, nameof(cluster)); + Argument.AssertNotNull(migrationSolutionId, nameof(migrationSolutionId)); + + AzStackHciSiteId = azStackHciSiteId; + ApplianceName = new ChangeTrackingList(); + Cluster = cluster; + MigrationSolutionId = migrationSolutionId; + InstanceType = "AzStackHCI"; + } + + /// Initializes a new instance of . + /// Discriminator property for FabricModelCustomProperties. + /// Keeps track of any properties unknown to the library. + /// Gets or sets the ARM Id of the AzStackHCI site. + /// Gets or sets the Appliance name. + /// AzStackHCI cluster properties. + /// Gets or sets the fabric resource Id. + /// Gets or sets the fabric container Id. + /// Gets or sets the Migration solution ARM Id. + /// Gets or sets the migration hub Uri. + internal AzStackHCIFabricModelCustomProperties(string instanceType, IDictionary serializedAdditionalRawData, string azStackHciSiteId, IReadOnlyList applianceName, AzStackHCIClusterProperties cluster, string fabricResourceId, string fabricContainerId, string migrationSolutionId, string migrationHubUri) : base(instanceType, serializedAdditionalRawData) + { + AzStackHciSiteId = azStackHciSiteId; + ApplianceName = applianceName; + Cluster = cluster; + FabricResourceId = fabricResourceId; + FabricContainerId = fabricContainerId; + MigrationSolutionId = migrationSolutionId; + MigrationHubUri = migrationHubUri; + InstanceType = instanceType ?? "AzStackHCI"; + } + + /// Initializes a new instance of for deserialization. + internal AzStackHCIFabricModelCustomProperties() + { + } + + /// Gets or sets the ARM Id of the AzStackHCI site. + public string AzStackHciSiteId { get; set; } + /// Gets or sets the Appliance name. + public IReadOnlyList ApplianceName { get; } + /// AzStackHCI cluster properties. + public AzStackHCIClusterProperties Cluster { get; set; } + /// Gets or sets the fabric resource Id. + public string FabricResourceId { get; } + /// Gets or sets the fabric container Id. + public string FabricContainerId { get; } + /// Gets or sets the Migration solution ARM Id. + public string MigrationSolutionId { get; set; } + /// Gets or sets the migration hub Uri. + public string MigrationHubUri { get; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/CheckNameAvailabilityModel.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/CheckNameAvailabilityModel.Serialization.cs new file mode 100644 index 000000000000..064bf4436a49 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/CheckNameAvailabilityModel.Serialization.cs @@ -0,0 +1,140 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + public partial class CheckNameAvailabilityModel : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(CheckNameAvailabilityModel)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(Name)) + { + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name); + } + if (Optional.IsDefined(Type)) + { + writer.WritePropertyName("type"u8); + writer.WriteStringValue(Type); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + CheckNameAvailabilityModel 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(CheckNameAvailabilityModel)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeCheckNameAvailabilityModel(document.RootElement, options); + } + + internal static CheckNameAvailabilityModel DeserializeCheckNameAvailabilityModel(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string name = default; + string type = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("type"u8)) + { + type = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new CheckNameAvailabilityModel(name, type, 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(CheckNameAvailabilityModel)} does not support writing '{options.Format}' format."); + } + } + + CheckNameAvailabilityModel IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeCheckNameAvailabilityModel(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(CheckNameAvailabilityModel)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/CheckNameAvailabilityModel.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/CheckNameAvailabilityModel.cs new file mode 100644 index 000000000000..1ef551cc1b2d --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/CheckNameAvailabilityModel.cs @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + /// Check name availability model. + public partial class CheckNameAvailabilityModel + { + /// + /// 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 CheckNameAvailabilityModel() + { + } + + /// Initializes a new instance of . + /// Gets or sets the resource name. + /// Gets or sets the resource type. + /// Keeps track of any properties unknown to the library. + internal CheckNameAvailabilityModel(string name, string type, IDictionary serializedAdditionalRawData) + { + Name = name; + Type = type; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Gets or sets the resource name. + public string Name { get; set; } + /// Gets or sets the resource type. + public string Type { get; set; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/CheckNameAvailabilityResponseModel.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/CheckNameAvailabilityResponseModel.Serialization.cs new file mode 100644 index 000000000000..17bf2627d631 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/CheckNameAvailabilityResponseModel.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; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + public partial class CheckNameAvailabilityResponseModel : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(CheckNameAvailabilityResponseModel)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(NameAvailable)) + { + writer.WritePropertyName("nameAvailable"u8); + writer.WriteBooleanValue(NameAvailable.Value); + } + if (Optional.IsDefined(Reason)) + { + writer.WritePropertyName("reason"u8); + writer.WriteStringValue(Reason); + } + if (Optional.IsDefined(Message)) + { + writer.WritePropertyName("message"u8); + writer.WriteStringValue(Message); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + CheckNameAvailabilityResponseModel 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(CheckNameAvailabilityResponseModel)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeCheckNameAvailabilityResponseModel(document.RootElement, options); + } + + internal static CheckNameAvailabilityResponseModel DeserializeCheckNameAvailabilityResponseModel(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + bool? nameAvailable = default; + string reason = default; + string message = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("nameAvailable"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + nameAvailable = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("reason"u8)) + { + reason = property.Value.GetString(); + continue; + } + if (property.NameEquals("message"u8)) + { + message = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new CheckNameAvailabilityResponseModel(nameAvailable, reason, message, 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(CheckNameAvailabilityResponseModel)} does not support writing '{options.Format}' format."); + } + } + + CheckNameAvailabilityResponseModel IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeCheckNameAvailabilityResponseModel(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(CheckNameAvailabilityResponseModel)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/CheckNameAvailabilityResponseModel.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/CheckNameAvailabilityResponseModel.cs new file mode 100644 index 000000000000..c9ed860f4ed0 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/CheckNameAvailabilityResponseModel.cs @@ -0,0 +1,73 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + /// Check name availability response model. + public partial class CheckNameAvailabilityResponseModel + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + internal CheckNameAvailabilityResponseModel() + { + } + + /// Initializes a new instance of . + /// Gets or sets a value indicating whether resource name is available or not. + /// Gets or sets the reason for resource name unavailability. + /// Gets or sets the message for resource name unavailability. + /// Keeps track of any properties unknown to the library. + internal CheckNameAvailabilityResponseModel(bool? nameAvailable, string reason, string message, IDictionary serializedAdditionalRawData) + { + NameAvailable = nameAvailable; + Reason = reason; + Message = message; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Gets or sets a value indicating whether resource name is available or not. + public bool? NameAvailable { get; } + /// Gets or sets the reason for resource name unavailability. + public string Reason { get; } + /// Gets or sets the message for resource name unavailability. + public string Message { get; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/ConnectionDetails.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/ConnectionDetails.Serialization.cs new file mode 100644 index 000000000000..92607505196e --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/ConnectionDetails.Serialization.cs @@ -0,0 +1,179 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + public partial class ConnectionDetails : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ConnectionDetails)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(Id)) + { + writer.WritePropertyName("id"u8); + writer.WriteStringValue(Id); + } + if (Optional.IsDefined(PrivateIPAddress)) + { + writer.WritePropertyName("privateIpAddress"u8); + writer.WriteStringValue(PrivateIPAddress); + } + if (Optional.IsDefined(LinkIdentifier)) + { + writer.WritePropertyName("linkIdentifier"u8); + writer.WriteStringValue(LinkIdentifier); + } + if (Optional.IsDefined(GroupId)) + { + writer.WritePropertyName("groupId"u8); + writer.WriteStringValue(GroupId); + } + if (Optional.IsDefined(MemberName)) + { + writer.WritePropertyName("memberName"u8); + writer.WriteStringValue(MemberName); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + ConnectionDetails 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(ConnectionDetails)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeConnectionDetails(document.RootElement, options); + } + + internal static ConnectionDetails DeserializeConnectionDetails(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string id = default; + string privateIPAddress = default; + string linkIdentifier = default; + string groupId = default; + string memberName = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("id"u8)) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("privateIpAddress"u8)) + { + privateIPAddress = property.Value.GetString(); + continue; + } + if (property.NameEquals("linkIdentifier"u8)) + { + linkIdentifier = property.Value.GetString(); + continue; + } + if (property.NameEquals("groupId"u8)) + { + groupId = property.Value.GetString(); + continue; + } + if (property.NameEquals("memberName"u8)) + { + memberName = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ConnectionDetails( + id, + privateIPAddress, + linkIdentifier, + groupId, + memberName, + 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(ConnectionDetails)} does not support writing '{options.Format}' format."); + } + } + + ConnectionDetails IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeConnectionDetails(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ConnectionDetails)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/ConnectionDetails.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/ConnectionDetails.cs new file mode 100644 index 000000000000..d4e50015784d --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/ConnectionDetails.cs @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + /// Private endpoint connection details at member level. + public partial class ConnectionDetails + { + /// + /// 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 ConnectionDetails() + { + } + + /// Initializes a new instance of . + /// Gets or sets id. + /// Gets or sets private IP address. + /// Gets or sets link identifier. + /// Gets or sets group id. + /// Gets or sets member name. + /// Keeps track of any properties unknown to the library. + internal ConnectionDetails(string id, string privateIPAddress, string linkIdentifier, string groupId, string memberName, IDictionary serializedAdditionalRawData) + { + Id = id; + PrivateIPAddress = privateIPAddress; + LinkIdentifier = linkIdentifier; + GroupId = groupId; + MemberName = memberName; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Gets or sets id. + public string Id { get; set; } + /// Gets or sets private IP address. + public string PrivateIPAddress { get; set; } + /// Gets or sets link identifier. + public string LinkIdentifier { get; set; } + /// Gets or sets group id. + public string GroupId { get; set; } + /// Gets or sets member name. + public string MemberName { get; set; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DeploymentPreflightModel.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DeploymentPreflightModel.Serialization.cs new file mode 100644 index 000000000000..b2fcaf17ac50 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DeploymentPreflightModel.Serialization.cs @@ -0,0 +1,143 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + public partial class DeploymentPreflightModel : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DeploymentPreflightModel)} does not support writing '{format}' format."); + } + + if (Optional.IsCollectionDefined(Resources)) + { + writer.WritePropertyName("resources"u8); + writer.WriteStartArray(); + foreach (var item in Resources) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + DeploymentPreflightModel 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(DeploymentPreflightModel)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDeploymentPreflightModel(document.RootElement, options); + } + + internal static DeploymentPreflightModel DeserializeDeploymentPreflightModel(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IList resources = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("resources"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(DeploymentPreflightResource.DeserializeDeploymentPreflightResource(item, options)); + } + resources = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DeploymentPreflightModel(resources ?? new ChangeTrackingList(), serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(DeploymentPreflightModel)} does not support writing '{options.Format}' format."); + } + } + + DeploymentPreflightModel IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeDeploymentPreflightModel(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DeploymentPreflightModel)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DeploymentPreflightModel.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DeploymentPreflightModel.cs new file mode 100644 index 000000000000..05f2ee146cdc --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DeploymentPreflightModel.cs @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + /// Deployment preflight model. + public partial class DeploymentPreflightModel + { + /// + /// 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 DeploymentPreflightModel() + { + Resources = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// Gets or sets the list of resources. + /// Keeps track of any properties unknown to the library. + internal DeploymentPreflightModel(IList resources, IDictionary serializedAdditionalRawData) + { + Resources = resources; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Gets or sets the list of resources. + public IList Resources { get; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DeploymentPreflightResource.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DeploymentPreflightResource.Serialization.cs new file mode 100644 index 000000000000..4100d8abac5f --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DeploymentPreflightResource.Serialization.cs @@ -0,0 +1,190 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + public partial class DeploymentPreflightResource : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DeploymentPreflightResource)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(Name)) + { + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name); + } + if (Optional.IsDefined(Type)) + { + writer.WritePropertyName("type"u8); + writer.WriteStringValue(Type); + } + if (Optional.IsDefined(Location)) + { + writer.WritePropertyName("location"u8); + writer.WriteStringValue(Location); + } + if (Optional.IsDefined(ApiVersion)) + { + writer.WritePropertyName("apiVersion"u8); + writer.WriteStringValue(ApiVersion); + } + if (Optional.IsDefined(Properties)) + { + writer.WritePropertyName("properties"u8); +#if NET6_0_OR_GREATER + writer.WriteRawValue(Properties); +#else + using (JsonDocument document = JsonDocument.Parse(Properties)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + DeploymentPreflightResource 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(DeploymentPreflightResource)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDeploymentPreflightResource(document.RootElement, options); + } + + internal static DeploymentPreflightResource DeserializeDeploymentPreflightResource(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string name = default; + string type = default; + string location = default; + string apiVersion = default; + BinaryData properties = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("type"u8)) + { + type = property.Value.GetString(); + continue; + } + if (property.NameEquals("location"u8)) + { + location = property.Value.GetString(); + continue; + } + if (property.NameEquals("apiVersion"u8)) + { + apiVersion = property.Value.GetString(); + continue; + } + if (property.NameEquals("properties"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + properties = BinaryData.FromString(property.Value.GetRawText()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DeploymentPreflightResource( + name, + type, + location, + apiVersion, + 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(DeploymentPreflightResource)} does not support writing '{options.Format}' format."); + } + } + + DeploymentPreflightResource IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeDeploymentPreflightResource(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DeploymentPreflightResource)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DeploymentPreflightResource.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DeploymentPreflightResource.cs new file mode 100644 index 000000000000..246f7f578880 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DeploymentPreflightResource.cs @@ -0,0 +1,110 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + /// Deployment preflight resource. + public partial class DeploymentPreflightResource + { + /// + /// 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 DeploymentPreflightResource() + { + } + + /// Initializes a new instance of . + /// Gets or sets the resource name. + /// Gets or sets the resource type. + /// Gets or sets the location of the resource. + /// Gets or sets the Api version. + /// Gets or sets the properties of the resource. + /// Keeps track of any properties unknown to the library. + internal DeploymentPreflightResource(string name, string type, string location, string apiVersion, BinaryData properties, IDictionary serializedAdditionalRawData) + { + Name = name; + Type = type; + Location = location; + ApiVersion = apiVersion; + Properties = properties; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Gets or sets the resource name. + public string Name { get; set; } + /// Gets or sets the resource type. + public string Type { get; set; } + /// Gets or sets the location of the resource. + public string Location { get; set; } + /// Gets or sets the Api version. + public string ApiVersion { get; set; } + /// + /// Gets or sets the properties of the resource. + /// + /// To assign an object to 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" }. + /// + /// + /// + /// + public BinaryData Properties { get; set; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DiskControllerInputs.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DiskControllerInputs.Serialization.cs new file mode 100644 index 000000000000..dcc9cc4a6b49 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DiskControllerInputs.Serialization.cs @@ -0,0 +1,142 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + public partial class DiskControllerInputs : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DiskControllerInputs)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("controllerName"u8); + writer.WriteStringValue(ControllerName); + writer.WritePropertyName("controllerId"u8); + writer.WriteNumberValue(ControllerId); + writer.WritePropertyName("controllerLocation"u8); + writer.WriteNumberValue(ControllerLocation); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + DiskControllerInputs 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(DiskControllerInputs)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDiskControllerInputs(document.RootElement, options); + } + + internal static DiskControllerInputs DeserializeDiskControllerInputs(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string controllerName = default; + int controllerId = default; + int controllerLocation = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("controllerName"u8)) + { + controllerName = property.Value.GetString(); + continue; + } + if (property.NameEquals("controllerId"u8)) + { + controllerId = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("controllerLocation"u8)) + { + controllerLocation = property.Value.GetInt32(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DiskControllerInputs(controllerName, controllerId, controllerLocation, 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(DiskControllerInputs)} does not support writing '{options.Format}' format."); + } + } + + DiskControllerInputs IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeDiskControllerInputs(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DiskControllerInputs)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DiskControllerInputs.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DiskControllerInputs.cs new file mode 100644 index 000000000000..1ea2d9533b87 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DiskControllerInputs.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; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + /// Disk controller. + public partial class DiskControllerInputs + { + /// + /// 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 . + /// Gets or sets the controller name (IDE,SCSI). + /// Gets or sets the controller ID. + /// Gets or sets the controller Location. + /// is null. + public DiskControllerInputs(string controllerName, int controllerId, int controllerLocation) + { + Argument.AssertNotNull(controllerName, nameof(controllerName)); + + ControllerName = controllerName; + ControllerId = controllerId; + ControllerLocation = controllerLocation; + } + + /// Initializes a new instance of . + /// Gets or sets the controller name (IDE,SCSI). + /// Gets or sets the controller ID. + /// Gets or sets the controller Location. + /// Keeps track of any properties unknown to the library. + internal DiskControllerInputs(string controllerName, int controllerId, int controllerLocation, IDictionary serializedAdditionalRawData) + { + ControllerName = controllerName; + ControllerId = controllerId; + ControllerLocation = controllerLocation; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal DiskControllerInputs() + { + } + + /// Gets or sets the controller name (IDE,SCSI). + public string ControllerName { get; set; } + /// Gets or sets the controller ID. + public int ControllerId { get; set; } + /// Gets or sets the controller Location. + public int ControllerLocation { get; set; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/EmailConfigurationModelListResult.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/EmailConfigurationModelListResult.Serialization.cs new file mode 100644 index 000000000000..564d66770de9 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/EmailConfigurationModelListResult.Serialization.cs @@ -0,0 +1,151 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + internal partial class EmailConfigurationModelListResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(EmailConfigurationModelListResult)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var item in Value) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + if (Optional.IsDefined(NextLink)) + { + writer.WritePropertyName("nextLink"u8); + writer.WriteStringValue(NextLink.AbsoluteUri); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + EmailConfigurationModelListResult 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(EmailConfigurationModelListResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeEmailConfigurationModelListResult(document.RootElement, options); + } + + internal static EmailConfigurationModelListResult DeserializeEmailConfigurationModelListResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IReadOnlyList value = default; + Uri nextLink = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(EmailConfigurationModelData.DeserializeEmailConfigurationModelData(item, options)); + } + value = array; + continue; + } + if (property.NameEquals("nextLink"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + nextLink = new Uri(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new EmailConfigurationModelListResult(value, nextLink, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(EmailConfigurationModelListResult)} does not support writing '{options.Format}' format."); + } + } + + EmailConfigurationModelListResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeEmailConfigurationModelListResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(EmailConfigurationModelListResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/EmailConfigurationModelListResult.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/EmailConfigurationModelListResult.cs new file mode 100644 index 000000000000..36774ca19611 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/EmailConfigurationModelListResult.cs @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + /// The response of a EmailConfigurationModel list operation. + internal partial class EmailConfigurationModelListResult + { + /// + /// 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 EmailConfigurationModel items on this page. + /// is null. + internal EmailConfigurationModelListResult(IEnumerable value) + { + Argument.AssertNotNull(value, nameof(value)); + + Value = value.ToList(); + } + + /// Initializes a new instance of . + /// The EmailConfigurationModel items on this page. + /// The link to the next page of items. + /// Keeps track of any properties unknown to the library. + internal EmailConfigurationModelListResult(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) + { + Value = value; + NextLink = nextLink; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal EmailConfigurationModelListResult() + { + } + + /// The EmailConfigurationModel items on this page. + public IReadOnlyList Value { get; } + /// The link to the next page of items. + public Uri NextLink { get; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/EmailConfigurationModelProperties.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/EmailConfigurationModelProperties.Serialization.cs new file mode 100644 index 000000000000..d7dc6bcd0c6d --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/EmailConfigurationModelProperties.Serialization.cs @@ -0,0 +1,177 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + public partial class EmailConfigurationModelProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(EmailConfigurationModelProperties)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("sendToOwners"u8); + writer.WriteBooleanValue(SendToOwners); + if (Optional.IsCollectionDefined(CustomEmailAddresses)) + { + writer.WritePropertyName("customEmailAddresses"u8); + writer.WriteStartArray(); + foreach (var item in CustomEmailAddresses) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(Locale)) + { + writer.WritePropertyName("locale"u8); + writer.WriteStringValue(Locale); + } + if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) + { + writer.WritePropertyName("provisioningState"u8); + writer.WriteStringValue(ProvisioningState.Value.ToString()); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + EmailConfigurationModelProperties 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(EmailConfigurationModelProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeEmailConfigurationModelProperties(document.RootElement, options); + } + + internal static EmailConfigurationModelProperties DeserializeEmailConfigurationModelProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + bool sendToOwners = default; + IList customEmailAddresses = default; + string locale = default; + ProvisioningState? provisioningState = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("sendToOwners"u8)) + { + sendToOwners = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("customEmailAddresses"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + customEmailAddresses = array; + continue; + } + if (property.NameEquals("locale"u8)) + { + locale = property.Value.GetString(); + continue; + } + if (property.NameEquals("provisioningState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + provisioningState = new ProvisioningState(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new EmailConfigurationModelProperties(sendToOwners, customEmailAddresses ?? new ChangeTrackingList(), locale, provisioningState, 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(EmailConfigurationModelProperties)} does not support writing '{options.Format}' format."); + } + } + + EmailConfigurationModelProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeEmailConfigurationModelProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(EmailConfigurationModelProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/EmailConfigurationModelProperties.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/EmailConfigurationModelProperties.cs new file mode 100644 index 000000000000..cb717df57647 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/EmailConfigurationModelProperties.cs @@ -0,0 +1,85 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + /// Email configuration model properties. + public partial class EmailConfigurationModelProperties + { + /// + /// 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 . + /// Gets or sets a value indicating whether to send email to subscription administrator. + public EmailConfigurationModelProperties(bool sendToOwners) + { + SendToOwners = sendToOwners; + CustomEmailAddresses = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// Gets or sets a value indicating whether to send email to subscription administrator. + /// Gets or sets the custom email address for sending emails. + /// Gets or sets the locale for the email notification. + /// Gets or sets the provisioning state of the email configuration. + /// Keeps track of any properties unknown to the library. + internal EmailConfigurationModelProperties(bool sendToOwners, IList customEmailAddresses, string locale, ProvisioningState? provisioningState, IDictionary serializedAdditionalRawData) + { + SendToOwners = sendToOwners; + CustomEmailAddresses = customEmailAddresses; + Locale = locale; + ProvisioningState = provisioningState; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal EmailConfigurationModelProperties() + { + } + + /// Gets or sets a value indicating whether to send email to subscription administrator. + public bool SendToOwners { get; set; } + /// Gets or sets the custom email address for sending emails. + public IList CustomEmailAddresses { get; } + /// Gets or sets the locale for the email notification. + public string Locale { get; set; } + /// Gets or sets the provisioning state of the email configuration. + public ProvisioningState? ProvisioningState { get; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/ErrorModel.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/ErrorModel.Serialization.cs new file mode 100644 index 000000000000..a32e6dd5c6b8 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/ErrorModel.Serialization.cs @@ -0,0 +1,207 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + public partial class ErrorModel : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ErrorModel)} does not support writing '{format}' format."); + } + + if (options.Format != "W" && Optional.IsDefined(Code)) + { + writer.WritePropertyName("code"u8); + writer.WriteStringValue(Code); + } + if (options.Format != "W" && Optional.IsDefined(Type)) + { + writer.WritePropertyName("type"u8); + writer.WriteStringValue(Type); + } + if (options.Format != "W" && Optional.IsDefined(Severity)) + { + writer.WritePropertyName("severity"u8); + writer.WriteStringValue(Severity); + } + if (options.Format != "W" && Optional.IsDefined(CreatedOn)) + { + writer.WritePropertyName("creationTime"u8); + writer.WriteStringValue(CreatedOn.Value, "O"); + } + if (options.Format != "W" && Optional.IsDefined(Message)) + { + writer.WritePropertyName("message"u8); + writer.WriteStringValue(Message); + } + if (options.Format != "W" && Optional.IsDefined(Causes)) + { + writer.WritePropertyName("causes"u8); + writer.WriteStringValue(Causes); + } + if (options.Format != "W" && Optional.IsDefined(Recommendation)) + { + writer.WritePropertyName("recommendation"u8); + writer.WriteStringValue(Recommendation); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + ErrorModel 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(ErrorModel)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeErrorModel(document.RootElement, options); + } + + internal static ErrorModel DeserializeErrorModel(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string code = default; + string type = default; + string severity = default; + DateTimeOffset? creationTime = default; + string message = default; + string causes = default; + string recommendation = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("code"u8)) + { + code = property.Value.GetString(); + continue; + } + if (property.NameEquals("type"u8)) + { + type = property.Value.GetString(); + continue; + } + if (property.NameEquals("severity"u8)) + { + severity = property.Value.GetString(); + continue; + } + if (property.NameEquals("creationTime"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + creationTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("message"u8)) + { + message = property.Value.GetString(); + continue; + } + if (property.NameEquals("causes"u8)) + { + causes = property.Value.GetString(); + continue; + } + if (property.NameEquals("recommendation"u8)) + { + recommendation = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ErrorModel( + code, + type, + severity, + creationTime, + message, + causes, + recommendation, + 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(ErrorModel)} does not support writing '{options.Format}' format."); + } + } + + ErrorModel IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeErrorModel(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ErrorModel)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/ErrorModel.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/ErrorModel.cs new file mode 100644 index 000000000000..7f8870744261 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/ErrorModel.cs @@ -0,0 +1,89 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + /// Error model. + public partial class ErrorModel + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + internal ErrorModel() + { + } + + /// Initializes a new instance of . + /// Gets or sets the error code. + /// Gets or sets the error type. + /// Gets or sets the error severity. + /// Gets or sets the creation time of error. + /// Gets or sets the error message. + /// Gets or sets the possible causes of error. + /// Gets or sets the recommended action to resolve error. + /// Keeps track of any properties unknown to the library. + internal ErrorModel(string code, string type, string severity, DateTimeOffset? createdOn, string message, string causes, string recommendation, IDictionary serializedAdditionalRawData) + { + Code = code; + Type = type; + Severity = severity; + CreatedOn = createdOn; + Message = message; + Causes = causes; + Recommendation = recommendation; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Gets or sets the error code. + public string Code { get; } + /// Gets or sets the error type. + public string Type { get; } + /// Gets or sets the error severity. + public string Severity { get; } + /// Gets or sets the creation time of error. + public DateTimeOffset? CreatedOn { get; } + /// Gets or sets the error message. + public string Message { get; } + /// Gets or sets the possible causes of error. + public string Causes { get; } + /// Gets or sets the recommended action to resolve error. + public string Recommendation { get; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/EventModelCustomProperties.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/EventModelCustomProperties.Serialization.cs new file mode 100644 index 000000000000..81689d033f26 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/EventModelCustomProperties.Serialization.cs @@ -0,0 +1,118 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + [PersistableModelProxy(typeof(UnknownEventModelCustomProperties))] + public partial class EventModelCustomProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(EventModelCustomProperties)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("instanceType"u8); + writer.WriteStringValue(InstanceType); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + EventModelCustomProperties 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(EventModelCustomProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeEventModelCustomProperties(document.RootElement, options); + } + + internal static EventModelCustomProperties DeserializeEventModelCustomProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + if (element.TryGetProperty("instanceType", out JsonElement discriminator)) + { + switch (discriminator.GetString()) + { + case "HyperVToAzStackHCI": return HyperVToAzStackHCIEventModelCustomProperties.DeserializeHyperVToAzStackHCIEventModelCustomProperties(element, options); + case "VMwareToAzStackHCI": return VMwareToAzStackHCIEventModelCustomProperties.DeserializeVMwareToAzStackHCIEventModelCustomProperties(element, options); + } + } + return UnknownEventModelCustomProperties.DeserializeUnknownEventModelCustomProperties(element, options); + } + + 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(EventModelCustomProperties)} does not support writing '{options.Format}' format."); + } + } + + EventModelCustomProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeEventModelCustomProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(EventModelCustomProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/EventModelCustomProperties.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/EventModelCustomProperties.cs new file mode 100644 index 000000000000..4737c3569c74 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/EventModelCustomProperties.cs @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + /// + /// Event model custom properties. + /// 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 . + /// + public abstract partial class EventModelCustomProperties + { + /// + /// 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 protected IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + protected EventModelCustomProperties() + { + } + + /// Initializes a new instance of . + /// Discriminator property for EventModelCustomProperties. + /// Keeps track of any properties unknown to the library. + internal EventModelCustomProperties(string instanceType, IDictionary serializedAdditionalRawData) + { + InstanceType = instanceType; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Discriminator property for EventModelCustomProperties. + internal string InstanceType { get; set; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/EventModelListResult.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/EventModelListResult.Serialization.cs new file mode 100644 index 000000000000..cf77bd1ac861 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/EventModelListResult.Serialization.cs @@ -0,0 +1,151 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + internal partial class EventModelListResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(EventModelListResult)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var item in Value) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + if (Optional.IsDefined(NextLink)) + { + writer.WritePropertyName("nextLink"u8); + writer.WriteStringValue(NextLink.AbsoluteUri); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + EventModelListResult 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(EventModelListResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeEventModelListResult(document.RootElement, options); + } + + internal static EventModelListResult DeserializeEventModelListResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IReadOnlyList value = default; + Uri nextLink = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(EventModelData.DeserializeEventModelData(item, options)); + } + value = array; + continue; + } + if (property.NameEquals("nextLink"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + nextLink = new Uri(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new EventModelListResult(value, nextLink, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(EventModelListResult)} does not support writing '{options.Format}' format."); + } + } + + EventModelListResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeEventModelListResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(EventModelListResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/EventModelListResult.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/EventModelListResult.cs new file mode 100644 index 000000000000..6a7059af4d21 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/EventModelListResult.cs @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + /// The response of a EventModel list operation. + internal partial class EventModelListResult + { + /// + /// 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 EventModel items on this page. + /// is null. + internal EventModelListResult(IEnumerable value) + { + Argument.AssertNotNull(value, nameof(value)); + + Value = value.ToList(); + } + + /// Initializes a new instance of . + /// The EventModel items on this page. + /// The link to the next page of items. + /// Keeps track of any properties unknown to the library. + internal EventModelListResult(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) + { + Value = value; + NextLink = nextLink; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal EventModelListResult() + { + } + + /// The EventModel items on this page. + public IReadOnlyList Value { get; } + /// The link to the next page of items. + public Uri NextLink { get; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/EventModelProperties.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/EventModelProperties.Serialization.cs new file mode 100644 index 000000000000..650cf05a67f3 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/EventModelProperties.Serialization.cs @@ -0,0 +1,270 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + public partial class EventModelProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(EventModelProperties)} does not support writing '{format}' format."); + } + + if (options.Format != "W" && Optional.IsDefined(ResourceType)) + { + writer.WritePropertyName("resourceType"u8); + writer.WriteStringValue(ResourceType); + } + if (options.Format != "W" && Optional.IsDefined(ResourceName)) + { + writer.WritePropertyName("resourceName"u8); + writer.WriteStringValue(ResourceName); + } + if (options.Format != "W" && Optional.IsDefined(EventType)) + { + writer.WritePropertyName("eventType"u8); + writer.WriteStringValue(EventType); + } + if (options.Format != "W" && Optional.IsDefined(EventName)) + { + writer.WritePropertyName("eventName"u8); + writer.WriteStringValue(EventName); + } + if (options.Format != "W" && Optional.IsDefined(TimeOfOccurrence)) + { + writer.WritePropertyName("timeOfOccurrence"u8); + writer.WriteStringValue(TimeOfOccurrence.Value, "O"); + } + if (options.Format != "W" && Optional.IsDefined(Severity)) + { + writer.WritePropertyName("severity"u8); + writer.WriteStringValue(Severity); + } + if (options.Format != "W" && Optional.IsDefined(Description)) + { + writer.WritePropertyName("description"u8); + writer.WriteStringValue(Description); + } + if (options.Format != "W" && Optional.IsDefined(CorrelationId)) + { + writer.WritePropertyName("correlationId"u8); + writer.WriteStringValue(CorrelationId); + } + if (options.Format != "W" && Optional.IsCollectionDefined(HealthErrors)) + { + writer.WritePropertyName("healthErrors"u8); + writer.WriteStartArray(); + foreach (var item in HealthErrors) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + writer.WritePropertyName("customProperties"u8); + writer.WriteObjectValue(CustomProperties, options); + if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) + { + writer.WritePropertyName("provisioningState"u8); + writer.WriteStringValue(ProvisioningState.Value.ToString()); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + EventModelProperties 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(EventModelProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeEventModelProperties(document.RootElement, options); + } + + internal static EventModelProperties DeserializeEventModelProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string resourceType = default; + string resourceName = default; + string eventType = default; + string eventName = default; + DateTimeOffset? timeOfOccurrence = default; + string severity = default; + string description = default; + string correlationId = default; + IReadOnlyList healthErrors = default; + EventModelCustomProperties customProperties = default; + ProvisioningState? provisioningState = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("resourceType"u8)) + { + resourceType = property.Value.GetString(); + continue; + } + if (property.NameEquals("resourceName"u8)) + { + resourceName = property.Value.GetString(); + continue; + } + if (property.NameEquals("eventType"u8)) + { + eventType = property.Value.GetString(); + continue; + } + if (property.NameEquals("eventName"u8)) + { + eventName = property.Value.GetString(); + continue; + } + if (property.NameEquals("timeOfOccurrence"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + timeOfOccurrence = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("severity"u8)) + { + severity = property.Value.GetString(); + continue; + } + if (property.NameEquals("description"u8)) + { + description = property.Value.GetString(); + continue; + } + if (property.NameEquals("correlationId"u8)) + { + correlationId = property.Value.GetString(); + continue; + } + if (property.NameEquals("healthErrors"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(HealthErrorModel.DeserializeHealthErrorModel(item, options)); + } + healthErrors = array; + continue; + } + if (property.NameEquals("customProperties"u8)) + { + customProperties = EventModelCustomProperties.DeserializeEventModelCustomProperties(property.Value, options); + continue; + } + if (property.NameEquals("provisioningState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + provisioningState = new ProvisioningState(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new EventModelProperties( + resourceType, + resourceName, + eventType, + eventName, + timeOfOccurrence, + severity, + description, + correlationId, + healthErrors ?? new ChangeTrackingList(), + customProperties, + provisioningState, + 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(EventModelProperties)} does not support writing '{options.Format}' format."); + } + } + + EventModelProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeEventModelProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(EventModelProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/EventModelProperties.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/EventModelProperties.cs new file mode 100644 index 000000000000..a72386e4d757 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/EventModelProperties.cs @@ -0,0 +1,128 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + /// Event model properties. + public partial class EventModelProperties + { + /// + /// 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 . + /// + /// Event model custom properties. + /// 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 . + /// + /// is null. + internal EventModelProperties(EventModelCustomProperties customProperties) + { + Argument.AssertNotNull(customProperties, nameof(customProperties)); + + HealthErrors = new ChangeTrackingList(); + CustomProperties = customProperties; + } + + /// Initializes a new instance of . + /// Gets or sets the resource type. + /// Gets or sets the resource name. + /// Gets or sets the event type. + /// Gets or sets the event name. + /// Gets or sets the time at which the event occurred at source. + /// Gets or sets the event severity. + /// Gets or sets the event description. + /// Gets or sets the event correlation Id. + /// Gets or sets the errors associated with this event. + /// + /// Event model custom properties. + /// 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 . + /// + /// Gets or sets the provisioning state of the event. + /// Keeps track of any properties unknown to the library. + internal EventModelProperties(string resourceType, string resourceName, string eventType, string eventName, DateTimeOffset? timeOfOccurrence, string severity, string description, string correlationId, IReadOnlyList healthErrors, EventModelCustomProperties customProperties, ProvisioningState? provisioningState, IDictionary serializedAdditionalRawData) + { + ResourceType = resourceType; + ResourceName = resourceName; + EventType = eventType; + EventName = eventName; + TimeOfOccurrence = timeOfOccurrence; + Severity = severity; + Description = description; + CorrelationId = correlationId; + HealthErrors = healthErrors; + CustomProperties = customProperties; + ProvisioningState = provisioningState; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal EventModelProperties() + { + } + + /// Gets or sets the resource type. + public string ResourceType { get; } + /// Gets or sets the resource name. + public string ResourceName { get; } + /// Gets or sets the event type. + public string EventType { get; } + /// Gets or sets the event name. + public string EventName { get; } + /// Gets or sets the time at which the event occurred at source. + public DateTimeOffset? TimeOfOccurrence { get; } + /// Gets or sets the event severity. + public string Severity { get; } + /// Gets or sets the event description. + public string Description { get; } + /// Gets or sets the event correlation Id. + public string CorrelationId { get; } + /// Gets or sets the errors associated with this event. + public IReadOnlyList HealthErrors { get; } + /// + /// Event model custom properties. + /// 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 . + /// + public EventModelCustomProperties CustomProperties { get; } + /// Gets or sets the provisioning state of the event. + public ProvisioningState? ProvisioningState { get; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/FabricAgentModelCustomProperties.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/FabricAgentModelCustomProperties.Serialization.cs new file mode 100644 index 000000000000..621dec5315c8 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/FabricAgentModelCustomProperties.Serialization.cs @@ -0,0 +1,117 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + [PersistableModelProxy(typeof(UnknownFabricAgentModelCustomProperties))] + public partial class FabricAgentModelCustomProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(FabricAgentModelCustomProperties)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("instanceType"u8); + writer.WriteStringValue(InstanceType); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + FabricAgentModelCustomProperties 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(FabricAgentModelCustomProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeFabricAgentModelCustomProperties(document.RootElement, options); + } + + internal static FabricAgentModelCustomProperties DeserializeFabricAgentModelCustomProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + if (element.TryGetProperty("instanceType", out JsonElement discriminator)) + { + switch (discriminator.GetString()) + { + case "VMware": return VMwareFabricAgentModelCustomProperties.DeserializeVMwareFabricAgentModelCustomProperties(element, options); + } + } + return UnknownFabricAgentModelCustomProperties.DeserializeUnknownFabricAgentModelCustomProperties(element, options); + } + + 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(FabricAgentModelCustomProperties)} does not support writing '{options.Format}' format."); + } + } + + FabricAgentModelCustomProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeFabricAgentModelCustomProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(FabricAgentModelCustomProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/FabricAgentModelCustomProperties.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/FabricAgentModelCustomProperties.cs new file mode 100644 index 000000000000..a49fe3e7f1a3 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/FabricAgentModelCustomProperties.cs @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + /// + /// Fabric agent model custom properties. + /// 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 abstract partial class FabricAgentModelCustomProperties + { + /// + /// 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 protected IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + protected FabricAgentModelCustomProperties() + { + } + + /// Initializes a new instance of . + /// Discriminator property for FabricAgentModelCustomProperties. + /// Keeps track of any properties unknown to the library. + internal FabricAgentModelCustomProperties(string instanceType, IDictionary serializedAdditionalRawData) + { + InstanceType = instanceType; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Discriminator property for FabricAgentModelCustomProperties. + internal string InstanceType { get; set; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/FabricAgentModelListResult.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/FabricAgentModelListResult.Serialization.cs new file mode 100644 index 000000000000..3e113957d568 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/FabricAgentModelListResult.Serialization.cs @@ -0,0 +1,151 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + internal partial class FabricAgentModelListResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(FabricAgentModelListResult)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var item in Value) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + if (Optional.IsDefined(NextLink)) + { + writer.WritePropertyName("nextLink"u8); + writer.WriteStringValue(NextLink.AbsoluteUri); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + FabricAgentModelListResult 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(FabricAgentModelListResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeFabricAgentModelListResult(document.RootElement, options); + } + + internal static FabricAgentModelListResult DeserializeFabricAgentModelListResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IReadOnlyList value = default; + Uri nextLink = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(FabricAgentModelData.DeserializeFabricAgentModelData(item, options)); + } + value = array; + continue; + } + if (property.NameEquals("nextLink"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + nextLink = new Uri(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new FabricAgentModelListResult(value, nextLink, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(FabricAgentModelListResult)} does not support writing '{options.Format}' format."); + } + } + + FabricAgentModelListResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeFabricAgentModelListResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(FabricAgentModelListResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/FabricAgentModelListResult.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/FabricAgentModelListResult.cs new file mode 100644 index 000000000000..124873b1edd0 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/FabricAgentModelListResult.cs @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + /// The response of a FabricAgentModel list operation. + internal partial class FabricAgentModelListResult + { + /// + /// 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 FabricAgentModel items on this page. + /// is null. + internal FabricAgentModelListResult(IEnumerable value) + { + Argument.AssertNotNull(value, nameof(value)); + + Value = value.ToList(); + } + + /// Initializes a new instance of . + /// The FabricAgentModel items on this page. + /// The link to the next page of items. + /// Keeps track of any properties unknown to the library. + internal FabricAgentModelListResult(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) + { + Value = value; + NextLink = nextLink; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal FabricAgentModelListResult() + { + } + + /// The FabricAgentModel items on this page. + public IReadOnlyList Value { get; } + /// The link to the next page of items. + public Uri NextLink { get; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/FabricAgentModelProperties.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/FabricAgentModelProperties.Serialization.cs new file mode 100644 index 000000000000..d1e2ce543327 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/FabricAgentModelProperties.Serialization.cs @@ -0,0 +1,262 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + public partial class FabricAgentModelProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(FabricAgentModelProperties)} does not support writing '{format}' format."); + } + + if (options.Format != "W" && Optional.IsDefined(CorrelationId)) + { + writer.WritePropertyName("correlationId"u8); + writer.WriteStringValue(CorrelationId); + } + writer.WritePropertyName("machineId"u8); + writer.WriteStringValue(MachineId); + writer.WritePropertyName("machineName"u8); + writer.WriteStringValue(MachineName); + writer.WritePropertyName("authenticationIdentity"u8); + writer.WriteObjectValue(AuthenticationIdentity, options); + writer.WritePropertyName("resourceAccessIdentity"u8); + writer.WriteObjectValue(ResourceAccessIdentity, options); + if (options.Format != "W" && Optional.IsDefined(IsResponsive)) + { + writer.WritePropertyName("isResponsive"u8); + writer.WriteBooleanValue(IsResponsive.Value); + } + if (options.Format != "W" && Optional.IsDefined(LastHeartbeat)) + { + writer.WritePropertyName("lastHeartbeat"u8); + writer.WriteStringValue(LastHeartbeat.Value, "O"); + } + if (options.Format != "W" && Optional.IsDefined(VersionNumber)) + { + writer.WritePropertyName("versionNumber"u8); + writer.WriteStringValue(VersionNumber); + } + if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) + { + writer.WritePropertyName("provisioningState"u8); + writer.WriteStringValue(ProvisioningState.Value.ToString()); + } + if (options.Format != "W" && Optional.IsCollectionDefined(HealthErrors)) + { + writer.WritePropertyName("healthErrors"u8); + writer.WriteStartArray(); + foreach (var item in HealthErrors) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + writer.WritePropertyName("customProperties"u8); + writer.WriteObjectValue(CustomProperties, options); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + FabricAgentModelProperties 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(FabricAgentModelProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeFabricAgentModelProperties(document.RootElement, options); + } + + internal static FabricAgentModelProperties DeserializeFabricAgentModelProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string correlationId = default; + string machineId = default; + string machineName = default; + IdentityModel authenticationIdentity = default; + IdentityModel resourceAccessIdentity = default; + bool? isResponsive = default; + DateTimeOffset? lastHeartbeat = default; + string versionNumber = default; + ProvisioningState? provisioningState = default; + IReadOnlyList healthErrors = default; + FabricAgentModelCustomProperties customProperties = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("correlationId"u8)) + { + correlationId = property.Value.GetString(); + continue; + } + if (property.NameEquals("machineId"u8)) + { + machineId = property.Value.GetString(); + continue; + } + if (property.NameEquals("machineName"u8)) + { + machineName = property.Value.GetString(); + continue; + } + if (property.NameEquals("authenticationIdentity"u8)) + { + authenticationIdentity = IdentityModel.DeserializeIdentityModel(property.Value, options); + continue; + } + if (property.NameEquals("resourceAccessIdentity"u8)) + { + resourceAccessIdentity = IdentityModel.DeserializeIdentityModel(property.Value, options); + continue; + } + if (property.NameEquals("isResponsive"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + isResponsive = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("lastHeartbeat"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + lastHeartbeat = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("versionNumber"u8)) + { + versionNumber = property.Value.GetString(); + continue; + } + if (property.NameEquals("provisioningState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + provisioningState = new ProvisioningState(property.Value.GetString()); + continue; + } + if (property.NameEquals("healthErrors"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(HealthErrorModel.DeserializeHealthErrorModel(item, options)); + } + healthErrors = array; + continue; + } + if (property.NameEquals("customProperties"u8)) + { + customProperties = FabricAgentModelCustomProperties.DeserializeFabricAgentModelCustomProperties(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new FabricAgentModelProperties( + correlationId, + machineId, + machineName, + authenticationIdentity, + resourceAccessIdentity, + isResponsive, + lastHeartbeat, + versionNumber, + provisioningState, + healthErrors ?? new ChangeTrackingList(), + customProperties, + 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(FabricAgentModelProperties)} does not support writing '{options.Format}' format."); + } + } + + FabricAgentModelProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeFabricAgentModelProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(FabricAgentModelProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/FabricAgentModelProperties.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/FabricAgentModelProperties.cs new file mode 100644 index 000000000000..53a829e4e5b6 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/FabricAgentModelProperties.cs @@ -0,0 +1,140 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + /// Fabric agent model properties. + public partial class FabricAgentModelProperties + { + /// + /// 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 . + /// Gets or sets the machine Id where fabric agent is running. + /// Gets or sets the machine name where fabric agent is running. + /// Identity model. + /// Identity model. + /// + /// Fabric agent model custom properties. + /// 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 . + /// + /// , , , or is null. + public FabricAgentModelProperties(string machineId, string machineName, IdentityModel authenticationIdentity, IdentityModel resourceAccessIdentity, FabricAgentModelCustomProperties customProperties) + { + Argument.AssertNotNull(machineId, nameof(machineId)); + Argument.AssertNotNull(machineName, nameof(machineName)); + Argument.AssertNotNull(authenticationIdentity, nameof(authenticationIdentity)); + Argument.AssertNotNull(resourceAccessIdentity, nameof(resourceAccessIdentity)); + Argument.AssertNotNull(customProperties, nameof(customProperties)); + + MachineId = machineId; + MachineName = machineName; + AuthenticationIdentity = authenticationIdentity; + ResourceAccessIdentity = resourceAccessIdentity; + HealthErrors = new ChangeTrackingList(); + CustomProperties = customProperties; + } + + /// Initializes a new instance of . + /// Gets or sets the fabric agent correlation Id. + /// Gets or sets the machine Id where fabric agent is running. + /// Gets or sets the machine name where fabric agent is running. + /// Identity model. + /// Identity model. + /// Gets or sets a value indicating whether the fabric agent is responsive. + /// Gets or sets the time when last heartbeat was sent by the fabric agent. + /// Gets or sets the fabric agent version. + /// Gets or sets the provisioning state of the fabric agent. + /// Gets or sets the list of health errors. + /// + /// Fabric agent model custom properties. + /// 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 FabricAgentModelProperties(string correlationId, string machineId, string machineName, IdentityModel authenticationIdentity, IdentityModel resourceAccessIdentity, bool? isResponsive, DateTimeOffset? lastHeartbeat, string versionNumber, ProvisioningState? provisioningState, IReadOnlyList healthErrors, FabricAgentModelCustomProperties customProperties, IDictionary serializedAdditionalRawData) + { + CorrelationId = correlationId; + MachineId = machineId; + MachineName = machineName; + AuthenticationIdentity = authenticationIdentity; + ResourceAccessIdentity = resourceAccessIdentity; + IsResponsive = isResponsive; + LastHeartbeat = lastHeartbeat; + VersionNumber = versionNumber; + ProvisioningState = provisioningState; + HealthErrors = healthErrors; + CustomProperties = customProperties; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal FabricAgentModelProperties() + { + } + + /// Gets or sets the fabric agent correlation Id. + public string CorrelationId { get; } + /// Gets or sets the machine Id where fabric agent is running. + public string MachineId { get; set; } + /// Gets or sets the machine name where fabric agent is running. + public string MachineName { get; set; } + /// Identity model. + public IdentityModel AuthenticationIdentity { get; set; } + /// Identity model. + public IdentityModel ResourceAccessIdentity { get; set; } + /// Gets or sets a value indicating whether the fabric agent is responsive. + public bool? IsResponsive { get; } + /// Gets or sets the time when last heartbeat was sent by the fabric agent. + public DateTimeOffset? LastHeartbeat { get; } + /// Gets or sets the fabric agent version. + public string VersionNumber { get; } + /// Gets or sets the provisioning state of the fabric agent. + public ProvisioningState? ProvisioningState { get; } + /// Gets or sets the list of health errors. + public IReadOnlyList HealthErrors { get; } + /// + /// Fabric agent model custom properties. + /// 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 FabricAgentModelCustomProperties CustomProperties { get; set; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/FabricModelCustomProperties.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/FabricModelCustomProperties.Serialization.cs new file mode 100644 index 000000000000..fc63ee1215d2 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/FabricModelCustomProperties.Serialization.cs @@ -0,0 +1,119 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + [PersistableModelProxy(typeof(UnknownFabricModelCustomProperties))] + public partial class FabricModelCustomProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(FabricModelCustomProperties)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("instanceType"u8); + writer.WriteStringValue(InstanceType); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + FabricModelCustomProperties 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(FabricModelCustomProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeFabricModelCustomProperties(document.RootElement, options); + } + + internal static FabricModelCustomProperties DeserializeFabricModelCustomProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + if (element.TryGetProperty("instanceType", out JsonElement discriminator)) + { + switch (discriminator.GetString()) + { + case "AzStackHCI": return AzStackHCIFabricModelCustomProperties.DeserializeAzStackHCIFabricModelCustomProperties(element, options); + case "HyperVMigrate": return HyperVMigrateFabricModelCustomProperties.DeserializeHyperVMigrateFabricModelCustomProperties(element, options); + case "VMwareMigrate": return VMwareMigrateFabricModelCustomProperties.DeserializeVMwareMigrateFabricModelCustomProperties(element, options); + } + } + return UnknownFabricModelCustomProperties.DeserializeUnknownFabricModelCustomProperties(element, options); + } + + 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(FabricModelCustomProperties)} does not support writing '{options.Format}' format."); + } + } + + FabricModelCustomProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeFabricModelCustomProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(FabricModelCustomProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/FabricModelCustomProperties.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/FabricModelCustomProperties.cs new file mode 100644 index 000000000000..3ce0beba8e3c --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/FabricModelCustomProperties.cs @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + /// + /// Fabric model custom properties. + /// 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 . + /// + public abstract partial class FabricModelCustomProperties + { + /// + /// 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 protected IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + protected FabricModelCustomProperties() + { + } + + /// Initializes a new instance of . + /// Discriminator property for FabricModelCustomProperties. + /// Keeps track of any properties unknown to the library. + internal FabricModelCustomProperties(string instanceType, IDictionary serializedAdditionalRawData) + { + InstanceType = instanceType; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Discriminator property for FabricModelCustomProperties. + internal string InstanceType { get; set; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/FabricModelListResult.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/FabricModelListResult.Serialization.cs new file mode 100644 index 000000000000..880569f6ba20 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/FabricModelListResult.Serialization.cs @@ -0,0 +1,151 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + internal partial class FabricModelListResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(FabricModelListResult)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var item in Value) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + if (Optional.IsDefined(NextLink)) + { + writer.WritePropertyName("nextLink"u8); + writer.WriteStringValue(NextLink.AbsoluteUri); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + FabricModelListResult 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(FabricModelListResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeFabricModelListResult(document.RootElement, options); + } + + internal static FabricModelListResult DeserializeFabricModelListResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IReadOnlyList value = default; + Uri nextLink = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(FabricModelData.DeserializeFabricModelData(item, options)); + } + value = array; + continue; + } + if (property.NameEquals("nextLink"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + nextLink = new Uri(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new FabricModelListResult(value, nextLink, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(FabricModelListResult)} does not support writing '{options.Format}' format."); + } + } + + FabricModelListResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeFabricModelListResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(FabricModelListResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/FabricModelListResult.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/FabricModelListResult.cs new file mode 100644 index 000000000000..6fdae6407c96 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/FabricModelListResult.cs @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + /// The response of a FabricModel list operation. + internal partial class FabricModelListResult + { + /// + /// 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 FabricModel items on this page. + /// is null. + internal FabricModelListResult(IEnumerable value) + { + Argument.AssertNotNull(value, nameof(value)); + + Value = value.ToList(); + } + + /// Initializes a new instance of . + /// The FabricModel items on this page. + /// The link to the next page of items. + /// Keeps track of any properties unknown to the library. + internal FabricModelListResult(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) + { + Value = value; + NextLink = nextLink; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal FabricModelListResult() + { + } + + /// The FabricModel items on this page. + public IReadOnlyList Value { get; } + /// The link to the next page of items. + public Uri NextLink { get; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/FabricModelPatch.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/FabricModelPatch.Serialization.cs new file mode 100644 index 000000000000..98aa3e4876a2 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/FabricModelPatch.Serialization.cs @@ -0,0 +1,181 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + public partial class FabricModelPatch : 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(FabricModelPatch)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (Optional.IsCollectionDefined(Tags)) + { + writer.WritePropertyName("tags"u8); + writer.WriteStartObject(); + foreach (var item in Tags) + { + writer.WritePropertyName(item.Key); + writer.WriteStringValue(item.Value); + } + writer.WriteEndObject(); + } + if (Optional.IsDefined(Properties)) + { + writer.WritePropertyName("properties"u8); + writer.WriteObjectValue(Properties, options); + } + } + + FabricModelPatch 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(FabricModelPatch)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeFabricModelPatch(document.RootElement, options); + } + + internal static FabricModelPatch DeserializeFabricModelPatch(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IDictionary tags = default; + FabricModelProperties 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("tags"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var property0 in property.Value.EnumerateObject()) + { + dictionary.Add(property0.Name, property0.Value.GetString()); + } + tags = dictionary; + continue; + } + if (property.NameEquals("properties"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + properties = FabricModelProperties.DeserializeFabricModelProperties(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 FabricModelPatch( + id, + name, + type, + systemData, + tags ?? new ChangeTrackingDictionary(), + 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(FabricModelPatch)} does not support writing '{options.Format}' format."); + } + } + + FabricModelPatch IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeFabricModelPatch(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(FabricModelPatch)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/FabricModelPatch.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/FabricModelPatch.cs new file mode 100644 index 000000000000..47f9fb872668 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/FabricModelPatch.cs @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + /// Fabric model update. + public partial class FabricModelPatch : 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 FabricModelPatch() + { + Tags = new ChangeTrackingDictionary(); + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// Gets or sets the resource tags. + /// Fabric model properties. + /// Keeps track of any properties unknown to the library. + internal FabricModelPatch(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, FabricModelProperties properties, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) + { + Tags = tags; + Properties = properties; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Gets or sets the resource tags. + public IDictionary Tags { get; } + /// Fabric model properties. + public FabricModelProperties Properties { get; set; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/FabricModelProperties.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/FabricModelProperties.Serialization.cs new file mode 100644 index 000000000000..bbc3b5af2c56 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/FabricModelProperties.Serialization.cs @@ -0,0 +1,210 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + public partial class FabricModelProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(FabricModelProperties)} does not support writing '{format}' format."); + } + + if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) + { + writer.WritePropertyName("provisioningState"u8); + writer.WriteStringValue(ProvisioningState.Value.ToString()); + } + if (options.Format != "W" && Optional.IsDefined(ServiceEndpoint)) + { + writer.WritePropertyName("serviceEndpoint"u8); + writer.WriteStringValue(ServiceEndpoint); + } + if (options.Format != "W" && Optional.IsDefined(ServiceResourceId)) + { + writer.WritePropertyName("serviceResourceId"u8); + writer.WriteStringValue(ServiceResourceId); + } + if (options.Format != "W" && Optional.IsDefined(Health)) + { + writer.WritePropertyName("health"u8); + writer.WriteStringValue(Health.Value.ToString()); + } + if (options.Format != "W" && Optional.IsCollectionDefined(HealthErrors)) + { + writer.WritePropertyName("healthErrors"u8); + writer.WriteStartArray(); + foreach (var item in HealthErrors) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + writer.WritePropertyName("customProperties"u8); + writer.WriteObjectValue(CustomProperties, options); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + FabricModelProperties 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(FabricModelProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeFabricModelProperties(document.RootElement, options); + } + + internal static FabricModelProperties DeserializeFabricModelProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ProvisioningState? provisioningState = default; + string serviceEndpoint = default; + string serviceResourceId = default; + HealthStatus? health = default; + IReadOnlyList healthErrors = default; + FabricModelCustomProperties customProperties = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("provisioningState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + provisioningState = new ProvisioningState(property.Value.GetString()); + continue; + } + if (property.NameEquals("serviceEndpoint"u8)) + { + serviceEndpoint = property.Value.GetString(); + continue; + } + if (property.NameEquals("serviceResourceId"u8)) + { + serviceResourceId = property.Value.GetString(); + continue; + } + if (property.NameEquals("health"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + health = new HealthStatus(property.Value.GetString()); + continue; + } + if (property.NameEquals("healthErrors"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(HealthErrorModel.DeserializeHealthErrorModel(item, options)); + } + healthErrors = array; + continue; + } + if (property.NameEquals("customProperties"u8)) + { + customProperties = FabricModelCustomProperties.DeserializeFabricModelCustomProperties(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new FabricModelProperties( + provisioningState, + serviceEndpoint, + serviceResourceId, + health, + healthErrors ?? new ChangeTrackingList(), + customProperties, + 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(FabricModelProperties)} does not support writing '{options.Format}' format."); + } + } + + FabricModelProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeFabricModelProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(FabricModelProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/FabricModelProperties.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/FabricModelProperties.cs new file mode 100644 index 000000000000..7385e9e691ff --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/FabricModelProperties.cs @@ -0,0 +1,108 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + /// Fabric model properties. + public partial class FabricModelProperties + { + /// + /// 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 . + /// + /// Fabric model custom properties. + /// 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 . + /// + /// is null. + public FabricModelProperties(FabricModelCustomProperties customProperties) + { + Argument.AssertNotNull(customProperties, nameof(customProperties)); + + HealthErrors = new ChangeTrackingList(); + CustomProperties = customProperties; + } + + /// Initializes a new instance of . + /// Gets or sets the provisioning state of the fabric. + /// Gets or sets the service endpoint. + /// Gets or sets the service resource Id. + /// Gets or sets the fabric health. + /// Gets or sets the list of health errors. + /// + /// Fabric model custom properties. + /// 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 . + /// + /// Keeps track of any properties unknown to the library. + internal FabricModelProperties(ProvisioningState? provisioningState, string serviceEndpoint, string serviceResourceId, HealthStatus? health, IReadOnlyList healthErrors, FabricModelCustomProperties customProperties, IDictionary serializedAdditionalRawData) + { + ProvisioningState = provisioningState; + ServiceEndpoint = serviceEndpoint; + ServiceResourceId = serviceResourceId; + Health = health; + HealthErrors = healthErrors; + CustomProperties = customProperties; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal FabricModelProperties() + { + } + + /// Gets or sets the provisioning state of the fabric. + public ProvisioningState? ProvisioningState { get; } + /// Gets or sets the service endpoint. + public string ServiceEndpoint { get; } + /// Gets or sets the service resource Id. + public string ServiceResourceId { get; } + /// Gets or sets the fabric health. + public HealthStatus? Health { get; } + /// Gets or sets the list of health errors. + public IReadOnlyList HealthErrors { get; } + /// + /// Fabric model custom properties. + /// 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 . + /// + public FabricModelCustomProperties CustomProperties { get; set; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/FailoverJobModelCustomProperties.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/FailoverJobModelCustomProperties.Serialization.cs new file mode 100644 index 000000000000..c51000443cb6 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/FailoverJobModelCustomProperties.Serialization.cs @@ -0,0 +1,145 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + public partial class FailoverJobModelCustomProperties : 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(FailoverJobModelCustomProperties)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (options.Format != "W" && Optional.IsCollectionDefined(ProtectedItemDetails)) + { + writer.WritePropertyName("protectedItemDetails"u8); + writer.WriteStartArray(); + foreach (var item in ProtectedItemDetails) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + } + + FailoverJobModelCustomProperties 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(FailoverJobModelCustomProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeFailoverJobModelCustomProperties(document.RootElement, options); + } + + internal static FailoverJobModelCustomProperties DeserializeFailoverJobModelCustomProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IReadOnlyList protectedItemDetails = default; + string instanceType = default; + JobModelCustomPropertiesAffectedObjectDetails affectedObjectDetails = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("protectedItemDetails"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(FailoverProtectedItemProperties.DeserializeFailoverProtectedItemProperties(item, options)); + } + protectedItemDetails = array; + continue; + } + if (property.NameEquals("instanceType"u8)) + { + instanceType = property.Value.GetString(); + continue; + } + if (property.NameEquals("affectedObjectDetails"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + affectedObjectDetails = JobModelCustomPropertiesAffectedObjectDetails.DeserializeJobModelCustomPropertiesAffectedObjectDetails(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new FailoverJobModelCustomProperties(instanceType, affectedObjectDetails, serializedAdditionalRawData, protectedItemDetails ?? new ChangeTrackingList()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(FailoverJobModelCustomProperties)} does not support writing '{options.Format}' format."); + } + } + + FailoverJobModelCustomProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeFailoverJobModelCustomProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(FailoverJobModelCustomProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/FailoverJobModelCustomProperties.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/FailoverJobModelCustomProperties.cs new file mode 100644 index 000000000000..816aea6bfb38 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/FailoverJobModelCustomProperties.cs @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + /// Failover job model custom properties. + public partial class FailoverJobModelCustomProperties : JobModelCustomProperties + { + /// Initializes a new instance of . + internal FailoverJobModelCustomProperties() + { + ProtectedItemDetails = new ChangeTrackingList(); + InstanceType = "FailoverJobDetails"; + } + + /// Initializes a new instance of . + /// Discriminator property for JobModelCustomProperties. + /// Gets or sets any custom properties of the affected object. + /// Keeps track of any properties unknown to the library. + /// Gets or sets the failed over protected item details. + internal FailoverJobModelCustomProperties(string instanceType, JobModelCustomPropertiesAffectedObjectDetails affectedObjectDetails, IDictionary serializedAdditionalRawData, IReadOnlyList protectedItemDetails) : base(instanceType, affectedObjectDetails, serializedAdditionalRawData) + { + ProtectedItemDetails = protectedItemDetails; + InstanceType = instanceType ?? "FailoverJobDetails"; + } + + /// Gets or sets the failed over protected item details. + public IReadOnlyList ProtectedItemDetails { get; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/FailoverProtectedItemProperties.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/FailoverProtectedItemProperties.Serialization.cs new file mode 100644 index 000000000000..a9b027d37c76 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/FailoverProtectedItemProperties.Serialization.cs @@ -0,0 +1,207 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + public partial class FailoverProtectedItemProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(FailoverProtectedItemProperties)} does not support writing '{format}' format."); + } + + if (options.Format != "W" && Optional.IsDefined(ProtectedItemName)) + { + writer.WritePropertyName("protectedItemName"u8); + writer.WriteStringValue(ProtectedItemName); + } + if (options.Format != "W" && Optional.IsDefined(VmName)) + { + writer.WritePropertyName("vmName"u8); + writer.WriteStringValue(VmName); + } + if (options.Format != "W" && Optional.IsDefined(TestVmName)) + { + writer.WritePropertyName("testVmName"u8); + writer.WriteStringValue(TestVmName); + } + if (options.Format != "W" && Optional.IsDefined(RecoveryPointId)) + { + writer.WritePropertyName("recoveryPointId"u8); + writer.WriteStringValue(RecoveryPointId); + } + if (options.Format != "W" && Optional.IsDefined(RecoveryPointOn)) + { + writer.WritePropertyName("recoveryPointTime"u8); + writer.WriteStringValue(RecoveryPointOn.Value, "O"); + } + if (options.Format != "W" && Optional.IsDefined(NetworkName)) + { + writer.WritePropertyName("networkName"u8); + writer.WriteStringValue(NetworkName); + } + if (options.Format != "W" && Optional.IsDefined(Subnet)) + { + writer.WritePropertyName("subnet"u8); + writer.WriteStringValue(Subnet); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + FailoverProtectedItemProperties 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(FailoverProtectedItemProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeFailoverProtectedItemProperties(document.RootElement, options); + } + + internal static FailoverProtectedItemProperties DeserializeFailoverProtectedItemProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string protectedItemName = default; + string vmName = default; + string testVmName = default; + string recoveryPointId = default; + DateTimeOffset? recoveryPointTime = default; + string networkName = default; + string subnet = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("protectedItemName"u8)) + { + protectedItemName = property.Value.GetString(); + continue; + } + if (property.NameEquals("vmName"u8)) + { + vmName = property.Value.GetString(); + continue; + } + if (property.NameEquals("testVmName"u8)) + { + testVmName = property.Value.GetString(); + continue; + } + if (property.NameEquals("recoveryPointId"u8)) + { + recoveryPointId = property.Value.GetString(); + continue; + } + if (property.NameEquals("recoveryPointTime"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + recoveryPointTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("networkName"u8)) + { + networkName = property.Value.GetString(); + continue; + } + if (property.NameEquals("subnet"u8)) + { + subnet = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new FailoverProtectedItemProperties( + protectedItemName, + vmName, + testVmName, + recoveryPointId, + recoveryPointTime, + networkName, + subnet, + 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(FailoverProtectedItemProperties)} does not support writing '{options.Format}' format."); + } + } + + FailoverProtectedItemProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeFailoverProtectedItemProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(FailoverProtectedItemProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/FailoverProtectedItemProperties.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/FailoverProtectedItemProperties.cs new file mode 100644 index 000000000000..ba5635ae92a1 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/FailoverProtectedItemProperties.cs @@ -0,0 +1,89 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + /// Failover properties of the protected item. + public partial class FailoverProtectedItemProperties + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + internal FailoverProtectedItemProperties() + { + } + + /// Initializes a new instance of . + /// Gets or sets the protected item name. + /// Gets or sets the VM name. + /// Gets or sets the test VM name. + /// Gets or sets the recovery point Id. + /// Gets or sets the recovery point time. + /// Gets or sets the network name. + /// Gets or sets the network subnet. + /// Keeps track of any properties unknown to the library. + internal FailoverProtectedItemProperties(string protectedItemName, string vmName, string testVmName, string recoveryPointId, DateTimeOffset? recoveryPointOn, string networkName, string subnet, IDictionary serializedAdditionalRawData) + { + ProtectedItemName = protectedItemName; + VmName = vmName; + TestVmName = testVmName; + RecoveryPointId = recoveryPointId; + RecoveryPointOn = recoveryPointOn; + NetworkName = networkName; + Subnet = subnet; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Gets or sets the protected item name. + public string ProtectedItemName { get; } + /// Gets or sets the VM name. + public string VmName { get; } + /// Gets or sets the test VM name. + public string TestVmName { get; } + /// Gets or sets the recovery point Id. + public string RecoveryPointId { get; } + /// Gets or sets the recovery point time. + public DateTimeOffset? RecoveryPointOn { get; } + /// Gets or sets the network name. + public string NetworkName { get; } + /// Gets or sets the network subnet. + public string Subnet { get; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/GroupConnectivityInformation.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/GroupConnectivityInformation.Serialization.cs new file mode 100644 index 000000000000..f1ccfe690431 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/GroupConnectivityInformation.Serialization.cs @@ -0,0 +1,205 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + public partial class GroupConnectivityInformation : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(GroupConnectivityInformation)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(GroupId)) + { + writer.WritePropertyName("groupId"u8); + writer.WriteStringValue(GroupId); + } + if (Optional.IsDefined(MemberName)) + { + writer.WritePropertyName("memberName"u8); + writer.WriteStringValue(MemberName); + } + if (Optional.IsCollectionDefined(CustomerVisibleFqdns)) + { + writer.WritePropertyName("customerVisibleFqdns"u8); + writer.WriteStartArray(); + foreach (var item in CustomerVisibleFqdns) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(InternalFqdn)) + { + writer.WritePropertyName("internalFqdn"u8); + writer.WriteStringValue(InternalFqdn); + } + if (Optional.IsDefined(RedirectMapId)) + { + writer.WritePropertyName("redirectMapId"u8); + writer.WriteStringValue(RedirectMapId); + } + if (Optional.IsDefined(PrivateLinkServiceArmRegion)) + { + writer.WritePropertyName("privateLinkServiceArmRegion"u8); + writer.WriteStringValue(PrivateLinkServiceArmRegion); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + GroupConnectivityInformation 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(GroupConnectivityInformation)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeGroupConnectivityInformation(document.RootElement, options); + } + + internal static GroupConnectivityInformation DeserializeGroupConnectivityInformation(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string groupId = default; + string memberName = default; + IList customerVisibleFqdns = default; + string internalFqdn = default; + string redirectMapId = default; + string privateLinkServiceArmRegion = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("groupId"u8)) + { + groupId = property.Value.GetString(); + continue; + } + if (property.NameEquals("memberName"u8)) + { + memberName = property.Value.GetString(); + continue; + } + if (property.NameEquals("customerVisibleFqdns"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + customerVisibleFqdns = array; + continue; + } + if (property.NameEquals("internalFqdn"u8)) + { + internalFqdn = property.Value.GetString(); + continue; + } + if (property.NameEquals("redirectMapId"u8)) + { + redirectMapId = property.Value.GetString(); + continue; + } + if (property.NameEquals("privateLinkServiceArmRegion"u8)) + { + privateLinkServiceArmRegion = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new GroupConnectivityInformation( + groupId, + memberName, + customerVisibleFqdns ?? new ChangeTrackingList(), + internalFqdn, + redirectMapId, + privateLinkServiceArmRegion, + 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(GroupConnectivityInformation)} does not support writing '{options.Format}' format."); + } + } + + GroupConnectivityInformation IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeGroupConnectivityInformation(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(GroupConnectivityInformation)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/GroupConnectivityInformation.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/GroupConnectivityInformation.cs new file mode 100644 index 000000000000..bc4ad49ffc23 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/GroupConnectivityInformation.cs @@ -0,0 +1,86 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + /// Represents of a connection's group information. + public partial class GroupConnectivityInformation + { + /// + /// 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 GroupConnectivityInformation() + { + CustomerVisibleFqdns = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// Gets or sets group id. + /// Gets or sets member name. + /// Gets or sets customer visible FQDNs. + /// Gets or sets Internal Fqdn. + /// Gets or sets the redirect map id. + /// Gets or sets the private link service arm region. + /// Keeps track of any properties unknown to the library. + internal GroupConnectivityInformation(string groupId, string memberName, IList customerVisibleFqdns, string internalFqdn, string redirectMapId, string privateLinkServiceArmRegion, IDictionary serializedAdditionalRawData) + { + GroupId = groupId; + MemberName = memberName; + CustomerVisibleFqdns = customerVisibleFqdns; + InternalFqdn = internalFqdn; + RedirectMapId = redirectMapId; + PrivateLinkServiceArmRegion = privateLinkServiceArmRegion; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Gets or sets group id. + public string GroupId { get; set; } + /// Gets or sets member name. + public string MemberName { get; set; } + /// Gets or sets customer visible FQDNs. + public IList CustomerVisibleFqdns { get; } + /// Gets or sets Internal Fqdn. + public string InternalFqdn { get; set; } + /// Gets or sets the redirect map id. + public string RedirectMapId { get; set; } + /// Gets or sets the private link service arm region. + public string PrivateLinkServiceArmRegion { get; set; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/HealthErrorModel.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/HealthErrorModel.Serialization.cs new file mode 100644 index 000000000000..15ad13c76eb2 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/HealthErrorModel.Serialization.cs @@ -0,0 +1,323 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + public partial class HealthErrorModel : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(HealthErrorModel)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(AffectedResourceType)) + { + writer.WritePropertyName("affectedResourceType"u8); + writer.WriteStringValue(AffectedResourceType); + } + if (Optional.IsCollectionDefined(AffectedResourceCorrelationIds)) + { + writer.WritePropertyName("affectedResourceCorrelationIds"u8); + writer.WriteStartArray(); + foreach (var item in AffectedResourceCorrelationIds) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(ChildErrors)) + { + writer.WritePropertyName("childErrors"u8); + writer.WriteStartArray(); + foreach (var item in ChildErrors) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && Optional.IsDefined(Code)) + { + writer.WritePropertyName("code"u8); + writer.WriteStringValue(Code); + } + if (options.Format != "W" && Optional.IsDefined(HealthCategory)) + { + writer.WritePropertyName("healthCategory"u8); + writer.WriteStringValue(HealthCategory); + } + if (options.Format != "W" && Optional.IsDefined(Category)) + { + writer.WritePropertyName("category"u8); + writer.WriteStringValue(Category); + } + if (options.Format != "W" && Optional.IsDefined(Severity)) + { + writer.WritePropertyName("severity"u8); + writer.WriteStringValue(Severity); + } + if (options.Format != "W" && Optional.IsDefined(Source)) + { + writer.WritePropertyName("source"u8); + writer.WriteStringValue(Source); + } + if (options.Format != "W" && Optional.IsDefined(CreatedOn)) + { + writer.WritePropertyName("creationTime"u8); + writer.WriteStringValue(CreatedOn.Value, "O"); + } + if (options.Format != "W" && Optional.IsDefined(IsCustomerResolvable)) + { + writer.WritePropertyName("isCustomerResolvable"u8); + writer.WriteBooleanValue(IsCustomerResolvable.Value); + } + if (options.Format != "W" && Optional.IsDefined(Summary)) + { + writer.WritePropertyName("summary"u8); + writer.WriteStringValue(Summary); + } + if (options.Format != "W" && Optional.IsDefined(Message)) + { + writer.WritePropertyName("message"u8); + writer.WriteStringValue(Message); + } + if (options.Format != "W" && Optional.IsDefined(Causes)) + { + writer.WritePropertyName("causes"u8); + writer.WriteStringValue(Causes); + } + if (options.Format != "W" && Optional.IsDefined(Recommendation)) + { + writer.WritePropertyName("recommendation"u8); + writer.WriteStringValue(Recommendation); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + HealthErrorModel 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(HealthErrorModel)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeHealthErrorModel(document.RootElement, options); + } + + internal static HealthErrorModel DeserializeHealthErrorModel(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string affectedResourceType = default; + IReadOnlyList affectedResourceCorrelationIds = default; + IReadOnlyList childErrors = default; + string code = default; + string healthCategory = default; + string category = default; + string severity = default; + string source = default; + DateTimeOffset? creationTime = default; + bool? isCustomerResolvable = default; + string summary = default; + string message = default; + string causes = default; + string recommendation = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("affectedResourceType"u8)) + { + affectedResourceType = property.Value.GetString(); + continue; + } + if (property.NameEquals("affectedResourceCorrelationIds"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + affectedResourceCorrelationIds = array; + continue; + } + if (property.NameEquals("childErrors"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(InnerHealthErrorModel.DeserializeInnerHealthErrorModel(item, options)); + } + childErrors = array; + continue; + } + if (property.NameEquals("code"u8)) + { + code = property.Value.GetString(); + continue; + } + if (property.NameEquals("healthCategory"u8)) + { + healthCategory = property.Value.GetString(); + continue; + } + if (property.NameEquals("category"u8)) + { + category = property.Value.GetString(); + continue; + } + if (property.NameEquals("severity"u8)) + { + severity = property.Value.GetString(); + continue; + } + if (property.NameEquals("source"u8)) + { + source = property.Value.GetString(); + continue; + } + if (property.NameEquals("creationTime"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + creationTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("isCustomerResolvable"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + isCustomerResolvable = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("summary"u8)) + { + summary = property.Value.GetString(); + continue; + } + if (property.NameEquals("message"u8)) + { + message = property.Value.GetString(); + continue; + } + if (property.NameEquals("causes"u8)) + { + causes = property.Value.GetString(); + continue; + } + if (property.NameEquals("recommendation"u8)) + { + recommendation = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new HealthErrorModel( + affectedResourceType, + affectedResourceCorrelationIds ?? new ChangeTrackingList(), + childErrors ?? new ChangeTrackingList(), + code, + healthCategory, + category, + severity, + source, + creationTime, + isCustomerResolvable, + summary, + message, + causes, + recommendation, + 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(HealthErrorModel)} does not support writing '{options.Format}' format."); + } + } + + HealthErrorModel IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeHealthErrorModel(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(HealthErrorModel)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/HealthErrorModel.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/HealthErrorModel.cs new file mode 100644 index 000000000000..001042828b86 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/HealthErrorModel.cs @@ -0,0 +1,119 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + /// Health error model. + public partial class HealthErrorModel + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + internal HealthErrorModel() + { + AffectedResourceCorrelationIds = new ChangeTrackingList(); + ChildErrors = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// Gets or sets the type of affected resource type. + /// Gets or sets the list of affected resource correlation Ids. This can be used to uniquely identify the count of items affected by a specific category and severity as well as count of item affected by an specific issue. + /// Gets or sets a list of child health errors associated with this error. + /// Gets or sets the error code. + /// Gets or sets the health category. + /// Gets or sets the error category. + /// Gets or sets the error severity. + /// Gets or sets the error source. + /// Gets or sets the error creation time. + /// Gets or sets a value indicating whether the error is customer resolvable. + /// Gets or sets the error summary. + /// Gets or sets the error message. + /// Gets or sets possible causes of the error. + /// Gets or sets recommended action to resolve the error. + /// Keeps track of any properties unknown to the library. + internal HealthErrorModel(string affectedResourceType, IReadOnlyList affectedResourceCorrelationIds, IReadOnlyList childErrors, string code, string healthCategory, string category, string severity, string source, DateTimeOffset? createdOn, bool? isCustomerResolvable, string summary, string message, string causes, string recommendation, IDictionary serializedAdditionalRawData) + { + AffectedResourceType = affectedResourceType; + AffectedResourceCorrelationIds = affectedResourceCorrelationIds; + ChildErrors = childErrors; + Code = code; + HealthCategory = healthCategory; + Category = category; + Severity = severity; + Source = source; + CreatedOn = createdOn; + IsCustomerResolvable = isCustomerResolvable; + Summary = summary; + Message = message; + Causes = causes; + Recommendation = recommendation; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Gets or sets the type of affected resource type. + public string AffectedResourceType { get; } + /// Gets or sets the list of affected resource correlation Ids. This can be used to uniquely identify the count of items affected by a specific category and severity as well as count of item affected by an specific issue. + public IReadOnlyList AffectedResourceCorrelationIds { get; } + /// Gets or sets a list of child health errors associated with this error. + public IReadOnlyList ChildErrors { get; } + /// Gets or sets the error code. + public string Code { get; } + /// Gets or sets the health category. + public string HealthCategory { get; } + /// Gets or sets the error category. + public string Category { get; } + /// Gets or sets the error severity. + public string Severity { get; } + /// Gets or sets the error source. + public string Source { get; } + /// Gets or sets the error creation time. + public DateTimeOffset? CreatedOn { get; } + /// Gets or sets a value indicating whether the error is customer resolvable. + public bool? IsCustomerResolvable { get; } + /// Gets or sets the error summary. + public string Summary { get; } + /// Gets or sets the error message. + public string Message { get; } + /// Gets or sets possible causes of the error. + public string Causes { get; } + /// Gets or sets recommended action to resolve the error. + public string Recommendation { get; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/HealthStatus.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/HealthStatus.cs new file mode 100644 index 000000000000..b041f126b9d2 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/HealthStatus.cs @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + /// Gets or sets the fabric health. + public readonly partial struct HealthStatus : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public HealthStatus(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string NormalValue = "Normal"; + private const string WarningValue = "Warning"; + private const string CriticalValue = "Critical"; + + /// Healthy Status. + public static HealthStatus Normal { get; } = new HealthStatus(NormalValue); + /// Warning Status. + public static HealthStatus Warning { get; } = new HealthStatus(WarningValue); + /// Critical Status. + public static HealthStatus Critical { get; } = new HealthStatus(CriticalValue); + /// Determines if two values are the same. + public static bool operator ==(HealthStatus left, HealthStatus right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(HealthStatus left, HealthStatus right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator HealthStatus(string value) => new HealthStatus(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is HealthStatus other && Equals(other); + /// + public bool Equals(HealthStatus other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/HyperVMigrateFabricModelCustomProperties.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/HyperVMigrateFabricModelCustomProperties.Serialization.cs new file mode 100644 index 000000000000..59476c091781 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/HyperVMigrateFabricModelCustomProperties.Serialization.cs @@ -0,0 +1,166 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + public partial class HyperVMigrateFabricModelCustomProperties : 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(HyperVMigrateFabricModelCustomProperties)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + writer.WritePropertyName("hyperVSiteId"u8); + writer.WriteStringValue(HyperVSiteId); + if (options.Format != "W" && Optional.IsDefined(FabricResourceId)) + { + writer.WritePropertyName("fabricResourceId"u8); + writer.WriteStringValue(FabricResourceId); + } + if (options.Format != "W" && Optional.IsDefined(FabricContainerId)) + { + writer.WritePropertyName("fabricContainerId"u8); + writer.WriteStringValue(FabricContainerId); + } + writer.WritePropertyName("migrationSolutionId"u8); + writer.WriteStringValue(MigrationSolutionId); + if (options.Format != "W" && Optional.IsDefined(MigrationHubUri)) + { + writer.WritePropertyName("migrationHubUri"u8); + writer.WriteStringValue(MigrationHubUri); + } + } + + HyperVMigrateFabricModelCustomProperties 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(HyperVMigrateFabricModelCustomProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeHyperVMigrateFabricModelCustomProperties(document.RootElement, options); + } + + internal static HyperVMigrateFabricModelCustomProperties DeserializeHyperVMigrateFabricModelCustomProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string hyperVSiteId = default; + string fabricResourceId = default; + string fabricContainerId = default; + string migrationSolutionId = default; + string migrationHubUri = default; + string instanceType = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("hyperVSiteId"u8)) + { + hyperVSiteId = property.Value.GetString(); + continue; + } + if (property.NameEquals("fabricResourceId"u8)) + { + fabricResourceId = property.Value.GetString(); + continue; + } + if (property.NameEquals("fabricContainerId"u8)) + { + fabricContainerId = property.Value.GetString(); + continue; + } + if (property.NameEquals("migrationSolutionId"u8)) + { + migrationSolutionId = property.Value.GetString(); + continue; + } + if (property.NameEquals("migrationHubUri"u8)) + { + migrationHubUri = property.Value.GetString(); + continue; + } + if (property.NameEquals("instanceType"u8)) + { + instanceType = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new HyperVMigrateFabricModelCustomProperties( + instanceType, + serializedAdditionalRawData, + hyperVSiteId, + fabricResourceId, + fabricContainerId, + migrationSolutionId, + migrationHubUri); + } + + 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(HyperVMigrateFabricModelCustomProperties)} does not support writing '{options.Format}' format."); + } + } + + HyperVMigrateFabricModelCustomProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeHyperVMigrateFabricModelCustomProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(HyperVMigrateFabricModelCustomProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/HyperVMigrateFabricModelCustomProperties.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/HyperVMigrateFabricModelCustomProperties.cs new file mode 100644 index 000000000000..6ffdc3ab394d --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/HyperVMigrateFabricModelCustomProperties.cs @@ -0,0 +1,64 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + /// HyperV migrate fabric model custom properties. + public partial class HyperVMigrateFabricModelCustomProperties : FabricModelCustomProperties + { + /// Initializes a new instance of . + /// Gets or sets the ARM Id of the HyperV site. + /// Gets or sets the migration solution ARM Id. + /// or is null. + public HyperVMigrateFabricModelCustomProperties(string hyperVSiteId, string migrationSolutionId) + { + Argument.AssertNotNull(hyperVSiteId, nameof(hyperVSiteId)); + Argument.AssertNotNull(migrationSolutionId, nameof(migrationSolutionId)); + + HyperVSiteId = hyperVSiteId; + MigrationSolutionId = migrationSolutionId; + InstanceType = "HyperVMigrate"; + } + + /// Initializes a new instance of . + /// Discriminator property for FabricModelCustomProperties. + /// Keeps track of any properties unknown to the library. + /// Gets or sets the ARM Id of the HyperV site. + /// Gets or sets the fabric resource Id. + /// Gets or sets the fabric container Id. + /// Gets or sets the migration solution ARM Id. + /// Gets or sets the migration hub Uri. + internal HyperVMigrateFabricModelCustomProperties(string instanceType, IDictionary serializedAdditionalRawData, string hyperVSiteId, string fabricResourceId, string fabricContainerId, string migrationSolutionId, string migrationHubUri) : base(instanceType, serializedAdditionalRawData) + { + HyperVSiteId = hyperVSiteId; + FabricResourceId = fabricResourceId; + FabricContainerId = fabricContainerId; + MigrationSolutionId = migrationSolutionId; + MigrationHubUri = migrationHubUri; + InstanceType = instanceType ?? "HyperVMigrate"; + } + + /// Initializes a new instance of for deserialization. + internal HyperVMigrateFabricModelCustomProperties() + { + } + + /// Gets or sets the ARM Id of the HyperV site. + public string HyperVSiteId { get; set; } + /// Gets or sets the fabric resource Id. + public string FabricResourceId { get; } + /// Gets or sets the fabric container Id. + public string FabricContainerId { get; } + /// Gets or sets the migration solution ARM Id. + public string MigrationSolutionId { get; set; } + /// Gets or sets the migration hub Uri. + public string MigrationHubUri { get; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/HyperVToAzStackHCIDiskInput.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/HyperVToAzStackHCIDiskInput.Serialization.cs new file mode 100644 index 000000000000..28c679ff3ffb --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/HyperVToAzStackHCIDiskInput.Serialization.cs @@ -0,0 +1,259 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + public partial class HyperVToAzStackHCIDiskInput : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(HyperVToAzStackHCIDiskInput)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("diskId"u8); + writer.WriteStringValue(DiskId); + if (Optional.IsDefined(StorageContainerId)) + { + writer.WritePropertyName("storageContainerId"u8); + writer.WriteStringValue(StorageContainerId); + } + if (Optional.IsDefined(IsDynamic)) + { + writer.WritePropertyName("isDynamic"u8); + writer.WriteBooleanValue(IsDynamic.Value); + } + writer.WritePropertyName("diskSizeGB"u8); + writer.WriteNumberValue(DiskSizeGB); + writer.WritePropertyName("diskFileFormat"u8); + writer.WriteStringValue(DiskFileFormat); + writer.WritePropertyName("isOsDisk"u8); + writer.WriteBooleanValue(IsOSDisk); + if (Optional.IsDefined(DiskBlockSize)) + { + writer.WritePropertyName("diskBlockSize"u8); + writer.WriteNumberValue(DiskBlockSize.Value); + } + if (Optional.IsDefined(DiskLogicalSectorSize)) + { + writer.WritePropertyName("diskLogicalSectorSize"u8); + writer.WriteNumberValue(DiskLogicalSectorSize.Value); + } + if (Optional.IsDefined(DiskPhysicalSectorSize)) + { + writer.WritePropertyName("diskPhysicalSectorSize"u8); + writer.WriteNumberValue(DiskPhysicalSectorSize.Value); + } + if (Optional.IsDefined(DiskIdentifier)) + { + writer.WritePropertyName("diskIdentifier"u8); + writer.WriteStringValue(DiskIdentifier); + } + if (Optional.IsDefined(DiskController)) + { + writer.WritePropertyName("diskController"u8); + writer.WriteObjectValue(DiskController, options); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + HyperVToAzStackHCIDiskInput 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(HyperVToAzStackHCIDiskInput)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeHyperVToAzStackHCIDiskInput(document.RootElement, options); + } + + internal static HyperVToAzStackHCIDiskInput DeserializeHyperVToAzStackHCIDiskInput(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string diskId = default; + string storageContainerId = default; + bool? isDynamic = default; + long diskSizeGB = default; + string diskFileFormat = default; + bool isOSDisk = default; + long? diskBlockSize = default; + long? diskLogicalSectorSize = default; + long? diskPhysicalSectorSize = default; + string diskIdentifier = default; + DiskControllerInputs diskController = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("diskId"u8)) + { + diskId = property.Value.GetString(); + continue; + } + if (property.NameEquals("storageContainerId"u8)) + { + storageContainerId = property.Value.GetString(); + continue; + } + if (property.NameEquals("isDynamic"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + isDynamic = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("diskSizeGB"u8)) + { + diskSizeGB = property.Value.GetInt64(); + continue; + } + if (property.NameEquals("diskFileFormat"u8)) + { + diskFileFormat = property.Value.GetString(); + continue; + } + if (property.NameEquals("isOsDisk"u8)) + { + isOSDisk = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("diskBlockSize"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + diskBlockSize = property.Value.GetInt64(); + continue; + } + if (property.NameEquals("diskLogicalSectorSize"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + diskLogicalSectorSize = property.Value.GetInt64(); + continue; + } + if (property.NameEquals("diskPhysicalSectorSize"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + diskPhysicalSectorSize = property.Value.GetInt64(); + continue; + } + if (property.NameEquals("diskIdentifier"u8)) + { + diskIdentifier = property.Value.GetString(); + continue; + } + if (property.NameEquals("diskController"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + diskController = DiskControllerInputs.DeserializeDiskControllerInputs(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new HyperVToAzStackHCIDiskInput( + diskId, + storageContainerId, + isDynamic, + diskSizeGB, + diskFileFormat, + isOSDisk, + diskBlockSize, + diskLogicalSectorSize, + diskPhysicalSectorSize, + diskIdentifier, + diskController, + 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(HyperVToAzStackHCIDiskInput)} does not support writing '{options.Format}' format."); + } + } + + HyperVToAzStackHCIDiskInput IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeHyperVToAzStackHCIDiskInput(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(HyperVToAzStackHCIDiskInput)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/HyperVToAzStackHCIDiskInput.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/HyperVToAzStackHCIDiskInput.cs new file mode 100644 index 000000000000..914001918502 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/HyperVToAzStackHCIDiskInput.cs @@ -0,0 +1,122 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + /// HyperVToAzStack disk input. + public partial class HyperVToAzStackHCIDiskInput + { + /// + /// 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 . + /// Gets or sets the disk Id. + /// Gets or sets the disk size in GB. + /// Gets or sets the type of the virtual hard disk, vhd or vhdx. + /// Gets or sets a value indicating whether disk is os disk. + /// or is null. + public HyperVToAzStackHCIDiskInput(string diskId, long diskSizeGB, string diskFileFormat, bool isOSDisk) + { + Argument.AssertNotNull(diskId, nameof(diskId)); + Argument.AssertNotNull(diskFileFormat, nameof(diskFileFormat)); + + DiskId = diskId; + DiskSizeGB = diskSizeGB; + DiskFileFormat = diskFileFormat; + IsOSDisk = isOSDisk; + } + + /// Initializes a new instance of . + /// Gets or sets the disk Id. + /// Gets or sets the target storage account ARM Id. + /// Gets or sets a value indicating whether dynamic sizing is enabled on the virtual hard disk. + /// Gets or sets the disk size in GB. + /// Gets or sets the type of the virtual hard disk, vhd or vhdx. + /// Gets or sets a value indicating whether disk is os disk. + /// Gets or sets a value of disk block size. + /// Gets or sets a value of disk logical sector size. + /// Gets or sets a value of disk physical sector size. + /// Gets or sets a value of disk identifier. + /// Disk controller. + /// Keeps track of any properties unknown to the library. + internal HyperVToAzStackHCIDiskInput(string diskId, string storageContainerId, bool? isDynamic, long diskSizeGB, string diskFileFormat, bool isOSDisk, long? diskBlockSize, long? diskLogicalSectorSize, long? diskPhysicalSectorSize, string diskIdentifier, DiskControllerInputs diskController, IDictionary serializedAdditionalRawData) + { + DiskId = diskId; + StorageContainerId = storageContainerId; + IsDynamic = isDynamic; + DiskSizeGB = diskSizeGB; + DiskFileFormat = diskFileFormat; + IsOSDisk = isOSDisk; + DiskBlockSize = diskBlockSize; + DiskLogicalSectorSize = diskLogicalSectorSize; + DiskPhysicalSectorSize = diskPhysicalSectorSize; + DiskIdentifier = diskIdentifier; + DiskController = diskController; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal HyperVToAzStackHCIDiskInput() + { + } + + /// Gets or sets the disk Id. + public string DiskId { get; set; } + /// Gets or sets the target storage account ARM Id. + public string StorageContainerId { get; set; } + /// Gets or sets a value indicating whether dynamic sizing is enabled on the virtual hard disk. + public bool? IsDynamic { get; set; } + /// Gets or sets the disk size in GB. + public long DiskSizeGB { get; set; } + /// Gets or sets the type of the virtual hard disk, vhd or vhdx. + public string DiskFileFormat { get; set; } + /// Gets or sets a value indicating whether disk is os disk. + public bool IsOSDisk { get; set; } + /// Gets or sets a value of disk block size. + public long? DiskBlockSize { get; set; } + /// Gets or sets a value of disk logical sector size. + public long? DiskLogicalSectorSize { get; set; } + /// Gets or sets a value of disk physical sector size. + public long? DiskPhysicalSectorSize { get; set; } + /// Gets or sets a value of disk identifier. + public string DiskIdentifier { get; set; } + /// Disk controller. + public DiskControllerInputs DiskController { get; set; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/HyperVToAzStackHCIEventModelCustomProperties.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/HyperVToAzStackHCIEventModelCustomProperties.Serialization.cs new file mode 100644 index 000000000000..d567ad3bd22e --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/HyperVToAzStackHCIEventModelCustomProperties.Serialization.cs @@ -0,0 +1,172 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + public partial class HyperVToAzStackHCIEventModelCustomProperties : 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(HyperVToAzStackHCIEventModelCustomProperties)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (options.Format != "W" && Optional.IsDefined(EventSourceFriendlyName)) + { + writer.WritePropertyName("eventSourceFriendlyName"u8); + writer.WriteStringValue(EventSourceFriendlyName); + } + if (options.Format != "W" && Optional.IsDefined(ProtectedItemFriendlyName)) + { + writer.WritePropertyName("protectedItemFriendlyName"u8); + writer.WriteStringValue(ProtectedItemFriendlyName); + } + if (options.Format != "W" && Optional.IsDefined(SourceApplianceName)) + { + writer.WritePropertyName("sourceApplianceName"u8); + writer.WriteStringValue(SourceApplianceName); + } + if (options.Format != "W" && Optional.IsDefined(TargetApplianceName)) + { + writer.WritePropertyName("targetApplianceName"u8); + writer.WriteStringValue(TargetApplianceName); + } + if (options.Format != "W" && Optional.IsDefined(ServerType)) + { + writer.WritePropertyName("serverType"u8); + writer.WriteStringValue(ServerType); + } + } + + HyperVToAzStackHCIEventModelCustomProperties 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(HyperVToAzStackHCIEventModelCustomProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeHyperVToAzStackHCIEventModelCustomProperties(document.RootElement, options); + } + + internal static HyperVToAzStackHCIEventModelCustomProperties DeserializeHyperVToAzStackHCIEventModelCustomProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string eventSourceFriendlyName = default; + string protectedItemFriendlyName = default; + string sourceApplianceName = default; + string targetApplianceName = default; + string serverType = default; + string instanceType = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("eventSourceFriendlyName"u8)) + { + eventSourceFriendlyName = property.Value.GetString(); + continue; + } + if (property.NameEquals("protectedItemFriendlyName"u8)) + { + protectedItemFriendlyName = property.Value.GetString(); + continue; + } + if (property.NameEquals("sourceApplianceName"u8)) + { + sourceApplianceName = property.Value.GetString(); + continue; + } + if (property.NameEquals("targetApplianceName"u8)) + { + targetApplianceName = property.Value.GetString(); + continue; + } + if (property.NameEquals("serverType"u8)) + { + serverType = property.Value.GetString(); + continue; + } + if (property.NameEquals("instanceType"u8)) + { + instanceType = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new HyperVToAzStackHCIEventModelCustomProperties( + instanceType, + serializedAdditionalRawData, + eventSourceFriendlyName, + protectedItemFriendlyName, + sourceApplianceName, + targetApplianceName, + serverType); + } + + 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(HyperVToAzStackHCIEventModelCustomProperties)} does not support writing '{options.Format}' format."); + } + } + + HyperVToAzStackHCIEventModelCustomProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeHyperVToAzStackHCIEventModelCustomProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(HyperVToAzStackHCIEventModelCustomProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/HyperVToAzStackHCIEventModelCustomProperties.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/HyperVToAzStackHCIEventModelCustomProperties.cs new file mode 100644 index 000000000000..8bf4c5bc4125 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/HyperVToAzStackHCIEventModelCustomProperties.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + /// HyperV to AzStackHCI event model custom properties. This class provides provider specific details for events of type DataContract.HealthEvents.HealthEventType.ProtectedItemHealth and DataContract.HealthEvents.HealthEventType.AgentHealth. + public partial class HyperVToAzStackHCIEventModelCustomProperties : EventModelCustomProperties + { + /// Initializes a new instance of . + internal HyperVToAzStackHCIEventModelCustomProperties() + { + InstanceType = "HyperVToAzStackHCI"; + } + + /// Initializes a new instance of . + /// Discriminator property for EventModelCustomProperties. + /// Keeps track of any properties unknown to the library. + /// Gets or sets the friendly name of the source which has raised this health event. + /// Gets or sets the protected item friendly name. + /// Gets or sets the source appliance name. + /// Gets or sets the source target name. + /// Gets or sets the server type. + internal HyperVToAzStackHCIEventModelCustomProperties(string instanceType, IDictionary serializedAdditionalRawData, string eventSourceFriendlyName, string protectedItemFriendlyName, string sourceApplianceName, string targetApplianceName, string serverType) : base(instanceType, serializedAdditionalRawData) + { + EventSourceFriendlyName = eventSourceFriendlyName; + ProtectedItemFriendlyName = protectedItemFriendlyName; + SourceApplianceName = sourceApplianceName; + TargetApplianceName = targetApplianceName; + ServerType = serverType; + InstanceType = instanceType ?? "HyperVToAzStackHCI"; + } + + /// Gets or sets the friendly name of the source which has raised this health event. + public string EventSourceFriendlyName { get; } + /// Gets or sets the protected item friendly name. + public string ProtectedItemFriendlyName { get; } + /// Gets or sets the source appliance name. + public string SourceApplianceName { get; } + /// Gets or sets the source target name. + public string TargetApplianceName { get; } + /// Gets or sets the server type. + public string ServerType { get; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/HyperVToAzStackHCINicInput.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/HyperVToAzStackHCINicInput.Serialization.cs new file mode 100644 index 000000000000..a53c80fa1c75 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/HyperVToAzStackHCINicInput.Serialization.cs @@ -0,0 +1,205 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + public partial class HyperVToAzStackHCINicInput : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(HyperVToAzStackHCINicInput)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("nicId"u8); + writer.WriteStringValue(NicId); + if (options.Format != "W" && Optional.IsDefined(NetworkName)) + { + writer.WritePropertyName("networkName"u8); + writer.WriteStringValue(NetworkName); + } + if (Optional.IsDefined(TargetNetworkId)) + { + writer.WritePropertyName("targetNetworkId"u8); + writer.WriteStringValue(TargetNetworkId); + } + if (Optional.IsDefined(TestNetworkId)) + { + writer.WritePropertyName("testNetworkId"u8); + writer.WriteStringValue(TestNetworkId); + } + writer.WritePropertyName("selectionTypeForFailover"u8); + writer.WriteStringValue(SelectionTypeForFailover.ToString()); + if (Optional.IsDefined(IsStaticIPMigrationEnabled)) + { + writer.WritePropertyName("isStaticIpMigrationEnabled"u8); + writer.WriteBooleanValue(IsStaticIPMigrationEnabled.Value); + } + if (Optional.IsDefined(IsMacMigrationEnabled)) + { + writer.WritePropertyName("isMacMigrationEnabled"u8); + writer.WriteBooleanValue(IsMacMigrationEnabled.Value); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + HyperVToAzStackHCINicInput 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(HyperVToAzStackHCINicInput)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeHyperVToAzStackHCINicInput(document.RootElement, options); + } + + internal static HyperVToAzStackHCINicInput DeserializeHyperVToAzStackHCINicInput(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string nicId = default; + string networkName = default; + string targetNetworkId = default; + string testNetworkId = default; + VmNicSelection selectionTypeForFailover = default; + bool? isStaticIPMigrationEnabled = default; + bool? isMacMigrationEnabled = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("nicId"u8)) + { + nicId = property.Value.GetString(); + continue; + } + if (property.NameEquals("networkName"u8)) + { + networkName = property.Value.GetString(); + continue; + } + if (property.NameEquals("targetNetworkId"u8)) + { + targetNetworkId = property.Value.GetString(); + continue; + } + if (property.NameEquals("testNetworkId"u8)) + { + testNetworkId = property.Value.GetString(); + continue; + } + if (property.NameEquals("selectionTypeForFailover"u8)) + { + selectionTypeForFailover = new VmNicSelection(property.Value.GetString()); + continue; + } + if (property.NameEquals("isStaticIpMigrationEnabled"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + isStaticIPMigrationEnabled = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("isMacMigrationEnabled"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + isMacMigrationEnabled = property.Value.GetBoolean(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new HyperVToAzStackHCINicInput( + nicId, + networkName, + targetNetworkId, + testNetworkId, + selectionTypeForFailover, + isStaticIPMigrationEnabled, + isMacMigrationEnabled, + 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(HyperVToAzStackHCINicInput)} does not support writing '{options.Format}' format."); + } + } + + HyperVToAzStackHCINicInput IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeHyperVToAzStackHCINicInput(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(HyperVToAzStackHCINicInput)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/HyperVToAzStackHCINicInput.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/HyperVToAzStackHCINicInput.cs new file mode 100644 index 000000000000..a9d606924290 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/HyperVToAzStackHCINicInput.cs @@ -0,0 +1,101 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + /// HyperVToAzStackHCI NIC properties. + public partial class HyperVToAzStackHCINicInput + { + /// + /// 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 . + /// Gets or sets the NIC Id. + /// Gets or sets the selection type of the NIC. + /// is null. + public HyperVToAzStackHCINicInput(string nicId, VmNicSelection selectionTypeForFailover) + { + Argument.AssertNotNull(nicId, nameof(nicId)); + + NicId = nicId; + SelectionTypeForFailover = selectionTypeForFailover; + } + + /// Initializes a new instance of . + /// Gets or sets the NIC Id. + /// Gets or sets the network name. + /// Gets or sets the target network Id within AzStackHCI Cluster. + /// Gets or sets the target test network Id within AzStackHCI Cluster. + /// Gets or sets the selection type of the NIC. + /// Gets or sets a value indicating whether static ip migration is enabled. + /// Gets or sets a value indicating whether mac address migration is enabled. + /// Keeps track of any properties unknown to the library. + internal HyperVToAzStackHCINicInput(string nicId, string networkName, string targetNetworkId, string testNetworkId, VmNicSelection selectionTypeForFailover, bool? isStaticIPMigrationEnabled, bool? isMacMigrationEnabled, IDictionary serializedAdditionalRawData) + { + NicId = nicId; + NetworkName = networkName; + TargetNetworkId = targetNetworkId; + TestNetworkId = testNetworkId; + SelectionTypeForFailover = selectionTypeForFailover; + IsStaticIPMigrationEnabled = isStaticIPMigrationEnabled; + IsMacMigrationEnabled = isMacMigrationEnabled; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal HyperVToAzStackHCINicInput() + { + } + + /// Gets or sets the NIC Id. + public string NicId { get; set; } + /// Gets or sets the network name. + public string NetworkName { get; } + /// Gets or sets the target network Id within AzStackHCI Cluster. + public string TargetNetworkId { get; set; } + /// Gets or sets the target test network Id within AzStackHCI Cluster. + public string TestNetworkId { get; set; } + /// Gets or sets the selection type of the NIC. + public VmNicSelection SelectionTypeForFailover { get; set; } + /// Gets or sets a value indicating whether static ip migration is enabled. + public bool? IsStaticIPMigrationEnabled { get; set; } + /// Gets or sets a value indicating whether mac address migration is enabled. + public bool? IsMacMigrationEnabled { get; set; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/HyperVToAzStackHCIPlannedFailoverModelCustomProperties.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/HyperVToAzStackHCIPlannedFailoverModelCustomProperties.Serialization.cs new file mode 100644 index 000000000000..396ea14843f8 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/HyperVToAzStackHCIPlannedFailoverModelCustomProperties.Serialization.cs @@ -0,0 +1,118 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + public partial class HyperVToAzStackHCIPlannedFailoverModelCustomProperties : 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(HyperVToAzStackHCIPlannedFailoverModelCustomProperties)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + writer.WritePropertyName("shutdownSourceVM"u8); + writer.WriteBooleanValue(ShutdownSourceVm); + } + + HyperVToAzStackHCIPlannedFailoverModelCustomProperties 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(HyperVToAzStackHCIPlannedFailoverModelCustomProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeHyperVToAzStackHCIPlannedFailoverModelCustomProperties(document.RootElement, options); + } + + internal static HyperVToAzStackHCIPlannedFailoverModelCustomProperties DeserializeHyperVToAzStackHCIPlannedFailoverModelCustomProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + bool shutdownSourceVm = default; + string instanceType = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("shutdownSourceVM"u8)) + { + shutdownSourceVm = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("instanceType"u8)) + { + instanceType = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new HyperVToAzStackHCIPlannedFailoverModelCustomProperties(instanceType, serializedAdditionalRawData, shutdownSourceVm); + } + + 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(HyperVToAzStackHCIPlannedFailoverModelCustomProperties)} does not support writing '{options.Format}' format."); + } + } + + HyperVToAzStackHCIPlannedFailoverModelCustomProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeHyperVToAzStackHCIPlannedFailoverModelCustomProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(HyperVToAzStackHCIPlannedFailoverModelCustomProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/HyperVToAzStackHCIPlannedFailoverModelCustomProperties.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/HyperVToAzStackHCIPlannedFailoverModelCustomProperties.cs new file mode 100644 index 000000000000..2ace1b482296 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/HyperVToAzStackHCIPlannedFailoverModelCustomProperties.cs @@ -0,0 +1,42 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + /// HyperV to AzStackHCI planned failover model custom properties. + public partial class HyperVToAzStackHCIPlannedFailoverModelCustomProperties : PlannedFailoverModelCustomProperties + { + /// Initializes a new instance of . + /// Gets or sets a value indicating whether VM needs to be shut down. + public HyperVToAzStackHCIPlannedFailoverModelCustomProperties(bool shutdownSourceVm) + { + ShutdownSourceVm = shutdownSourceVm; + InstanceType = "HyperVToAzStackHCI"; + } + + /// Initializes a new instance of . + /// Discriminator property for PlannedFailoverModelCustomProperties. + /// Keeps track of any properties unknown to the library. + /// Gets or sets a value indicating whether VM needs to be shut down. + internal HyperVToAzStackHCIPlannedFailoverModelCustomProperties(string instanceType, IDictionary serializedAdditionalRawData, bool shutdownSourceVm) : base(instanceType, serializedAdditionalRawData) + { + ShutdownSourceVm = shutdownSourceVm; + InstanceType = instanceType ?? "HyperVToAzStackHCI"; + } + + /// Initializes a new instance of for deserialization. + internal HyperVToAzStackHCIPlannedFailoverModelCustomProperties() + { + } + + /// Gets or sets a value indicating whether VM needs to be shut down. + public bool ShutdownSourceVm { get; set; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/HyperVToAzStackHCIPolicyModelCustomProperties.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/HyperVToAzStackHCIPolicyModelCustomProperties.Serialization.cs new file mode 100644 index 000000000000..b0c81c460b8b --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/HyperVToAzStackHCIPolicyModelCustomProperties.Serialization.cs @@ -0,0 +1,134 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + public partial class HyperVToAzStackHCIPolicyModelCustomProperties : 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(HyperVToAzStackHCIPolicyModelCustomProperties)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + writer.WritePropertyName("recoveryPointHistoryInMinutes"u8); + writer.WriteNumberValue(RecoveryPointHistoryInMinutes); + writer.WritePropertyName("crashConsistentFrequencyInMinutes"u8); + writer.WriteNumberValue(CrashConsistentFrequencyInMinutes); + writer.WritePropertyName("appConsistentFrequencyInMinutes"u8); + writer.WriteNumberValue(AppConsistentFrequencyInMinutes); + } + + HyperVToAzStackHCIPolicyModelCustomProperties 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(HyperVToAzStackHCIPolicyModelCustomProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeHyperVToAzStackHCIPolicyModelCustomProperties(document.RootElement, options); + } + + internal static HyperVToAzStackHCIPolicyModelCustomProperties DeserializeHyperVToAzStackHCIPolicyModelCustomProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + int recoveryPointHistoryInMinutes = default; + int crashConsistentFrequencyInMinutes = default; + int appConsistentFrequencyInMinutes = default; + string instanceType = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("recoveryPointHistoryInMinutes"u8)) + { + recoveryPointHistoryInMinutes = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("crashConsistentFrequencyInMinutes"u8)) + { + crashConsistentFrequencyInMinutes = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("appConsistentFrequencyInMinutes"u8)) + { + appConsistentFrequencyInMinutes = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("instanceType"u8)) + { + instanceType = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new HyperVToAzStackHCIPolicyModelCustomProperties(instanceType, serializedAdditionalRawData, recoveryPointHistoryInMinutes, crashConsistentFrequencyInMinutes, appConsistentFrequencyInMinutes); + } + + 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(HyperVToAzStackHCIPolicyModelCustomProperties)} does not support writing '{options.Format}' format."); + } + } + + HyperVToAzStackHCIPolicyModelCustomProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeHyperVToAzStackHCIPolicyModelCustomProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(HyperVToAzStackHCIPolicyModelCustomProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/HyperVToAzStackHCIPolicyModelCustomProperties.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/HyperVToAzStackHCIPolicyModelCustomProperties.cs new file mode 100644 index 000000000000..08491ac9e2e1 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/HyperVToAzStackHCIPolicyModelCustomProperties.cs @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + /// HyperV To AzStackHCI Policy model custom properties. + public partial class HyperVToAzStackHCIPolicyModelCustomProperties : PolicyModelCustomProperties + { + /// Initializes a new instance of . + /// Gets or sets the duration in minutes until which the recovery points need to be stored. + /// Gets or sets the crash consistent snapshot frequency (in minutes). + /// Gets or sets the app consistent snapshot frequency (in minutes). + public HyperVToAzStackHCIPolicyModelCustomProperties(int recoveryPointHistoryInMinutes, int crashConsistentFrequencyInMinutes, int appConsistentFrequencyInMinutes) + { + RecoveryPointHistoryInMinutes = recoveryPointHistoryInMinutes; + CrashConsistentFrequencyInMinutes = crashConsistentFrequencyInMinutes; + AppConsistentFrequencyInMinutes = appConsistentFrequencyInMinutes; + InstanceType = "HyperVToAzStackHCI"; + } + + /// Initializes a new instance of . + /// Discriminator property for PolicyModelCustomProperties. + /// Keeps track of any properties unknown to the library. + /// Gets or sets the duration in minutes until which the recovery points need to be stored. + /// Gets or sets the crash consistent snapshot frequency (in minutes). + /// Gets or sets the app consistent snapshot frequency (in minutes). + internal HyperVToAzStackHCIPolicyModelCustomProperties(string instanceType, IDictionary serializedAdditionalRawData, int recoveryPointHistoryInMinutes, int crashConsistentFrequencyInMinutes, int appConsistentFrequencyInMinutes) : base(instanceType, serializedAdditionalRawData) + { + RecoveryPointHistoryInMinutes = recoveryPointHistoryInMinutes; + CrashConsistentFrequencyInMinutes = crashConsistentFrequencyInMinutes; + AppConsistentFrequencyInMinutes = appConsistentFrequencyInMinutes; + InstanceType = instanceType ?? "HyperVToAzStackHCI"; + } + + /// Initializes a new instance of for deserialization. + internal HyperVToAzStackHCIPolicyModelCustomProperties() + { + } + + /// Gets or sets the duration in minutes until which the recovery points need to be stored. + public int RecoveryPointHistoryInMinutes { get; set; } + /// Gets or sets the crash consistent snapshot frequency (in minutes). + public int CrashConsistentFrequencyInMinutes { get; set; } + /// Gets or sets the app consistent snapshot frequency (in minutes). + public int AppConsistentFrequencyInMinutes { get; set; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/HyperVToAzStackHCIProtectedDiskProperties.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/HyperVToAzStackHCIProtectedDiskProperties.Serialization.cs new file mode 100644 index 000000000000..283c9225978e --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/HyperVToAzStackHCIProtectedDiskProperties.Serialization.cs @@ -0,0 +1,311 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + public partial class HyperVToAzStackHCIProtectedDiskProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(HyperVToAzStackHCIProtectedDiskProperties)} does not support writing '{format}' format."); + } + + if (options.Format != "W" && Optional.IsDefined(StorageContainerId)) + { + writer.WritePropertyName("storageContainerId"u8); + writer.WriteStringValue(StorageContainerId); + } + if (options.Format != "W" && Optional.IsDefined(StorageContainerLocalPath)) + { + writer.WritePropertyName("storageContainerLocalPath"u8); + writer.WriteStringValue(StorageContainerLocalPath); + } + if (options.Format != "W" && Optional.IsDefined(SourceDiskId)) + { + writer.WritePropertyName("sourceDiskId"u8); + writer.WriteStringValue(SourceDiskId); + } + if (options.Format != "W" && Optional.IsDefined(SourceDiskName)) + { + writer.WritePropertyName("sourceDiskName"u8); + writer.WriteStringValue(SourceDiskName); + } + if (options.Format != "W" && Optional.IsDefined(SeedDiskName)) + { + writer.WritePropertyName("seedDiskName"u8); + writer.WriteStringValue(SeedDiskName); + } + if (options.Format != "W" && Optional.IsDefined(TestMigrateDiskName)) + { + writer.WritePropertyName("testMigrateDiskName"u8); + writer.WriteStringValue(TestMigrateDiskName); + } + if (options.Format != "W" && Optional.IsDefined(MigrateDiskName)) + { + writer.WritePropertyName("migrateDiskName"u8); + writer.WriteStringValue(MigrateDiskName); + } + if (options.Format != "W" && Optional.IsDefined(IsOSDisk)) + { + writer.WritePropertyName("isOsDisk"u8); + writer.WriteBooleanValue(IsOSDisk.Value); + } + if (options.Format != "W" && Optional.IsDefined(CapacityInBytes)) + { + writer.WritePropertyName("capacityInBytes"u8); + writer.WriteNumberValue(CapacityInBytes.Value); + } + if (options.Format != "W" && Optional.IsDefined(IsDynamic)) + { + writer.WritePropertyName("isDynamic"u8); + writer.WriteBooleanValue(IsDynamic.Value); + } + if (options.Format != "W" && Optional.IsDefined(DiskType)) + { + writer.WritePropertyName("diskType"u8); + writer.WriteStringValue(DiskType); + } + if (options.Format != "W" && Optional.IsDefined(DiskBlockSize)) + { + writer.WritePropertyName("diskBlockSize"u8); + writer.WriteNumberValue(DiskBlockSize.Value); + } + if (options.Format != "W" && Optional.IsDefined(DiskLogicalSectorSize)) + { + writer.WritePropertyName("diskLogicalSectorSize"u8); + writer.WriteNumberValue(DiskLogicalSectorSize.Value); + } + if (options.Format != "W" && Optional.IsDefined(DiskPhysicalSectorSize)) + { + writer.WritePropertyName("diskPhysicalSectorSize"u8); + writer.WriteNumberValue(DiskPhysicalSectorSize.Value); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + HyperVToAzStackHCIProtectedDiskProperties 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(HyperVToAzStackHCIProtectedDiskProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeHyperVToAzStackHCIProtectedDiskProperties(document.RootElement, options); + } + + internal static HyperVToAzStackHCIProtectedDiskProperties DeserializeHyperVToAzStackHCIProtectedDiskProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string storageContainerId = default; + string storageContainerLocalPath = default; + string sourceDiskId = default; + string sourceDiskName = default; + string seedDiskName = default; + string testMigrateDiskName = default; + string migrateDiskName = default; + bool? isOSDisk = default; + long? capacityInBytes = default; + bool? isDynamic = default; + string diskType = default; + long? diskBlockSize = default; + long? diskLogicalSectorSize = default; + long? diskPhysicalSectorSize = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("storageContainerId"u8)) + { + storageContainerId = property.Value.GetString(); + continue; + } + if (property.NameEquals("storageContainerLocalPath"u8)) + { + storageContainerLocalPath = property.Value.GetString(); + continue; + } + if (property.NameEquals("sourceDiskId"u8)) + { + sourceDiskId = property.Value.GetString(); + continue; + } + if (property.NameEquals("sourceDiskName"u8)) + { + sourceDiskName = property.Value.GetString(); + continue; + } + if (property.NameEquals("seedDiskName"u8)) + { + seedDiskName = property.Value.GetString(); + continue; + } + if (property.NameEquals("testMigrateDiskName"u8)) + { + testMigrateDiskName = property.Value.GetString(); + continue; + } + if (property.NameEquals("migrateDiskName"u8)) + { + migrateDiskName = property.Value.GetString(); + continue; + } + if (property.NameEquals("isOsDisk"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + isOSDisk = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("capacityInBytes"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + capacityInBytes = property.Value.GetInt64(); + continue; + } + if (property.NameEquals("isDynamic"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + isDynamic = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("diskType"u8)) + { + diskType = property.Value.GetString(); + continue; + } + if (property.NameEquals("diskBlockSize"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + diskBlockSize = property.Value.GetInt64(); + continue; + } + if (property.NameEquals("diskLogicalSectorSize"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + diskLogicalSectorSize = property.Value.GetInt64(); + continue; + } + if (property.NameEquals("diskPhysicalSectorSize"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + diskPhysicalSectorSize = property.Value.GetInt64(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new HyperVToAzStackHCIProtectedDiskProperties( + storageContainerId, + storageContainerLocalPath, + sourceDiskId, + sourceDiskName, + seedDiskName, + testMigrateDiskName, + migrateDiskName, + isOSDisk, + capacityInBytes, + isDynamic, + diskType, + diskBlockSize, + diskLogicalSectorSize, + diskPhysicalSectorSize, + 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(HyperVToAzStackHCIProtectedDiskProperties)} does not support writing '{options.Format}' format."); + } + } + + HyperVToAzStackHCIProtectedDiskProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeHyperVToAzStackHCIProtectedDiskProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(HyperVToAzStackHCIProtectedDiskProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/HyperVToAzStackHCIProtectedDiskProperties.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/HyperVToAzStackHCIProtectedDiskProperties.cs new file mode 100644 index 000000000000..4c1f784d37c7 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/HyperVToAzStackHCIProtectedDiskProperties.cs @@ -0,0 +1,117 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + /// HyperVToAzStackHCI protected disk properties. + public partial class HyperVToAzStackHCIProtectedDiskProperties + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + internal HyperVToAzStackHCIProtectedDiskProperties() + { + } + + /// Initializes a new instance of . + /// Gets or sets the ARM Id of the storage container. + /// Gets or sets the local path of the storage container. + /// Gets or sets the source disk Id. + /// Gets or sets the source disk Name. + /// Gets or sets the seed disk name. + /// Gets or sets the test failover clone disk. + /// Gets or sets the failover clone disk. + /// Gets or sets a value indicating whether the disk is the OS disk. + /// Gets or sets the disk capacity in bytes. + /// Gets or sets a value indicating whether dynamic sizing is enabled on the virtual hard disk. + /// Gets or sets the disk type. + /// Gets or sets a value of disk block size. + /// Gets or sets a value of disk logical sector size. + /// Gets or sets a value of disk physical sector size. + /// Keeps track of any properties unknown to the library. + internal HyperVToAzStackHCIProtectedDiskProperties(string storageContainerId, string storageContainerLocalPath, string sourceDiskId, string sourceDiskName, string seedDiskName, string testMigrateDiskName, string migrateDiskName, bool? isOSDisk, long? capacityInBytes, bool? isDynamic, string diskType, long? diskBlockSize, long? diskLogicalSectorSize, long? diskPhysicalSectorSize, IDictionary serializedAdditionalRawData) + { + StorageContainerId = storageContainerId; + StorageContainerLocalPath = storageContainerLocalPath; + SourceDiskId = sourceDiskId; + SourceDiskName = sourceDiskName; + SeedDiskName = seedDiskName; + TestMigrateDiskName = testMigrateDiskName; + MigrateDiskName = migrateDiskName; + IsOSDisk = isOSDisk; + CapacityInBytes = capacityInBytes; + IsDynamic = isDynamic; + DiskType = diskType; + DiskBlockSize = diskBlockSize; + DiskLogicalSectorSize = diskLogicalSectorSize; + DiskPhysicalSectorSize = diskPhysicalSectorSize; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Gets or sets the ARM Id of the storage container. + public string StorageContainerId { get; } + /// Gets or sets the local path of the storage container. + public string StorageContainerLocalPath { get; } + /// Gets or sets the source disk Id. + public string SourceDiskId { get; } + /// Gets or sets the source disk Name. + public string SourceDiskName { get; } + /// Gets or sets the seed disk name. + public string SeedDiskName { get; } + /// Gets or sets the test failover clone disk. + public string TestMigrateDiskName { get; } + /// Gets or sets the failover clone disk. + public string MigrateDiskName { get; } + /// Gets or sets a value indicating whether the disk is the OS disk. + public bool? IsOSDisk { get; } + /// Gets or sets the disk capacity in bytes. + public long? CapacityInBytes { get; } + /// Gets or sets a value indicating whether dynamic sizing is enabled on the virtual hard disk. + public bool? IsDynamic { get; } + /// Gets or sets the disk type. + public string DiskType { get; } + /// Gets or sets a value of disk block size. + public long? DiskBlockSize { get; } + /// Gets or sets a value of disk logical sector size. + public long? DiskLogicalSectorSize { get; } + /// Gets or sets a value of disk physical sector size. + public long? DiskPhysicalSectorSize { get; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/HyperVToAzStackHCIProtectedItemModelCustomProperties.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/HyperVToAzStackHCIProtectedItemModelCustomProperties.Serialization.cs new file mode 100644 index 000000000000..6a4eb2eedfee --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/HyperVToAzStackHCIProtectedItemModelCustomProperties.Serialization.cs @@ -0,0 +1,636 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + public partial class HyperVToAzStackHCIProtectedItemModelCustomProperties : 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(HyperVToAzStackHCIProtectedItemModelCustomProperties)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (options.Format != "W" && Optional.IsDefined(ActiveLocation)) + { + writer.WritePropertyName("activeLocation"u8); + writer.WriteStringValue(ActiveLocation.Value.ToString()); + } + writer.WritePropertyName("targetHciClusterId"u8); + writer.WriteStringValue(TargetHciClusterId); + writer.WritePropertyName("targetArcClusterCustomLocationId"u8); + writer.WriteStringValue(TargetArcClusterCustomLocationId); + if (options.Format != "W" && Optional.IsDefined(TargetAzStackHciClusterName)) + { + writer.WritePropertyName("targetAzStackHciClusterName"u8); + writer.WriteStringValue(TargetAzStackHciClusterName); + } + writer.WritePropertyName("fabricDiscoveryMachineId"u8); + writer.WriteStringValue(FabricDiscoveryMachineId); + writer.WritePropertyName("disksToInclude"u8); + writer.WriteStartArray(); + foreach (var item in DisksToInclude) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + writer.WritePropertyName("nicsToInclude"u8); + writer.WriteStartArray(); + foreach (var item in NicsToInclude) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + if (options.Format != "W" && Optional.IsDefined(SourceVmName)) + { + writer.WritePropertyName("sourceVmName"u8); + writer.WriteStringValue(SourceVmName); + } + if (options.Format != "W" && Optional.IsDefined(SourceCpuCores)) + { + writer.WritePropertyName("sourceCpuCores"u8); + writer.WriteNumberValue(SourceCpuCores.Value); + } + if (options.Format != "W" && Optional.IsDefined(SourceMemoryInMegaBytes)) + { + writer.WritePropertyName("sourceMemoryInMegaBytes"u8); + writer.WriteNumberValue(SourceMemoryInMegaBytes.Value); + } + if (Optional.IsDefined(TargetVmName)) + { + writer.WritePropertyName("targetVmName"u8); + writer.WriteStringValue(TargetVmName); + } + writer.WritePropertyName("targetResourceGroupId"u8); + writer.WriteStringValue(TargetResourceGroupId); + writer.WritePropertyName("storageContainerId"u8); + writer.WriteStringValue(StorageContainerId); + writer.WritePropertyName("hyperVGeneration"u8); + writer.WriteStringValue(HyperVGeneration); + if (Optional.IsDefined(TargetNetworkId)) + { + writer.WritePropertyName("targetNetworkId"u8); + writer.WriteStringValue(TargetNetworkId); + } + if (Optional.IsDefined(TestNetworkId)) + { + writer.WritePropertyName("testNetworkId"u8); + writer.WriteStringValue(TestNetworkId); + } + if (Optional.IsDefined(TargetCpuCores)) + { + writer.WritePropertyName("targetCpuCores"u8); + writer.WriteNumberValue(TargetCpuCores.Value); + } + if (Optional.IsDefined(IsDynamicRam)) + { + writer.WritePropertyName("isDynamicRam"u8); + writer.WriteBooleanValue(IsDynamicRam.Value); + } + if (Optional.IsDefined(DynamicMemoryConfig)) + { + writer.WritePropertyName("dynamicMemoryConfig"u8); + writer.WriteObjectValue(DynamicMemoryConfig, options); + } + if (Optional.IsDefined(TargetMemoryInMegaBytes)) + { + writer.WritePropertyName("targetMemoryInMegaBytes"u8); + writer.WriteNumberValue(TargetMemoryInMegaBytes.Value); + } + writer.WritePropertyName("runAsAccountId"u8); + writer.WriteStringValue(RunAsAccountId); + writer.WritePropertyName("sourceFabricAgentName"u8); + writer.WriteStringValue(SourceFabricAgentName); + writer.WritePropertyName("targetFabricAgentName"u8); + writer.WriteStringValue(TargetFabricAgentName); + if (options.Format != "W" && Optional.IsDefined(SourceApplianceName)) + { + writer.WritePropertyName("sourceApplianceName"u8); + writer.WriteStringValue(SourceApplianceName); + } + if (options.Format != "W" && Optional.IsDefined(TargetApplianceName)) + { + writer.WritePropertyName("targetApplianceName"u8); + writer.WriteStringValue(TargetApplianceName); + } + if (options.Format != "W" && Optional.IsDefined(OSType)) + { + writer.WritePropertyName("osType"u8); + writer.WriteStringValue(OSType); + } + if (options.Format != "W" && Optional.IsDefined(OSName)) + { + writer.WritePropertyName("osName"u8); + writer.WriteStringValue(OSName); + } + if (options.Format != "W" && Optional.IsDefined(FirmwareType)) + { + writer.WritePropertyName("firmwareType"u8); + writer.WriteStringValue(FirmwareType); + } + if (options.Format != "W" && Optional.IsDefined(TargetLocation)) + { + writer.WritePropertyName("targetLocation"u8); + writer.WriteStringValue(TargetLocation); + } + writer.WritePropertyName("customLocationRegion"u8); + writer.WriteStringValue(CustomLocationRegion); + if (options.Format != "W" && Optional.IsDefined(FailoverRecoveryPointId)) + { + writer.WritePropertyName("failoverRecoveryPointId"u8); + writer.WriteStringValue(FailoverRecoveryPointId); + } + if (options.Format != "W" && Optional.IsDefined(LastRecoveryPointReceived)) + { + writer.WritePropertyName("lastRecoveryPointReceived"u8); + writer.WriteStringValue(LastRecoveryPointReceived.Value, "O"); + } + if (options.Format != "W" && Optional.IsDefined(LastRecoveryPointId)) + { + writer.WritePropertyName("lastRecoveryPointId"u8); + writer.WriteStringValue(LastRecoveryPointId); + } + if (options.Format != "W" && Optional.IsDefined(InitialReplicationProgressPercentage)) + { + writer.WritePropertyName("initialReplicationProgressPercentage"u8); + writer.WriteNumberValue(InitialReplicationProgressPercentage.Value); + } + if (options.Format != "W" && Optional.IsDefined(ResyncProgressPercentage)) + { + writer.WritePropertyName("resyncProgressPercentage"u8); + writer.WriteNumberValue(ResyncProgressPercentage.Value); + } + if (options.Format != "W" && Optional.IsCollectionDefined(ProtectedDisks)) + { + writer.WritePropertyName("protectedDisks"u8); + writer.WriteStartArray(); + foreach (var item in ProtectedDisks) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && Optional.IsCollectionDefined(ProtectedNics)) + { + writer.WritePropertyName("protectedNics"u8); + writer.WriteStartArray(); + foreach (var item in ProtectedNics) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && Optional.IsDefined(TargetVmBiosId)) + { + writer.WritePropertyName("targetVmBiosId"u8); + writer.WriteStringValue(TargetVmBiosId); + } + if (options.Format != "W" && Optional.IsDefined(LastReplicationUpdateOn)) + { + writer.WritePropertyName("lastReplicationUpdateTime"u8); + writer.WriteStringValue(LastReplicationUpdateOn.Value, "O"); + } + } + + HyperVToAzStackHCIProtectedItemModelCustomProperties 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(HyperVToAzStackHCIProtectedItemModelCustomProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeHyperVToAzStackHCIProtectedItemModelCustomProperties(document.RootElement, options); + } + + internal static HyperVToAzStackHCIProtectedItemModelCustomProperties DeserializeHyperVToAzStackHCIProtectedItemModelCustomProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ProtectedItemActiveLocation? activeLocation = default; + string targetHciClusterId = default; + string targetArcClusterCustomLocationId = default; + string targetAzStackHciClusterName = default; + string fabricDiscoveryMachineId = default; + IList disksToInclude = default; + IList nicsToInclude = default; + string sourceVmName = default; + int? sourceCpuCores = default; + double? sourceMemoryInMegaBytes = default; + string targetVmName = default; + string targetResourceGroupId = default; + string storageContainerId = default; + string hyperVGeneration = default; + string targetNetworkId = default; + string testNetworkId = default; + int? targetCpuCores = default; + bool? isDynamicRam = default; + ProtectedItemDynamicMemoryConfig dynamicMemoryConfig = default; + int? targetMemoryInMegaBytes = default; + string runAsAccountId = default; + string sourceFabricAgentName = default; + string targetFabricAgentName = default; + string sourceApplianceName = default; + string targetApplianceName = default; + string osType = default; + string osName = default; + string firmwareType = default; + string targetLocation = default; + string customLocationRegion = default; + string failoverRecoveryPointId = default; + DateTimeOffset? lastRecoveryPointReceived = default; + string lastRecoveryPointId = default; + int? initialReplicationProgressPercentage = default; + int? resyncProgressPercentage = default; + IReadOnlyList protectedDisks = default; + IReadOnlyList protectedNics = default; + string targetVmBiosId = default; + DateTimeOffset? lastReplicationUpdateTime = default; + string instanceType = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("activeLocation"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + activeLocation = new ProtectedItemActiveLocation(property.Value.GetString()); + continue; + } + if (property.NameEquals("targetHciClusterId"u8)) + { + targetHciClusterId = property.Value.GetString(); + continue; + } + if (property.NameEquals("targetArcClusterCustomLocationId"u8)) + { + targetArcClusterCustomLocationId = property.Value.GetString(); + continue; + } + if (property.NameEquals("targetAzStackHciClusterName"u8)) + { + targetAzStackHciClusterName = property.Value.GetString(); + continue; + } + if (property.NameEquals("fabricDiscoveryMachineId"u8)) + { + fabricDiscoveryMachineId = property.Value.GetString(); + continue; + } + if (property.NameEquals("disksToInclude"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(HyperVToAzStackHCIDiskInput.DeserializeHyperVToAzStackHCIDiskInput(item, options)); + } + disksToInclude = array; + continue; + } + if (property.NameEquals("nicsToInclude"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(HyperVToAzStackHCINicInput.DeserializeHyperVToAzStackHCINicInput(item, options)); + } + nicsToInclude = array; + continue; + } + if (property.NameEquals("sourceVmName"u8)) + { + sourceVmName = property.Value.GetString(); + continue; + } + if (property.NameEquals("sourceCpuCores"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + sourceCpuCores = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("sourceMemoryInMegaBytes"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + sourceMemoryInMegaBytes = property.Value.GetDouble(); + continue; + } + if (property.NameEquals("targetVmName"u8)) + { + targetVmName = property.Value.GetString(); + continue; + } + if (property.NameEquals("targetResourceGroupId"u8)) + { + targetResourceGroupId = property.Value.GetString(); + continue; + } + if (property.NameEquals("storageContainerId"u8)) + { + storageContainerId = property.Value.GetString(); + continue; + } + if (property.NameEquals("hyperVGeneration"u8)) + { + hyperVGeneration = property.Value.GetString(); + continue; + } + if (property.NameEquals("targetNetworkId"u8)) + { + targetNetworkId = property.Value.GetString(); + continue; + } + if (property.NameEquals("testNetworkId"u8)) + { + testNetworkId = property.Value.GetString(); + continue; + } + if (property.NameEquals("targetCpuCores"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + targetCpuCores = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("isDynamicRam"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + isDynamicRam = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("dynamicMemoryConfig"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + dynamicMemoryConfig = ProtectedItemDynamicMemoryConfig.DeserializeProtectedItemDynamicMemoryConfig(property.Value, options); + continue; + } + if (property.NameEquals("targetMemoryInMegaBytes"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + targetMemoryInMegaBytes = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("runAsAccountId"u8)) + { + runAsAccountId = property.Value.GetString(); + continue; + } + if (property.NameEquals("sourceFabricAgentName"u8)) + { + sourceFabricAgentName = property.Value.GetString(); + continue; + } + if (property.NameEquals("targetFabricAgentName"u8)) + { + targetFabricAgentName = property.Value.GetString(); + continue; + } + if (property.NameEquals("sourceApplianceName"u8)) + { + sourceApplianceName = property.Value.GetString(); + continue; + } + if (property.NameEquals("targetApplianceName"u8)) + { + targetApplianceName = property.Value.GetString(); + continue; + } + if (property.NameEquals("osType"u8)) + { + osType = property.Value.GetString(); + continue; + } + if (property.NameEquals("osName"u8)) + { + osName = property.Value.GetString(); + continue; + } + if (property.NameEquals("firmwareType"u8)) + { + firmwareType = property.Value.GetString(); + continue; + } + if (property.NameEquals("targetLocation"u8)) + { + targetLocation = property.Value.GetString(); + continue; + } + if (property.NameEquals("customLocationRegion"u8)) + { + customLocationRegion = property.Value.GetString(); + continue; + } + if (property.NameEquals("failoverRecoveryPointId"u8)) + { + failoverRecoveryPointId = property.Value.GetString(); + continue; + } + if (property.NameEquals("lastRecoveryPointReceived"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + lastRecoveryPointReceived = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("lastRecoveryPointId"u8)) + { + lastRecoveryPointId = property.Value.GetString(); + continue; + } + if (property.NameEquals("initialReplicationProgressPercentage"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + initialReplicationProgressPercentage = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("resyncProgressPercentage"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + resyncProgressPercentage = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("protectedDisks"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(HyperVToAzStackHCIProtectedDiskProperties.DeserializeHyperVToAzStackHCIProtectedDiskProperties(item, options)); + } + protectedDisks = array; + continue; + } + if (property.NameEquals("protectedNics"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(HyperVToAzStackHCIProtectedNicProperties.DeserializeHyperVToAzStackHCIProtectedNicProperties(item, options)); + } + protectedNics = array; + continue; + } + if (property.NameEquals("targetVmBiosId"u8)) + { + targetVmBiosId = property.Value.GetString(); + continue; + } + if (property.NameEquals("lastReplicationUpdateTime"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + lastReplicationUpdateTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("instanceType"u8)) + { + instanceType = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new HyperVToAzStackHCIProtectedItemModelCustomProperties( + instanceType, + serializedAdditionalRawData, + activeLocation, + targetHciClusterId, + targetArcClusterCustomLocationId, + targetAzStackHciClusterName, + fabricDiscoveryMachineId, + disksToInclude, + nicsToInclude, + sourceVmName, + sourceCpuCores, + sourceMemoryInMegaBytes, + targetVmName, + targetResourceGroupId, + storageContainerId, + hyperVGeneration, + targetNetworkId, + testNetworkId, + targetCpuCores, + isDynamicRam, + dynamicMemoryConfig, + targetMemoryInMegaBytes, + runAsAccountId, + sourceFabricAgentName, + targetFabricAgentName, + sourceApplianceName, + targetApplianceName, + osType, + osName, + firmwareType, + targetLocation, + customLocationRegion, + failoverRecoveryPointId, + lastRecoveryPointReceived, + lastRecoveryPointId, + initialReplicationProgressPercentage, + resyncProgressPercentage, + protectedDisks ?? new ChangeTrackingList(), + protectedNics ?? new ChangeTrackingList(), + targetVmBiosId, + lastReplicationUpdateTime); + } + + 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(HyperVToAzStackHCIProtectedItemModelCustomProperties)} does not support writing '{options.Format}' format."); + } + } + + HyperVToAzStackHCIProtectedItemModelCustomProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeHyperVToAzStackHCIProtectedItemModelCustomProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(HyperVToAzStackHCIProtectedItemModelCustomProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/HyperVToAzStackHCIProtectedItemModelCustomProperties.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/HyperVToAzStackHCIProtectedItemModelCustomProperties.cs new file mode 100644 index 000000000000..bc93309eccbe --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/HyperVToAzStackHCIProtectedItemModelCustomProperties.cs @@ -0,0 +1,233 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + /// HyperV to AzStackHCI Protected item model custom properties. + public partial class HyperVToAzStackHCIProtectedItemModelCustomProperties : ProtectedItemModelCustomProperties + { + /// Initializes a new instance of . + /// Gets or sets the Target HCI Cluster ARM Id. + /// Gets or sets the Target Arc Cluster Custom Location ARM Id. + /// Gets or sets the ARM Id of the discovered machine. + /// Gets or sets the list of disks to replicate. + /// Gets or sets the list of VM NIC to replicate. + /// Gets or sets the target resource group ARM Id. + /// Gets or sets the target storage container ARM Id. + /// Gets or sets the hypervisor generation of the virtual machine. + /// Gets or sets the Run As account Id. + /// Gets or sets the source fabric agent name. + /// Gets or sets the target fabric agent name. + /// Gets or sets the location of Azure Arc HCI custom location resource. + /// , , , , , , , , , , or is null. + public HyperVToAzStackHCIProtectedItemModelCustomProperties(string targetHciClusterId, string targetArcClusterCustomLocationId, string fabricDiscoveryMachineId, IEnumerable disksToInclude, IEnumerable nicsToInclude, string targetResourceGroupId, string storageContainerId, string hyperVGeneration, string runAsAccountId, string sourceFabricAgentName, string targetFabricAgentName, string customLocationRegion) + { + Argument.AssertNotNull(targetHciClusterId, nameof(targetHciClusterId)); + Argument.AssertNotNull(targetArcClusterCustomLocationId, nameof(targetArcClusterCustomLocationId)); + Argument.AssertNotNull(fabricDiscoveryMachineId, nameof(fabricDiscoveryMachineId)); + Argument.AssertNotNull(disksToInclude, nameof(disksToInclude)); + Argument.AssertNotNull(nicsToInclude, nameof(nicsToInclude)); + Argument.AssertNotNull(targetResourceGroupId, nameof(targetResourceGroupId)); + Argument.AssertNotNull(storageContainerId, nameof(storageContainerId)); + Argument.AssertNotNull(hyperVGeneration, nameof(hyperVGeneration)); + Argument.AssertNotNull(runAsAccountId, nameof(runAsAccountId)); + Argument.AssertNotNull(sourceFabricAgentName, nameof(sourceFabricAgentName)); + Argument.AssertNotNull(targetFabricAgentName, nameof(targetFabricAgentName)); + Argument.AssertNotNull(customLocationRegion, nameof(customLocationRegion)); + + TargetHciClusterId = targetHciClusterId; + TargetArcClusterCustomLocationId = targetArcClusterCustomLocationId; + FabricDiscoveryMachineId = fabricDiscoveryMachineId; + DisksToInclude = disksToInclude.ToList(); + NicsToInclude = nicsToInclude.ToList(); + TargetResourceGroupId = targetResourceGroupId; + StorageContainerId = storageContainerId; + HyperVGeneration = hyperVGeneration; + RunAsAccountId = runAsAccountId; + SourceFabricAgentName = sourceFabricAgentName; + TargetFabricAgentName = targetFabricAgentName; + CustomLocationRegion = customLocationRegion; + ProtectedDisks = new ChangeTrackingList(); + ProtectedNics = new ChangeTrackingList(); + InstanceType = "HyperVToAzStackHCI"; + } + + /// Initializes a new instance of . + /// Discriminator property for ProtectedItemModelCustomProperties. + /// Keeps track of any properties unknown to the library. + /// Gets or sets the location of the protected item. + /// Gets or sets the Target HCI Cluster ARM Id. + /// Gets or sets the Target Arc Cluster Custom Location ARM Id. + /// Gets or sets the Target AzStackHCI cluster name. + /// Gets or sets the ARM Id of the discovered machine. + /// Gets or sets the list of disks to replicate. + /// Gets or sets the list of VM NIC to replicate. + /// Gets or sets the source VM display name. + /// Gets or sets the source VM CPU cores. + /// Gets or sets the source VM ram memory size in megabytes. + /// Gets or sets the target VM display name. + /// Gets or sets the target resource group ARM Id. + /// Gets or sets the target storage container ARM Id. + /// Gets or sets the hypervisor generation of the virtual machine. + /// Gets or sets the target network Id within AzStackHCI Cluster. + /// Gets or sets the target test network Id within AzStackHCI Cluster. + /// Gets or sets the target CPU cores. + /// Gets or sets a value indicating whether memory is dynamical. + /// Protected item dynamic memory config. + /// Gets or sets the target memory in mega-bytes. + /// Gets or sets the Run As account Id. + /// Gets or sets the source fabric agent name. + /// Gets or sets the target fabric agent name. + /// Gets or sets the source appliance name. + /// Gets or sets the target appliance name. + /// Gets or sets the type of the OS. + /// Gets or sets the name of the OS. + /// Gets or sets the firmware type. + /// Gets or sets the target location. + /// Gets or sets the location of Azure Arc HCI custom location resource. + /// Gets or sets the recovery point Id to which the VM was failed over. + /// Gets or sets the last recovery point received time. + /// Gets or sets the last recovery point Id. + /// Gets or sets the initial replication progress percentage. This is calculated based on total bytes processed for all disks in the source VM. + /// Gets or sets the resync progress percentage. This is calculated based on total bytes processed for all disks in the source VM. + /// Gets or sets the list of protected disks. + /// Gets or sets the VM NIC details. + /// Gets or sets the BIOS Id of the target AzStackHCI VM. + /// Gets or sets the latest timestamp that replication status is updated. + internal HyperVToAzStackHCIProtectedItemModelCustomProperties(string instanceType, IDictionary serializedAdditionalRawData, ProtectedItemActiveLocation? activeLocation, string targetHciClusterId, string targetArcClusterCustomLocationId, string targetAzStackHciClusterName, string fabricDiscoveryMachineId, IList disksToInclude, IList nicsToInclude, string sourceVmName, int? sourceCpuCores, double? sourceMemoryInMegaBytes, string targetVmName, string targetResourceGroupId, string storageContainerId, string hyperVGeneration, string targetNetworkId, string testNetworkId, int? targetCpuCores, bool? isDynamicRam, ProtectedItemDynamicMemoryConfig dynamicMemoryConfig, int? targetMemoryInMegaBytes, string runAsAccountId, string sourceFabricAgentName, string targetFabricAgentName, string sourceApplianceName, string targetApplianceName, string osType, string osName, string firmwareType, string targetLocation, string customLocationRegion, string failoverRecoveryPointId, DateTimeOffset? lastRecoveryPointReceived, string lastRecoveryPointId, int? initialReplicationProgressPercentage, int? resyncProgressPercentage, IReadOnlyList protectedDisks, IReadOnlyList protectedNics, string targetVmBiosId, DateTimeOffset? lastReplicationUpdateOn) : base(instanceType, serializedAdditionalRawData) + { + ActiveLocation = activeLocation; + TargetHciClusterId = targetHciClusterId; + TargetArcClusterCustomLocationId = targetArcClusterCustomLocationId; + TargetAzStackHciClusterName = targetAzStackHciClusterName; + FabricDiscoveryMachineId = fabricDiscoveryMachineId; + DisksToInclude = disksToInclude; + NicsToInclude = nicsToInclude; + SourceVmName = sourceVmName; + SourceCpuCores = sourceCpuCores; + SourceMemoryInMegaBytes = sourceMemoryInMegaBytes; + TargetVmName = targetVmName; + TargetResourceGroupId = targetResourceGroupId; + StorageContainerId = storageContainerId; + HyperVGeneration = hyperVGeneration; + TargetNetworkId = targetNetworkId; + TestNetworkId = testNetworkId; + TargetCpuCores = targetCpuCores; + IsDynamicRam = isDynamicRam; + DynamicMemoryConfig = dynamicMemoryConfig; + TargetMemoryInMegaBytes = targetMemoryInMegaBytes; + RunAsAccountId = runAsAccountId; + SourceFabricAgentName = sourceFabricAgentName; + TargetFabricAgentName = targetFabricAgentName; + SourceApplianceName = sourceApplianceName; + TargetApplianceName = targetApplianceName; + OSType = osType; + OSName = osName; + FirmwareType = firmwareType; + TargetLocation = targetLocation; + CustomLocationRegion = customLocationRegion; + FailoverRecoveryPointId = failoverRecoveryPointId; + LastRecoveryPointReceived = lastRecoveryPointReceived; + LastRecoveryPointId = lastRecoveryPointId; + InitialReplicationProgressPercentage = initialReplicationProgressPercentage; + ResyncProgressPercentage = resyncProgressPercentage; + ProtectedDisks = protectedDisks; + ProtectedNics = protectedNics; + TargetVmBiosId = targetVmBiosId; + LastReplicationUpdateOn = lastReplicationUpdateOn; + InstanceType = instanceType ?? "HyperVToAzStackHCI"; + } + + /// Initializes a new instance of for deserialization. + internal HyperVToAzStackHCIProtectedItemModelCustomProperties() + { + } + + /// Gets or sets the location of the protected item. + public ProtectedItemActiveLocation? ActiveLocation { get; } + /// Gets or sets the Target HCI Cluster ARM Id. + public string TargetHciClusterId { get; set; } + /// Gets or sets the Target Arc Cluster Custom Location ARM Id. + public string TargetArcClusterCustomLocationId { get; set; } + /// Gets or sets the Target AzStackHCI cluster name. + public string TargetAzStackHciClusterName { get; } + /// Gets or sets the ARM Id of the discovered machine. + public string FabricDiscoveryMachineId { get; set; } + /// Gets or sets the list of disks to replicate. + public IList DisksToInclude { get; } + /// Gets or sets the list of VM NIC to replicate. + public IList NicsToInclude { get; } + /// Gets or sets the source VM display name. + public string SourceVmName { get; } + /// Gets or sets the source VM CPU cores. + public int? SourceCpuCores { get; } + /// Gets or sets the source VM ram memory size in megabytes. + public double? SourceMemoryInMegaBytes { get; } + /// Gets or sets the target VM display name. + public string TargetVmName { get; set; } + /// Gets or sets the target resource group ARM Id. + public string TargetResourceGroupId { get; set; } + /// Gets or sets the target storage container ARM Id. + public string StorageContainerId { get; set; } + /// Gets or sets the hypervisor generation of the virtual machine. + public string HyperVGeneration { get; set; } + /// Gets or sets the target network Id within AzStackHCI Cluster. + public string TargetNetworkId { get; set; } + /// Gets or sets the target test network Id within AzStackHCI Cluster. + public string TestNetworkId { get; set; } + /// Gets or sets the target CPU cores. + public int? TargetCpuCores { get; set; } + /// Gets or sets a value indicating whether memory is dynamical. + public bool? IsDynamicRam { get; set; } + /// Protected item dynamic memory config. + public ProtectedItemDynamicMemoryConfig DynamicMemoryConfig { get; set; } + /// Gets or sets the target memory in mega-bytes. + public int? TargetMemoryInMegaBytes { get; set; } + /// Gets or sets the Run As account Id. + public string RunAsAccountId { get; set; } + /// Gets or sets the source fabric agent name. + public string SourceFabricAgentName { get; set; } + /// Gets or sets the target fabric agent name. + public string TargetFabricAgentName { get; set; } + /// Gets or sets the source appliance name. + public string SourceApplianceName { get; } + /// Gets or sets the target appliance name. + public string TargetApplianceName { get; } + /// Gets or sets the type of the OS. + public string OSType { get; } + /// Gets or sets the name of the OS. + public string OSName { get; } + /// Gets or sets the firmware type. + public string FirmwareType { get; } + /// Gets or sets the target location. + public string TargetLocation { get; } + /// Gets or sets the location of Azure Arc HCI custom location resource. + public string CustomLocationRegion { get; set; } + /// Gets or sets the recovery point Id to which the VM was failed over. + public string FailoverRecoveryPointId { get; } + /// Gets or sets the last recovery point received time. + public DateTimeOffset? LastRecoveryPointReceived { get; } + /// Gets or sets the last recovery point Id. + public string LastRecoveryPointId { get; } + /// Gets or sets the initial replication progress percentage. This is calculated based on total bytes processed for all disks in the source VM. + public int? InitialReplicationProgressPercentage { get; } + /// Gets or sets the resync progress percentage. This is calculated based on total bytes processed for all disks in the source VM. + public int? ResyncProgressPercentage { get; } + /// Gets or sets the list of protected disks. + public IReadOnlyList ProtectedDisks { get; } + /// Gets or sets the VM NIC details. + public IReadOnlyList ProtectedNics { get; } + /// Gets or sets the BIOS Id of the target AzStackHCI VM. + public string TargetVmBiosId { get; } + /// Gets or sets the latest timestamp that replication status is updated. + public DateTimeOffset? LastReplicationUpdateOn { get; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/HyperVToAzStackHCIProtectedItemModelCustomPropertiesUpdate.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/HyperVToAzStackHCIProtectedItemModelCustomPropertiesUpdate.Serialization.cs new file mode 100644 index 000000000000..5b486b2502ae --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/HyperVToAzStackHCIProtectedItemModelCustomPropertiesUpdate.Serialization.cs @@ -0,0 +1,214 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + public partial class HyperVToAzStackHCIProtectedItemModelCustomPropertiesUpdate : 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(HyperVToAzStackHCIProtectedItemModelCustomPropertiesUpdate)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (Optional.IsCollectionDefined(NicsToInclude)) + { + writer.WritePropertyName("nicsToInclude"u8); + writer.WriteStartArray(); + foreach (var item in NicsToInclude) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(TargetCpuCores)) + { + writer.WritePropertyName("targetCpuCores"u8); + writer.WriteNumberValue(TargetCpuCores.Value); + } + if (Optional.IsDefined(IsDynamicRam)) + { + writer.WritePropertyName("isDynamicRam"u8); + writer.WriteBooleanValue(IsDynamicRam.Value); + } + if (Optional.IsDefined(DynamicMemoryConfig)) + { + writer.WritePropertyName("dynamicMemoryConfig"u8); + writer.WriteObjectValue(DynamicMemoryConfig, options); + } + if (Optional.IsDefined(TargetMemoryInMegaBytes)) + { + writer.WritePropertyName("targetMemoryInMegaBytes"u8); + writer.WriteNumberValue(TargetMemoryInMegaBytes.Value); + } + if (Optional.IsDefined(OSType)) + { + writer.WritePropertyName("osType"u8); + writer.WriteStringValue(OSType); + } + } + + HyperVToAzStackHCIProtectedItemModelCustomPropertiesUpdate 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(HyperVToAzStackHCIProtectedItemModelCustomPropertiesUpdate)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeHyperVToAzStackHCIProtectedItemModelCustomPropertiesUpdate(document.RootElement, options); + } + + internal static HyperVToAzStackHCIProtectedItemModelCustomPropertiesUpdate DeserializeHyperVToAzStackHCIProtectedItemModelCustomPropertiesUpdate(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IList nicsToInclude = default; + int? targetCpuCores = default; + bool? isDynamicRam = default; + ProtectedItemDynamicMemoryConfig dynamicMemoryConfig = default; + int? targetMemoryInMegaBytes = default; + string osType = default; + string instanceType = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("nicsToInclude"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(HyperVToAzStackHCINicInput.DeserializeHyperVToAzStackHCINicInput(item, options)); + } + nicsToInclude = array; + continue; + } + if (property.NameEquals("targetCpuCores"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + targetCpuCores = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("isDynamicRam"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + isDynamicRam = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("dynamicMemoryConfig"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + dynamicMemoryConfig = ProtectedItemDynamicMemoryConfig.DeserializeProtectedItemDynamicMemoryConfig(property.Value, options); + continue; + } + if (property.NameEquals("targetMemoryInMegaBytes"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + targetMemoryInMegaBytes = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("osType"u8)) + { + osType = property.Value.GetString(); + continue; + } + if (property.NameEquals("instanceType"u8)) + { + instanceType = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new HyperVToAzStackHCIProtectedItemModelCustomPropertiesUpdate( + instanceType, + serializedAdditionalRawData, + nicsToInclude ?? new ChangeTrackingList(), + targetCpuCores, + isDynamicRam, + dynamicMemoryConfig, + targetMemoryInMegaBytes, + osType); + } + + 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(HyperVToAzStackHCIProtectedItemModelCustomPropertiesUpdate)} does not support writing '{options.Format}' format."); + } + } + + HyperVToAzStackHCIProtectedItemModelCustomPropertiesUpdate IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeHyperVToAzStackHCIProtectedItemModelCustomPropertiesUpdate(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(HyperVToAzStackHCIProtectedItemModelCustomPropertiesUpdate)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/HyperVToAzStackHCIProtectedItemModelCustomPropertiesUpdate.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/HyperVToAzStackHCIProtectedItemModelCustomPropertiesUpdate.cs new file mode 100644 index 000000000000..85b34e6a8a2d --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/HyperVToAzStackHCIProtectedItemModelCustomPropertiesUpdate.cs @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + /// HyperV to AzStackHCI Protected item model custom properties. + public partial class HyperVToAzStackHCIProtectedItemModelCustomPropertiesUpdate : ProtectedItemModelCustomPropertiesUpdate + { + /// Initializes a new instance of . + public HyperVToAzStackHCIProtectedItemModelCustomPropertiesUpdate() + { + NicsToInclude = new ChangeTrackingList(); + InstanceType = "HyperVToAzStackHCI"; + } + + /// Initializes a new instance of . + /// Discriminator property for ProtectedItemModelCustomPropertiesUpdate. + /// Keeps track of any properties unknown to the library. + /// Gets or sets the list of VM NIC to replicate. + /// Gets or sets the target CPU cores. + /// Gets or sets a value indicating whether memory is dynamical. + /// Protected item dynamic memory config. + /// Gets or sets the target memory in mega-bytes. + /// Gets or sets the type of the OS. + internal HyperVToAzStackHCIProtectedItemModelCustomPropertiesUpdate(string instanceType, IDictionary serializedAdditionalRawData, IList nicsToInclude, int? targetCpuCores, bool? isDynamicRam, ProtectedItemDynamicMemoryConfig dynamicMemoryConfig, int? targetMemoryInMegaBytes, string osType) : base(instanceType, serializedAdditionalRawData) + { + NicsToInclude = nicsToInclude; + TargetCpuCores = targetCpuCores; + IsDynamicRam = isDynamicRam; + DynamicMemoryConfig = dynamicMemoryConfig; + TargetMemoryInMegaBytes = targetMemoryInMegaBytes; + OSType = osType; + InstanceType = instanceType ?? "HyperVToAzStackHCI"; + } + + /// Gets or sets the list of VM NIC to replicate. + public IList NicsToInclude { get; } + /// Gets or sets the target CPU cores. + public int? TargetCpuCores { get; set; } + /// Gets or sets a value indicating whether memory is dynamical. + public bool? IsDynamicRam { get; set; } + /// Protected item dynamic memory config. + public ProtectedItemDynamicMemoryConfig DynamicMemoryConfig { get; set; } + /// Gets or sets the target memory in mega-bytes. + public int? TargetMemoryInMegaBytes { get; set; } + /// Gets or sets the type of the OS. + public string OSType { get; set; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/HyperVToAzStackHCIProtectedNicProperties.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/HyperVToAzStackHCIProtectedNicProperties.Serialization.cs new file mode 100644 index 000000000000..9b0a6fa88f5c --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/HyperVToAzStackHCIProtectedNicProperties.Serialization.cs @@ -0,0 +1,195 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + public partial class HyperVToAzStackHCIProtectedNicProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(HyperVToAzStackHCIProtectedNicProperties)} does not support writing '{format}' format."); + } + + if (options.Format != "W" && Optional.IsDefined(NicId)) + { + writer.WritePropertyName("nicId"u8); + writer.WriteStringValue(NicId); + } + if (options.Format != "W" && Optional.IsDefined(MacAddress)) + { + writer.WritePropertyName("macAddress"u8); + writer.WriteStringValue(MacAddress); + } + if (options.Format != "W" && Optional.IsDefined(NetworkName)) + { + writer.WritePropertyName("networkName"u8); + writer.WriteStringValue(NetworkName); + } + if (options.Format != "W" && Optional.IsDefined(TargetNetworkId)) + { + writer.WritePropertyName("targetNetworkId"u8); + writer.WriteStringValue(TargetNetworkId); + } + if (options.Format != "W" && Optional.IsDefined(TestNetworkId)) + { + writer.WritePropertyName("testNetworkId"u8); + writer.WriteStringValue(TestNetworkId); + } + if (options.Format != "W" && Optional.IsDefined(SelectionTypeForFailover)) + { + writer.WritePropertyName("selectionTypeForFailover"u8); + writer.WriteStringValue(SelectionTypeForFailover.Value.ToString()); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + HyperVToAzStackHCIProtectedNicProperties 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(HyperVToAzStackHCIProtectedNicProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeHyperVToAzStackHCIProtectedNicProperties(document.RootElement, options); + } + + internal static HyperVToAzStackHCIProtectedNicProperties DeserializeHyperVToAzStackHCIProtectedNicProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string nicId = default; + string macAddress = default; + string networkName = default; + string targetNetworkId = default; + string testNetworkId = default; + VmNicSelection? selectionTypeForFailover = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("nicId"u8)) + { + nicId = property.Value.GetString(); + continue; + } + if (property.NameEquals("macAddress"u8)) + { + macAddress = property.Value.GetString(); + continue; + } + if (property.NameEquals("networkName"u8)) + { + networkName = property.Value.GetString(); + continue; + } + if (property.NameEquals("targetNetworkId"u8)) + { + targetNetworkId = property.Value.GetString(); + continue; + } + if (property.NameEquals("testNetworkId"u8)) + { + testNetworkId = property.Value.GetString(); + continue; + } + if (property.NameEquals("selectionTypeForFailover"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + selectionTypeForFailover = new VmNicSelection(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new HyperVToAzStackHCIProtectedNicProperties( + nicId, + macAddress, + networkName, + targetNetworkId, + testNetworkId, + selectionTypeForFailover, + 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(HyperVToAzStackHCIProtectedNicProperties)} does not support writing '{options.Format}' format."); + } + } + + HyperVToAzStackHCIProtectedNicProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeHyperVToAzStackHCIProtectedNicProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(HyperVToAzStackHCIProtectedNicProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/HyperVToAzStackHCIProtectedNicProperties.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/HyperVToAzStackHCIProtectedNicProperties.cs new file mode 100644 index 000000000000..34dd2ff1350e --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/HyperVToAzStackHCIProtectedNicProperties.cs @@ -0,0 +1,85 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + /// HyperVToAzStackHCI NIC properties. + public partial class HyperVToAzStackHCIProtectedNicProperties + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + internal HyperVToAzStackHCIProtectedNicProperties() + { + } + + /// Initializes a new instance of . + /// Gets or sets the NIC Id. + /// Gets or sets the NIC mac address. + /// Gets or sets the network name. + /// Gets or sets the target network Id within AzStackHCI Cluster. + /// Gets or sets the target test network Id within AzStackHCI Cluster. + /// Gets or sets the selection type of the NIC. + /// Keeps track of any properties unknown to the library. + internal HyperVToAzStackHCIProtectedNicProperties(string nicId, string macAddress, string networkName, string targetNetworkId, string testNetworkId, VmNicSelection? selectionTypeForFailover, IDictionary serializedAdditionalRawData) + { + NicId = nicId; + MacAddress = macAddress; + NetworkName = networkName; + TargetNetworkId = targetNetworkId; + TestNetworkId = testNetworkId; + SelectionTypeForFailover = selectionTypeForFailover; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Gets or sets the NIC Id. + public string NicId { get; } + /// Gets or sets the NIC mac address. + public string MacAddress { get; } + /// Gets or sets the network name. + public string NetworkName { get; } + /// Gets or sets the target network Id within AzStackHCI Cluster. + public string TargetNetworkId { get; } + /// Gets or sets the target test network Id within AzStackHCI Cluster. + public string TestNetworkId { get; } + /// Gets or sets the selection type of the NIC. + public VmNicSelection? SelectionTypeForFailover { get; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/HyperVToAzStackHCIRecoveryPointModelCustomProperties.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/HyperVToAzStackHCIRecoveryPointModelCustomProperties.Serialization.cs new file mode 100644 index 000000000000..908ea187b491 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/HyperVToAzStackHCIRecoveryPointModelCustomProperties.Serialization.cs @@ -0,0 +1,135 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + public partial class HyperVToAzStackHCIRecoveryPointModelCustomProperties : 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(HyperVToAzStackHCIRecoveryPointModelCustomProperties)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (options.Format != "W" && Optional.IsCollectionDefined(DiskIds)) + { + writer.WritePropertyName("diskIds"u8); + writer.WriteStartArray(); + foreach (var item in DiskIds) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + } + + HyperVToAzStackHCIRecoveryPointModelCustomProperties 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(HyperVToAzStackHCIRecoveryPointModelCustomProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeHyperVToAzStackHCIRecoveryPointModelCustomProperties(document.RootElement, options); + } + + internal static HyperVToAzStackHCIRecoveryPointModelCustomProperties DeserializeHyperVToAzStackHCIRecoveryPointModelCustomProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IReadOnlyList diskIds = default; + string instanceType = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("diskIds"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + diskIds = array; + continue; + } + if (property.NameEquals("instanceType"u8)) + { + instanceType = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new HyperVToAzStackHCIRecoveryPointModelCustomProperties(instanceType, serializedAdditionalRawData, diskIds ?? new ChangeTrackingList()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(HyperVToAzStackHCIRecoveryPointModelCustomProperties)} does not support writing '{options.Format}' format."); + } + } + + HyperVToAzStackHCIRecoveryPointModelCustomProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeHyperVToAzStackHCIRecoveryPointModelCustomProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(HyperVToAzStackHCIRecoveryPointModelCustomProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/HyperVToAzStackHCIRecoveryPointModelCustomProperties.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/HyperVToAzStackHCIRecoveryPointModelCustomProperties.cs new file mode 100644 index 000000000000..0c923afd9783 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/HyperVToAzStackHCIRecoveryPointModelCustomProperties.cs @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + /// HyperV to AzStackHCI recovery point model custom properties. + public partial class HyperVToAzStackHCIRecoveryPointModelCustomProperties : RecoveryPointModelCustomProperties + { + /// Initializes a new instance of . + internal HyperVToAzStackHCIRecoveryPointModelCustomProperties() + { + DiskIds = new ChangeTrackingList(); + InstanceType = "HyperVToAzStackHCI"; + } + + /// Initializes a new instance of . + /// Discriminator property for RecoveryPointModelCustomProperties. + /// Keeps track of any properties unknown to the library. + /// Gets or sets the list of the disk Ids. + internal HyperVToAzStackHCIRecoveryPointModelCustomProperties(string instanceType, IDictionary serializedAdditionalRawData, IReadOnlyList diskIds) : base(instanceType, serializedAdditionalRawData) + { + DiskIds = diskIds; + InstanceType = instanceType ?? "HyperVToAzStackHCI"; + } + + /// Gets or sets the list of the disk Ids. + public IReadOnlyList DiskIds { get; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/HyperVToAzStackHCIReplicationExtensionModelCustomProperties.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/HyperVToAzStackHCIReplicationExtensionModelCustomProperties.Serialization.cs new file mode 100644 index 000000000000..8077f20b3e19 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/HyperVToAzStackHCIReplicationExtensionModelCustomProperties.Serialization.cs @@ -0,0 +1,298 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + public partial class HyperVToAzStackHCIReplicationExtensionModelCustomProperties : 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(HyperVToAzStackHCIReplicationExtensionModelCustomProperties)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + writer.WritePropertyName("hyperVFabricArmId"u8); + writer.WriteStringValue(HyperVFabricArmId); + if (options.Format != "W" && Optional.IsDefined(HyperVSiteId)) + { + writer.WritePropertyName("hyperVSiteId"u8); + writer.WriteStringValue(HyperVSiteId); + } + writer.WritePropertyName("azStackHciFabricArmId"u8); + writer.WriteStringValue(AzStackHciFabricArmId); + if (options.Format != "W" && Optional.IsDefined(AzStackHciSiteId)) + { + writer.WritePropertyName("azStackHciSiteId"u8); + writer.WriteStringValue(AzStackHciSiteId); + } + if (Optional.IsDefined(StorageAccountId)) + { + writer.WritePropertyName("storageAccountId"u8); + writer.WriteStringValue(StorageAccountId); + } + if (Optional.IsDefined(StorageAccountSasSecretName)) + { + writer.WritePropertyName("storageAccountSasSecretName"u8); + writer.WriteStringValue(StorageAccountSasSecretName); + } + if (options.Format != "W" && Optional.IsDefined(AsrServiceUri)) + { + writer.WritePropertyName("asrServiceUri"u8); + writer.WriteStringValue(AsrServiceUri); + } + if (options.Format != "W" && Optional.IsDefined(RcmServiceUri)) + { + writer.WritePropertyName("rcmServiceUri"u8); + writer.WriteStringValue(RcmServiceUri); + } + if (options.Format != "W" && Optional.IsDefined(GatewayServiceUri)) + { + writer.WritePropertyName("gatewayServiceUri"u8); + writer.WriteStringValue(GatewayServiceUri); + } + if (options.Format != "W" && Optional.IsDefined(SourceGatewayServiceId)) + { + writer.WritePropertyName("sourceGatewayServiceId"u8); + writer.WriteStringValue(SourceGatewayServiceId); + } + if (options.Format != "W" && Optional.IsDefined(TargetGatewayServiceId)) + { + writer.WritePropertyName("targetGatewayServiceId"u8); + writer.WriteStringValue(TargetGatewayServiceId); + } + if (options.Format != "W" && Optional.IsDefined(SourceStorageContainerName)) + { + writer.WritePropertyName("sourceStorageContainerName"u8); + writer.WriteStringValue(SourceStorageContainerName); + } + if (options.Format != "W" && Optional.IsDefined(TargetStorageContainerName)) + { + writer.WritePropertyName("targetStorageContainerName"u8); + writer.WriteStringValue(TargetStorageContainerName); + } + if (options.Format != "W" && Optional.IsDefined(ResourceLocation)) + { + writer.WritePropertyName("resourceLocation"u8); + writer.WriteStringValue(ResourceLocation); + } + if (options.Format != "W" && Optional.IsDefined(SubscriptionId)) + { + writer.WritePropertyName("subscriptionId"u8); + writer.WriteStringValue(SubscriptionId); + } + if (options.Format != "W" && Optional.IsDefined(ResourceGroup)) + { + writer.WritePropertyName("resourceGroup"u8); + writer.WriteStringValue(ResourceGroup); + } + } + + HyperVToAzStackHCIReplicationExtensionModelCustomProperties 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(HyperVToAzStackHCIReplicationExtensionModelCustomProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeHyperVToAzStackHCIReplicationExtensionModelCustomProperties(document.RootElement, options); + } + + internal static HyperVToAzStackHCIReplicationExtensionModelCustomProperties DeserializeHyperVToAzStackHCIReplicationExtensionModelCustomProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string hyperVFabricArmId = default; + string hyperVSiteId = default; + string azStackHciFabricArmId = default; + string azStackHciSiteId = default; + string storageAccountId = default; + string storageAccountSasSecretName = default; + string asrServiceUri = default; + string rcmServiceUri = default; + string gatewayServiceUri = default; + string sourceGatewayServiceId = default; + string targetGatewayServiceId = default; + string sourceStorageContainerName = default; + string targetStorageContainerName = default; + string resourceLocation = default; + string subscriptionId = default; + string resourceGroup = default; + string instanceType = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("hyperVFabricArmId"u8)) + { + hyperVFabricArmId = property.Value.GetString(); + continue; + } + if (property.NameEquals("hyperVSiteId"u8)) + { + hyperVSiteId = property.Value.GetString(); + continue; + } + if (property.NameEquals("azStackHciFabricArmId"u8)) + { + azStackHciFabricArmId = property.Value.GetString(); + continue; + } + if (property.NameEquals("azStackHciSiteId"u8)) + { + azStackHciSiteId = property.Value.GetString(); + continue; + } + if (property.NameEquals("storageAccountId"u8)) + { + storageAccountId = property.Value.GetString(); + continue; + } + if (property.NameEquals("storageAccountSasSecretName"u8)) + { + storageAccountSasSecretName = property.Value.GetString(); + continue; + } + if (property.NameEquals("asrServiceUri"u8)) + { + asrServiceUri = property.Value.GetString(); + continue; + } + if (property.NameEquals("rcmServiceUri"u8)) + { + rcmServiceUri = property.Value.GetString(); + continue; + } + if (property.NameEquals("gatewayServiceUri"u8)) + { + gatewayServiceUri = property.Value.GetString(); + continue; + } + if (property.NameEquals("sourceGatewayServiceId"u8)) + { + sourceGatewayServiceId = property.Value.GetString(); + continue; + } + if (property.NameEquals("targetGatewayServiceId"u8)) + { + targetGatewayServiceId = property.Value.GetString(); + continue; + } + if (property.NameEquals("sourceStorageContainerName"u8)) + { + sourceStorageContainerName = property.Value.GetString(); + continue; + } + if (property.NameEquals("targetStorageContainerName"u8)) + { + targetStorageContainerName = property.Value.GetString(); + continue; + } + if (property.NameEquals("resourceLocation"u8)) + { + resourceLocation = property.Value.GetString(); + continue; + } + if (property.NameEquals("subscriptionId"u8)) + { + subscriptionId = property.Value.GetString(); + continue; + } + if (property.NameEquals("resourceGroup"u8)) + { + resourceGroup = property.Value.GetString(); + continue; + } + if (property.NameEquals("instanceType"u8)) + { + instanceType = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new HyperVToAzStackHCIReplicationExtensionModelCustomProperties( + instanceType, + serializedAdditionalRawData, + hyperVFabricArmId, + hyperVSiteId, + azStackHciFabricArmId, + azStackHciSiteId, + storageAccountId, + storageAccountSasSecretName, + asrServiceUri, + rcmServiceUri, + gatewayServiceUri, + sourceGatewayServiceId, + targetGatewayServiceId, + sourceStorageContainerName, + targetStorageContainerName, + resourceLocation, + subscriptionId, + resourceGroup); + } + + 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(HyperVToAzStackHCIReplicationExtensionModelCustomProperties)} does not support writing '{options.Format}' format."); + } + } + + HyperVToAzStackHCIReplicationExtensionModelCustomProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeHyperVToAzStackHCIReplicationExtensionModelCustomProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(HyperVToAzStackHCIReplicationExtensionModelCustomProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/HyperVToAzStackHCIReplicationExtensionModelCustomProperties.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/HyperVToAzStackHCIReplicationExtensionModelCustomProperties.cs new file mode 100644 index 000000000000..2dac0943e92e --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/HyperVToAzStackHCIReplicationExtensionModelCustomProperties.cs @@ -0,0 +1,108 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + /// HyperV to AzStackHCI Replication extension model custom properties. + public partial class HyperVToAzStackHCIReplicationExtensionModelCustomProperties : ReplicationExtensionModelCustomProperties + { + /// Initializes a new instance of . + /// Gets or sets the ARM Id of the source HyperV fabric. + /// Gets or sets the ARM Id of the target AzStackHCI fabric. + /// or is null. + public HyperVToAzStackHCIReplicationExtensionModelCustomProperties(string hyperVFabricArmId, string azStackHciFabricArmId) + { + Argument.AssertNotNull(hyperVFabricArmId, nameof(hyperVFabricArmId)); + Argument.AssertNotNull(azStackHciFabricArmId, nameof(azStackHciFabricArmId)); + + HyperVFabricArmId = hyperVFabricArmId; + AzStackHciFabricArmId = azStackHciFabricArmId; + InstanceType = "HyperVToAzStackHCI"; + } + + /// Initializes a new instance of . + /// Discriminator property for ReplicationExtensionModelCustomProperties. + /// Keeps track of any properties unknown to the library. + /// Gets or sets the ARM Id of the source HyperV fabric. + /// Gets or sets the ARM Id of the HyperV site. + /// Gets or sets the ARM Id of the target AzStackHCI fabric. + /// Gets or sets the ARM Id of the AzStackHCI site. + /// Gets or sets the storage account Id. + /// Gets or sets the Sas Secret of storage account. + /// Gets or sets the Uri of ASR. + /// Gets or sets the Uri of Rcm. + /// Gets or sets the Uri of Gateway. + /// Gets or sets the gateway service Id of source. + /// Gets or sets the gateway service Id of target. + /// Gets or sets the source storage container name. + /// Gets or sets the target storage container name. + /// Gets or sets the resource location. + /// Gets or sets the subscription. + /// Gets or sets the resource group. + internal HyperVToAzStackHCIReplicationExtensionModelCustomProperties(string instanceType, IDictionary serializedAdditionalRawData, string hyperVFabricArmId, string hyperVSiteId, string azStackHciFabricArmId, string azStackHciSiteId, string storageAccountId, string storageAccountSasSecretName, string asrServiceUri, string rcmServiceUri, string gatewayServiceUri, string sourceGatewayServiceId, string targetGatewayServiceId, string sourceStorageContainerName, string targetStorageContainerName, string resourceLocation, string subscriptionId, string resourceGroup) : base(instanceType, serializedAdditionalRawData) + { + HyperVFabricArmId = hyperVFabricArmId; + HyperVSiteId = hyperVSiteId; + AzStackHciFabricArmId = azStackHciFabricArmId; + AzStackHciSiteId = azStackHciSiteId; + StorageAccountId = storageAccountId; + StorageAccountSasSecretName = storageAccountSasSecretName; + AsrServiceUri = asrServiceUri; + RcmServiceUri = rcmServiceUri; + GatewayServiceUri = gatewayServiceUri; + SourceGatewayServiceId = sourceGatewayServiceId; + TargetGatewayServiceId = targetGatewayServiceId; + SourceStorageContainerName = sourceStorageContainerName; + TargetStorageContainerName = targetStorageContainerName; + ResourceLocation = resourceLocation; + SubscriptionId = subscriptionId; + ResourceGroup = resourceGroup; + InstanceType = instanceType ?? "HyperVToAzStackHCI"; + } + + /// Initializes a new instance of for deserialization. + internal HyperVToAzStackHCIReplicationExtensionModelCustomProperties() + { + } + + /// Gets or sets the ARM Id of the source HyperV fabric. + public string HyperVFabricArmId { get; set; } + /// Gets or sets the ARM Id of the HyperV site. + public string HyperVSiteId { get; } + /// Gets or sets the ARM Id of the target AzStackHCI fabric. + public string AzStackHciFabricArmId { get; set; } + /// Gets or sets the ARM Id of the AzStackHCI site. + public string AzStackHciSiteId { get; } + /// Gets or sets the storage account Id. + public string StorageAccountId { get; set; } + /// Gets or sets the Sas Secret of storage account. + public string StorageAccountSasSecretName { get; set; } + /// Gets or sets the Uri of ASR. + public string AsrServiceUri { get; } + /// Gets or sets the Uri of Rcm. + public string RcmServiceUri { get; } + /// Gets or sets the Uri of Gateway. + public string GatewayServiceUri { get; } + /// Gets or sets the gateway service Id of source. + public string SourceGatewayServiceId { get; } + /// Gets or sets the gateway service Id of target. + public string TargetGatewayServiceId { get; } + /// Gets or sets the source storage container name. + public string SourceStorageContainerName { get; } + /// Gets or sets the target storage container name. + public string TargetStorageContainerName { get; } + /// Gets or sets the resource location. + public string ResourceLocation { get; } + /// Gets or sets the subscription. + public string SubscriptionId { get; } + /// Gets or sets the resource group. + public string ResourceGroup { get; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/IdentityModel.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/IdentityModel.Serialization.cs new file mode 100644 index 000000000000..1a31cb91d21a --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/IdentityModel.Serialization.cs @@ -0,0 +1,164 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + public partial class IdentityModel : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(IdentityModel)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("tenantId"u8); + writer.WriteStringValue(TenantId); + writer.WritePropertyName("applicationId"u8); + writer.WriteStringValue(ApplicationId); + writer.WritePropertyName("objectId"u8); + writer.WriteStringValue(ObjectId); + writer.WritePropertyName("audience"u8); + writer.WriteStringValue(Audience); + writer.WritePropertyName("aadAuthority"u8); + writer.WriteStringValue(AadAuthority); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + IdentityModel 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(IdentityModel)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeIdentityModel(document.RootElement, options); + } + + internal static IdentityModel DeserializeIdentityModel(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string tenantId = default; + string applicationId = default; + string objectId = default; + string audience = default; + string aadAuthority = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("tenantId"u8)) + { + tenantId = property.Value.GetString(); + continue; + } + if (property.NameEquals("applicationId"u8)) + { + applicationId = property.Value.GetString(); + continue; + } + if (property.NameEquals("objectId"u8)) + { + objectId = property.Value.GetString(); + continue; + } + if (property.NameEquals("audience"u8)) + { + audience = property.Value.GetString(); + continue; + } + if (property.NameEquals("aadAuthority"u8)) + { + aadAuthority = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new IdentityModel( + tenantId, + applicationId, + objectId, + audience, + aadAuthority, + 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(IdentityModel)} does not support writing '{options.Format}' format."); + } + } + + IdentityModel IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeIdentityModel(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(IdentityModel)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/IdentityModel.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/IdentityModel.cs new file mode 100644 index 000000000000..ad053c1893db --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/IdentityModel.cs @@ -0,0 +1,103 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + /// Identity model. + public partial class IdentityModel + { + /// + /// 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 . + /// Gets or sets the tenant Id of the SPN with which fabric agent communicates to service. + /// Gets or sets the client/application Id of the SPN with which fabric agent communicates to service. + /// Gets or sets the object Id of the SPN with which fabric agent communicates to service. + /// Gets or sets the audience of the SPN with which fabric agent communicates to service. + /// Gets or sets the authority of the SPN with which fabric agent communicates to service. + /// , , , or is null. + public IdentityModel(string tenantId, string applicationId, string objectId, string audience, string aadAuthority) + { + Argument.AssertNotNull(tenantId, nameof(tenantId)); + Argument.AssertNotNull(applicationId, nameof(applicationId)); + Argument.AssertNotNull(objectId, nameof(objectId)); + Argument.AssertNotNull(audience, nameof(audience)); + Argument.AssertNotNull(aadAuthority, nameof(aadAuthority)); + + TenantId = tenantId; + ApplicationId = applicationId; + ObjectId = objectId; + Audience = audience; + AadAuthority = aadAuthority; + } + + /// Initializes a new instance of . + /// Gets or sets the tenant Id of the SPN with which fabric agent communicates to service. + /// Gets or sets the client/application Id of the SPN with which fabric agent communicates to service. + /// Gets or sets the object Id of the SPN with which fabric agent communicates to service. + /// Gets or sets the audience of the SPN with which fabric agent communicates to service. + /// Gets or sets the authority of the SPN with which fabric agent communicates to service. + /// Keeps track of any properties unknown to the library. + internal IdentityModel(string tenantId, string applicationId, string objectId, string audience, string aadAuthority, IDictionary serializedAdditionalRawData) + { + TenantId = tenantId; + ApplicationId = applicationId; + ObjectId = objectId; + Audience = audience; + AadAuthority = aadAuthority; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal IdentityModel() + { + } + + /// Gets or sets the tenant Id of the SPN with which fabric agent communicates to service. + public string TenantId { get; set; } + /// Gets or sets the client/application Id of the SPN with which fabric agent communicates to service. + public string ApplicationId { get; set; } + /// Gets or sets the object Id of the SPN with which fabric agent communicates to service. + public string ObjectId { get; set; } + /// Gets or sets the audience of the SPN with which fabric agent communicates to service. + public string Audience { get; set; } + /// Gets or sets the authority of the SPN with which fabric agent communicates to service. + public string AadAuthority { get; set; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/InnerHealthErrorModel.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/InnerHealthErrorModel.Serialization.cs new file mode 100644 index 000000000000..3ae52dfc130e --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/InnerHealthErrorModel.Serialization.cs @@ -0,0 +1,259 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + public partial class InnerHealthErrorModel : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(InnerHealthErrorModel)} does not support writing '{format}' format."); + } + + if (options.Format != "W" && Optional.IsDefined(Code)) + { + writer.WritePropertyName("code"u8); + writer.WriteStringValue(Code); + } + if (options.Format != "W" && Optional.IsDefined(HealthCategory)) + { + writer.WritePropertyName("healthCategory"u8); + writer.WriteStringValue(HealthCategory); + } + if (options.Format != "W" && Optional.IsDefined(Category)) + { + writer.WritePropertyName("category"u8); + writer.WriteStringValue(Category); + } + if (options.Format != "W" && Optional.IsDefined(Severity)) + { + writer.WritePropertyName("severity"u8); + writer.WriteStringValue(Severity); + } + if (options.Format != "W" && Optional.IsDefined(Source)) + { + writer.WritePropertyName("source"u8); + writer.WriteStringValue(Source); + } + if (options.Format != "W" && Optional.IsDefined(CreatedOn)) + { + writer.WritePropertyName("creationTime"u8); + writer.WriteStringValue(CreatedOn.Value, "O"); + } + if (options.Format != "W" && Optional.IsDefined(IsCustomerResolvable)) + { + writer.WritePropertyName("isCustomerResolvable"u8); + writer.WriteBooleanValue(IsCustomerResolvable.Value); + } + if (options.Format != "W" && Optional.IsDefined(Summary)) + { + writer.WritePropertyName("summary"u8); + writer.WriteStringValue(Summary); + } + if (options.Format != "W" && Optional.IsDefined(Message)) + { + writer.WritePropertyName("message"u8); + writer.WriteStringValue(Message); + } + if (options.Format != "W" && Optional.IsDefined(Causes)) + { + writer.WritePropertyName("causes"u8); + writer.WriteStringValue(Causes); + } + if (options.Format != "W" && Optional.IsDefined(Recommendation)) + { + writer.WritePropertyName("recommendation"u8); + writer.WriteStringValue(Recommendation); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + InnerHealthErrorModel 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(InnerHealthErrorModel)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeInnerHealthErrorModel(document.RootElement, options); + } + + internal static InnerHealthErrorModel DeserializeInnerHealthErrorModel(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string code = default; + string healthCategory = default; + string category = default; + string severity = default; + string source = default; + DateTimeOffset? creationTime = default; + bool? isCustomerResolvable = default; + string summary = default; + string message = default; + string causes = default; + string recommendation = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("code"u8)) + { + code = property.Value.GetString(); + continue; + } + if (property.NameEquals("healthCategory"u8)) + { + healthCategory = property.Value.GetString(); + continue; + } + if (property.NameEquals("category"u8)) + { + category = property.Value.GetString(); + continue; + } + if (property.NameEquals("severity"u8)) + { + severity = property.Value.GetString(); + continue; + } + if (property.NameEquals("source"u8)) + { + source = property.Value.GetString(); + continue; + } + if (property.NameEquals("creationTime"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + creationTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("isCustomerResolvable"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + isCustomerResolvable = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("summary"u8)) + { + summary = property.Value.GetString(); + continue; + } + if (property.NameEquals("message"u8)) + { + message = property.Value.GetString(); + continue; + } + if (property.NameEquals("causes"u8)) + { + causes = property.Value.GetString(); + continue; + } + if (property.NameEquals("recommendation"u8)) + { + recommendation = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new InnerHealthErrorModel( + code, + healthCategory, + category, + severity, + source, + creationTime, + isCustomerResolvable, + summary, + message, + causes, + recommendation, + 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(InnerHealthErrorModel)} does not support writing '{options.Format}' format."); + } + } + + InnerHealthErrorModel IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeInnerHealthErrorModel(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(InnerHealthErrorModel)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/InnerHealthErrorModel.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/InnerHealthErrorModel.cs new file mode 100644 index 000000000000..43c2fa9cdcb7 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/InnerHealthErrorModel.cs @@ -0,0 +1,105 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + /// Inner health error model. + public partial class InnerHealthErrorModel + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + internal InnerHealthErrorModel() + { + } + + /// Initializes a new instance of . + /// Gets or sets the error code. + /// Gets or sets the health category. + /// Gets or sets the error category. + /// Gets or sets the error severity. + /// Gets or sets the error source. + /// Gets or sets the error creation time. + /// Gets or sets a value indicating whether the error is customer resolvable. + /// Gets or sets the error summary. + /// Gets or sets the error message. + /// Gets or sets possible causes of the error. + /// Gets or sets recommended action to resolve the error. + /// Keeps track of any properties unknown to the library. + internal InnerHealthErrorModel(string code, string healthCategory, string category, string severity, string source, DateTimeOffset? createdOn, bool? isCustomerResolvable, string summary, string message, string causes, string recommendation, IDictionary serializedAdditionalRawData) + { + Code = code; + HealthCategory = healthCategory; + Category = category; + Severity = severity; + Source = source; + CreatedOn = createdOn; + IsCustomerResolvable = isCustomerResolvable; + Summary = summary; + Message = message; + Causes = causes; + Recommendation = recommendation; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Gets or sets the error code. + public string Code { get; } + /// Gets or sets the health category. + public string HealthCategory { get; } + /// Gets or sets the error category. + public string Category { get; } + /// Gets or sets the error severity. + public string Severity { get; } + /// Gets or sets the error source. + public string Source { get; } + /// Gets or sets the error creation time. + public DateTimeOffset? CreatedOn { get; } + /// Gets or sets a value indicating whether the error is customer resolvable. + public bool? IsCustomerResolvable { get; } + /// Gets or sets the error summary. + public string Summary { get; } + /// Gets or sets the error message. + public string Message { get; } + /// Gets or sets possible causes of the error. + public string Causes { get; } + /// Gets or sets recommended action to resolve the error. + public string Recommendation { get; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/JobModelCustomProperties.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/JobModelCustomProperties.Serialization.cs new file mode 100644 index 000000000000..edcdbd374844 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/JobModelCustomProperties.Serialization.cs @@ -0,0 +1,124 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + [PersistableModelProxy(typeof(UnknownJobModelCustomProperties))] + public partial class JobModelCustomProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(JobModelCustomProperties)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("instanceType"u8); + writer.WriteStringValue(InstanceType); + if (options.Format != "W" && Optional.IsDefined(AffectedObjectDetails)) + { + writer.WritePropertyName("affectedObjectDetails"u8); + writer.WriteObjectValue(AffectedObjectDetails, options); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + JobModelCustomProperties 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(JobModelCustomProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeJobModelCustomProperties(document.RootElement, options); + } + + internal static JobModelCustomProperties DeserializeJobModelCustomProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + if (element.TryGetProperty("instanceType", out JsonElement discriminator)) + { + switch (discriminator.GetString()) + { + case "FailoverJobDetails": return FailoverJobModelCustomProperties.DeserializeFailoverJobModelCustomProperties(element, options); + case "TestFailoverCleanupJobDetails": return TestFailoverCleanupJobModelCustomProperties.DeserializeTestFailoverCleanupJobModelCustomProperties(element, options); + case "TestFailoverJobDetails": return TestFailoverJobModelCustomProperties.DeserializeTestFailoverJobModelCustomProperties(element, options); + } + } + return UnknownJobModelCustomProperties.DeserializeUnknownJobModelCustomProperties(element, options); + } + + 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(JobModelCustomProperties)} does not support writing '{options.Format}' format."); + } + } + + JobModelCustomProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeJobModelCustomProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(JobModelCustomProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/JobModelCustomProperties.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/JobModelCustomProperties.cs new file mode 100644 index 000000000000..4c7142b0dc88 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/JobModelCustomProperties.cs @@ -0,0 +1,73 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + /// + /// Job model custom properties. + /// 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 . + /// + public abstract partial class JobModelCustomProperties + { + /// + /// 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 protected IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + protected JobModelCustomProperties() + { + } + + /// Initializes a new instance of . + /// Discriminator property for JobModelCustomProperties. + /// Gets or sets any custom properties of the affected object. + /// Keeps track of any properties unknown to the library. + internal JobModelCustomProperties(string instanceType, JobModelCustomPropertiesAffectedObjectDetails affectedObjectDetails, IDictionary serializedAdditionalRawData) + { + InstanceType = instanceType; + AffectedObjectDetails = affectedObjectDetails; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Discriminator property for JobModelCustomProperties. + internal string InstanceType { get; set; } + /// Gets or sets any custom properties of the affected object. + public JobModelCustomPropertiesAffectedObjectDetails AffectedObjectDetails { get; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/JobModelCustomPropertiesAffectedObjectDetails.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/JobModelCustomPropertiesAffectedObjectDetails.Serialization.cs new file mode 100644 index 000000000000..6551c82b96e4 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/JobModelCustomPropertiesAffectedObjectDetails.Serialization.cs @@ -0,0 +1,144 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + public partial class JobModelCustomPropertiesAffectedObjectDetails : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(JobModelCustomPropertiesAffectedObjectDetails)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(Description)) + { + writer.WritePropertyName("description"u8); + writer.WriteStringValue(Description); + } + if (Optional.IsDefined(Type)) + { + writer.WritePropertyName("type"u8); + writer.WriteStringValue(Type.Value.ToString()); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + JobModelCustomPropertiesAffectedObjectDetails 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(JobModelCustomPropertiesAffectedObjectDetails)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeJobModelCustomPropertiesAffectedObjectDetails(document.RootElement, options); + } + + internal static JobModelCustomPropertiesAffectedObjectDetails DeserializeJobModelCustomPropertiesAffectedObjectDetails(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string description = default; + JobModelCustomPropertiesAffectedObjectDetailsType? type = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("description"u8)) + { + description = property.Value.GetString(); + continue; + } + if (property.NameEquals("type"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + type = new JobModelCustomPropertiesAffectedObjectDetailsType(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new JobModelCustomPropertiesAffectedObjectDetails(description, type, 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(JobModelCustomPropertiesAffectedObjectDetails)} does not support writing '{options.Format}' format."); + } + } + + JobModelCustomPropertiesAffectedObjectDetails IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeJobModelCustomPropertiesAffectedObjectDetails(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(JobModelCustomPropertiesAffectedObjectDetails)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/JobModelCustomPropertiesAffectedObjectDetails.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/JobModelCustomPropertiesAffectedObjectDetails.cs new file mode 100644 index 000000000000..f164407b0c96 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/JobModelCustomPropertiesAffectedObjectDetails.cs @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + /// The JobModelCustomPropertiesAffectedObjectDetails. + public partial class JobModelCustomPropertiesAffectedObjectDetails + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + internal JobModelCustomPropertiesAffectedObjectDetails() + { + } + + /// Initializes a new instance of . + /// + /// + /// Keeps track of any properties unknown to the library. + internal JobModelCustomPropertiesAffectedObjectDetails(string description, JobModelCustomPropertiesAffectedObjectDetailsType? type, IDictionary serializedAdditionalRawData) + { + Description = description; + Type = type; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Gets the description. + public string Description { get; } + /// Gets the type. + public JobModelCustomPropertiesAffectedObjectDetailsType? Type { get; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/JobModelCustomPropertiesAffectedObjectDetailsType.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/JobModelCustomPropertiesAffectedObjectDetailsType.cs new file mode 100644 index 000000000000..fbc06c6e77d8 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/JobModelCustomPropertiesAffectedObjectDetailsType.cs @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + /// The JobModelCustomPropertiesAffectedObjectDetails_type. + public readonly partial struct JobModelCustomPropertiesAffectedObjectDetailsType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public JobModelCustomPropertiesAffectedObjectDetailsType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string ObjectValue = "object"; + + /// object. + public static JobModelCustomPropertiesAffectedObjectDetailsType Object { get; } = new JobModelCustomPropertiesAffectedObjectDetailsType(ObjectValue); + /// Determines if two values are the same. + public static bool operator ==(JobModelCustomPropertiesAffectedObjectDetailsType left, JobModelCustomPropertiesAffectedObjectDetailsType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(JobModelCustomPropertiesAffectedObjectDetailsType left, JobModelCustomPropertiesAffectedObjectDetailsType right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator JobModelCustomPropertiesAffectedObjectDetailsType(string value) => new JobModelCustomPropertiesAffectedObjectDetailsType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is JobModelCustomPropertiesAffectedObjectDetailsType other && Equals(other); + /// + public bool Equals(JobModelCustomPropertiesAffectedObjectDetailsType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/JobModelListResult.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/JobModelListResult.Serialization.cs new file mode 100644 index 000000000000..a543c7c26d54 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/JobModelListResult.Serialization.cs @@ -0,0 +1,151 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + internal partial class JobModelListResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(JobModelListResult)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var item in Value) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + if (Optional.IsDefined(NextLink)) + { + writer.WritePropertyName("nextLink"u8); + writer.WriteStringValue(NextLink.AbsoluteUri); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + JobModelListResult 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(JobModelListResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeJobModelListResult(document.RootElement, options); + } + + internal static JobModelListResult DeserializeJobModelListResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IReadOnlyList value = default; + Uri nextLink = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(JobModelData.DeserializeJobModelData(item, options)); + } + value = array; + continue; + } + if (property.NameEquals("nextLink"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + nextLink = new Uri(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new JobModelListResult(value, nextLink, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(JobModelListResult)} does not support writing '{options.Format}' format."); + } + } + + JobModelListResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeJobModelListResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(JobModelListResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/JobModelListResult.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/JobModelListResult.cs new file mode 100644 index 000000000000..aad50c35084c --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/JobModelListResult.cs @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + /// The response of a JobModel list operation. + internal partial class JobModelListResult + { + /// + /// 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 JobModel items on this page. + /// is null. + internal JobModelListResult(IEnumerable value) + { + Argument.AssertNotNull(value, nameof(value)); + + Value = value.ToList(); + } + + /// Initializes a new instance of . + /// The JobModel items on this page. + /// The link to the next page of items. + /// Keeps track of any properties unknown to the library. + internal JobModelListResult(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) + { + Value = value; + NextLink = nextLink; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal JobModelListResult() + { + } + + /// The JobModel items on this page. + public IReadOnlyList Value { get; } + /// The link to the next page of items. + public Uri NextLink { get; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/JobModelProperties.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/JobModelProperties.Serialization.cs new file mode 100644 index 000000000000..72e845324a72 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/JobModelProperties.Serialization.cs @@ -0,0 +1,394 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + public partial class JobModelProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(JobModelProperties)} does not support writing '{format}' format."); + } + + if (options.Format != "W" && Optional.IsDefined(DisplayName)) + { + writer.WritePropertyName("displayName"u8); + writer.WriteStringValue(DisplayName); + } + if (options.Format != "W" && Optional.IsDefined(State)) + { + writer.WritePropertyName("state"u8); + writer.WriteStringValue(State.Value.ToString()); + } + if (options.Format != "W" && Optional.IsDefined(StartOn)) + { + writer.WritePropertyName("startTime"u8); + writer.WriteStringValue(StartOn.Value, "O"); + } + if (options.Format != "W" && Optional.IsDefined(EndOn)) + { + writer.WritePropertyName("endTime"u8); + writer.WriteStringValue(EndOn.Value, "O"); + } + if (options.Format != "W" && Optional.IsDefined(ObjectId)) + { + writer.WritePropertyName("objectId"u8); + writer.WriteStringValue(ObjectId); + } + if (options.Format != "W" && Optional.IsDefined(ObjectName)) + { + writer.WritePropertyName("objectName"u8); + writer.WriteStringValue(ObjectName); + } + if (options.Format != "W" && Optional.IsDefined(ObjectInternalId)) + { + writer.WritePropertyName("objectInternalId"u8); + writer.WriteStringValue(ObjectInternalId); + } + if (options.Format != "W" && Optional.IsDefined(ObjectInternalName)) + { + writer.WritePropertyName("objectInternalName"u8); + writer.WriteStringValue(ObjectInternalName); + } + if (options.Format != "W" && Optional.IsDefined(ObjectType)) + { + writer.WritePropertyName("objectType"u8); + writer.WriteStringValue(ObjectType.Value.ToString()); + } + if (options.Format != "W" && Optional.IsDefined(ReplicationProviderId)) + { + writer.WritePropertyName("replicationProviderId"u8); + writer.WriteStringValue(ReplicationProviderId); + } + if (options.Format != "W" && Optional.IsDefined(SourceFabricProviderId)) + { + writer.WritePropertyName("sourceFabricProviderId"u8); + writer.WriteStringValue(SourceFabricProviderId); + } + if (options.Format != "W" && Optional.IsDefined(TargetFabricProviderId)) + { + writer.WritePropertyName("targetFabricProviderId"u8); + writer.WriteStringValue(TargetFabricProviderId); + } + if (options.Format != "W" && Optional.IsCollectionDefined(AllowedActions)) + { + writer.WritePropertyName("allowedActions"u8); + writer.WriteStartArray(); + foreach (var item in AllowedActions) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && Optional.IsDefined(ActivityId)) + { + writer.WritePropertyName("activityId"u8); + writer.WriteStringValue(ActivityId); + } + if (options.Format != "W" && Optional.IsCollectionDefined(Tasks)) + { + writer.WritePropertyName("tasks"u8); + writer.WriteStartArray(); + foreach (var item in Tasks) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && Optional.IsCollectionDefined(Errors)) + { + writer.WritePropertyName("errors"u8); + writer.WriteStartArray(); + foreach (var item in Errors) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + writer.WritePropertyName("customProperties"u8); + writer.WriteObjectValue(CustomProperties, options); + if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) + { + writer.WritePropertyName("provisioningState"u8); + writer.WriteStringValue(ProvisioningState.Value.ToString()); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + JobModelProperties 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(JobModelProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeJobModelProperties(document.RootElement, options); + } + + internal static JobModelProperties DeserializeJobModelProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string displayName = default; + JobState? state = default; + DateTimeOffset? startTime = default; + DateTimeOffset? endTime = default; + string objectId = default; + string objectName = default; + string objectInternalId = default; + string objectInternalName = default; + JobObjectType? objectType = default; + string replicationProviderId = default; + string sourceFabricProviderId = default; + string targetFabricProviderId = default; + IReadOnlyList allowedActions = default; + string activityId = default; + IReadOnlyList tasks = default; + IReadOnlyList errors = default; + JobModelCustomProperties customProperties = default; + ProvisioningState? provisioningState = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("displayName"u8)) + { + displayName = property.Value.GetString(); + continue; + } + if (property.NameEquals("state"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + state = new JobState(property.Value.GetString()); + continue; + } + if (property.NameEquals("startTime"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + startTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("endTime"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + endTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("objectId"u8)) + { + objectId = property.Value.GetString(); + continue; + } + if (property.NameEquals("objectName"u8)) + { + objectName = property.Value.GetString(); + continue; + } + if (property.NameEquals("objectInternalId"u8)) + { + objectInternalId = property.Value.GetString(); + continue; + } + if (property.NameEquals("objectInternalName"u8)) + { + objectInternalName = property.Value.GetString(); + continue; + } + if (property.NameEquals("objectType"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + objectType = new JobObjectType(property.Value.GetString()); + continue; + } + if (property.NameEquals("replicationProviderId"u8)) + { + replicationProviderId = property.Value.GetString(); + continue; + } + if (property.NameEquals("sourceFabricProviderId"u8)) + { + sourceFabricProviderId = property.Value.GetString(); + continue; + } + if (property.NameEquals("targetFabricProviderId"u8)) + { + targetFabricProviderId = property.Value.GetString(); + continue; + } + if (property.NameEquals("allowedActions"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + allowedActions = array; + continue; + } + if (property.NameEquals("activityId"u8)) + { + activityId = property.Value.GetString(); + continue; + } + if (property.NameEquals("tasks"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(TaskModel.DeserializeTaskModel(item, options)); + } + tasks = array; + continue; + } + if (property.NameEquals("errors"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ErrorModel.DeserializeErrorModel(item, options)); + } + errors = array; + continue; + } + if (property.NameEquals("customProperties"u8)) + { + customProperties = JobModelCustomProperties.DeserializeJobModelCustomProperties(property.Value, options); + continue; + } + if (property.NameEquals("provisioningState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + provisioningState = new ProvisioningState(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new JobModelProperties( + displayName, + state, + startTime, + endTime, + objectId, + objectName, + objectInternalId, + objectInternalName, + objectType, + replicationProviderId, + sourceFabricProviderId, + targetFabricProviderId, + allowedActions ?? new ChangeTrackingList(), + activityId, + tasks ?? new ChangeTrackingList(), + errors ?? new ChangeTrackingList(), + customProperties, + provisioningState, + 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(JobModelProperties)} does not support writing '{options.Format}' format."); + } + } + + JobModelProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeJobModelProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(JobModelProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/JobModelProperties.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/JobModelProperties.cs new file mode 100644 index 000000000000..894b971611c6 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/JobModelProperties.cs @@ -0,0 +1,158 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + /// Job model properties. + public partial class JobModelProperties + { + /// + /// 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 . + /// + /// Job model custom properties. + /// 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 . + /// + /// is null. + internal JobModelProperties(JobModelCustomProperties customProperties) + { + Argument.AssertNotNull(customProperties, nameof(customProperties)); + + AllowedActions = new ChangeTrackingList(); + Tasks = new ChangeTrackingList(); + Errors = new ChangeTrackingList(); + CustomProperties = customProperties; + } + + /// Initializes a new instance of . + /// Gets or sets the friendly display name. + /// Gets or sets the job state. + /// Gets or sets the start time. + /// Gets or sets the end time. + /// Gets or sets the affected object Id. + /// Gets or sets the affected object name. + /// Gets or sets the affected object internal Id. + /// Gets or sets the affected object internal name. + /// Gets or sets the object type. + /// Gets or sets the replication provider. + /// Gets or sets the source fabric provider. + /// Gets or sets the target fabric provider. + /// Gets or sets the list of allowed actions on the job. + /// Gets or sets the job activity id. + /// Gets or sets the list of tasks. + /// Gets or sets the list of errors. + /// + /// Job model custom properties. + /// 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 . + /// + /// Gets or sets the provisioning state of the job. + /// Keeps track of any properties unknown to the library. + internal JobModelProperties(string displayName, JobState? state, DateTimeOffset? startOn, DateTimeOffset? endOn, string objectId, string objectName, string objectInternalId, string objectInternalName, JobObjectType? objectType, string replicationProviderId, string sourceFabricProviderId, string targetFabricProviderId, IReadOnlyList allowedActions, string activityId, IReadOnlyList tasks, IReadOnlyList errors, JobModelCustomProperties customProperties, ProvisioningState? provisioningState, IDictionary serializedAdditionalRawData) + { + DisplayName = displayName; + State = state; + StartOn = startOn; + EndOn = endOn; + ObjectId = objectId; + ObjectName = objectName; + ObjectInternalId = objectInternalId; + ObjectInternalName = objectInternalName; + ObjectType = objectType; + ReplicationProviderId = replicationProviderId; + SourceFabricProviderId = sourceFabricProviderId; + TargetFabricProviderId = targetFabricProviderId; + AllowedActions = allowedActions; + ActivityId = activityId; + Tasks = tasks; + Errors = errors; + CustomProperties = customProperties; + ProvisioningState = provisioningState; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal JobModelProperties() + { + } + + /// Gets or sets the friendly display name. + public string DisplayName { get; } + /// Gets or sets the job state. + public JobState? State { get; } + /// Gets or sets the start time. + public DateTimeOffset? StartOn { get; } + /// Gets or sets the end time. + public DateTimeOffset? EndOn { get; } + /// Gets or sets the affected object Id. + public string ObjectId { get; } + /// Gets or sets the affected object name. + public string ObjectName { get; } + /// Gets or sets the affected object internal Id. + public string ObjectInternalId { get; } + /// Gets or sets the affected object internal name. + public string ObjectInternalName { get; } + /// Gets or sets the object type. + public JobObjectType? ObjectType { get; } + /// Gets or sets the replication provider. + public string ReplicationProviderId { get; } + /// Gets or sets the source fabric provider. + public string SourceFabricProviderId { get; } + /// Gets or sets the target fabric provider. + public string TargetFabricProviderId { get; } + /// Gets or sets the list of allowed actions on the job. + public IReadOnlyList AllowedActions { get; } + /// Gets or sets the job activity id. + public string ActivityId { get; } + /// Gets or sets the list of tasks. + public IReadOnlyList Tasks { get; } + /// Gets or sets the list of errors. + public IReadOnlyList Errors { get; } + /// + /// Job model custom properties. + /// 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 . + /// + public JobModelCustomProperties CustomProperties { get; } + /// Gets or sets the provisioning state of the job. + public ProvisioningState? ProvisioningState { get; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/JobObjectType.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/JobObjectType.cs new file mode 100644 index 000000000000..d3912c1c08d8 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/JobObjectType.cs @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + /// Gets or sets the object type. + public readonly partial struct JobObjectType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public JobObjectType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string AvsDiskPoolValue = "AvsDiskPool"; + private const string FabricAgentValue = "FabricAgent"; + private const string FabricValue = "Fabric"; + private const string PolicyValue = "Policy"; + private const string ProtectedItemValue = "ProtectedItem"; + private const string RecoveryPlanValue = "RecoveryPlan"; + private const string ReplicationExtensionValue = "ReplicationExtension"; + private const string VaultValue = "Vault"; + + /// AVS disk pool. + public static JobObjectType AvsDiskPool { get; } = new JobObjectType(AvsDiskPoolValue); + /// Fabric agent level workflow. + public static JobObjectType FabricAgent { get; } = new JobObjectType(FabricAgentValue); + /// Fabric level job. + public static JobObjectType Fabric { get; } = new JobObjectType(FabricValue); + /// Policy level job. + public static JobObjectType Policy { get; } = new JobObjectType(PolicyValue); + /// Protected item level job. + public static JobObjectType ProtectedItem { get; } = new JobObjectType(ProtectedItemValue); + /// Recovery plan level job. + public static JobObjectType RecoveryPlan { get; } = new JobObjectType(RecoveryPlanValue); + /// Replication extension level job. + public static JobObjectType ReplicationExtension { get; } = new JobObjectType(ReplicationExtensionValue); + /// Vault level job. + public static JobObjectType Vault { get; } = new JobObjectType(VaultValue); + /// Determines if two values are the same. + public static bool operator ==(JobObjectType left, JobObjectType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(JobObjectType left, JobObjectType right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator JobObjectType(string value) => new JobObjectType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is JobObjectType other && Equals(other); + /// + public bool Equals(JobObjectType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/JobState.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/JobState.cs new file mode 100644 index 000000000000..ca92bba61150 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/JobState.cs @@ -0,0 +1,72 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + /// Gets or sets the job state. + public readonly partial struct JobState : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public JobState(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string PendingValue = "Pending"; + private const string StartedValue = "Started"; + private const string CancellingValue = "Cancelling"; + private const string SucceededValue = "Succeeded"; + private const string FailedValue = "Failed"; + private const string CancelledValue = "Cancelled"; + private const string CompletedWithInformationValue = "CompletedWithInformation"; + private const string CompletedWithWarningsValue = "CompletedWithWarnings"; + private const string CompletedWithErrorsValue = "CompletedWithErrors"; + + /// Job has not been started. + public static JobState Pending { get; } = new JobState(PendingValue); + /// Job is in progress. + public static JobState Started { get; } = new JobState(StartedValue); + /// Job cancellation is in progress. + public static JobState Cancelling { get; } = new JobState(CancellingValue); + /// Job has completed successfully. + public static JobState Succeeded { get; } = new JobState(SucceededValue); + /// Job failed. + public static JobState Failed { get; } = new JobState(FailedValue); + /// Job has been cancelled. + public static JobState Cancelled { get; } = new JobState(CancelledValue); + /// Job has completed with information. + public static JobState CompletedWithInformation { get; } = new JobState(CompletedWithInformationValue); + /// Job has completed with warnings. + public static JobState CompletedWithWarnings { get; } = new JobState(CompletedWithWarningsValue); + /// Job has completed with errors. + public static JobState CompletedWithErrors { get; } = new JobState(CompletedWithErrorsValue); + /// Determines if two values are the same. + public static bool operator ==(JobState left, JobState right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(JobState left, JobState right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator JobState(string value) => new JobState(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is JobState other && Equals(other); + /// + public bool Equals(JobState other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/OperationStatus.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/OperationStatus.Serialization.cs new file mode 100644 index 000000000000..8383b6f52f0d --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/OperationStatus.Serialization.cs @@ -0,0 +1,179 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + public partial class OperationStatus : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(OperationStatus)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(Id)) + { + writer.WritePropertyName("id"u8); + writer.WriteStringValue(Id); + } + if (Optional.IsDefined(Name)) + { + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name); + } + if (Optional.IsDefined(Status)) + { + writer.WritePropertyName("status"u8); + writer.WriteStringValue(Status); + } + if (Optional.IsDefined(StartTime)) + { + writer.WritePropertyName("startTime"u8); + writer.WriteStringValue(StartTime); + } + if (Optional.IsDefined(EndTime)) + { + writer.WritePropertyName("endTime"u8); + writer.WriteStringValue(EndTime); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + OperationStatus 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(OperationStatus)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeOperationStatus(document.RootElement, options); + } + + internal static OperationStatus DeserializeOperationStatus(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string id = default; + string name = default; + string status = default; + string startTime = default; + string endTime = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("id"u8)) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("status"u8)) + { + status = property.Value.GetString(); + continue; + } + if (property.NameEquals("startTime"u8)) + { + startTime = property.Value.GetString(); + continue; + } + if (property.NameEquals("endTime"u8)) + { + endTime = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new OperationStatus( + id, + name, + status, + startTime, + endTime, + 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(OperationStatus)} does not support writing '{options.Format}' format."); + } + } + + OperationStatus IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeOperationStatus(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(OperationStatus)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/OperationStatus.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/OperationStatus.cs new file mode 100644 index 000000000000..62283b20f80f --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/OperationStatus.cs @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + /// Defines the operation status. + public partial class OperationStatus + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + internal OperationStatus() + { + } + + /// Initializes a new instance of . + /// Gets or sets the Id. + /// Gets or sets the operation name. + /// Gets or sets the status of the operation. ARM expects the terminal status to be one of Succeeded/ Failed/ Canceled. All other values imply that the operation is still running. + /// Gets or sets the start time. + /// Gets or sets the end time. + /// Keeps track of any properties unknown to the library. + internal OperationStatus(string id, string name, string status, string startTime, string endTime, IDictionary serializedAdditionalRawData) + { + Id = id; + Name = name; + Status = status; + StartTime = startTime; + EndTime = endTime; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Gets or sets the Id. + public string Id { get; } + /// Gets or sets the operation name. + public string Name { get; } + /// Gets or sets the status of the operation. ARM expects the terminal status to be one of Succeeded/ Failed/ Canceled. All other values imply that the operation is still running. + public string Status { get; } + /// Gets or sets the start time. + public string StartTime { get; } + /// Gets or sets the end time. + public string EndTime { get; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/PlannedFailoverModel.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/PlannedFailoverModel.Serialization.cs new file mode 100644 index 000000000000..c41615ba5fe8 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/PlannedFailoverModel.Serialization.cs @@ -0,0 +1,126 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + public partial class PlannedFailoverModel : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(PlannedFailoverModel)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("properties"u8); + writer.WriteObjectValue(Properties, options); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + PlannedFailoverModel 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(PlannedFailoverModel)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializePlannedFailoverModel(document.RootElement, options); + } + + internal static PlannedFailoverModel DeserializePlannedFailoverModel(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + PlannedFailoverModelProperties properties = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("properties"u8)) + { + properties = PlannedFailoverModelProperties.DeserializePlannedFailoverModelProperties(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new PlannedFailoverModel(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(PlannedFailoverModel)} does not support writing '{options.Format}' format."); + } + } + + PlannedFailoverModel IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializePlannedFailoverModel(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(PlannedFailoverModel)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/PlannedFailoverModel.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/PlannedFailoverModel.cs new file mode 100644 index 000000000000..8adab9089db6 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/PlannedFailoverModel.cs @@ -0,0 +1,85 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + /// Planned failover model. + public partial class PlannedFailoverModel + { + /// + /// 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 . + /// Planned failover model properties. + /// is null. + public PlannedFailoverModel(PlannedFailoverModelProperties properties) + { + Argument.AssertNotNull(properties, nameof(properties)); + + Properties = properties; + } + + /// Initializes a new instance of . + /// Planned failover model properties. + /// Keeps track of any properties unknown to the library. + internal PlannedFailoverModel(PlannedFailoverModelProperties properties, IDictionary serializedAdditionalRawData) + { + Properties = properties; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal PlannedFailoverModel() + { + } + + /// Planned failover model properties. + internal PlannedFailoverModelProperties Properties { get; set; } + /// + /// Planned failover model custom properties. + /// 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 . + /// + public PlannedFailoverModelCustomProperties PlannedFailoverModelCustomProperties + { + get => Properties is null ? default : Properties.CustomProperties; + set => Properties = new PlannedFailoverModelProperties(value); + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/PlannedFailoverModelCustomProperties.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/PlannedFailoverModelCustomProperties.Serialization.cs new file mode 100644 index 000000000000..f3eb5082ad42 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/PlannedFailoverModelCustomProperties.Serialization.cs @@ -0,0 +1,118 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + [PersistableModelProxy(typeof(UnknownPlannedFailoverModelCustomProperties))] + public partial class PlannedFailoverModelCustomProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(PlannedFailoverModelCustomProperties)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("instanceType"u8); + writer.WriteStringValue(InstanceType); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + PlannedFailoverModelCustomProperties 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(PlannedFailoverModelCustomProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializePlannedFailoverModelCustomProperties(document.RootElement, options); + } + + internal static PlannedFailoverModelCustomProperties DeserializePlannedFailoverModelCustomProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + if (element.TryGetProperty("instanceType", out JsonElement discriminator)) + { + switch (discriminator.GetString()) + { + case "HyperVToAzStackHCI": return HyperVToAzStackHCIPlannedFailoverModelCustomProperties.DeserializeHyperVToAzStackHCIPlannedFailoverModelCustomProperties(element, options); + case "VMwareToAzStackHCI": return VMwareToAzStackHCIPlannedFailoverModelCustomProperties.DeserializeVMwareToAzStackHCIPlannedFailoverModelCustomProperties(element, options); + } + } + return UnknownPlannedFailoverModelCustomProperties.DeserializeUnknownPlannedFailoverModelCustomProperties(element, options); + } + + 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(PlannedFailoverModelCustomProperties)} does not support writing '{options.Format}' format."); + } + } + + PlannedFailoverModelCustomProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializePlannedFailoverModelCustomProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(PlannedFailoverModelCustomProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/PlannedFailoverModelCustomProperties.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/PlannedFailoverModelCustomProperties.cs new file mode 100644 index 000000000000..ecdd06836a6f --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/PlannedFailoverModelCustomProperties.cs @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + /// + /// Planned failover model custom properties. + /// 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 . + /// + public abstract partial class PlannedFailoverModelCustomProperties + { + /// + /// 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 protected IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + protected PlannedFailoverModelCustomProperties() + { + } + + /// Initializes a new instance of . + /// Discriminator property for PlannedFailoverModelCustomProperties. + /// Keeps track of any properties unknown to the library. + internal PlannedFailoverModelCustomProperties(string instanceType, IDictionary serializedAdditionalRawData) + { + InstanceType = instanceType; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Discriminator property for PlannedFailoverModelCustomProperties. + internal string InstanceType { get; set; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/PlannedFailoverModelProperties.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/PlannedFailoverModelProperties.Serialization.cs new file mode 100644 index 000000000000..6ee7898bb81f --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/PlannedFailoverModelProperties.Serialization.cs @@ -0,0 +1,126 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + public partial class PlannedFailoverModelProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(PlannedFailoverModelProperties)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("customProperties"u8); + writer.WriteObjectValue(CustomProperties, options); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + PlannedFailoverModelProperties 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(PlannedFailoverModelProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializePlannedFailoverModelProperties(document.RootElement, options); + } + + internal static PlannedFailoverModelProperties DeserializePlannedFailoverModelProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + PlannedFailoverModelCustomProperties customProperties = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("customProperties"u8)) + { + customProperties = PlannedFailoverModelCustomProperties.DeserializePlannedFailoverModelCustomProperties(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new PlannedFailoverModelProperties(customProperties, 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(PlannedFailoverModelProperties)} does not support writing '{options.Format}' format."); + } + } + + PlannedFailoverModelProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializePlannedFailoverModelProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(PlannedFailoverModelProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/PlannedFailoverModelProperties.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/PlannedFailoverModelProperties.cs new file mode 100644 index 000000000000..8ec2ac08fc3e --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/PlannedFailoverModelProperties.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; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + /// Planned failover model properties. + public partial class PlannedFailoverModelProperties + { + /// + /// 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 . + /// + /// Planned failover model custom properties. + /// 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 . + /// + /// is null. + public PlannedFailoverModelProperties(PlannedFailoverModelCustomProperties customProperties) + { + Argument.AssertNotNull(customProperties, nameof(customProperties)); + + CustomProperties = customProperties; + } + + /// Initializes a new instance of . + /// + /// Planned failover model custom properties. + /// 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 . + /// + /// Keeps track of any properties unknown to the library. + internal PlannedFailoverModelProperties(PlannedFailoverModelCustomProperties customProperties, IDictionary serializedAdditionalRawData) + { + CustomProperties = customProperties; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal PlannedFailoverModelProperties() + { + } + + /// + /// Planned failover model custom properties. + /// 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 . + /// + public PlannedFailoverModelCustomProperties CustomProperties { get; set; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/PolicyModelCustomProperties.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/PolicyModelCustomProperties.Serialization.cs new file mode 100644 index 000000000000..edd608ac0665 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/PolicyModelCustomProperties.Serialization.cs @@ -0,0 +1,118 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + [PersistableModelProxy(typeof(UnknownPolicyModelCustomProperties))] + public partial class PolicyModelCustomProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(PolicyModelCustomProperties)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("instanceType"u8); + writer.WriteStringValue(InstanceType); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + PolicyModelCustomProperties 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(PolicyModelCustomProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializePolicyModelCustomProperties(document.RootElement, options); + } + + internal static PolicyModelCustomProperties DeserializePolicyModelCustomProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + if (element.TryGetProperty("instanceType", out JsonElement discriminator)) + { + switch (discriminator.GetString()) + { + case "HyperVToAzStackHCI": return HyperVToAzStackHCIPolicyModelCustomProperties.DeserializeHyperVToAzStackHCIPolicyModelCustomProperties(element, options); + case "VMwareToAzStackHCI": return VMwareToAzStackHCIPolicyModelCustomProperties.DeserializeVMwareToAzStackHCIPolicyModelCustomProperties(element, options); + } + } + return UnknownPolicyModelCustomProperties.DeserializeUnknownPolicyModelCustomProperties(element, options); + } + + 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(PolicyModelCustomProperties)} does not support writing '{options.Format}' format."); + } + } + + PolicyModelCustomProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializePolicyModelCustomProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(PolicyModelCustomProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/PolicyModelCustomProperties.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/PolicyModelCustomProperties.cs new file mode 100644 index 000000000000..0ea8d4e12506 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/PolicyModelCustomProperties.cs @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + /// + /// Policy model custom properties. + /// 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 . + /// + public abstract partial class PolicyModelCustomProperties + { + /// + /// 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 protected IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + protected PolicyModelCustomProperties() + { + } + + /// Initializes a new instance of . + /// Discriminator property for PolicyModelCustomProperties. + /// Keeps track of any properties unknown to the library. + internal PolicyModelCustomProperties(string instanceType, IDictionary serializedAdditionalRawData) + { + InstanceType = instanceType; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Discriminator property for PolicyModelCustomProperties. + internal string InstanceType { get; set; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/PolicyModelListResult.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/PolicyModelListResult.Serialization.cs new file mode 100644 index 000000000000..7a0724ee5eb9 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/PolicyModelListResult.Serialization.cs @@ -0,0 +1,151 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + internal partial class PolicyModelListResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(PolicyModelListResult)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var item in Value) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + if (Optional.IsDefined(NextLink)) + { + writer.WritePropertyName("nextLink"u8); + writer.WriteStringValue(NextLink.AbsoluteUri); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + PolicyModelListResult 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(PolicyModelListResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializePolicyModelListResult(document.RootElement, options); + } + + internal static PolicyModelListResult DeserializePolicyModelListResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IReadOnlyList value = default; + Uri nextLink = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(PolicyModelData.DeserializePolicyModelData(item, options)); + } + value = array; + continue; + } + if (property.NameEquals("nextLink"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + nextLink = new Uri(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new PolicyModelListResult(value, nextLink, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(PolicyModelListResult)} does not support writing '{options.Format}' format."); + } + } + + PolicyModelListResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializePolicyModelListResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(PolicyModelListResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/PolicyModelListResult.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/PolicyModelListResult.cs new file mode 100644 index 000000000000..5168b7a8fb93 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/PolicyModelListResult.cs @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + /// The response of a PolicyModel list operation. + internal partial class PolicyModelListResult + { + /// + /// 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 PolicyModel items on this page. + /// is null. + internal PolicyModelListResult(IEnumerable value) + { + Argument.AssertNotNull(value, nameof(value)); + + Value = value.ToList(); + } + + /// Initializes a new instance of . + /// The PolicyModel items on this page. + /// The link to the next page of items. + /// Keeps track of any properties unknown to the library. + internal PolicyModelListResult(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) + { + Value = value; + NextLink = nextLink; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal PolicyModelListResult() + { + } + + /// The PolicyModel items on this page. + public IReadOnlyList Value { get; } + /// The link to the next page of items. + public Uri NextLink { get; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/PolicyModelProperties.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/PolicyModelProperties.Serialization.cs new file mode 100644 index 000000000000..f991bbb1513c --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/PolicyModelProperties.Serialization.cs @@ -0,0 +1,141 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + public partial class PolicyModelProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(PolicyModelProperties)} does not support writing '{format}' format."); + } + + if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) + { + writer.WritePropertyName("provisioningState"u8); + writer.WriteStringValue(ProvisioningState.Value.ToString()); + } + writer.WritePropertyName("customProperties"u8); + writer.WriteObjectValue(CustomProperties, options); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + PolicyModelProperties 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(PolicyModelProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializePolicyModelProperties(document.RootElement, options); + } + + internal static PolicyModelProperties DeserializePolicyModelProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ProvisioningState? provisioningState = default; + PolicyModelCustomProperties customProperties = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("provisioningState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + provisioningState = new ProvisioningState(property.Value.GetString()); + continue; + } + if (property.NameEquals("customProperties"u8)) + { + customProperties = PolicyModelCustomProperties.DeserializePolicyModelCustomProperties(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new PolicyModelProperties(provisioningState, customProperties, 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(PolicyModelProperties)} does not support writing '{options.Format}' format."); + } + } + + PolicyModelProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializePolicyModelProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(PolicyModelProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/PolicyModelProperties.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/PolicyModelProperties.cs new file mode 100644 index 000000000000..eee13b2ce72a --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/PolicyModelProperties.cs @@ -0,0 +1,91 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + /// Policy model properties. + public partial class PolicyModelProperties + { + /// + /// 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 . + /// + /// Policy model custom properties. + /// 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 . + /// + /// is null. + public PolicyModelProperties(PolicyModelCustomProperties customProperties) + { + Argument.AssertNotNull(customProperties, nameof(customProperties)); + + CustomProperties = customProperties; + } + + /// Initializes a new instance of . + /// Gets or sets the provisioning state of the policy. + /// + /// Policy model custom properties. + /// 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 . + /// + /// Keeps track of any properties unknown to the library. + internal PolicyModelProperties(ProvisioningState? provisioningState, PolicyModelCustomProperties customProperties, IDictionary serializedAdditionalRawData) + { + ProvisioningState = provisioningState; + CustomProperties = customProperties; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal PolicyModelProperties() + { + } + + /// Gets or sets the provisioning state of the policy. + public ProvisioningState? ProvisioningState { get; } + /// + /// Policy model custom properties. + /// 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 . + /// + public PolicyModelCustomProperties CustomProperties { get; set; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/PrivateEndpointConnectionProxyListResult.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/PrivateEndpointConnectionProxyListResult.Serialization.cs new file mode 100644 index 000000000000..0a65c1c1e4f2 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/PrivateEndpointConnectionProxyListResult.Serialization.cs @@ -0,0 +1,151 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + internal partial class PrivateEndpointConnectionProxyListResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(PrivateEndpointConnectionProxyListResult)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var item in Value) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + if (Optional.IsDefined(NextLink)) + { + writer.WritePropertyName("nextLink"u8); + writer.WriteStringValue(NextLink.AbsoluteUri); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + PrivateEndpointConnectionProxyListResult 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(PrivateEndpointConnectionProxyListResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializePrivateEndpointConnectionProxyListResult(document.RootElement, options); + } + + internal static PrivateEndpointConnectionProxyListResult DeserializePrivateEndpointConnectionProxyListResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IReadOnlyList value = default; + Uri nextLink = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(PrivateEndpointConnectionProxyData.DeserializePrivateEndpointConnectionProxyData(item, options)); + } + value = array; + continue; + } + if (property.NameEquals("nextLink"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + nextLink = new Uri(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new PrivateEndpointConnectionProxyListResult(value, nextLink, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(PrivateEndpointConnectionProxyListResult)} does not support writing '{options.Format}' format."); + } + } + + PrivateEndpointConnectionProxyListResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializePrivateEndpointConnectionProxyListResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(PrivateEndpointConnectionProxyListResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/PrivateEndpointConnectionProxyListResult.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/PrivateEndpointConnectionProxyListResult.cs new file mode 100644 index 000000000000..4a53b04bbc22 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/PrivateEndpointConnectionProxyListResult.cs @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + /// The response of a PrivateEndpointConnectionProxy list operation. + internal partial class PrivateEndpointConnectionProxyListResult + { + /// + /// 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 PrivateEndpointConnectionProxy items on this page. + /// is null. + internal PrivateEndpointConnectionProxyListResult(IEnumerable value) + { + Argument.AssertNotNull(value, nameof(value)); + + Value = value.ToList(); + } + + /// Initializes a new instance of . + /// The PrivateEndpointConnectionProxy items on this page. + /// The link to the next page of items. + /// Keeps track of any properties unknown to the library. + internal PrivateEndpointConnectionProxyListResult(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) + { + Value = value; + NextLink = nextLink; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal PrivateEndpointConnectionProxyListResult() + { + } + + /// The PrivateEndpointConnectionProxy items on this page. + public IReadOnlyList Value { get; } + /// The link to the next page of items. + public Uri NextLink { get; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/PrivateEndpointConnectionProxyProperties.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/PrivateEndpointConnectionProxyProperties.Serialization.cs new file mode 100644 index 000000000000..3e257a1cc1a7 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/PrivateEndpointConnectionProxyProperties.Serialization.cs @@ -0,0 +1,148 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + public partial class PrivateEndpointConnectionProxyProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(PrivateEndpointConnectionProxyProperties)} does not support writing '{format}' format."); + } + + if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) + { + writer.WritePropertyName("provisioningState"u8); + writer.WriteStringValue(ProvisioningState.Value.ToString()); + } + if (Optional.IsDefined(RemotePrivateEndpoint)) + { + writer.WritePropertyName("remotePrivateEndpoint"u8); + writer.WriteObjectValue(RemotePrivateEndpoint, options); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + PrivateEndpointConnectionProxyProperties 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(PrivateEndpointConnectionProxyProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializePrivateEndpointConnectionProxyProperties(document.RootElement, options); + } + + internal static PrivateEndpointConnectionProxyProperties DeserializePrivateEndpointConnectionProxyProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ProvisioningState? provisioningState = default; + RemotePrivateEndpoint remotePrivateEndpoint = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("provisioningState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + provisioningState = new ProvisioningState(property.Value.GetString()); + continue; + } + if (property.NameEquals("remotePrivateEndpoint"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + remotePrivateEndpoint = RemotePrivateEndpoint.DeserializeRemotePrivateEndpoint(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new PrivateEndpointConnectionProxyProperties(provisioningState, remotePrivateEndpoint, 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(PrivateEndpointConnectionProxyProperties)} does not support writing '{options.Format}' format."); + } + } + + PrivateEndpointConnectionProxyProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializePrivateEndpointConnectionProxyProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(PrivateEndpointConnectionProxyProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/PrivateEndpointConnectionProxyProperties.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/PrivateEndpointConnectionProxyProperties.cs new file mode 100644 index 000000000000..4e3c9feaecfc --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/PrivateEndpointConnectionProxyProperties.cs @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + /// Represents private endpoint connection proxy request. + public partial class PrivateEndpointConnectionProxyProperties + { + /// + /// 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 PrivateEndpointConnectionProxyProperties() + { + } + + /// Initializes a new instance of . + /// Gets or sets the provisioning state of the private endpoint connection proxy. + /// Represent remote private endpoint information for the private endpoint connection proxy. + /// Keeps track of any properties unknown to the library. + internal PrivateEndpointConnectionProxyProperties(ProvisioningState? provisioningState, RemotePrivateEndpoint remotePrivateEndpoint, IDictionary serializedAdditionalRawData) + { + ProvisioningState = provisioningState; + RemotePrivateEndpoint = remotePrivateEndpoint; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Gets or sets the provisioning state of the private endpoint connection proxy. + public ProvisioningState? ProvisioningState { get; } + /// Represent remote private endpoint information for the private endpoint connection proxy. + public RemotePrivateEndpoint RemotePrivateEndpoint { get; set; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/PrivateEndpointConnectionResponseProperties.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/PrivateEndpointConnectionResponseProperties.Serialization.cs new file mode 100644 index 000000000000..bfa74681b261 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/PrivateEndpointConnectionResponseProperties.Serialization.cs @@ -0,0 +1,164 @@ +// 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.Resources.Models; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + public partial class PrivateEndpointConnectionResponseProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(PrivateEndpointConnectionResponseProperties)} does not support writing '{format}' format."); + } + + if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) + { + writer.WritePropertyName("provisioningState"u8); + writer.WriteStringValue(ProvisioningState.Value.ToString()); + } + if (Optional.IsDefined(PrivateEndpoint)) + { + writer.WritePropertyName("privateEndpoint"u8); + JsonSerializer.Serialize(writer, PrivateEndpoint); + } + if (Optional.IsDefined(PrivateLinkServiceConnectionState)) + { + writer.WritePropertyName("privateLinkServiceConnectionState"u8); + writer.WriteObjectValue(PrivateLinkServiceConnectionState, options); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + PrivateEndpointConnectionResponseProperties 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(PrivateEndpointConnectionResponseProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializePrivateEndpointConnectionResponseProperties(document.RootElement, options); + } + + internal static PrivateEndpointConnectionResponseProperties DeserializePrivateEndpointConnectionResponseProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ProvisioningState? provisioningState = default; + WritableSubResource privateEndpoint = default; + RecoveryServicesDataReplicationPrivateLinkServiceConnectionState privateLinkServiceConnectionState = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("provisioningState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + provisioningState = new ProvisioningState(property.Value.GetString()); + continue; + } + if (property.NameEquals("privateEndpoint"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + privateEndpoint = JsonSerializer.Deserialize(property.Value.GetRawText()); + continue; + } + if (property.NameEquals("privateLinkServiceConnectionState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + privateLinkServiceConnectionState = RecoveryServicesDataReplicationPrivateLinkServiceConnectionState.DeserializeRecoveryServicesDataReplicationPrivateLinkServiceConnectionState(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new PrivateEndpointConnectionResponseProperties(provisioningState, privateEndpoint, privateLinkServiceConnectionState, 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(PrivateEndpointConnectionResponseProperties)} does not support writing '{options.Format}' format."); + } + } + + PrivateEndpointConnectionResponseProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializePrivateEndpointConnectionResponseProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(PrivateEndpointConnectionResponseProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/PrivateEndpointConnectionResponseProperties.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/PrivateEndpointConnectionResponseProperties.cs new file mode 100644 index 000000000000..eb39906ac843 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/PrivateEndpointConnectionResponseProperties.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.Resources.Models; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + /// Represents Private endpoint connection response properties. + public partial class PrivateEndpointConnectionResponseProperties + { + /// + /// 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 PrivateEndpointConnectionResponseProperties() + { + } + + /// Initializes a new instance of . + /// Gets or sets provisioning state of the private endpoint connection. + /// Represent private Endpoint network resource that is linked to the Private Endpoint connection. + /// Represents Private link service connection state. + /// Keeps track of any properties unknown to the library. + internal PrivateEndpointConnectionResponseProperties(ProvisioningState? provisioningState, WritableSubResource privateEndpoint, RecoveryServicesDataReplicationPrivateLinkServiceConnectionState privateLinkServiceConnectionState, IDictionary serializedAdditionalRawData) + { + ProvisioningState = provisioningState; + PrivateEndpoint = privateEndpoint; + PrivateLinkServiceConnectionState = privateLinkServiceConnectionState; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Gets or sets provisioning state of the private endpoint connection. + public ProvisioningState? ProvisioningState { get; } + /// Represent private Endpoint network resource that is linked to the Private Endpoint connection. + internal WritableSubResource PrivateEndpoint { get; set; } + /// Gets or sets Id. + public ResourceIdentifier PrivateEndpointId + { + get => PrivateEndpoint is null ? default : PrivateEndpoint.Id; + set + { + if (PrivateEndpoint is null) + PrivateEndpoint = new WritableSubResource(); + PrivateEndpoint.Id = value; + } + } + + /// Represents Private link service connection state. + public RecoveryServicesDataReplicationPrivateLinkServiceConnectionState PrivateLinkServiceConnectionState { get; set; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/PrivateEndpointConnectionStatus.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/PrivateEndpointConnectionStatus.cs new file mode 100644 index 000000000000..ec655cc3bbc9 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/PrivateEndpointConnectionStatus.cs @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + /// Gets or sets the status. + public readonly partial struct PrivateEndpointConnectionStatus : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public PrivateEndpointConnectionStatus(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string ApprovedValue = "Approved"; + private const string DisconnectedValue = "Disconnected"; + private const string PendingValue = "Pending"; + private const string RejectedValue = "Rejected"; + + /// Approved Status. + public static PrivateEndpointConnectionStatus Approved { get; } = new PrivateEndpointConnectionStatus(ApprovedValue); + /// Disconnected Status. + public static PrivateEndpointConnectionStatus Disconnected { get; } = new PrivateEndpointConnectionStatus(DisconnectedValue); + /// Pending Status. + public static PrivateEndpointConnectionStatus Pending { get; } = new PrivateEndpointConnectionStatus(PendingValue); + /// Rejected Status. + public static PrivateEndpointConnectionStatus Rejected { get; } = new PrivateEndpointConnectionStatus(RejectedValue); + /// Determines if two values are the same. + public static bool operator ==(PrivateEndpointConnectionStatus left, PrivateEndpointConnectionStatus right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(PrivateEndpointConnectionStatus left, PrivateEndpointConnectionStatus right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator PrivateEndpointConnectionStatus(string value) => new PrivateEndpointConnectionStatus(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is PrivateEndpointConnectionStatus other && Equals(other); + /// + public bool Equals(PrivateEndpointConnectionStatus other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/PrivateLinkServiceConnection.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/PrivateLinkServiceConnection.Serialization.cs new file mode 100644 index 000000000000..b9f669a11974 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/PrivateLinkServiceConnection.Serialization.cs @@ -0,0 +1,165 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + public partial class PrivateLinkServiceConnection : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(PrivateLinkServiceConnection)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(Name)) + { + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name); + } + if (Optional.IsCollectionDefined(GroupIds)) + { + writer.WritePropertyName("groupIds"u8); + writer.WriteStartArray(); + foreach (var item in GroupIds) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(RequestMessage)) + { + writer.WritePropertyName("requestMessage"u8); + writer.WriteStringValue(RequestMessage); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + PrivateLinkServiceConnection 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(PrivateLinkServiceConnection)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializePrivateLinkServiceConnection(document.RootElement, options); + } + + internal static PrivateLinkServiceConnection DeserializePrivateLinkServiceConnection(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string name = default; + IList groupIds = default; + string requestMessage = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("groupIds"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + groupIds = array; + continue; + } + if (property.NameEquals("requestMessage"u8)) + { + requestMessage = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new PrivateLinkServiceConnection(name, groupIds ?? new ChangeTrackingList(), requestMessage, 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(PrivateLinkServiceConnection)} does not support writing '{options.Format}' format."); + } + } + + PrivateLinkServiceConnection IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializePrivateLinkServiceConnection(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(PrivateLinkServiceConnection)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/PrivateLinkServiceConnection.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/PrivateLinkServiceConnection.cs new file mode 100644 index 000000000000..8afc55f47cd3 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/PrivateLinkServiceConnection.cs @@ -0,0 +1,74 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + /// Represents of an NRP private link service connection. + public partial class PrivateLinkServiceConnection + { + /// + /// 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 PrivateLinkServiceConnection() + { + GroupIds = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// Gets or sets private link service connection name. + /// Gets or sets group ids. + /// Gets or sets the request message for the private link service connection. + /// Keeps track of any properties unknown to the library. + internal PrivateLinkServiceConnection(string name, IList groupIds, string requestMessage, IDictionary serializedAdditionalRawData) + { + Name = name; + GroupIds = groupIds; + RequestMessage = requestMessage; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Gets or sets private link service connection name. + public string Name { get; set; } + /// Gets or sets group ids. + public IList GroupIds { get; } + /// Gets or sets the request message for the private link service connection. + public string RequestMessage { get; set; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/PrivateLinkServiceProxy.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/PrivateLinkServiceProxy.Serialization.cs new file mode 100644 index 000000000000..50ef35008f57 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/PrivateLinkServiceProxy.Serialization.cs @@ -0,0 +1,185 @@ +// 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.Resources.Models; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + public partial class PrivateLinkServiceProxy : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(PrivateLinkServiceProxy)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(Id)) + { + writer.WritePropertyName("id"u8); + writer.WriteStringValue(Id); + } + if (Optional.IsDefined(RemotePrivateLinkServiceConnectionState)) + { + writer.WritePropertyName("remotePrivateLinkServiceConnectionState"u8); + writer.WriteObjectValue(RemotePrivateLinkServiceConnectionState, options); + } + if (Optional.IsDefined(RemotePrivateEndpointConnection)) + { + writer.WritePropertyName("remotePrivateEndpointConnection"u8); + JsonSerializer.Serialize(writer, RemotePrivateEndpointConnection); + } + if (Optional.IsCollectionDefined(GroupConnectivityInformation)) + { + writer.WritePropertyName("groupConnectivityInformation"u8); + writer.WriteStartArray(); + foreach (var item in GroupConnectivityInformation) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + PrivateLinkServiceProxy 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(PrivateLinkServiceProxy)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializePrivateLinkServiceProxy(document.RootElement, options); + } + + internal static PrivateLinkServiceProxy DeserializePrivateLinkServiceProxy(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string id = default; + RecoveryServicesDataReplicationPrivateLinkServiceConnectionState remotePrivateLinkServiceConnectionState = default; + WritableSubResource remotePrivateEndpointConnection = default; + IList groupConnectivityInformation = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("id"u8)) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("remotePrivateLinkServiceConnectionState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + remotePrivateLinkServiceConnectionState = RecoveryServicesDataReplicationPrivateLinkServiceConnectionState.DeserializeRecoveryServicesDataReplicationPrivateLinkServiceConnectionState(property.Value, options); + continue; + } + if (property.NameEquals("remotePrivateEndpointConnection"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + remotePrivateEndpointConnection = JsonSerializer.Deserialize(property.Value.GetRawText()); + continue; + } + if (property.NameEquals("groupConnectivityInformation"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(Models.GroupConnectivityInformation.DeserializeGroupConnectivityInformation(item, options)); + } + groupConnectivityInformation = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new PrivateLinkServiceProxy(id, remotePrivateLinkServiceConnectionState, remotePrivateEndpointConnection, groupConnectivityInformation ?? new ChangeTrackingList(), serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(PrivateLinkServiceProxy)} does not support writing '{options.Format}' format."); + } + } + + PrivateLinkServiceProxy IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializePrivateLinkServiceProxy(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(PrivateLinkServiceProxy)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/PrivateLinkServiceProxy.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/PrivateLinkServiceProxy.cs new file mode 100644 index 000000000000..938ab7d27a56 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/PrivateLinkServiceProxy.cs @@ -0,0 +1,92 @@ +// 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.Resources.Models; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + /// Represents NRP private link service proxy. + public partial class PrivateLinkServiceProxy + { + /// + /// 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 PrivateLinkServiceProxy() + { + GroupConnectivityInformation = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// Gets or sets private link service proxy id. + /// Represents Private link service connection state. + /// Represent remote private endpoint connection. + /// Gets or sets group connectivity information. + /// Keeps track of any properties unknown to the library. + internal PrivateLinkServiceProxy(string id, RecoveryServicesDataReplicationPrivateLinkServiceConnectionState remotePrivateLinkServiceConnectionState, WritableSubResource remotePrivateEndpointConnection, IList groupConnectivityInformation, IDictionary serializedAdditionalRawData) + { + Id = id; + RemotePrivateLinkServiceConnectionState = remotePrivateLinkServiceConnectionState; + RemotePrivateEndpointConnection = remotePrivateEndpointConnection; + GroupConnectivityInformation = groupConnectivityInformation; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Gets or sets private link service proxy id. + public string Id { get; set; } + /// Represents Private link service connection state. + public RecoveryServicesDataReplicationPrivateLinkServiceConnectionState RemotePrivateLinkServiceConnectionState { get; set; } + /// Represent remote private endpoint connection. + internal WritableSubResource RemotePrivateEndpointConnection { get; set; } + /// Gets or sets Id. + public ResourceIdentifier RemotePrivateEndpointConnectionId + { + get => RemotePrivateEndpointConnection is null ? default : RemotePrivateEndpointConnection.Id; + set + { + if (RemotePrivateEndpointConnection is null) + RemotePrivateEndpointConnection = new WritableSubResource(); + RemotePrivateEndpointConnection.Id = value; + } + } + + /// Gets or sets group connectivity information. + public IList GroupConnectivityInformation { get; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/ProtectedItemActiveLocation.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/ProtectedItemActiveLocation.cs new file mode 100644 index 000000000000..e7fb5c914aed --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/ProtectedItemActiveLocation.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + /// Gets or sets the location of the protected item. + public readonly partial struct ProtectedItemActiveLocation : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public ProtectedItemActiveLocation(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string PrimaryValue = "Primary"; + private const string RecoveryValue = "Recovery"; + + /// Protected item is active on Primary. + public static ProtectedItemActiveLocation Primary { get; } = new ProtectedItemActiveLocation(PrimaryValue); + /// Protected item is active on Recovery. + public static ProtectedItemActiveLocation Recovery { get; } = new ProtectedItemActiveLocation(RecoveryValue); + /// Determines if two values are the same. + public static bool operator ==(ProtectedItemActiveLocation left, ProtectedItemActiveLocation right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(ProtectedItemActiveLocation left, ProtectedItemActiveLocation right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator ProtectedItemActiveLocation(string value) => new ProtectedItemActiveLocation(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is ProtectedItemActiveLocation other && Equals(other); + /// + public bool Equals(ProtectedItemActiveLocation other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/ProtectedItemDynamicMemoryConfig.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/ProtectedItemDynamicMemoryConfig.Serialization.cs new file mode 100644 index 000000000000..511b777031e4 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/ProtectedItemDynamicMemoryConfig.Serialization.cs @@ -0,0 +1,142 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + public partial class ProtectedItemDynamicMemoryConfig : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ProtectedItemDynamicMemoryConfig)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("maximumMemoryInMegaBytes"u8); + writer.WriteNumberValue(MaximumMemoryInMegaBytes); + writer.WritePropertyName("minimumMemoryInMegaBytes"u8); + writer.WriteNumberValue(MinimumMemoryInMegaBytes); + writer.WritePropertyName("targetMemoryBufferPercentage"u8); + writer.WriteNumberValue(TargetMemoryBufferPercentage); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + ProtectedItemDynamicMemoryConfig 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(ProtectedItemDynamicMemoryConfig)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeProtectedItemDynamicMemoryConfig(document.RootElement, options); + } + + internal static ProtectedItemDynamicMemoryConfig DeserializeProtectedItemDynamicMemoryConfig(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + long maximumMemoryInMegaBytes = default; + long minimumMemoryInMegaBytes = default; + int targetMemoryBufferPercentage = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("maximumMemoryInMegaBytes"u8)) + { + maximumMemoryInMegaBytes = property.Value.GetInt64(); + continue; + } + if (property.NameEquals("minimumMemoryInMegaBytes"u8)) + { + minimumMemoryInMegaBytes = property.Value.GetInt64(); + continue; + } + if (property.NameEquals("targetMemoryBufferPercentage"u8)) + { + targetMemoryBufferPercentage = property.Value.GetInt32(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ProtectedItemDynamicMemoryConfig(maximumMemoryInMegaBytes, minimumMemoryInMegaBytes, targetMemoryBufferPercentage, 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(ProtectedItemDynamicMemoryConfig)} does not support writing '{options.Format}' format."); + } + } + + ProtectedItemDynamicMemoryConfig IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeProtectedItemDynamicMemoryConfig(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ProtectedItemDynamicMemoryConfig)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/ProtectedItemDynamicMemoryConfig.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/ProtectedItemDynamicMemoryConfig.cs new file mode 100644 index 000000000000..95f93ff06669 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/ProtectedItemDynamicMemoryConfig.cs @@ -0,0 +1,84 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + /// Protected item dynamic memory config. + public partial class ProtectedItemDynamicMemoryConfig + { + /// + /// 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 . + /// Gets or sets maximum memory in MB. + /// Gets or sets minimum memory in MB. + /// Gets or sets target memory buffer in %. + public ProtectedItemDynamicMemoryConfig(long maximumMemoryInMegaBytes, long minimumMemoryInMegaBytes, int targetMemoryBufferPercentage) + { + MaximumMemoryInMegaBytes = maximumMemoryInMegaBytes; + MinimumMemoryInMegaBytes = minimumMemoryInMegaBytes; + TargetMemoryBufferPercentage = targetMemoryBufferPercentage; + } + + /// Initializes a new instance of . + /// Gets or sets maximum memory in MB. + /// Gets or sets minimum memory in MB. + /// Gets or sets target memory buffer in %. + /// Keeps track of any properties unknown to the library. + internal ProtectedItemDynamicMemoryConfig(long maximumMemoryInMegaBytes, long minimumMemoryInMegaBytes, int targetMemoryBufferPercentage, IDictionary serializedAdditionalRawData) + { + MaximumMemoryInMegaBytes = maximumMemoryInMegaBytes; + MinimumMemoryInMegaBytes = minimumMemoryInMegaBytes; + TargetMemoryBufferPercentage = targetMemoryBufferPercentage; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal ProtectedItemDynamicMemoryConfig() + { + } + + /// Gets or sets maximum memory in MB. + public long MaximumMemoryInMegaBytes { get; set; } + /// Gets or sets minimum memory in MB. + public long MinimumMemoryInMegaBytes { get; set; } + /// Gets or sets target memory buffer in %. + public int TargetMemoryBufferPercentage { get; set; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/ProtectedItemJobProperties.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/ProtectedItemJobProperties.Serialization.cs new file mode 100644 index 000000000000..bf1365d147c7 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/ProtectedItemJobProperties.Serialization.cs @@ -0,0 +1,211 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + public partial class ProtectedItemJobProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ProtectedItemJobProperties)} does not support writing '{format}' format."); + } + + if (options.Format != "W" && Optional.IsDefined(ScenarioName)) + { + writer.WritePropertyName("scenarioName"u8); + writer.WriteStringValue(ScenarioName); + } + if (options.Format != "W" && Optional.IsDefined(Id)) + { + writer.WritePropertyName("id"u8); + writer.WriteStringValue(Id); + } + if (options.Format != "W" && Optional.IsDefined(Name)) + { + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name); + } + if (options.Format != "W" && Optional.IsDefined(DisplayName)) + { + writer.WritePropertyName("displayName"u8); + writer.WriteStringValue(DisplayName); + } + if (options.Format != "W" && Optional.IsDefined(State)) + { + writer.WritePropertyName("state"u8); + writer.WriteStringValue(State); + } + if (options.Format != "W" && Optional.IsDefined(StartOn)) + { + writer.WritePropertyName("startTime"u8); + writer.WriteStringValue(StartOn.Value, "O"); + } + if (options.Format != "W" && Optional.IsDefined(EndOn)) + { + writer.WritePropertyName("endTime"u8); + writer.WriteStringValue(EndOn.Value, "O"); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + ProtectedItemJobProperties 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(ProtectedItemJobProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeProtectedItemJobProperties(document.RootElement, options); + } + + internal static ProtectedItemJobProperties DeserializeProtectedItemJobProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string scenarioName = default; + string id = default; + string name = default; + string displayName = default; + string state = default; + DateTimeOffset? startTime = default; + DateTimeOffset? endTime = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("scenarioName"u8)) + { + scenarioName = property.Value.GetString(); + continue; + } + if (property.NameEquals("id"u8)) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("displayName"u8)) + { + displayName = property.Value.GetString(); + continue; + } + if (property.NameEquals("state"u8)) + { + state = property.Value.GetString(); + continue; + } + if (property.NameEquals("startTime"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + startTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("endTime"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + endTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ProtectedItemJobProperties( + scenarioName, + id, + name, + displayName, + state, + startTime, + endTime, + 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(ProtectedItemJobProperties)} does not support writing '{options.Format}' format."); + } + } + + ProtectedItemJobProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeProtectedItemJobProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ProtectedItemJobProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/ProtectedItemJobProperties.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/ProtectedItemJobProperties.cs new file mode 100644 index 000000000000..f19142061375 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/ProtectedItemJobProperties.cs @@ -0,0 +1,89 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + /// Protected item job properties. + public partial class ProtectedItemJobProperties + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + internal ProtectedItemJobProperties() + { + } + + /// Initializes a new instance of . + /// Gets or sets protection scenario name. + /// Gets or sets job Id. + /// Gets or sets job name. + /// Gets or sets the job friendly display name. + /// Gets or sets job state. + /// Gets or sets start time of the job. + /// Gets or sets end time of the job. + /// Keeps track of any properties unknown to the library. + internal ProtectedItemJobProperties(string scenarioName, string id, string name, string displayName, string state, DateTimeOffset? startOn, DateTimeOffset? endOn, IDictionary serializedAdditionalRawData) + { + ScenarioName = scenarioName; + Id = id; + Name = name; + DisplayName = displayName; + State = state; + StartOn = startOn; + EndOn = endOn; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Gets or sets protection scenario name. + public string ScenarioName { get; } + /// Gets or sets job Id. + public string Id { get; } + /// Gets or sets job name. + public string Name { get; } + /// Gets or sets the job friendly display name. + public string DisplayName { get; } + /// Gets or sets job state. + public string State { get; } + /// Gets or sets start time of the job. + public DateTimeOffset? StartOn { get; } + /// Gets or sets end time of the job. + public DateTimeOffset? EndOn { get; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/ProtectedItemModelCustomProperties.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/ProtectedItemModelCustomProperties.Serialization.cs new file mode 100644 index 000000000000..3e5bd6c0fbc6 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/ProtectedItemModelCustomProperties.Serialization.cs @@ -0,0 +1,118 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + [PersistableModelProxy(typeof(UnknownProtectedItemModelCustomProperties))] + public partial class ProtectedItemModelCustomProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ProtectedItemModelCustomProperties)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("instanceType"u8); + writer.WriteStringValue(InstanceType); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + ProtectedItemModelCustomProperties 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(ProtectedItemModelCustomProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeProtectedItemModelCustomProperties(document.RootElement, options); + } + + internal static ProtectedItemModelCustomProperties DeserializeProtectedItemModelCustomProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + if (element.TryGetProperty("instanceType", out JsonElement discriminator)) + { + switch (discriminator.GetString()) + { + case "HyperVToAzStackHCI": return HyperVToAzStackHCIProtectedItemModelCustomProperties.DeserializeHyperVToAzStackHCIProtectedItemModelCustomProperties(element, options); + case "VMwareToAzStackHCI": return VMwareToAzStackHCIProtectedItemModelCustomProperties.DeserializeVMwareToAzStackHCIProtectedItemModelCustomProperties(element, options); + } + } + return UnknownProtectedItemModelCustomProperties.DeserializeUnknownProtectedItemModelCustomProperties(element, options); + } + + 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(ProtectedItemModelCustomProperties)} does not support writing '{options.Format}' format."); + } + } + + ProtectedItemModelCustomProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeProtectedItemModelCustomProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ProtectedItemModelCustomProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/ProtectedItemModelCustomProperties.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/ProtectedItemModelCustomProperties.cs new file mode 100644 index 000000000000..a445babbb084 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/ProtectedItemModelCustomProperties.cs @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + /// + /// Protected item model custom properties. + /// 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 . + /// + public abstract partial class ProtectedItemModelCustomProperties + { + /// + /// 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 protected IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + protected ProtectedItemModelCustomProperties() + { + } + + /// Initializes a new instance of . + /// Discriminator property for ProtectedItemModelCustomProperties. + /// Keeps track of any properties unknown to the library. + internal ProtectedItemModelCustomProperties(string instanceType, IDictionary serializedAdditionalRawData) + { + InstanceType = instanceType; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Discriminator property for ProtectedItemModelCustomProperties. + internal string InstanceType { get; set; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/ProtectedItemModelCustomPropertiesUpdate.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/ProtectedItemModelCustomPropertiesUpdate.Serialization.cs new file mode 100644 index 000000000000..4c5aec3679e2 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/ProtectedItemModelCustomPropertiesUpdate.Serialization.cs @@ -0,0 +1,118 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + [PersistableModelProxy(typeof(UnknownProtectedItemModelCustomPropertiesUpdate))] + public partial class ProtectedItemModelCustomPropertiesUpdate : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ProtectedItemModelCustomPropertiesUpdate)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("instanceType"u8); + writer.WriteStringValue(InstanceType); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + ProtectedItemModelCustomPropertiesUpdate 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(ProtectedItemModelCustomPropertiesUpdate)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeProtectedItemModelCustomPropertiesUpdate(document.RootElement, options); + } + + internal static ProtectedItemModelCustomPropertiesUpdate DeserializeProtectedItemModelCustomPropertiesUpdate(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + if (element.TryGetProperty("instanceType", out JsonElement discriminator)) + { + switch (discriminator.GetString()) + { + case "HyperVToAzStackHCI": return HyperVToAzStackHCIProtectedItemModelCustomPropertiesUpdate.DeserializeHyperVToAzStackHCIProtectedItemModelCustomPropertiesUpdate(element, options); + case "VMwareToAzStackHCI": return VMwareToAzStackHCIProtectedItemModelCustomPropertiesUpdate.DeserializeVMwareToAzStackHCIProtectedItemModelCustomPropertiesUpdate(element, options); + } + } + return UnknownProtectedItemModelCustomPropertiesUpdate.DeserializeUnknownProtectedItemModelCustomPropertiesUpdate(element, options); + } + + 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(ProtectedItemModelCustomPropertiesUpdate)} does not support writing '{options.Format}' format."); + } + } + + ProtectedItemModelCustomPropertiesUpdate IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeProtectedItemModelCustomPropertiesUpdate(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ProtectedItemModelCustomPropertiesUpdate)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/ProtectedItemModelCustomPropertiesUpdate.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/ProtectedItemModelCustomPropertiesUpdate.cs new file mode 100644 index 000000000000..14921d512302 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/ProtectedItemModelCustomPropertiesUpdate.cs @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + /// + /// Protected item model custom properties. + /// 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 . + /// + public abstract partial class ProtectedItemModelCustomPropertiesUpdate + { + /// + /// 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 protected IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + protected ProtectedItemModelCustomPropertiesUpdate() + { + } + + /// Initializes a new instance of . + /// Discriminator property for ProtectedItemModelCustomPropertiesUpdate. + /// Keeps track of any properties unknown to the library. + internal ProtectedItemModelCustomPropertiesUpdate(string instanceType, IDictionary serializedAdditionalRawData) + { + InstanceType = instanceType; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Discriminator property for ProtectedItemModelCustomPropertiesUpdate. + internal string InstanceType { get; set; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/ProtectedItemModelListResult.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/ProtectedItemModelListResult.Serialization.cs new file mode 100644 index 000000000000..2c7c096e3256 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/ProtectedItemModelListResult.Serialization.cs @@ -0,0 +1,151 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + internal partial class ProtectedItemModelListResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ProtectedItemModelListResult)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var item in Value) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + if (Optional.IsDefined(NextLink)) + { + writer.WritePropertyName("nextLink"u8); + writer.WriteStringValue(NextLink.AbsoluteUri); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + ProtectedItemModelListResult 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(ProtectedItemModelListResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeProtectedItemModelListResult(document.RootElement, options); + } + + internal static ProtectedItemModelListResult DeserializeProtectedItemModelListResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IReadOnlyList value = default; + Uri nextLink = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ProtectedItemModelData.DeserializeProtectedItemModelData(item, options)); + } + value = array; + continue; + } + if (property.NameEquals("nextLink"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + nextLink = new Uri(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ProtectedItemModelListResult(value, nextLink, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ProtectedItemModelListResult)} does not support writing '{options.Format}' format."); + } + } + + ProtectedItemModelListResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeProtectedItemModelListResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ProtectedItemModelListResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/ProtectedItemModelListResult.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/ProtectedItemModelListResult.cs new file mode 100644 index 000000000000..5777df06e2e2 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/ProtectedItemModelListResult.cs @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + /// The response of a ProtectedItemModel list operation. + internal partial class ProtectedItemModelListResult + { + /// + /// 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 ProtectedItemModel items on this page. + /// is null. + internal ProtectedItemModelListResult(IEnumerable value) + { + Argument.AssertNotNull(value, nameof(value)); + + Value = value.ToList(); + } + + /// Initializes a new instance of . + /// The ProtectedItemModel items on this page. + /// The link to the next page of items. + /// Keeps track of any properties unknown to the library. + internal ProtectedItemModelListResult(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) + { + Value = value; + NextLink = nextLink; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal ProtectedItemModelListResult() + { + } + + /// The ProtectedItemModel items on this page. + public IReadOnlyList Value { get; } + /// The link to the next page of items. + public Uri NextLink { get; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/ProtectedItemModelPatch.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/ProtectedItemModelPatch.Serialization.cs new file mode 100644 index 000000000000..458cbd6db840 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/ProtectedItemModelPatch.Serialization.cs @@ -0,0 +1,154 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + public partial class ProtectedItemModelPatch : 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(ProtectedItemModelPatch)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (Optional.IsDefined(Properties)) + { + writer.WritePropertyName("properties"u8); + writer.WriteObjectValue(Properties, options); + } + } + + ProtectedItemModelPatch 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(ProtectedItemModelPatch)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeProtectedItemModelPatch(document.RootElement, options); + } + + internal static ProtectedItemModelPatch DeserializeProtectedItemModelPatch(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ProtectedItemModelPropertiesUpdate 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 = ProtectedItemModelPropertiesUpdate.DeserializeProtectedItemModelPropertiesUpdate(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 ProtectedItemModelPatch( + 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(ProtectedItemModelPatch)} does not support writing '{options.Format}' format."); + } + } + + ProtectedItemModelPatch IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeProtectedItemModelPatch(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ProtectedItemModelPatch)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/ProtectedItemModelPatch.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/ProtectedItemModelPatch.cs new file mode 100644 index 000000000000..fd165554eb97 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/ProtectedItemModelPatch.cs @@ -0,0 +1,86 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + /// Protected item model update. + public partial class ProtectedItemModelPatch : 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 ProtectedItemModelPatch() + { + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// Protected item model properties. + /// Keeps track of any properties unknown to the library. + internal ProtectedItemModelPatch(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, ProtectedItemModelPropertiesUpdate properties, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) + { + Properties = properties; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Protected item model properties. + internal ProtectedItemModelPropertiesUpdate Properties { get; set; } + /// + /// Protected item model custom properties update. + /// 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 . + /// + public ProtectedItemModelCustomPropertiesUpdate CustomProperties + { + get => Properties is null ? default : Properties.CustomProperties; + set + { + if (Properties is null) + Properties = new ProtectedItemModelPropertiesUpdate(); + Properties.CustomProperties = value; + } + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/ProtectedItemModelProperties.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/ProtectedItemModelProperties.Serialization.cs new file mode 100644 index 000000000000..fffa4eed133e --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/ProtectedItemModelProperties.Serialization.cs @@ -0,0 +1,538 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + public partial class ProtectedItemModelProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ProtectedItemModelProperties)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("policyName"u8); + writer.WriteStringValue(PolicyName); + writer.WritePropertyName("replicationExtensionName"u8); + writer.WriteStringValue(ReplicationExtensionName); + if (options.Format != "W" && Optional.IsDefined(CorrelationId)) + { + writer.WritePropertyName("correlationId"u8); + writer.WriteStringValue(CorrelationId); + } + if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) + { + writer.WritePropertyName("provisioningState"u8); + writer.WriteStringValue(ProvisioningState.Value.ToString()); + } + if (options.Format != "W" && Optional.IsDefined(ProtectionState)) + { + writer.WritePropertyName("protectionState"u8); + writer.WriteStringValue(ProtectionState.Value.ToString()); + } + if (options.Format != "W" && Optional.IsDefined(ProtectionStateDescription)) + { + writer.WritePropertyName("protectionStateDescription"u8); + writer.WriteStringValue(ProtectionStateDescription); + } + if (options.Format != "W" && Optional.IsDefined(TestFailoverState)) + { + writer.WritePropertyName("testFailoverState"u8); + writer.WriteStringValue(TestFailoverState.Value.ToString()); + } + if (options.Format != "W" && Optional.IsDefined(TestFailoverStateDescription)) + { + writer.WritePropertyName("testFailoverStateDescription"u8); + writer.WriteStringValue(TestFailoverStateDescription); + } + if (options.Format != "W" && Optional.IsDefined(ResynchronizationState)) + { + writer.WritePropertyName("resynchronizationState"u8); + writer.WriteStringValue(ResynchronizationState.Value.ToString()); + } + if (options.Format != "W" && Optional.IsDefined(FabricObjectId)) + { + writer.WritePropertyName("fabricObjectId"u8); + writer.WriteStringValue(FabricObjectId); + } + if (options.Format != "W" && Optional.IsDefined(FabricObjectName)) + { + writer.WritePropertyName("fabricObjectName"u8); + writer.WriteStringValue(FabricObjectName); + } + if (options.Format != "W" && Optional.IsDefined(SourceFabricProviderId)) + { + writer.WritePropertyName("sourceFabricProviderId"u8); + writer.WriteStringValue(SourceFabricProviderId); + } + if (options.Format != "W" && Optional.IsDefined(TargetFabricProviderId)) + { + writer.WritePropertyName("targetFabricProviderId"u8); + writer.WriteStringValue(TargetFabricProviderId); + } + if (options.Format != "W" && Optional.IsDefined(FabricId)) + { + writer.WritePropertyName("fabricId"u8); + writer.WriteStringValue(FabricId); + } + if (options.Format != "W" && Optional.IsDefined(TargetFabricId)) + { + writer.WritePropertyName("targetFabricId"u8); + writer.WriteStringValue(TargetFabricId); + } + if (options.Format != "W" && Optional.IsDefined(FabricAgentId)) + { + writer.WritePropertyName("fabricAgentId"u8); + writer.WriteStringValue(FabricAgentId); + } + if (options.Format != "W" && Optional.IsDefined(TargetFabricAgentId)) + { + writer.WritePropertyName("targetFabricAgentId"u8); + writer.WriteStringValue(TargetFabricAgentId); + } + if (options.Format != "W" && Optional.IsDefined(ResyncRequired)) + { + writer.WritePropertyName("resyncRequired"u8); + writer.WriteBooleanValue(ResyncRequired.Value); + } + if (options.Format != "W" && Optional.IsDefined(LastSuccessfulPlannedFailoverOn)) + { + writer.WritePropertyName("lastSuccessfulPlannedFailoverTime"u8); + writer.WriteStringValue(LastSuccessfulPlannedFailoverOn.Value, "O"); + } + if (options.Format != "W" && Optional.IsDefined(LastSuccessfulUnplannedFailoverOn)) + { + writer.WritePropertyName("lastSuccessfulUnplannedFailoverTime"u8); + writer.WriteStringValue(LastSuccessfulUnplannedFailoverOn.Value, "O"); + } + if (options.Format != "W" && Optional.IsDefined(LastSuccessfulTestFailoverOn)) + { + writer.WritePropertyName("lastSuccessfulTestFailoverTime"u8); + writer.WriteStringValue(LastSuccessfulTestFailoverOn.Value, "O"); + } + if (options.Format != "W" && Optional.IsDefined(CurrentJob)) + { + writer.WritePropertyName("currentJob"u8); + writer.WriteObjectValue(CurrentJob, options); + } + if (options.Format != "W" && Optional.IsCollectionDefined(AllowedJobs)) + { + writer.WritePropertyName("allowedJobs"u8); + writer.WriteStartArray(); + foreach (var item in AllowedJobs) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && Optional.IsDefined(LastFailedEnableProtectionJob)) + { + writer.WritePropertyName("lastFailedEnableProtectionJob"u8); + writer.WriteObjectValue(LastFailedEnableProtectionJob, options); + } + if (options.Format != "W" && Optional.IsDefined(LastFailedPlannedFailoverJob)) + { + writer.WritePropertyName("lastFailedPlannedFailoverJob"u8); + writer.WriteObjectValue(LastFailedPlannedFailoverJob, options); + } + if (options.Format != "W" && Optional.IsDefined(LastTestFailoverJob)) + { + writer.WritePropertyName("lastTestFailoverJob"u8); + writer.WriteObjectValue(LastTestFailoverJob, options); + } + if (options.Format != "W" && Optional.IsDefined(ReplicationHealth)) + { + writer.WritePropertyName("replicationHealth"u8); + writer.WriteStringValue(ReplicationHealth.Value.ToString()); + } + if (options.Format != "W" && Optional.IsCollectionDefined(HealthErrors)) + { + writer.WritePropertyName("healthErrors"u8); + writer.WriteStartArray(); + foreach (var item in HealthErrors) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + writer.WritePropertyName("customProperties"u8); + writer.WriteObjectValue(CustomProperties, options); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + ProtectedItemModelProperties 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(ProtectedItemModelProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeProtectedItemModelProperties(document.RootElement, options); + } + + internal static ProtectedItemModelProperties DeserializeProtectedItemModelProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string policyName = default; + string replicationExtensionName = default; + string correlationId = default; + ProvisioningState? provisioningState = default; + ProtectionState? protectionState = default; + string protectionStateDescription = default; + TestFailoverState? testFailoverState = default; + string testFailoverStateDescription = default; + ResynchronizationState? resynchronizationState = default; + string fabricObjectId = default; + string fabricObjectName = default; + string sourceFabricProviderId = default; + string targetFabricProviderId = default; + string fabricId = default; + string targetFabricId = default; + string fabricAgentId = default; + string targetFabricAgentId = default; + bool? resyncRequired = default; + DateTimeOffset? lastSuccessfulPlannedFailoverTime = default; + DateTimeOffset? lastSuccessfulUnplannedFailoverTime = default; + DateTimeOffset? lastSuccessfulTestFailoverTime = default; + ProtectedItemJobProperties currentJob = default; + IReadOnlyList allowedJobs = default; + ProtectedItemJobProperties lastFailedEnableProtectionJob = default; + ProtectedItemJobProperties lastFailedPlannedFailoverJob = default; + ProtectedItemJobProperties lastTestFailoverJob = default; + HealthStatus? replicationHealth = default; + IReadOnlyList healthErrors = default; + ProtectedItemModelCustomProperties customProperties = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("policyName"u8)) + { + policyName = property.Value.GetString(); + continue; + } + if (property.NameEquals("replicationExtensionName"u8)) + { + replicationExtensionName = property.Value.GetString(); + continue; + } + if (property.NameEquals("correlationId"u8)) + { + correlationId = property.Value.GetString(); + continue; + } + if (property.NameEquals("provisioningState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + provisioningState = new ProvisioningState(property.Value.GetString()); + continue; + } + if (property.NameEquals("protectionState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + protectionState = new ProtectionState(property.Value.GetString()); + continue; + } + if (property.NameEquals("protectionStateDescription"u8)) + { + protectionStateDescription = property.Value.GetString(); + continue; + } + if (property.NameEquals("testFailoverState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + testFailoverState = new TestFailoverState(property.Value.GetString()); + continue; + } + if (property.NameEquals("testFailoverStateDescription"u8)) + { + testFailoverStateDescription = property.Value.GetString(); + continue; + } + if (property.NameEquals("resynchronizationState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + resynchronizationState = new ResynchronizationState(property.Value.GetString()); + continue; + } + if (property.NameEquals("fabricObjectId"u8)) + { + fabricObjectId = property.Value.GetString(); + continue; + } + if (property.NameEquals("fabricObjectName"u8)) + { + fabricObjectName = property.Value.GetString(); + continue; + } + if (property.NameEquals("sourceFabricProviderId"u8)) + { + sourceFabricProviderId = property.Value.GetString(); + continue; + } + if (property.NameEquals("targetFabricProviderId"u8)) + { + targetFabricProviderId = property.Value.GetString(); + continue; + } + if (property.NameEquals("fabricId"u8)) + { + fabricId = property.Value.GetString(); + continue; + } + if (property.NameEquals("targetFabricId"u8)) + { + targetFabricId = property.Value.GetString(); + continue; + } + if (property.NameEquals("fabricAgentId"u8)) + { + fabricAgentId = property.Value.GetString(); + continue; + } + if (property.NameEquals("targetFabricAgentId"u8)) + { + targetFabricAgentId = property.Value.GetString(); + continue; + } + if (property.NameEquals("resyncRequired"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + resyncRequired = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("lastSuccessfulPlannedFailoverTime"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + lastSuccessfulPlannedFailoverTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("lastSuccessfulUnplannedFailoverTime"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + lastSuccessfulUnplannedFailoverTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("lastSuccessfulTestFailoverTime"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + lastSuccessfulTestFailoverTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("currentJob"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + currentJob = ProtectedItemJobProperties.DeserializeProtectedItemJobProperties(property.Value, options); + continue; + } + if (property.NameEquals("allowedJobs"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + allowedJobs = array; + continue; + } + if (property.NameEquals("lastFailedEnableProtectionJob"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + lastFailedEnableProtectionJob = ProtectedItemJobProperties.DeserializeProtectedItemJobProperties(property.Value, options); + continue; + } + if (property.NameEquals("lastFailedPlannedFailoverJob"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + lastFailedPlannedFailoverJob = ProtectedItemJobProperties.DeserializeProtectedItemJobProperties(property.Value, options); + continue; + } + if (property.NameEquals("lastTestFailoverJob"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + lastTestFailoverJob = ProtectedItemJobProperties.DeserializeProtectedItemJobProperties(property.Value, options); + continue; + } + if (property.NameEquals("replicationHealth"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + replicationHealth = new HealthStatus(property.Value.GetString()); + continue; + } + if (property.NameEquals("healthErrors"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(HealthErrorModel.DeserializeHealthErrorModel(item, options)); + } + healthErrors = array; + continue; + } + if (property.NameEquals("customProperties"u8)) + { + customProperties = ProtectedItemModelCustomProperties.DeserializeProtectedItemModelCustomProperties(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ProtectedItemModelProperties( + policyName, + replicationExtensionName, + correlationId, + provisioningState, + protectionState, + protectionStateDescription, + testFailoverState, + testFailoverStateDescription, + resynchronizationState, + fabricObjectId, + fabricObjectName, + sourceFabricProviderId, + targetFabricProviderId, + fabricId, + targetFabricId, + fabricAgentId, + targetFabricAgentId, + resyncRequired, + lastSuccessfulPlannedFailoverTime, + lastSuccessfulUnplannedFailoverTime, + lastSuccessfulTestFailoverTime, + currentJob, + allowedJobs ?? new ChangeTrackingList(), + lastFailedEnableProtectionJob, + lastFailedPlannedFailoverJob, + lastTestFailoverJob, + replicationHealth, + healthErrors ?? new ChangeTrackingList(), + customProperties, + 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(ProtectedItemModelProperties)} does not support writing '{options.Format}' format."); + } + } + + ProtectedItemModelProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeProtectedItemModelProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ProtectedItemModelProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/ProtectedItemModelProperties.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/ProtectedItemModelProperties.cs new file mode 100644 index 000000000000..1a8805efb869 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/ProtectedItemModelProperties.cs @@ -0,0 +1,207 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + /// Protected item model properties. + public partial class ProtectedItemModelProperties + { + /// + /// 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 . + /// Gets or sets the policy name. + /// Gets or sets the replication extension name. + /// + /// Protected item model custom properties. + /// 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 . + /// + /// , or is null. + public ProtectedItemModelProperties(string policyName, string replicationExtensionName, ProtectedItemModelCustomProperties customProperties) + { + Argument.AssertNotNull(policyName, nameof(policyName)); + Argument.AssertNotNull(replicationExtensionName, nameof(replicationExtensionName)); + Argument.AssertNotNull(customProperties, nameof(customProperties)); + + PolicyName = policyName; + ReplicationExtensionName = replicationExtensionName; + AllowedJobs = new ChangeTrackingList(); + HealthErrors = new ChangeTrackingList(); + CustomProperties = customProperties; + } + + /// Initializes a new instance of . + /// Gets or sets the policy name. + /// Gets or sets the replication extension name. + /// Gets or sets the protected item correlation Id. + /// Gets or sets the provisioning state of the fabric agent. + /// Gets or sets the protection state. + /// Gets or sets the protection state description. + /// Gets or sets the test failover state. + /// Gets or sets the Test failover state description. + /// Gets or sets the resynchronization state. + /// Gets or sets the fabric object Id. + /// Gets or sets the fabric object name. + /// Gets or sets the source fabric provider Id. + /// Gets or sets the target fabric provider Id. + /// Gets or sets the fabric Id. + /// Gets or sets the target fabric Id. + /// Gets or sets the fabric agent Id. + /// Gets or sets the target fabric agent Id. + /// Gets or sets a value indicating whether resynchronization is required or not. + /// Gets or sets the Last successful planned failover time. + /// Gets or sets the Last successful unplanned failover time. + /// Gets or sets the Last successful test failover time. + /// Gets or sets the current scenario. + /// Gets or sets the allowed scenarios on the protected item. + /// Gets or sets the last failed enabled protection job. + /// Gets or sets the last failed planned failover job. + /// Gets or sets the last test failover job. + /// Gets or sets protected item replication health. + /// Gets or sets the list of health errors. + /// + /// Protected item model custom properties. + /// 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 . + /// + /// Keeps track of any properties unknown to the library. + internal ProtectedItemModelProperties(string policyName, string replicationExtensionName, string correlationId, ProvisioningState? provisioningState, ProtectionState? protectionState, string protectionStateDescription, TestFailoverState? testFailoverState, string testFailoverStateDescription, ResynchronizationState? resynchronizationState, string fabricObjectId, string fabricObjectName, string sourceFabricProviderId, string targetFabricProviderId, string fabricId, string targetFabricId, string fabricAgentId, string targetFabricAgentId, bool? resyncRequired, DateTimeOffset? lastSuccessfulPlannedFailoverOn, DateTimeOffset? lastSuccessfulUnplannedFailoverOn, DateTimeOffset? lastSuccessfulTestFailoverOn, ProtectedItemJobProperties currentJob, IReadOnlyList allowedJobs, ProtectedItemJobProperties lastFailedEnableProtectionJob, ProtectedItemJobProperties lastFailedPlannedFailoverJob, ProtectedItemJobProperties lastTestFailoverJob, HealthStatus? replicationHealth, IReadOnlyList healthErrors, ProtectedItemModelCustomProperties customProperties, IDictionary serializedAdditionalRawData) + { + PolicyName = policyName; + ReplicationExtensionName = replicationExtensionName; + CorrelationId = correlationId; + ProvisioningState = provisioningState; + ProtectionState = protectionState; + ProtectionStateDescription = protectionStateDescription; + TestFailoverState = testFailoverState; + TestFailoverStateDescription = testFailoverStateDescription; + ResynchronizationState = resynchronizationState; + FabricObjectId = fabricObjectId; + FabricObjectName = fabricObjectName; + SourceFabricProviderId = sourceFabricProviderId; + TargetFabricProviderId = targetFabricProviderId; + FabricId = fabricId; + TargetFabricId = targetFabricId; + FabricAgentId = fabricAgentId; + TargetFabricAgentId = targetFabricAgentId; + ResyncRequired = resyncRequired; + LastSuccessfulPlannedFailoverOn = lastSuccessfulPlannedFailoverOn; + LastSuccessfulUnplannedFailoverOn = lastSuccessfulUnplannedFailoverOn; + LastSuccessfulTestFailoverOn = lastSuccessfulTestFailoverOn; + CurrentJob = currentJob; + AllowedJobs = allowedJobs; + LastFailedEnableProtectionJob = lastFailedEnableProtectionJob; + LastFailedPlannedFailoverJob = lastFailedPlannedFailoverJob; + LastTestFailoverJob = lastTestFailoverJob; + ReplicationHealth = replicationHealth; + HealthErrors = healthErrors; + CustomProperties = customProperties; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal ProtectedItemModelProperties() + { + } + + /// Gets or sets the policy name. + public string PolicyName { get; set; } + /// Gets or sets the replication extension name. + public string ReplicationExtensionName { get; set; } + /// Gets or sets the protected item correlation Id. + public string CorrelationId { get; } + /// Gets or sets the provisioning state of the fabric agent. + public ProvisioningState? ProvisioningState { get; } + /// Gets or sets the protection state. + public ProtectionState? ProtectionState { get; } + /// Gets or sets the protection state description. + public string ProtectionStateDescription { get; } + /// Gets or sets the test failover state. + public TestFailoverState? TestFailoverState { get; } + /// Gets or sets the Test failover state description. + public string TestFailoverStateDescription { get; } + /// Gets or sets the resynchronization state. + public ResynchronizationState? ResynchronizationState { get; } + /// Gets or sets the fabric object Id. + public string FabricObjectId { get; } + /// Gets or sets the fabric object name. + public string FabricObjectName { get; } + /// Gets or sets the source fabric provider Id. + public string SourceFabricProviderId { get; } + /// Gets or sets the target fabric provider Id. + public string TargetFabricProviderId { get; } + /// Gets or sets the fabric Id. + public string FabricId { get; } + /// Gets or sets the target fabric Id. + public string TargetFabricId { get; } + /// Gets or sets the fabric agent Id. + public string FabricAgentId { get; } + /// Gets or sets the target fabric agent Id. + public string TargetFabricAgentId { get; } + /// Gets or sets a value indicating whether resynchronization is required or not. + public bool? ResyncRequired { get; } + /// Gets or sets the Last successful planned failover time. + public DateTimeOffset? LastSuccessfulPlannedFailoverOn { get; } + /// Gets or sets the Last successful unplanned failover time. + public DateTimeOffset? LastSuccessfulUnplannedFailoverOn { get; } + /// Gets or sets the Last successful test failover time. + public DateTimeOffset? LastSuccessfulTestFailoverOn { get; } + /// Gets or sets the current scenario. + public ProtectedItemJobProperties CurrentJob { get; } + /// Gets or sets the allowed scenarios on the protected item. + public IReadOnlyList AllowedJobs { get; } + /// Gets or sets the last failed enabled protection job. + public ProtectedItemJobProperties LastFailedEnableProtectionJob { get; } + /// Gets or sets the last failed planned failover job. + public ProtectedItemJobProperties LastFailedPlannedFailoverJob { get; } + /// Gets or sets the last test failover job. + public ProtectedItemJobProperties LastTestFailoverJob { get; } + /// Gets or sets protected item replication health. + public HealthStatus? ReplicationHealth { get; } + /// Gets or sets the list of health errors. + public IReadOnlyList HealthErrors { get; } + /// + /// Protected item model custom properties. + /// 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 . + /// + public ProtectedItemModelCustomProperties CustomProperties { get; set; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/ProtectedItemModelPropertiesUpdate.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/ProtectedItemModelPropertiesUpdate.Serialization.cs new file mode 100644 index 000000000000..2c2ff965487d --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/ProtectedItemModelPropertiesUpdate.Serialization.cs @@ -0,0 +1,133 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + internal partial class ProtectedItemModelPropertiesUpdate : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ProtectedItemModelPropertiesUpdate)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(CustomProperties)) + { + writer.WritePropertyName("customProperties"u8); + writer.WriteObjectValue(CustomProperties, options); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + ProtectedItemModelPropertiesUpdate 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(ProtectedItemModelPropertiesUpdate)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeProtectedItemModelPropertiesUpdate(document.RootElement, options); + } + + internal static ProtectedItemModelPropertiesUpdate DeserializeProtectedItemModelPropertiesUpdate(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ProtectedItemModelCustomPropertiesUpdate customProperties = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("customProperties"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + customProperties = ProtectedItemModelCustomPropertiesUpdate.DeserializeProtectedItemModelCustomPropertiesUpdate(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ProtectedItemModelPropertiesUpdate(customProperties, 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(ProtectedItemModelPropertiesUpdate)} does not support writing '{options.Format}' format."); + } + } + + ProtectedItemModelPropertiesUpdate IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeProtectedItemModelPropertiesUpdate(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ProtectedItemModelPropertiesUpdate)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/ProtectedItemModelPropertiesUpdate.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/ProtectedItemModelPropertiesUpdate.cs new file mode 100644 index 000000000000..51aa3741ba6e --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/ProtectedItemModelPropertiesUpdate.cs @@ -0,0 +1,73 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + /// Protected item model properties update. + internal partial class ProtectedItemModelPropertiesUpdate + { + /// + /// 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 ProtectedItemModelPropertiesUpdate() + { + } + + /// Initializes a new instance of . + /// + /// Protected item model custom properties update. + /// 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 . + /// + /// Keeps track of any properties unknown to the library. + internal ProtectedItemModelPropertiesUpdate(ProtectedItemModelCustomPropertiesUpdate customProperties, IDictionary serializedAdditionalRawData) + { + CustomProperties = customProperties; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// + /// Protected item model custom properties update. + /// 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 . + /// + public ProtectedItemModelCustomPropertiesUpdate CustomProperties { get; set; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/ProtectionState.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/ProtectionState.cs new file mode 100644 index 000000000000..9129465abbf3 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/ProtectionState.cs @@ -0,0 +1,201 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + /// Gets or sets the protection state. + public readonly partial struct ProtectionState : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public ProtectionState(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string UnprotectedStatesBeginValue = "UnprotectedStatesBegin"; + private const string EnablingProtectionValue = "EnablingProtection"; + private const string EnablingFailedValue = "EnablingFailed"; + private const string DisablingProtectionValue = "DisablingProtection"; + private const string MarkedForDeletionValue = "MarkedForDeletion"; + private const string DisablingFailedValue = "DisablingFailed"; + private const string UnprotectedStatesEndValue = "UnprotectedStatesEnd"; + private const string InitialReplicationStatesBeginValue = "InitialReplicationStatesBegin"; + private const string InitialReplicationInProgressValue = "InitialReplicationInProgress"; + private const string InitialReplicationCompletedOnPrimaryValue = "InitialReplicationCompletedOnPrimary"; + private const string InitialReplicationCompletedOnRecoveryValue = "InitialReplicationCompletedOnRecovery"; + private const string InitialReplicationFailedValue = "InitialReplicationFailed"; + private const string InitialReplicationStatesEndValue = "InitialReplicationStatesEnd"; + private const string ProtectedStatesBeginValue = "ProtectedStatesBegin"; + private const string ProtectedValue = "Protected"; + private const string ProtectedStatesEndValue = "ProtectedStatesEnd"; + private const string PlannedFailoverTransitionStatesBeginValue = "PlannedFailoverTransitionStatesBegin"; + private const string PlannedFailoverInitiatedValue = "PlannedFailoverInitiated"; + private const string PlannedFailoverCompletingValue = "PlannedFailoverCompleting"; + private const string PlannedFailoverCompletedValue = "PlannedFailoverCompleted"; + private const string PlannedFailoverFailedValue = "PlannedFailoverFailed"; + private const string PlannedFailoverCompletionFailedValue = "PlannedFailoverCompletionFailed"; + private const string PlannedFailoverTransitionStatesEndValue = "PlannedFailoverTransitionStatesEnd"; + private const string UnplannedFailoverTransitionStatesBeginValue = "UnplannedFailoverTransitionStatesBegin"; + private const string UnplannedFailoverInitiatedValue = "UnplannedFailoverInitiated"; + private const string UnplannedFailoverCompletingValue = "UnplannedFailoverCompleting"; + private const string UnplannedFailoverCompletedValue = "UnplannedFailoverCompleted"; + private const string UnplannedFailoverFailedValue = "UnplannedFailoverFailed"; + private const string UnplannedFailoverCompletionFailedValue = "UnplannedFailoverCompletionFailed"; + private const string UnplannedFailoverTransitionStatesEndValue = "UnplannedFailoverTransitionStatesEnd"; + private const string CommitFailoverStatesBeginValue = "CommitFailoverStatesBegin"; + private const string CommitFailoverInProgressOnPrimaryValue = "CommitFailoverInProgressOnPrimary"; + private const string CommitFailoverInProgressOnRecoveryValue = "CommitFailoverInProgressOnRecovery"; + private const string CommitFailoverCompletedValue = "CommitFailoverCompleted"; + private const string CommitFailoverFailedOnPrimaryValue = "CommitFailoverFailedOnPrimary"; + private const string CommitFailoverFailedOnRecoveryValue = "CommitFailoverFailedOnRecovery"; + private const string CommitFailoverStatesEndValue = "CommitFailoverStatesEnd"; + private const string CancelFailoverStatesBeginValue = "CancelFailoverStatesBegin"; + private const string CancelFailoverInProgressOnPrimaryValue = "CancelFailoverInProgressOnPrimary"; + private const string CancelFailoverInProgressOnRecoveryValue = "CancelFailoverInProgressOnRecovery"; + private const string CancelFailoverFailedOnPrimaryValue = "CancelFailoverFailedOnPrimary"; + private const string CancelFailoverFailedOnRecoveryValue = "CancelFailoverFailedOnRecovery"; + private const string CancelFailoverStatesEndValue = "CancelFailoverStatesEnd"; + private const string ChangeRecoveryPointStatesBeginValue = "ChangeRecoveryPointStatesBegin"; + private const string ChangeRecoveryPointInitiatedValue = "ChangeRecoveryPointInitiated"; + private const string ChangeRecoveryPointCompletedValue = "ChangeRecoveryPointCompleted"; + private const string ChangeRecoveryPointFailedValue = "ChangeRecoveryPointFailed"; + private const string ChangeRecoveryPointStatesEndValue = "ChangeRecoveryPointStatesEnd"; + private const string ReprotectStatesBeginValue = "ReprotectStatesBegin"; + private const string ReprotectInitiatedValue = "ReprotectInitiated"; + private const string ReprotectFailedValue = "ReprotectFailed"; + private const string ReprotectStatesEndValue = "ReprotectStatesEnd"; + + /// Begin marker for unprotected states. + public static ProtectionState UnprotectedStatesBegin { get; } = new ProtectionState(UnprotectedStatesBeginValue); + /// Enable protection is in progress. + public static ProtectionState EnablingProtection { get; } = new ProtectionState(EnablingProtectionValue); + /// Enable protection failed. + public static ProtectionState EnablingFailed { get; } = new ProtectionState(EnablingFailedValue); + /// Disabling protection is in progress. + public static ProtectionState DisablingProtection { get; } = new ProtectionState(DisablingProtectionValue); + /// Disabling protection succeeded. This is a transient state before the protected item is deleted. + public static ProtectionState MarkedForDeletion { get; } = new ProtectionState(MarkedForDeletionValue); + /// Disable protection failed. + public static ProtectionState DisablingFailed { get; } = new ProtectionState(DisablingFailedValue); + /// End marker for unprotected states. + public static ProtectionState UnprotectedStatesEnd { get; } = new ProtectionState(UnprotectedStatesEndValue); + /// Begin marker for initial replication states. + public static ProtectionState InitialReplicationStatesBegin { get; } = new ProtectionState(InitialReplicationStatesBeginValue); + /// Initial replication is in progress. + public static ProtectionState InitialReplicationInProgress { get; } = new ProtectionState(InitialReplicationInProgressValue); + /// Initial replication has completed on the primary side. + public static ProtectionState InitialReplicationCompletedOnPrimary { get; } = new ProtectionState(InitialReplicationCompletedOnPrimaryValue); + /// Initial replication has completed on the recovery side. + public static ProtectionState InitialReplicationCompletedOnRecovery { get; } = new ProtectionState(InitialReplicationCompletedOnRecoveryValue); + /// Initial replication failed and would need to be started again. + public static ProtectionState InitialReplicationFailed { get; } = new ProtectionState(InitialReplicationFailedValue); + /// End marker for initial replication states. + public static ProtectionState InitialReplicationStatesEnd { get; } = new ProtectionState(InitialReplicationStatesEndValue); + /// Begin marker for protected steady-state states. + public static ProtectionState ProtectedStatesBegin { get; } = new ProtectionState(ProtectedStatesBeginValue); + /// Protected item is protected and replication is on-going. Any issues with replication will be surfaced separately via the health property and will not affect the state. + public static ProtectionState Protected { get; } = new ProtectionState(ProtectedValue); + /// End marker for protected steady-state states. + public static ProtectionState ProtectedStatesEnd { get; } = new ProtectionState(ProtectedStatesEndValue); + /// Begin marker for planned failover transition states. + public static ProtectionState PlannedFailoverTransitionStatesBegin { get; } = new ProtectionState(PlannedFailoverTransitionStatesBeginValue); + /// Planned failover has been initiated. + public static ProtectionState PlannedFailoverInitiated { get; } = new ProtectionState(PlannedFailoverInitiatedValue); + /// Planned failover preparing protected entities is in progress. + public static ProtectionState PlannedFailoverCompleting { get; } = new ProtectionState(PlannedFailoverCompletingValue); + /// Planned failover has been completed successfully. + public static ProtectionState PlannedFailoverCompleted { get; } = new ProtectionState(PlannedFailoverCompletedValue); + /// Planned failover initiation failed. + public static ProtectionState PlannedFailoverFailed { get; } = new ProtectionState(PlannedFailoverFailedValue); + /// Planned failover preparing protected entities failed. + public static ProtectionState PlannedFailoverCompletionFailed { get; } = new ProtectionState(PlannedFailoverCompletionFailedValue); + /// End marker for planned failover transition states. + public static ProtectionState PlannedFailoverTransitionStatesEnd { get; } = new ProtectionState(PlannedFailoverTransitionStatesEndValue); + /// Begin marker for unplanned failover transition states. + public static ProtectionState UnplannedFailoverTransitionStatesBegin { get; } = new ProtectionState(UnplannedFailoverTransitionStatesBeginValue); + /// Unplanned failover has been initiated. + public static ProtectionState UnplannedFailoverInitiated { get; } = new ProtectionState(UnplannedFailoverInitiatedValue); + /// Unplanned failover preparing protected entities is in progress. + public static ProtectionState UnplannedFailoverCompleting { get; } = new ProtectionState(UnplannedFailoverCompletingValue); + /// Unplanned failover preparing protected entities is in progress. + public static ProtectionState UnplannedFailoverCompleted { get; } = new ProtectionState(UnplannedFailoverCompletedValue); + /// Unplanned failover initiation failed. + public static ProtectionState UnplannedFailoverFailed { get; } = new ProtectionState(UnplannedFailoverFailedValue); + /// Unplanned failover preparing protected entities failed. + public static ProtectionState UnplannedFailoverCompletionFailed { get; } = new ProtectionState(UnplannedFailoverCompletionFailedValue); + /// End marker for unplanned failover transition states. + public static ProtectionState UnplannedFailoverTransitionStatesEnd { get; } = new ProtectionState(UnplannedFailoverTransitionStatesEndValue); + /// Begin marker for commit failover states. + public static ProtectionState CommitFailoverStatesBegin { get; } = new ProtectionState(CommitFailoverStatesBeginValue); + /// Commit failover is in progress on the primary side. + public static ProtectionState CommitFailoverInProgressOnPrimary { get; } = new ProtectionState(CommitFailoverInProgressOnPrimaryValue); + /// Commit failover is in progress on the recovery side. + public static ProtectionState CommitFailoverInProgressOnRecovery { get; } = new ProtectionState(CommitFailoverInProgressOnRecoveryValue); + /// Commit failover has been completed successfully. + public static ProtectionState CommitFailoverCompleted { get; } = new ProtectionState(CommitFailoverCompletedValue); + /// Commit failover failed on the primary side. + public static ProtectionState CommitFailoverFailedOnPrimary { get; } = new ProtectionState(CommitFailoverFailedOnPrimaryValue); + /// Commit failover failed on the recovery side. + public static ProtectionState CommitFailoverFailedOnRecovery { get; } = new ProtectionState(CommitFailoverFailedOnRecoveryValue); + /// End marker for commit failover states. + public static ProtectionState CommitFailoverStatesEnd { get; } = new ProtectionState(CommitFailoverStatesEndValue); + /// Begin marker for cancel failover states. + public static ProtectionState CancelFailoverStatesBegin { get; } = new ProtectionState(CancelFailoverStatesBeginValue); + /// Cancel failover is in progress on the primary side. + public static ProtectionState CancelFailoverInProgressOnPrimary { get; } = new ProtectionState(CancelFailoverInProgressOnPrimaryValue); + /// Cancel failover is in progress on the recovery side. + public static ProtectionState CancelFailoverInProgressOnRecovery { get; } = new ProtectionState(CancelFailoverInProgressOnRecoveryValue); + /// Cancel failover failed on the primary side. + public static ProtectionState CancelFailoverFailedOnPrimary { get; } = new ProtectionState(CancelFailoverFailedOnPrimaryValue); + /// Cancel failover failed on the recovery side. + public static ProtectionState CancelFailoverFailedOnRecovery { get; } = new ProtectionState(CancelFailoverFailedOnRecoveryValue); + /// End marker for cancel failover states. + public static ProtectionState CancelFailoverStatesEnd { get; } = new ProtectionState(CancelFailoverStatesEndValue); + /// Begin marker for change recovery point states. + public static ProtectionState ChangeRecoveryPointStatesBegin { get; } = new ProtectionState(ChangeRecoveryPointStatesBeginValue); + /// Change recovery point has been initiated.. + public static ProtectionState ChangeRecoveryPointInitiated { get; } = new ProtectionState(ChangeRecoveryPointInitiatedValue); + /// Change recovery point has been completed successfully. + public static ProtectionState ChangeRecoveryPointCompleted { get; } = new ProtectionState(ChangeRecoveryPointCompletedValue); + /// Change recovery point has failed. + public static ProtectionState ChangeRecoveryPointFailed { get; } = new ProtectionState(ChangeRecoveryPointFailedValue); + /// End marker for change recovery point states. + public static ProtectionState ChangeRecoveryPointStatesEnd { get; } = new ProtectionState(ChangeRecoveryPointStatesEndValue); + /// Begin marker for reprotect states. + public static ProtectionState ReprotectStatesBegin { get; } = new ProtectionState(ReprotectStatesBeginValue); + /// Reprotect has been initiated. + public static ProtectionState ReprotectInitiated { get; } = new ProtectionState(ReprotectInitiatedValue); + /// Reprotect has failed. + public static ProtectionState ReprotectFailed { get; } = new ProtectionState(ReprotectFailedValue); + /// End marker for reprotect states. + public static ProtectionState ReprotectStatesEnd { get; } = new ProtectionState(ReprotectStatesEndValue); + /// Determines if two values are the same. + public static bool operator ==(ProtectionState left, ProtectionState right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(ProtectionState left, ProtectionState right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator ProtectionState(string value) => new ProtectionState(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is ProtectionState other && Equals(other); + /// + public bool Equals(ProtectionState other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/ProvisioningState.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/ProvisioningState.cs new file mode 100644 index 000000000000..cd174a6b84a4 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/ProvisioningState.cs @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + /// Gets or sets the provisioning state of the email configuration. + public readonly partial struct ProvisioningState : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public ProvisioningState(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string CanceledValue = "Canceled"; + private const string CreatingValue = "Creating"; + private const string DeletingValue = "Deleting"; + private const string DeletedValue = "Deleted"; + private const string FailedValue = "Failed"; + private const string SucceededValue = "Succeeded"; + private const string UpdatingValue = "Updating"; + + /// Resource creation has been canceled. + public static ProvisioningState Canceled { get; } = new ProvisioningState(CanceledValue); + /// Resource is being created. + public static ProvisioningState Creating { get; } = new ProvisioningState(CreatingValue); + /// Resource is being deleted. + public static ProvisioningState Deleting { get; } = new ProvisioningState(DeletingValue); + /// Resource has been deleted. + public static ProvisioningState Deleted { get; } = new ProvisioningState(DeletedValue); + /// Resource creation failed. + public static ProvisioningState Failed { get; } = new ProvisioningState(FailedValue); + /// Resource creation/update succeeded. + public static ProvisioningState Succeeded { get; } = new ProvisioningState(SucceededValue); + /// Resource is being updated. + public static ProvisioningState Updating { get; } = new ProvisioningState(UpdatingValue); + /// Determines if two values are the same. + public static bool operator ==(ProvisioningState left, ProvisioningState right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(ProvisioningState left, ProvisioningState right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator ProvisioningState(string value) => new ProvisioningState(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is ProvisioningState other && Equals(other); + /// + public bool Equals(ProvisioningState other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/RecoveryPointModelCustomProperties.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/RecoveryPointModelCustomProperties.Serialization.cs new file mode 100644 index 000000000000..245c0589f035 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/RecoveryPointModelCustomProperties.Serialization.cs @@ -0,0 +1,118 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + [PersistableModelProxy(typeof(UnknownRecoveryPointModelCustomProperties))] + public partial class RecoveryPointModelCustomProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(RecoveryPointModelCustomProperties)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("instanceType"u8); + writer.WriteStringValue(InstanceType); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + RecoveryPointModelCustomProperties 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(RecoveryPointModelCustomProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeRecoveryPointModelCustomProperties(document.RootElement, options); + } + + internal static RecoveryPointModelCustomProperties DeserializeRecoveryPointModelCustomProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + if (element.TryGetProperty("instanceType", out JsonElement discriminator)) + { + switch (discriminator.GetString()) + { + case "HyperVToAzStackHCI": return HyperVToAzStackHCIRecoveryPointModelCustomProperties.DeserializeHyperVToAzStackHCIRecoveryPointModelCustomProperties(element, options); + case "VMwareToAzStackHCIRecoveryPointModelCustomProperties": return VMwareToAzStackHCIRecoveryPointModelCustomProperties.DeserializeVMwareToAzStackHCIRecoveryPointModelCustomProperties(element, options); + } + } + return UnknownRecoveryPointModelCustomProperties.DeserializeUnknownRecoveryPointModelCustomProperties(element, options); + } + + 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(RecoveryPointModelCustomProperties)} does not support writing '{options.Format}' format."); + } + } + + RecoveryPointModelCustomProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeRecoveryPointModelCustomProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(RecoveryPointModelCustomProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/RecoveryPointModelCustomProperties.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/RecoveryPointModelCustomProperties.cs new file mode 100644 index 000000000000..3961b4b39cbc --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/RecoveryPointModelCustomProperties.cs @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + /// + /// Recovery point model custom properties. + /// 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 . + /// + public abstract partial class RecoveryPointModelCustomProperties + { + /// + /// 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 protected IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + protected RecoveryPointModelCustomProperties() + { + } + + /// Initializes a new instance of . + /// Discriminator property for RecoveryPointModelCustomProperties. + /// Keeps track of any properties unknown to the library. + internal RecoveryPointModelCustomProperties(string instanceType, IDictionary serializedAdditionalRawData) + { + InstanceType = instanceType; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Discriminator property for RecoveryPointModelCustomProperties. + internal string InstanceType { get; set; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/RecoveryPointModelListResult.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/RecoveryPointModelListResult.Serialization.cs new file mode 100644 index 000000000000..3ddfb28bdf8d --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/RecoveryPointModelListResult.Serialization.cs @@ -0,0 +1,151 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + internal partial class RecoveryPointModelListResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(RecoveryPointModelListResult)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var item in Value) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + if (Optional.IsDefined(NextLink)) + { + writer.WritePropertyName("nextLink"u8); + writer.WriteStringValue(NextLink.AbsoluteUri); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + RecoveryPointModelListResult 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(RecoveryPointModelListResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeRecoveryPointModelListResult(document.RootElement, options); + } + + internal static RecoveryPointModelListResult DeserializeRecoveryPointModelListResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IReadOnlyList value = default; + Uri nextLink = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(RecoveryPointModelData.DeserializeRecoveryPointModelData(item, options)); + } + value = array; + continue; + } + if (property.NameEquals("nextLink"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + nextLink = new Uri(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new RecoveryPointModelListResult(value, nextLink, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(RecoveryPointModelListResult)} does not support writing '{options.Format}' format."); + } + } + + RecoveryPointModelListResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeRecoveryPointModelListResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(RecoveryPointModelListResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/RecoveryPointModelListResult.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/RecoveryPointModelListResult.cs new file mode 100644 index 000000000000..81778628fe60 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/RecoveryPointModelListResult.cs @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + /// The response of a RecoveryPointModel list operation. + internal partial class RecoveryPointModelListResult + { + /// + /// 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 RecoveryPointModel items on this page. + /// is null. + internal RecoveryPointModelListResult(IEnumerable value) + { + Argument.AssertNotNull(value, nameof(value)); + + Value = value.ToList(); + } + + /// Initializes a new instance of . + /// The RecoveryPointModel items on this page. + /// The link to the next page of items. + /// Keeps track of any properties unknown to the library. + internal RecoveryPointModelListResult(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) + { + Value = value; + NextLink = nextLink; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal RecoveryPointModelListResult() + { + } + + /// The RecoveryPointModel items on this page. + public IReadOnlyList Value { get; } + /// The link to the next page of items. + public Uri NextLink { get; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/RecoveryPointModelProperties.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/RecoveryPointModelProperties.Serialization.cs new file mode 100644 index 000000000000..f7682274ed0b --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/RecoveryPointModelProperties.Serialization.cs @@ -0,0 +1,157 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + public partial class RecoveryPointModelProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(RecoveryPointModelProperties)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("recoveryPointTime"u8); + writer.WriteStringValue(RecoveryPointOn, "O"); + writer.WritePropertyName("recoveryPointType"u8); + writer.WriteStringValue(RecoveryPointType.ToString()); + writer.WritePropertyName("customProperties"u8); + writer.WriteObjectValue(CustomProperties, options); + if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) + { + writer.WritePropertyName("provisioningState"u8); + writer.WriteStringValue(ProvisioningState.Value.ToString()); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + RecoveryPointModelProperties 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(RecoveryPointModelProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeRecoveryPointModelProperties(document.RootElement, options); + } + + internal static RecoveryPointModelProperties DeserializeRecoveryPointModelProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + DateTimeOffset recoveryPointTime = default; + RecoveryPointType recoveryPointType = default; + RecoveryPointModelCustomProperties customProperties = default; + ProvisioningState? provisioningState = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("recoveryPointTime"u8)) + { + recoveryPointTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("recoveryPointType"u8)) + { + recoveryPointType = new RecoveryPointType(property.Value.GetString()); + continue; + } + if (property.NameEquals("customProperties"u8)) + { + customProperties = RecoveryPointModelCustomProperties.DeserializeRecoveryPointModelCustomProperties(property.Value, options); + continue; + } + if (property.NameEquals("provisioningState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + provisioningState = new ProvisioningState(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new RecoveryPointModelProperties(recoveryPointTime, recoveryPointType, customProperties, provisioningState, 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(RecoveryPointModelProperties)} does not support writing '{options.Format}' format."); + } + } + + RecoveryPointModelProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeRecoveryPointModelProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(RecoveryPointModelProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/RecoveryPointModelProperties.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/RecoveryPointModelProperties.cs new file mode 100644 index 000000000000..31aae0d4c159 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/RecoveryPointModelProperties.cs @@ -0,0 +1,103 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + /// Recovery point model properties. + public partial class RecoveryPointModelProperties + { + /// + /// 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 . + /// Gets or sets the recovery point time. + /// Gets or sets the recovery point type. + /// + /// Recovery point model custom properties. + /// 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 . + /// + /// is null. + internal RecoveryPointModelProperties(DateTimeOffset recoveryPointOn, RecoveryPointType recoveryPointType, RecoveryPointModelCustomProperties customProperties) + { + Argument.AssertNotNull(customProperties, nameof(customProperties)); + + RecoveryPointOn = recoveryPointOn; + RecoveryPointType = recoveryPointType; + CustomProperties = customProperties; + } + + /// Initializes a new instance of . + /// Gets or sets the recovery point time. + /// Gets or sets the recovery point type. + /// + /// Recovery point model custom properties. + /// 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 . + /// + /// Gets or sets the provisioning state of the recovery point item. + /// Keeps track of any properties unknown to the library. + internal RecoveryPointModelProperties(DateTimeOffset recoveryPointOn, RecoveryPointType recoveryPointType, RecoveryPointModelCustomProperties customProperties, ProvisioningState? provisioningState, IDictionary serializedAdditionalRawData) + { + RecoveryPointOn = recoveryPointOn; + RecoveryPointType = recoveryPointType; + CustomProperties = customProperties; + ProvisioningState = provisioningState; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal RecoveryPointModelProperties() + { + } + + /// Gets or sets the recovery point time. + public DateTimeOffset RecoveryPointOn { get; } + /// Gets or sets the recovery point type. + public RecoveryPointType RecoveryPointType { get; } + /// + /// Recovery point model custom properties. + /// 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 . + /// + public RecoveryPointModelCustomProperties CustomProperties { get; } + /// Gets or sets the provisioning state of the recovery point item. + public ProvisioningState? ProvisioningState { get; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/RecoveryPointType.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/RecoveryPointType.cs new file mode 100644 index 000000000000..8e45e11ce941 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/RecoveryPointType.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + /// Gets or sets the recovery point type. + public readonly partial struct RecoveryPointType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public RecoveryPointType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string ApplicationConsistentValue = "ApplicationConsistent"; + private const string CrashConsistentValue = "CrashConsistent"; + + /// Application consistent recovery point. + public static RecoveryPointType ApplicationConsistent { get; } = new RecoveryPointType(ApplicationConsistentValue); + /// Crash consistent recovery point. + public static RecoveryPointType CrashConsistent { get; } = new RecoveryPointType(CrashConsistentValue); + /// Determines if two values are the same. + public static bool operator ==(RecoveryPointType left, RecoveryPointType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(RecoveryPointType left, RecoveryPointType right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator RecoveryPointType(string value) => new RecoveryPointType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is RecoveryPointType other && Equals(other); + /// + public bool Equals(RecoveryPointType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/RecoveryServicesDataReplicationPrivateEndpointConnectionListResult.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/RecoveryServicesDataReplicationPrivateEndpointConnectionListResult.Serialization.cs new file mode 100644 index 000000000000..7efd8df5d1be --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/RecoveryServicesDataReplicationPrivateEndpointConnectionListResult.Serialization.cs @@ -0,0 +1,151 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + internal partial class RecoveryServicesDataReplicationPrivateEndpointConnectionListResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(RecoveryServicesDataReplicationPrivateEndpointConnectionListResult)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var item in Value) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + if (Optional.IsDefined(NextLink)) + { + writer.WritePropertyName("nextLink"u8); + writer.WriteStringValue(NextLink.AbsoluteUri); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + RecoveryServicesDataReplicationPrivateEndpointConnectionListResult 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(RecoveryServicesDataReplicationPrivateEndpointConnectionListResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeRecoveryServicesDataReplicationPrivateEndpointConnectionListResult(document.RootElement, options); + } + + internal static RecoveryServicesDataReplicationPrivateEndpointConnectionListResult DeserializeRecoveryServicesDataReplicationPrivateEndpointConnectionListResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IReadOnlyList value = default; + Uri nextLink = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(RecoveryServicesDataReplicationPrivateEndpointConnectionData.DeserializeRecoveryServicesDataReplicationPrivateEndpointConnectionData(item, options)); + } + value = array; + continue; + } + if (property.NameEquals("nextLink"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + nextLink = new Uri(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new RecoveryServicesDataReplicationPrivateEndpointConnectionListResult(value, nextLink, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(RecoveryServicesDataReplicationPrivateEndpointConnectionListResult)} does not support writing '{options.Format}' format."); + } + } + + RecoveryServicesDataReplicationPrivateEndpointConnectionListResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeRecoveryServicesDataReplicationPrivateEndpointConnectionListResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(RecoveryServicesDataReplicationPrivateEndpointConnectionListResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/RecoveryServicesDataReplicationPrivateEndpointConnectionListResult.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/RecoveryServicesDataReplicationPrivateEndpointConnectionListResult.cs new file mode 100644 index 000000000000..c96fcbfdc6f8 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/RecoveryServicesDataReplicationPrivateEndpointConnectionListResult.cs @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + /// The response of a PrivateEndpointConnection list operation. + internal partial class RecoveryServicesDataReplicationPrivateEndpointConnectionListResult + { + /// + /// 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 PrivateEndpointConnection items on this page. + /// is null. + internal RecoveryServicesDataReplicationPrivateEndpointConnectionListResult(IEnumerable value) + { + Argument.AssertNotNull(value, nameof(value)); + + Value = value.ToList(); + } + + /// Initializes a new instance of . + /// The PrivateEndpointConnection items on this page. + /// The link to the next page of items. + /// Keeps track of any properties unknown to the library. + internal RecoveryServicesDataReplicationPrivateEndpointConnectionListResult(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) + { + Value = value; + NextLink = nextLink; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal RecoveryServicesDataReplicationPrivateEndpointConnectionListResult() + { + } + + /// The PrivateEndpointConnection items on this page. + public IReadOnlyList Value { get; } + /// The link to the next page of items. + public Uri NextLink { get; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/RecoveryServicesDataReplicationPrivateLinkResourceListResult.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/RecoveryServicesDataReplicationPrivateLinkResourceListResult.Serialization.cs new file mode 100644 index 000000000000..37f18aa40cc9 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/RecoveryServicesDataReplicationPrivateLinkResourceListResult.Serialization.cs @@ -0,0 +1,151 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + internal partial class RecoveryServicesDataReplicationPrivateLinkResourceListResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(RecoveryServicesDataReplicationPrivateLinkResourceListResult)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var item in Value) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + if (Optional.IsDefined(NextLink)) + { + writer.WritePropertyName("nextLink"u8); + writer.WriteStringValue(NextLink.AbsoluteUri); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + RecoveryServicesDataReplicationPrivateLinkResourceListResult 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(RecoveryServicesDataReplicationPrivateLinkResourceListResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeRecoveryServicesDataReplicationPrivateLinkResourceListResult(document.RootElement, options); + } + + internal static RecoveryServicesDataReplicationPrivateLinkResourceListResult DeserializeRecoveryServicesDataReplicationPrivateLinkResourceListResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IReadOnlyList value = default; + Uri nextLink = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(RecoveryServicesDataReplicationPrivateLinkResourceDataData.DeserializeRecoveryServicesDataReplicationPrivateLinkResourceDataData(item, options)); + } + value = array; + continue; + } + if (property.NameEquals("nextLink"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + nextLink = new Uri(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new RecoveryServicesDataReplicationPrivateLinkResourceListResult(value, nextLink, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(RecoveryServicesDataReplicationPrivateLinkResourceListResult)} does not support writing '{options.Format}' format."); + } + } + + RecoveryServicesDataReplicationPrivateLinkResourceListResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeRecoveryServicesDataReplicationPrivateLinkResourceListResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(RecoveryServicesDataReplicationPrivateLinkResourceListResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/RecoveryServicesDataReplicationPrivateLinkResourceListResult.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/RecoveryServicesDataReplicationPrivateLinkResourceListResult.cs new file mode 100644 index 000000000000..abee00f3e2f1 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/RecoveryServicesDataReplicationPrivateLinkResourceListResult.cs @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + /// The response of a PrivateLinkResource list operation. + internal partial class RecoveryServicesDataReplicationPrivateLinkResourceListResult + { + /// + /// 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 PrivateLinkResource items on this page. + /// is null. + internal RecoveryServicesDataReplicationPrivateLinkResourceListResult(IEnumerable value) + { + Argument.AssertNotNull(value, nameof(value)); + + Value = value.ToList(); + } + + /// Initializes a new instance of . + /// The PrivateLinkResource items on this page. + /// The link to the next page of items. + /// Keeps track of any properties unknown to the library. + internal RecoveryServicesDataReplicationPrivateLinkResourceListResult(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) + { + Value = value; + NextLink = nextLink; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal RecoveryServicesDataReplicationPrivateLinkResourceListResult() + { + } + + /// The PrivateLinkResource items on this page. + public IReadOnlyList Value { get; } + /// The link to the next page of items. + public Uri NextLink { get; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/RecoveryServicesDataReplicationPrivateLinkResourceProperties.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/RecoveryServicesDataReplicationPrivateLinkResourceProperties.Serialization.cs new file mode 100644 index 000000000000..fdb5a9c2b8eb --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/RecoveryServicesDataReplicationPrivateLinkResourceProperties.Serialization.cs @@ -0,0 +1,194 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + public partial class RecoveryServicesDataReplicationPrivateLinkResourceProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(RecoveryServicesDataReplicationPrivateLinkResourceProperties)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(GroupId)) + { + writer.WritePropertyName("groupId"u8); + writer.WriteStringValue(GroupId); + } + if (Optional.IsCollectionDefined(RequiredMembers)) + { + writer.WritePropertyName("requiredMembers"u8); + writer.WriteStartArray(); + foreach (var item in RequiredMembers) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(RequiredZoneNames)) + { + writer.WritePropertyName("requiredZoneNames"u8); + writer.WriteStartArray(); + foreach (var item in RequiredZoneNames) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) + { + writer.WritePropertyName("provisioningState"u8); + writer.WriteStringValue(ProvisioningState.Value.ToString()); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + RecoveryServicesDataReplicationPrivateLinkResourceProperties 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(RecoveryServicesDataReplicationPrivateLinkResourceProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeRecoveryServicesDataReplicationPrivateLinkResourceProperties(document.RootElement, options); + } + + internal static RecoveryServicesDataReplicationPrivateLinkResourceProperties DeserializeRecoveryServicesDataReplicationPrivateLinkResourceProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string groupId = default; + IReadOnlyList requiredMembers = default; + IReadOnlyList requiredZoneNames = default; + ProvisioningState? provisioningState = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("groupId"u8)) + { + groupId = property.Value.GetString(); + continue; + } + if (property.NameEquals("requiredMembers"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + requiredMembers = array; + continue; + } + if (property.NameEquals("requiredZoneNames"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + requiredZoneNames = array; + continue; + } + if (property.NameEquals("provisioningState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + provisioningState = new ProvisioningState(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new RecoveryServicesDataReplicationPrivateLinkResourceProperties(groupId, requiredMembers ?? new ChangeTrackingList(), requiredZoneNames ?? new ChangeTrackingList(), provisioningState, 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(RecoveryServicesDataReplicationPrivateLinkResourceProperties)} does not support writing '{options.Format}' format."); + } + } + + RecoveryServicesDataReplicationPrivateLinkResourceProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeRecoveryServicesDataReplicationPrivateLinkResourceProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(RecoveryServicesDataReplicationPrivateLinkResourceProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/RecoveryServicesDataReplicationPrivateLinkResourceProperties.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/RecoveryServicesDataReplicationPrivateLinkResourceProperties.cs new file mode 100644 index 000000000000..26b1c6b32366 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/RecoveryServicesDataReplicationPrivateLinkResourceProperties.cs @@ -0,0 +1,79 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + /// Represents private link resource properties. + public partial class RecoveryServicesDataReplicationPrivateLinkResourceProperties + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + internal RecoveryServicesDataReplicationPrivateLinkResourceProperties() + { + RequiredMembers = new ChangeTrackingList(); + RequiredZoneNames = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// Gets or sets the group id. + /// Gets or sets the required member. This translates to how many Private IPs should be created for each privately linkable resource. + /// Gets or sets the private DNS zone names. + /// Gets or sets the provisioning state of the private link resource. + /// Keeps track of any properties unknown to the library. + internal RecoveryServicesDataReplicationPrivateLinkResourceProperties(string groupId, IReadOnlyList requiredMembers, IReadOnlyList requiredZoneNames, ProvisioningState? provisioningState, IDictionary serializedAdditionalRawData) + { + GroupId = groupId; + RequiredMembers = requiredMembers; + RequiredZoneNames = requiredZoneNames; + ProvisioningState = provisioningState; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Gets or sets the group id. + public string GroupId { get; } + /// Gets or sets the required member. This translates to how many Private IPs should be created for each privately linkable resource. + public IReadOnlyList RequiredMembers { get; } + /// Gets or sets the private DNS zone names. + public IReadOnlyList RequiredZoneNames { get; } + /// Gets or sets the provisioning state of the private link resource. + public ProvisioningState? ProvisioningState { get; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/RecoveryServicesDataReplicationPrivateLinkServiceConnectionState.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/RecoveryServicesDataReplicationPrivateLinkServiceConnectionState.Serialization.cs new file mode 100644 index 000000000000..0dfbcb2abb5f --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/RecoveryServicesDataReplicationPrivateLinkServiceConnectionState.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; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + public partial class RecoveryServicesDataReplicationPrivateLinkServiceConnectionState : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(RecoveryServicesDataReplicationPrivateLinkServiceConnectionState)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(Status)) + { + writer.WritePropertyName("status"u8); + writer.WriteStringValue(Status.Value.ToString()); + } + if (Optional.IsDefined(Description)) + { + writer.WritePropertyName("description"u8); + writer.WriteStringValue(Description); + } + if (Optional.IsDefined(ActionsRequired)) + { + writer.WritePropertyName("actionsRequired"u8); + writer.WriteStringValue(ActionsRequired); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + RecoveryServicesDataReplicationPrivateLinkServiceConnectionState 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(RecoveryServicesDataReplicationPrivateLinkServiceConnectionState)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeRecoveryServicesDataReplicationPrivateLinkServiceConnectionState(document.RootElement, options); + } + + internal static RecoveryServicesDataReplicationPrivateLinkServiceConnectionState DeserializeRecoveryServicesDataReplicationPrivateLinkServiceConnectionState(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + PrivateEndpointConnectionStatus? status = default; + string description = default; + string actionsRequired = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("status"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + status = new PrivateEndpointConnectionStatus(property.Value.GetString()); + continue; + } + if (property.NameEquals("description"u8)) + { + description = property.Value.GetString(); + continue; + } + if (property.NameEquals("actionsRequired"u8)) + { + actionsRequired = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new RecoveryServicesDataReplicationPrivateLinkServiceConnectionState(status, description, actionsRequired, 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(RecoveryServicesDataReplicationPrivateLinkServiceConnectionState)} does not support writing '{options.Format}' format."); + } + } + + RecoveryServicesDataReplicationPrivateLinkServiceConnectionState IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeRecoveryServicesDataReplicationPrivateLinkServiceConnectionState(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(RecoveryServicesDataReplicationPrivateLinkServiceConnectionState)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/RecoveryServicesDataReplicationPrivateLinkServiceConnectionState.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/RecoveryServicesDataReplicationPrivateLinkServiceConnectionState.cs new file mode 100644 index 000000000000..8f098ef0a7c5 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/RecoveryServicesDataReplicationPrivateLinkServiceConnectionState.cs @@ -0,0 +1,73 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + /// Represents Private link service connection state. + public partial class RecoveryServicesDataReplicationPrivateLinkServiceConnectionState + { + /// + /// 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 RecoveryServicesDataReplicationPrivateLinkServiceConnectionState() + { + } + + /// Initializes a new instance of . + /// Gets or sets the status. + /// Gets or sets description. + /// Gets or sets actions required. + /// Keeps track of any properties unknown to the library. + internal RecoveryServicesDataReplicationPrivateLinkServiceConnectionState(PrivateEndpointConnectionStatus? status, string description, string actionsRequired, IDictionary serializedAdditionalRawData) + { + Status = status; + Description = description; + ActionsRequired = actionsRequired; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Gets or sets the status. + public PrivateEndpointConnectionStatus? Status { get; set; } + /// Gets or sets description. + public string Description { get; set; } + /// Gets or sets actions required. + public string ActionsRequired { get; set; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/RemotePrivateEndpoint.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/RemotePrivateEndpoint.Serialization.cs new file mode 100644 index 000000000000..de8ac44a4828 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/RemotePrivateEndpoint.Serialization.cs @@ -0,0 +1,232 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + public partial class RemotePrivateEndpoint : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(RemotePrivateEndpoint)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("id"u8); + writer.WriteStringValue(Id); + if (Optional.IsCollectionDefined(PrivateLinkServiceConnections)) + { + writer.WritePropertyName("privateLinkServiceConnections"u8); + writer.WriteStartArray(); + foreach (var item in PrivateLinkServiceConnections) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(ManualPrivateLinkServiceConnections)) + { + writer.WritePropertyName("manualPrivateLinkServiceConnections"u8); + writer.WriteStartArray(); + foreach (var item in ManualPrivateLinkServiceConnections) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(PrivateLinkServiceProxies)) + { + writer.WritePropertyName("privateLinkServiceProxies"u8); + writer.WriteStartArray(); + foreach (var item in PrivateLinkServiceProxies) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(ConnectionDetails)) + { + writer.WritePropertyName("connectionDetails"u8); + writer.WriteStartArray(); + foreach (var item in ConnectionDetails) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + RemotePrivateEndpoint 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(RemotePrivateEndpoint)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeRemotePrivateEndpoint(document.RootElement, options); + } + + internal static RemotePrivateEndpoint DeserializeRemotePrivateEndpoint(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string id = default; + IList privateLinkServiceConnections = default; + IList manualPrivateLinkServiceConnections = default; + IList privateLinkServiceProxies = default; + IList connectionDetails = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("id"u8)) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("privateLinkServiceConnections"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(PrivateLinkServiceConnection.DeserializePrivateLinkServiceConnection(item, options)); + } + privateLinkServiceConnections = array; + continue; + } + if (property.NameEquals("manualPrivateLinkServiceConnections"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(PrivateLinkServiceConnection.DeserializePrivateLinkServiceConnection(item, options)); + } + manualPrivateLinkServiceConnections = array; + continue; + } + if (property.NameEquals("privateLinkServiceProxies"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(PrivateLinkServiceProxy.DeserializePrivateLinkServiceProxy(item, options)); + } + privateLinkServiceProxies = array; + continue; + } + if (property.NameEquals("connectionDetails"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(Models.ConnectionDetails.DeserializeConnectionDetails(item, options)); + } + connectionDetails = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new RemotePrivateEndpoint( + id, + privateLinkServiceConnections ?? new ChangeTrackingList(), + manualPrivateLinkServiceConnections ?? new ChangeTrackingList(), + privateLinkServiceProxies ?? new ChangeTrackingList(), + connectionDetails ?? new ChangeTrackingList(), + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(RemotePrivateEndpoint)} does not support writing '{options.Format}' format."); + } + } + + RemotePrivateEndpoint IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeRemotePrivateEndpoint(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(RemotePrivateEndpoint)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/RemotePrivateEndpoint.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/RemotePrivateEndpoint.cs new file mode 100644 index 000000000000..4fae1de10d3e --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/RemotePrivateEndpoint.cs @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + /// Represent remote private endpoint information for the private endpoint connection proxy. + public partial class RemotePrivateEndpoint + { + /// + /// 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 . + /// Gets or sets private link service proxy id. + /// is null. + public RemotePrivateEndpoint(string id) + { + Argument.AssertNotNull(id, nameof(id)); + + Id = id; + PrivateLinkServiceConnections = new ChangeTrackingList(); + ManualPrivateLinkServiceConnections = new ChangeTrackingList(); + PrivateLinkServiceProxies = new ChangeTrackingList(); + ConnectionDetails = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// Gets or sets private link service proxy id. + /// Gets or sets the list of Private Link Service Connections and gets populated for Auto approval flow. + /// Gets or sets the list of Manual Private Link Service Connections and gets populated for Manual approval flow. + /// Gets or sets the list of private link service proxies. + /// Gets or sets the list of Connection Details. This is the connection details for private endpoint. + /// Keeps track of any properties unknown to the library. + internal RemotePrivateEndpoint(string id, IList privateLinkServiceConnections, IList manualPrivateLinkServiceConnections, IList privateLinkServiceProxies, IList connectionDetails, IDictionary serializedAdditionalRawData) + { + Id = id; + PrivateLinkServiceConnections = privateLinkServiceConnections; + ManualPrivateLinkServiceConnections = manualPrivateLinkServiceConnections; + PrivateLinkServiceProxies = privateLinkServiceProxies; + ConnectionDetails = connectionDetails; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal RemotePrivateEndpoint() + { + } + + /// Gets or sets private link service proxy id. + public string Id { get; set; } + /// Gets or sets the list of Private Link Service Connections and gets populated for Auto approval flow. + public IList PrivateLinkServiceConnections { get; } + /// Gets or sets the list of Manual Private Link Service Connections and gets populated for Manual approval flow. + public IList ManualPrivateLinkServiceConnections { get; } + /// Gets or sets the list of private link service proxies. + public IList PrivateLinkServiceProxies { get; } + /// Gets or sets the list of Connection Details. This is the connection details for private endpoint. + public IList ConnectionDetails { get; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/ReplicationExtensionModelCustomProperties.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/ReplicationExtensionModelCustomProperties.Serialization.cs new file mode 100644 index 000000000000..e3e51cb1aa8f --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/ReplicationExtensionModelCustomProperties.Serialization.cs @@ -0,0 +1,118 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + [PersistableModelProxy(typeof(UnknownReplicationExtensionModelCustomProperties))] + public partial class ReplicationExtensionModelCustomProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ReplicationExtensionModelCustomProperties)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("instanceType"u8); + writer.WriteStringValue(InstanceType); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + ReplicationExtensionModelCustomProperties 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(ReplicationExtensionModelCustomProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeReplicationExtensionModelCustomProperties(document.RootElement, options); + } + + internal static ReplicationExtensionModelCustomProperties DeserializeReplicationExtensionModelCustomProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + if (element.TryGetProperty("instanceType", out JsonElement discriminator)) + { + switch (discriminator.GetString()) + { + case "HyperVToAzStackHCI": return HyperVToAzStackHCIReplicationExtensionModelCustomProperties.DeserializeHyperVToAzStackHCIReplicationExtensionModelCustomProperties(element, options); + case "VMwareToAzStackHCI": return VMwareToAzStackHCIReplicationExtensionModelCustomProperties.DeserializeVMwareToAzStackHCIReplicationExtensionModelCustomProperties(element, options); + } + } + return UnknownReplicationExtensionModelCustomProperties.DeserializeUnknownReplicationExtensionModelCustomProperties(element, options); + } + + 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(ReplicationExtensionModelCustomProperties)} does not support writing '{options.Format}' format."); + } + } + + ReplicationExtensionModelCustomProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeReplicationExtensionModelCustomProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ReplicationExtensionModelCustomProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/ReplicationExtensionModelCustomProperties.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/ReplicationExtensionModelCustomProperties.cs new file mode 100644 index 000000000000..4d5334c8248e --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/ReplicationExtensionModelCustomProperties.cs @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + /// + /// Replication extension model custom properties. + /// 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 . + /// + public abstract partial class ReplicationExtensionModelCustomProperties + { + /// + /// 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 protected IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + protected ReplicationExtensionModelCustomProperties() + { + } + + /// Initializes a new instance of . + /// Discriminator property for ReplicationExtensionModelCustomProperties. + /// Keeps track of any properties unknown to the library. + internal ReplicationExtensionModelCustomProperties(string instanceType, IDictionary serializedAdditionalRawData) + { + InstanceType = instanceType; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Discriminator property for ReplicationExtensionModelCustomProperties. + internal string InstanceType { get; set; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/ReplicationExtensionModelListResult.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/ReplicationExtensionModelListResult.Serialization.cs new file mode 100644 index 000000000000..5fbb01fbcb8a --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/ReplicationExtensionModelListResult.Serialization.cs @@ -0,0 +1,151 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + internal partial class ReplicationExtensionModelListResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ReplicationExtensionModelListResult)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var item in Value) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + if (Optional.IsDefined(NextLink)) + { + writer.WritePropertyName("nextLink"u8); + writer.WriteStringValue(NextLink.AbsoluteUri); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + ReplicationExtensionModelListResult 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(ReplicationExtensionModelListResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeReplicationExtensionModelListResult(document.RootElement, options); + } + + internal static ReplicationExtensionModelListResult DeserializeReplicationExtensionModelListResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IReadOnlyList value = default; + Uri nextLink = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ReplicationExtensionModelData.DeserializeReplicationExtensionModelData(item, options)); + } + value = array; + continue; + } + if (property.NameEquals("nextLink"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + nextLink = new Uri(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ReplicationExtensionModelListResult(value, nextLink, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ReplicationExtensionModelListResult)} does not support writing '{options.Format}' format."); + } + } + + ReplicationExtensionModelListResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeReplicationExtensionModelListResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ReplicationExtensionModelListResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/ReplicationExtensionModelListResult.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/ReplicationExtensionModelListResult.cs new file mode 100644 index 000000000000..b0d1fc5f2f59 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/ReplicationExtensionModelListResult.cs @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + /// The response of a ReplicationExtensionModel list operation. + internal partial class ReplicationExtensionModelListResult + { + /// + /// 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 ReplicationExtensionModel items on this page. + /// is null. + internal ReplicationExtensionModelListResult(IEnumerable value) + { + Argument.AssertNotNull(value, nameof(value)); + + Value = value.ToList(); + } + + /// Initializes a new instance of . + /// The ReplicationExtensionModel items on this page. + /// The link to the next page of items. + /// Keeps track of any properties unknown to the library. + internal ReplicationExtensionModelListResult(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) + { + Value = value; + NextLink = nextLink; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal ReplicationExtensionModelListResult() + { + } + + /// The ReplicationExtensionModel items on this page. + public IReadOnlyList Value { get; } + /// The link to the next page of items. + public Uri NextLink { get; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/ReplicationExtensionModelProperties.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/ReplicationExtensionModelProperties.Serialization.cs new file mode 100644 index 000000000000..075a7a5a01ad --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/ReplicationExtensionModelProperties.Serialization.cs @@ -0,0 +1,141 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + public partial class ReplicationExtensionModelProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ReplicationExtensionModelProperties)} does not support writing '{format}' format."); + } + + if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) + { + writer.WritePropertyName("provisioningState"u8); + writer.WriteStringValue(ProvisioningState.Value.ToString()); + } + writer.WritePropertyName("customProperties"u8); + writer.WriteObjectValue(CustomProperties, options); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + ReplicationExtensionModelProperties 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(ReplicationExtensionModelProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeReplicationExtensionModelProperties(document.RootElement, options); + } + + internal static ReplicationExtensionModelProperties DeserializeReplicationExtensionModelProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ProvisioningState? provisioningState = default; + ReplicationExtensionModelCustomProperties customProperties = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("provisioningState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + provisioningState = new ProvisioningState(property.Value.GetString()); + continue; + } + if (property.NameEquals("customProperties"u8)) + { + customProperties = ReplicationExtensionModelCustomProperties.DeserializeReplicationExtensionModelCustomProperties(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ReplicationExtensionModelProperties(provisioningState, customProperties, 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(ReplicationExtensionModelProperties)} does not support writing '{options.Format}' format."); + } + } + + ReplicationExtensionModelProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeReplicationExtensionModelProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ReplicationExtensionModelProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/ReplicationExtensionModelProperties.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/ReplicationExtensionModelProperties.cs new file mode 100644 index 000000000000..bc28252a42c2 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/ReplicationExtensionModelProperties.cs @@ -0,0 +1,91 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + /// Replication extension model properties. + public partial class ReplicationExtensionModelProperties + { + /// + /// 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 . + /// + /// Replication extension model custom properties. + /// 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 . + /// + /// is null. + public ReplicationExtensionModelProperties(ReplicationExtensionModelCustomProperties customProperties) + { + Argument.AssertNotNull(customProperties, nameof(customProperties)); + + CustomProperties = customProperties; + } + + /// Initializes a new instance of . + /// Gets or sets the provisioning state of the replication extension. + /// + /// Replication extension model custom properties. + /// 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 . + /// + /// Keeps track of any properties unknown to the library. + internal ReplicationExtensionModelProperties(ProvisioningState? provisioningState, ReplicationExtensionModelCustomProperties customProperties, IDictionary serializedAdditionalRawData) + { + ProvisioningState = provisioningState; + CustomProperties = customProperties; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal ReplicationExtensionModelProperties() + { + } + + /// Gets or sets the provisioning state of the replication extension. + public ProvisioningState? ProvisioningState { get; } + /// + /// Replication extension model custom properties. + /// 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 . + /// + public ReplicationExtensionModelCustomProperties CustomProperties { get; set; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/ReplicationVaultType.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/ReplicationVaultType.cs new file mode 100644 index 000000000000..0cf3ee07527e --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/ReplicationVaultType.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + /// Gets or sets the type of vault. + public readonly partial struct ReplicationVaultType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public ReplicationVaultType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string DisasterRecoveryValue = "DisasterRecovery"; + private const string MigrateValue = "Migrate"; + + /// Disaster recovery vault. + public static ReplicationVaultType DisasterRecovery { get; } = new ReplicationVaultType(DisasterRecoveryValue); + /// Migrate vault. + public static ReplicationVaultType Migrate { get; } = new ReplicationVaultType(MigrateValue); + /// Determines if two values are the same. + public static bool operator ==(ReplicationVaultType left, ReplicationVaultType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(ReplicationVaultType left, ReplicationVaultType right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator ReplicationVaultType(string value) => new ReplicationVaultType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is ReplicationVaultType other && Equals(other); + /// + public bool Equals(ReplicationVaultType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/ResynchronizationState.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/ResynchronizationState.cs new file mode 100644 index 000000000000..c6c2d3efa345 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/ResynchronizationState.cs @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + /// Gets or sets the resynchronization state. + public readonly partial struct ResynchronizationState : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public ResynchronizationState(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string NoneValue = "None"; + private const string ResynchronizationInitiatedValue = "ResynchronizationInitiated"; + private const string ResynchronizationCompletedValue = "ResynchronizationCompleted"; + private const string ResynchronizationFailedValue = "ResynchronizationFailed"; + + /// Resynchronization is not active. + public static ResynchronizationState None { get; } = new ResynchronizationState(NoneValue); + /// Resynchronization has been initiated. + public static ResynchronizationState ResynchronizationInitiated { get; } = new ResynchronizationState(ResynchronizationInitiatedValue); + /// Resynchronization has been completed successfully. + public static ResynchronizationState ResynchronizationCompleted { get; } = new ResynchronizationState(ResynchronizationCompletedValue); + /// Resynchronization has failed and would need to be started again. + public static ResynchronizationState ResynchronizationFailed { get; } = new ResynchronizationState(ResynchronizationFailedValue); + /// Determines if two values are the same. + public static bool operator ==(ResynchronizationState left, ResynchronizationState right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(ResynchronizationState left, ResynchronizationState right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator ResynchronizationState(string value) => new ResynchronizationState(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is ResynchronizationState other && Equals(other); + /// + public bool Equals(ResynchronizationState other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/StorageContainerProperties.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/StorageContainerProperties.Serialization.cs new file mode 100644 index 000000000000..5b9aa7c5cca0 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/StorageContainerProperties.Serialization.cs @@ -0,0 +1,134 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + public partial class StorageContainerProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(StorageContainerProperties)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name); + writer.WritePropertyName("clusterSharedVolumePath"u8); + writer.WriteStringValue(ClusterSharedVolumePath); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + StorageContainerProperties 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(StorageContainerProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeStorageContainerProperties(document.RootElement, options); + } + + internal static StorageContainerProperties DeserializeStorageContainerProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string name = default; + string clusterSharedVolumePath = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("clusterSharedVolumePath"u8)) + { + clusterSharedVolumePath = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new StorageContainerProperties(name, clusterSharedVolumePath, 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(StorageContainerProperties)} does not support writing '{options.Format}' format."); + } + } + + StorageContainerProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeStorageContainerProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(StorageContainerProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/StorageContainerProperties.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/StorageContainerProperties.cs new file mode 100644 index 000000000000..b1cd48805258 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/StorageContainerProperties.cs @@ -0,0 +1,82 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + /// Storage container properties. + public partial class StorageContainerProperties + { + /// + /// 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 . + /// Gets or sets the Name. + /// Gets or sets the ClusterSharedVolumePath. + /// or is null. + public StorageContainerProperties(string name, string clusterSharedVolumePath) + { + Argument.AssertNotNull(name, nameof(name)); + Argument.AssertNotNull(clusterSharedVolumePath, nameof(clusterSharedVolumePath)); + + Name = name; + ClusterSharedVolumePath = clusterSharedVolumePath; + } + + /// Initializes a new instance of . + /// Gets or sets the Name. + /// Gets or sets the ClusterSharedVolumePath. + /// Keeps track of any properties unknown to the library. + internal StorageContainerProperties(string name, string clusterSharedVolumePath, IDictionary serializedAdditionalRawData) + { + Name = name; + ClusterSharedVolumePath = clusterSharedVolumePath; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal StorageContainerProperties() + { + } + + /// Gets or sets the Name. + public string Name { get; set; } + /// Gets or sets the ClusterSharedVolumePath. + public string ClusterSharedVolumePath { get; set; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/TaskModel.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/TaskModel.Serialization.cs new file mode 100644 index 000000000000..c6f7bf4f8ad8 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/TaskModel.Serialization.cs @@ -0,0 +1,221 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + public partial class TaskModel : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(TaskModel)} does not support writing '{format}' format."); + } + + if (options.Format != "W" && Optional.IsDefined(TaskName)) + { + writer.WritePropertyName("taskName"u8); + writer.WriteStringValue(TaskName); + } + if (options.Format != "W" && Optional.IsDefined(State)) + { + writer.WritePropertyName("state"u8); + writer.WriteStringValue(State.Value.ToString()); + } + if (options.Format != "W" && Optional.IsDefined(StartOn)) + { + writer.WritePropertyName("startTime"u8); + writer.WriteStringValue(StartOn.Value, "O"); + } + if (options.Format != "W" && Optional.IsDefined(EndOn)) + { + writer.WritePropertyName("endTime"u8); + writer.WriteStringValue(EndOn.Value, "O"); + } + if (Optional.IsDefined(CustomProperties)) + { + writer.WritePropertyName("customProperties"u8); + writer.WriteObjectValue(CustomProperties, options); + } + if (Optional.IsCollectionDefined(ChildrenJobs)) + { + writer.WritePropertyName("childrenJobs"u8); + writer.WriteStartArray(); + foreach (var item in ChildrenJobs) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + TaskModel 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(TaskModel)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeTaskModel(document.RootElement, options); + } + + internal static TaskModel DeserializeTaskModel(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string taskName = default; + TaskState? state = default; + DateTimeOffset? startTime = default; + DateTimeOffset? endTime = default; + TaskModelCustomProperties customProperties = default; + IReadOnlyList childrenJobs = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("taskName"u8)) + { + taskName = property.Value.GetString(); + continue; + } + if (property.NameEquals("state"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + state = new TaskState(property.Value.GetString()); + continue; + } + if (property.NameEquals("startTime"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + startTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("endTime"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + endTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("customProperties"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + customProperties = TaskModelCustomProperties.DeserializeTaskModelCustomProperties(property.Value, options); + continue; + } + if (property.NameEquals("childrenJobs"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(JobModelData.DeserializeJobModelData(item, options)); + } + childrenJobs = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new TaskModel( + taskName, + state, + startTime, + endTime, + customProperties, + childrenJobs ?? new ChangeTrackingList(), + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(TaskModel)} does not support writing '{options.Format}' format."); + } + } + + TaskModel IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeTaskModel(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(TaskModel)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/TaskModel.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/TaskModel.cs new file mode 100644 index 000000000000..be491daea75a --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/TaskModel.cs @@ -0,0 +1,92 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + /// Task model. + public partial class TaskModel + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + internal TaskModel() + { + ChildrenJobs = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// Gets or sets the task name. + /// Gets or sets the task state. + /// Gets or sets the start time. + /// Gets or sets the end time. + /// Task model custom properties. + /// Gets or sets the list of children job models. + /// Keeps track of any properties unknown to the library. + internal TaskModel(string taskName, TaskState? state, DateTimeOffset? startOn, DateTimeOffset? endOn, TaskModelCustomProperties customProperties, IReadOnlyList childrenJobs, IDictionary serializedAdditionalRawData) + { + TaskName = taskName; + State = state; + StartOn = startOn; + EndOn = endOn; + CustomProperties = customProperties; + ChildrenJobs = childrenJobs; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Gets or sets the task name. + public string TaskName { get; } + /// Gets or sets the task state. + public TaskState? State { get; } + /// Gets or sets the start time. + public DateTimeOffset? StartOn { get; } + /// Gets or sets the end time. + public DateTimeOffset? EndOn { get; } + /// Task model custom properties. + internal TaskModelCustomProperties CustomProperties { get; } + /// Gets or sets the instance type. + public string CustomInstanceType + { + get => CustomProperties?.InstanceType; + } + + /// Gets or sets the list of children job models. + public IReadOnlyList ChildrenJobs { get; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/TaskModelCustomProperties.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/TaskModelCustomProperties.Serialization.cs new file mode 100644 index 000000000000..edd62a199636 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/TaskModelCustomProperties.Serialization.cs @@ -0,0 +1,126 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + internal partial class TaskModelCustomProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(TaskModelCustomProperties)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("instanceType"u8); + writer.WriteStringValue(InstanceType); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + TaskModelCustomProperties 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(TaskModelCustomProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeTaskModelCustomProperties(document.RootElement, options); + } + + internal static TaskModelCustomProperties DeserializeTaskModelCustomProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string instanceType = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("instanceType"u8)) + { + instanceType = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new TaskModelCustomProperties(instanceType, 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(TaskModelCustomProperties)} does not support writing '{options.Format}' format."); + } + } + + TaskModelCustomProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeTaskModelCustomProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(TaskModelCustomProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/TaskModelCustomProperties.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/TaskModelCustomProperties.cs new file mode 100644 index 000000000000..1b1d1d03fbd5 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/TaskModelCustomProperties.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; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + /// Task model custom properties. + internal partial class TaskModelCustomProperties + { + /// + /// 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 . + /// Gets or sets the instance type. + /// is null. + internal TaskModelCustomProperties(string instanceType) + { + Argument.AssertNotNull(instanceType, nameof(instanceType)); + + InstanceType = instanceType; + } + + /// Initializes a new instance of . + /// Gets or sets the instance type. + /// Keeps track of any properties unknown to the library. + internal TaskModelCustomProperties(string instanceType, IDictionary serializedAdditionalRawData) + { + InstanceType = instanceType; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal TaskModelCustomProperties() + { + } + + /// Gets or sets the instance type. + public string InstanceType { get; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/TaskState.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/TaskState.cs new file mode 100644 index 000000000000..46907986bd82 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/TaskState.cs @@ -0,0 +1,63 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + /// Gets or sets the task state. + public readonly partial struct TaskState : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public TaskState(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string PendingValue = "Pending"; + private const string StartedValue = "Started"; + private const string SucceededValue = "Succeeded"; + private const string FailedValue = "Failed"; + private const string CancelledValue = "Cancelled"; + private const string SkippedValue = "Skipped"; + + /// Task has not been started. + public static TaskState Pending { get; } = new TaskState(PendingValue); + /// Task is in progress. + public static TaskState Started { get; } = new TaskState(StartedValue); + /// Task has completed successfully. + public static TaskState Succeeded { get; } = new TaskState(SucceededValue); + /// Task failed. + public static TaskState Failed { get; } = new TaskState(FailedValue); + /// Task has been cancelled. + public static TaskState Cancelled { get; } = new TaskState(CancelledValue); + /// Task has been skipped. + public static TaskState Skipped { get; } = new TaskState(SkippedValue); + /// Determines if two values are the same. + public static bool operator ==(TaskState left, TaskState right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(TaskState left, TaskState right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator TaskState(string value) => new TaskState(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is TaskState other && Equals(other); + /// + public bool Equals(TaskState other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/TestFailoverCleanupJobModelCustomProperties.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/TestFailoverCleanupJobModelCustomProperties.Serialization.cs new file mode 100644 index 000000000000..2f80cd70060a --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/TestFailoverCleanupJobModelCustomProperties.Serialization.cs @@ -0,0 +1,131 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + public partial class TestFailoverCleanupJobModelCustomProperties : 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(TestFailoverCleanupJobModelCustomProperties)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (options.Format != "W" && Optional.IsDefined(Comments)) + { + writer.WritePropertyName("comments"u8); + writer.WriteStringValue(Comments); + } + } + + TestFailoverCleanupJobModelCustomProperties 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(TestFailoverCleanupJobModelCustomProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeTestFailoverCleanupJobModelCustomProperties(document.RootElement, options); + } + + internal static TestFailoverCleanupJobModelCustomProperties DeserializeTestFailoverCleanupJobModelCustomProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string comments = default; + string instanceType = default; + JobModelCustomPropertiesAffectedObjectDetails affectedObjectDetails = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("comments"u8)) + { + comments = property.Value.GetString(); + continue; + } + if (property.NameEquals("instanceType"u8)) + { + instanceType = property.Value.GetString(); + continue; + } + if (property.NameEquals("affectedObjectDetails"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + affectedObjectDetails = JobModelCustomPropertiesAffectedObjectDetails.DeserializeJobModelCustomPropertiesAffectedObjectDetails(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new TestFailoverCleanupJobModelCustomProperties(instanceType, affectedObjectDetails, serializedAdditionalRawData, comments); + } + + 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(TestFailoverCleanupJobModelCustomProperties)} does not support writing '{options.Format}' format."); + } + } + + TestFailoverCleanupJobModelCustomProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeTestFailoverCleanupJobModelCustomProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(TestFailoverCleanupJobModelCustomProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/TestFailoverCleanupJobModelCustomProperties.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/TestFailoverCleanupJobModelCustomProperties.cs new file mode 100644 index 000000000000..8ca1b7432c9b --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/TestFailoverCleanupJobModelCustomProperties.cs @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + /// Test failover cleanup job model custom properties. + public partial class TestFailoverCleanupJobModelCustomProperties : JobModelCustomProperties + { + /// Initializes a new instance of . + internal TestFailoverCleanupJobModelCustomProperties() + { + InstanceType = "TestFailoverCleanupJobDetails"; + } + + /// Initializes a new instance of . + /// Discriminator property for JobModelCustomProperties. + /// Gets or sets any custom properties of the affected object. + /// Keeps track of any properties unknown to the library. + /// Gets or sets the test failover cleanup comments. + internal TestFailoverCleanupJobModelCustomProperties(string instanceType, JobModelCustomPropertiesAffectedObjectDetails affectedObjectDetails, IDictionary serializedAdditionalRawData, string comments) : base(instanceType, affectedObjectDetails, serializedAdditionalRawData) + { + Comments = comments; + InstanceType = instanceType ?? "TestFailoverCleanupJobDetails"; + } + + /// Gets or sets the test failover cleanup comments. + public string Comments { get; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/TestFailoverJobModelCustomProperties.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/TestFailoverJobModelCustomProperties.Serialization.cs new file mode 100644 index 000000000000..0d6ce544e483 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/TestFailoverJobModelCustomProperties.Serialization.cs @@ -0,0 +1,145 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + public partial class TestFailoverJobModelCustomProperties : 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(TestFailoverJobModelCustomProperties)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (options.Format != "W" && Optional.IsCollectionDefined(ProtectedItemDetails)) + { + writer.WritePropertyName("protectedItemDetails"u8); + writer.WriteStartArray(); + foreach (var item in ProtectedItemDetails) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + } + + TestFailoverJobModelCustomProperties 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(TestFailoverJobModelCustomProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeTestFailoverJobModelCustomProperties(document.RootElement, options); + } + + internal static TestFailoverJobModelCustomProperties DeserializeTestFailoverJobModelCustomProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IReadOnlyList protectedItemDetails = default; + string instanceType = default; + JobModelCustomPropertiesAffectedObjectDetails affectedObjectDetails = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("protectedItemDetails"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(FailoverProtectedItemProperties.DeserializeFailoverProtectedItemProperties(item, options)); + } + protectedItemDetails = array; + continue; + } + if (property.NameEquals("instanceType"u8)) + { + instanceType = property.Value.GetString(); + continue; + } + if (property.NameEquals("affectedObjectDetails"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + affectedObjectDetails = JobModelCustomPropertiesAffectedObjectDetails.DeserializeJobModelCustomPropertiesAffectedObjectDetails(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new TestFailoverJobModelCustomProperties(instanceType, affectedObjectDetails, serializedAdditionalRawData, protectedItemDetails ?? new ChangeTrackingList()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(TestFailoverJobModelCustomProperties)} does not support writing '{options.Format}' format."); + } + } + + TestFailoverJobModelCustomProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeTestFailoverJobModelCustomProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(TestFailoverJobModelCustomProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/TestFailoverJobModelCustomProperties.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/TestFailoverJobModelCustomProperties.cs new file mode 100644 index 000000000000..7c6b802faa54 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/TestFailoverJobModelCustomProperties.cs @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + /// Test failover job model custom properties. + public partial class TestFailoverJobModelCustomProperties : JobModelCustomProperties + { + /// Initializes a new instance of . + internal TestFailoverJobModelCustomProperties() + { + ProtectedItemDetails = new ChangeTrackingList(); + InstanceType = "TestFailoverJobDetails"; + } + + /// Initializes a new instance of . + /// Discriminator property for JobModelCustomProperties. + /// Gets or sets any custom properties of the affected object. + /// Keeps track of any properties unknown to the library. + /// Gets or sets the test VM details. + internal TestFailoverJobModelCustomProperties(string instanceType, JobModelCustomPropertiesAffectedObjectDetails affectedObjectDetails, IDictionary serializedAdditionalRawData, IReadOnlyList protectedItemDetails) : base(instanceType, affectedObjectDetails, serializedAdditionalRawData) + { + ProtectedItemDetails = protectedItemDetails; + InstanceType = instanceType ?? "TestFailoverJobDetails"; + } + + /// Gets or sets the test VM details. + public IReadOnlyList ProtectedItemDetails { get; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/TestFailoverState.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/TestFailoverState.cs new file mode 100644 index 000000000000..3bba8f5b6721 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/TestFailoverState.cs @@ -0,0 +1,72 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + /// Gets or sets the test failover state. + public readonly partial struct TestFailoverState : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public TestFailoverState(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string NoneValue = "None"; + private const string TestFailoverInitiatedValue = "TestFailoverInitiated"; + private const string TestFailoverCompletingValue = "TestFailoverCompleting"; + private const string TestFailoverCompletedValue = "TestFailoverCompleted"; + private const string TestFailoverFailedValue = "TestFailoverFailed"; + private const string TestFailoverCompletionFailedValue = "TestFailoverCompletionFailed"; + private const string TestFailoverCleanupInitiatedValue = "TestFailoverCleanupInitiated"; + private const string TestFailoverCleanupCompletingValue = "TestFailoverCleanupCompleting"; + private const string MarkedForDeletionValue = "MarkedForDeletion"; + + /// Test failover is not active. + public static TestFailoverState None { get; } = new TestFailoverState(NoneValue); + /// Test failover has been initiated. + public static TestFailoverState TestFailoverInitiated { get; } = new TestFailoverState(TestFailoverInitiatedValue); + /// Preparing test protected entities is in progress. + public static TestFailoverState TestFailoverCompleting { get; } = new TestFailoverState(TestFailoverCompletingValue); + /// Test failover has been completed successfully. + public static TestFailoverState TestFailoverCompleted { get; } = new TestFailoverState(TestFailoverCompletedValue); + /// Test failover initiation failed.. + public static TestFailoverState TestFailoverFailed { get; } = new TestFailoverState(TestFailoverFailedValue); + /// Preparing test protected entities failed. + public static TestFailoverState TestFailoverCompletionFailed { get; } = new TestFailoverState(TestFailoverCompletionFailedValue); + /// Test failover cleanup has been initiated. + public static TestFailoverState TestFailoverCleanupInitiated { get; } = new TestFailoverState(TestFailoverCleanupInitiatedValue); + /// Cleaning up test protected entities is in progress. + public static TestFailoverState TestFailoverCleanupCompleting { get; } = new TestFailoverState(TestFailoverCleanupCompletingValue); + /// Test failover cleanup has completed/failed. This is a transient state before the state is moved back to None. + public static TestFailoverState MarkedForDeletion { get; } = new TestFailoverState(MarkedForDeletionValue); + /// Determines if two values are the same. + public static bool operator ==(TestFailoverState left, TestFailoverState right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(TestFailoverState left, TestFailoverState right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator TestFailoverState(string value) => new TestFailoverState(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is TestFailoverState other && Equals(other); + /// + public bool Equals(TestFailoverState other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/UnknownEventModelCustomProperties.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/UnknownEventModelCustomProperties.Serialization.cs new file mode 100644 index 000000000000..0e9bf96d8d25 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/UnknownEventModelCustomProperties.Serialization.cs @@ -0,0 +1,110 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + internal partial class UnknownEventModelCustomProperties : 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(EventModelCustomProperties)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + } + + EventModelCustomProperties 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(EventModelCustomProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeEventModelCustomProperties(document.RootElement, options); + } + + internal static UnknownEventModelCustomProperties DeserializeUnknownEventModelCustomProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string instanceType = "Unknown"; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("instanceType"u8)) + { + instanceType = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new UnknownEventModelCustomProperties(instanceType, 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(EventModelCustomProperties)} does not support writing '{options.Format}' format."); + } + } + + EventModelCustomProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeEventModelCustomProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(EventModelCustomProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/UnknownEventModelCustomProperties.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/UnknownEventModelCustomProperties.cs new file mode 100644 index 000000000000..db880977a749 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/UnknownEventModelCustomProperties.cs @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + /// Unknown version of EventModelCustomProperties. + internal partial class UnknownEventModelCustomProperties : EventModelCustomProperties + { + /// Initializes a new instance of . + /// Discriminator property for EventModelCustomProperties. + /// Keeps track of any properties unknown to the library. + internal UnknownEventModelCustomProperties(string instanceType, IDictionary serializedAdditionalRawData) : base(instanceType, serializedAdditionalRawData) + { + InstanceType = instanceType ?? "Unknown"; + } + + /// Initializes a new instance of for deserialization. + internal UnknownEventModelCustomProperties() + { + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/UnknownFabricAgentModelCustomProperties.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/UnknownFabricAgentModelCustomProperties.Serialization.cs new file mode 100644 index 000000000000..e481c538f958 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/UnknownFabricAgentModelCustomProperties.Serialization.cs @@ -0,0 +1,110 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + internal partial class UnknownFabricAgentModelCustomProperties : 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(FabricAgentModelCustomProperties)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + } + + FabricAgentModelCustomProperties 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(FabricAgentModelCustomProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeFabricAgentModelCustomProperties(document.RootElement, options); + } + + internal static UnknownFabricAgentModelCustomProperties DeserializeUnknownFabricAgentModelCustomProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string instanceType = "Unknown"; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("instanceType"u8)) + { + instanceType = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new UnknownFabricAgentModelCustomProperties(instanceType, 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(FabricAgentModelCustomProperties)} does not support writing '{options.Format}' format."); + } + } + + FabricAgentModelCustomProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeFabricAgentModelCustomProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(FabricAgentModelCustomProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/UnknownFabricAgentModelCustomProperties.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/UnknownFabricAgentModelCustomProperties.cs new file mode 100644 index 000000000000..cd33abd2370e --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/UnknownFabricAgentModelCustomProperties.cs @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + /// Unknown version of FabricAgentModelCustomProperties. + internal partial class UnknownFabricAgentModelCustomProperties : FabricAgentModelCustomProperties + { + /// Initializes a new instance of . + /// Discriminator property for FabricAgentModelCustomProperties. + /// Keeps track of any properties unknown to the library. + internal UnknownFabricAgentModelCustomProperties(string instanceType, IDictionary serializedAdditionalRawData) : base(instanceType, serializedAdditionalRawData) + { + InstanceType = instanceType ?? "Unknown"; + } + + /// Initializes a new instance of for deserialization. + internal UnknownFabricAgentModelCustomProperties() + { + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/UnknownFabricModelCustomProperties.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/UnknownFabricModelCustomProperties.Serialization.cs new file mode 100644 index 000000000000..c2356f8ad99d --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/UnknownFabricModelCustomProperties.Serialization.cs @@ -0,0 +1,110 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + internal partial class UnknownFabricModelCustomProperties : 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(FabricModelCustomProperties)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + } + + FabricModelCustomProperties 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(FabricModelCustomProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeFabricModelCustomProperties(document.RootElement, options); + } + + internal static UnknownFabricModelCustomProperties DeserializeUnknownFabricModelCustomProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string instanceType = "Unknown"; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("instanceType"u8)) + { + instanceType = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new UnknownFabricModelCustomProperties(instanceType, 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(FabricModelCustomProperties)} does not support writing '{options.Format}' format."); + } + } + + FabricModelCustomProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeFabricModelCustomProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(FabricModelCustomProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/UnknownFabricModelCustomProperties.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/UnknownFabricModelCustomProperties.cs new file mode 100644 index 000000000000..aaa7f96245d7 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/UnknownFabricModelCustomProperties.cs @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + /// Unknown version of FabricModelCustomProperties. + internal partial class UnknownFabricModelCustomProperties : FabricModelCustomProperties + { + /// Initializes a new instance of . + /// Discriminator property for FabricModelCustomProperties. + /// Keeps track of any properties unknown to the library. + internal UnknownFabricModelCustomProperties(string instanceType, IDictionary serializedAdditionalRawData) : base(instanceType, serializedAdditionalRawData) + { + InstanceType = instanceType ?? "Unknown"; + } + + /// Initializes a new instance of for deserialization. + internal UnknownFabricModelCustomProperties() + { + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/UnknownJobModelCustomProperties.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/UnknownJobModelCustomProperties.Serialization.cs new file mode 100644 index 000000000000..18a765f321ac --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/UnknownJobModelCustomProperties.Serialization.cs @@ -0,0 +1,120 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + internal partial class UnknownJobModelCustomProperties : 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(JobModelCustomProperties)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + } + + JobModelCustomProperties 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(JobModelCustomProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeJobModelCustomProperties(document.RootElement, options); + } + + internal static UnknownJobModelCustomProperties DeserializeUnknownJobModelCustomProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string instanceType = "Unknown"; + JobModelCustomPropertiesAffectedObjectDetails affectedObjectDetails = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("instanceType"u8)) + { + instanceType = property.Value.GetString(); + continue; + } + if (property.NameEquals("affectedObjectDetails"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + affectedObjectDetails = JobModelCustomPropertiesAffectedObjectDetails.DeserializeJobModelCustomPropertiesAffectedObjectDetails(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new UnknownJobModelCustomProperties(instanceType, affectedObjectDetails, 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(JobModelCustomProperties)} does not support writing '{options.Format}' format."); + } + } + + JobModelCustomProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeJobModelCustomProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(JobModelCustomProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/UnknownJobModelCustomProperties.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/UnknownJobModelCustomProperties.cs new file mode 100644 index 000000000000..84042f084be3 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/UnknownJobModelCustomProperties.cs @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + /// Unknown version of JobModelCustomProperties. + internal partial class UnknownJobModelCustomProperties : JobModelCustomProperties + { + /// Initializes a new instance of . + /// Discriminator property for JobModelCustomProperties. + /// Gets or sets any custom properties of the affected object. + /// Keeps track of any properties unknown to the library. + internal UnknownJobModelCustomProperties(string instanceType, JobModelCustomPropertiesAffectedObjectDetails affectedObjectDetails, IDictionary serializedAdditionalRawData) : base(instanceType, affectedObjectDetails, serializedAdditionalRawData) + { + InstanceType = instanceType ?? "Unknown"; + } + + /// Initializes a new instance of for deserialization. + internal UnknownJobModelCustomProperties() + { + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/UnknownPlannedFailoverModelCustomProperties.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/UnknownPlannedFailoverModelCustomProperties.Serialization.cs new file mode 100644 index 000000000000..a0d9849d492d --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/UnknownPlannedFailoverModelCustomProperties.Serialization.cs @@ -0,0 +1,110 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + internal partial class UnknownPlannedFailoverModelCustomProperties : 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(PlannedFailoverModelCustomProperties)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + } + + PlannedFailoverModelCustomProperties 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(PlannedFailoverModelCustomProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializePlannedFailoverModelCustomProperties(document.RootElement, options); + } + + internal static UnknownPlannedFailoverModelCustomProperties DeserializeUnknownPlannedFailoverModelCustomProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string instanceType = "Unknown"; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("instanceType"u8)) + { + instanceType = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new UnknownPlannedFailoverModelCustomProperties(instanceType, 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(PlannedFailoverModelCustomProperties)} does not support writing '{options.Format}' format."); + } + } + + PlannedFailoverModelCustomProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializePlannedFailoverModelCustomProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(PlannedFailoverModelCustomProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/UnknownPlannedFailoverModelCustomProperties.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/UnknownPlannedFailoverModelCustomProperties.cs new file mode 100644 index 000000000000..af1ea21ac0d5 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/UnknownPlannedFailoverModelCustomProperties.cs @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + /// Unknown version of PlannedFailoverModelCustomProperties. + internal partial class UnknownPlannedFailoverModelCustomProperties : PlannedFailoverModelCustomProperties + { + /// Initializes a new instance of . + /// Discriminator property for PlannedFailoverModelCustomProperties. + /// Keeps track of any properties unknown to the library. + internal UnknownPlannedFailoverModelCustomProperties(string instanceType, IDictionary serializedAdditionalRawData) : base(instanceType, serializedAdditionalRawData) + { + InstanceType = instanceType ?? "Unknown"; + } + + /// Initializes a new instance of for deserialization. + internal UnknownPlannedFailoverModelCustomProperties() + { + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/UnknownPolicyModelCustomProperties.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/UnknownPolicyModelCustomProperties.Serialization.cs new file mode 100644 index 000000000000..3780b6398c66 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/UnknownPolicyModelCustomProperties.Serialization.cs @@ -0,0 +1,110 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + internal partial class UnknownPolicyModelCustomProperties : 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(PolicyModelCustomProperties)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + } + + PolicyModelCustomProperties 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(PolicyModelCustomProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializePolicyModelCustomProperties(document.RootElement, options); + } + + internal static UnknownPolicyModelCustomProperties DeserializeUnknownPolicyModelCustomProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string instanceType = "Unknown"; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("instanceType"u8)) + { + instanceType = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new UnknownPolicyModelCustomProperties(instanceType, 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(PolicyModelCustomProperties)} does not support writing '{options.Format}' format."); + } + } + + PolicyModelCustomProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializePolicyModelCustomProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(PolicyModelCustomProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/UnknownPolicyModelCustomProperties.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/UnknownPolicyModelCustomProperties.cs new file mode 100644 index 000000000000..ab06b03b1084 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/UnknownPolicyModelCustomProperties.cs @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + /// Unknown version of PolicyModelCustomProperties. + internal partial class UnknownPolicyModelCustomProperties : PolicyModelCustomProperties + { + /// Initializes a new instance of . + /// Discriminator property for PolicyModelCustomProperties. + /// Keeps track of any properties unknown to the library. + internal UnknownPolicyModelCustomProperties(string instanceType, IDictionary serializedAdditionalRawData) : base(instanceType, serializedAdditionalRawData) + { + InstanceType = instanceType ?? "Unknown"; + } + + /// Initializes a new instance of for deserialization. + internal UnknownPolicyModelCustomProperties() + { + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/UnknownProtectedItemModelCustomProperties.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/UnknownProtectedItemModelCustomProperties.Serialization.cs new file mode 100644 index 000000000000..ad6a3ae6ab73 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/UnknownProtectedItemModelCustomProperties.Serialization.cs @@ -0,0 +1,110 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + internal partial class UnknownProtectedItemModelCustomProperties : 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(ProtectedItemModelCustomProperties)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + } + + ProtectedItemModelCustomProperties 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(ProtectedItemModelCustomProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeProtectedItemModelCustomProperties(document.RootElement, options); + } + + internal static UnknownProtectedItemModelCustomProperties DeserializeUnknownProtectedItemModelCustomProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string instanceType = "Unknown"; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("instanceType"u8)) + { + instanceType = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new UnknownProtectedItemModelCustomProperties(instanceType, 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(ProtectedItemModelCustomProperties)} does not support writing '{options.Format}' format."); + } + } + + ProtectedItemModelCustomProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeProtectedItemModelCustomProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ProtectedItemModelCustomProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/UnknownProtectedItemModelCustomProperties.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/UnknownProtectedItemModelCustomProperties.cs new file mode 100644 index 000000000000..00c02feff892 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/UnknownProtectedItemModelCustomProperties.cs @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + /// Unknown version of ProtectedItemModelCustomProperties. + internal partial class UnknownProtectedItemModelCustomProperties : ProtectedItemModelCustomProperties + { + /// Initializes a new instance of . + /// Discriminator property for ProtectedItemModelCustomProperties. + /// Keeps track of any properties unknown to the library. + internal UnknownProtectedItemModelCustomProperties(string instanceType, IDictionary serializedAdditionalRawData) : base(instanceType, serializedAdditionalRawData) + { + InstanceType = instanceType ?? "Unknown"; + } + + /// Initializes a new instance of for deserialization. + internal UnknownProtectedItemModelCustomProperties() + { + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/UnknownProtectedItemModelCustomPropertiesUpdate.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/UnknownProtectedItemModelCustomPropertiesUpdate.Serialization.cs new file mode 100644 index 000000000000..600e4df4a133 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/UnknownProtectedItemModelCustomPropertiesUpdate.Serialization.cs @@ -0,0 +1,110 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + internal partial class UnknownProtectedItemModelCustomPropertiesUpdate : 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(ProtectedItemModelCustomPropertiesUpdate)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + } + + ProtectedItemModelCustomPropertiesUpdate 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(ProtectedItemModelCustomPropertiesUpdate)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeProtectedItemModelCustomPropertiesUpdate(document.RootElement, options); + } + + internal static UnknownProtectedItemModelCustomPropertiesUpdate DeserializeUnknownProtectedItemModelCustomPropertiesUpdate(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string instanceType = "Unknown"; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("instanceType"u8)) + { + instanceType = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new UnknownProtectedItemModelCustomPropertiesUpdate(instanceType, 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(ProtectedItemModelCustomPropertiesUpdate)} does not support writing '{options.Format}' format."); + } + } + + ProtectedItemModelCustomPropertiesUpdate IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeProtectedItemModelCustomPropertiesUpdate(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ProtectedItemModelCustomPropertiesUpdate)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/UnknownProtectedItemModelCustomPropertiesUpdate.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/UnknownProtectedItemModelCustomPropertiesUpdate.cs new file mode 100644 index 000000000000..3657c192af53 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/UnknownProtectedItemModelCustomPropertiesUpdate.cs @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + /// Unknown version of ProtectedItemModelCustomPropertiesUpdate. + internal partial class UnknownProtectedItemModelCustomPropertiesUpdate : ProtectedItemModelCustomPropertiesUpdate + { + /// Initializes a new instance of . + /// Discriminator property for ProtectedItemModelCustomPropertiesUpdate. + /// Keeps track of any properties unknown to the library. + internal UnknownProtectedItemModelCustomPropertiesUpdate(string instanceType, IDictionary serializedAdditionalRawData) : base(instanceType, serializedAdditionalRawData) + { + InstanceType = instanceType ?? "Unknown"; + } + + /// Initializes a new instance of for deserialization. + internal UnknownProtectedItemModelCustomPropertiesUpdate() + { + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/UnknownRecoveryPointModelCustomProperties.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/UnknownRecoveryPointModelCustomProperties.Serialization.cs new file mode 100644 index 000000000000..1dfbfa790762 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/UnknownRecoveryPointModelCustomProperties.Serialization.cs @@ -0,0 +1,110 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + internal partial class UnknownRecoveryPointModelCustomProperties : 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(RecoveryPointModelCustomProperties)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + } + + RecoveryPointModelCustomProperties 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(RecoveryPointModelCustomProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeRecoveryPointModelCustomProperties(document.RootElement, options); + } + + internal static UnknownRecoveryPointModelCustomProperties DeserializeUnknownRecoveryPointModelCustomProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string instanceType = "Unknown"; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("instanceType"u8)) + { + instanceType = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new UnknownRecoveryPointModelCustomProperties(instanceType, 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(RecoveryPointModelCustomProperties)} does not support writing '{options.Format}' format."); + } + } + + RecoveryPointModelCustomProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeRecoveryPointModelCustomProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(RecoveryPointModelCustomProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/UnknownRecoveryPointModelCustomProperties.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/UnknownRecoveryPointModelCustomProperties.cs new file mode 100644 index 000000000000..b6dcb77f1101 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/UnknownRecoveryPointModelCustomProperties.cs @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + /// Unknown version of RecoveryPointModelCustomProperties. + internal partial class UnknownRecoveryPointModelCustomProperties : RecoveryPointModelCustomProperties + { + /// Initializes a new instance of . + /// Discriminator property for RecoveryPointModelCustomProperties. + /// Keeps track of any properties unknown to the library. + internal UnknownRecoveryPointModelCustomProperties(string instanceType, IDictionary serializedAdditionalRawData) : base(instanceType, serializedAdditionalRawData) + { + InstanceType = instanceType ?? "Unknown"; + } + + /// Initializes a new instance of for deserialization. + internal UnknownRecoveryPointModelCustomProperties() + { + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/UnknownReplicationExtensionModelCustomProperties.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/UnknownReplicationExtensionModelCustomProperties.Serialization.cs new file mode 100644 index 000000000000..bb899b458c8f --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/UnknownReplicationExtensionModelCustomProperties.Serialization.cs @@ -0,0 +1,110 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + internal partial class UnknownReplicationExtensionModelCustomProperties : 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(ReplicationExtensionModelCustomProperties)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + } + + ReplicationExtensionModelCustomProperties 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(ReplicationExtensionModelCustomProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeReplicationExtensionModelCustomProperties(document.RootElement, options); + } + + internal static UnknownReplicationExtensionModelCustomProperties DeserializeUnknownReplicationExtensionModelCustomProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string instanceType = "Unknown"; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("instanceType"u8)) + { + instanceType = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new UnknownReplicationExtensionModelCustomProperties(instanceType, 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(ReplicationExtensionModelCustomProperties)} does not support writing '{options.Format}' format."); + } + } + + ReplicationExtensionModelCustomProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeReplicationExtensionModelCustomProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ReplicationExtensionModelCustomProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/UnknownReplicationExtensionModelCustomProperties.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/UnknownReplicationExtensionModelCustomProperties.cs new file mode 100644 index 000000000000..17d66acbbbd1 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/UnknownReplicationExtensionModelCustomProperties.cs @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + /// Unknown version of ReplicationExtensionModelCustomProperties. + internal partial class UnknownReplicationExtensionModelCustomProperties : ReplicationExtensionModelCustomProperties + { + /// Initializes a new instance of . + /// Discriminator property for ReplicationExtensionModelCustomProperties. + /// Keeps track of any properties unknown to the library. + internal UnknownReplicationExtensionModelCustomProperties(string instanceType, IDictionary serializedAdditionalRawData) : base(instanceType, serializedAdditionalRawData) + { + InstanceType = instanceType ?? "Unknown"; + } + + /// Initializes a new instance of for deserialization. + internal UnknownReplicationExtensionModelCustomProperties() + { + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/VMwareFabricAgentModelCustomProperties.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/VMwareFabricAgentModelCustomProperties.Serialization.cs new file mode 100644 index 000000000000..d54e15a761e9 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/VMwareFabricAgentModelCustomProperties.Serialization.cs @@ -0,0 +1,126 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + public partial class VMwareFabricAgentModelCustomProperties : 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(VMwareFabricAgentModelCustomProperties)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + writer.WritePropertyName("biosId"u8); + writer.WriteStringValue(BiosId); + writer.WritePropertyName("marsAuthenticationIdentity"u8); + writer.WriteObjectValue(MarsAuthenticationIdentity, options); + } + + VMwareFabricAgentModelCustomProperties 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(VMwareFabricAgentModelCustomProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeVMwareFabricAgentModelCustomProperties(document.RootElement, options); + } + + internal static VMwareFabricAgentModelCustomProperties DeserializeVMwareFabricAgentModelCustomProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string biosId = default; + IdentityModel marsAuthenticationIdentity = default; + string instanceType = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("biosId"u8)) + { + biosId = property.Value.GetString(); + continue; + } + if (property.NameEquals("marsAuthenticationIdentity"u8)) + { + marsAuthenticationIdentity = IdentityModel.DeserializeIdentityModel(property.Value, options); + continue; + } + if (property.NameEquals("instanceType"u8)) + { + instanceType = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new VMwareFabricAgentModelCustomProperties(instanceType, serializedAdditionalRawData, biosId, marsAuthenticationIdentity); + } + + 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(VMwareFabricAgentModelCustomProperties)} does not support writing '{options.Format}' format."); + } + } + + VMwareFabricAgentModelCustomProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeVMwareFabricAgentModelCustomProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(VMwareFabricAgentModelCustomProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/VMwareFabricAgentModelCustomProperties.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/VMwareFabricAgentModelCustomProperties.cs new file mode 100644 index 000000000000..d8524c12031d --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/VMwareFabricAgentModelCustomProperties.cs @@ -0,0 +1,52 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + /// VMware fabric agent model custom properties. + public partial class VMwareFabricAgentModelCustomProperties : FabricAgentModelCustomProperties + { + /// Initializes a new instance of . + /// Gets or sets the BIOS Id of the fabric agent machine. + /// Identity model. + /// or is null. + public VMwareFabricAgentModelCustomProperties(string biosId, IdentityModel marsAuthenticationIdentity) + { + Argument.AssertNotNull(biosId, nameof(biosId)); + Argument.AssertNotNull(marsAuthenticationIdentity, nameof(marsAuthenticationIdentity)); + + BiosId = biosId; + MarsAuthenticationIdentity = marsAuthenticationIdentity; + InstanceType = "VMware"; + } + + /// Initializes a new instance of . + /// Discriminator property for FabricAgentModelCustomProperties. + /// Keeps track of any properties unknown to the library. + /// Gets or sets the BIOS Id of the fabric agent machine. + /// Identity model. + internal VMwareFabricAgentModelCustomProperties(string instanceType, IDictionary serializedAdditionalRawData, string biosId, IdentityModel marsAuthenticationIdentity) : base(instanceType, serializedAdditionalRawData) + { + BiosId = biosId; + MarsAuthenticationIdentity = marsAuthenticationIdentity; + InstanceType = instanceType ?? "VMware"; + } + + /// Initializes a new instance of for deserialization. + internal VMwareFabricAgentModelCustomProperties() + { + } + + /// Gets or sets the BIOS Id of the fabric agent machine. + public string BiosId { get; set; } + /// Identity model. + public IdentityModel MarsAuthenticationIdentity { get; set; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/VMwareMigrateFabricModelCustomProperties.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/VMwareMigrateFabricModelCustomProperties.Serialization.cs new file mode 100644 index 000000000000..962fe4b6fc03 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/VMwareMigrateFabricModelCustomProperties.Serialization.cs @@ -0,0 +1,126 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + public partial class VMwareMigrateFabricModelCustomProperties : 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(VMwareMigrateFabricModelCustomProperties)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + writer.WritePropertyName("vmwareSiteId"u8); + writer.WriteStringValue(VmwareSiteId); + writer.WritePropertyName("migrationSolutionId"u8); + writer.WriteStringValue(MigrationSolutionId); + } + + VMwareMigrateFabricModelCustomProperties 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(VMwareMigrateFabricModelCustomProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeVMwareMigrateFabricModelCustomProperties(document.RootElement, options); + } + + internal static VMwareMigrateFabricModelCustomProperties DeserializeVMwareMigrateFabricModelCustomProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string vmwareSiteId = default; + string migrationSolutionId = default; + string instanceType = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("vmwareSiteId"u8)) + { + vmwareSiteId = property.Value.GetString(); + continue; + } + if (property.NameEquals("migrationSolutionId"u8)) + { + migrationSolutionId = property.Value.GetString(); + continue; + } + if (property.NameEquals("instanceType"u8)) + { + instanceType = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new VMwareMigrateFabricModelCustomProperties(instanceType, serializedAdditionalRawData, vmwareSiteId, migrationSolutionId); + } + + 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(VMwareMigrateFabricModelCustomProperties)} does not support writing '{options.Format}' format."); + } + } + + VMwareMigrateFabricModelCustomProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeVMwareMigrateFabricModelCustomProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(VMwareMigrateFabricModelCustomProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/VMwareMigrateFabricModelCustomProperties.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/VMwareMigrateFabricModelCustomProperties.cs new file mode 100644 index 000000000000..4e9d44291e2e --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/VMwareMigrateFabricModelCustomProperties.cs @@ -0,0 +1,52 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + /// VMware migrate fabric model custom properties. + public partial class VMwareMigrateFabricModelCustomProperties : FabricModelCustomProperties + { + /// Initializes a new instance of . + /// Gets or sets the ARM Id of the VMware site. + /// Gets or sets the ARM Id of the migration solution. + /// or is null. + public VMwareMigrateFabricModelCustomProperties(string vmwareSiteId, string migrationSolutionId) + { + Argument.AssertNotNull(vmwareSiteId, nameof(vmwareSiteId)); + Argument.AssertNotNull(migrationSolutionId, nameof(migrationSolutionId)); + + VmwareSiteId = vmwareSiteId; + MigrationSolutionId = migrationSolutionId; + InstanceType = "VMwareMigrate"; + } + + /// Initializes a new instance of . + /// Discriminator property for FabricModelCustomProperties. + /// Keeps track of any properties unknown to the library. + /// Gets or sets the ARM Id of the VMware site. + /// Gets or sets the ARM Id of the migration solution. + internal VMwareMigrateFabricModelCustomProperties(string instanceType, IDictionary serializedAdditionalRawData, string vmwareSiteId, string migrationSolutionId) : base(instanceType, serializedAdditionalRawData) + { + VmwareSiteId = vmwareSiteId; + MigrationSolutionId = migrationSolutionId; + InstanceType = instanceType ?? "VMwareMigrate"; + } + + /// Initializes a new instance of for deserialization. + internal VMwareMigrateFabricModelCustomProperties() + { + } + + /// Gets or sets the ARM Id of the VMware site. + public string VmwareSiteId { get; set; } + /// Gets or sets the ARM Id of the migration solution. + public string MigrationSolutionId { get; set; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/VMwareToAzStackHCIDiskInput.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/VMwareToAzStackHCIDiskInput.Serialization.cs new file mode 100644 index 000000000000..985dacc4bfbf --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/VMwareToAzStackHCIDiskInput.Serialization.cs @@ -0,0 +1,259 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + public partial class VMwareToAzStackHCIDiskInput : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(VMwareToAzStackHCIDiskInput)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("diskId"u8); + writer.WriteStringValue(DiskId); + if (Optional.IsDefined(StorageContainerId)) + { + writer.WritePropertyName("storageContainerId"u8); + writer.WriteStringValue(StorageContainerId); + } + if (Optional.IsDefined(IsDynamic)) + { + writer.WritePropertyName("isDynamic"u8); + writer.WriteBooleanValue(IsDynamic.Value); + } + writer.WritePropertyName("diskSizeGB"u8); + writer.WriteNumberValue(DiskSizeGB); + writer.WritePropertyName("diskFileFormat"u8); + writer.WriteStringValue(DiskFileFormat); + writer.WritePropertyName("isOsDisk"u8); + writer.WriteBooleanValue(IsOSDisk); + if (Optional.IsDefined(DiskBlockSize)) + { + writer.WritePropertyName("diskBlockSize"u8); + writer.WriteNumberValue(DiskBlockSize.Value); + } + if (Optional.IsDefined(DiskLogicalSectorSize)) + { + writer.WritePropertyName("diskLogicalSectorSize"u8); + writer.WriteNumberValue(DiskLogicalSectorSize.Value); + } + if (Optional.IsDefined(DiskPhysicalSectorSize)) + { + writer.WritePropertyName("diskPhysicalSectorSize"u8); + writer.WriteNumberValue(DiskPhysicalSectorSize.Value); + } + if (Optional.IsDefined(DiskIdentifier)) + { + writer.WritePropertyName("diskIdentifier"u8); + writer.WriteStringValue(DiskIdentifier); + } + if (Optional.IsDefined(DiskController)) + { + writer.WritePropertyName("diskController"u8); + writer.WriteObjectValue(DiskController, options); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + VMwareToAzStackHCIDiskInput 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(VMwareToAzStackHCIDiskInput)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeVMwareToAzStackHCIDiskInput(document.RootElement, options); + } + + internal static VMwareToAzStackHCIDiskInput DeserializeVMwareToAzStackHCIDiskInput(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string diskId = default; + string storageContainerId = default; + bool? isDynamic = default; + long diskSizeGB = default; + string diskFileFormat = default; + bool isOSDisk = default; + long? diskBlockSize = default; + long? diskLogicalSectorSize = default; + long? diskPhysicalSectorSize = default; + string diskIdentifier = default; + DiskControllerInputs diskController = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("diskId"u8)) + { + diskId = property.Value.GetString(); + continue; + } + if (property.NameEquals("storageContainerId"u8)) + { + storageContainerId = property.Value.GetString(); + continue; + } + if (property.NameEquals("isDynamic"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + isDynamic = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("diskSizeGB"u8)) + { + diskSizeGB = property.Value.GetInt64(); + continue; + } + if (property.NameEquals("diskFileFormat"u8)) + { + diskFileFormat = property.Value.GetString(); + continue; + } + if (property.NameEquals("isOsDisk"u8)) + { + isOSDisk = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("diskBlockSize"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + diskBlockSize = property.Value.GetInt64(); + continue; + } + if (property.NameEquals("diskLogicalSectorSize"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + diskLogicalSectorSize = property.Value.GetInt64(); + continue; + } + if (property.NameEquals("diskPhysicalSectorSize"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + diskPhysicalSectorSize = property.Value.GetInt64(); + continue; + } + if (property.NameEquals("diskIdentifier"u8)) + { + diskIdentifier = property.Value.GetString(); + continue; + } + if (property.NameEquals("diskController"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + diskController = DiskControllerInputs.DeserializeDiskControllerInputs(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new VMwareToAzStackHCIDiskInput( + diskId, + storageContainerId, + isDynamic, + diskSizeGB, + diskFileFormat, + isOSDisk, + diskBlockSize, + diskLogicalSectorSize, + diskPhysicalSectorSize, + diskIdentifier, + diskController, + 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(VMwareToAzStackHCIDiskInput)} does not support writing '{options.Format}' format."); + } + } + + VMwareToAzStackHCIDiskInput IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeVMwareToAzStackHCIDiskInput(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(VMwareToAzStackHCIDiskInput)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/VMwareToAzStackHCIDiskInput.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/VMwareToAzStackHCIDiskInput.cs new file mode 100644 index 000000000000..3372a477254d --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/VMwareToAzStackHCIDiskInput.cs @@ -0,0 +1,122 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + /// VMwareToAzStack disk input. + public partial class VMwareToAzStackHCIDiskInput + { + /// + /// 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 . + /// Gets or sets the disk Id. + /// Gets or sets the disk size in GB. + /// Gets or sets the type of the virtual hard disk, vhd or vhdx. + /// Gets or sets a value indicating whether disk is os disk. + /// or is null. + public VMwareToAzStackHCIDiskInput(string diskId, long diskSizeGB, string diskFileFormat, bool isOSDisk) + { + Argument.AssertNotNull(diskId, nameof(diskId)); + Argument.AssertNotNull(diskFileFormat, nameof(diskFileFormat)); + + DiskId = diskId; + DiskSizeGB = diskSizeGB; + DiskFileFormat = diskFileFormat; + IsOSDisk = isOSDisk; + } + + /// Initializes a new instance of . + /// Gets or sets the disk Id. + /// Gets or sets the target storage account ARM Id. + /// Gets or sets a value indicating whether dynamic sizing is enabled on the virtual hard disk. + /// Gets or sets the disk size in GB. + /// Gets or sets the type of the virtual hard disk, vhd or vhdx. + /// Gets or sets a value indicating whether disk is os disk. + /// Gets or sets a value of disk block size. + /// Gets or sets a value of disk logical sector size. + /// Gets or sets a value of disk physical sector size. + /// Gets or sets a value of disk identifier. + /// Disk controller. + /// Keeps track of any properties unknown to the library. + internal VMwareToAzStackHCIDiskInput(string diskId, string storageContainerId, bool? isDynamic, long diskSizeGB, string diskFileFormat, bool isOSDisk, long? diskBlockSize, long? diskLogicalSectorSize, long? diskPhysicalSectorSize, string diskIdentifier, DiskControllerInputs diskController, IDictionary serializedAdditionalRawData) + { + DiskId = diskId; + StorageContainerId = storageContainerId; + IsDynamic = isDynamic; + DiskSizeGB = diskSizeGB; + DiskFileFormat = diskFileFormat; + IsOSDisk = isOSDisk; + DiskBlockSize = diskBlockSize; + DiskLogicalSectorSize = diskLogicalSectorSize; + DiskPhysicalSectorSize = diskPhysicalSectorSize; + DiskIdentifier = diskIdentifier; + DiskController = diskController; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal VMwareToAzStackHCIDiskInput() + { + } + + /// Gets or sets the disk Id. + public string DiskId { get; set; } + /// Gets or sets the target storage account ARM Id. + public string StorageContainerId { get; set; } + /// Gets or sets a value indicating whether dynamic sizing is enabled on the virtual hard disk. + public bool? IsDynamic { get; set; } + /// Gets or sets the disk size in GB. + public long DiskSizeGB { get; set; } + /// Gets or sets the type of the virtual hard disk, vhd or vhdx. + public string DiskFileFormat { get; set; } + /// Gets or sets a value indicating whether disk is os disk. + public bool IsOSDisk { get; set; } + /// Gets or sets a value of disk block size. + public long? DiskBlockSize { get; set; } + /// Gets or sets a value of disk logical sector size. + public long? DiskLogicalSectorSize { get; set; } + /// Gets or sets a value of disk physical sector size. + public long? DiskPhysicalSectorSize { get; set; } + /// Gets or sets a value of disk identifier. + public string DiskIdentifier { get; set; } + /// Disk controller. + public DiskControllerInputs DiskController { get; set; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/VMwareToAzStackHCIEventModelCustomProperties.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/VMwareToAzStackHCIEventModelCustomProperties.Serialization.cs new file mode 100644 index 000000000000..8cc20e09c3ed --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/VMwareToAzStackHCIEventModelCustomProperties.Serialization.cs @@ -0,0 +1,172 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + public partial class VMwareToAzStackHCIEventModelCustomProperties : 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(VMwareToAzStackHCIEventModelCustomProperties)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (options.Format != "W" && Optional.IsDefined(EventSourceFriendlyName)) + { + writer.WritePropertyName("eventSourceFriendlyName"u8); + writer.WriteStringValue(EventSourceFriendlyName); + } + if (options.Format != "W" && Optional.IsDefined(ProtectedItemFriendlyName)) + { + writer.WritePropertyName("protectedItemFriendlyName"u8); + writer.WriteStringValue(ProtectedItemFriendlyName); + } + if (options.Format != "W" && Optional.IsDefined(SourceApplianceName)) + { + writer.WritePropertyName("sourceApplianceName"u8); + writer.WriteStringValue(SourceApplianceName); + } + if (options.Format != "W" && Optional.IsDefined(TargetApplianceName)) + { + writer.WritePropertyName("targetApplianceName"u8); + writer.WriteStringValue(TargetApplianceName); + } + if (options.Format != "W" && Optional.IsDefined(ServerType)) + { + writer.WritePropertyName("serverType"u8); + writer.WriteStringValue(ServerType); + } + } + + VMwareToAzStackHCIEventModelCustomProperties 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(VMwareToAzStackHCIEventModelCustomProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeVMwareToAzStackHCIEventModelCustomProperties(document.RootElement, options); + } + + internal static VMwareToAzStackHCIEventModelCustomProperties DeserializeVMwareToAzStackHCIEventModelCustomProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string eventSourceFriendlyName = default; + string protectedItemFriendlyName = default; + string sourceApplianceName = default; + string targetApplianceName = default; + string serverType = default; + string instanceType = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("eventSourceFriendlyName"u8)) + { + eventSourceFriendlyName = property.Value.GetString(); + continue; + } + if (property.NameEquals("protectedItemFriendlyName"u8)) + { + protectedItemFriendlyName = property.Value.GetString(); + continue; + } + if (property.NameEquals("sourceApplianceName"u8)) + { + sourceApplianceName = property.Value.GetString(); + continue; + } + if (property.NameEquals("targetApplianceName"u8)) + { + targetApplianceName = property.Value.GetString(); + continue; + } + if (property.NameEquals("serverType"u8)) + { + serverType = property.Value.GetString(); + continue; + } + if (property.NameEquals("instanceType"u8)) + { + instanceType = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new VMwareToAzStackHCIEventModelCustomProperties( + instanceType, + serializedAdditionalRawData, + eventSourceFriendlyName, + protectedItemFriendlyName, + sourceApplianceName, + targetApplianceName, + serverType); + } + + 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(VMwareToAzStackHCIEventModelCustomProperties)} does not support writing '{options.Format}' format."); + } + } + + VMwareToAzStackHCIEventModelCustomProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeVMwareToAzStackHCIEventModelCustomProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(VMwareToAzStackHCIEventModelCustomProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/VMwareToAzStackHCIEventModelCustomProperties.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/VMwareToAzStackHCIEventModelCustomProperties.cs new file mode 100644 index 000000000000..6a26ce8d34c3 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/VMwareToAzStackHCIEventModelCustomProperties.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + /// VMware to AzStackHCI event model custom properties. This class provides provider specific details for events of type DataContract.HealthEvents.HealthEventType.ProtectedItemHealth and DataContract.HealthEvents.HealthEventType.AgentHealth. + public partial class VMwareToAzStackHCIEventModelCustomProperties : EventModelCustomProperties + { + /// Initializes a new instance of . + internal VMwareToAzStackHCIEventModelCustomProperties() + { + InstanceType = "VMwareToAzStackHCI"; + } + + /// Initializes a new instance of . + /// Discriminator property for EventModelCustomProperties. + /// Keeps track of any properties unknown to the library. + /// Gets or sets the friendly name of the source which has raised this health event. + /// Gets or sets the protected item friendly name. + /// Gets or sets the source appliance name. + /// Gets or sets the source target name. + /// Gets or sets the server type. + internal VMwareToAzStackHCIEventModelCustomProperties(string instanceType, IDictionary serializedAdditionalRawData, string eventSourceFriendlyName, string protectedItemFriendlyName, string sourceApplianceName, string targetApplianceName, string serverType) : base(instanceType, serializedAdditionalRawData) + { + EventSourceFriendlyName = eventSourceFriendlyName; + ProtectedItemFriendlyName = protectedItemFriendlyName; + SourceApplianceName = sourceApplianceName; + TargetApplianceName = targetApplianceName; + ServerType = serverType; + InstanceType = instanceType ?? "VMwareToAzStackHCI"; + } + + /// Gets or sets the friendly name of the source which has raised this health event. + public string EventSourceFriendlyName { get; } + /// Gets or sets the protected item friendly name. + public string ProtectedItemFriendlyName { get; } + /// Gets or sets the source appliance name. + public string SourceApplianceName { get; } + /// Gets or sets the source target name. + public string TargetApplianceName { get; } + /// Gets or sets the server type. + public string ServerType { get; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/VMwareToAzStackHCINicInput.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/VMwareToAzStackHCINicInput.Serialization.cs new file mode 100644 index 000000000000..1a800f4c5157 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/VMwareToAzStackHCINicInput.Serialization.cs @@ -0,0 +1,214 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + public partial class VMwareToAzStackHCINicInput : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(VMwareToAzStackHCINicInput)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("nicId"u8); + writer.WriteStringValue(NicId); + writer.WritePropertyName("label"u8); + writer.WriteStringValue(Label); + if (options.Format != "W" && Optional.IsDefined(NetworkName)) + { + writer.WritePropertyName("networkName"u8); + writer.WriteStringValue(NetworkName); + } + if (Optional.IsDefined(TargetNetworkId)) + { + writer.WritePropertyName("targetNetworkId"u8); + writer.WriteStringValue(TargetNetworkId); + } + if (Optional.IsDefined(TestNetworkId)) + { + writer.WritePropertyName("testNetworkId"u8); + writer.WriteStringValue(TestNetworkId); + } + writer.WritePropertyName("selectionTypeForFailover"u8); + writer.WriteStringValue(SelectionTypeForFailover.ToString()); + if (Optional.IsDefined(IsStaticIPMigrationEnabled)) + { + writer.WritePropertyName("isStaticIpMigrationEnabled"u8); + writer.WriteBooleanValue(IsStaticIPMigrationEnabled.Value); + } + if (Optional.IsDefined(IsMacMigrationEnabled)) + { + writer.WritePropertyName("isMacMigrationEnabled"u8); + writer.WriteBooleanValue(IsMacMigrationEnabled.Value); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + VMwareToAzStackHCINicInput 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(VMwareToAzStackHCINicInput)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeVMwareToAzStackHCINicInput(document.RootElement, options); + } + + internal static VMwareToAzStackHCINicInput DeserializeVMwareToAzStackHCINicInput(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string nicId = default; + string label = default; + string networkName = default; + string targetNetworkId = default; + string testNetworkId = default; + VmNicSelection selectionTypeForFailover = default; + bool? isStaticIPMigrationEnabled = default; + bool? isMacMigrationEnabled = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("nicId"u8)) + { + nicId = property.Value.GetString(); + continue; + } + if (property.NameEquals("label"u8)) + { + label = property.Value.GetString(); + continue; + } + if (property.NameEquals("networkName"u8)) + { + networkName = property.Value.GetString(); + continue; + } + if (property.NameEquals("targetNetworkId"u8)) + { + targetNetworkId = property.Value.GetString(); + continue; + } + if (property.NameEquals("testNetworkId"u8)) + { + testNetworkId = property.Value.GetString(); + continue; + } + if (property.NameEquals("selectionTypeForFailover"u8)) + { + selectionTypeForFailover = new VmNicSelection(property.Value.GetString()); + continue; + } + if (property.NameEquals("isStaticIpMigrationEnabled"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + isStaticIPMigrationEnabled = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("isMacMigrationEnabled"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + isMacMigrationEnabled = property.Value.GetBoolean(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new VMwareToAzStackHCINicInput( + nicId, + label, + networkName, + targetNetworkId, + testNetworkId, + selectionTypeForFailover, + isStaticIPMigrationEnabled, + isMacMigrationEnabled, + 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(VMwareToAzStackHCINicInput)} does not support writing '{options.Format}' format."); + } + } + + VMwareToAzStackHCINicInput IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeVMwareToAzStackHCINicInput(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(VMwareToAzStackHCINicInput)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/VMwareToAzStackHCINicInput.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/VMwareToAzStackHCINicInput.cs new file mode 100644 index 000000000000..f7d6b2202748 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/VMwareToAzStackHCINicInput.cs @@ -0,0 +1,108 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + /// VMwareToAzStackHCI NIC properties. + public partial class VMwareToAzStackHCINicInput + { + /// + /// 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 . + /// Gets or sets the NIC Id. + /// Gets or sets the NIC label. + /// Gets or sets the selection type of the NIC. + /// or is null. + public VMwareToAzStackHCINicInput(string nicId, string label, VmNicSelection selectionTypeForFailover) + { + Argument.AssertNotNull(nicId, nameof(nicId)); + Argument.AssertNotNull(label, nameof(label)); + + NicId = nicId; + Label = label; + SelectionTypeForFailover = selectionTypeForFailover; + } + + /// Initializes a new instance of . + /// Gets or sets the NIC Id. + /// Gets or sets the NIC label. + /// Gets or sets the network name. + /// Gets or sets the target network Id within AzStackHCI Cluster. + /// Gets or sets the target test network Id within AzStackHCI Cluster. + /// Gets or sets the selection type of the NIC. + /// Gets or sets a value indicating whether static ip migration is enabled. + /// Gets or sets a value indicating whether mac address migration is enabled. + /// Keeps track of any properties unknown to the library. + internal VMwareToAzStackHCINicInput(string nicId, string label, string networkName, string targetNetworkId, string testNetworkId, VmNicSelection selectionTypeForFailover, bool? isStaticIPMigrationEnabled, bool? isMacMigrationEnabled, IDictionary serializedAdditionalRawData) + { + NicId = nicId; + Label = label; + NetworkName = networkName; + TargetNetworkId = targetNetworkId; + TestNetworkId = testNetworkId; + SelectionTypeForFailover = selectionTypeForFailover; + IsStaticIPMigrationEnabled = isStaticIPMigrationEnabled; + IsMacMigrationEnabled = isMacMigrationEnabled; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal VMwareToAzStackHCINicInput() + { + } + + /// Gets or sets the NIC Id. + public string NicId { get; set; } + /// Gets or sets the NIC label. + public string Label { get; set; } + /// Gets or sets the network name. + public string NetworkName { get; } + /// Gets or sets the target network Id within AzStackHCI Cluster. + public string TargetNetworkId { get; set; } + /// Gets or sets the target test network Id within AzStackHCI Cluster. + public string TestNetworkId { get; set; } + /// Gets or sets the selection type of the NIC. + public VmNicSelection SelectionTypeForFailover { get; set; } + /// Gets or sets a value indicating whether static ip migration is enabled. + public bool? IsStaticIPMigrationEnabled { get; set; } + /// Gets or sets a value indicating whether mac address migration is enabled. + public bool? IsMacMigrationEnabled { get; set; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/VMwareToAzStackHCIPlannedFailoverModelCustomProperties.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/VMwareToAzStackHCIPlannedFailoverModelCustomProperties.Serialization.cs new file mode 100644 index 000000000000..195efc2e4aa9 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/VMwareToAzStackHCIPlannedFailoverModelCustomProperties.Serialization.cs @@ -0,0 +1,118 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + public partial class VMwareToAzStackHCIPlannedFailoverModelCustomProperties : 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(VMwareToAzStackHCIPlannedFailoverModelCustomProperties)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + writer.WritePropertyName("shutdownSourceVM"u8); + writer.WriteBooleanValue(ShutdownSourceVm); + } + + VMwareToAzStackHCIPlannedFailoverModelCustomProperties 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(VMwareToAzStackHCIPlannedFailoverModelCustomProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeVMwareToAzStackHCIPlannedFailoverModelCustomProperties(document.RootElement, options); + } + + internal static VMwareToAzStackHCIPlannedFailoverModelCustomProperties DeserializeVMwareToAzStackHCIPlannedFailoverModelCustomProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + bool shutdownSourceVm = default; + string instanceType = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("shutdownSourceVM"u8)) + { + shutdownSourceVm = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("instanceType"u8)) + { + instanceType = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new VMwareToAzStackHCIPlannedFailoverModelCustomProperties(instanceType, serializedAdditionalRawData, shutdownSourceVm); + } + + 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(VMwareToAzStackHCIPlannedFailoverModelCustomProperties)} does not support writing '{options.Format}' format."); + } + } + + VMwareToAzStackHCIPlannedFailoverModelCustomProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeVMwareToAzStackHCIPlannedFailoverModelCustomProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(VMwareToAzStackHCIPlannedFailoverModelCustomProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/VMwareToAzStackHCIPlannedFailoverModelCustomProperties.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/VMwareToAzStackHCIPlannedFailoverModelCustomProperties.cs new file mode 100644 index 000000000000..d32d849edf5e --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/VMwareToAzStackHCIPlannedFailoverModelCustomProperties.cs @@ -0,0 +1,42 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + /// VMware to AzStackHCI planned failover model custom properties. + public partial class VMwareToAzStackHCIPlannedFailoverModelCustomProperties : PlannedFailoverModelCustomProperties + { + /// Initializes a new instance of . + /// Gets or sets a value indicating whether VM needs to be shut down. + public VMwareToAzStackHCIPlannedFailoverModelCustomProperties(bool shutdownSourceVm) + { + ShutdownSourceVm = shutdownSourceVm; + InstanceType = "VMwareToAzStackHCI"; + } + + /// Initializes a new instance of . + /// Discriminator property for PlannedFailoverModelCustomProperties. + /// Keeps track of any properties unknown to the library. + /// Gets or sets a value indicating whether VM needs to be shut down. + internal VMwareToAzStackHCIPlannedFailoverModelCustomProperties(string instanceType, IDictionary serializedAdditionalRawData, bool shutdownSourceVm) : base(instanceType, serializedAdditionalRawData) + { + ShutdownSourceVm = shutdownSourceVm; + InstanceType = instanceType ?? "VMwareToAzStackHCI"; + } + + /// Initializes a new instance of for deserialization. + internal VMwareToAzStackHCIPlannedFailoverModelCustomProperties() + { + } + + /// Gets or sets a value indicating whether VM needs to be shut down. + public bool ShutdownSourceVm { get; set; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/VMwareToAzStackHCIPolicyModelCustomProperties.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/VMwareToAzStackHCIPolicyModelCustomProperties.Serialization.cs new file mode 100644 index 000000000000..d55758167c69 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/VMwareToAzStackHCIPolicyModelCustomProperties.Serialization.cs @@ -0,0 +1,134 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + public partial class VMwareToAzStackHCIPolicyModelCustomProperties : 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(VMwareToAzStackHCIPolicyModelCustomProperties)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + writer.WritePropertyName("recoveryPointHistoryInMinutes"u8); + writer.WriteNumberValue(RecoveryPointHistoryInMinutes); + writer.WritePropertyName("crashConsistentFrequencyInMinutes"u8); + writer.WriteNumberValue(CrashConsistentFrequencyInMinutes); + writer.WritePropertyName("appConsistentFrequencyInMinutes"u8); + writer.WriteNumberValue(AppConsistentFrequencyInMinutes); + } + + VMwareToAzStackHCIPolicyModelCustomProperties 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(VMwareToAzStackHCIPolicyModelCustomProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeVMwareToAzStackHCIPolicyModelCustomProperties(document.RootElement, options); + } + + internal static VMwareToAzStackHCIPolicyModelCustomProperties DeserializeVMwareToAzStackHCIPolicyModelCustomProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + int recoveryPointHistoryInMinutes = default; + int crashConsistentFrequencyInMinutes = default; + int appConsistentFrequencyInMinutes = default; + string instanceType = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("recoveryPointHistoryInMinutes"u8)) + { + recoveryPointHistoryInMinutes = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("crashConsistentFrequencyInMinutes"u8)) + { + crashConsistentFrequencyInMinutes = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("appConsistentFrequencyInMinutes"u8)) + { + appConsistentFrequencyInMinutes = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("instanceType"u8)) + { + instanceType = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new VMwareToAzStackHCIPolicyModelCustomProperties(instanceType, serializedAdditionalRawData, recoveryPointHistoryInMinutes, crashConsistentFrequencyInMinutes, appConsistentFrequencyInMinutes); + } + + 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(VMwareToAzStackHCIPolicyModelCustomProperties)} does not support writing '{options.Format}' format."); + } + } + + VMwareToAzStackHCIPolicyModelCustomProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeVMwareToAzStackHCIPolicyModelCustomProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(VMwareToAzStackHCIPolicyModelCustomProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/VMwareToAzStackHCIPolicyModelCustomProperties.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/VMwareToAzStackHCIPolicyModelCustomProperties.cs new file mode 100644 index 000000000000..805df49a9a07 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/VMwareToAzStackHCIPolicyModelCustomProperties.cs @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + /// VMware To AzStackHCI Policy model custom properties. + public partial class VMwareToAzStackHCIPolicyModelCustomProperties : PolicyModelCustomProperties + { + /// Initializes a new instance of . + /// Gets or sets the duration in minutes until which the recovery points need to be stored. + /// Gets or sets the crash consistent snapshot frequency (in minutes). + /// Gets or sets the app consistent snapshot frequency (in minutes). + public VMwareToAzStackHCIPolicyModelCustomProperties(int recoveryPointHistoryInMinutes, int crashConsistentFrequencyInMinutes, int appConsistentFrequencyInMinutes) + { + RecoveryPointHistoryInMinutes = recoveryPointHistoryInMinutes; + CrashConsistentFrequencyInMinutes = crashConsistentFrequencyInMinutes; + AppConsistentFrequencyInMinutes = appConsistentFrequencyInMinutes; + InstanceType = "VMwareToAzStackHCI"; + } + + /// Initializes a new instance of . + /// Discriminator property for PolicyModelCustomProperties. + /// Keeps track of any properties unknown to the library. + /// Gets or sets the duration in minutes until which the recovery points need to be stored. + /// Gets or sets the crash consistent snapshot frequency (in minutes). + /// Gets or sets the app consistent snapshot frequency (in minutes). + internal VMwareToAzStackHCIPolicyModelCustomProperties(string instanceType, IDictionary serializedAdditionalRawData, int recoveryPointHistoryInMinutes, int crashConsistentFrequencyInMinutes, int appConsistentFrequencyInMinutes) : base(instanceType, serializedAdditionalRawData) + { + RecoveryPointHistoryInMinutes = recoveryPointHistoryInMinutes; + CrashConsistentFrequencyInMinutes = crashConsistentFrequencyInMinutes; + AppConsistentFrequencyInMinutes = appConsistentFrequencyInMinutes; + InstanceType = instanceType ?? "VMwareToAzStackHCI"; + } + + /// Initializes a new instance of for deserialization. + internal VMwareToAzStackHCIPolicyModelCustomProperties() + { + } + + /// Gets or sets the duration in minutes until which the recovery points need to be stored. + public int RecoveryPointHistoryInMinutes { get; set; } + /// Gets or sets the crash consistent snapshot frequency (in minutes). + public int CrashConsistentFrequencyInMinutes { get; set; } + /// Gets or sets the app consistent snapshot frequency (in minutes). + public int AppConsistentFrequencyInMinutes { get; set; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/VMwareToAzStackHCIProtectedDiskProperties.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/VMwareToAzStackHCIProtectedDiskProperties.Serialization.cs new file mode 100644 index 000000000000..3cb6268e7097 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/VMwareToAzStackHCIProtectedDiskProperties.Serialization.cs @@ -0,0 +1,311 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + public partial class VMwareToAzStackHCIProtectedDiskProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(VMwareToAzStackHCIProtectedDiskProperties)} does not support writing '{format}' format."); + } + + if (options.Format != "W" && Optional.IsDefined(StorageContainerId)) + { + writer.WritePropertyName("storageContainerId"u8); + writer.WriteStringValue(StorageContainerId); + } + if (options.Format != "W" && Optional.IsDefined(StorageContainerLocalPath)) + { + writer.WritePropertyName("storageContainerLocalPath"u8); + writer.WriteStringValue(StorageContainerLocalPath); + } + if (options.Format != "W" && Optional.IsDefined(SourceDiskId)) + { + writer.WritePropertyName("sourceDiskId"u8); + writer.WriteStringValue(SourceDiskId); + } + if (options.Format != "W" && Optional.IsDefined(SourceDiskName)) + { + writer.WritePropertyName("sourceDiskName"u8); + writer.WriteStringValue(SourceDiskName); + } + if (options.Format != "W" && Optional.IsDefined(SeedDiskName)) + { + writer.WritePropertyName("seedDiskName"u8); + writer.WriteStringValue(SeedDiskName); + } + if (options.Format != "W" && Optional.IsDefined(TestMigrateDiskName)) + { + writer.WritePropertyName("testMigrateDiskName"u8); + writer.WriteStringValue(TestMigrateDiskName); + } + if (options.Format != "W" && Optional.IsDefined(MigrateDiskName)) + { + writer.WritePropertyName("migrateDiskName"u8); + writer.WriteStringValue(MigrateDiskName); + } + if (options.Format != "W" && Optional.IsDefined(IsOSDisk)) + { + writer.WritePropertyName("isOsDisk"u8); + writer.WriteBooleanValue(IsOSDisk.Value); + } + if (options.Format != "W" && Optional.IsDefined(CapacityInBytes)) + { + writer.WritePropertyName("capacityInBytes"u8); + writer.WriteNumberValue(CapacityInBytes.Value); + } + if (options.Format != "W" && Optional.IsDefined(IsDynamic)) + { + writer.WritePropertyName("isDynamic"u8); + writer.WriteBooleanValue(IsDynamic.Value); + } + if (options.Format != "W" && Optional.IsDefined(DiskType)) + { + writer.WritePropertyName("diskType"u8); + writer.WriteStringValue(DiskType); + } + if (options.Format != "W" && Optional.IsDefined(DiskBlockSize)) + { + writer.WritePropertyName("diskBlockSize"u8); + writer.WriteNumberValue(DiskBlockSize.Value); + } + if (options.Format != "W" && Optional.IsDefined(DiskLogicalSectorSize)) + { + writer.WritePropertyName("diskLogicalSectorSize"u8); + writer.WriteNumberValue(DiskLogicalSectorSize.Value); + } + if (options.Format != "W" && Optional.IsDefined(DiskPhysicalSectorSize)) + { + writer.WritePropertyName("diskPhysicalSectorSize"u8); + writer.WriteNumberValue(DiskPhysicalSectorSize.Value); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + VMwareToAzStackHCIProtectedDiskProperties 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(VMwareToAzStackHCIProtectedDiskProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeVMwareToAzStackHCIProtectedDiskProperties(document.RootElement, options); + } + + internal static VMwareToAzStackHCIProtectedDiskProperties DeserializeVMwareToAzStackHCIProtectedDiskProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string storageContainerId = default; + string storageContainerLocalPath = default; + string sourceDiskId = default; + string sourceDiskName = default; + string seedDiskName = default; + string testMigrateDiskName = default; + string migrateDiskName = default; + bool? isOSDisk = default; + long? capacityInBytes = default; + bool? isDynamic = default; + string diskType = default; + long? diskBlockSize = default; + long? diskLogicalSectorSize = default; + long? diskPhysicalSectorSize = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("storageContainerId"u8)) + { + storageContainerId = property.Value.GetString(); + continue; + } + if (property.NameEquals("storageContainerLocalPath"u8)) + { + storageContainerLocalPath = property.Value.GetString(); + continue; + } + if (property.NameEquals("sourceDiskId"u8)) + { + sourceDiskId = property.Value.GetString(); + continue; + } + if (property.NameEquals("sourceDiskName"u8)) + { + sourceDiskName = property.Value.GetString(); + continue; + } + if (property.NameEquals("seedDiskName"u8)) + { + seedDiskName = property.Value.GetString(); + continue; + } + if (property.NameEquals("testMigrateDiskName"u8)) + { + testMigrateDiskName = property.Value.GetString(); + continue; + } + if (property.NameEquals("migrateDiskName"u8)) + { + migrateDiskName = property.Value.GetString(); + continue; + } + if (property.NameEquals("isOsDisk"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + isOSDisk = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("capacityInBytes"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + capacityInBytes = property.Value.GetInt64(); + continue; + } + if (property.NameEquals("isDynamic"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + isDynamic = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("diskType"u8)) + { + diskType = property.Value.GetString(); + continue; + } + if (property.NameEquals("diskBlockSize"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + diskBlockSize = property.Value.GetInt64(); + continue; + } + if (property.NameEquals("diskLogicalSectorSize"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + diskLogicalSectorSize = property.Value.GetInt64(); + continue; + } + if (property.NameEquals("diskPhysicalSectorSize"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + diskPhysicalSectorSize = property.Value.GetInt64(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new VMwareToAzStackHCIProtectedDiskProperties( + storageContainerId, + storageContainerLocalPath, + sourceDiskId, + sourceDiskName, + seedDiskName, + testMigrateDiskName, + migrateDiskName, + isOSDisk, + capacityInBytes, + isDynamic, + diskType, + diskBlockSize, + diskLogicalSectorSize, + diskPhysicalSectorSize, + 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(VMwareToAzStackHCIProtectedDiskProperties)} does not support writing '{options.Format}' format."); + } + } + + VMwareToAzStackHCIProtectedDiskProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeVMwareToAzStackHCIProtectedDiskProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(VMwareToAzStackHCIProtectedDiskProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/VMwareToAzStackHCIProtectedDiskProperties.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/VMwareToAzStackHCIProtectedDiskProperties.cs new file mode 100644 index 000000000000..204d7393d84b --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/VMwareToAzStackHCIProtectedDiskProperties.cs @@ -0,0 +1,117 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + /// VMwareToAzStackHCI protected disk properties. + public partial class VMwareToAzStackHCIProtectedDiskProperties + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + internal VMwareToAzStackHCIProtectedDiskProperties() + { + } + + /// Initializes a new instance of . + /// Gets or sets the ARM Id of the storage container. + /// Gets or sets the local path of the storage container. + /// Gets or sets the source disk Id. + /// Gets or sets the source disk Name. + /// Gets or sets the seed disk name. + /// Gets or sets the test failover clone disk. + /// Gets or sets the failover clone disk. + /// Gets or sets a value indicating whether the disk is the OS disk. + /// Gets or sets the disk capacity in bytes. + /// Gets or sets a value indicating whether dynamic sizing is enabled on the virtual hard disk. + /// Gets or sets the disk type. + /// Gets or sets a value of disk block size. + /// Gets or sets a value of disk logical sector size. + /// Gets or sets a value of disk physical sector size. + /// Keeps track of any properties unknown to the library. + internal VMwareToAzStackHCIProtectedDiskProperties(string storageContainerId, string storageContainerLocalPath, string sourceDiskId, string sourceDiskName, string seedDiskName, string testMigrateDiskName, string migrateDiskName, bool? isOSDisk, long? capacityInBytes, bool? isDynamic, string diskType, long? diskBlockSize, long? diskLogicalSectorSize, long? diskPhysicalSectorSize, IDictionary serializedAdditionalRawData) + { + StorageContainerId = storageContainerId; + StorageContainerLocalPath = storageContainerLocalPath; + SourceDiskId = sourceDiskId; + SourceDiskName = sourceDiskName; + SeedDiskName = seedDiskName; + TestMigrateDiskName = testMigrateDiskName; + MigrateDiskName = migrateDiskName; + IsOSDisk = isOSDisk; + CapacityInBytes = capacityInBytes; + IsDynamic = isDynamic; + DiskType = diskType; + DiskBlockSize = diskBlockSize; + DiskLogicalSectorSize = diskLogicalSectorSize; + DiskPhysicalSectorSize = diskPhysicalSectorSize; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Gets or sets the ARM Id of the storage container. + public string StorageContainerId { get; } + /// Gets or sets the local path of the storage container. + public string StorageContainerLocalPath { get; } + /// Gets or sets the source disk Id. + public string SourceDiskId { get; } + /// Gets or sets the source disk Name. + public string SourceDiskName { get; } + /// Gets or sets the seed disk name. + public string SeedDiskName { get; } + /// Gets or sets the test failover clone disk. + public string TestMigrateDiskName { get; } + /// Gets or sets the failover clone disk. + public string MigrateDiskName { get; } + /// Gets or sets a value indicating whether the disk is the OS disk. + public bool? IsOSDisk { get; } + /// Gets or sets the disk capacity in bytes. + public long? CapacityInBytes { get; } + /// Gets or sets a value indicating whether dynamic sizing is enabled on the virtual hard disk. + public bool? IsDynamic { get; } + /// Gets or sets the disk type. + public string DiskType { get; } + /// Gets or sets a value of disk block size. + public long? DiskBlockSize { get; } + /// Gets or sets a value of disk logical sector size. + public long? DiskLogicalSectorSize { get; } + /// Gets or sets a value of disk physical sector size. + public long? DiskPhysicalSectorSize { get; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/VMwareToAzStackHCIProtectedItemModelCustomProperties.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/VMwareToAzStackHCIProtectedItemModelCustomProperties.Serialization.cs new file mode 100644 index 000000000000..5d62fdd50dfd --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/VMwareToAzStackHCIProtectedItemModelCustomProperties.Serialization.cs @@ -0,0 +1,748 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + public partial class VMwareToAzStackHCIProtectedItemModelCustomProperties : 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(VMwareToAzStackHCIProtectedItemModelCustomProperties)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (options.Format != "W" && Optional.IsDefined(ActiveLocation)) + { + writer.WritePropertyName("activeLocation"u8); + writer.WriteStringValue(ActiveLocation.Value.ToString()); + } + writer.WritePropertyName("targetHciClusterId"u8); + writer.WriteStringValue(TargetHciClusterId); + writer.WritePropertyName("targetArcClusterCustomLocationId"u8); + writer.WriteStringValue(TargetArcClusterCustomLocationId); + if (options.Format != "W" && Optional.IsDefined(TargetAzStackHciClusterName)) + { + writer.WritePropertyName("targetAzStackHciClusterName"u8); + writer.WriteStringValue(TargetAzStackHciClusterName); + } + writer.WritePropertyName("storageContainerId"u8); + writer.WriteStringValue(StorageContainerId); + writer.WritePropertyName("targetResourceGroupId"u8); + writer.WriteStringValue(TargetResourceGroupId); + if (options.Format != "W" && Optional.IsDefined(TargetLocation)) + { + writer.WritePropertyName("targetLocation"u8); + writer.WriteStringValue(TargetLocation); + } + writer.WritePropertyName("customLocationRegion"u8); + writer.WriteStringValue(CustomLocationRegion); + writer.WritePropertyName("disksToInclude"u8); + writer.WriteStartArray(); + foreach (var item in DisksToInclude) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + writer.WritePropertyName("nicsToInclude"u8); + writer.WriteStartArray(); + foreach (var item in NicsToInclude) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + if (options.Format != "W" && Optional.IsCollectionDefined(ProtectedDisks)) + { + writer.WritePropertyName("protectedDisks"u8); + writer.WriteStartArray(); + foreach (var item in ProtectedDisks) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && Optional.IsCollectionDefined(ProtectedNics)) + { + writer.WritePropertyName("protectedNics"u8); + writer.WriteStartArray(); + foreach (var item in ProtectedNics) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && Optional.IsDefined(TargetVmBiosId)) + { + writer.WritePropertyName("targetVmBiosId"u8); + writer.WriteStringValue(TargetVmBiosId); + } + if (Optional.IsDefined(TargetVmName)) + { + writer.WritePropertyName("targetVmName"u8); + writer.WriteStringValue(TargetVmName); + } + writer.WritePropertyName("hyperVGeneration"u8); + writer.WriteStringValue(HyperVGeneration); + if (Optional.IsDefined(TargetNetworkId)) + { + writer.WritePropertyName("targetNetworkId"u8); + writer.WriteStringValue(TargetNetworkId); + } + if (Optional.IsDefined(TestNetworkId)) + { + writer.WritePropertyName("testNetworkId"u8); + writer.WriteStringValue(TestNetworkId); + } + if (Optional.IsDefined(TargetCpuCores)) + { + writer.WritePropertyName("targetCpuCores"u8); + writer.WriteNumberValue(TargetCpuCores.Value); + } + if (Optional.IsDefined(IsDynamicRam)) + { + writer.WritePropertyName("isDynamicRam"u8); + writer.WriteBooleanValue(IsDynamicRam.Value); + } + if (Optional.IsDefined(DynamicMemoryConfig)) + { + writer.WritePropertyName("dynamicMemoryConfig"u8); + writer.WriteObjectValue(DynamicMemoryConfig, options); + } + if (Optional.IsDefined(TargetMemoryInMegaBytes)) + { + writer.WritePropertyName("targetMemoryInMegaBytes"u8); + writer.WriteNumberValue(TargetMemoryInMegaBytes.Value); + } + if (options.Format != "W" && Optional.IsDefined(OSType)) + { + writer.WritePropertyName("osType"u8); + writer.WriteStringValue(OSType); + } + if (options.Format != "W" && Optional.IsDefined(OSName)) + { + writer.WritePropertyName("osName"u8); + writer.WriteStringValue(OSName); + } + if (options.Format != "W" && Optional.IsDefined(FirmwareType)) + { + writer.WritePropertyName("firmwareType"u8); + writer.WriteStringValue(FirmwareType); + } + writer.WritePropertyName("fabricDiscoveryMachineId"u8); + writer.WriteStringValue(FabricDiscoveryMachineId); + if (options.Format != "W" && Optional.IsDefined(SourceVmName)) + { + writer.WritePropertyName("sourceVmName"u8); + writer.WriteStringValue(SourceVmName); + } + if (options.Format != "W" && Optional.IsDefined(SourceCpuCores)) + { + writer.WritePropertyName("sourceCpuCores"u8); + writer.WriteNumberValue(SourceCpuCores.Value); + } + if (options.Format != "W" && Optional.IsDefined(SourceMemoryInMegaBytes)) + { + writer.WritePropertyName("sourceMemoryInMegaBytes"u8); + writer.WriteNumberValue(SourceMemoryInMegaBytes.Value); + } + writer.WritePropertyName("runAsAccountId"u8); + writer.WriteStringValue(RunAsAccountId); + writer.WritePropertyName("sourceFabricAgentName"u8); + writer.WriteStringValue(SourceFabricAgentName); + writer.WritePropertyName("targetFabricAgentName"u8); + writer.WriteStringValue(TargetFabricAgentName); + if (options.Format != "W" && Optional.IsDefined(SourceApplianceName)) + { + writer.WritePropertyName("sourceApplianceName"u8); + writer.WriteStringValue(SourceApplianceName); + } + if (options.Format != "W" && Optional.IsDefined(TargetApplianceName)) + { + writer.WritePropertyName("targetApplianceName"u8); + writer.WriteStringValue(TargetApplianceName); + } + if (options.Format != "W" && Optional.IsDefined(FailoverRecoveryPointId)) + { + writer.WritePropertyName("failoverRecoveryPointId"u8); + writer.WriteStringValue(FailoverRecoveryPointId); + } + if (options.Format != "W" && Optional.IsDefined(LastRecoveryPointReceived)) + { + writer.WritePropertyName("lastRecoveryPointReceived"u8); + writer.WriteStringValue(LastRecoveryPointReceived.Value, "O"); + } + if (options.Format != "W" && Optional.IsDefined(LastRecoveryPointId)) + { + writer.WritePropertyName("lastRecoveryPointId"u8); + writer.WriteStringValue(LastRecoveryPointId); + } + if (options.Format != "W" && Optional.IsDefined(InitialReplicationProgressPercentage)) + { + writer.WritePropertyName("initialReplicationProgressPercentage"u8); + writer.WriteNumberValue(InitialReplicationProgressPercentage.Value); + } + if (options.Format != "W" && Optional.IsDefined(MigrationProgressPercentage)) + { + writer.WritePropertyName("migrationProgressPercentage"u8); + writer.WriteNumberValue(MigrationProgressPercentage.Value); + } + if (options.Format != "W" && Optional.IsDefined(ResumeProgressPercentage)) + { + writer.WritePropertyName("resumeProgressPercentage"u8); + writer.WriteNumberValue(ResumeProgressPercentage.Value); + } + if (options.Format != "W" && Optional.IsDefined(ResyncProgressPercentage)) + { + writer.WritePropertyName("resyncProgressPercentage"u8); + writer.WriteNumberValue(ResyncProgressPercentage.Value); + } + if (options.Format != "W" && Optional.IsDefined(ResyncRetryCount)) + { + writer.WritePropertyName("resyncRetryCount"u8); + writer.WriteNumberValue(ResyncRetryCount.Value); + } + if (options.Format != "W" && Optional.IsDefined(ResyncRequired)) + { + writer.WritePropertyName("resyncRequired"u8); + writer.WriteBooleanValue(ResyncRequired.Value); + } + if (options.Format != "W" && Optional.IsDefined(ResyncState)) + { + writer.WritePropertyName("resyncState"u8); + writer.WriteStringValue(ResyncState.Value.ToString()); + } + if (Optional.IsDefined(PerformAutoResync)) + { + writer.WritePropertyName("performAutoResync"u8); + writer.WriteBooleanValue(PerformAutoResync.Value); + } + if (options.Format != "W" && Optional.IsDefined(ResumeRetryCount)) + { + writer.WritePropertyName("resumeRetryCount"u8); + writer.WriteNumberValue(ResumeRetryCount.Value); + } + if (options.Format != "W" && Optional.IsDefined(LastReplicationUpdateOn)) + { + writer.WritePropertyName("lastReplicationUpdateTime"u8); + writer.WriteStringValue(LastReplicationUpdateOn.Value, "O"); + } + } + + VMwareToAzStackHCIProtectedItemModelCustomProperties 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(VMwareToAzStackHCIProtectedItemModelCustomProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeVMwareToAzStackHCIProtectedItemModelCustomProperties(document.RootElement, options); + } + + internal static VMwareToAzStackHCIProtectedItemModelCustomProperties DeserializeVMwareToAzStackHCIProtectedItemModelCustomProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ProtectedItemActiveLocation? activeLocation = default; + string targetHciClusterId = default; + string targetArcClusterCustomLocationId = default; + string targetAzStackHciClusterName = default; + string storageContainerId = default; + string targetResourceGroupId = default; + string targetLocation = default; + string customLocationRegion = default; + IList disksToInclude = default; + IList nicsToInclude = default; + IReadOnlyList protectedDisks = default; + IReadOnlyList protectedNics = default; + string targetVmBiosId = default; + string targetVmName = default; + string hyperVGeneration = default; + string targetNetworkId = default; + string testNetworkId = default; + int? targetCpuCores = default; + bool? isDynamicRam = default; + ProtectedItemDynamicMemoryConfig dynamicMemoryConfig = default; + int? targetMemoryInMegaBytes = default; + string osType = default; + string osName = default; + string firmwareType = default; + string fabricDiscoveryMachineId = default; + string sourceVmName = default; + int? sourceCpuCores = default; + double? sourceMemoryInMegaBytes = default; + string runAsAccountId = default; + string sourceFabricAgentName = default; + string targetFabricAgentName = default; + string sourceApplianceName = default; + string targetApplianceName = default; + string failoverRecoveryPointId = default; + DateTimeOffset? lastRecoveryPointReceived = default; + string lastRecoveryPointId = default; + int? initialReplicationProgressPercentage = default; + int? migrationProgressPercentage = default; + int? resumeProgressPercentage = default; + int? resyncProgressPercentage = default; + long? resyncRetryCount = default; + bool? resyncRequired = default; + VMwareToAzureMigrateResyncState? resyncState = default; + bool? performAutoResync = default; + long? resumeRetryCount = default; + DateTimeOffset? lastReplicationUpdateTime = default; + string instanceType = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("activeLocation"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + activeLocation = new ProtectedItemActiveLocation(property.Value.GetString()); + continue; + } + if (property.NameEquals("targetHciClusterId"u8)) + { + targetHciClusterId = property.Value.GetString(); + continue; + } + if (property.NameEquals("targetArcClusterCustomLocationId"u8)) + { + targetArcClusterCustomLocationId = property.Value.GetString(); + continue; + } + if (property.NameEquals("targetAzStackHciClusterName"u8)) + { + targetAzStackHciClusterName = property.Value.GetString(); + continue; + } + if (property.NameEquals("storageContainerId"u8)) + { + storageContainerId = property.Value.GetString(); + continue; + } + if (property.NameEquals("targetResourceGroupId"u8)) + { + targetResourceGroupId = property.Value.GetString(); + continue; + } + if (property.NameEquals("targetLocation"u8)) + { + targetLocation = property.Value.GetString(); + continue; + } + if (property.NameEquals("customLocationRegion"u8)) + { + customLocationRegion = property.Value.GetString(); + continue; + } + if (property.NameEquals("disksToInclude"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(VMwareToAzStackHCIDiskInput.DeserializeVMwareToAzStackHCIDiskInput(item, options)); + } + disksToInclude = array; + continue; + } + if (property.NameEquals("nicsToInclude"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(VMwareToAzStackHCINicInput.DeserializeVMwareToAzStackHCINicInput(item, options)); + } + nicsToInclude = array; + continue; + } + if (property.NameEquals("protectedDisks"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(VMwareToAzStackHCIProtectedDiskProperties.DeserializeVMwareToAzStackHCIProtectedDiskProperties(item, options)); + } + protectedDisks = array; + continue; + } + if (property.NameEquals("protectedNics"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(VMwareToAzStackHCIProtectedNicProperties.DeserializeVMwareToAzStackHCIProtectedNicProperties(item, options)); + } + protectedNics = array; + continue; + } + if (property.NameEquals("targetVmBiosId"u8)) + { + targetVmBiosId = property.Value.GetString(); + continue; + } + if (property.NameEquals("targetVmName"u8)) + { + targetVmName = property.Value.GetString(); + continue; + } + if (property.NameEquals("hyperVGeneration"u8)) + { + hyperVGeneration = property.Value.GetString(); + continue; + } + if (property.NameEquals("targetNetworkId"u8)) + { + targetNetworkId = property.Value.GetString(); + continue; + } + if (property.NameEquals("testNetworkId"u8)) + { + testNetworkId = property.Value.GetString(); + continue; + } + if (property.NameEquals("targetCpuCores"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + targetCpuCores = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("isDynamicRam"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + isDynamicRam = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("dynamicMemoryConfig"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + dynamicMemoryConfig = ProtectedItemDynamicMemoryConfig.DeserializeProtectedItemDynamicMemoryConfig(property.Value, options); + continue; + } + if (property.NameEquals("targetMemoryInMegaBytes"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + targetMemoryInMegaBytes = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("osType"u8)) + { + osType = property.Value.GetString(); + continue; + } + if (property.NameEquals("osName"u8)) + { + osName = property.Value.GetString(); + continue; + } + if (property.NameEquals("firmwareType"u8)) + { + firmwareType = property.Value.GetString(); + continue; + } + if (property.NameEquals("fabricDiscoveryMachineId"u8)) + { + fabricDiscoveryMachineId = property.Value.GetString(); + continue; + } + if (property.NameEquals("sourceVmName"u8)) + { + sourceVmName = property.Value.GetString(); + continue; + } + if (property.NameEquals("sourceCpuCores"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + sourceCpuCores = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("sourceMemoryInMegaBytes"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + sourceMemoryInMegaBytes = property.Value.GetDouble(); + continue; + } + if (property.NameEquals("runAsAccountId"u8)) + { + runAsAccountId = property.Value.GetString(); + continue; + } + if (property.NameEquals("sourceFabricAgentName"u8)) + { + sourceFabricAgentName = property.Value.GetString(); + continue; + } + if (property.NameEquals("targetFabricAgentName"u8)) + { + targetFabricAgentName = property.Value.GetString(); + continue; + } + if (property.NameEquals("sourceApplianceName"u8)) + { + sourceApplianceName = property.Value.GetString(); + continue; + } + if (property.NameEquals("targetApplianceName"u8)) + { + targetApplianceName = property.Value.GetString(); + continue; + } + if (property.NameEquals("failoverRecoveryPointId"u8)) + { + failoverRecoveryPointId = property.Value.GetString(); + continue; + } + if (property.NameEquals("lastRecoveryPointReceived"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + lastRecoveryPointReceived = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("lastRecoveryPointId"u8)) + { + lastRecoveryPointId = property.Value.GetString(); + continue; + } + if (property.NameEquals("initialReplicationProgressPercentage"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + initialReplicationProgressPercentage = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("migrationProgressPercentage"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + migrationProgressPercentage = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("resumeProgressPercentage"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + resumeProgressPercentage = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("resyncProgressPercentage"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + resyncProgressPercentage = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("resyncRetryCount"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + resyncRetryCount = property.Value.GetInt64(); + continue; + } + if (property.NameEquals("resyncRequired"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + resyncRequired = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("resyncState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + resyncState = new VMwareToAzureMigrateResyncState(property.Value.GetString()); + continue; + } + if (property.NameEquals("performAutoResync"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + performAutoResync = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("resumeRetryCount"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + resumeRetryCount = property.Value.GetInt64(); + continue; + } + if (property.NameEquals("lastReplicationUpdateTime"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + lastReplicationUpdateTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("instanceType"u8)) + { + instanceType = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new VMwareToAzStackHCIProtectedItemModelCustomProperties( + instanceType, + serializedAdditionalRawData, + activeLocation, + targetHciClusterId, + targetArcClusterCustomLocationId, + targetAzStackHciClusterName, + storageContainerId, + targetResourceGroupId, + targetLocation, + customLocationRegion, + disksToInclude, + nicsToInclude, + protectedDisks ?? new ChangeTrackingList(), + protectedNics ?? new ChangeTrackingList(), + targetVmBiosId, + targetVmName, + hyperVGeneration, + targetNetworkId, + testNetworkId, + targetCpuCores, + isDynamicRam, + dynamicMemoryConfig, + targetMemoryInMegaBytes, + osType, + osName, + firmwareType, + fabricDiscoveryMachineId, + sourceVmName, + sourceCpuCores, + sourceMemoryInMegaBytes, + runAsAccountId, + sourceFabricAgentName, + targetFabricAgentName, + sourceApplianceName, + targetApplianceName, + failoverRecoveryPointId, + lastRecoveryPointReceived, + lastRecoveryPointId, + initialReplicationProgressPercentage, + migrationProgressPercentage, + resumeProgressPercentage, + resyncProgressPercentage, + resyncRetryCount, + resyncRequired, + resyncState, + performAutoResync, + resumeRetryCount, + lastReplicationUpdateTime); + } + + 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(VMwareToAzStackHCIProtectedItemModelCustomProperties)} does not support writing '{options.Format}' format."); + } + } + + VMwareToAzStackHCIProtectedItemModelCustomProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeVMwareToAzStackHCIProtectedItemModelCustomProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(VMwareToAzStackHCIProtectedItemModelCustomProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/VMwareToAzStackHCIProtectedItemModelCustomProperties.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/VMwareToAzStackHCIProtectedItemModelCustomProperties.cs new file mode 100644 index 000000000000..f6251ec3695d --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/VMwareToAzStackHCIProtectedItemModelCustomProperties.cs @@ -0,0 +1,261 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + /// VMware to AzStackHCI Protected item model custom properties. + public partial class VMwareToAzStackHCIProtectedItemModelCustomProperties : ProtectedItemModelCustomProperties + { + /// Initializes a new instance of . + /// Gets or sets the Target HCI Cluster ARM Id. + /// Gets or sets the Target Arc Cluster Custom Location ARM Id. + /// Gets or sets the target storage container ARM Id. + /// Gets or sets the target resource group ARM Id. + /// Gets or sets the location of Azure Arc HCI custom location resource. + /// Gets or sets the list of disks to replicate. + /// Gets or sets the list of VM NIC to replicate. + /// Gets or sets the hypervisor generation of the virtual machine possible values are 1,2. + /// Gets or sets the ARM Id of the discovered machine. + /// Gets or sets the run as account Id. + /// Gets or sets the source fabric agent name. + /// Gets or sets the target fabric agent name. + /// , , , , , , , , , , or is null. + public VMwareToAzStackHCIProtectedItemModelCustomProperties(string targetHciClusterId, string targetArcClusterCustomLocationId, string storageContainerId, string targetResourceGroupId, string customLocationRegion, IEnumerable disksToInclude, IEnumerable nicsToInclude, string hyperVGeneration, string fabricDiscoveryMachineId, string runAsAccountId, string sourceFabricAgentName, string targetFabricAgentName) + { + Argument.AssertNotNull(targetHciClusterId, nameof(targetHciClusterId)); + Argument.AssertNotNull(targetArcClusterCustomLocationId, nameof(targetArcClusterCustomLocationId)); + Argument.AssertNotNull(storageContainerId, nameof(storageContainerId)); + Argument.AssertNotNull(targetResourceGroupId, nameof(targetResourceGroupId)); + Argument.AssertNotNull(customLocationRegion, nameof(customLocationRegion)); + Argument.AssertNotNull(disksToInclude, nameof(disksToInclude)); + Argument.AssertNotNull(nicsToInclude, nameof(nicsToInclude)); + Argument.AssertNotNull(hyperVGeneration, nameof(hyperVGeneration)); + Argument.AssertNotNull(fabricDiscoveryMachineId, nameof(fabricDiscoveryMachineId)); + Argument.AssertNotNull(runAsAccountId, nameof(runAsAccountId)); + Argument.AssertNotNull(sourceFabricAgentName, nameof(sourceFabricAgentName)); + Argument.AssertNotNull(targetFabricAgentName, nameof(targetFabricAgentName)); + + TargetHciClusterId = targetHciClusterId; + TargetArcClusterCustomLocationId = targetArcClusterCustomLocationId; + StorageContainerId = storageContainerId; + TargetResourceGroupId = targetResourceGroupId; + CustomLocationRegion = customLocationRegion; + DisksToInclude = disksToInclude.ToList(); + NicsToInclude = nicsToInclude.ToList(); + ProtectedDisks = new ChangeTrackingList(); + ProtectedNics = new ChangeTrackingList(); + HyperVGeneration = hyperVGeneration; + FabricDiscoveryMachineId = fabricDiscoveryMachineId; + RunAsAccountId = runAsAccountId; + SourceFabricAgentName = sourceFabricAgentName; + TargetFabricAgentName = targetFabricAgentName; + InstanceType = "VMwareToAzStackHCI"; + } + + /// Initializes a new instance of . + /// Discriminator property for ProtectedItemModelCustomProperties. + /// Keeps track of any properties unknown to the library. + /// Gets or sets the location of the protected item. + /// Gets or sets the Target HCI Cluster ARM Id. + /// Gets or sets the Target Arc Cluster Custom Location ARM Id. + /// Gets or sets the Target AzStackHCI cluster name. + /// Gets or sets the target storage container ARM Id. + /// Gets or sets the target resource group ARM Id. + /// Gets or sets the target location. + /// Gets or sets the location of Azure Arc HCI custom location resource. + /// Gets or sets the list of disks to replicate. + /// Gets or sets the list of VM NIC to replicate. + /// Gets or sets the list of protected disks. + /// Gets or sets the VM NIC details. + /// Gets or sets the BIOS Id of the target AzStackHCI VM. + /// Gets or sets the target VM display name. + /// Gets or sets the hypervisor generation of the virtual machine possible values are 1,2. + /// Gets or sets the target network Id within AzStackHCI Cluster. + /// Gets or sets the target test network Id within AzStackHCI Cluster. + /// Gets or sets the target CPU cores. + /// Gets or sets a value indicating whether memory is dynamical. + /// Protected item dynamic memory config. + /// Gets or sets the target memory in mega-bytes. + /// Gets or sets the type of the OS. + /// Gets or sets the name of the OS. + /// Gets or sets the firmware type. + /// Gets or sets the ARM Id of the discovered machine. + /// Gets or sets the source VM display name. + /// Gets or sets the source VM CPU cores. + /// Gets or sets the source VM ram memory size in megabytes. + /// Gets or sets the run as account Id. + /// Gets or sets the source fabric agent name. + /// Gets or sets the target fabric agent name. + /// Gets or sets the source appliance name. + /// Gets or sets the target appliance name. + /// Gets or sets the recovery point Id to which the VM was failed over. + /// Gets or sets the last recovery point received time. + /// Gets or sets the last recovery point Id. + /// Gets or sets the initial replication progress percentage. This is calculated based on total bytes processed for all disks in the source VM. + /// Gets or sets the migration progress percentage. + /// Gets or sets the resume progress percentage. + /// Gets or sets the resync progress percentage. This is calculated based on total bytes processed for all disks in the source VM. + /// Gets or sets the resync retry count. + /// Gets or sets a value indicating whether resync is required. + /// Gets or sets the resync state. + /// Gets or sets a value indicating whether auto resync is to be done. + /// Gets or sets the resume retry count. + /// Gets or sets the latest timestamp that replication status is updated. + internal VMwareToAzStackHCIProtectedItemModelCustomProperties(string instanceType, IDictionary serializedAdditionalRawData, ProtectedItemActiveLocation? activeLocation, string targetHciClusterId, string targetArcClusterCustomLocationId, string targetAzStackHciClusterName, string storageContainerId, string targetResourceGroupId, string targetLocation, string customLocationRegion, IList disksToInclude, IList nicsToInclude, IReadOnlyList protectedDisks, IReadOnlyList protectedNics, string targetVmBiosId, string targetVmName, string hyperVGeneration, string targetNetworkId, string testNetworkId, int? targetCpuCores, bool? isDynamicRam, ProtectedItemDynamicMemoryConfig dynamicMemoryConfig, int? targetMemoryInMegaBytes, string osType, string osName, string firmwareType, string fabricDiscoveryMachineId, string sourceVmName, int? sourceCpuCores, double? sourceMemoryInMegaBytes, string runAsAccountId, string sourceFabricAgentName, string targetFabricAgentName, string sourceApplianceName, string targetApplianceName, string failoverRecoveryPointId, DateTimeOffset? lastRecoveryPointReceived, string lastRecoveryPointId, int? initialReplicationProgressPercentage, int? migrationProgressPercentage, int? resumeProgressPercentage, int? resyncProgressPercentage, long? resyncRetryCount, bool? resyncRequired, VMwareToAzureMigrateResyncState? resyncState, bool? performAutoResync, long? resumeRetryCount, DateTimeOffset? lastReplicationUpdateOn) : base(instanceType, serializedAdditionalRawData) + { + ActiveLocation = activeLocation; + TargetHciClusterId = targetHciClusterId; + TargetArcClusterCustomLocationId = targetArcClusterCustomLocationId; + TargetAzStackHciClusterName = targetAzStackHciClusterName; + StorageContainerId = storageContainerId; + TargetResourceGroupId = targetResourceGroupId; + TargetLocation = targetLocation; + CustomLocationRegion = customLocationRegion; + DisksToInclude = disksToInclude; + NicsToInclude = nicsToInclude; + ProtectedDisks = protectedDisks; + ProtectedNics = protectedNics; + TargetVmBiosId = targetVmBiosId; + TargetVmName = targetVmName; + HyperVGeneration = hyperVGeneration; + TargetNetworkId = targetNetworkId; + TestNetworkId = testNetworkId; + TargetCpuCores = targetCpuCores; + IsDynamicRam = isDynamicRam; + DynamicMemoryConfig = dynamicMemoryConfig; + TargetMemoryInMegaBytes = targetMemoryInMegaBytes; + OSType = osType; + OSName = osName; + FirmwareType = firmwareType; + FabricDiscoveryMachineId = fabricDiscoveryMachineId; + SourceVmName = sourceVmName; + SourceCpuCores = sourceCpuCores; + SourceMemoryInMegaBytes = sourceMemoryInMegaBytes; + RunAsAccountId = runAsAccountId; + SourceFabricAgentName = sourceFabricAgentName; + TargetFabricAgentName = targetFabricAgentName; + SourceApplianceName = sourceApplianceName; + TargetApplianceName = targetApplianceName; + FailoverRecoveryPointId = failoverRecoveryPointId; + LastRecoveryPointReceived = lastRecoveryPointReceived; + LastRecoveryPointId = lastRecoveryPointId; + InitialReplicationProgressPercentage = initialReplicationProgressPercentage; + MigrationProgressPercentage = migrationProgressPercentage; + ResumeProgressPercentage = resumeProgressPercentage; + ResyncProgressPercentage = resyncProgressPercentage; + ResyncRetryCount = resyncRetryCount; + ResyncRequired = resyncRequired; + ResyncState = resyncState; + PerformAutoResync = performAutoResync; + ResumeRetryCount = resumeRetryCount; + LastReplicationUpdateOn = lastReplicationUpdateOn; + InstanceType = instanceType ?? "VMwareToAzStackHCI"; + } + + /// Initializes a new instance of for deserialization. + internal VMwareToAzStackHCIProtectedItemModelCustomProperties() + { + } + + /// Gets or sets the location of the protected item. + public ProtectedItemActiveLocation? ActiveLocation { get; } + /// Gets or sets the Target HCI Cluster ARM Id. + public string TargetHciClusterId { get; set; } + /// Gets or sets the Target Arc Cluster Custom Location ARM Id. + public string TargetArcClusterCustomLocationId { get; set; } + /// Gets or sets the Target AzStackHCI cluster name. + public string TargetAzStackHciClusterName { get; } + /// Gets or sets the target storage container ARM Id. + public string StorageContainerId { get; set; } + /// Gets or sets the target resource group ARM Id. + public string TargetResourceGroupId { get; set; } + /// Gets or sets the target location. + public string TargetLocation { get; } + /// Gets or sets the location of Azure Arc HCI custom location resource. + public string CustomLocationRegion { get; set; } + /// Gets or sets the list of disks to replicate. + public IList DisksToInclude { get; } + /// Gets or sets the list of VM NIC to replicate. + public IList NicsToInclude { get; } + /// Gets or sets the list of protected disks. + public IReadOnlyList ProtectedDisks { get; } + /// Gets or sets the VM NIC details. + public IReadOnlyList ProtectedNics { get; } + /// Gets or sets the BIOS Id of the target AzStackHCI VM. + public string TargetVmBiosId { get; } + /// Gets or sets the target VM display name. + public string TargetVmName { get; set; } + /// Gets or sets the hypervisor generation of the virtual machine possible values are 1,2. + public string HyperVGeneration { get; set; } + /// Gets or sets the target network Id within AzStackHCI Cluster. + public string TargetNetworkId { get; set; } + /// Gets or sets the target test network Id within AzStackHCI Cluster. + public string TestNetworkId { get; set; } + /// Gets or sets the target CPU cores. + public int? TargetCpuCores { get; set; } + /// Gets or sets a value indicating whether memory is dynamical. + public bool? IsDynamicRam { get; set; } + /// Protected item dynamic memory config. + public ProtectedItemDynamicMemoryConfig DynamicMemoryConfig { get; set; } + /// Gets or sets the target memory in mega-bytes. + public int? TargetMemoryInMegaBytes { get; set; } + /// Gets or sets the type of the OS. + public string OSType { get; } + /// Gets or sets the name of the OS. + public string OSName { get; } + /// Gets or sets the firmware type. + public string FirmwareType { get; } + /// Gets or sets the ARM Id of the discovered machine. + public string FabricDiscoveryMachineId { get; set; } + /// Gets or sets the source VM display name. + public string SourceVmName { get; } + /// Gets or sets the source VM CPU cores. + public int? SourceCpuCores { get; } + /// Gets or sets the source VM ram memory size in megabytes. + public double? SourceMemoryInMegaBytes { get; } + /// Gets or sets the run as account Id. + public string RunAsAccountId { get; set; } + /// Gets or sets the source fabric agent name. + public string SourceFabricAgentName { get; set; } + /// Gets or sets the target fabric agent name. + public string TargetFabricAgentName { get; set; } + /// Gets or sets the source appliance name. + public string SourceApplianceName { get; } + /// Gets or sets the target appliance name. + public string TargetApplianceName { get; } + /// Gets or sets the recovery point Id to which the VM was failed over. + public string FailoverRecoveryPointId { get; } + /// Gets or sets the last recovery point received time. + public DateTimeOffset? LastRecoveryPointReceived { get; } + /// Gets or sets the last recovery point Id. + public string LastRecoveryPointId { get; } + /// Gets or sets the initial replication progress percentage. This is calculated based on total bytes processed for all disks in the source VM. + public int? InitialReplicationProgressPercentage { get; } + /// Gets or sets the migration progress percentage. + public int? MigrationProgressPercentage { get; } + /// Gets or sets the resume progress percentage. + public int? ResumeProgressPercentage { get; } + /// Gets or sets the resync progress percentage. This is calculated based on total bytes processed for all disks in the source VM. + public int? ResyncProgressPercentage { get; } + /// Gets or sets the resync retry count. + public long? ResyncRetryCount { get; } + /// Gets or sets a value indicating whether resync is required. + public bool? ResyncRequired { get; } + /// Gets or sets the resync state. + public VMwareToAzureMigrateResyncState? ResyncState { get; } + /// Gets or sets a value indicating whether auto resync is to be done. + public bool? PerformAutoResync { get; set; } + /// Gets or sets the resume retry count. + public long? ResumeRetryCount { get; } + /// Gets or sets the latest timestamp that replication status is updated. + public DateTimeOffset? LastReplicationUpdateOn { get; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/VMwareToAzStackHCIProtectedItemModelCustomPropertiesUpdate.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/VMwareToAzStackHCIProtectedItemModelCustomPropertiesUpdate.Serialization.cs new file mode 100644 index 000000000000..fe3b2797f89f --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/VMwareToAzStackHCIProtectedItemModelCustomPropertiesUpdate.Serialization.cs @@ -0,0 +1,214 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + public partial class VMwareToAzStackHCIProtectedItemModelCustomPropertiesUpdate : 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(VMwareToAzStackHCIProtectedItemModelCustomPropertiesUpdate)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (Optional.IsCollectionDefined(NicsToInclude)) + { + writer.WritePropertyName("nicsToInclude"u8); + writer.WriteStartArray(); + foreach (var item in NicsToInclude) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(TargetCpuCores)) + { + writer.WritePropertyName("targetCpuCores"u8); + writer.WriteNumberValue(TargetCpuCores.Value); + } + if (Optional.IsDefined(IsDynamicRam)) + { + writer.WritePropertyName("isDynamicRam"u8); + writer.WriteBooleanValue(IsDynamicRam.Value); + } + if (Optional.IsDefined(DynamicMemoryConfig)) + { + writer.WritePropertyName("dynamicMemoryConfig"u8); + writer.WriteObjectValue(DynamicMemoryConfig, options); + } + if (Optional.IsDefined(TargetMemoryInMegaBytes)) + { + writer.WritePropertyName("targetMemoryInMegaBytes"u8); + writer.WriteNumberValue(TargetMemoryInMegaBytes.Value); + } + if (Optional.IsDefined(OSType)) + { + writer.WritePropertyName("osType"u8); + writer.WriteStringValue(OSType); + } + } + + VMwareToAzStackHCIProtectedItemModelCustomPropertiesUpdate 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(VMwareToAzStackHCIProtectedItemModelCustomPropertiesUpdate)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeVMwareToAzStackHCIProtectedItemModelCustomPropertiesUpdate(document.RootElement, options); + } + + internal static VMwareToAzStackHCIProtectedItemModelCustomPropertiesUpdate DeserializeVMwareToAzStackHCIProtectedItemModelCustomPropertiesUpdate(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IList nicsToInclude = default; + int? targetCpuCores = default; + bool? isDynamicRam = default; + ProtectedItemDynamicMemoryConfig dynamicMemoryConfig = default; + int? targetMemoryInMegaBytes = default; + string osType = default; + string instanceType = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("nicsToInclude"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(VMwareToAzStackHCINicInput.DeserializeVMwareToAzStackHCINicInput(item, options)); + } + nicsToInclude = array; + continue; + } + if (property.NameEquals("targetCpuCores"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + targetCpuCores = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("isDynamicRam"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + isDynamicRam = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("dynamicMemoryConfig"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + dynamicMemoryConfig = ProtectedItemDynamicMemoryConfig.DeserializeProtectedItemDynamicMemoryConfig(property.Value, options); + continue; + } + if (property.NameEquals("targetMemoryInMegaBytes"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + targetMemoryInMegaBytes = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("osType"u8)) + { + osType = property.Value.GetString(); + continue; + } + if (property.NameEquals("instanceType"u8)) + { + instanceType = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new VMwareToAzStackHCIProtectedItemModelCustomPropertiesUpdate( + instanceType, + serializedAdditionalRawData, + nicsToInclude ?? new ChangeTrackingList(), + targetCpuCores, + isDynamicRam, + dynamicMemoryConfig, + targetMemoryInMegaBytes, + osType); + } + + 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(VMwareToAzStackHCIProtectedItemModelCustomPropertiesUpdate)} does not support writing '{options.Format}' format."); + } + } + + VMwareToAzStackHCIProtectedItemModelCustomPropertiesUpdate IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeVMwareToAzStackHCIProtectedItemModelCustomPropertiesUpdate(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(VMwareToAzStackHCIProtectedItemModelCustomPropertiesUpdate)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/VMwareToAzStackHCIProtectedItemModelCustomPropertiesUpdate.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/VMwareToAzStackHCIProtectedItemModelCustomPropertiesUpdate.cs new file mode 100644 index 000000000000..aef73551189e --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/VMwareToAzStackHCIProtectedItemModelCustomPropertiesUpdate.cs @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + /// VMware to AzStackHCI Protected item model custom properties. + public partial class VMwareToAzStackHCIProtectedItemModelCustomPropertiesUpdate : ProtectedItemModelCustomPropertiesUpdate + { + /// Initializes a new instance of . + public VMwareToAzStackHCIProtectedItemModelCustomPropertiesUpdate() + { + NicsToInclude = new ChangeTrackingList(); + InstanceType = "VMwareToAzStackHCI"; + } + + /// Initializes a new instance of . + /// Discriminator property for ProtectedItemModelCustomPropertiesUpdate. + /// Keeps track of any properties unknown to the library. + /// Gets or sets the list of VM NIC to replicate. + /// Gets or sets the target CPU cores. + /// Gets or sets a value indicating whether memory is dynamical. + /// Protected item dynamic memory config. + /// Gets or sets the target memory in mega-bytes. + /// Gets or sets the type of the OS. + internal VMwareToAzStackHCIProtectedItemModelCustomPropertiesUpdate(string instanceType, IDictionary serializedAdditionalRawData, IList nicsToInclude, int? targetCpuCores, bool? isDynamicRam, ProtectedItemDynamicMemoryConfig dynamicMemoryConfig, int? targetMemoryInMegaBytes, string osType) : base(instanceType, serializedAdditionalRawData) + { + NicsToInclude = nicsToInclude; + TargetCpuCores = targetCpuCores; + IsDynamicRam = isDynamicRam; + DynamicMemoryConfig = dynamicMemoryConfig; + TargetMemoryInMegaBytes = targetMemoryInMegaBytes; + OSType = osType; + InstanceType = instanceType ?? "VMwareToAzStackHCI"; + } + + /// Gets or sets the list of VM NIC to replicate. + public IList NicsToInclude { get; } + /// Gets or sets the target CPU cores. + public int? TargetCpuCores { get; set; } + /// Gets or sets a value indicating whether memory is dynamical. + public bool? IsDynamicRam { get; set; } + /// Protected item dynamic memory config. + public ProtectedItemDynamicMemoryConfig DynamicMemoryConfig { get; set; } + /// Gets or sets the target memory in mega-bytes. + public int? TargetMemoryInMegaBytes { get; set; } + /// Gets or sets the type of the OS. + public string OSType { get; set; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/VMwareToAzStackHCIProtectedNicProperties.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/VMwareToAzStackHCIProtectedNicProperties.Serialization.cs new file mode 100644 index 000000000000..580178b93c3c --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/VMwareToAzStackHCIProtectedNicProperties.Serialization.cs @@ -0,0 +1,223 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + public partial class VMwareToAzStackHCIProtectedNicProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(VMwareToAzStackHCIProtectedNicProperties)} does not support writing '{format}' format."); + } + + if (options.Format != "W" && Optional.IsDefined(NicId)) + { + writer.WritePropertyName("nicId"u8); + writer.WriteStringValue(NicId); + } + if (options.Format != "W" && Optional.IsDefined(MacAddress)) + { + writer.WritePropertyName("macAddress"u8); + writer.WriteStringValue(MacAddress); + } + if (options.Format != "W" && Optional.IsDefined(Label)) + { + writer.WritePropertyName("label"u8); + writer.WriteStringValue(Label); + } + if (Optional.IsDefined(IsPrimaryNic)) + { + writer.WritePropertyName("isPrimaryNic"u8); + writer.WriteBooleanValue(IsPrimaryNic.Value); + } + if (options.Format != "W" && Optional.IsDefined(NetworkName)) + { + writer.WritePropertyName("networkName"u8); + writer.WriteStringValue(NetworkName); + } + if (options.Format != "W" && Optional.IsDefined(TargetNetworkId)) + { + writer.WritePropertyName("targetNetworkId"u8); + writer.WriteStringValue(TargetNetworkId); + } + if (options.Format != "W" && Optional.IsDefined(TestNetworkId)) + { + writer.WritePropertyName("testNetworkId"u8); + writer.WriteStringValue(TestNetworkId); + } + if (options.Format != "W" && Optional.IsDefined(SelectionTypeForFailover)) + { + writer.WritePropertyName("selectionTypeForFailover"u8); + writer.WriteStringValue(SelectionTypeForFailover.Value.ToString()); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + VMwareToAzStackHCIProtectedNicProperties 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(VMwareToAzStackHCIProtectedNicProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeVMwareToAzStackHCIProtectedNicProperties(document.RootElement, options); + } + + internal static VMwareToAzStackHCIProtectedNicProperties DeserializeVMwareToAzStackHCIProtectedNicProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string nicId = default; + string macAddress = default; + string label = default; + bool? isPrimaryNic = default; + string networkName = default; + string targetNetworkId = default; + string testNetworkId = default; + VmNicSelection? selectionTypeForFailover = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("nicId"u8)) + { + nicId = property.Value.GetString(); + continue; + } + if (property.NameEquals("macAddress"u8)) + { + macAddress = property.Value.GetString(); + continue; + } + if (property.NameEquals("label"u8)) + { + label = property.Value.GetString(); + continue; + } + if (property.NameEquals("isPrimaryNic"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + isPrimaryNic = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("networkName"u8)) + { + networkName = property.Value.GetString(); + continue; + } + if (property.NameEquals("targetNetworkId"u8)) + { + targetNetworkId = property.Value.GetString(); + continue; + } + if (property.NameEquals("testNetworkId"u8)) + { + testNetworkId = property.Value.GetString(); + continue; + } + if (property.NameEquals("selectionTypeForFailover"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + selectionTypeForFailover = new VmNicSelection(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new VMwareToAzStackHCIProtectedNicProperties( + nicId, + macAddress, + label, + isPrimaryNic, + networkName, + targetNetworkId, + testNetworkId, + selectionTypeForFailover, + 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(VMwareToAzStackHCIProtectedNicProperties)} does not support writing '{options.Format}' format."); + } + } + + VMwareToAzStackHCIProtectedNicProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeVMwareToAzStackHCIProtectedNicProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(VMwareToAzStackHCIProtectedNicProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/VMwareToAzStackHCIProtectedNicProperties.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/VMwareToAzStackHCIProtectedNicProperties.cs new file mode 100644 index 000000000000..c06ae19234b1 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/VMwareToAzStackHCIProtectedNicProperties.cs @@ -0,0 +1,93 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + /// VMwareToAzStackHCI NIC properties. + public partial class VMwareToAzStackHCIProtectedNicProperties + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + internal VMwareToAzStackHCIProtectedNicProperties() + { + } + + /// Initializes a new instance of . + /// Gets or sets the NIC Id. + /// Gets or sets the NIC mac address. + /// Gets or sets the NIC label. + /// Gets or sets a value indicating whether this is the primary NIC. + /// Gets or sets the network name. + /// Gets or sets the target network Id within AzStackHCI Cluster. + /// Gets or sets the target test network Id within AzStackHCI Cluster. + /// Gets or sets the selection type of the NIC. + /// Keeps track of any properties unknown to the library. + internal VMwareToAzStackHCIProtectedNicProperties(string nicId, string macAddress, string label, bool? isPrimaryNic, string networkName, string targetNetworkId, string testNetworkId, VmNicSelection? selectionTypeForFailover, IDictionary serializedAdditionalRawData) + { + NicId = nicId; + MacAddress = macAddress; + Label = label; + IsPrimaryNic = isPrimaryNic; + NetworkName = networkName; + TargetNetworkId = targetNetworkId; + TestNetworkId = testNetworkId; + SelectionTypeForFailover = selectionTypeForFailover; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Gets or sets the NIC Id. + public string NicId { get; } + /// Gets or sets the NIC mac address. + public string MacAddress { get; } + /// Gets or sets the NIC label. + public string Label { get; } + /// Gets or sets a value indicating whether this is the primary NIC. + public bool? IsPrimaryNic { get; } + /// Gets or sets the network name. + public string NetworkName { get; } + /// Gets or sets the target network Id within AzStackHCI Cluster. + public string TargetNetworkId { get; } + /// Gets or sets the target test network Id within AzStackHCI Cluster. + public string TestNetworkId { get; } + /// Gets or sets the selection type of the NIC. + public VmNicSelection? SelectionTypeForFailover { get; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/VMwareToAzStackHCIRecoveryPointModelCustomProperties.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/VMwareToAzStackHCIRecoveryPointModelCustomProperties.Serialization.cs new file mode 100644 index 000000000000..42e1e61681e8 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/VMwareToAzStackHCIRecoveryPointModelCustomProperties.Serialization.cs @@ -0,0 +1,135 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + public partial class VMwareToAzStackHCIRecoveryPointModelCustomProperties : 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(VMwareToAzStackHCIRecoveryPointModelCustomProperties)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (options.Format != "W" && Optional.IsCollectionDefined(DiskIds)) + { + writer.WritePropertyName("diskIds"u8); + writer.WriteStartArray(); + foreach (var item in DiskIds) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + } + + VMwareToAzStackHCIRecoveryPointModelCustomProperties 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(VMwareToAzStackHCIRecoveryPointModelCustomProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeVMwareToAzStackHCIRecoveryPointModelCustomProperties(document.RootElement, options); + } + + internal static VMwareToAzStackHCIRecoveryPointModelCustomProperties DeserializeVMwareToAzStackHCIRecoveryPointModelCustomProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IReadOnlyList diskIds = default; + string instanceType = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("diskIds"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + diskIds = array; + continue; + } + if (property.NameEquals("instanceType"u8)) + { + instanceType = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new VMwareToAzStackHCIRecoveryPointModelCustomProperties(instanceType, serializedAdditionalRawData, diskIds ?? new ChangeTrackingList()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(VMwareToAzStackHCIRecoveryPointModelCustomProperties)} does not support writing '{options.Format}' format."); + } + } + + VMwareToAzStackHCIRecoveryPointModelCustomProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeVMwareToAzStackHCIRecoveryPointModelCustomProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(VMwareToAzStackHCIRecoveryPointModelCustomProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/VMwareToAzStackHCIRecoveryPointModelCustomProperties.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/VMwareToAzStackHCIRecoveryPointModelCustomProperties.cs new file mode 100644 index 000000000000..69af75e615e1 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/VMwareToAzStackHCIRecoveryPointModelCustomProperties.cs @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + /// VMware to AzStackHCI recovery point model custom properties. + public partial class VMwareToAzStackHCIRecoveryPointModelCustomProperties : RecoveryPointModelCustomProperties + { + /// Initializes a new instance of . + internal VMwareToAzStackHCIRecoveryPointModelCustomProperties() + { + DiskIds = new ChangeTrackingList(); + InstanceType = "VMwareToAzStackHCIRecoveryPointModelCustomProperties"; + } + + /// Initializes a new instance of . + /// Discriminator property for RecoveryPointModelCustomProperties. + /// Keeps track of any properties unknown to the library. + /// Gets or sets the list of the disk Ids. + internal VMwareToAzStackHCIRecoveryPointModelCustomProperties(string instanceType, IDictionary serializedAdditionalRawData, IReadOnlyList diskIds) : base(instanceType, serializedAdditionalRawData) + { + DiskIds = diskIds; + InstanceType = instanceType ?? "VMwareToAzStackHCIRecoveryPointModelCustomProperties"; + } + + /// Gets or sets the list of the disk Ids. + public IReadOnlyList DiskIds { get; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/VMwareToAzStackHCIReplicationExtensionModelCustomProperties.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/VMwareToAzStackHCIReplicationExtensionModelCustomProperties.Serialization.cs new file mode 100644 index 000000000000..71799723371b --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/VMwareToAzStackHCIReplicationExtensionModelCustomProperties.Serialization.cs @@ -0,0 +1,298 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + public partial class VMwareToAzStackHCIReplicationExtensionModelCustomProperties : 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(VMwareToAzStackHCIReplicationExtensionModelCustomProperties)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + writer.WritePropertyName("vmwareFabricArmId"u8); + writer.WriteStringValue(VmwareFabricArmId); + if (options.Format != "W" && Optional.IsDefined(VmwareSiteId)) + { + writer.WritePropertyName("vmwareSiteId"u8); + writer.WriteStringValue(VmwareSiteId); + } + writer.WritePropertyName("azStackHciFabricArmId"u8); + writer.WriteStringValue(AzStackHciFabricArmId); + if (options.Format != "W" && Optional.IsDefined(AzStackHciSiteId)) + { + writer.WritePropertyName("azStackHciSiteId"u8); + writer.WriteStringValue(AzStackHciSiteId); + } + if (Optional.IsDefined(StorageAccountId)) + { + writer.WritePropertyName("storageAccountId"u8); + writer.WriteStringValue(StorageAccountId); + } + if (Optional.IsDefined(StorageAccountSasSecretName)) + { + writer.WritePropertyName("storageAccountSasSecretName"u8); + writer.WriteStringValue(StorageAccountSasSecretName); + } + if (options.Format != "W" && Optional.IsDefined(AsrServiceUri)) + { + writer.WritePropertyName("asrServiceUri"u8); + writer.WriteStringValue(AsrServiceUri); + } + if (options.Format != "W" && Optional.IsDefined(RcmServiceUri)) + { + writer.WritePropertyName("rcmServiceUri"u8); + writer.WriteStringValue(RcmServiceUri); + } + if (options.Format != "W" && Optional.IsDefined(GatewayServiceUri)) + { + writer.WritePropertyName("gatewayServiceUri"u8); + writer.WriteStringValue(GatewayServiceUri); + } + if (options.Format != "W" && Optional.IsDefined(SourceGatewayServiceId)) + { + writer.WritePropertyName("sourceGatewayServiceId"u8); + writer.WriteStringValue(SourceGatewayServiceId); + } + if (options.Format != "W" && Optional.IsDefined(TargetGatewayServiceId)) + { + writer.WritePropertyName("targetGatewayServiceId"u8); + writer.WriteStringValue(TargetGatewayServiceId); + } + if (options.Format != "W" && Optional.IsDefined(SourceStorageContainerName)) + { + writer.WritePropertyName("sourceStorageContainerName"u8); + writer.WriteStringValue(SourceStorageContainerName); + } + if (options.Format != "W" && Optional.IsDefined(TargetStorageContainerName)) + { + writer.WritePropertyName("targetStorageContainerName"u8); + writer.WriteStringValue(TargetStorageContainerName); + } + if (options.Format != "W" && Optional.IsDefined(ResourceLocation)) + { + writer.WritePropertyName("resourceLocation"u8); + writer.WriteStringValue(ResourceLocation); + } + if (options.Format != "W" && Optional.IsDefined(SubscriptionId)) + { + writer.WritePropertyName("subscriptionId"u8); + writer.WriteStringValue(SubscriptionId); + } + if (options.Format != "W" && Optional.IsDefined(ResourceGroup)) + { + writer.WritePropertyName("resourceGroup"u8); + writer.WriteStringValue(ResourceGroup); + } + } + + VMwareToAzStackHCIReplicationExtensionModelCustomProperties 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(VMwareToAzStackHCIReplicationExtensionModelCustomProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeVMwareToAzStackHCIReplicationExtensionModelCustomProperties(document.RootElement, options); + } + + internal static VMwareToAzStackHCIReplicationExtensionModelCustomProperties DeserializeVMwareToAzStackHCIReplicationExtensionModelCustomProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string vmwareFabricArmId = default; + string vmwareSiteId = default; + string azStackHciFabricArmId = default; + string azStackHciSiteId = default; + string storageAccountId = default; + string storageAccountSasSecretName = default; + string asrServiceUri = default; + string rcmServiceUri = default; + string gatewayServiceUri = default; + string sourceGatewayServiceId = default; + string targetGatewayServiceId = default; + string sourceStorageContainerName = default; + string targetStorageContainerName = default; + string resourceLocation = default; + string subscriptionId = default; + string resourceGroup = default; + string instanceType = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("vmwareFabricArmId"u8)) + { + vmwareFabricArmId = property.Value.GetString(); + continue; + } + if (property.NameEquals("vmwareSiteId"u8)) + { + vmwareSiteId = property.Value.GetString(); + continue; + } + if (property.NameEquals("azStackHciFabricArmId"u8)) + { + azStackHciFabricArmId = property.Value.GetString(); + continue; + } + if (property.NameEquals("azStackHciSiteId"u8)) + { + azStackHciSiteId = property.Value.GetString(); + continue; + } + if (property.NameEquals("storageAccountId"u8)) + { + storageAccountId = property.Value.GetString(); + continue; + } + if (property.NameEquals("storageAccountSasSecretName"u8)) + { + storageAccountSasSecretName = property.Value.GetString(); + continue; + } + if (property.NameEquals("asrServiceUri"u8)) + { + asrServiceUri = property.Value.GetString(); + continue; + } + if (property.NameEquals("rcmServiceUri"u8)) + { + rcmServiceUri = property.Value.GetString(); + continue; + } + if (property.NameEquals("gatewayServiceUri"u8)) + { + gatewayServiceUri = property.Value.GetString(); + continue; + } + if (property.NameEquals("sourceGatewayServiceId"u8)) + { + sourceGatewayServiceId = property.Value.GetString(); + continue; + } + if (property.NameEquals("targetGatewayServiceId"u8)) + { + targetGatewayServiceId = property.Value.GetString(); + continue; + } + if (property.NameEquals("sourceStorageContainerName"u8)) + { + sourceStorageContainerName = property.Value.GetString(); + continue; + } + if (property.NameEquals("targetStorageContainerName"u8)) + { + targetStorageContainerName = property.Value.GetString(); + continue; + } + if (property.NameEquals("resourceLocation"u8)) + { + resourceLocation = property.Value.GetString(); + continue; + } + if (property.NameEquals("subscriptionId"u8)) + { + subscriptionId = property.Value.GetString(); + continue; + } + if (property.NameEquals("resourceGroup"u8)) + { + resourceGroup = property.Value.GetString(); + continue; + } + if (property.NameEquals("instanceType"u8)) + { + instanceType = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new VMwareToAzStackHCIReplicationExtensionModelCustomProperties( + instanceType, + serializedAdditionalRawData, + vmwareFabricArmId, + vmwareSiteId, + azStackHciFabricArmId, + azStackHciSiteId, + storageAccountId, + storageAccountSasSecretName, + asrServiceUri, + rcmServiceUri, + gatewayServiceUri, + sourceGatewayServiceId, + targetGatewayServiceId, + sourceStorageContainerName, + targetStorageContainerName, + resourceLocation, + subscriptionId, + resourceGroup); + } + + 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(VMwareToAzStackHCIReplicationExtensionModelCustomProperties)} does not support writing '{options.Format}' format."); + } + } + + VMwareToAzStackHCIReplicationExtensionModelCustomProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeVMwareToAzStackHCIReplicationExtensionModelCustomProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(VMwareToAzStackHCIReplicationExtensionModelCustomProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/VMwareToAzStackHCIReplicationExtensionModelCustomProperties.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/VMwareToAzStackHCIReplicationExtensionModelCustomProperties.cs new file mode 100644 index 000000000000..14956f628d61 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/VMwareToAzStackHCIReplicationExtensionModelCustomProperties.cs @@ -0,0 +1,108 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + /// VMware to AzStackHCI Replication extension model custom properties. + public partial class VMwareToAzStackHCIReplicationExtensionModelCustomProperties : ReplicationExtensionModelCustomProperties + { + /// Initializes a new instance of . + /// Gets or sets the ARM Id of the source VMware fabric. + /// Gets or sets the ARM Id of the target AzStackHCI fabric. + /// or is null. + public VMwareToAzStackHCIReplicationExtensionModelCustomProperties(string vmwareFabricArmId, string azStackHciFabricArmId) + { + Argument.AssertNotNull(vmwareFabricArmId, nameof(vmwareFabricArmId)); + Argument.AssertNotNull(azStackHciFabricArmId, nameof(azStackHciFabricArmId)); + + VmwareFabricArmId = vmwareFabricArmId; + AzStackHciFabricArmId = azStackHciFabricArmId; + InstanceType = "VMwareToAzStackHCI"; + } + + /// Initializes a new instance of . + /// Discriminator property for ReplicationExtensionModelCustomProperties. + /// Keeps track of any properties unknown to the library. + /// Gets or sets the ARM Id of the source VMware fabric. + /// Gets or sets the ARM Id of the VMware site. + /// Gets or sets the ARM Id of the target AzStackHCI fabric. + /// Gets or sets the ARM Id of the AzStackHCI site. + /// Gets or sets the storage account Id. + /// Gets or sets the Sas Secret of storage account. + /// Gets or sets the Uri of ASR. + /// Gets or sets the Uri of Rcm. + /// Gets or sets the Uri of Gateway. + /// Gets or sets the gateway service Id of source. + /// Gets or sets the gateway service Id of target. + /// Gets or sets the source storage container name. + /// Gets or sets the target storage container name. + /// Gets or sets the resource location. + /// Gets or sets the subscription. + /// Gets or sets the resource group. + internal VMwareToAzStackHCIReplicationExtensionModelCustomProperties(string instanceType, IDictionary serializedAdditionalRawData, string vmwareFabricArmId, string vmwareSiteId, string azStackHciFabricArmId, string azStackHciSiteId, string storageAccountId, string storageAccountSasSecretName, string asrServiceUri, string rcmServiceUri, string gatewayServiceUri, string sourceGatewayServiceId, string targetGatewayServiceId, string sourceStorageContainerName, string targetStorageContainerName, string resourceLocation, string subscriptionId, string resourceGroup) : base(instanceType, serializedAdditionalRawData) + { + VmwareFabricArmId = vmwareFabricArmId; + VmwareSiteId = vmwareSiteId; + AzStackHciFabricArmId = azStackHciFabricArmId; + AzStackHciSiteId = azStackHciSiteId; + StorageAccountId = storageAccountId; + StorageAccountSasSecretName = storageAccountSasSecretName; + AsrServiceUri = asrServiceUri; + RcmServiceUri = rcmServiceUri; + GatewayServiceUri = gatewayServiceUri; + SourceGatewayServiceId = sourceGatewayServiceId; + TargetGatewayServiceId = targetGatewayServiceId; + SourceStorageContainerName = sourceStorageContainerName; + TargetStorageContainerName = targetStorageContainerName; + ResourceLocation = resourceLocation; + SubscriptionId = subscriptionId; + ResourceGroup = resourceGroup; + InstanceType = instanceType ?? "VMwareToAzStackHCI"; + } + + /// Initializes a new instance of for deserialization. + internal VMwareToAzStackHCIReplicationExtensionModelCustomProperties() + { + } + + /// Gets or sets the ARM Id of the source VMware fabric. + public string VmwareFabricArmId { get; set; } + /// Gets or sets the ARM Id of the VMware site. + public string VmwareSiteId { get; } + /// Gets or sets the ARM Id of the target AzStackHCI fabric. + public string AzStackHciFabricArmId { get; set; } + /// Gets or sets the ARM Id of the AzStackHCI site. + public string AzStackHciSiteId { get; } + /// Gets or sets the storage account Id. + public string StorageAccountId { get; set; } + /// Gets or sets the Sas Secret of storage account. + public string StorageAccountSasSecretName { get; set; } + /// Gets or sets the Uri of ASR. + public string AsrServiceUri { get; } + /// Gets or sets the Uri of Rcm. + public string RcmServiceUri { get; } + /// Gets or sets the Uri of Gateway. + public string GatewayServiceUri { get; } + /// Gets or sets the gateway service Id of source. + public string SourceGatewayServiceId { get; } + /// Gets or sets the gateway service Id of target. + public string TargetGatewayServiceId { get; } + /// Gets or sets the source storage container name. + public string SourceStorageContainerName { get; } + /// Gets or sets the target storage container name. + public string TargetStorageContainerName { get; } + /// Gets or sets the resource location. + public string ResourceLocation { get; } + /// Gets or sets the subscription. + public string SubscriptionId { get; } + /// Gets or sets the resource group. + public string ResourceGroup { get; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/VMwareToAzureMigrateResyncState.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/VMwareToAzureMigrateResyncState.cs new file mode 100644 index 000000000000..86cd45ebfb00 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/VMwareToAzureMigrateResyncState.cs @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + /// Gets or sets the resync state. + public readonly partial struct VMwareToAzureMigrateResyncState : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public VMwareToAzureMigrateResyncState(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string NoneValue = "None"; + private const string PreparedForResynchronizationValue = "PreparedForResynchronization"; + private const string StartedResynchronizationValue = "StartedResynchronization"; + + /// None state. + public static VMwareToAzureMigrateResyncState None { get; } = new VMwareToAzureMigrateResyncState(NoneValue); + /// Prepared for resynchronization state. + public static VMwareToAzureMigrateResyncState PreparedForResynchronization { get; } = new VMwareToAzureMigrateResyncState(PreparedForResynchronizationValue); + /// Started resynchronization state. + public static VMwareToAzureMigrateResyncState StartedResynchronization { get; } = new VMwareToAzureMigrateResyncState(StartedResynchronizationValue); + /// Determines if two values are the same. + public static bool operator ==(VMwareToAzureMigrateResyncState left, VMwareToAzureMigrateResyncState right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(VMwareToAzureMigrateResyncState left, VMwareToAzureMigrateResyncState right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator VMwareToAzureMigrateResyncState(string value) => new VMwareToAzureMigrateResyncState(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is VMwareToAzureMigrateResyncState other && Equals(other); + /// + public bool Equals(VMwareToAzureMigrateResyncState other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/VaultModelListResult.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/VaultModelListResult.Serialization.cs new file mode 100644 index 000000000000..1c3f18c90e23 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/VaultModelListResult.Serialization.cs @@ -0,0 +1,151 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + internal partial class VaultModelListResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(VaultModelListResult)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var item in Value) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + if (Optional.IsDefined(NextLink)) + { + writer.WritePropertyName("nextLink"u8); + writer.WriteStringValue(NextLink.AbsoluteUri); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + VaultModelListResult 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(VaultModelListResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeVaultModelListResult(document.RootElement, options); + } + + internal static VaultModelListResult DeserializeVaultModelListResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IReadOnlyList value = default; + Uri nextLink = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(VaultModelData.DeserializeVaultModelData(item, options)); + } + value = array; + continue; + } + if (property.NameEquals("nextLink"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + nextLink = new Uri(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new VaultModelListResult(value, nextLink, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(VaultModelListResult)} does not support writing '{options.Format}' format."); + } + } + + VaultModelListResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeVaultModelListResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(VaultModelListResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/VaultModelListResult.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/VaultModelListResult.cs new file mode 100644 index 000000000000..3bb8fc127f30 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/VaultModelListResult.cs @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + /// The response of a VaultModel list operation. + internal partial class VaultModelListResult + { + /// + /// 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 VaultModel items on this page. + /// is null. + internal VaultModelListResult(IEnumerable value) + { + Argument.AssertNotNull(value, nameof(value)); + + Value = value.ToList(); + } + + /// Initializes a new instance of . + /// The VaultModel items on this page. + /// The link to the next page of items. + /// Keeps track of any properties unknown to the library. + internal VaultModelListResult(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) + { + Value = value; + NextLink = nextLink; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal VaultModelListResult() + { + } + + /// The VaultModel items on this page. + public IReadOnlyList Value { get; } + /// The link to the next page of items. + public Uri NextLink { get; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/VaultModelPatch.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/VaultModelPatch.Serialization.cs new file mode 100644 index 000000000000..ec2ca60abe40 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/VaultModelPatch.Serialization.cs @@ -0,0 +1,197 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + public partial class VaultModelPatch : 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(VaultModelPatch)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (Optional.IsCollectionDefined(Tags)) + { + writer.WritePropertyName("tags"u8); + writer.WriteStartObject(); + foreach (var item in Tags) + { + writer.WritePropertyName(item.Key); + writer.WriteStringValue(item.Value); + } + writer.WriteEndObject(); + } + if (Optional.IsDefined(Properties)) + { + writer.WritePropertyName("properties"u8); + writer.WriteObjectValue(Properties, options); + } + if (Optional.IsDefined(Identity)) + { + writer.WritePropertyName("identity"u8); + JsonSerializer.Serialize(writer, Identity); + } + } + + VaultModelPatch 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(VaultModelPatch)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeVaultModelPatch(document.RootElement, options); + } + + internal static VaultModelPatch DeserializeVaultModelPatch(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IDictionary tags = default; + VaultModelProperties properties = default; + ManagedServiceIdentity identity = 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("tags"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var property0 in property.Value.EnumerateObject()) + { + dictionary.Add(property0.Name, property0.Value.GetString()); + } + tags = dictionary; + continue; + } + if (property.NameEquals("properties"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + properties = VaultModelProperties.DeserializeVaultModelProperties(property.Value, options); + continue; + } + if (property.NameEquals("identity"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + identity = JsonSerializer.Deserialize(property.Value.GetRawText()); + 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 VaultModelPatch( + id, + name, + type, + systemData, + tags ?? new ChangeTrackingDictionary(), + 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(VaultModelPatch)} does not support writing '{options.Format}' format."); + } + } + + VaultModelPatch IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeVaultModelPatch(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(VaultModelPatch)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/VaultModelPatch.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/VaultModelPatch.cs new file mode 100644 index 000000000000..cf2cedb44fc5 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/VaultModelPatch.cs @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + /// Vault model update. + public partial class VaultModelPatch : 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 VaultModelPatch() + { + Tags = new ChangeTrackingDictionary(); + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// Gets or sets the resource tags. + /// Vault properties. + /// Vault identity. Current supported identity types: None, SystemAssigned, UserAssigned. + /// Keeps track of any properties unknown to the library. + internal VaultModelPatch(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, VaultModelProperties properties, ManagedServiceIdentity identity, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) + { + Tags = tags; + Properties = properties; + Identity = identity; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Gets or sets the resource tags. + public IDictionary Tags { get; } + /// Vault properties. + public VaultModelProperties Properties { get; set; } + /// Vault identity. Current supported identity types: None, SystemAssigned, UserAssigned. + public ManagedServiceIdentity Identity { get; set; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/VaultModelProperties.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/VaultModelProperties.Serialization.cs new file mode 100644 index 000000000000..c70ecb6b80ac --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/VaultModelProperties.Serialization.cs @@ -0,0 +1,159 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + public partial class VaultModelProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(VaultModelProperties)} does not support writing '{format}' format."); + } + + if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) + { + writer.WritePropertyName("provisioningState"u8); + writer.WriteStringValue(ProvisioningState.Value.ToString()); + } + if (options.Format != "W" && Optional.IsDefined(ServiceResourceId)) + { + writer.WritePropertyName("serviceResourceId"u8); + writer.WriteStringValue(ServiceResourceId); + } + if (Optional.IsDefined(VaultType)) + { + writer.WritePropertyName("vaultType"u8); + writer.WriteStringValue(VaultType.Value.ToString()); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + VaultModelProperties 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(VaultModelProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeVaultModelProperties(document.RootElement, options); + } + + internal static VaultModelProperties DeserializeVaultModelProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ProvisioningState? provisioningState = default; + string serviceResourceId = default; + ReplicationVaultType? vaultType = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("provisioningState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + provisioningState = new ProvisioningState(property.Value.GetString()); + continue; + } + if (property.NameEquals("serviceResourceId"u8)) + { + serviceResourceId = property.Value.GetString(); + continue; + } + if (property.NameEquals("vaultType"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + vaultType = new ReplicationVaultType(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new VaultModelProperties(provisioningState, serviceResourceId, vaultType, 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(VaultModelProperties)} does not support writing '{options.Format}' format."); + } + } + + VaultModelProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeVaultModelProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(VaultModelProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/VaultModelProperties.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/VaultModelProperties.cs new file mode 100644 index 000000000000..6348e470bcc4 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/VaultModelProperties.cs @@ -0,0 +1,73 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + /// Vault properties. + public partial class VaultModelProperties + { + /// + /// 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 VaultModelProperties() + { + } + + /// Initializes a new instance of . + /// Gets or sets the provisioning state of the vault. + /// Gets or sets the service resource Id. + /// Gets or sets the type of vault. + /// Keeps track of any properties unknown to the library. + internal VaultModelProperties(ProvisioningState? provisioningState, string serviceResourceId, ReplicationVaultType? vaultType, IDictionary serializedAdditionalRawData) + { + ProvisioningState = provisioningState; + ServiceResourceId = serviceResourceId; + VaultType = vaultType; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Gets or sets the provisioning state of the vault. + public ProvisioningState? ProvisioningState { get; } + /// Gets or sets the service resource Id. + public string ServiceResourceId { get; } + /// Gets or sets the type of vault. + public ReplicationVaultType? VaultType { get; set; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/VmNicSelection.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/VmNicSelection.cs new file mode 100644 index 000000000000..1b7b81e237db --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/VmNicSelection.cs @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + /// Gets or sets the selection type of the NIC. + public readonly partial struct VmNicSelection : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public VmNicSelection(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string NotSelectedValue = "NotSelected"; + private const string SelectedByUserValue = "SelectedByUser"; + private const string SelectedByDefaultValue = "SelectedByDefault"; + private const string SelectedByUserOverrideValue = "SelectedByUserOverride"; + + /// Not Selected. + public static VmNicSelection NotSelected { get; } = new VmNicSelection(NotSelectedValue); + /// Selected by user. + public static VmNicSelection SelectedByUser { get; } = new VmNicSelection(SelectedByUserValue); + /// Default selection by ASR. + public static VmNicSelection SelectedByDefault { get; } = new VmNicSelection(SelectedByDefaultValue); + /// NIC configuration overridden by user. Differs from SelectedByUser in the sense that the legacy SelectedByUser is used both for explicit modification by user and implicit approval of user if the settings are used for TFO/FO. SelectedByUserOverride implies user overriding at least one of the configurations. + public static VmNicSelection SelectedByUserOverride { get; } = new VmNicSelection(SelectedByUserOverrideValue); + /// Determines if two values are the same. + public static bool operator ==(VmNicSelection left, VmNicSelection right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(VmNicSelection left, VmNicSelection right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator VmNicSelection(string value) => new VmNicSelection(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is VmNicSelection other && Equals(other); + /// + public bool Equals(VmNicSelection other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/PolicyModelCollection.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/PolicyModelCollection.cs new file mode 100644 index 000000000000..189c46e5ba87 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/PolicyModelCollection.cs @@ -0,0 +1,493 @@ +// 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.RecoveryServicesDataReplication +{ + /// + /// 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 GetPolicyModels method from an instance of . + /// + public partial class PolicyModelCollection : ArmCollection, IEnumerable, IAsyncEnumerable + { + private readonly ClientDiagnostics _policyModelPolicyClientDiagnostics; + private readonly PolicyRestOperations _policyModelPolicyRestClient; + + /// Initializes a new instance of the class for mocking. + protected PolicyModelCollection() + { + } + + /// 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 PolicyModelCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _policyModelPolicyClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.RecoveryServicesDataReplication", PolicyModelResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(PolicyModelResource.ResourceType, out string policyModelPolicyApiVersion); + _policyModelPolicyRestClient = new PolicyRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, policyModelPolicyApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != VaultModelResource.ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, VaultModelResource.ResourceType), nameof(id)); + } + + /// + /// Creates the policy. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/replicationPolicies/{policyName} + /// + /// + /// Operation Id + /// PolicyModel_Create + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// 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 policy name. + /// Policy model. + /// 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 policyName, PolicyModelData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(policyName, nameof(policyName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _policyModelPolicyClientDiagnostics.CreateScope("PolicyModelCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = await _policyModelPolicyRestClient.CreateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, policyName, data, cancellationToken).ConfigureAwait(false); + var operation = new RecoveryServicesDataReplicationArmOperation(new PolicyModelOperationSource(Client), _policyModelPolicyClientDiagnostics, Pipeline, _policyModelPolicyRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, policyName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Creates the policy. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/replicationPolicies/{policyName} + /// + /// + /// Operation Id + /// PolicyModel_Create + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// 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 policy name. + /// Policy model. + /// 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 policyName, PolicyModelData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(policyName, nameof(policyName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _policyModelPolicyClientDiagnostics.CreateScope("PolicyModelCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = _policyModelPolicyRestClient.Create(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, policyName, data, cancellationToken); + var operation = new RecoveryServicesDataReplicationArmOperation(new PolicyModelOperationSource(Client), _policyModelPolicyClientDiagnostics, Pipeline, _policyModelPolicyRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, policyName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets the details of the policy. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/replicationPolicies/{policyName} + /// + /// + /// Operation Id + /// PolicyModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The policy name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetAsync(string policyName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(policyName, nameof(policyName)); + + using var scope = _policyModelPolicyClientDiagnostics.CreateScope("PolicyModelCollection.Get"); + scope.Start(); + try + { + var response = await _policyModelPolicyRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, policyName, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new PolicyModelResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets the details of the policy. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/replicationPolicies/{policyName} + /// + /// + /// Operation Id + /// PolicyModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The policy name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Get(string policyName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(policyName, nameof(policyName)); + + using var scope = _policyModelPolicyClientDiagnostics.CreateScope("PolicyModelCollection.Get"); + scope.Start(); + try + { + var response = _policyModelPolicyRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, policyName, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new PolicyModelResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets the list of policies in the given vault. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/replicationPolicies + /// + /// + /// Operation Id + /// PolicyModel_List + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// 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) => _policyModelPolicyRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _policyModelPolicyRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new PolicyModelResource(Client, PolicyModelData.DeserializePolicyModelData(e)), _policyModelPolicyClientDiagnostics, Pipeline, "PolicyModelCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Gets the list of policies in the given vault. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/replicationPolicies + /// + /// + /// Operation Id + /// PolicyModel_List + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// 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) => _policyModelPolicyRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _policyModelPolicyRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new PolicyModelResource(Client, PolicyModelData.DeserializePolicyModelData(e)), _policyModelPolicyClientDiagnostics, Pipeline, "PolicyModelCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/replicationPolicies/{policyName} + /// + /// + /// Operation Id + /// PolicyModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The policy name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> ExistsAsync(string policyName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(policyName, nameof(policyName)); + + using var scope = _policyModelPolicyClientDiagnostics.CreateScope("PolicyModelCollection.Exists"); + scope.Start(); + try + { + var response = await _policyModelPolicyRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, policyName, 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.DataReplication/replicationVaults/{vaultName}/replicationPolicies/{policyName} + /// + /// + /// Operation Id + /// PolicyModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The policy name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Exists(string policyName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(policyName, nameof(policyName)); + + using var scope = _policyModelPolicyClientDiagnostics.CreateScope("PolicyModelCollection.Exists"); + scope.Start(); + try + { + var response = _policyModelPolicyRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, policyName, 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.DataReplication/replicationVaults/{vaultName}/replicationPolicies/{policyName} + /// + /// + /// Operation Id + /// PolicyModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The policy name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetIfExistsAsync(string policyName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(policyName, nameof(policyName)); + + using var scope = _policyModelPolicyClientDiagnostics.CreateScope("PolicyModelCollection.GetIfExists"); + scope.Start(); + try + { + var response = await _policyModelPolicyRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, policyName, cancellationToken: cancellationToken).ConfigureAwait(false); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new PolicyModelResource(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.DataReplication/replicationVaults/{vaultName}/replicationPolicies/{policyName} + /// + /// + /// Operation Id + /// PolicyModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The policy name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual NullableResponse GetIfExists(string policyName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(policyName, nameof(policyName)); + + using var scope = _policyModelPolicyClientDiagnostics.CreateScope("PolicyModelCollection.GetIfExists"); + scope.Start(); + try + { + var response = _policyModelPolicyRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, policyName, cancellationToken: cancellationToken); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new PolicyModelResource(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/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/PolicyModelData.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/PolicyModelData.Serialization.cs new file mode 100644 index 000000000000..6d9bd1e90e66 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/PolicyModelData.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.Models; +using Azure.ResourceManager.RecoveryServicesDataReplication.Models; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication +{ + public partial class PolicyModelData : 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(PolicyModelData)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (Optional.IsDefined(Properties)) + { + writer.WritePropertyName("properties"u8); + writer.WriteObjectValue(Properties, options); + } + } + + PolicyModelData 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(PolicyModelData)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializePolicyModelData(document.RootElement, options); + } + + internal static PolicyModelData DeserializePolicyModelData(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + PolicyModelProperties 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 = PolicyModelProperties.DeserializePolicyModelProperties(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 PolicyModelData( + 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(PolicyModelData)} does not support writing '{options.Format}' format."); + } + } + + PolicyModelData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializePolicyModelData(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(PolicyModelData)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/PolicyModelData.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/PolicyModelData.cs new file mode 100644 index 000000000000..f3d195ab107a --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/PolicyModelData.cs @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; +using Azure.ResourceManager.Models; +using Azure.ResourceManager.RecoveryServicesDataReplication.Models; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication +{ + /// + /// A class representing the PolicyModel data model. + /// Policy model. + /// + public partial class PolicyModelData : 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 PolicyModelData() + { + } + + /// 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 PolicyModelData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, PolicyModelProperties properties, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) + { + Properties = properties; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The resource-specific properties for this resource. + public PolicyModelProperties Properties { get; set; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/PolicyModelResource.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/PolicyModelResource.Serialization.cs new file mode 100644 index 000000000000..c3524dfcd952 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/PolicyModelResource.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.RecoveryServicesDataReplication +{ + public partial class PolicyModelResource : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); + + PolicyModelData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options); + + PolicyModelData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options); + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/PolicyModelResource.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/PolicyModelResource.cs new file mode 100644 index 000000000000..89d03722187e --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/PolicyModelResource.cs @@ -0,0 +1,347 @@ +// 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.RecoveryServicesDataReplication +{ + /// + /// A Class representing a PolicyModel 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 GetPolicyModelResource method. + /// Otherwise you can get one from its parent resource using the GetPolicyModel method. + /// + public partial class PolicyModelResource : ArmResource + { + /// Generate the resource identifier of a instance. + /// The subscriptionId. + /// The resourceGroupName. + /// The vaultName. + /// The policyName. + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string vaultName, string policyName) + { + var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/replicationPolicies/{policyName}"; + return new ResourceIdentifier(resourceId); + } + + private readonly ClientDiagnostics _policyModelPolicyClientDiagnostics; + private readonly PolicyRestOperations _policyModelPolicyRestClient; + private readonly PolicyModelData _data; + + /// Gets the resource type for the operations. + public static readonly ResourceType ResourceType = "Microsoft.DataReplication/replicationVaults/replicationPolicies"; + + /// Initializes a new instance of the class for mocking. + protected PolicyModelResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal PolicyModelResource(ArmClient client, PolicyModelData 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 PolicyModelResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _policyModelPolicyClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.RecoveryServicesDataReplication", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string policyModelPolicyApiVersion); + _policyModelPolicyRestClient = new PolicyRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, policyModelPolicyApiVersion); +#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 PolicyModelData 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)); + } + + /// + /// Gets the details of the policy. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/replicationPolicies/{policyName} + /// + /// + /// Operation Id + /// PolicyModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _policyModelPolicyClientDiagnostics.CreateScope("PolicyModelResource.Get"); + scope.Start(); + try + { + var response = await _policyModelPolicyRestClient.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 PolicyModelResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets the details of the policy. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/replicationPolicies/{policyName} + /// + /// + /// Operation Id + /// PolicyModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _policyModelPolicyClientDiagnostics.CreateScope("PolicyModelResource.Get"); + scope.Start(); + try + { + var response = _policyModelPolicyRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new PolicyModelResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Removes the policy. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/replicationPolicies/{policyName} + /// + /// + /// Operation Id + /// PolicyModel_Delete + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// 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 = _policyModelPolicyClientDiagnostics.CreateScope("PolicyModelResource.Delete"); + scope.Start(); + try + { + var response = await _policyModelPolicyRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + var operation = new RecoveryServicesDataReplicationArmOperation(_policyModelPolicyClientDiagnostics, Pipeline, _policyModelPolicyRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Removes the policy. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/replicationPolicies/{policyName} + /// + /// + /// Operation Id + /// PolicyModel_Delete + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// 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 = _policyModelPolicyClientDiagnostics.CreateScope("PolicyModelResource.Delete"); + scope.Start(); + try + { + var response = _policyModelPolicyRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + var operation = new RecoveryServicesDataReplicationArmOperation(_policyModelPolicyClientDiagnostics, Pipeline, _policyModelPolicyRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletionResponse(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Creates the policy. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/replicationPolicies/{policyName} + /// + /// + /// Operation Id + /// PolicyModel_Create + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// 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. + /// Policy model. + /// The cancellation token to use. + /// is null. + public virtual async Task> UpdateAsync(WaitUntil waitUntil, PolicyModelData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _policyModelPolicyClientDiagnostics.CreateScope("PolicyModelResource.Update"); + scope.Start(); + try + { + var response = await _policyModelPolicyRestClient.CreateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, cancellationToken).ConfigureAwait(false); + var operation = new RecoveryServicesDataReplicationArmOperation(new PolicyModelOperationSource(Client), _policyModelPolicyClientDiagnostics, Pipeline, _policyModelPolicyRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Creates the policy. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/replicationPolicies/{policyName} + /// + /// + /// Operation Id + /// PolicyModel_Create + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// 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. + /// Policy model. + /// The cancellation token to use. + /// is null. + public virtual ArmOperation Update(WaitUntil waitUntil, PolicyModelData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _policyModelPolicyClientDiagnostics.CreateScope("PolicyModelResource.Update"); + scope.Start(); + try + { + var response = _policyModelPolicyRestClient.Create(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, cancellationToken); + var operation = new RecoveryServicesDataReplicationArmOperation(new PolicyModelOperationSource(Client), _policyModelPolicyClientDiagnostics, Pipeline, _policyModelPolicyRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/PrivateEndpointConnectionProxyCollection.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/PrivateEndpointConnectionProxyCollection.cs new file mode 100644 index 000000000000..0a97ba42d708 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/PrivateEndpointConnectionProxyCollection.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.RecoveryServicesDataReplication +{ + /// + /// 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 GetPrivateEndpointConnectionProxies method from an instance of . + /// + public partial class PrivateEndpointConnectionProxyCollection : ArmCollection, IEnumerable, IAsyncEnumerable + { + private readonly ClientDiagnostics _privateEndpointConnectionProxyClientDiagnostics; + private readonly PrivateEndpointConnectionProxiesRestOperations _privateEndpointConnectionProxyRestClient; + + /// Initializes a new instance of the class for mocking. + protected PrivateEndpointConnectionProxyCollection() + { + } + + /// 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 PrivateEndpointConnectionProxyCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _privateEndpointConnectionProxyClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.RecoveryServicesDataReplication", PrivateEndpointConnectionProxyResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(PrivateEndpointConnectionProxyResource.ResourceType, out string privateEndpointConnectionProxyApiVersion); + _privateEndpointConnectionProxyRestClient = new PrivateEndpointConnectionProxiesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, privateEndpointConnectionProxyApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != VaultModelResource.ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, VaultModelResource.ResourceType), nameof(id)); + } + + /// + /// Create a new private endpoint connection proxy which includes both auto and manual approval types. Creating the proxy resource will also create a private endpoint connection resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/privateEndpointConnectionProxies/{privateEndpointConnectionProxyName} + /// + /// + /// Operation Id + /// PrivateEndpointConnectionProxy_Create + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// 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 private endpoint connection proxy name. + /// Private endpoint connection creation input. + /// 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 privateEndpointConnectionProxyName, PrivateEndpointConnectionProxyData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(privateEndpointConnectionProxyName, nameof(privateEndpointConnectionProxyName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _privateEndpointConnectionProxyClientDiagnostics.CreateScope("PrivateEndpointConnectionProxyCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = await _privateEndpointConnectionProxyRestClient.CreateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, privateEndpointConnectionProxyName, data, cancellationToken).ConfigureAwait(false); + var uri = _privateEndpointConnectionProxyRestClient.CreateCreateRequestUri(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, privateEndpointConnectionProxyName, data); + var rehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(RequestMethod.Put, uri.ToUri(), uri.ToString(), "None", null, OperationFinalStateVia.OriginalUri.ToString()); + var operation = new RecoveryServicesDataReplicationArmOperation(Response.FromValue(new PrivateEndpointConnectionProxyResource(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 new private endpoint connection proxy which includes both auto and manual approval types. Creating the proxy resource will also create a private endpoint connection resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/privateEndpointConnectionProxies/{privateEndpointConnectionProxyName} + /// + /// + /// Operation Id + /// PrivateEndpointConnectionProxy_Create + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// 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 private endpoint connection proxy name. + /// Private endpoint connection creation input. + /// 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 privateEndpointConnectionProxyName, PrivateEndpointConnectionProxyData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(privateEndpointConnectionProxyName, nameof(privateEndpointConnectionProxyName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _privateEndpointConnectionProxyClientDiagnostics.CreateScope("PrivateEndpointConnectionProxyCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = _privateEndpointConnectionProxyRestClient.Create(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, privateEndpointConnectionProxyName, data, cancellationToken); + var uri = _privateEndpointConnectionProxyRestClient.CreateCreateRequestUri(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, privateEndpointConnectionProxyName, data); + var rehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(RequestMethod.Put, uri.ToUri(), uri.ToString(), "None", null, OperationFinalStateVia.OriginalUri.ToString()); + var operation = new RecoveryServicesDataReplicationArmOperation(Response.FromValue(new PrivateEndpointConnectionProxyResource(Client, response), response.GetRawResponse()), rehydrationToken); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets the private endpoint connection proxy details. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/privateEndpointConnectionProxies/{privateEndpointConnectionProxyName} + /// + /// + /// Operation Id + /// PrivateEndpointConnectionProxy_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The private endpoint connection proxy name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetAsync(string privateEndpointConnectionProxyName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(privateEndpointConnectionProxyName, nameof(privateEndpointConnectionProxyName)); + + using var scope = _privateEndpointConnectionProxyClientDiagnostics.CreateScope("PrivateEndpointConnectionProxyCollection.Get"); + scope.Start(); + try + { + var response = await _privateEndpointConnectionProxyRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, privateEndpointConnectionProxyName, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new PrivateEndpointConnectionProxyResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets the private endpoint connection proxy details. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/privateEndpointConnectionProxies/{privateEndpointConnectionProxyName} + /// + /// + /// Operation Id + /// PrivateEndpointConnectionProxy_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The private endpoint connection proxy name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Get(string privateEndpointConnectionProxyName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(privateEndpointConnectionProxyName, nameof(privateEndpointConnectionProxyName)); + + using var scope = _privateEndpointConnectionProxyClientDiagnostics.CreateScope("PrivateEndpointConnectionProxyCollection.Get"); + scope.Start(); + try + { + var response = _privateEndpointConnectionProxyRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, privateEndpointConnectionProxyName, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new PrivateEndpointConnectionProxyResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets the all private endpoint connections proxies. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/privateEndpointConnectionProxies + /// + /// + /// Operation Id + /// PrivateEndpointConnectionProxy_List + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// 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) => _privateEndpointConnectionProxyRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _privateEndpointConnectionProxyRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new PrivateEndpointConnectionProxyResource(Client, PrivateEndpointConnectionProxyData.DeserializePrivateEndpointConnectionProxyData(e)), _privateEndpointConnectionProxyClientDiagnostics, Pipeline, "PrivateEndpointConnectionProxyCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Gets the all private endpoint connections proxies. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/privateEndpointConnectionProxies + /// + /// + /// Operation Id + /// PrivateEndpointConnectionProxy_List + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// 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) => _privateEndpointConnectionProxyRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _privateEndpointConnectionProxyRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new PrivateEndpointConnectionProxyResource(Client, PrivateEndpointConnectionProxyData.DeserializePrivateEndpointConnectionProxyData(e)), _privateEndpointConnectionProxyClientDiagnostics, Pipeline, "PrivateEndpointConnectionProxyCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/privateEndpointConnectionProxies/{privateEndpointConnectionProxyName} + /// + /// + /// Operation Id + /// PrivateEndpointConnectionProxy_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The private endpoint connection proxy name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> ExistsAsync(string privateEndpointConnectionProxyName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(privateEndpointConnectionProxyName, nameof(privateEndpointConnectionProxyName)); + + using var scope = _privateEndpointConnectionProxyClientDiagnostics.CreateScope("PrivateEndpointConnectionProxyCollection.Exists"); + scope.Start(); + try + { + var response = await _privateEndpointConnectionProxyRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, privateEndpointConnectionProxyName, 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.DataReplication/replicationVaults/{vaultName}/privateEndpointConnectionProxies/{privateEndpointConnectionProxyName} + /// + /// + /// Operation Id + /// PrivateEndpointConnectionProxy_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The private endpoint connection proxy name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Exists(string privateEndpointConnectionProxyName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(privateEndpointConnectionProxyName, nameof(privateEndpointConnectionProxyName)); + + using var scope = _privateEndpointConnectionProxyClientDiagnostics.CreateScope("PrivateEndpointConnectionProxyCollection.Exists"); + scope.Start(); + try + { + var response = _privateEndpointConnectionProxyRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, privateEndpointConnectionProxyName, 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.DataReplication/replicationVaults/{vaultName}/privateEndpointConnectionProxies/{privateEndpointConnectionProxyName} + /// + /// + /// Operation Id + /// PrivateEndpointConnectionProxy_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The private endpoint connection proxy name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetIfExistsAsync(string privateEndpointConnectionProxyName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(privateEndpointConnectionProxyName, nameof(privateEndpointConnectionProxyName)); + + using var scope = _privateEndpointConnectionProxyClientDiagnostics.CreateScope("PrivateEndpointConnectionProxyCollection.GetIfExists"); + scope.Start(); + try + { + var response = await _privateEndpointConnectionProxyRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, privateEndpointConnectionProxyName, cancellationToken: cancellationToken).ConfigureAwait(false); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new PrivateEndpointConnectionProxyResource(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.DataReplication/replicationVaults/{vaultName}/privateEndpointConnectionProxies/{privateEndpointConnectionProxyName} + /// + /// + /// Operation Id + /// PrivateEndpointConnectionProxy_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The private endpoint connection proxy name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual NullableResponse GetIfExists(string privateEndpointConnectionProxyName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(privateEndpointConnectionProxyName, nameof(privateEndpointConnectionProxyName)); + + using var scope = _privateEndpointConnectionProxyClientDiagnostics.CreateScope("PrivateEndpointConnectionProxyCollection.GetIfExists"); + scope.Start(); + try + { + var response = _privateEndpointConnectionProxyRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, privateEndpointConnectionProxyName, cancellationToken: cancellationToken); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new PrivateEndpointConnectionProxyResource(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/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/PrivateEndpointConnectionProxyData.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/PrivateEndpointConnectionProxyData.Serialization.cs new file mode 100644 index 000000000000..2e75ef9f0f41 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/PrivateEndpointConnectionProxyData.Serialization.cs @@ -0,0 +1,167 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.Models; +using Azure.ResourceManager.RecoveryServicesDataReplication.Models; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication +{ + public partial class PrivateEndpointConnectionProxyData : 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(PrivateEndpointConnectionProxyData)} 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(ETag)) + { + writer.WritePropertyName("etag"u8); + writer.WriteStringValue(ETag); + } + } + + PrivateEndpointConnectionProxyData 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(PrivateEndpointConnectionProxyData)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializePrivateEndpointConnectionProxyData(document.RootElement, options); + } + + internal static PrivateEndpointConnectionProxyData DeserializePrivateEndpointConnectionProxyData(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + PrivateEndpointConnectionProxyProperties properties = default; + string etag = 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 = PrivateEndpointConnectionProxyProperties.DeserializePrivateEndpointConnectionProxyProperties(property.Value, options); + continue; + } + if (property.NameEquals("etag"u8)) + { + etag = 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 PrivateEndpointConnectionProxyData( + id, + name, + type, + systemData, + properties, + etag, + 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(PrivateEndpointConnectionProxyData)} does not support writing '{options.Format}' format."); + } + } + + PrivateEndpointConnectionProxyData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializePrivateEndpointConnectionProxyData(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(PrivateEndpointConnectionProxyData)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/PrivateEndpointConnectionProxyData.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/PrivateEndpointConnectionProxyData.cs new file mode 100644 index 000000000000..9f1cbc56a319 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/PrivateEndpointConnectionProxyData.cs @@ -0,0 +1,79 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; +using Azure.ResourceManager.Models; +using Azure.ResourceManager.RecoveryServicesDataReplication.Models; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication +{ + /// + /// A class representing the PrivateEndpointConnectionProxy data model. + /// Represents private endpoint connection proxy request. + /// + public partial class PrivateEndpointConnectionProxyData : 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 PrivateEndpointConnectionProxyData() + { + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The resource-specific properties for this resource. + /// Gets or sets ETag. + /// Keeps track of any properties unknown to the library. + internal PrivateEndpointConnectionProxyData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, PrivateEndpointConnectionProxyProperties properties, string etag, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) + { + Properties = properties; + ETag = etag; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The resource-specific properties for this resource. + public PrivateEndpointConnectionProxyProperties Properties { get; set; } + /// Gets or sets ETag. + public string ETag { get; set; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/PrivateEndpointConnectionProxyResource.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/PrivateEndpointConnectionProxyResource.Serialization.cs new file mode 100644 index 000000000000..98ebc6566f2f --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/PrivateEndpointConnectionProxyResource.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.RecoveryServicesDataReplication +{ + public partial class PrivateEndpointConnectionProxyResource : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); + + PrivateEndpointConnectionProxyData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options); + + PrivateEndpointConnectionProxyData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options); + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/PrivateEndpointConnectionProxyResource.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/PrivateEndpointConnectionProxyResource.cs new file mode 100644 index 000000000000..5f6bbd1aa86c --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/PrivateEndpointConnectionProxyResource.cs @@ -0,0 +1,435 @@ +// 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.RecoveryServicesDataReplication +{ + /// + /// A Class representing a PrivateEndpointConnectionProxy 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 GetPrivateEndpointConnectionProxyResource method. + /// Otherwise you can get one from its parent resource using the GetPrivateEndpointConnectionProxy method. + /// + public partial class PrivateEndpointConnectionProxyResource : ArmResource + { + /// Generate the resource identifier of a instance. + /// The subscriptionId. + /// The resourceGroupName. + /// The vaultName. + /// The privateEndpointConnectionProxyName. + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string vaultName, string privateEndpointConnectionProxyName) + { + var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/privateEndpointConnectionProxies/{privateEndpointConnectionProxyName}"; + return new ResourceIdentifier(resourceId); + } + + private readonly ClientDiagnostics _privateEndpointConnectionProxyClientDiagnostics; + private readonly PrivateEndpointConnectionProxiesRestOperations _privateEndpointConnectionProxyRestClient; + private readonly PrivateEndpointConnectionProxyData _data; + + /// Gets the resource type for the operations. + public static readonly ResourceType ResourceType = "Microsoft.DataReplication/replicationVaults/privateEndpointConnectionProxies"; + + /// Initializes a new instance of the class for mocking. + protected PrivateEndpointConnectionProxyResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal PrivateEndpointConnectionProxyResource(ArmClient client, PrivateEndpointConnectionProxyData 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 PrivateEndpointConnectionProxyResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _privateEndpointConnectionProxyClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.RecoveryServicesDataReplication", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string privateEndpointConnectionProxyApiVersion); + _privateEndpointConnectionProxyRestClient = new PrivateEndpointConnectionProxiesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, privateEndpointConnectionProxyApiVersion); +#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 PrivateEndpointConnectionProxyData 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)); + } + + /// + /// Gets the private endpoint connection proxy details. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/privateEndpointConnectionProxies/{privateEndpointConnectionProxyName} + /// + /// + /// Operation Id + /// PrivateEndpointConnectionProxy_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _privateEndpointConnectionProxyClientDiagnostics.CreateScope("PrivateEndpointConnectionProxyResource.Get"); + scope.Start(); + try + { + var response = await _privateEndpointConnectionProxyRestClient.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 PrivateEndpointConnectionProxyResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets the private endpoint connection proxy details. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/privateEndpointConnectionProxies/{privateEndpointConnectionProxyName} + /// + /// + /// Operation Id + /// PrivateEndpointConnectionProxy_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _privateEndpointConnectionProxyClientDiagnostics.CreateScope("PrivateEndpointConnectionProxyResource.Get"); + scope.Start(); + try + { + var response = _privateEndpointConnectionProxyRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new PrivateEndpointConnectionProxyResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Returns the operation to track the deletion of private endpoint connection proxy. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/privateEndpointConnectionProxies/{privateEndpointConnectionProxyName} + /// + /// + /// Operation Id + /// PrivateEndpointConnectionProxy_Delete + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// 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 = _privateEndpointConnectionProxyClientDiagnostics.CreateScope("PrivateEndpointConnectionProxyResource.Delete"); + scope.Start(); + try + { + var response = await _privateEndpointConnectionProxyRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + var operation = new RecoveryServicesDataReplicationArmOperation(_privateEndpointConnectionProxyClientDiagnostics, Pipeline, _privateEndpointConnectionProxyRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Returns the operation to track the deletion of private endpoint connection proxy. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/privateEndpointConnectionProxies/{privateEndpointConnectionProxyName} + /// + /// + /// Operation Id + /// PrivateEndpointConnectionProxy_Delete + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// 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 = _privateEndpointConnectionProxyClientDiagnostics.CreateScope("PrivateEndpointConnectionProxyResource.Delete"); + scope.Start(); + try + { + var response = _privateEndpointConnectionProxyRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + var operation = new RecoveryServicesDataReplicationArmOperation(_privateEndpointConnectionProxyClientDiagnostics, Pipeline, _privateEndpointConnectionProxyRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletionResponse(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Create a new private endpoint connection proxy which includes both auto and manual approval types. Creating the proxy resource will also create a private endpoint connection resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/privateEndpointConnectionProxies/{privateEndpointConnectionProxyName} + /// + /// + /// Operation Id + /// PrivateEndpointConnectionProxy_Create + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// 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. + /// Private endpoint connection creation input. + /// The cancellation token to use. + /// is null. + public virtual async Task> UpdateAsync(WaitUntil waitUntil, PrivateEndpointConnectionProxyData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _privateEndpointConnectionProxyClientDiagnostics.CreateScope("PrivateEndpointConnectionProxyResource.Update"); + scope.Start(); + try + { + var response = await _privateEndpointConnectionProxyRestClient.CreateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, cancellationToken).ConfigureAwait(false); + var uri = _privateEndpointConnectionProxyRestClient.CreateCreateRequestUri(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 RecoveryServicesDataReplicationArmOperation(Response.FromValue(new PrivateEndpointConnectionProxyResource(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 new private endpoint connection proxy which includes both auto and manual approval types. Creating the proxy resource will also create a private endpoint connection resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/privateEndpointConnectionProxies/{privateEndpointConnectionProxyName} + /// + /// + /// Operation Id + /// PrivateEndpointConnectionProxy_Create + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// 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. + /// Private endpoint connection creation input. + /// The cancellation token to use. + /// is null. + public virtual ArmOperation Update(WaitUntil waitUntil, PrivateEndpointConnectionProxyData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _privateEndpointConnectionProxyClientDiagnostics.CreateScope("PrivateEndpointConnectionProxyResource.Update"); + scope.Start(); + try + { + var response = _privateEndpointConnectionProxyRestClient.Create(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, cancellationToken); + var uri = _privateEndpointConnectionProxyRestClient.CreateCreateRequestUri(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 RecoveryServicesDataReplicationArmOperation(Response.FromValue(new PrivateEndpointConnectionProxyResource(Client, response), response.GetRawResponse()), rehydrationToken); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Returns remote private endpoint connection information after validation. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/privateEndpointConnectionProxies/{privateEndpointConnectionProxyName}/validate + /// + /// + /// Operation Id + /// PrivateEndpointConnectionProxies_Validate + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The private endpoint connection proxy input. + /// The cancellation token to use. + /// is null. + public virtual async Task> ValidateAsync(PrivateEndpointConnectionProxyData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _privateEndpointConnectionProxyClientDiagnostics.CreateScope("PrivateEndpointConnectionProxyResource.Validate"); + scope.Start(); + try + { + var response = await _privateEndpointConnectionProxyRestClient.ValidateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new PrivateEndpointConnectionProxyResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Returns remote private endpoint connection information after validation. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/privateEndpointConnectionProxies/{privateEndpointConnectionProxyName}/validate + /// + /// + /// Operation Id + /// PrivateEndpointConnectionProxies_Validate + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The private endpoint connection proxy input. + /// The cancellation token to use. + /// is null. + public virtual Response Validate(PrivateEndpointConnectionProxyData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _privateEndpointConnectionProxyClientDiagnostics.CreateScope("PrivateEndpointConnectionProxyResource.Validate"); + scope.Start(); + try + { + var response = _privateEndpointConnectionProxyRestClient.Validate(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, cancellationToken); + return Response.FromValue(new PrivateEndpointConnectionProxyResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/ProtectedItemModelCollection.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/ProtectedItemModelCollection.cs new file mode 100644 index 000000000000..5298c4d40a08 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/ProtectedItemModelCollection.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.RecoveryServicesDataReplication +{ + /// + /// 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 GetProtectedItemModels method from an instance of . + /// + public partial class ProtectedItemModelCollection : ArmCollection, IEnumerable, IAsyncEnumerable + { + private readonly ClientDiagnostics _protectedItemModelProtectedItemClientDiagnostics; + private readonly ProtectedItemRestOperations _protectedItemModelProtectedItemRestClient; + + /// Initializes a new instance of the class for mocking. + protected ProtectedItemModelCollection() + { + } + + /// 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 ProtectedItemModelCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _protectedItemModelProtectedItemClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.RecoveryServicesDataReplication", ProtectedItemModelResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ProtectedItemModelResource.ResourceType, out string protectedItemModelProtectedItemApiVersion); + _protectedItemModelProtectedItemRestClient = new ProtectedItemRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, protectedItemModelProtectedItemApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != VaultModelResource.ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, VaultModelResource.ResourceType), nameof(id)); + } + + /// + /// Creates the protected item. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/protectedItems/{protectedItemName} + /// + /// + /// Operation Id + /// ProtectedItemModel_Create + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// 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 protected item name. + /// Protected item model. + /// 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 protectedItemName, ProtectedItemModelData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(protectedItemName, nameof(protectedItemName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _protectedItemModelProtectedItemClientDiagnostics.CreateScope("ProtectedItemModelCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = await _protectedItemModelProtectedItemRestClient.CreateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, protectedItemName, data, cancellationToken).ConfigureAwait(false); + var operation = new RecoveryServicesDataReplicationArmOperation(new ProtectedItemModelOperationSource(Client), _protectedItemModelProtectedItemClientDiagnostics, Pipeline, _protectedItemModelProtectedItemRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, protectedItemName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Creates the protected item. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/protectedItems/{protectedItemName} + /// + /// + /// Operation Id + /// ProtectedItemModel_Create + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// 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 protected item name. + /// Protected item model. + /// 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 protectedItemName, ProtectedItemModelData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(protectedItemName, nameof(protectedItemName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _protectedItemModelProtectedItemClientDiagnostics.CreateScope("ProtectedItemModelCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = _protectedItemModelProtectedItemRestClient.Create(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, protectedItemName, data, cancellationToken); + var operation = new RecoveryServicesDataReplicationArmOperation(new ProtectedItemModelOperationSource(Client), _protectedItemModelProtectedItemClientDiagnostics, Pipeline, _protectedItemModelProtectedItemRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, protectedItemName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets the details of the protected item. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/protectedItems/{protectedItemName} + /// + /// + /// Operation Id + /// ProtectedItemModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The protected item name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetAsync(string protectedItemName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(protectedItemName, nameof(protectedItemName)); + + using var scope = _protectedItemModelProtectedItemClientDiagnostics.CreateScope("ProtectedItemModelCollection.Get"); + scope.Start(); + try + { + var response = await _protectedItemModelProtectedItemRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, protectedItemName, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new ProtectedItemModelResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets the details of the protected item. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/protectedItems/{protectedItemName} + /// + /// + /// Operation Id + /// ProtectedItemModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The protected item name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Get(string protectedItemName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(protectedItemName, nameof(protectedItemName)); + + using var scope = _protectedItemModelProtectedItemClientDiagnostics.CreateScope("ProtectedItemModelCollection.Get"); + scope.Start(); + try + { + var response = _protectedItemModelProtectedItemRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, protectedItemName, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new ProtectedItemModelResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets the list of protected items in the given vault. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/protectedItems + /// + /// + /// Operation Id + /// ProtectedItemModel_List + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// OData options. + /// Continuation token. + /// Page size. + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetAllAsync(string odataOptions = null, string continuationToken = null, int? pageSize = null, CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _protectedItemModelProtectedItemRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, odataOptions, continuationToken, pageSizeHint); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _protectedItemModelProtectedItemRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name, odataOptions, continuationToken, pageSizeHint); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new ProtectedItemModelResource(Client, ProtectedItemModelData.DeserializeProtectedItemModelData(e)), _protectedItemModelProtectedItemClientDiagnostics, Pipeline, "ProtectedItemModelCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Gets the list of protected items in the given vault. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/protectedItems + /// + /// + /// Operation Id + /// ProtectedItemModel_List + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// OData options. + /// Continuation token. + /// Page size. + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetAll(string odataOptions = null, string continuationToken = null, int? pageSize = null, CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _protectedItemModelProtectedItemRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, odataOptions, continuationToken, pageSizeHint); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _protectedItemModelProtectedItemRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name, odataOptions, continuationToken, pageSizeHint); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new ProtectedItemModelResource(Client, ProtectedItemModelData.DeserializeProtectedItemModelData(e)), _protectedItemModelProtectedItemClientDiagnostics, Pipeline, "ProtectedItemModelCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/protectedItems/{protectedItemName} + /// + /// + /// Operation Id + /// ProtectedItemModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The protected item name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> ExistsAsync(string protectedItemName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(protectedItemName, nameof(protectedItemName)); + + using var scope = _protectedItemModelProtectedItemClientDiagnostics.CreateScope("ProtectedItemModelCollection.Exists"); + scope.Start(); + try + { + var response = await _protectedItemModelProtectedItemRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, protectedItemName, 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.DataReplication/replicationVaults/{vaultName}/protectedItems/{protectedItemName} + /// + /// + /// Operation Id + /// ProtectedItemModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The protected item name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Exists(string protectedItemName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(protectedItemName, nameof(protectedItemName)); + + using var scope = _protectedItemModelProtectedItemClientDiagnostics.CreateScope("ProtectedItemModelCollection.Exists"); + scope.Start(); + try + { + var response = _protectedItemModelProtectedItemRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, protectedItemName, 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.DataReplication/replicationVaults/{vaultName}/protectedItems/{protectedItemName} + /// + /// + /// Operation Id + /// ProtectedItemModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The protected item name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetIfExistsAsync(string protectedItemName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(protectedItemName, nameof(protectedItemName)); + + using var scope = _protectedItemModelProtectedItemClientDiagnostics.CreateScope("ProtectedItemModelCollection.GetIfExists"); + scope.Start(); + try + { + var response = await _protectedItemModelProtectedItemRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, protectedItemName, cancellationToken: cancellationToken).ConfigureAwait(false); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new ProtectedItemModelResource(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.DataReplication/replicationVaults/{vaultName}/protectedItems/{protectedItemName} + /// + /// + /// Operation Id + /// ProtectedItemModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The protected item name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual NullableResponse GetIfExists(string protectedItemName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(protectedItemName, nameof(protectedItemName)); + + using var scope = _protectedItemModelProtectedItemClientDiagnostics.CreateScope("ProtectedItemModelCollection.GetIfExists"); + scope.Start(); + try + { + var response = _protectedItemModelProtectedItemRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, protectedItemName, cancellationToken: cancellationToken); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new ProtectedItemModelResource(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/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/ProtectedItemModelData.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/ProtectedItemModelData.Serialization.cs new file mode 100644 index 000000000000..a676d1847e84 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/ProtectedItemModelData.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.Models; +using Azure.ResourceManager.RecoveryServicesDataReplication.Models; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication +{ + public partial class ProtectedItemModelData : 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(ProtectedItemModelData)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (Optional.IsDefined(Properties)) + { + writer.WritePropertyName("properties"u8); + writer.WriteObjectValue(Properties, options); + } + } + + ProtectedItemModelData 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(ProtectedItemModelData)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeProtectedItemModelData(document.RootElement, options); + } + + internal static ProtectedItemModelData DeserializeProtectedItemModelData(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ProtectedItemModelProperties 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 = ProtectedItemModelProperties.DeserializeProtectedItemModelProperties(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 ProtectedItemModelData( + 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(ProtectedItemModelData)} does not support writing '{options.Format}' format."); + } + } + + ProtectedItemModelData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeProtectedItemModelData(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ProtectedItemModelData)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/ProtectedItemModelData.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/ProtectedItemModelData.cs new file mode 100644 index 000000000000..44733c4d887b --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/ProtectedItemModelData.cs @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; +using Azure.ResourceManager.Models; +using Azure.ResourceManager.RecoveryServicesDataReplication.Models; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication +{ + /// + /// A class representing the ProtectedItemModel data model. + /// Protected item model. + /// + public partial class ProtectedItemModelData : 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 ProtectedItemModelData() + { + } + + /// 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 ProtectedItemModelData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, ProtectedItemModelProperties properties, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) + { + Properties = properties; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The resource-specific properties for this resource. + public ProtectedItemModelProperties Properties { get; set; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/ProtectedItemModelResource.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/ProtectedItemModelResource.Serialization.cs new file mode 100644 index 000000000000..46f76650feaa --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/ProtectedItemModelResource.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.RecoveryServicesDataReplication +{ + public partial class ProtectedItemModelResource : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); + + ProtectedItemModelData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options); + + ProtectedItemModelData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options); + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/ProtectedItemModelResource.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/ProtectedItemModelResource.cs new file mode 100644 index 000000000000..9403365ee6af --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/ProtectedItemModelResource.cs @@ -0,0 +1,511 @@ +// 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; +using Azure.ResourceManager.RecoveryServicesDataReplication.Models; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication +{ + /// + /// A Class representing a ProtectedItemModel 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 GetProtectedItemModelResource method. + /// Otherwise you can get one from its parent resource using the GetProtectedItemModel method. + /// + public partial class ProtectedItemModelResource : ArmResource + { + /// Generate the resource identifier of a instance. + /// The subscriptionId. + /// The resourceGroupName. + /// The vaultName. + /// The protectedItemName. + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string vaultName, string protectedItemName) + { + var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/protectedItems/{protectedItemName}"; + return new ResourceIdentifier(resourceId); + } + + private readonly ClientDiagnostics _protectedItemModelProtectedItemClientDiagnostics; + private readonly ProtectedItemRestOperations _protectedItemModelProtectedItemRestClient; + private readonly ProtectedItemModelData _data; + + /// Gets the resource type for the operations. + public static readonly ResourceType ResourceType = "Microsoft.DataReplication/replicationVaults/protectedItems"; + + /// Initializes a new instance of the class for mocking. + protected ProtectedItemModelResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal ProtectedItemModelResource(ArmClient client, ProtectedItemModelData 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 ProtectedItemModelResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _protectedItemModelProtectedItemClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.RecoveryServicesDataReplication", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string protectedItemModelProtectedItemApiVersion); + _protectedItemModelProtectedItemRestClient = new ProtectedItemRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, protectedItemModelProtectedItemApiVersion); +#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 ProtectedItemModelData 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)); + } + + /// Gets a collection of RecoveryPointModelResources in the ProtectedItemModel. + /// An object representing collection of RecoveryPointModelResources and their operations over a RecoveryPointModelResource. + public virtual RecoveryPointModelCollection GetRecoveryPointModels() + { + return GetCachedClient(client => new RecoveryPointModelCollection(client, Id)); + } + + /// + /// Gets the details of the recovery point of a protected item. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/protectedItems/{protectedItemName}/recoveryPoints/{recoveryPointName} + /// + /// + /// Operation Id + /// RecoveryPointModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The recovery point name. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetRecoveryPointModelAsync(string recoveryPointName, CancellationToken cancellationToken = default) + { + return await GetRecoveryPointModels().GetAsync(recoveryPointName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets the details of the recovery point of a protected item. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/protectedItems/{protectedItemName}/recoveryPoints/{recoveryPointName} + /// + /// + /// Operation Id + /// RecoveryPointModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The recovery point name. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetRecoveryPointModel(string recoveryPointName, CancellationToken cancellationToken = default) + { + return GetRecoveryPointModels().Get(recoveryPointName, cancellationToken); + } + + /// + /// Gets the details of the protected item. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/protectedItems/{protectedItemName} + /// + /// + /// Operation Id + /// ProtectedItemModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _protectedItemModelProtectedItemClientDiagnostics.CreateScope("ProtectedItemModelResource.Get"); + scope.Start(); + try + { + var response = await _protectedItemModelProtectedItemRestClient.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 ProtectedItemModelResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets the details of the protected item. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/protectedItems/{protectedItemName} + /// + /// + /// Operation Id + /// ProtectedItemModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _protectedItemModelProtectedItemClientDiagnostics.CreateScope("ProtectedItemModelResource.Get"); + scope.Start(); + try + { + var response = _protectedItemModelProtectedItemRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new ProtectedItemModelResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Removes the protected item. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/protectedItems/{protectedItemName} + /// + /// + /// Operation Id + /// ProtectedItemModel_Delete + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// 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. + /// A flag indicating whether to do force delete or not. + /// The cancellation token to use. + public virtual async Task DeleteAsync(WaitUntil waitUntil, bool? forceDelete = null, CancellationToken cancellationToken = default) + { + using var scope = _protectedItemModelProtectedItemClientDiagnostics.CreateScope("ProtectedItemModelResource.Delete"); + scope.Start(); + try + { + var response = await _protectedItemModelProtectedItemRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, forceDelete, cancellationToken).ConfigureAwait(false); + var operation = new RecoveryServicesDataReplicationArmOperation(_protectedItemModelProtectedItemClientDiagnostics, Pipeline, _protectedItemModelProtectedItemRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, forceDelete).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Removes the protected item. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/protectedItems/{protectedItemName} + /// + /// + /// Operation Id + /// ProtectedItemModel_Delete + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// 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. + /// A flag indicating whether to do force delete or not. + /// The cancellation token to use. + public virtual ArmOperation Delete(WaitUntil waitUntil, bool? forceDelete = null, CancellationToken cancellationToken = default) + { + using var scope = _protectedItemModelProtectedItemClientDiagnostics.CreateScope("ProtectedItemModelResource.Delete"); + scope.Start(); + try + { + var response = _protectedItemModelProtectedItemRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, forceDelete, cancellationToken); + var operation = new RecoveryServicesDataReplicationArmOperation(_protectedItemModelProtectedItemClientDiagnostics, Pipeline, _protectedItemModelProtectedItemRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, forceDelete).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletionResponse(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Performs update on the protected item. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/protectedItems/{protectedItemName} + /// + /// + /// Operation Id + /// ProtectedItemModel_Update + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// 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. + /// Protected item model. + /// The cancellation token to use. + /// is null. + public virtual async Task> UpdateAsync(WaitUntil waitUntil, ProtectedItemModelPatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(patch, nameof(patch)); + + using var scope = _protectedItemModelProtectedItemClientDiagnostics.CreateScope("ProtectedItemModelResource.Update"); + scope.Start(); + try + { + var response = await _protectedItemModelProtectedItemRestClient.UpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, patch, cancellationToken).ConfigureAwait(false); + var operation = new RecoveryServicesDataReplicationArmOperation(new ProtectedItemModelOperationSource(Client), _protectedItemModelProtectedItemClientDiagnostics, Pipeline, _protectedItemModelProtectedItemRestClient.CreateUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, patch).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Performs update on the protected item. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/protectedItems/{protectedItemName} + /// + /// + /// Operation Id + /// ProtectedItemModel_Update + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// 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. + /// Protected item model. + /// The cancellation token to use. + /// is null. + public virtual ArmOperation Update(WaitUntil waitUntil, ProtectedItemModelPatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(patch, nameof(patch)); + + using var scope = _protectedItemModelProtectedItemClientDiagnostics.CreateScope("ProtectedItemModelResource.Update"); + scope.Start(); + try + { + var response = _protectedItemModelProtectedItemRestClient.Update(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, patch, cancellationToken); + var operation = new RecoveryServicesDataReplicationArmOperation(new ProtectedItemModelOperationSource(Client), _protectedItemModelProtectedItemClientDiagnostics, Pipeline, _protectedItemModelProtectedItemRestClient.CreateUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, patch).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Performs the planned failover on the protected item. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/protectedItems/{protectedItemName}/plannedFailover + /// + /// + /// Operation Id + /// ProtectedItem_PlannedFailover + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// 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. + /// Planned failover model. + /// The cancellation token to use. + /// is null. + public virtual async Task> PlannedFailoverAsync(WaitUntil waitUntil, PlannedFailoverModel body, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(body, nameof(body)); + + using var scope = _protectedItemModelProtectedItemClientDiagnostics.CreateScope("ProtectedItemModelResource.PlannedFailover"); + scope.Start(); + try + { + var response = await _protectedItemModelProtectedItemRestClient.PlannedFailoverAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, body, cancellationToken).ConfigureAwait(false); + var operation = new RecoveryServicesDataReplicationArmOperation(new PlannedFailoverModelOperationSource(), _protectedItemModelProtectedItemClientDiagnostics, Pipeline, _protectedItemModelProtectedItemRestClient.CreatePlannedFailoverRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, body).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Performs the planned failover on the protected item. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/protectedItems/{protectedItemName}/plannedFailover + /// + /// + /// Operation Id + /// ProtectedItem_PlannedFailover + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// 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. + /// Planned failover model. + /// The cancellation token to use. + /// is null. + public virtual ArmOperation PlannedFailover(WaitUntil waitUntil, PlannedFailoverModel body, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(body, nameof(body)); + + using var scope = _protectedItemModelProtectedItemClientDiagnostics.CreateScope("ProtectedItemModelResource.PlannedFailover"); + scope.Start(); + try + { + var response = _protectedItemModelProtectedItemRestClient.PlannedFailover(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, body, cancellationToken); + var operation = new RecoveryServicesDataReplicationArmOperation(new PlannedFailoverModelOperationSource(), _protectedItemModelProtectedItemClientDiagnostics, Pipeline, _protectedItemModelProtectedItemRestClient.CreatePlannedFailoverRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, body).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/ProviderConstants.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/ProviderConstants.cs new file mode 100644 index 000000000000..c468763062c9 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/ProviderConstants.cs @@ -0,0 +1,16 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication +{ + internal static class ProviderConstants + { + public static string DefaultProviderNamespace { get; } = ClientDiagnostics.GetResourceProviderNamespace(typeof(ProviderConstants).Assembly); + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/RecoveryPointModelCollection.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/RecoveryPointModelCollection.cs new file mode 100644 index 000000000000..ac3477bc3cfa --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/RecoveryPointModelCollection.cs @@ -0,0 +1,395 @@ +// 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.RecoveryServicesDataReplication +{ + /// + /// 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 GetRecoveryPointModels method from an instance of . + /// + public partial class RecoveryPointModelCollection : ArmCollection, IEnumerable, IAsyncEnumerable + { + private readonly ClientDiagnostics _recoveryPointModelRecoveryPointClientDiagnostics; + private readonly RecoveryPointRestOperations _recoveryPointModelRecoveryPointRestClient; + + /// Initializes a new instance of the class for mocking. + protected RecoveryPointModelCollection() + { + } + + /// 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 RecoveryPointModelCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _recoveryPointModelRecoveryPointClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.RecoveryServicesDataReplication", RecoveryPointModelResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(RecoveryPointModelResource.ResourceType, out string recoveryPointModelRecoveryPointApiVersion); + _recoveryPointModelRecoveryPointRestClient = new RecoveryPointRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, recoveryPointModelRecoveryPointApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != ProtectedItemModelResource.ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ProtectedItemModelResource.ResourceType), nameof(id)); + } + + /// + /// Gets the details of the recovery point of a protected item. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/protectedItems/{protectedItemName}/recoveryPoints/{recoveryPointName} + /// + /// + /// Operation Id + /// RecoveryPointModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The recovery point name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetAsync(string recoveryPointName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(recoveryPointName, nameof(recoveryPointName)); + + using var scope = _recoveryPointModelRecoveryPointClientDiagnostics.CreateScope("RecoveryPointModelCollection.Get"); + scope.Start(); + try + { + var response = await _recoveryPointModelRecoveryPointRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, recoveryPointName, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new RecoveryPointModelResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets the details of the recovery point of a protected item. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/protectedItems/{protectedItemName}/recoveryPoints/{recoveryPointName} + /// + /// + /// Operation Id + /// RecoveryPointModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The recovery point name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Get(string recoveryPointName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(recoveryPointName, nameof(recoveryPointName)); + + using var scope = _recoveryPointModelRecoveryPointClientDiagnostics.CreateScope("RecoveryPointModelCollection.Get"); + scope.Start(); + try + { + var response = _recoveryPointModelRecoveryPointRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, recoveryPointName, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new RecoveryPointModelResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets the list of recovery points of the given protected item. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/protectedItems/{protectedItemName}/recoveryPoints + /// + /// + /// Operation Id + /// RecoveryPointModel_List + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// 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) => _recoveryPointModelRecoveryPointRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _recoveryPointModelRecoveryPointRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new RecoveryPointModelResource(Client, RecoveryPointModelData.DeserializeRecoveryPointModelData(e)), _recoveryPointModelRecoveryPointClientDiagnostics, Pipeline, "RecoveryPointModelCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Gets the list of recovery points of the given protected item. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/protectedItems/{protectedItemName}/recoveryPoints + /// + /// + /// Operation Id + /// RecoveryPointModel_List + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// 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) => _recoveryPointModelRecoveryPointRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _recoveryPointModelRecoveryPointRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new RecoveryPointModelResource(Client, RecoveryPointModelData.DeserializeRecoveryPointModelData(e)), _recoveryPointModelRecoveryPointClientDiagnostics, Pipeline, "RecoveryPointModelCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/protectedItems/{protectedItemName}/recoveryPoints/{recoveryPointName} + /// + /// + /// Operation Id + /// RecoveryPointModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The recovery point name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> ExistsAsync(string recoveryPointName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(recoveryPointName, nameof(recoveryPointName)); + + using var scope = _recoveryPointModelRecoveryPointClientDiagnostics.CreateScope("RecoveryPointModelCollection.Exists"); + scope.Start(); + try + { + var response = await _recoveryPointModelRecoveryPointRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, recoveryPointName, 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.DataReplication/replicationVaults/{vaultName}/protectedItems/{protectedItemName}/recoveryPoints/{recoveryPointName} + /// + /// + /// Operation Id + /// RecoveryPointModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The recovery point name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Exists(string recoveryPointName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(recoveryPointName, nameof(recoveryPointName)); + + using var scope = _recoveryPointModelRecoveryPointClientDiagnostics.CreateScope("RecoveryPointModelCollection.Exists"); + scope.Start(); + try + { + var response = _recoveryPointModelRecoveryPointRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, recoveryPointName, 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.DataReplication/replicationVaults/{vaultName}/protectedItems/{protectedItemName}/recoveryPoints/{recoveryPointName} + /// + /// + /// Operation Id + /// RecoveryPointModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The recovery point name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetIfExistsAsync(string recoveryPointName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(recoveryPointName, nameof(recoveryPointName)); + + using var scope = _recoveryPointModelRecoveryPointClientDiagnostics.CreateScope("RecoveryPointModelCollection.GetIfExists"); + scope.Start(); + try + { + var response = await _recoveryPointModelRecoveryPointRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, recoveryPointName, cancellationToken: cancellationToken).ConfigureAwait(false); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new RecoveryPointModelResource(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.DataReplication/replicationVaults/{vaultName}/protectedItems/{protectedItemName}/recoveryPoints/{recoveryPointName} + /// + /// + /// Operation Id + /// RecoveryPointModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The recovery point name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual NullableResponse GetIfExists(string recoveryPointName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(recoveryPointName, nameof(recoveryPointName)); + + using var scope = _recoveryPointModelRecoveryPointClientDiagnostics.CreateScope("RecoveryPointModelCollection.GetIfExists"); + scope.Start(); + try + { + var response = _recoveryPointModelRecoveryPointRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, recoveryPointName, cancellationToken: cancellationToken); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new RecoveryPointModelResource(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/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/RecoveryPointModelData.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/RecoveryPointModelData.Serialization.cs new file mode 100644 index 000000000000..ecf5e2ea9690 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/RecoveryPointModelData.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.Models; +using Azure.ResourceManager.RecoveryServicesDataReplication.Models; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication +{ + public partial class RecoveryPointModelData : 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(RecoveryPointModelData)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (Optional.IsDefined(Properties)) + { + writer.WritePropertyName("properties"u8); + writer.WriteObjectValue(Properties, options); + } + } + + RecoveryPointModelData 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(RecoveryPointModelData)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeRecoveryPointModelData(document.RootElement, options); + } + + internal static RecoveryPointModelData DeserializeRecoveryPointModelData(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + RecoveryPointModelProperties 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 = RecoveryPointModelProperties.DeserializeRecoveryPointModelProperties(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 RecoveryPointModelData( + 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(RecoveryPointModelData)} does not support writing '{options.Format}' format."); + } + } + + RecoveryPointModelData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeRecoveryPointModelData(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(RecoveryPointModelData)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/RecoveryPointModelData.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/RecoveryPointModelData.cs new file mode 100644 index 000000000000..22c24c91c386 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/RecoveryPointModelData.cs @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; +using Azure.ResourceManager.Models; +using Azure.ResourceManager.RecoveryServicesDataReplication.Models; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication +{ + /// + /// A class representing the RecoveryPointModel data model. + /// Recovery point model. + /// + public partial class RecoveryPointModelData : 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 . + internal RecoveryPointModelData() + { + } + + /// 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 RecoveryPointModelData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, RecoveryPointModelProperties properties, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) + { + Properties = properties; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The resource-specific properties for this resource. + public RecoveryPointModelProperties Properties { get; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/RecoveryPointModelResource.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/RecoveryPointModelResource.Serialization.cs new file mode 100644 index 000000000000..0c6e5617736f --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/RecoveryPointModelResource.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.RecoveryServicesDataReplication +{ + public partial class RecoveryPointModelResource : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); + + RecoveryPointModelData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options); + + RecoveryPointModelData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options); + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/RecoveryPointModelResource.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/RecoveryPointModelResource.cs new file mode 100644 index 000000000000..5e29d56fa382 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/RecoveryPointModelResource.cs @@ -0,0 +1,172 @@ +// 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.RecoveryServicesDataReplication +{ + /// + /// A Class representing a RecoveryPointModel 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 GetRecoveryPointModelResource method. + /// Otherwise you can get one from its parent resource using the GetRecoveryPointModel method. + /// + public partial class RecoveryPointModelResource : ArmResource + { + /// Generate the resource identifier of a instance. + /// The subscriptionId. + /// The resourceGroupName. + /// The vaultName. + /// The protectedItemName. + /// The recoveryPointName. + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string vaultName, string protectedItemName, string recoveryPointName) + { + var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/protectedItems/{protectedItemName}/recoveryPoints/{recoveryPointName}"; + return new ResourceIdentifier(resourceId); + } + + private readonly ClientDiagnostics _recoveryPointModelRecoveryPointClientDiagnostics; + private readonly RecoveryPointRestOperations _recoveryPointModelRecoveryPointRestClient; + private readonly RecoveryPointModelData _data; + + /// Gets the resource type for the operations. + public static readonly ResourceType ResourceType = "Microsoft.DataReplication/replicationVaults/protectedItems/recoveryPoints"; + + /// Initializes a new instance of the class for mocking. + protected RecoveryPointModelResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal RecoveryPointModelResource(ArmClient client, RecoveryPointModelData 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 RecoveryPointModelResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _recoveryPointModelRecoveryPointClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.RecoveryServicesDataReplication", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string recoveryPointModelRecoveryPointApiVersion); + _recoveryPointModelRecoveryPointRestClient = new RecoveryPointRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, recoveryPointModelRecoveryPointApiVersion); +#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 RecoveryPointModelData 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)); + } + + /// + /// Gets the details of the recovery point of a protected item. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/protectedItems/{protectedItemName}/recoveryPoints/{recoveryPointName} + /// + /// + /// Operation Id + /// RecoveryPointModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _recoveryPointModelRecoveryPointClientDiagnostics.CreateScope("RecoveryPointModelResource.Get"); + scope.Start(); + try + { + var response = await _recoveryPointModelRecoveryPointRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new RecoveryPointModelResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets the details of the recovery point of a protected item. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/protectedItems/{protectedItemName}/recoveryPoints/{recoveryPointName} + /// + /// + /// Operation Id + /// RecoveryPointModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _recoveryPointModelRecoveryPointClientDiagnostics.CreateScope("RecoveryPointModelResource.Get"); + scope.Start(); + try + { + var response = _recoveryPointModelRecoveryPointRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new RecoveryPointModelResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/RecoveryServicesDataReplicationPrivateEndpointConnectionCollection.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/RecoveryServicesDataReplicationPrivateEndpointConnectionCollection.cs new file mode 100644 index 000000000000..9d9cbce6d52e --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/RecoveryServicesDataReplicationPrivateEndpointConnectionCollection.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.RecoveryServicesDataReplication +{ + /// + /// 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 GetRecoveryServicesDataReplicationPrivateEndpointConnections method from an instance of . + /// + public partial class RecoveryServicesDataReplicationPrivateEndpointConnectionCollection : ArmCollection, IEnumerable, IAsyncEnumerable + { + private readonly ClientDiagnostics _recoveryServicesDataReplicationPrivateEndpointConnectionPrivateEndpointConnectionsClientDiagnostics; + private readonly PrivateEndpointConnectionsRestOperations _recoveryServicesDataReplicationPrivateEndpointConnectionPrivateEndpointConnectionsRestClient; + + /// Initializes a new instance of the class for mocking. + protected RecoveryServicesDataReplicationPrivateEndpointConnectionCollection() + { + } + + /// 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 RecoveryServicesDataReplicationPrivateEndpointConnectionCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _recoveryServicesDataReplicationPrivateEndpointConnectionPrivateEndpointConnectionsClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.RecoveryServicesDataReplication", RecoveryServicesDataReplicationPrivateEndpointConnectionResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(RecoveryServicesDataReplicationPrivateEndpointConnectionResource.ResourceType, out string recoveryServicesDataReplicationPrivateEndpointConnectionPrivateEndpointConnectionsApiVersion); + _recoveryServicesDataReplicationPrivateEndpointConnectionPrivateEndpointConnectionsRestClient = new PrivateEndpointConnectionsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, recoveryServicesDataReplicationPrivateEndpointConnectionPrivateEndpointConnectionsApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != VaultModelResource.ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, VaultModelResource.ResourceType), nameof(id)); + } + + /// + /// Updated the private endpoint connection status (Approval/Rejected). This gets invoked by resource admin. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/privateEndpointConnections/{privateEndpointConnectionName} + /// + /// + /// Operation Id + /// PrivateEndpointConnection_Update + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// 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 private endpoint connection name. + /// Private endpoint connection update input. + /// 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 privateEndpointConnectionName, RecoveryServicesDataReplicationPrivateEndpointConnectionData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(privateEndpointConnectionName, nameof(privateEndpointConnectionName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _recoveryServicesDataReplicationPrivateEndpointConnectionPrivateEndpointConnectionsClientDiagnostics.CreateScope("RecoveryServicesDataReplicationPrivateEndpointConnectionCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = await _recoveryServicesDataReplicationPrivateEndpointConnectionPrivateEndpointConnectionsRestClient.UpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, privateEndpointConnectionName, data, cancellationToken).ConfigureAwait(false); + var uri = _recoveryServicesDataReplicationPrivateEndpointConnectionPrivateEndpointConnectionsRestClient.CreateUpdateRequestUri(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, privateEndpointConnectionName, data); + var rehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(RequestMethod.Put, uri.ToUri(), uri.ToString(), "None", null, OperationFinalStateVia.OriginalUri.ToString()); + var operation = new RecoveryServicesDataReplicationArmOperation(Response.FromValue(new RecoveryServicesDataReplicationPrivateEndpointConnectionResource(Client, response), response.GetRawResponse()), rehydrationToken); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Updated the private endpoint connection status (Approval/Rejected). This gets invoked by resource admin. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/privateEndpointConnections/{privateEndpointConnectionName} + /// + /// + /// Operation Id + /// PrivateEndpointConnection_Update + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// 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 private endpoint connection name. + /// Private endpoint connection update input. + /// 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 privateEndpointConnectionName, RecoveryServicesDataReplicationPrivateEndpointConnectionData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(privateEndpointConnectionName, nameof(privateEndpointConnectionName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _recoveryServicesDataReplicationPrivateEndpointConnectionPrivateEndpointConnectionsClientDiagnostics.CreateScope("RecoveryServicesDataReplicationPrivateEndpointConnectionCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = _recoveryServicesDataReplicationPrivateEndpointConnectionPrivateEndpointConnectionsRestClient.Update(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, privateEndpointConnectionName, data, cancellationToken); + var uri = _recoveryServicesDataReplicationPrivateEndpointConnectionPrivateEndpointConnectionsRestClient.CreateUpdateRequestUri(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, privateEndpointConnectionName, data); + var rehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(RequestMethod.Put, uri.ToUri(), uri.ToString(), "None", null, OperationFinalStateVia.OriginalUri.ToString()); + var operation = new RecoveryServicesDataReplicationArmOperation(Response.FromValue(new RecoveryServicesDataReplicationPrivateEndpointConnectionResource(Client, response), response.GetRawResponse()), rehydrationToken); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets the private endpoint connection details. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/privateEndpointConnections/{privateEndpointConnectionName} + /// + /// + /// Operation Id + /// PrivateEndpointConnection_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The private endpoint connection name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetAsync(string privateEndpointConnectionName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(privateEndpointConnectionName, nameof(privateEndpointConnectionName)); + + using var scope = _recoveryServicesDataReplicationPrivateEndpointConnectionPrivateEndpointConnectionsClientDiagnostics.CreateScope("RecoveryServicesDataReplicationPrivateEndpointConnectionCollection.Get"); + scope.Start(); + try + { + var response = await _recoveryServicesDataReplicationPrivateEndpointConnectionPrivateEndpointConnectionsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, privateEndpointConnectionName, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new RecoveryServicesDataReplicationPrivateEndpointConnectionResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets the private endpoint connection details. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/privateEndpointConnections/{privateEndpointConnectionName} + /// + /// + /// Operation Id + /// PrivateEndpointConnection_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The private endpoint connection name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Get(string privateEndpointConnectionName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(privateEndpointConnectionName, nameof(privateEndpointConnectionName)); + + using var scope = _recoveryServicesDataReplicationPrivateEndpointConnectionPrivateEndpointConnectionsClientDiagnostics.CreateScope("RecoveryServicesDataReplicationPrivateEndpointConnectionCollection.Get"); + scope.Start(); + try + { + var response = _recoveryServicesDataReplicationPrivateEndpointConnectionPrivateEndpointConnectionsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, privateEndpointConnectionName, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new RecoveryServicesDataReplicationPrivateEndpointConnectionResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets the all private endpoint connections configured on the vault. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/privateEndpointConnections + /// + /// + /// Operation Id + /// PrivateEndpointConnection_List + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// 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) => _recoveryServicesDataReplicationPrivateEndpointConnectionPrivateEndpointConnectionsRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _recoveryServicesDataReplicationPrivateEndpointConnectionPrivateEndpointConnectionsRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new RecoveryServicesDataReplicationPrivateEndpointConnectionResource(Client, RecoveryServicesDataReplicationPrivateEndpointConnectionData.DeserializeRecoveryServicesDataReplicationPrivateEndpointConnectionData(e)), _recoveryServicesDataReplicationPrivateEndpointConnectionPrivateEndpointConnectionsClientDiagnostics, Pipeline, "RecoveryServicesDataReplicationPrivateEndpointConnectionCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Gets the all private endpoint connections configured on the vault. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/privateEndpointConnections + /// + /// + /// Operation Id + /// PrivateEndpointConnection_List + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// 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) => _recoveryServicesDataReplicationPrivateEndpointConnectionPrivateEndpointConnectionsRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _recoveryServicesDataReplicationPrivateEndpointConnectionPrivateEndpointConnectionsRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new RecoveryServicesDataReplicationPrivateEndpointConnectionResource(Client, RecoveryServicesDataReplicationPrivateEndpointConnectionData.DeserializeRecoveryServicesDataReplicationPrivateEndpointConnectionData(e)), _recoveryServicesDataReplicationPrivateEndpointConnectionPrivateEndpointConnectionsClientDiagnostics, Pipeline, "RecoveryServicesDataReplicationPrivateEndpointConnectionCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/privateEndpointConnections/{privateEndpointConnectionName} + /// + /// + /// Operation Id + /// PrivateEndpointConnection_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The private endpoint connection name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> ExistsAsync(string privateEndpointConnectionName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(privateEndpointConnectionName, nameof(privateEndpointConnectionName)); + + using var scope = _recoveryServicesDataReplicationPrivateEndpointConnectionPrivateEndpointConnectionsClientDiagnostics.CreateScope("RecoveryServicesDataReplicationPrivateEndpointConnectionCollection.Exists"); + scope.Start(); + try + { + var response = await _recoveryServicesDataReplicationPrivateEndpointConnectionPrivateEndpointConnectionsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, privateEndpointConnectionName, 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.DataReplication/replicationVaults/{vaultName}/privateEndpointConnections/{privateEndpointConnectionName} + /// + /// + /// Operation Id + /// PrivateEndpointConnection_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The private endpoint connection name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Exists(string privateEndpointConnectionName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(privateEndpointConnectionName, nameof(privateEndpointConnectionName)); + + using var scope = _recoveryServicesDataReplicationPrivateEndpointConnectionPrivateEndpointConnectionsClientDiagnostics.CreateScope("RecoveryServicesDataReplicationPrivateEndpointConnectionCollection.Exists"); + scope.Start(); + try + { + var response = _recoveryServicesDataReplicationPrivateEndpointConnectionPrivateEndpointConnectionsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, privateEndpointConnectionName, 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.DataReplication/replicationVaults/{vaultName}/privateEndpointConnections/{privateEndpointConnectionName} + /// + /// + /// Operation Id + /// PrivateEndpointConnection_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The private endpoint connection name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetIfExistsAsync(string privateEndpointConnectionName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(privateEndpointConnectionName, nameof(privateEndpointConnectionName)); + + using var scope = _recoveryServicesDataReplicationPrivateEndpointConnectionPrivateEndpointConnectionsClientDiagnostics.CreateScope("RecoveryServicesDataReplicationPrivateEndpointConnectionCollection.GetIfExists"); + scope.Start(); + try + { + var response = await _recoveryServicesDataReplicationPrivateEndpointConnectionPrivateEndpointConnectionsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, privateEndpointConnectionName, cancellationToken: cancellationToken).ConfigureAwait(false); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new RecoveryServicesDataReplicationPrivateEndpointConnectionResource(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.DataReplication/replicationVaults/{vaultName}/privateEndpointConnections/{privateEndpointConnectionName} + /// + /// + /// Operation Id + /// PrivateEndpointConnection_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The private endpoint connection name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual NullableResponse GetIfExists(string privateEndpointConnectionName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(privateEndpointConnectionName, nameof(privateEndpointConnectionName)); + + using var scope = _recoveryServicesDataReplicationPrivateEndpointConnectionPrivateEndpointConnectionsClientDiagnostics.CreateScope("RecoveryServicesDataReplicationPrivateEndpointConnectionCollection.GetIfExists"); + scope.Start(); + try + { + var response = _recoveryServicesDataReplicationPrivateEndpointConnectionPrivateEndpointConnectionsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, privateEndpointConnectionName, cancellationToken: cancellationToken); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new RecoveryServicesDataReplicationPrivateEndpointConnectionResource(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/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/RecoveryServicesDataReplicationPrivateEndpointConnectionData.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/RecoveryServicesDataReplicationPrivateEndpointConnectionData.Serialization.cs new file mode 100644 index 000000000000..1f69fa685a00 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/RecoveryServicesDataReplicationPrivateEndpointConnectionData.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.Models; +using Azure.ResourceManager.RecoveryServicesDataReplication.Models; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication +{ + public partial class RecoveryServicesDataReplicationPrivateEndpointConnectionData : 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(RecoveryServicesDataReplicationPrivateEndpointConnectionData)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (Optional.IsDefined(Properties)) + { + writer.WritePropertyName("properties"u8); + writer.WriteObjectValue(Properties, options); + } + } + + RecoveryServicesDataReplicationPrivateEndpointConnectionData 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(RecoveryServicesDataReplicationPrivateEndpointConnectionData)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeRecoveryServicesDataReplicationPrivateEndpointConnectionData(document.RootElement, options); + } + + internal static RecoveryServicesDataReplicationPrivateEndpointConnectionData DeserializeRecoveryServicesDataReplicationPrivateEndpointConnectionData(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + PrivateEndpointConnectionResponseProperties 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 = PrivateEndpointConnectionResponseProperties.DeserializePrivateEndpointConnectionResponseProperties(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 RecoveryServicesDataReplicationPrivateEndpointConnectionData( + 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(RecoveryServicesDataReplicationPrivateEndpointConnectionData)} does not support writing '{options.Format}' format."); + } + } + + RecoveryServicesDataReplicationPrivateEndpointConnectionData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeRecoveryServicesDataReplicationPrivateEndpointConnectionData(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(RecoveryServicesDataReplicationPrivateEndpointConnectionData)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/RecoveryServicesDataReplicationPrivateEndpointConnectionData.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/RecoveryServicesDataReplicationPrivateEndpointConnectionData.cs new file mode 100644 index 000000000000..307ddb5cee7f --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/RecoveryServicesDataReplicationPrivateEndpointConnectionData.cs @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; +using Azure.ResourceManager.Models; +using Azure.ResourceManager.RecoveryServicesDataReplication.Models; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication +{ + /// + /// A class representing the RecoveryServicesDataReplicationPrivateEndpointConnection data model. + /// Represents private endpoint connection. + /// + public partial class RecoveryServicesDataReplicationPrivateEndpointConnectionData : 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 RecoveryServicesDataReplicationPrivateEndpointConnectionData() + { + } + + /// 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 RecoveryServicesDataReplicationPrivateEndpointConnectionData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, PrivateEndpointConnectionResponseProperties properties, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) + { + Properties = properties; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The resource-specific properties for this resource. + public PrivateEndpointConnectionResponseProperties Properties { get; set; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/RecoveryServicesDataReplicationPrivateEndpointConnectionResource.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/RecoveryServicesDataReplicationPrivateEndpointConnectionResource.Serialization.cs new file mode 100644 index 000000000000..c5876387e74c --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/RecoveryServicesDataReplicationPrivateEndpointConnectionResource.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.RecoveryServicesDataReplication +{ + public partial class RecoveryServicesDataReplicationPrivateEndpointConnectionResource : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); + + RecoveryServicesDataReplicationPrivateEndpointConnectionData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options); + + RecoveryServicesDataReplicationPrivateEndpointConnectionData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options); + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/RecoveryServicesDataReplicationPrivateEndpointConnectionResource.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/RecoveryServicesDataReplicationPrivateEndpointConnectionResource.cs new file mode 100644 index 000000000000..e966ad260dc8 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/RecoveryServicesDataReplicationPrivateEndpointConnectionResource.cs @@ -0,0 +1,351 @@ +// 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.RecoveryServicesDataReplication +{ + /// + /// A Class representing a RecoveryServicesDataReplicationPrivateEndpointConnection 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 GetRecoveryServicesDataReplicationPrivateEndpointConnectionResource method. + /// Otherwise you can get one from its parent resource using the GetRecoveryServicesDataReplicationPrivateEndpointConnection method. + /// + public partial class RecoveryServicesDataReplicationPrivateEndpointConnectionResource : ArmResource + { + /// Generate the resource identifier of a instance. + /// The subscriptionId. + /// The resourceGroupName. + /// The vaultName. + /// The privateEndpointConnectionName. + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string vaultName, string privateEndpointConnectionName) + { + var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/privateEndpointConnections/{privateEndpointConnectionName}"; + return new ResourceIdentifier(resourceId); + } + + private readonly ClientDiagnostics _recoveryServicesDataReplicationPrivateEndpointConnectionPrivateEndpointConnectionsClientDiagnostics; + private readonly PrivateEndpointConnectionsRestOperations _recoveryServicesDataReplicationPrivateEndpointConnectionPrivateEndpointConnectionsRestClient; + private readonly RecoveryServicesDataReplicationPrivateEndpointConnectionData _data; + + /// Gets the resource type for the operations. + public static readonly ResourceType ResourceType = "Microsoft.DataReplication/replicationVaults/privateEndpointConnections"; + + /// Initializes a new instance of the class for mocking. + protected RecoveryServicesDataReplicationPrivateEndpointConnectionResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal RecoveryServicesDataReplicationPrivateEndpointConnectionResource(ArmClient client, RecoveryServicesDataReplicationPrivateEndpointConnectionData 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 RecoveryServicesDataReplicationPrivateEndpointConnectionResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _recoveryServicesDataReplicationPrivateEndpointConnectionPrivateEndpointConnectionsClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.RecoveryServicesDataReplication", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string recoveryServicesDataReplicationPrivateEndpointConnectionPrivateEndpointConnectionsApiVersion); + _recoveryServicesDataReplicationPrivateEndpointConnectionPrivateEndpointConnectionsRestClient = new PrivateEndpointConnectionsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, recoveryServicesDataReplicationPrivateEndpointConnectionPrivateEndpointConnectionsApiVersion); +#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 RecoveryServicesDataReplicationPrivateEndpointConnectionData 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)); + } + + /// + /// Gets the private endpoint connection details. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/privateEndpointConnections/{privateEndpointConnectionName} + /// + /// + /// Operation Id + /// PrivateEndpointConnection_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _recoveryServicesDataReplicationPrivateEndpointConnectionPrivateEndpointConnectionsClientDiagnostics.CreateScope("RecoveryServicesDataReplicationPrivateEndpointConnectionResource.Get"); + scope.Start(); + try + { + var response = await _recoveryServicesDataReplicationPrivateEndpointConnectionPrivateEndpointConnectionsRestClient.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 RecoveryServicesDataReplicationPrivateEndpointConnectionResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets the private endpoint connection details. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/privateEndpointConnections/{privateEndpointConnectionName} + /// + /// + /// Operation Id + /// PrivateEndpointConnection_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _recoveryServicesDataReplicationPrivateEndpointConnectionPrivateEndpointConnectionsClientDiagnostics.CreateScope("RecoveryServicesDataReplicationPrivateEndpointConnectionResource.Get"); + scope.Start(); + try + { + var response = _recoveryServicesDataReplicationPrivateEndpointConnectionPrivateEndpointConnectionsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new RecoveryServicesDataReplicationPrivateEndpointConnectionResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Deletes the private endpoint connection. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/privateEndpointConnections/{privateEndpointConnectionName} + /// + /// + /// Operation Id + /// PrivateEndpointConnection_Delete + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// 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 = _recoveryServicesDataReplicationPrivateEndpointConnectionPrivateEndpointConnectionsClientDiagnostics.CreateScope("RecoveryServicesDataReplicationPrivateEndpointConnectionResource.Delete"); + scope.Start(); + try + { + var response = await _recoveryServicesDataReplicationPrivateEndpointConnectionPrivateEndpointConnectionsRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + var operation = new RecoveryServicesDataReplicationArmOperation(_recoveryServicesDataReplicationPrivateEndpointConnectionPrivateEndpointConnectionsClientDiagnostics, Pipeline, _recoveryServicesDataReplicationPrivateEndpointConnectionPrivateEndpointConnectionsRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Deletes the private endpoint connection. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/privateEndpointConnections/{privateEndpointConnectionName} + /// + /// + /// Operation Id + /// PrivateEndpointConnection_Delete + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// 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 = _recoveryServicesDataReplicationPrivateEndpointConnectionPrivateEndpointConnectionsClientDiagnostics.CreateScope("RecoveryServicesDataReplicationPrivateEndpointConnectionResource.Delete"); + scope.Start(); + try + { + var response = _recoveryServicesDataReplicationPrivateEndpointConnectionPrivateEndpointConnectionsRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + var operation = new RecoveryServicesDataReplicationArmOperation(_recoveryServicesDataReplicationPrivateEndpointConnectionPrivateEndpointConnectionsClientDiagnostics, Pipeline, _recoveryServicesDataReplicationPrivateEndpointConnectionPrivateEndpointConnectionsRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletionResponse(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Updated the private endpoint connection status (Approval/Rejected). This gets invoked by resource admin. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/privateEndpointConnections/{privateEndpointConnectionName} + /// + /// + /// Operation Id + /// PrivateEndpointConnection_Update + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// 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. + /// Private endpoint connection update input. + /// The cancellation token to use. + /// is null. + public virtual async Task> UpdateAsync(WaitUntil waitUntil, RecoveryServicesDataReplicationPrivateEndpointConnectionData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _recoveryServicesDataReplicationPrivateEndpointConnectionPrivateEndpointConnectionsClientDiagnostics.CreateScope("RecoveryServicesDataReplicationPrivateEndpointConnectionResource.Update"); + scope.Start(); + try + { + var response = await _recoveryServicesDataReplicationPrivateEndpointConnectionPrivateEndpointConnectionsRestClient.UpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, cancellationToken).ConfigureAwait(false); + var uri = _recoveryServicesDataReplicationPrivateEndpointConnectionPrivateEndpointConnectionsRestClient.CreateUpdateRequestUri(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 RecoveryServicesDataReplicationArmOperation(Response.FromValue(new RecoveryServicesDataReplicationPrivateEndpointConnectionResource(Client, response), response.GetRawResponse()), rehydrationToken); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Updated the private endpoint connection status (Approval/Rejected). This gets invoked by resource admin. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/privateEndpointConnections/{privateEndpointConnectionName} + /// + /// + /// Operation Id + /// PrivateEndpointConnection_Update + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// 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. + /// Private endpoint connection update input. + /// The cancellation token to use. + /// is null. + public virtual ArmOperation Update(WaitUntil waitUntil, RecoveryServicesDataReplicationPrivateEndpointConnectionData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _recoveryServicesDataReplicationPrivateEndpointConnectionPrivateEndpointConnectionsClientDiagnostics.CreateScope("RecoveryServicesDataReplicationPrivateEndpointConnectionResource.Update"); + scope.Start(); + try + { + var response = _recoveryServicesDataReplicationPrivateEndpointConnectionPrivateEndpointConnectionsRestClient.Update(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, cancellationToken); + var uri = _recoveryServicesDataReplicationPrivateEndpointConnectionPrivateEndpointConnectionsRestClient.CreateUpdateRequestUri(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 RecoveryServicesDataReplicationArmOperation(Response.FromValue(new RecoveryServicesDataReplicationPrivateEndpointConnectionResource(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/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/RecoveryServicesDataReplicationPrivateLinkResourceDataCollection.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/RecoveryServicesDataReplicationPrivateLinkResourceDataCollection.cs new file mode 100644 index 000000000000..c8d4adc26124 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/RecoveryServicesDataReplicationPrivateLinkResourceDataCollection.cs @@ -0,0 +1,395 @@ +// 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.RecoveryServicesDataReplication +{ + /// + /// 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 GetRecoveryServicesDataReplicationPrivateLinkResourceData method from an instance of . + /// + public partial class RecoveryServicesDataReplicationPrivateLinkResourceDataCollection : ArmCollection, IEnumerable, IAsyncEnumerable + { + private readonly ClientDiagnostics _recoveryServicesDataReplicationPrivateLinkResourceDataPrivateLinkResourcesClientDiagnostics; + private readonly PrivateLinkResourcesRestOperations _recoveryServicesDataReplicationPrivateLinkResourceDataPrivateLinkResourcesRestClient; + + /// Initializes a new instance of the class for mocking. + protected RecoveryServicesDataReplicationPrivateLinkResourceDataCollection() + { + } + + /// 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 RecoveryServicesDataReplicationPrivateLinkResourceDataCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _recoveryServicesDataReplicationPrivateLinkResourceDataPrivateLinkResourcesClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.RecoveryServicesDataReplication", RecoveryServicesDataReplicationPrivateLinkResourceDataResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(RecoveryServicesDataReplicationPrivateLinkResourceDataResource.ResourceType, out string recoveryServicesDataReplicationPrivateLinkResourceDataPrivateLinkResourcesApiVersion); + _recoveryServicesDataReplicationPrivateLinkResourceDataPrivateLinkResourcesRestClient = new PrivateLinkResourcesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, recoveryServicesDataReplicationPrivateLinkResourceDataPrivateLinkResourcesApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != VaultModelResource.ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, VaultModelResource.ResourceType), nameof(id)); + } + + /// + /// Gets the details of site recovery private link resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/privateLinkResources/{privateLinkResourceName} + /// + /// + /// Operation Id + /// PrivateLinkResource_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The private link name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetAsync(string privateLinkResourceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(privateLinkResourceName, nameof(privateLinkResourceName)); + + using var scope = _recoveryServicesDataReplicationPrivateLinkResourceDataPrivateLinkResourcesClientDiagnostics.CreateScope("RecoveryServicesDataReplicationPrivateLinkResourceDataCollection.Get"); + scope.Start(); + try + { + var response = await _recoveryServicesDataReplicationPrivateLinkResourceDataPrivateLinkResourcesRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, privateLinkResourceName, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new RecoveryServicesDataReplicationPrivateLinkResourceDataResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets the details of site recovery private link resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/privateLinkResources/{privateLinkResourceName} + /// + /// + /// Operation Id + /// PrivateLinkResource_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The private link name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Get(string privateLinkResourceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(privateLinkResourceName, nameof(privateLinkResourceName)); + + using var scope = _recoveryServicesDataReplicationPrivateLinkResourceDataPrivateLinkResourcesClientDiagnostics.CreateScope("RecoveryServicesDataReplicationPrivateLinkResourceDataCollection.Get"); + scope.Start(); + try + { + var response = _recoveryServicesDataReplicationPrivateLinkResourceDataPrivateLinkResourcesRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, privateLinkResourceName, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new RecoveryServicesDataReplicationPrivateLinkResourceDataResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets the list of private link resources. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/privateLinkResources + /// + /// + /// Operation Id + /// PrivateLinkResource_List + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// 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) => _recoveryServicesDataReplicationPrivateLinkResourceDataPrivateLinkResourcesRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _recoveryServicesDataReplicationPrivateLinkResourceDataPrivateLinkResourcesRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new RecoveryServicesDataReplicationPrivateLinkResourceDataResource(Client, RecoveryServicesDataReplicationPrivateLinkResourceDataData.DeserializeRecoveryServicesDataReplicationPrivateLinkResourceDataData(e)), _recoveryServicesDataReplicationPrivateLinkResourceDataPrivateLinkResourcesClientDiagnostics, Pipeline, "RecoveryServicesDataReplicationPrivateLinkResourceDataCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Gets the list of private link resources. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/privateLinkResources + /// + /// + /// Operation Id + /// PrivateLinkResource_List + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// 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) => _recoveryServicesDataReplicationPrivateLinkResourceDataPrivateLinkResourcesRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _recoveryServicesDataReplicationPrivateLinkResourceDataPrivateLinkResourcesRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new RecoveryServicesDataReplicationPrivateLinkResourceDataResource(Client, RecoveryServicesDataReplicationPrivateLinkResourceDataData.DeserializeRecoveryServicesDataReplicationPrivateLinkResourceDataData(e)), _recoveryServicesDataReplicationPrivateLinkResourceDataPrivateLinkResourcesClientDiagnostics, Pipeline, "RecoveryServicesDataReplicationPrivateLinkResourceDataCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/privateLinkResources/{privateLinkResourceName} + /// + /// + /// Operation Id + /// PrivateLinkResource_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The private link name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> ExistsAsync(string privateLinkResourceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(privateLinkResourceName, nameof(privateLinkResourceName)); + + using var scope = _recoveryServicesDataReplicationPrivateLinkResourceDataPrivateLinkResourcesClientDiagnostics.CreateScope("RecoveryServicesDataReplicationPrivateLinkResourceDataCollection.Exists"); + scope.Start(); + try + { + var response = await _recoveryServicesDataReplicationPrivateLinkResourceDataPrivateLinkResourcesRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, privateLinkResourceName, 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.DataReplication/replicationVaults/{vaultName}/privateLinkResources/{privateLinkResourceName} + /// + /// + /// Operation Id + /// PrivateLinkResource_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The private link name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Exists(string privateLinkResourceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(privateLinkResourceName, nameof(privateLinkResourceName)); + + using var scope = _recoveryServicesDataReplicationPrivateLinkResourceDataPrivateLinkResourcesClientDiagnostics.CreateScope("RecoveryServicesDataReplicationPrivateLinkResourceDataCollection.Exists"); + scope.Start(); + try + { + var response = _recoveryServicesDataReplicationPrivateLinkResourceDataPrivateLinkResourcesRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, privateLinkResourceName, 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.DataReplication/replicationVaults/{vaultName}/privateLinkResources/{privateLinkResourceName} + /// + /// + /// Operation Id + /// PrivateLinkResource_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The private link name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetIfExistsAsync(string privateLinkResourceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(privateLinkResourceName, nameof(privateLinkResourceName)); + + using var scope = _recoveryServicesDataReplicationPrivateLinkResourceDataPrivateLinkResourcesClientDiagnostics.CreateScope("RecoveryServicesDataReplicationPrivateLinkResourceDataCollection.GetIfExists"); + scope.Start(); + try + { + var response = await _recoveryServicesDataReplicationPrivateLinkResourceDataPrivateLinkResourcesRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, privateLinkResourceName, cancellationToken: cancellationToken).ConfigureAwait(false); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new RecoveryServicesDataReplicationPrivateLinkResourceDataResource(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.DataReplication/replicationVaults/{vaultName}/privateLinkResources/{privateLinkResourceName} + /// + /// + /// Operation Id + /// PrivateLinkResource_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The private link name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual NullableResponse GetIfExists(string privateLinkResourceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(privateLinkResourceName, nameof(privateLinkResourceName)); + + using var scope = _recoveryServicesDataReplicationPrivateLinkResourceDataPrivateLinkResourcesClientDiagnostics.CreateScope("RecoveryServicesDataReplicationPrivateLinkResourceDataCollection.GetIfExists"); + scope.Start(); + try + { + var response = _recoveryServicesDataReplicationPrivateLinkResourceDataPrivateLinkResourcesRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, privateLinkResourceName, cancellationToken: cancellationToken); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new RecoveryServicesDataReplicationPrivateLinkResourceDataResource(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/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/RecoveryServicesDataReplicationPrivateLinkResourceDataData.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/RecoveryServicesDataReplicationPrivateLinkResourceDataData.Serialization.cs new file mode 100644 index 000000000000..8b632f9b35f9 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/RecoveryServicesDataReplicationPrivateLinkResourceDataData.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.Models; +using Azure.ResourceManager.RecoveryServicesDataReplication.Models; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication +{ + public partial class RecoveryServicesDataReplicationPrivateLinkResourceDataData : 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(RecoveryServicesDataReplicationPrivateLinkResourceDataData)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (Optional.IsDefined(Properties)) + { + writer.WritePropertyName("properties"u8); + writer.WriteObjectValue(Properties, options); + } + } + + RecoveryServicesDataReplicationPrivateLinkResourceDataData 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(RecoveryServicesDataReplicationPrivateLinkResourceDataData)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeRecoveryServicesDataReplicationPrivateLinkResourceDataData(document.RootElement, options); + } + + internal static RecoveryServicesDataReplicationPrivateLinkResourceDataData DeserializeRecoveryServicesDataReplicationPrivateLinkResourceDataData(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + RecoveryServicesDataReplicationPrivateLinkResourceProperties 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 = RecoveryServicesDataReplicationPrivateLinkResourceProperties.DeserializeRecoveryServicesDataReplicationPrivateLinkResourceProperties(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 RecoveryServicesDataReplicationPrivateLinkResourceDataData( + 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(RecoveryServicesDataReplicationPrivateLinkResourceDataData)} does not support writing '{options.Format}' format."); + } + } + + RecoveryServicesDataReplicationPrivateLinkResourceDataData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeRecoveryServicesDataReplicationPrivateLinkResourceDataData(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(RecoveryServicesDataReplicationPrivateLinkResourceDataData)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/RecoveryServicesDataReplicationPrivateLinkResourceDataData.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/RecoveryServicesDataReplicationPrivateLinkResourceDataData.cs new file mode 100644 index 000000000000..51ca1dbfa8f0 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/RecoveryServicesDataReplicationPrivateLinkResourceDataData.cs @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; +using Azure.ResourceManager.Models; +using Azure.ResourceManager.RecoveryServicesDataReplication.Models; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication +{ + /// + /// A class representing the RecoveryServicesDataReplicationPrivateLinkResourceData data model. + /// Represents private link resource. + /// + public partial class RecoveryServicesDataReplicationPrivateLinkResourceDataData : 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 . + internal RecoveryServicesDataReplicationPrivateLinkResourceDataData() + { + } + + /// 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 RecoveryServicesDataReplicationPrivateLinkResourceDataData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, RecoveryServicesDataReplicationPrivateLinkResourceProperties properties, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) + { + Properties = properties; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The resource-specific properties for this resource. + public RecoveryServicesDataReplicationPrivateLinkResourceProperties Properties { get; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/RecoveryServicesDataReplicationPrivateLinkResourceDataResource.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/RecoveryServicesDataReplicationPrivateLinkResourceDataResource.Serialization.cs new file mode 100644 index 000000000000..d9e36a235227 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/RecoveryServicesDataReplicationPrivateLinkResourceDataResource.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.RecoveryServicesDataReplication +{ + public partial class RecoveryServicesDataReplicationPrivateLinkResourceDataResource : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); + + RecoveryServicesDataReplicationPrivateLinkResourceDataData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options); + + RecoveryServicesDataReplicationPrivateLinkResourceDataData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options); + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/RecoveryServicesDataReplicationPrivateLinkResourceDataResource.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/RecoveryServicesDataReplicationPrivateLinkResourceDataResource.cs new file mode 100644 index 000000000000..30233857ef34 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/RecoveryServicesDataReplicationPrivateLinkResourceDataResource.cs @@ -0,0 +1,171 @@ +// 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.RecoveryServicesDataReplication +{ + /// + /// A Class representing a RecoveryServicesDataReplicationPrivateLinkResourceData 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 GetRecoveryServicesDataReplicationPrivateLinkResourceDataResource method. + /// Otherwise you can get one from its parent resource using the GetRecoveryServicesDataReplicationPrivateLinkResourceData method. + /// + public partial class RecoveryServicesDataReplicationPrivateLinkResourceDataResource : ArmResource + { + /// Generate the resource identifier of a instance. + /// The subscriptionId. + /// The resourceGroupName. + /// The vaultName. + /// The privateLinkResourceName. + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string vaultName, string privateLinkResourceName) + { + var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/privateLinkResources/{privateLinkResourceName}"; + return new ResourceIdentifier(resourceId); + } + + private readonly ClientDiagnostics _recoveryServicesDataReplicationPrivateLinkResourceDataPrivateLinkResourcesClientDiagnostics; + private readonly PrivateLinkResourcesRestOperations _recoveryServicesDataReplicationPrivateLinkResourceDataPrivateLinkResourcesRestClient; + private readonly RecoveryServicesDataReplicationPrivateLinkResourceDataData _data; + + /// Gets the resource type for the operations. + public static readonly ResourceType ResourceType = "Microsoft.DataReplication/replicationVaults/privateLinkResources"; + + /// Initializes a new instance of the class for mocking. + protected RecoveryServicesDataReplicationPrivateLinkResourceDataResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal RecoveryServicesDataReplicationPrivateLinkResourceDataResource(ArmClient client, RecoveryServicesDataReplicationPrivateLinkResourceDataData 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 RecoveryServicesDataReplicationPrivateLinkResourceDataResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _recoveryServicesDataReplicationPrivateLinkResourceDataPrivateLinkResourcesClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.RecoveryServicesDataReplication", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string recoveryServicesDataReplicationPrivateLinkResourceDataPrivateLinkResourcesApiVersion); + _recoveryServicesDataReplicationPrivateLinkResourceDataPrivateLinkResourcesRestClient = new PrivateLinkResourcesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, recoveryServicesDataReplicationPrivateLinkResourceDataPrivateLinkResourcesApiVersion); +#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 RecoveryServicesDataReplicationPrivateLinkResourceDataData 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)); + } + + /// + /// Gets the details of site recovery private link resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/privateLinkResources/{privateLinkResourceName} + /// + /// + /// Operation Id + /// PrivateLinkResource_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _recoveryServicesDataReplicationPrivateLinkResourceDataPrivateLinkResourcesClientDiagnostics.CreateScope("RecoveryServicesDataReplicationPrivateLinkResourceDataResource.Get"); + scope.Start(); + try + { + var response = await _recoveryServicesDataReplicationPrivateLinkResourceDataPrivateLinkResourcesRestClient.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 RecoveryServicesDataReplicationPrivateLinkResourceDataResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets the details of site recovery private link resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/privateLinkResources/{privateLinkResourceName} + /// + /// + /// Operation Id + /// PrivateLinkResource_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _recoveryServicesDataReplicationPrivateLinkResourceDataPrivateLinkResourcesClientDiagnostics.CreateScope("RecoveryServicesDataReplicationPrivateLinkResourceDataResource.Get"); + scope.Start(); + try + { + var response = _recoveryServicesDataReplicationPrivateLinkResourceDataPrivateLinkResourcesRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new RecoveryServicesDataReplicationPrivateLinkResourceDataResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/ReplicationExtensionModelCollection.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/ReplicationExtensionModelCollection.cs new file mode 100644 index 000000000000..3fcdcef988e3 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/ReplicationExtensionModelCollection.cs @@ -0,0 +1,493 @@ +// 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.RecoveryServicesDataReplication +{ + /// + /// 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 GetReplicationExtensionModels method from an instance of . + /// + public partial class ReplicationExtensionModelCollection : ArmCollection, IEnumerable, IAsyncEnumerable + { + private readonly ClientDiagnostics _replicationExtensionModelReplicationExtensionClientDiagnostics; + private readonly ReplicationExtensionRestOperations _replicationExtensionModelReplicationExtensionRestClient; + + /// Initializes a new instance of the class for mocking. + protected ReplicationExtensionModelCollection() + { + } + + /// 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 ReplicationExtensionModelCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _replicationExtensionModelReplicationExtensionClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.RecoveryServicesDataReplication", ReplicationExtensionModelResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ReplicationExtensionModelResource.ResourceType, out string replicationExtensionModelReplicationExtensionApiVersion); + _replicationExtensionModelReplicationExtensionRestClient = new ReplicationExtensionRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, replicationExtensionModelReplicationExtensionApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != VaultModelResource.ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, VaultModelResource.ResourceType), nameof(id)); + } + + /// + /// Creates the replication extension in the given vault. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/replicationExtensions/{replicationExtensionName} + /// + /// + /// Operation Id + /// ReplicationExtensionModel_Create + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// 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 replication extension name. + /// Replication extension model. + /// 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 replicationExtensionName, ReplicationExtensionModelData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(replicationExtensionName, nameof(replicationExtensionName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _replicationExtensionModelReplicationExtensionClientDiagnostics.CreateScope("ReplicationExtensionModelCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = await _replicationExtensionModelReplicationExtensionRestClient.CreateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, replicationExtensionName, data, cancellationToken).ConfigureAwait(false); + var operation = new RecoveryServicesDataReplicationArmOperation(new ReplicationExtensionModelOperationSource(Client), _replicationExtensionModelReplicationExtensionClientDiagnostics, Pipeline, _replicationExtensionModelReplicationExtensionRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, replicationExtensionName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Creates the replication extension in the given vault. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/replicationExtensions/{replicationExtensionName} + /// + /// + /// Operation Id + /// ReplicationExtensionModel_Create + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// 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 replication extension name. + /// Replication extension model. + /// 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 replicationExtensionName, ReplicationExtensionModelData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(replicationExtensionName, nameof(replicationExtensionName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _replicationExtensionModelReplicationExtensionClientDiagnostics.CreateScope("ReplicationExtensionModelCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = _replicationExtensionModelReplicationExtensionRestClient.Create(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, replicationExtensionName, data, cancellationToken); + var operation = new RecoveryServicesDataReplicationArmOperation(new ReplicationExtensionModelOperationSource(Client), _replicationExtensionModelReplicationExtensionClientDiagnostics, Pipeline, _replicationExtensionModelReplicationExtensionRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, replicationExtensionName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets the details of the replication extension. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/replicationExtensions/{replicationExtensionName} + /// + /// + /// Operation Id + /// ReplicationExtensionModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The replication extension name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetAsync(string replicationExtensionName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(replicationExtensionName, nameof(replicationExtensionName)); + + using var scope = _replicationExtensionModelReplicationExtensionClientDiagnostics.CreateScope("ReplicationExtensionModelCollection.Get"); + scope.Start(); + try + { + var response = await _replicationExtensionModelReplicationExtensionRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, replicationExtensionName, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new ReplicationExtensionModelResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets the details of the replication extension. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/replicationExtensions/{replicationExtensionName} + /// + /// + /// Operation Id + /// ReplicationExtensionModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The replication extension name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Get(string replicationExtensionName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(replicationExtensionName, nameof(replicationExtensionName)); + + using var scope = _replicationExtensionModelReplicationExtensionClientDiagnostics.CreateScope("ReplicationExtensionModelCollection.Get"); + scope.Start(); + try + { + var response = _replicationExtensionModelReplicationExtensionRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, replicationExtensionName, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new ReplicationExtensionModelResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets the list of replication extensions in the given vault. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/replicationExtensions + /// + /// + /// Operation Id + /// ReplicationExtensionModel_List + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// 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) => _replicationExtensionModelReplicationExtensionRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _replicationExtensionModelReplicationExtensionRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new ReplicationExtensionModelResource(Client, ReplicationExtensionModelData.DeserializeReplicationExtensionModelData(e)), _replicationExtensionModelReplicationExtensionClientDiagnostics, Pipeline, "ReplicationExtensionModelCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Gets the list of replication extensions in the given vault. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/replicationExtensions + /// + /// + /// Operation Id + /// ReplicationExtensionModel_List + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// 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) => _replicationExtensionModelReplicationExtensionRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _replicationExtensionModelReplicationExtensionRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new ReplicationExtensionModelResource(Client, ReplicationExtensionModelData.DeserializeReplicationExtensionModelData(e)), _replicationExtensionModelReplicationExtensionClientDiagnostics, Pipeline, "ReplicationExtensionModelCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/replicationExtensions/{replicationExtensionName} + /// + /// + /// Operation Id + /// ReplicationExtensionModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The replication extension name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> ExistsAsync(string replicationExtensionName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(replicationExtensionName, nameof(replicationExtensionName)); + + using var scope = _replicationExtensionModelReplicationExtensionClientDiagnostics.CreateScope("ReplicationExtensionModelCollection.Exists"); + scope.Start(); + try + { + var response = await _replicationExtensionModelReplicationExtensionRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, replicationExtensionName, 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.DataReplication/replicationVaults/{vaultName}/replicationExtensions/{replicationExtensionName} + /// + /// + /// Operation Id + /// ReplicationExtensionModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The replication extension name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Exists(string replicationExtensionName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(replicationExtensionName, nameof(replicationExtensionName)); + + using var scope = _replicationExtensionModelReplicationExtensionClientDiagnostics.CreateScope("ReplicationExtensionModelCollection.Exists"); + scope.Start(); + try + { + var response = _replicationExtensionModelReplicationExtensionRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, replicationExtensionName, 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.DataReplication/replicationVaults/{vaultName}/replicationExtensions/{replicationExtensionName} + /// + /// + /// Operation Id + /// ReplicationExtensionModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The replication extension name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetIfExistsAsync(string replicationExtensionName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(replicationExtensionName, nameof(replicationExtensionName)); + + using var scope = _replicationExtensionModelReplicationExtensionClientDiagnostics.CreateScope("ReplicationExtensionModelCollection.GetIfExists"); + scope.Start(); + try + { + var response = await _replicationExtensionModelReplicationExtensionRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, replicationExtensionName, cancellationToken: cancellationToken).ConfigureAwait(false); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new ReplicationExtensionModelResource(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.DataReplication/replicationVaults/{vaultName}/replicationExtensions/{replicationExtensionName} + /// + /// + /// Operation Id + /// ReplicationExtensionModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The replication extension name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual NullableResponse GetIfExists(string replicationExtensionName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(replicationExtensionName, nameof(replicationExtensionName)); + + using var scope = _replicationExtensionModelReplicationExtensionClientDiagnostics.CreateScope("ReplicationExtensionModelCollection.GetIfExists"); + scope.Start(); + try + { + var response = _replicationExtensionModelReplicationExtensionRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, replicationExtensionName, cancellationToken: cancellationToken); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new ReplicationExtensionModelResource(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/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/ReplicationExtensionModelData.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/ReplicationExtensionModelData.Serialization.cs new file mode 100644 index 000000000000..41f09887d3ff --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/ReplicationExtensionModelData.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.Models; +using Azure.ResourceManager.RecoveryServicesDataReplication.Models; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication +{ + public partial class ReplicationExtensionModelData : 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(ReplicationExtensionModelData)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (Optional.IsDefined(Properties)) + { + writer.WritePropertyName("properties"u8); + writer.WriteObjectValue(Properties, options); + } + } + + ReplicationExtensionModelData 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(ReplicationExtensionModelData)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeReplicationExtensionModelData(document.RootElement, options); + } + + internal static ReplicationExtensionModelData DeserializeReplicationExtensionModelData(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ReplicationExtensionModelProperties 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 = ReplicationExtensionModelProperties.DeserializeReplicationExtensionModelProperties(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 ReplicationExtensionModelData( + 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(ReplicationExtensionModelData)} does not support writing '{options.Format}' format."); + } + } + + ReplicationExtensionModelData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeReplicationExtensionModelData(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ReplicationExtensionModelData)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/ReplicationExtensionModelData.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/ReplicationExtensionModelData.cs new file mode 100644 index 000000000000..b5d07f0a428a --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/ReplicationExtensionModelData.cs @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; +using Azure.ResourceManager.Models; +using Azure.ResourceManager.RecoveryServicesDataReplication.Models; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication +{ + /// + /// A class representing the ReplicationExtensionModel data model. + /// Replication extension model. + /// + public partial class ReplicationExtensionModelData : 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 ReplicationExtensionModelData() + { + } + + /// 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 ReplicationExtensionModelData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, ReplicationExtensionModelProperties properties, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) + { + Properties = properties; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The resource-specific properties for this resource. + public ReplicationExtensionModelProperties Properties { get; set; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/ReplicationExtensionModelResource.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/ReplicationExtensionModelResource.Serialization.cs new file mode 100644 index 000000000000..6ac5e5e0fb4c --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/ReplicationExtensionModelResource.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.RecoveryServicesDataReplication +{ + public partial class ReplicationExtensionModelResource : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); + + ReplicationExtensionModelData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options); + + ReplicationExtensionModelData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options); + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/ReplicationExtensionModelResource.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/ReplicationExtensionModelResource.cs new file mode 100644 index 000000000000..79fc95313467 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/ReplicationExtensionModelResource.cs @@ -0,0 +1,347 @@ +// 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.RecoveryServicesDataReplication +{ + /// + /// A Class representing a ReplicationExtensionModel 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 GetReplicationExtensionModelResource method. + /// Otherwise you can get one from its parent resource using the GetReplicationExtensionModel method. + /// + public partial class ReplicationExtensionModelResource : ArmResource + { + /// Generate the resource identifier of a instance. + /// The subscriptionId. + /// The resourceGroupName. + /// The vaultName. + /// The replicationExtensionName. + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string vaultName, string replicationExtensionName) + { + var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/replicationExtensions/{replicationExtensionName}"; + return new ResourceIdentifier(resourceId); + } + + private readonly ClientDiagnostics _replicationExtensionModelReplicationExtensionClientDiagnostics; + private readonly ReplicationExtensionRestOperations _replicationExtensionModelReplicationExtensionRestClient; + private readonly ReplicationExtensionModelData _data; + + /// Gets the resource type for the operations. + public static readonly ResourceType ResourceType = "Microsoft.DataReplication/replicationVaults/replicationExtensions"; + + /// Initializes a new instance of the class for mocking. + protected ReplicationExtensionModelResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal ReplicationExtensionModelResource(ArmClient client, ReplicationExtensionModelData 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 ReplicationExtensionModelResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _replicationExtensionModelReplicationExtensionClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.RecoveryServicesDataReplication", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string replicationExtensionModelReplicationExtensionApiVersion); + _replicationExtensionModelReplicationExtensionRestClient = new ReplicationExtensionRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, replicationExtensionModelReplicationExtensionApiVersion); +#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 ReplicationExtensionModelData 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)); + } + + /// + /// Gets the details of the replication extension. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/replicationExtensions/{replicationExtensionName} + /// + /// + /// Operation Id + /// ReplicationExtensionModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _replicationExtensionModelReplicationExtensionClientDiagnostics.CreateScope("ReplicationExtensionModelResource.Get"); + scope.Start(); + try + { + var response = await _replicationExtensionModelReplicationExtensionRestClient.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 ReplicationExtensionModelResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets the details of the replication extension. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/replicationExtensions/{replicationExtensionName} + /// + /// + /// Operation Id + /// ReplicationExtensionModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _replicationExtensionModelReplicationExtensionClientDiagnostics.CreateScope("ReplicationExtensionModelResource.Get"); + scope.Start(); + try + { + var response = _replicationExtensionModelReplicationExtensionRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new ReplicationExtensionModelResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Deletes the replication extension in the given vault. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/replicationExtensions/{replicationExtensionName} + /// + /// + /// Operation Id + /// ReplicationExtensionModel_Delete + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// 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 = _replicationExtensionModelReplicationExtensionClientDiagnostics.CreateScope("ReplicationExtensionModelResource.Delete"); + scope.Start(); + try + { + var response = await _replicationExtensionModelReplicationExtensionRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + var operation = new RecoveryServicesDataReplicationArmOperation(_replicationExtensionModelReplicationExtensionClientDiagnostics, Pipeline, _replicationExtensionModelReplicationExtensionRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Deletes the replication extension in the given vault. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/replicationExtensions/{replicationExtensionName} + /// + /// + /// Operation Id + /// ReplicationExtensionModel_Delete + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// 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 = _replicationExtensionModelReplicationExtensionClientDiagnostics.CreateScope("ReplicationExtensionModelResource.Delete"); + scope.Start(); + try + { + var response = _replicationExtensionModelReplicationExtensionRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + var operation = new RecoveryServicesDataReplicationArmOperation(_replicationExtensionModelReplicationExtensionClientDiagnostics, Pipeline, _replicationExtensionModelReplicationExtensionRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletionResponse(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Creates the replication extension in the given vault. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/replicationExtensions/{replicationExtensionName} + /// + /// + /// Operation Id + /// ReplicationExtensionModel_Create + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// 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. + /// Replication extension model. + /// The cancellation token to use. + /// is null. + public virtual async Task> UpdateAsync(WaitUntil waitUntil, ReplicationExtensionModelData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _replicationExtensionModelReplicationExtensionClientDiagnostics.CreateScope("ReplicationExtensionModelResource.Update"); + scope.Start(); + try + { + var response = await _replicationExtensionModelReplicationExtensionRestClient.CreateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, cancellationToken).ConfigureAwait(false); + var operation = new RecoveryServicesDataReplicationArmOperation(new ReplicationExtensionModelOperationSource(Client), _replicationExtensionModelReplicationExtensionClientDiagnostics, Pipeline, _replicationExtensionModelReplicationExtensionRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Creates the replication extension in the given vault. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/replicationExtensions/{replicationExtensionName} + /// + /// + /// Operation Id + /// ReplicationExtensionModel_Create + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// 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. + /// Replication extension model. + /// The cancellation token to use. + /// is null. + public virtual ArmOperation Update(WaitUntil waitUntil, ReplicationExtensionModelData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _replicationExtensionModelReplicationExtensionClientDiagnostics.CreateScope("ReplicationExtensionModelResource.Update"); + scope.Start(); + try + { + var response = _replicationExtensionModelReplicationExtensionRestClient.Create(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, cancellationToken); + var operation = new RecoveryServicesDataReplicationArmOperation(new ReplicationExtensionModelOperationSource(Client), _replicationExtensionModelReplicationExtensionClientDiagnostics, Pipeline, _replicationExtensionModelReplicationExtensionRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/RestOperations/CheckNameAvailabilityRestOperations.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/RestOperations/CheckNameAvailabilityRestOperations.cs new file mode 100644 index 000000000000..3e1a81781f06 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/RestOperations/CheckNameAvailabilityRestOperations.cs @@ -0,0 +1,132 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.RecoveryServicesDataReplication.Models; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication +{ + internal partial class CheckNameAvailabilityRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of CheckNameAvailabilityRestOperations. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// The application id to use for user agent. + /// Service host. + /// The API version to use for this operation. + /// or is null. + public CheckNameAvailabilityRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + { + _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); + _endpoint = endpoint ?? new Uri("https://management.azure.com"); + _apiVersion = apiVersion ?? "2024-09-01"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreatePostRequestUri(string subscriptionId, AzureLocation location, CheckNameAvailabilityModel body) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/providers/Microsoft.DataReplication/locations/", false); + uri.AppendPath(location, true); + uri.AppendPath("/checkNameAvailability", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreatePostRequest(string subscriptionId, AzureLocation location, CheckNameAvailabilityModel body) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/providers/Microsoft.DataReplication/locations/", false); + uri.AppendPath(location, true); + uri.AppendPath("/checkNameAvailability", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + if (body != null) + { + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(body, ModelSerializationExtensions.WireOptions); + request.Content = content; + } + _userAgent.Apply(message); + return message; + } + + /// Checks the resource name availability. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the Azure region. + /// Resource details. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + public async Task> PostAsync(string subscriptionId, AzureLocation location, CheckNameAvailabilityModel body = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + + using var message = CreatePostRequest(subscriptionId, location, body); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + CheckNameAvailabilityResponseModel value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = CheckNameAvailabilityResponseModel.DeserializeCheckNameAvailabilityResponseModel(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Checks the resource name availability. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the Azure region. + /// Resource details. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + public Response Post(string subscriptionId, AzureLocation location, CheckNameAvailabilityModel body = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + + using var message = CreatePostRequest(subscriptionId, location, body); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + CheckNameAvailabilityResponseModel value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = CheckNameAvailabilityResponseModel.DeserializeCheckNameAvailabilityResponseModel(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/RestOperations/DeploymentPreflightRestOperations.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/RestOperations/DeploymentPreflightRestOperations.cs new file mode 100644 index 000000000000..0ca03badb870 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/RestOperations/DeploymentPreflightRestOperations.cs @@ -0,0 +1,142 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.RecoveryServicesDataReplication.Models; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication +{ + internal partial class DeploymentPreflightRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of DeploymentPreflightRestOperations. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// The application id to use for user agent. + /// Service host. + /// The API version to use for this operation. + /// or is null. + public DeploymentPreflightRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + { + _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); + _endpoint = endpoint ?? new Uri("https://management.azure.com"); + _apiVersion = apiVersion ?? "2024-09-01"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreatePostRequestUri(string subscriptionId, string resourceGroupName, string deploymentId, DeploymentPreflightModel body) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DataReplication/deployments/", false); + uri.AppendPath(deploymentId, true); + uri.AppendPath("/preflight", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreatePostRequest(string subscriptionId, string resourceGroupName, string deploymentId, DeploymentPreflightModel body) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DataReplication/deployments/", false); + uri.AppendPath(deploymentId, true); + uri.AppendPath("/preflight", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + if (body != null) + { + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(body, ModelSerializationExtensions.WireOptions); + request.Content = content; + } + _userAgent.Apply(message); + return message; + } + + /// Performs resource deployment preflight validation. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Deployment Id. + /// Deployment preflight model. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> PostAsync(string subscriptionId, string resourceGroupName, string deploymentId, DeploymentPreflightModel body = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(deploymentId, nameof(deploymentId)); + + using var message = CreatePostRequest(subscriptionId, resourceGroupName, deploymentId, body); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + DeploymentPreflightModel value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = DeploymentPreflightModel.DeserializeDeploymentPreflightModel(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Performs resource deployment preflight validation. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Deployment Id. + /// Deployment preflight model. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response Post(string subscriptionId, string resourceGroupName, string deploymentId, DeploymentPreflightModel body = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(deploymentId, nameof(deploymentId)); + + using var message = CreatePostRequest(subscriptionId, resourceGroupName, deploymentId, body); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + DeploymentPreflightModel value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = DeploymentPreflightModel.DeserializeDeploymentPreflightModel(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/RestOperations/EmailConfigurationRestOperations.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/RestOperations/EmailConfigurationRestOperations.cs new file mode 100644 index 000000000000..d30a2223ec48 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/RestOperations/EmailConfigurationRestOperations.cs @@ -0,0 +1,431 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.RecoveryServicesDataReplication.Models; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication +{ + internal partial class EmailConfigurationRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of EmailConfigurationRestOperations. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// The application id to use for user agent. + /// Service host. + /// The API version to use for this operation. + /// or is null. + public EmailConfigurationRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + { + _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); + _endpoint = endpoint ?? new Uri("https://management.azure.com"); + _apiVersion = apiVersion ?? "2024-09-01"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string vaultName, string emailConfigurationName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DataReplication/replicationVaults/", false); + uri.AppendPath(vaultName, true); + uri.AppendPath("/alertSettings/", false); + uri.AppendPath(emailConfigurationName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string vaultName, string emailConfigurationName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DataReplication/replicationVaults/", false); + uri.AppendPath(vaultName, true); + uri.AppendPath("/alertSettings/", false); + uri.AppendPath(emailConfigurationName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Gets the details of the alert configuration setting. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The vault name. + /// The email configuration name. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task> GetAsync(string subscriptionId, string resourceGroupName, string vaultName, string emailConfigurationName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + Argument.AssertNotNullOrEmpty(emailConfigurationName, nameof(emailConfigurationName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, vaultName, emailConfigurationName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + EmailConfigurationModelData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = EmailConfigurationModelData.DeserializeEmailConfigurationModelData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((EmailConfigurationModelData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// Gets the details of the alert configuration setting. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The vault name. + /// The email configuration name. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response Get(string subscriptionId, string resourceGroupName, string vaultName, string emailConfigurationName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + Argument.AssertNotNullOrEmpty(emailConfigurationName, nameof(emailConfigurationName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, vaultName, emailConfigurationName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + EmailConfigurationModelData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = EmailConfigurationModelData.DeserializeEmailConfigurationModelData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((EmailConfigurationModelData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateCreateRequestUri(string subscriptionId, string resourceGroupName, string vaultName, string emailConfigurationName, EmailConfigurationModelData data) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DataReplication/replicationVaults/", false); + uri.AppendPath(vaultName, true); + uri.AppendPath("/alertSettings/", false); + uri.AppendPath(emailConfigurationName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateCreateRequest(string subscriptionId, string resourceGroupName, string vaultName, string emailConfigurationName, EmailConfigurationModelData data) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Put; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DataReplication/replicationVaults/", false); + uri.AppendPath(vaultName, true); + uri.AppendPath("/alertSettings/", false); + uri.AppendPath(emailConfigurationName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(data, ModelSerializationExtensions.WireOptions); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Creates an alert configuration setting for the given vault. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The vault name. + /// The email configuration name. + /// EmailConfiguration model. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task> CreateAsync(string subscriptionId, string resourceGroupName, string vaultName, string emailConfigurationName, EmailConfigurationModelData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + Argument.AssertNotNullOrEmpty(emailConfigurationName, nameof(emailConfigurationName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateRequest(subscriptionId, resourceGroupName, vaultName, emailConfigurationName, data); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 201: + { + EmailConfigurationModelData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = EmailConfigurationModelData.DeserializeEmailConfigurationModelData(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Creates an alert configuration setting for the given vault. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The vault name. + /// The email configuration name. + /// EmailConfiguration model. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response Create(string subscriptionId, string resourceGroupName, string vaultName, string emailConfigurationName, EmailConfigurationModelData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + Argument.AssertNotNullOrEmpty(emailConfigurationName, nameof(emailConfigurationName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateRequest(subscriptionId, resourceGroupName, vaultName, emailConfigurationName, data); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 201: + { + EmailConfigurationModelData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = EmailConfigurationModelData.DeserializeEmailConfigurationModelData(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListRequestUri(string subscriptionId, string resourceGroupName, string vaultName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DataReplication/replicationVaults/", false); + uri.AppendPath(vaultName, true); + uri.AppendPath("/alertSettings", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateListRequest(string subscriptionId, string resourceGroupName, string vaultName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DataReplication/replicationVaults/", false); + uri.AppendPath(vaultName, true); + uri.AppendPath("/alertSettings", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Gets the list of alert configuration settings for the given vault. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The vault name. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> ListAsync(string subscriptionId, string resourceGroupName, string vaultName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + + using var message = CreateListRequest(subscriptionId, resourceGroupName, vaultName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + EmailConfigurationModelListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = EmailConfigurationModelListResult.DeserializeEmailConfigurationModelListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Gets the list of alert configuration settings for the given vault. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The vault name. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response List(string subscriptionId, string resourceGroupName, string vaultName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + + using var message = CreateListRequest(subscriptionId, resourceGroupName, vaultName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + EmailConfigurationModelListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = EmailConfigurationModelListResult.DeserializeEmailConfigurationModelListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string vaultName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateListNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string vaultName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Gets the list of alert configuration settings for the given vault. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The vault name. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> ListNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string vaultName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + + using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, vaultName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + EmailConfigurationModelListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = EmailConfigurationModelListResult.DeserializeEmailConfigurationModelListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Gets the list of alert configuration settings for the given vault. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The vault name. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response ListNextPage(string nextLink, string subscriptionId, string resourceGroupName, string vaultName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + + using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, vaultName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + EmailConfigurationModelListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = EmailConfigurationModelListResult.DeserializeEmailConfigurationModelListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/RestOperations/EventRestOperations.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/RestOperations/EventRestOperations.cs new file mode 100644 index 000000000000..63d1259f1b15 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/RestOperations/EventRestOperations.cs @@ -0,0 +1,357 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.RecoveryServicesDataReplication.Models; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication +{ + internal partial class EventRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of EventRestOperations. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// The application id to use for user agent. + /// Service host. + /// The API version to use for this operation. + /// or is null. + public EventRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + { + _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); + _endpoint = endpoint ?? new Uri("https://management.azure.com"); + _apiVersion = apiVersion ?? "2024-09-01"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string vaultName, string eventName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DataReplication/replicationVaults/", false); + uri.AppendPath(vaultName, true); + uri.AppendPath("/events/", false); + uri.AppendPath(eventName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string vaultName, string eventName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DataReplication/replicationVaults/", false); + uri.AppendPath(vaultName, true); + uri.AppendPath("/events/", false); + uri.AppendPath(eventName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Gets the details of the event. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The vault name. + /// The event name. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task> GetAsync(string subscriptionId, string resourceGroupName, string vaultName, string eventName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + Argument.AssertNotNullOrEmpty(eventName, nameof(eventName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, vaultName, eventName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + EventModelData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = EventModelData.DeserializeEventModelData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((EventModelData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// Gets the details of the event. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The vault name. + /// The event name. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response Get(string subscriptionId, string resourceGroupName, string vaultName, string eventName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + Argument.AssertNotNullOrEmpty(eventName, nameof(eventName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, vaultName, eventName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + EventModelData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = EventModelData.DeserializeEventModelData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((EventModelData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListRequestUri(string subscriptionId, string resourceGroupName, string vaultName, string odataOptions, string continuationToken, int? pageSize) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DataReplication/replicationVaults/", false); + uri.AppendPath(vaultName, true); + uri.AppendPath("/events", false); + uri.AppendQuery("api-version", _apiVersion, true); + if (odataOptions != null) + { + uri.AppendQuery("odataOptions", odataOptions, true); + } + if (continuationToken != null) + { + uri.AppendQuery("continuationToken", continuationToken, true); + } + if (pageSize != null) + { + uri.AppendQuery("pageSize", pageSize.Value, true); + } + return uri; + } + + internal HttpMessage CreateListRequest(string subscriptionId, string resourceGroupName, string vaultName, string odataOptions, string continuationToken, int? pageSize) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DataReplication/replicationVaults/", false); + uri.AppendPath(vaultName, true); + uri.AppendPath("/events", false); + uri.AppendQuery("api-version", _apiVersion, true); + if (odataOptions != null) + { + uri.AppendQuery("odataOptions", odataOptions, true); + } + if (continuationToken != null) + { + uri.AppendQuery("continuationToken", continuationToken, true); + } + if (pageSize != null) + { + uri.AppendQuery("pageSize", pageSize.Value, true); + } + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Gets the list of events in the given vault. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The vault name. + /// OData options. + /// Continuation token. + /// Page size. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> ListAsync(string subscriptionId, string resourceGroupName, string vaultName, string odataOptions = null, string continuationToken = null, int? pageSize = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + + using var message = CreateListRequest(subscriptionId, resourceGroupName, vaultName, odataOptions, continuationToken, pageSize); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + EventModelListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = EventModelListResult.DeserializeEventModelListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Gets the list of events in the given vault. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The vault name. + /// OData options. + /// Continuation token. + /// Page size. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response List(string subscriptionId, string resourceGroupName, string vaultName, string odataOptions = null, string continuationToken = null, int? pageSize = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + + using var message = CreateListRequest(subscriptionId, resourceGroupName, vaultName, odataOptions, continuationToken, pageSize); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + EventModelListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = EventModelListResult.DeserializeEventModelListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string vaultName, string odataOptions, string continuationToken, int? pageSize) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateListNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string vaultName, string odataOptions, string continuationToken, int? pageSize) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Gets the list of events in the given vault. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The vault name. + /// OData options. + /// Continuation token. + /// Page size. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> ListNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string vaultName, string odataOptions = null, string continuationToken = null, int? pageSize = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + + using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, vaultName, odataOptions, continuationToken, pageSize); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + EventModelListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = EventModelListResult.DeserializeEventModelListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Gets the list of events in the given vault. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The vault name. + /// OData options. + /// Continuation token. + /// Page size. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response ListNextPage(string nextLink, string subscriptionId, string resourceGroupName, string vaultName, string odataOptions = null, string continuationToken = null, int? pageSize = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + + using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, vaultName, odataOptions, continuationToken, pageSize); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + EventModelListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = EventModelListResult.DeserializeEventModelListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/RestOperations/FabricAgentRestOperations.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/RestOperations/FabricAgentRestOperations.cs new file mode 100644 index 000000000000..ff24b58bb482 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/RestOperations/FabricAgentRestOperations.cs @@ -0,0 +1,513 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.RecoveryServicesDataReplication.Models; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication +{ + internal partial class FabricAgentRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of FabricAgentRestOperations. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// The application id to use for user agent. + /// Service host. + /// The API version to use for this operation. + /// or is null. + public FabricAgentRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + { + _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); + _endpoint = endpoint ?? new Uri("https://management.azure.com"); + _apiVersion = apiVersion ?? "2024-09-01"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string fabricName, string fabricAgentName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DataReplication/replicationFabrics/", false); + uri.AppendPath(fabricName, true); + uri.AppendPath("/fabricAgents/", false); + uri.AppendPath(fabricAgentName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string fabricName, string fabricAgentName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DataReplication/replicationFabrics/", false); + uri.AppendPath(fabricName, true); + uri.AppendPath("/fabricAgents/", false); + uri.AppendPath(fabricAgentName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Gets the details of the fabric agent. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The fabric name. + /// The fabric agent name. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task> GetAsync(string subscriptionId, string resourceGroupName, string fabricName, string fabricAgentName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fabricName, nameof(fabricName)); + Argument.AssertNotNullOrEmpty(fabricAgentName, nameof(fabricAgentName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, fabricName, fabricAgentName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + FabricAgentModelData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = FabricAgentModelData.DeserializeFabricAgentModelData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((FabricAgentModelData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// Gets the details of the fabric agent. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The fabric name. + /// The fabric agent name. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response Get(string subscriptionId, string resourceGroupName, string fabricName, string fabricAgentName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fabricName, nameof(fabricName)); + Argument.AssertNotNullOrEmpty(fabricAgentName, nameof(fabricAgentName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, fabricName, fabricAgentName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + FabricAgentModelData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = FabricAgentModelData.DeserializeFabricAgentModelData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((FabricAgentModelData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateCreateRequestUri(string subscriptionId, string resourceGroupName, string fabricName, string fabricAgentName, FabricAgentModelData data) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DataReplication/replicationFabrics/", false); + uri.AppendPath(fabricName, true); + uri.AppendPath("/fabricAgents/", false); + uri.AppendPath(fabricAgentName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateCreateRequest(string subscriptionId, string resourceGroupName, string fabricName, string fabricAgentName, FabricAgentModelData data) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Put; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DataReplication/replicationFabrics/", false); + uri.AppendPath(fabricName, true); + uri.AppendPath("/fabricAgents/", false); + uri.AppendPath(fabricAgentName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(data, ModelSerializationExtensions.WireOptions); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Creates the fabric agent. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The fabric name. + /// The fabric agent name. + /// Fabric agent model. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task CreateAsync(string subscriptionId, string resourceGroupName, string fabricName, string fabricAgentName, FabricAgentModelData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fabricName, nameof(fabricName)); + Argument.AssertNotNullOrEmpty(fabricAgentName, nameof(fabricAgentName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateRequest(subscriptionId, resourceGroupName, fabricName, fabricAgentName, data); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 201: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Creates the fabric agent. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The fabric name. + /// The fabric agent name. + /// Fabric agent model. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response Create(string subscriptionId, string resourceGroupName, string fabricName, string fabricAgentName, FabricAgentModelData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fabricName, nameof(fabricName)); + Argument.AssertNotNullOrEmpty(fabricAgentName, nameof(fabricAgentName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateRequest(subscriptionId, resourceGroupName, fabricName, fabricAgentName, data); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 201: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string resourceGroupName, string fabricName, string fabricAgentName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DataReplication/replicationFabrics/", false); + uri.AppendPath(fabricName, true); + uri.AppendPath("/fabricAgents/", false); + uri.AppendPath(fabricAgentName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string fabricName, string fabricAgentName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Delete; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DataReplication/replicationFabrics/", false); + uri.AppendPath(fabricName, true); + uri.AppendPath("/fabricAgents/", false); + uri.AppendPath(fabricAgentName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Deletes fabric agent. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The fabric name. + /// The fabric agent name. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task DeleteAsync(string subscriptionId, string resourceGroupName, string fabricName, string fabricAgentName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fabricName, nameof(fabricName)); + Argument.AssertNotNullOrEmpty(fabricAgentName, nameof(fabricAgentName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, fabricName, fabricAgentName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Deletes fabric agent. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The fabric name. + /// The fabric agent name. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response Delete(string subscriptionId, string resourceGroupName, string fabricName, string fabricAgentName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fabricName, nameof(fabricName)); + Argument.AssertNotNullOrEmpty(fabricAgentName, nameof(fabricAgentName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, fabricName, fabricAgentName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListRequestUri(string subscriptionId, string resourceGroupName, string fabricName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DataReplication/replicationFabrics/", false); + uri.AppendPath(fabricName, true); + uri.AppendPath("/fabricAgents", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateListRequest(string subscriptionId, string resourceGroupName, string fabricName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DataReplication/replicationFabrics/", false); + uri.AppendPath(fabricName, true); + uri.AppendPath("/fabricAgents", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Gets the list of fabric agents in the given fabric. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The fabric name. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> ListAsync(string subscriptionId, string resourceGroupName, string fabricName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fabricName, nameof(fabricName)); + + using var message = CreateListRequest(subscriptionId, resourceGroupName, fabricName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + FabricAgentModelListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = FabricAgentModelListResult.DeserializeFabricAgentModelListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Gets the list of fabric agents in the given fabric. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The fabric name. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response List(string subscriptionId, string resourceGroupName, string fabricName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fabricName, nameof(fabricName)); + + using var message = CreateListRequest(subscriptionId, resourceGroupName, fabricName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + FabricAgentModelListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = FabricAgentModelListResult.DeserializeFabricAgentModelListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string fabricName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateListNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string fabricName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Gets the list of fabric agents in the given fabric. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The fabric name. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> ListNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string fabricName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fabricName, nameof(fabricName)); + + using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, fabricName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + FabricAgentModelListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = FabricAgentModelListResult.DeserializeFabricAgentModelListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Gets the list of fabric agents in the given fabric. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The fabric name. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response ListNextPage(string nextLink, string subscriptionId, string resourceGroupName, string fabricName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fabricName, nameof(fabricName)); + + using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, fabricName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + FabricAgentModelListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = FabricAgentModelListResult.DeserializeFabricAgentModelListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/RestOperations/FabricRestOperations.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/RestOperations/FabricRestOperations.cs new file mode 100644 index 000000000000..cbd09b511d6d --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/RestOperations/FabricRestOperations.cs @@ -0,0 +1,735 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.RecoveryServicesDataReplication.Models; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication +{ + internal partial class FabricRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of FabricRestOperations. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// The application id to use for user agent. + /// Service host. + /// The API version to use for this operation. + /// or is null. + public FabricRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + { + _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); + _endpoint = endpoint ?? new Uri("https://management.azure.com"); + _apiVersion = apiVersion ?? "2024-09-01"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string fabricName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DataReplication/replicationFabrics/", false); + uri.AppendPath(fabricName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string fabricName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DataReplication/replicationFabrics/", false); + uri.AppendPath(fabricName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Gets the details of the fabric. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The fabric name. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> GetAsync(string subscriptionId, string resourceGroupName, string fabricName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fabricName, nameof(fabricName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, fabricName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + FabricModelData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = FabricModelData.DeserializeFabricModelData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((FabricModelData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// Gets the details of the fabric. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The fabric name. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response Get(string subscriptionId, string resourceGroupName, string fabricName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fabricName, nameof(fabricName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, fabricName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + FabricModelData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = FabricModelData.DeserializeFabricModelData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((FabricModelData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateCreateRequestUri(string subscriptionId, string resourceGroupName, string fabricName, FabricModelData data) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DataReplication/replicationFabrics/", false); + uri.AppendPath(fabricName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateCreateRequest(string subscriptionId, string resourceGroupName, string fabricName, FabricModelData data) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Put; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DataReplication/replicationFabrics/", false); + uri.AppendPath(fabricName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(data, ModelSerializationExtensions.WireOptions); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Creates the fabric. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The fabric name. + /// Fabric properties. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task CreateAsync(string subscriptionId, string resourceGroupName, string fabricName, FabricModelData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fabricName, nameof(fabricName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateRequest(subscriptionId, resourceGroupName, fabricName, data); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 201: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Creates the fabric. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The fabric name. + /// Fabric properties. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response Create(string subscriptionId, string resourceGroupName, string fabricName, FabricModelData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fabricName, nameof(fabricName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateRequest(subscriptionId, resourceGroupName, fabricName, data); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 201: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateUpdateRequestUri(string subscriptionId, string resourceGroupName, string fabricName, FabricModelPatch patch) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DataReplication/replicationFabrics/", false); + uri.AppendPath(fabricName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceGroupName, string fabricName, FabricModelPatch patch) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Patch; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DataReplication/replicationFabrics/", false); + uri.AppendPath(fabricName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(patch, ModelSerializationExtensions.WireOptions); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Performs update on the fabric. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The fabric name. + /// Fabric properties. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task UpdateAsync(string subscriptionId, string resourceGroupName, string fabricName, FabricModelPatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fabricName, nameof(fabricName)); + Argument.AssertNotNull(patch, nameof(patch)); + + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, fabricName, patch); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Performs update on the fabric. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The fabric name. + /// Fabric properties. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response Update(string subscriptionId, string resourceGroupName, string fabricName, FabricModelPatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fabricName, nameof(fabricName)); + Argument.AssertNotNull(patch, nameof(patch)); + + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, fabricName, patch); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string resourceGroupName, string fabricName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DataReplication/replicationFabrics/", false); + uri.AppendPath(fabricName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string fabricName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Delete; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DataReplication/replicationFabrics/", false); + uri.AppendPath(fabricName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Removes the fabric. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The fabric name. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task DeleteAsync(string subscriptionId, string resourceGroupName, string fabricName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fabricName, nameof(fabricName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, fabricName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Removes the fabric. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The fabric name. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response Delete(string subscriptionId, string resourceGroupName, string fabricName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fabricName, nameof(fabricName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, fabricName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListRequestUri(string subscriptionId, string resourceGroupName, string continuationToken) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DataReplication/replicationFabrics", false); + uri.AppendQuery("api-version", _apiVersion, true); + if (continuationToken != null) + { + uri.AppendQuery("continuationToken", continuationToken, true); + } + return uri; + } + + internal HttpMessage CreateListRequest(string subscriptionId, string resourceGroupName, string continuationToken) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DataReplication/replicationFabrics", false); + uri.AppendQuery("api-version", _apiVersion, true); + if (continuationToken != null) + { + uri.AppendQuery("continuationToken", continuationToken, true); + } + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Gets the list of fabrics in the given subscription and resource group. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Continuation token from the previous call. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + public async Task> ListAsync(string subscriptionId, string resourceGroupName, string continuationToken = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + + using var message = CreateListRequest(subscriptionId, resourceGroupName, continuationToken); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + FabricModelListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = FabricModelListResult.DeserializeFabricModelListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Gets the list of fabrics in the given subscription and resource group. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Continuation token from the previous call. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + public Response List(string subscriptionId, string resourceGroupName, string continuationToken = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + + using var message = CreateListRequest(subscriptionId, resourceGroupName, continuationToken); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + FabricModelListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = FabricModelListResult.DeserializeFabricModelListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListBySubscriptionRequestUri(string subscriptionId) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/providers/Microsoft.DataReplication/replicationFabrics", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateListBySubscriptionRequest(string subscriptionId) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/providers/Microsoft.DataReplication/replicationFabrics", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Gets the list of fabrics in the given subscription. + /// The ID of the target subscription. The value must be an UUID. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + public async Task> ListBySubscriptionAsync(string subscriptionId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + + using var message = CreateListBySubscriptionRequest(subscriptionId); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + FabricModelListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = FabricModelListResult.DeserializeFabricModelListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Gets the list of fabrics in the given subscription. + /// The ID of the target subscription. The value must be an UUID. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + public Response ListBySubscription(string subscriptionId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + + using var message = CreateListBySubscriptionRequest(subscriptionId); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + FabricModelListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = FabricModelListResult.DeserializeFabricModelListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string continuationToken) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateListNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string continuationToken) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Gets the list of fabrics in the given subscription and resource group. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Continuation token from the previous call. + /// The cancellation token to use. + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + public async Task> ListNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string continuationToken = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + + using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, continuationToken); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + FabricModelListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = FabricModelListResult.DeserializeFabricModelListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Gets the list of fabrics in the given subscription and resource group. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Continuation token from the previous call. + /// The cancellation token to use. + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + public Response ListNextPage(string nextLink, string subscriptionId, string resourceGroupName, string continuationToken = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + + using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, continuationToken); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + FabricModelListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = FabricModelListResult.DeserializeFabricModelListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListBySubscriptionNextPageRequestUri(string nextLink, string subscriptionId) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateListBySubscriptionNextPageRequest(string nextLink, string subscriptionId) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Gets the list of fabrics in the given subscription. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + public async Task> ListBySubscriptionNextPageAsync(string nextLink, string subscriptionId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + + using var message = CreateListBySubscriptionNextPageRequest(nextLink, subscriptionId); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + FabricModelListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = FabricModelListResult.DeserializeFabricModelListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Gets the list of fabrics in the given subscription. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + public Response ListBySubscriptionNextPage(string nextLink, string subscriptionId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + + using var message = CreateListBySubscriptionNextPageRequest(nextLink, subscriptionId); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + FabricModelListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = FabricModelListResult.DeserializeFabricModelListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/RestOperations/JobRestOperations.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/RestOperations/JobRestOperations.cs new file mode 100644 index 000000000000..09d0b0fd1771 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/RestOperations/JobRestOperations.cs @@ -0,0 +1,357 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.RecoveryServicesDataReplication.Models; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication +{ + internal partial class JobRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of JobRestOperations. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// The application id to use for user agent. + /// Service host. + /// The API version to use for this operation. + /// or is null. + public JobRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + { + _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); + _endpoint = endpoint ?? new Uri("https://management.azure.com"); + _apiVersion = apiVersion ?? "2024-09-01"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string vaultName, string jobName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DataReplication/replicationVaults/", false); + uri.AppendPath(vaultName, true); + uri.AppendPath("/jobs/", false); + uri.AppendPath(jobName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string vaultName, string jobName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DataReplication/replicationVaults/", false); + uri.AppendPath(vaultName, true); + uri.AppendPath("/jobs/", false); + uri.AppendPath(jobName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Gets the details of the job. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The vault name. + /// The job name. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task> GetAsync(string subscriptionId, string resourceGroupName, string vaultName, string jobName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + Argument.AssertNotNullOrEmpty(jobName, nameof(jobName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, vaultName, jobName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + JobModelData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = JobModelData.DeserializeJobModelData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((JobModelData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// Gets the details of the job. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The vault name. + /// The job name. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response Get(string subscriptionId, string resourceGroupName, string vaultName, string jobName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + Argument.AssertNotNullOrEmpty(jobName, nameof(jobName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, vaultName, jobName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + JobModelData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = JobModelData.DeserializeJobModelData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((JobModelData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListRequestUri(string subscriptionId, string resourceGroupName, string vaultName, string odataOptions, string continuationToken, int? pageSize) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DataReplication/replicationVaults/", false); + uri.AppendPath(vaultName, true); + uri.AppendPath("/jobs", false); + uri.AppendQuery("api-version", _apiVersion, true); + if (odataOptions != null) + { + uri.AppendQuery("odataOptions", odataOptions, true); + } + if (continuationToken != null) + { + uri.AppendQuery("continuationToken", continuationToken, true); + } + if (pageSize != null) + { + uri.AppendQuery("pageSize", pageSize.Value, true); + } + return uri; + } + + internal HttpMessage CreateListRequest(string subscriptionId, string resourceGroupName, string vaultName, string odataOptions, string continuationToken, int? pageSize) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DataReplication/replicationVaults/", false); + uri.AppendPath(vaultName, true); + uri.AppendPath("/jobs", false); + uri.AppendQuery("api-version", _apiVersion, true); + if (odataOptions != null) + { + uri.AppendQuery("odataOptions", odataOptions, true); + } + if (continuationToken != null) + { + uri.AppendQuery("continuationToken", continuationToken, true); + } + if (pageSize != null) + { + uri.AppendQuery("pageSize", pageSize.Value, true); + } + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Gets the list of jobs in the given vault. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The vault name. + /// OData options. + /// Continuation token. + /// Page size. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> ListAsync(string subscriptionId, string resourceGroupName, string vaultName, string odataOptions = null, string continuationToken = null, int? pageSize = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + + using var message = CreateListRequest(subscriptionId, resourceGroupName, vaultName, odataOptions, continuationToken, pageSize); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + JobModelListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = JobModelListResult.DeserializeJobModelListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Gets the list of jobs in the given vault. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The vault name. + /// OData options. + /// Continuation token. + /// Page size. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response List(string subscriptionId, string resourceGroupName, string vaultName, string odataOptions = null, string continuationToken = null, int? pageSize = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + + using var message = CreateListRequest(subscriptionId, resourceGroupName, vaultName, odataOptions, continuationToken, pageSize); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + JobModelListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = JobModelListResult.DeserializeJobModelListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string vaultName, string odataOptions, string continuationToken, int? pageSize) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateListNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string vaultName, string odataOptions, string continuationToken, int? pageSize) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Gets the list of jobs in the given vault. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The vault name. + /// OData options. + /// Continuation token. + /// Page size. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> ListNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string vaultName, string odataOptions = null, string continuationToken = null, int? pageSize = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + + using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, vaultName, odataOptions, continuationToken, pageSize); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + JobModelListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = JobModelListResult.DeserializeJobModelListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Gets the list of jobs in the given vault. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The vault name. + /// OData options. + /// Continuation token. + /// Page size. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response ListNextPage(string nextLink, string subscriptionId, string resourceGroupName, string vaultName, string odataOptions = null, string continuationToken = null, int? pageSize = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + + using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, vaultName, odataOptions, continuationToken, pageSize); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + JobModelListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = JobModelListResult.DeserializeJobModelListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/RestOperations/OperationResultsRestOperations.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/RestOperations/OperationResultsRestOperations.cs new file mode 100644 index 000000000000..4a422275b6e5 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/RestOperations/OperationResultsRestOperations.cs @@ -0,0 +1,143 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.RecoveryServicesDataReplication.Models; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication +{ + internal partial class OperationResultsRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of OperationResultsRestOperations. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// The application id to use for user agent. + /// Service host. + /// The API version to use for this operation. + /// or is null. + public OperationResultsRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + { + _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); + _endpoint = endpoint ?? new Uri("https://management.azure.com"); + _apiVersion = apiVersion ?? "2024-09-01"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string operationId) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DataReplication/operationResults/", false); + uri.AppendPath(operationId, true); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/", false); + uri.AppendPath(operationId, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string operationId) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DataReplication/operationResults/", false); + uri.AppendPath(operationId, true); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/", false); + uri.AppendPath(operationId, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Gets the operations. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The ID of an ongoing async operation. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> GetAsync(string subscriptionId, string resourceGroupName, string operationId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(operationId, nameof(operationId)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, operationId); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + OperationStatus value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = OperationStatus.DeserializeOperationStatus(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Gets the operations. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The ID of an ongoing async operation. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response Get(string subscriptionId, string resourceGroupName, string operationId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(operationId, nameof(operationId)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, operationId); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + OperationStatus value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = OperationStatus.DeserializeOperationStatus(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/RestOperations/PolicyRestOperations.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/RestOperations/PolicyRestOperations.cs new file mode 100644 index 000000000000..fcf32cec3b94 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/RestOperations/PolicyRestOperations.cs @@ -0,0 +1,513 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.RecoveryServicesDataReplication.Models; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication +{ + internal partial class PolicyRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of PolicyRestOperations. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// The application id to use for user agent. + /// Service host. + /// The API version to use for this operation. + /// or is null. + public PolicyRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + { + _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); + _endpoint = endpoint ?? new Uri("https://management.azure.com"); + _apiVersion = apiVersion ?? "2024-09-01"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string vaultName, string policyName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DataReplication/replicationVaults/", false); + uri.AppendPath(vaultName, true); + uri.AppendPath("/replicationPolicies/", false); + uri.AppendPath(policyName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string vaultName, string policyName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DataReplication/replicationVaults/", false); + uri.AppendPath(vaultName, true); + uri.AppendPath("/replicationPolicies/", false); + uri.AppendPath(policyName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Gets the details of the policy. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The vault name. + /// The policy name. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task> GetAsync(string subscriptionId, string resourceGroupName, string vaultName, string policyName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + Argument.AssertNotNullOrEmpty(policyName, nameof(policyName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, vaultName, policyName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + PolicyModelData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = PolicyModelData.DeserializePolicyModelData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((PolicyModelData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// Gets the details of the policy. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The vault name. + /// The policy name. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response Get(string subscriptionId, string resourceGroupName, string vaultName, string policyName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + Argument.AssertNotNullOrEmpty(policyName, nameof(policyName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, vaultName, policyName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + PolicyModelData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = PolicyModelData.DeserializePolicyModelData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((PolicyModelData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateCreateRequestUri(string subscriptionId, string resourceGroupName, string vaultName, string policyName, PolicyModelData data) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DataReplication/replicationVaults/", false); + uri.AppendPath(vaultName, true); + uri.AppendPath("/replicationPolicies/", false); + uri.AppendPath(policyName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateCreateRequest(string subscriptionId, string resourceGroupName, string vaultName, string policyName, PolicyModelData data) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Put; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DataReplication/replicationVaults/", false); + uri.AppendPath(vaultName, true); + uri.AppendPath("/replicationPolicies/", false); + uri.AppendPath(policyName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(data, ModelSerializationExtensions.WireOptions); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Creates the policy. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The vault name. + /// The policy name. + /// Policy model. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task CreateAsync(string subscriptionId, string resourceGroupName, string vaultName, string policyName, PolicyModelData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + Argument.AssertNotNullOrEmpty(policyName, nameof(policyName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateRequest(subscriptionId, resourceGroupName, vaultName, policyName, data); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 201: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Creates the policy. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The vault name. + /// The policy name. + /// Policy model. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response Create(string subscriptionId, string resourceGroupName, string vaultName, string policyName, PolicyModelData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + Argument.AssertNotNullOrEmpty(policyName, nameof(policyName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateRequest(subscriptionId, resourceGroupName, vaultName, policyName, data); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 201: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string resourceGroupName, string vaultName, string policyName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DataReplication/replicationVaults/", false); + uri.AppendPath(vaultName, true); + uri.AppendPath("/replicationPolicies/", false); + uri.AppendPath(policyName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string vaultName, string policyName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Delete; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DataReplication/replicationVaults/", false); + uri.AppendPath(vaultName, true); + uri.AppendPath("/replicationPolicies/", false); + uri.AppendPath(policyName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Removes the policy. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The vault name. + /// The policy name. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task DeleteAsync(string subscriptionId, string resourceGroupName, string vaultName, string policyName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + Argument.AssertNotNullOrEmpty(policyName, nameof(policyName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, vaultName, policyName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Removes the policy. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The vault name. + /// The policy name. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response Delete(string subscriptionId, string resourceGroupName, string vaultName, string policyName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + Argument.AssertNotNullOrEmpty(policyName, nameof(policyName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, vaultName, policyName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListRequestUri(string subscriptionId, string resourceGroupName, string vaultName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DataReplication/replicationVaults/", false); + uri.AppendPath(vaultName, true); + uri.AppendPath("/replicationPolicies", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateListRequest(string subscriptionId, string resourceGroupName, string vaultName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DataReplication/replicationVaults/", false); + uri.AppendPath(vaultName, true); + uri.AppendPath("/replicationPolicies", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Gets the list of policies in the given vault. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The vault name. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> ListAsync(string subscriptionId, string resourceGroupName, string vaultName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + + using var message = CreateListRequest(subscriptionId, resourceGroupName, vaultName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + PolicyModelListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = PolicyModelListResult.DeserializePolicyModelListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Gets the list of policies in the given vault. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The vault name. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response List(string subscriptionId, string resourceGroupName, string vaultName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + + using var message = CreateListRequest(subscriptionId, resourceGroupName, vaultName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + PolicyModelListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = PolicyModelListResult.DeserializePolicyModelListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string vaultName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateListNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string vaultName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Gets the list of policies in the given vault. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The vault name. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> ListNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string vaultName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + + using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, vaultName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + PolicyModelListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = PolicyModelListResult.DeserializePolicyModelListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Gets the list of policies in the given vault. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The vault name. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response ListNextPage(string nextLink, string subscriptionId, string resourceGroupName, string vaultName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + + using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, vaultName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + PolicyModelListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = PolicyModelListResult.DeserializePolicyModelListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/RestOperations/PrivateEndpointConnectionProxiesRestOperations.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/RestOperations/PrivateEndpointConnectionProxiesRestOperations.cs new file mode 100644 index 000000000000..66ed4eeb70df --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/RestOperations/PrivateEndpointConnectionProxiesRestOperations.cs @@ -0,0 +1,633 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.RecoveryServicesDataReplication.Models; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication +{ + internal partial class PrivateEndpointConnectionProxiesRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of PrivateEndpointConnectionProxiesRestOperations. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// The application id to use for user agent. + /// Service host. + /// The API version to use for this operation. + /// or is null. + public PrivateEndpointConnectionProxiesRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + { + _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); + _endpoint = endpoint ?? new Uri("https://management.azure.com"); + _apiVersion = apiVersion ?? "2024-09-01"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string vaultName, string privateEndpointConnectionProxyName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DataReplication/replicationVaults/", false); + uri.AppendPath(vaultName, true); + uri.AppendPath("/privateEndpointConnectionProxies/", false); + uri.AppendPath(privateEndpointConnectionProxyName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string vaultName, string privateEndpointConnectionProxyName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DataReplication/replicationVaults/", false); + uri.AppendPath(vaultName, true); + uri.AppendPath("/privateEndpointConnectionProxies/", false); + uri.AppendPath(privateEndpointConnectionProxyName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Gets the private endpoint connection proxy details. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The vault name. + /// The private endpoint connection proxy name. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task> GetAsync(string subscriptionId, string resourceGroupName, string vaultName, string privateEndpointConnectionProxyName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + Argument.AssertNotNullOrEmpty(privateEndpointConnectionProxyName, nameof(privateEndpointConnectionProxyName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, vaultName, privateEndpointConnectionProxyName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + PrivateEndpointConnectionProxyData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = PrivateEndpointConnectionProxyData.DeserializePrivateEndpointConnectionProxyData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((PrivateEndpointConnectionProxyData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// Gets the private endpoint connection proxy details. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The vault name. + /// The private endpoint connection proxy name. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response Get(string subscriptionId, string resourceGroupName, string vaultName, string privateEndpointConnectionProxyName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + Argument.AssertNotNullOrEmpty(privateEndpointConnectionProxyName, nameof(privateEndpointConnectionProxyName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, vaultName, privateEndpointConnectionProxyName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + PrivateEndpointConnectionProxyData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = PrivateEndpointConnectionProxyData.DeserializePrivateEndpointConnectionProxyData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((PrivateEndpointConnectionProxyData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateCreateRequestUri(string subscriptionId, string resourceGroupName, string vaultName, string privateEndpointConnectionProxyName, PrivateEndpointConnectionProxyData data) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DataReplication/replicationVaults/", false); + uri.AppendPath(vaultName, true); + uri.AppendPath("/privateEndpointConnectionProxies/", false); + uri.AppendPath(privateEndpointConnectionProxyName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateCreateRequest(string subscriptionId, string resourceGroupName, string vaultName, string privateEndpointConnectionProxyName, PrivateEndpointConnectionProxyData data) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Put; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DataReplication/replicationVaults/", false); + uri.AppendPath(vaultName, true); + uri.AppendPath("/privateEndpointConnectionProxies/", false); + uri.AppendPath(privateEndpointConnectionProxyName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(data, ModelSerializationExtensions.WireOptions); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Create a new private endpoint connection proxy which includes both auto and manual approval types. Creating the proxy resource will also create a private endpoint connection resource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The vault name. + /// The private endpoint connection proxy name. + /// Private endpoint connection creation input. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task> CreateAsync(string subscriptionId, string resourceGroupName, string vaultName, string privateEndpointConnectionProxyName, PrivateEndpointConnectionProxyData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + Argument.AssertNotNullOrEmpty(privateEndpointConnectionProxyName, nameof(privateEndpointConnectionProxyName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateRequest(subscriptionId, resourceGroupName, vaultName, privateEndpointConnectionProxyName, data); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 201: + { + PrivateEndpointConnectionProxyData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = PrivateEndpointConnectionProxyData.DeserializePrivateEndpointConnectionProxyData(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Create a new private endpoint connection proxy which includes both auto and manual approval types. Creating the proxy resource will also create a private endpoint connection resource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The vault name. + /// The private endpoint connection proxy name. + /// Private endpoint connection creation input. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response Create(string subscriptionId, string resourceGroupName, string vaultName, string privateEndpointConnectionProxyName, PrivateEndpointConnectionProxyData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + Argument.AssertNotNullOrEmpty(privateEndpointConnectionProxyName, nameof(privateEndpointConnectionProxyName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateRequest(subscriptionId, resourceGroupName, vaultName, privateEndpointConnectionProxyName, data); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 201: + { + PrivateEndpointConnectionProxyData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = PrivateEndpointConnectionProxyData.DeserializePrivateEndpointConnectionProxyData(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string resourceGroupName, string vaultName, string privateEndpointConnectionProxyName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DataReplication/replicationVaults/", false); + uri.AppendPath(vaultName, true); + uri.AppendPath("/privateEndpointConnectionProxies/", false); + uri.AppendPath(privateEndpointConnectionProxyName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string vaultName, string privateEndpointConnectionProxyName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Delete; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DataReplication/replicationVaults/", false); + uri.AppendPath(vaultName, true); + uri.AppendPath("/privateEndpointConnectionProxies/", false); + uri.AppendPath(privateEndpointConnectionProxyName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Returns the operation to track the deletion of private endpoint connection proxy. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The vault name. + /// The private endpoint connection proxy name. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task DeleteAsync(string subscriptionId, string resourceGroupName, string vaultName, string privateEndpointConnectionProxyName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + Argument.AssertNotNullOrEmpty(privateEndpointConnectionProxyName, nameof(privateEndpointConnectionProxyName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, vaultName, privateEndpointConnectionProxyName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Returns the operation to track the deletion of private endpoint connection proxy. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The vault name. + /// The private endpoint connection proxy name. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response Delete(string subscriptionId, string resourceGroupName, string vaultName, string privateEndpointConnectionProxyName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + Argument.AssertNotNullOrEmpty(privateEndpointConnectionProxyName, nameof(privateEndpointConnectionProxyName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, vaultName, privateEndpointConnectionProxyName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListRequestUri(string subscriptionId, string resourceGroupName, string vaultName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DataReplication/replicationVaults/", false); + uri.AppendPath(vaultName, true); + uri.AppendPath("/privateEndpointConnectionProxies", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateListRequest(string subscriptionId, string resourceGroupName, string vaultName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DataReplication/replicationVaults/", false); + uri.AppendPath(vaultName, true); + uri.AppendPath("/privateEndpointConnectionProxies", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Gets the all private endpoint connections proxies. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The vault name. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> ListAsync(string subscriptionId, string resourceGroupName, string vaultName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + + using var message = CreateListRequest(subscriptionId, resourceGroupName, vaultName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + PrivateEndpointConnectionProxyListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = PrivateEndpointConnectionProxyListResult.DeserializePrivateEndpointConnectionProxyListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Gets the all private endpoint connections proxies. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The vault name. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response List(string subscriptionId, string resourceGroupName, string vaultName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + + using var message = CreateListRequest(subscriptionId, resourceGroupName, vaultName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + PrivateEndpointConnectionProxyListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = PrivateEndpointConnectionProxyListResult.DeserializePrivateEndpointConnectionProxyListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateValidateRequestUri(string subscriptionId, string resourceGroupName, string vaultName, string privateEndpointConnectionProxyName, PrivateEndpointConnectionProxyData data) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DataReplication/replicationVaults/", false); + uri.AppendPath(vaultName, true); + uri.AppendPath("/privateEndpointConnectionProxies/", false); + uri.AppendPath(privateEndpointConnectionProxyName, true); + uri.AppendPath("/validate", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateValidateRequest(string subscriptionId, string resourceGroupName, string vaultName, string privateEndpointConnectionProxyName, PrivateEndpointConnectionProxyData data) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DataReplication/replicationVaults/", false); + uri.AppendPath(vaultName, true); + uri.AppendPath("/privateEndpointConnectionProxies/", false); + uri.AppendPath(privateEndpointConnectionProxyName, true); + uri.AppendPath("/validate", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(data, ModelSerializationExtensions.WireOptions); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Returns remote private endpoint connection information after validation. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The vault name. + /// The private endpoint connection proxy name. + /// The private endpoint connection proxy input. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task> ValidateAsync(string subscriptionId, string resourceGroupName, string vaultName, string privateEndpointConnectionProxyName, PrivateEndpointConnectionProxyData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + Argument.AssertNotNullOrEmpty(privateEndpointConnectionProxyName, nameof(privateEndpointConnectionProxyName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateValidateRequest(subscriptionId, resourceGroupName, vaultName, privateEndpointConnectionProxyName, data); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + PrivateEndpointConnectionProxyData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = PrivateEndpointConnectionProxyData.DeserializePrivateEndpointConnectionProxyData(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Returns remote private endpoint connection information after validation. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The vault name. + /// The private endpoint connection proxy name. + /// The private endpoint connection proxy input. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response Validate(string subscriptionId, string resourceGroupName, string vaultName, string privateEndpointConnectionProxyName, PrivateEndpointConnectionProxyData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + Argument.AssertNotNullOrEmpty(privateEndpointConnectionProxyName, nameof(privateEndpointConnectionProxyName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateValidateRequest(subscriptionId, resourceGroupName, vaultName, privateEndpointConnectionProxyName, data); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + PrivateEndpointConnectionProxyData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = PrivateEndpointConnectionProxyData.DeserializePrivateEndpointConnectionProxyData(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string vaultName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateListNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string vaultName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Gets the all private endpoint connections proxies. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The vault name. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> ListNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string vaultName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + + using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, vaultName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + PrivateEndpointConnectionProxyListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = PrivateEndpointConnectionProxyListResult.DeserializePrivateEndpointConnectionProxyListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Gets the all private endpoint connections proxies. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The vault name. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response ListNextPage(string nextLink, string subscriptionId, string resourceGroupName, string vaultName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + + using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, vaultName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + PrivateEndpointConnectionProxyListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = PrivateEndpointConnectionProxyListResult.DeserializePrivateEndpointConnectionProxyListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/RestOperations/PrivateEndpointConnectionsRestOperations.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/RestOperations/PrivateEndpointConnectionsRestOperations.cs new file mode 100644 index 000000000000..819655edfa53 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/RestOperations/PrivateEndpointConnectionsRestOperations.cs @@ -0,0 +1,523 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.RecoveryServicesDataReplication.Models; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication +{ + internal partial class PrivateEndpointConnectionsRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of PrivateEndpointConnectionsRestOperations. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// The application id to use for user agent. + /// Service host. + /// The API version to use for this operation. + /// or is null. + public PrivateEndpointConnectionsRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + { + _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); + _endpoint = endpoint ?? new Uri("https://management.azure.com"); + _apiVersion = apiVersion ?? "2024-09-01"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string vaultName, string privateEndpointConnectionName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DataReplication/replicationVaults/", false); + uri.AppendPath(vaultName, true); + uri.AppendPath("/privateEndpointConnections/", false); + uri.AppendPath(privateEndpointConnectionName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string vaultName, string privateEndpointConnectionName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DataReplication/replicationVaults/", false); + uri.AppendPath(vaultName, true); + uri.AppendPath("/privateEndpointConnections/", false); + uri.AppendPath(privateEndpointConnectionName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Gets the private endpoint connection details. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The vault name. + /// The private endpoint connection name. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task> GetAsync(string subscriptionId, string resourceGroupName, string vaultName, string privateEndpointConnectionName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + Argument.AssertNotNullOrEmpty(privateEndpointConnectionName, nameof(privateEndpointConnectionName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, vaultName, privateEndpointConnectionName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + RecoveryServicesDataReplicationPrivateEndpointConnectionData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = RecoveryServicesDataReplicationPrivateEndpointConnectionData.DeserializeRecoveryServicesDataReplicationPrivateEndpointConnectionData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((RecoveryServicesDataReplicationPrivateEndpointConnectionData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// Gets the private endpoint connection details. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The vault name. + /// The private endpoint connection name. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response Get(string subscriptionId, string resourceGroupName, string vaultName, string privateEndpointConnectionName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + Argument.AssertNotNullOrEmpty(privateEndpointConnectionName, nameof(privateEndpointConnectionName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, vaultName, privateEndpointConnectionName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + RecoveryServicesDataReplicationPrivateEndpointConnectionData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = RecoveryServicesDataReplicationPrivateEndpointConnectionData.DeserializeRecoveryServicesDataReplicationPrivateEndpointConnectionData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((RecoveryServicesDataReplicationPrivateEndpointConnectionData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateUpdateRequestUri(string subscriptionId, string resourceGroupName, string vaultName, string privateEndpointConnectionName, RecoveryServicesDataReplicationPrivateEndpointConnectionData data) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DataReplication/replicationVaults/", false); + uri.AppendPath(vaultName, true); + uri.AppendPath("/privateEndpointConnections/", false); + uri.AppendPath(privateEndpointConnectionName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceGroupName, string vaultName, string privateEndpointConnectionName, RecoveryServicesDataReplicationPrivateEndpointConnectionData data) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Put; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DataReplication/replicationVaults/", false); + uri.AppendPath(vaultName, true); + uri.AppendPath("/privateEndpointConnections/", false); + uri.AppendPath(privateEndpointConnectionName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(data, ModelSerializationExtensions.WireOptions); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Updated the private endpoint connection status (Approval/Rejected). This gets invoked by resource admin. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The vault name. + /// The private endpoint connection name. + /// Private endpoint connection update input. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task> UpdateAsync(string subscriptionId, string resourceGroupName, string vaultName, string privateEndpointConnectionName, RecoveryServicesDataReplicationPrivateEndpointConnectionData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + Argument.AssertNotNullOrEmpty(privateEndpointConnectionName, nameof(privateEndpointConnectionName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, vaultName, privateEndpointConnectionName, data); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 201: + { + RecoveryServicesDataReplicationPrivateEndpointConnectionData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = RecoveryServicesDataReplicationPrivateEndpointConnectionData.DeserializeRecoveryServicesDataReplicationPrivateEndpointConnectionData(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Updated the private endpoint connection status (Approval/Rejected). This gets invoked by resource admin. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The vault name. + /// The private endpoint connection name. + /// Private endpoint connection update input. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response Update(string subscriptionId, string resourceGroupName, string vaultName, string privateEndpointConnectionName, RecoveryServicesDataReplicationPrivateEndpointConnectionData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + Argument.AssertNotNullOrEmpty(privateEndpointConnectionName, nameof(privateEndpointConnectionName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, vaultName, privateEndpointConnectionName, data); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 201: + { + RecoveryServicesDataReplicationPrivateEndpointConnectionData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = RecoveryServicesDataReplicationPrivateEndpointConnectionData.DeserializeRecoveryServicesDataReplicationPrivateEndpointConnectionData(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string resourceGroupName, string vaultName, string privateEndpointConnectionName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DataReplication/replicationVaults/", false); + uri.AppendPath(vaultName, true); + uri.AppendPath("/privateEndpointConnections/", false); + uri.AppendPath(privateEndpointConnectionName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string vaultName, string privateEndpointConnectionName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Delete; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DataReplication/replicationVaults/", false); + uri.AppendPath(vaultName, true); + uri.AppendPath("/privateEndpointConnections/", false); + uri.AppendPath(privateEndpointConnectionName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Deletes the private endpoint connection. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The vault name. + /// The private endpoint connection name. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task DeleteAsync(string subscriptionId, string resourceGroupName, string vaultName, string privateEndpointConnectionName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + Argument.AssertNotNullOrEmpty(privateEndpointConnectionName, nameof(privateEndpointConnectionName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, vaultName, privateEndpointConnectionName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Deletes the private endpoint connection. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The vault name. + /// The private endpoint connection name. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response Delete(string subscriptionId, string resourceGroupName, string vaultName, string privateEndpointConnectionName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + Argument.AssertNotNullOrEmpty(privateEndpointConnectionName, nameof(privateEndpointConnectionName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, vaultName, privateEndpointConnectionName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListRequestUri(string subscriptionId, string resourceGroupName, string vaultName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DataReplication/replicationVaults/", false); + uri.AppendPath(vaultName, true); + uri.AppendPath("/privateEndpointConnections", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateListRequest(string subscriptionId, string resourceGroupName, string vaultName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DataReplication/replicationVaults/", false); + uri.AppendPath(vaultName, true); + uri.AppendPath("/privateEndpointConnections", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Gets the all private endpoint connections configured on the vault. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The vault name. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> ListAsync(string subscriptionId, string resourceGroupName, string vaultName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + + using var message = CreateListRequest(subscriptionId, resourceGroupName, vaultName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + RecoveryServicesDataReplicationPrivateEndpointConnectionListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = RecoveryServicesDataReplicationPrivateEndpointConnectionListResult.DeserializeRecoveryServicesDataReplicationPrivateEndpointConnectionListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Gets the all private endpoint connections configured on the vault. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The vault name. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response List(string subscriptionId, string resourceGroupName, string vaultName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + + using var message = CreateListRequest(subscriptionId, resourceGroupName, vaultName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + RecoveryServicesDataReplicationPrivateEndpointConnectionListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = RecoveryServicesDataReplicationPrivateEndpointConnectionListResult.DeserializeRecoveryServicesDataReplicationPrivateEndpointConnectionListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string vaultName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateListNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string vaultName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Gets the all private endpoint connections configured on the vault. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The vault name. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> ListNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string vaultName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + + using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, vaultName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + RecoveryServicesDataReplicationPrivateEndpointConnectionListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = RecoveryServicesDataReplicationPrivateEndpointConnectionListResult.DeserializeRecoveryServicesDataReplicationPrivateEndpointConnectionListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Gets the all private endpoint connections configured on the vault. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The vault name. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response ListNextPage(string nextLink, string subscriptionId, string resourceGroupName, string vaultName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + + using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, vaultName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + RecoveryServicesDataReplicationPrivateEndpointConnectionListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = RecoveryServicesDataReplicationPrivateEndpointConnectionListResult.DeserializeRecoveryServicesDataReplicationPrivateEndpointConnectionListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/RestOperations/PrivateLinkResourcesRestOperations.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/RestOperations/PrivateLinkResourcesRestOperations.cs new file mode 100644 index 000000000000..a5ec9131e622 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/RestOperations/PrivateLinkResourcesRestOperations.cs @@ -0,0 +1,321 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.RecoveryServicesDataReplication.Models; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication +{ + internal partial class PrivateLinkResourcesRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of PrivateLinkResourcesRestOperations. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// The application id to use for user agent. + /// Service host. + /// The API version to use for this operation. + /// or is null. + public PrivateLinkResourcesRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + { + _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); + _endpoint = endpoint ?? new Uri("https://management.azure.com"); + _apiVersion = apiVersion ?? "2024-09-01"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string vaultName, string privateLinkResourceName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DataReplication/replicationVaults/", false); + uri.AppendPath(vaultName, true); + uri.AppendPath("/privateLinkResources/", false); + uri.AppendPath(privateLinkResourceName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string vaultName, string privateLinkResourceName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DataReplication/replicationVaults/", false); + uri.AppendPath(vaultName, true); + uri.AppendPath("/privateLinkResources/", false); + uri.AppendPath(privateLinkResourceName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Gets the details of site recovery private link resource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The vault name. + /// The private link name. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task> GetAsync(string subscriptionId, string resourceGroupName, string vaultName, string privateLinkResourceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + Argument.AssertNotNullOrEmpty(privateLinkResourceName, nameof(privateLinkResourceName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, vaultName, privateLinkResourceName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + RecoveryServicesDataReplicationPrivateLinkResourceDataData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = RecoveryServicesDataReplicationPrivateLinkResourceDataData.DeserializeRecoveryServicesDataReplicationPrivateLinkResourceDataData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((RecoveryServicesDataReplicationPrivateLinkResourceDataData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// Gets the details of site recovery private link resource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The vault name. + /// The private link name. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response Get(string subscriptionId, string resourceGroupName, string vaultName, string privateLinkResourceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + Argument.AssertNotNullOrEmpty(privateLinkResourceName, nameof(privateLinkResourceName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, vaultName, privateLinkResourceName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + RecoveryServicesDataReplicationPrivateLinkResourceDataData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = RecoveryServicesDataReplicationPrivateLinkResourceDataData.DeserializeRecoveryServicesDataReplicationPrivateLinkResourceDataData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((RecoveryServicesDataReplicationPrivateLinkResourceDataData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListRequestUri(string subscriptionId, string resourceGroupName, string vaultName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DataReplication/replicationVaults/", false); + uri.AppendPath(vaultName, true); + uri.AppendPath("/privateLinkResources", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateListRequest(string subscriptionId, string resourceGroupName, string vaultName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DataReplication/replicationVaults/", false); + uri.AppendPath(vaultName, true); + uri.AppendPath("/privateLinkResources", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Gets the list of private link resources. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The vault name. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> ListAsync(string subscriptionId, string resourceGroupName, string vaultName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + + using var message = CreateListRequest(subscriptionId, resourceGroupName, vaultName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + RecoveryServicesDataReplicationPrivateLinkResourceListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = RecoveryServicesDataReplicationPrivateLinkResourceListResult.DeserializeRecoveryServicesDataReplicationPrivateLinkResourceListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Gets the list of private link resources. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The vault name. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response List(string subscriptionId, string resourceGroupName, string vaultName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + + using var message = CreateListRequest(subscriptionId, resourceGroupName, vaultName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + RecoveryServicesDataReplicationPrivateLinkResourceListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = RecoveryServicesDataReplicationPrivateLinkResourceListResult.DeserializeRecoveryServicesDataReplicationPrivateLinkResourceListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string vaultName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateListNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string vaultName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Gets the list of private link resources. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The vault name. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> ListNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string vaultName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + + using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, vaultName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + RecoveryServicesDataReplicationPrivateLinkResourceListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = RecoveryServicesDataReplicationPrivateLinkResourceListResult.DeserializeRecoveryServicesDataReplicationPrivateLinkResourceListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Gets the list of private link resources. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The vault name. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response ListNextPage(string nextLink, string subscriptionId, string resourceGroupName, string vaultName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + + using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, vaultName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + RecoveryServicesDataReplicationPrivateLinkResourceListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = RecoveryServicesDataReplicationPrivateLinkResourceListResult.DeserializeRecoveryServicesDataReplicationPrivateLinkResourceListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/RestOperations/ProtectedItemRestOperations.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/RestOperations/ProtectedItemRestOperations.cs new file mode 100644 index 000000000000..c5e414b752aa --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/RestOperations/ProtectedItemRestOperations.cs @@ -0,0 +1,761 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.RecoveryServicesDataReplication.Models; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication +{ + internal partial class ProtectedItemRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of ProtectedItemRestOperations. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// The application id to use for user agent. + /// Service host. + /// The API version to use for this operation. + /// or is null. + public ProtectedItemRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + { + _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); + _endpoint = endpoint ?? new Uri("https://management.azure.com"); + _apiVersion = apiVersion ?? "2024-09-01"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string vaultName, string protectedItemName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DataReplication/replicationVaults/", false); + uri.AppendPath(vaultName, true); + uri.AppendPath("/protectedItems/", false); + uri.AppendPath(protectedItemName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string vaultName, string protectedItemName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DataReplication/replicationVaults/", false); + uri.AppendPath(vaultName, true); + uri.AppendPath("/protectedItems/", false); + uri.AppendPath(protectedItemName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Gets the details of the protected item. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The vault name. + /// The protected item name. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task> GetAsync(string subscriptionId, string resourceGroupName, string vaultName, string protectedItemName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + Argument.AssertNotNullOrEmpty(protectedItemName, nameof(protectedItemName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, vaultName, protectedItemName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + ProtectedItemModelData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = ProtectedItemModelData.DeserializeProtectedItemModelData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((ProtectedItemModelData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// Gets the details of the protected item. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The vault name. + /// The protected item name. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response Get(string subscriptionId, string resourceGroupName, string vaultName, string protectedItemName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + Argument.AssertNotNullOrEmpty(protectedItemName, nameof(protectedItemName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, vaultName, protectedItemName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + ProtectedItemModelData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = ProtectedItemModelData.DeserializeProtectedItemModelData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((ProtectedItemModelData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateCreateRequestUri(string subscriptionId, string resourceGroupName, string vaultName, string protectedItemName, ProtectedItemModelData data) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DataReplication/replicationVaults/", false); + uri.AppendPath(vaultName, true); + uri.AppendPath("/protectedItems/", false); + uri.AppendPath(protectedItemName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateCreateRequest(string subscriptionId, string resourceGroupName, string vaultName, string protectedItemName, ProtectedItemModelData data) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Put; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DataReplication/replicationVaults/", false); + uri.AppendPath(vaultName, true); + uri.AppendPath("/protectedItems/", false); + uri.AppendPath(protectedItemName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(data, ModelSerializationExtensions.WireOptions); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Creates the protected item. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The vault name. + /// The protected item name. + /// Protected item model. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task CreateAsync(string subscriptionId, string resourceGroupName, string vaultName, string protectedItemName, ProtectedItemModelData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + Argument.AssertNotNullOrEmpty(protectedItemName, nameof(protectedItemName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateRequest(subscriptionId, resourceGroupName, vaultName, protectedItemName, data); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 201: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Creates the protected item. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The vault name. + /// The protected item name. + /// Protected item model. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response Create(string subscriptionId, string resourceGroupName, string vaultName, string protectedItemName, ProtectedItemModelData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + Argument.AssertNotNullOrEmpty(protectedItemName, nameof(protectedItemName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateRequest(subscriptionId, resourceGroupName, vaultName, protectedItemName, data); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 201: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateUpdateRequestUri(string subscriptionId, string resourceGroupName, string vaultName, string protectedItemName, ProtectedItemModelPatch patch) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DataReplication/replicationVaults/", false); + uri.AppendPath(vaultName, true); + uri.AppendPath("/protectedItems/", false); + uri.AppendPath(protectedItemName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceGroupName, string vaultName, string protectedItemName, ProtectedItemModelPatch patch) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Patch; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DataReplication/replicationVaults/", false); + uri.AppendPath(vaultName, true); + uri.AppendPath("/protectedItems/", false); + uri.AppendPath(protectedItemName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(patch, ModelSerializationExtensions.WireOptions); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Performs update on the protected item. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The vault name. + /// The protected item name. + /// Protected item model. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task UpdateAsync(string subscriptionId, string resourceGroupName, string vaultName, string protectedItemName, ProtectedItemModelPatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + Argument.AssertNotNullOrEmpty(protectedItemName, nameof(protectedItemName)); + Argument.AssertNotNull(patch, nameof(patch)); + + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, vaultName, protectedItemName, patch); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Performs update on the protected item. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The vault name. + /// The protected item name. + /// Protected item model. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response Update(string subscriptionId, string resourceGroupName, string vaultName, string protectedItemName, ProtectedItemModelPatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + Argument.AssertNotNullOrEmpty(protectedItemName, nameof(protectedItemName)); + Argument.AssertNotNull(patch, nameof(patch)); + + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, vaultName, protectedItemName, patch); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string resourceGroupName, string vaultName, string protectedItemName, bool? forceDelete) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DataReplication/replicationVaults/", false); + uri.AppendPath(vaultName, true); + uri.AppendPath("/protectedItems/", false); + uri.AppendPath(protectedItemName, true); + uri.AppendQuery("api-version", _apiVersion, true); + if (forceDelete != null) + { + uri.AppendQuery("forceDelete", forceDelete.Value, true); + } + return uri; + } + + internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string vaultName, string protectedItemName, bool? forceDelete) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Delete; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DataReplication/replicationVaults/", false); + uri.AppendPath(vaultName, true); + uri.AppendPath("/protectedItems/", false); + uri.AppendPath(protectedItemName, true); + uri.AppendQuery("api-version", _apiVersion, true); + if (forceDelete != null) + { + uri.AppendQuery("forceDelete", forceDelete.Value, true); + } + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Removes the protected item. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The vault name. + /// The protected item name. + /// A flag indicating whether to do force delete or not. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task DeleteAsync(string subscriptionId, string resourceGroupName, string vaultName, string protectedItemName, bool? forceDelete = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + Argument.AssertNotNullOrEmpty(protectedItemName, nameof(protectedItemName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, vaultName, protectedItemName, forceDelete); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Removes the protected item. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The vault name. + /// The protected item name. + /// A flag indicating whether to do force delete or not. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response Delete(string subscriptionId, string resourceGroupName, string vaultName, string protectedItemName, bool? forceDelete = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + Argument.AssertNotNullOrEmpty(protectedItemName, nameof(protectedItemName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, vaultName, protectedItemName, forceDelete); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListRequestUri(string subscriptionId, string resourceGroupName, string vaultName, string odataOptions, string continuationToken, int? pageSize) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DataReplication/replicationVaults/", false); + uri.AppendPath(vaultName, true); + uri.AppendPath("/protectedItems", false); + uri.AppendQuery("api-version", _apiVersion, true); + if (odataOptions != null) + { + uri.AppendQuery("odataOptions", odataOptions, true); + } + if (continuationToken != null) + { + uri.AppendQuery("continuationToken", continuationToken, true); + } + if (pageSize != null) + { + uri.AppendQuery("pageSize", pageSize.Value, true); + } + return uri; + } + + internal HttpMessage CreateListRequest(string subscriptionId, string resourceGroupName, string vaultName, string odataOptions, string continuationToken, int? pageSize) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DataReplication/replicationVaults/", false); + uri.AppendPath(vaultName, true); + uri.AppendPath("/protectedItems", false); + uri.AppendQuery("api-version", _apiVersion, true); + if (odataOptions != null) + { + uri.AppendQuery("odataOptions", odataOptions, true); + } + if (continuationToken != null) + { + uri.AppendQuery("continuationToken", continuationToken, true); + } + if (pageSize != null) + { + uri.AppendQuery("pageSize", pageSize.Value, true); + } + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Gets the list of protected items in the given vault. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The vault name. + /// OData options. + /// Continuation token. + /// Page size. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> ListAsync(string subscriptionId, string resourceGroupName, string vaultName, string odataOptions = null, string continuationToken = null, int? pageSize = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + + using var message = CreateListRequest(subscriptionId, resourceGroupName, vaultName, odataOptions, continuationToken, pageSize); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + ProtectedItemModelListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = ProtectedItemModelListResult.DeserializeProtectedItemModelListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Gets the list of protected items in the given vault. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The vault name. + /// OData options. + /// Continuation token. + /// Page size. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response List(string subscriptionId, string resourceGroupName, string vaultName, string odataOptions = null, string continuationToken = null, int? pageSize = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + + using var message = CreateListRequest(subscriptionId, resourceGroupName, vaultName, odataOptions, continuationToken, pageSize); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + ProtectedItemModelListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = ProtectedItemModelListResult.DeserializeProtectedItemModelListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreatePlannedFailoverRequestUri(string subscriptionId, string resourceGroupName, string vaultName, string protectedItemName, PlannedFailoverModel body) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DataReplication/replicationVaults/", false); + uri.AppendPath(vaultName, true); + uri.AppendPath("/protectedItems/", false); + uri.AppendPath(protectedItemName, true); + uri.AppendPath("/plannedFailover", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreatePlannedFailoverRequest(string subscriptionId, string resourceGroupName, string vaultName, string protectedItemName, PlannedFailoverModel body) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DataReplication/replicationVaults/", false); + uri.AppendPath(vaultName, true); + uri.AppendPath("/protectedItems/", false); + uri.AppendPath(protectedItemName, true); + uri.AppendPath("/plannedFailover", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(body, ModelSerializationExtensions.WireOptions); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Performs the planned failover on the protected item. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The vault name. + /// The protected item name. + /// Planned failover model. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task PlannedFailoverAsync(string subscriptionId, string resourceGroupName, string vaultName, string protectedItemName, PlannedFailoverModel body, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + Argument.AssertNotNullOrEmpty(protectedItemName, nameof(protectedItemName)); + Argument.AssertNotNull(body, nameof(body)); + + using var message = CreatePlannedFailoverRequest(subscriptionId, resourceGroupName, vaultName, protectedItemName, body); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 202: + case 200: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Performs the planned failover on the protected item. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The vault name. + /// The protected item name. + /// Planned failover model. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response PlannedFailover(string subscriptionId, string resourceGroupName, string vaultName, string protectedItemName, PlannedFailoverModel body, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + Argument.AssertNotNullOrEmpty(protectedItemName, nameof(protectedItemName)); + Argument.AssertNotNull(body, nameof(body)); + + using var message = CreatePlannedFailoverRequest(subscriptionId, resourceGroupName, vaultName, protectedItemName, body); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 202: + case 200: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string vaultName, string odataOptions, string continuationToken, int? pageSize) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateListNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string vaultName, string odataOptions, string continuationToken, int? pageSize) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Gets the list of protected items in the given vault. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The vault name. + /// OData options. + /// Continuation token. + /// Page size. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> ListNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string vaultName, string odataOptions = null, string continuationToken = null, int? pageSize = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + + using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, vaultName, odataOptions, continuationToken, pageSize); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + ProtectedItemModelListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = ProtectedItemModelListResult.DeserializeProtectedItemModelListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Gets the list of protected items in the given vault. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The vault name. + /// OData options. + /// Continuation token. + /// Page size. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response ListNextPage(string nextLink, string subscriptionId, string resourceGroupName, string vaultName, string odataOptions = null, string continuationToken = null, int? pageSize = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + + using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, vaultName, odataOptions, continuationToken, pageSize); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + ProtectedItemModelListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = ProtectedItemModelListResult.DeserializeProtectedItemModelListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/RestOperations/RecoveryPointRestOperations.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/RestOperations/RecoveryPointRestOperations.cs new file mode 100644 index 000000000000..3c2d5196d6c5 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/RestOperations/RecoveryPointRestOperations.cs @@ -0,0 +1,341 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.RecoveryServicesDataReplication.Models; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication +{ + internal partial class RecoveryPointRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of RecoveryPointRestOperations. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// The application id to use for user agent. + /// Service host. + /// The API version to use for this operation. + /// or is null. + public RecoveryPointRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + { + _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); + _endpoint = endpoint ?? new Uri("https://management.azure.com"); + _apiVersion = apiVersion ?? "2024-09-01"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string vaultName, string protectedItemName, string recoveryPointName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DataReplication/replicationVaults/", false); + uri.AppendPath(vaultName, true); + uri.AppendPath("/protectedItems/", false); + uri.AppendPath(protectedItemName, true); + uri.AppendPath("/recoveryPoints/", false); + uri.AppendPath(recoveryPointName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string vaultName, string protectedItemName, string recoveryPointName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DataReplication/replicationVaults/", false); + uri.AppendPath(vaultName, true); + uri.AppendPath("/protectedItems/", false); + uri.AppendPath(protectedItemName, true); + uri.AppendPath("/recoveryPoints/", false); + uri.AppendPath(recoveryPointName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Gets the details of the recovery point of a protected item. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The vault name. + /// The protected item name. + /// The recovery point name. + /// The cancellation token to use. + /// , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public async Task> GetAsync(string subscriptionId, string resourceGroupName, string vaultName, string protectedItemName, string recoveryPointName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + Argument.AssertNotNullOrEmpty(protectedItemName, nameof(protectedItemName)); + Argument.AssertNotNullOrEmpty(recoveryPointName, nameof(recoveryPointName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, vaultName, protectedItemName, recoveryPointName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + RecoveryPointModelData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = RecoveryPointModelData.DeserializeRecoveryPointModelData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((RecoveryPointModelData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// Gets the details of the recovery point of a protected item. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The vault name. + /// The protected item name. + /// The recovery point name. + /// The cancellation token to use. + /// , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public Response Get(string subscriptionId, string resourceGroupName, string vaultName, string protectedItemName, string recoveryPointName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + Argument.AssertNotNullOrEmpty(protectedItemName, nameof(protectedItemName)); + Argument.AssertNotNullOrEmpty(recoveryPointName, nameof(recoveryPointName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, vaultName, protectedItemName, recoveryPointName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + RecoveryPointModelData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = RecoveryPointModelData.DeserializeRecoveryPointModelData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((RecoveryPointModelData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListRequestUri(string subscriptionId, string resourceGroupName, string vaultName, string protectedItemName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DataReplication/replicationVaults/", false); + uri.AppendPath(vaultName, true); + uri.AppendPath("/protectedItems/", false); + uri.AppendPath(protectedItemName, true); + uri.AppendPath("/recoveryPoints", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateListRequest(string subscriptionId, string resourceGroupName, string vaultName, string protectedItemName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DataReplication/replicationVaults/", false); + uri.AppendPath(vaultName, true); + uri.AppendPath("/protectedItems/", false); + uri.AppendPath(protectedItemName, true); + uri.AppendPath("/recoveryPoints", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Gets the list of recovery points of the given protected item. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The vault name. + /// The protected item name. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task> ListAsync(string subscriptionId, string resourceGroupName, string vaultName, string protectedItemName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + Argument.AssertNotNullOrEmpty(protectedItemName, nameof(protectedItemName)); + + using var message = CreateListRequest(subscriptionId, resourceGroupName, vaultName, protectedItemName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + RecoveryPointModelListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = RecoveryPointModelListResult.DeserializeRecoveryPointModelListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Gets the list of recovery points of the given protected item. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The vault name. + /// The protected item name. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response List(string subscriptionId, string resourceGroupName, string vaultName, string protectedItemName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + Argument.AssertNotNullOrEmpty(protectedItemName, nameof(protectedItemName)); + + using var message = CreateListRequest(subscriptionId, resourceGroupName, vaultName, protectedItemName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + RecoveryPointModelListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = RecoveryPointModelListResult.DeserializeRecoveryPointModelListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string vaultName, string protectedItemName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateListNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string vaultName, string protectedItemName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Gets the list of recovery points of the given protected item. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The vault name. + /// The protected item name. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task> ListNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string vaultName, string protectedItemName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + Argument.AssertNotNullOrEmpty(protectedItemName, nameof(protectedItemName)); + + using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, vaultName, protectedItemName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + RecoveryPointModelListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = RecoveryPointModelListResult.DeserializeRecoveryPointModelListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Gets the list of recovery points of the given protected item. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The vault name. + /// The protected item name. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response ListNextPage(string nextLink, string subscriptionId, string resourceGroupName, string vaultName, string protectedItemName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + Argument.AssertNotNullOrEmpty(protectedItemName, nameof(protectedItemName)); + + using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, vaultName, protectedItemName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + RecoveryPointModelListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = RecoveryPointModelListResult.DeserializeRecoveryPointModelListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/RestOperations/ReplicationExtensionRestOperations.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/RestOperations/ReplicationExtensionRestOperations.cs new file mode 100644 index 000000000000..db9017723b17 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/RestOperations/ReplicationExtensionRestOperations.cs @@ -0,0 +1,513 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.RecoveryServicesDataReplication.Models; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication +{ + internal partial class ReplicationExtensionRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of ReplicationExtensionRestOperations. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// The application id to use for user agent. + /// Service host. + /// The API version to use for this operation. + /// or is null. + public ReplicationExtensionRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + { + _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); + _endpoint = endpoint ?? new Uri("https://management.azure.com"); + _apiVersion = apiVersion ?? "2024-09-01"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string vaultName, string replicationExtensionName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DataReplication/replicationVaults/", false); + uri.AppendPath(vaultName, true); + uri.AppendPath("/replicationExtensions/", false); + uri.AppendPath(replicationExtensionName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string vaultName, string replicationExtensionName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DataReplication/replicationVaults/", false); + uri.AppendPath(vaultName, true); + uri.AppendPath("/replicationExtensions/", false); + uri.AppendPath(replicationExtensionName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Gets the details of the replication extension. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The vault name. + /// The replication extension name. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task> GetAsync(string subscriptionId, string resourceGroupName, string vaultName, string replicationExtensionName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + Argument.AssertNotNullOrEmpty(replicationExtensionName, nameof(replicationExtensionName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, vaultName, replicationExtensionName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + ReplicationExtensionModelData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = ReplicationExtensionModelData.DeserializeReplicationExtensionModelData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((ReplicationExtensionModelData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// Gets the details of the replication extension. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The vault name. + /// The replication extension name. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response Get(string subscriptionId, string resourceGroupName, string vaultName, string replicationExtensionName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + Argument.AssertNotNullOrEmpty(replicationExtensionName, nameof(replicationExtensionName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, vaultName, replicationExtensionName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + ReplicationExtensionModelData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = ReplicationExtensionModelData.DeserializeReplicationExtensionModelData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((ReplicationExtensionModelData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateCreateRequestUri(string subscriptionId, string resourceGroupName, string vaultName, string replicationExtensionName, ReplicationExtensionModelData data) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DataReplication/replicationVaults/", false); + uri.AppendPath(vaultName, true); + uri.AppendPath("/replicationExtensions/", false); + uri.AppendPath(replicationExtensionName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateCreateRequest(string subscriptionId, string resourceGroupName, string vaultName, string replicationExtensionName, ReplicationExtensionModelData data) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Put; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DataReplication/replicationVaults/", false); + uri.AppendPath(vaultName, true); + uri.AppendPath("/replicationExtensions/", false); + uri.AppendPath(replicationExtensionName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(data, ModelSerializationExtensions.WireOptions); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Creates the replication extension in the given vault. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The vault name. + /// The replication extension name. + /// Replication extension model. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task CreateAsync(string subscriptionId, string resourceGroupName, string vaultName, string replicationExtensionName, ReplicationExtensionModelData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + Argument.AssertNotNullOrEmpty(replicationExtensionName, nameof(replicationExtensionName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateRequest(subscriptionId, resourceGroupName, vaultName, replicationExtensionName, data); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 201: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Creates the replication extension in the given vault. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The vault name. + /// The replication extension name. + /// Replication extension model. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response Create(string subscriptionId, string resourceGroupName, string vaultName, string replicationExtensionName, ReplicationExtensionModelData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + Argument.AssertNotNullOrEmpty(replicationExtensionName, nameof(replicationExtensionName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateRequest(subscriptionId, resourceGroupName, vaultName, replicationExtensionName, data); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 201: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string resourceGroupName, string vaultName, string replicationExtensionName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DataReplication/replicationVaults/", false); + uri.AppendPath(vaultName, true); + uri.AppendPath("/replicationExtensions/", false); + uri.AppendPath(replicationExtensionName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string vaultName, string replicationExtensionName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Delete; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DataReplication/replicationVaults/", false); + uri.AppendPath(vaultName, true); + uri.AppendPath("/replicationExtensions/", false); + uri.AppendPath(replicationExtensionName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Deletes the replication extension in the given vault. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The vault name. + /// The replication extension name. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task DeleteAsync(string subscriptionId, string resourceGroupName, string vaultName, string replicationExtensionName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + Argument.AssertNotNullOrEmpty(replicationExtensionName, nameof(replicationExtensionName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, vaultName, replicationExtensionName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Deletes the replication extension in the given vault. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The vault name. + /// The replication extension name. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response Delete(string subscriptionId, string resourceGroupName, string vaultName, string replicationExtensionName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + Argument.AssertNotNullOrEmpty(replicationExtensionName, nameof(replicationExtensionName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, vaultName, replicationExtensionName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListRequestUri(string subscriptionId, string resourceGroupName, string vaultName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DataReplication/replicationVaults/", false); + uri.AppendPath(vaultName, true); + uri.AppendPath("/replicationExtensions", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateListRequest(string subscriptionId, string resourceGroupName, string vaultName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DataReplication/replicationVaults/", false); + uri.AppendPath(vaultName, true); + uri.AppendPath("/replicationExtensions", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Gets the list of replication extensions in the given vault. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The vault name. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> ListAsync(string subscriptionId, string resourceGroupName, string vaultName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + + using var message = CreateListRequest(subscriptionId, resourceGroupName, vaultName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + ReplicationExtensionModelListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = ReplicationExtensionModelListResult.DeserializeReplicationExtensionModelListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Gets the list of replication extensions in the given vault. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The vault name. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response List(string subscriptionId, string resourceGroupName, string vaultName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + + using var message = CreateListRequest(subscriptionId, resourceGroupName, vaultName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + ReplicationExtensionModelListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = ReplicationExtensionModelListResult.DeserializeReplicationExtensionModelListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string vaultName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateListNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string vaultName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Gets the list of replication extensions in the given vault. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The vault name. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> ListNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string vaultName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + + using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, vaultName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + ReplicationExtensionModelListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = ReplicationExtensionModelListResult.DeserializeReplicationExtensionModelListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Gets the list of replication extensions in the given vault. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The vault name. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response ListNextPage(string nextLink, string subscriptionId, string resourceGroupName, string vaultName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + + using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, vaultName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + ReplicationExtensionModelListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = ReplicationExtensionModelListResult.DeserializeReplicationExtensionModelListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/RestOperations/VaultRestOperations.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/RestOperations/VaultRestOperations.cs new file mode 100644 index 000000000000..8d1f6fce4b4b --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/RestOperations/VaultRestOperations.cs @@ -0,0 +1,735 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.RecoveryServicesDataReplication.Models; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication +{ + internal partial class VaultRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of VaultRestOperations. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// The application id to use for user agent. + /// Service host. + /// The API version to use for this operation. + /// or is null. + public VaultRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + { + _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); + _endpoint = endpoint ?? new Uri("https://management.azure.com"); + _apiVersion = apiVersion ?? "2024-09-01"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string vaultName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DataReplication/replicationVaults/", false); + uri.AppendPath(vaultName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string vaultName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DataReplication/replicationVaults/", false); + uri.AppendPath(vaultName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Gets the details of the vault. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The vault name. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> GetAsync(string subscriptionId, string resourceGroupName, string vaultName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, vaultName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + VaultModelData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = VaultModelData.DeserializeVaultModelData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((VaultModelData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// Gets the details of the vault. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The vault name. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response Get(string subscriptionId, string resourceGroupName, string vaultName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, vaultName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + VaultModelData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = VaultModelData.DeserializeVaultModelData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((VaultModelData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateCreateRequestUri(string subscriptionId, string resourceGroupName, string vaultName, VaultModelData data) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DataReplication/replicationVaults/", false); + uri.AppendPath(vaultName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateCreateRequest(string subscriptionId, string resourceGroupName, string vaultName, VaultModelData data) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Put; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DataReplication/replicationVaults/", false); + uri.AppendPath(vaultName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(data, ModelSerializationExtensions.WireOptions); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Creates the vault. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The vault name. + /// Vault properties. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task CreateAsync(string subscriptionId, string resourceGroupName, string vaultName, VaultModelData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateRequest(subscriptionId, resourceGroupName, vaultName, data); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 201: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Creates the vault. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The vault name. + /// Vault properties. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response Create(string subscriptionId, string resourceGroupName, string vaultName, VaultModelData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateRequest(subscriptionId, resourceGroupName, vaultName, data); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 201: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateUpdateRequestUri(string subscriptionId, string resourceGroupName, string vaultName, VaultModelPatch patch) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DataReplication/replicationVaults/", false); + uri.AppendPath(vaultName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceGroupName, string vaultName, VaultModelPatch patch) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Patch; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DataReplication/replicationVaults/", false); + uri.AppendPath(vaultName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(patch, ModelSerializationExtensions.WireOptions); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Performs update on the vault. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The vault name. + /// Vault properties. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task UpdateAsync(string subscriptionId, string resourceGroupName, string vaultName, VaultModelPatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + Argument.AssertNotNull(patch, nameof(patch)); + + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, vaultName, patch); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Performs update on the vault. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The vault name. + /// Vault properties. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response Update(string subscriptionId, string resourceGroupName, string vaultName, VaultModelPatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + Argument.AssertNotNull(patch, nameof(patch)); + + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, vaultName, patch); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string resourceGroupName, string vaultName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DataReplication/replicationVaults/", false); + uri.AppendPath(vaultName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string vaultName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Delete; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DataReplication/replicationVaults/", false); + uri.AppendPath(vaultName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Removes the vault. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The vault name. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task DeleteAsync(string subscriptionId, string resourceGroupName, string vaultName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, vaultName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Removes the vault. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The vault name. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response Delete(string subscriptionId, string resourceGroupName, string vaultName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, vaultName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListRequestUri(string subscriptionId, string resourceGroupName, string continuationToken) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DataReplication/replicationVaults", false); + uri.AppendQuery("api-version", _apiVersion, true); + if (continuationToken != null) + { + uri.AppendQuery("continuationToken", continuationToken, true); + } + return uri; + } + + internal HttpMessage CreateListRequest(string subscriptionId, string resourceGroupName, string continuationToken) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DataReplication/replicationVaults", false); + uri.AppendQuery("api-version", _apiVersion, true); + if (continuationToken != null) + { + uri.AppendQuery("continuationToken", continuationToken, true); + } + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Gets the list of vaults in the given subscription and resource group. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Continuation token from the previous call. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + public async Task> ListAsync(string subscriptionId, string resourceGroupName, string continuationToken = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + + using var message = CreateListRequest(subscriptionId, resourceGroupName, continuationToken); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + VaultModelListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = VaultModelListResult.DeserializeVaultModelListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Gets the list of vaults in the given subscription and resource group. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Continuation token from the previous call. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + public Response List(string subscriptionId, string resourceGroupName, string continuationToken = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + + using var message = CreateListRequest(subscriptionId, resourceGroupName, continuationToken); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + VaultModelListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = VaultModelListResult.DeserializeVaultModelListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListBySubscriptionRequestUri(string subscriptionId) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/providers/Microsoft.DataReplication/replicationVaults", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateListBySubscriptionRequest(string subscriptionId) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/providers/Microsoft.DataReplication/replicationVaults", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Gets the list of vaults in the given subscription. + /// The ID of the target subscription. The value must be an UUID. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + public async Task> ListBySubscriptionAsync(string subscriptionId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + + using var message = CreateListBySubscriptionRequest(subscriptionId); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + VaultModelListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = VaultModelListResult.DeserializeVaultModelListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Gets the list of vaults in the given subscription. + /// The ID of the target subscription. The value must be an UUID. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + public Response ListBySubscription(string subscriptionId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + + using var message = CreateListBySubscriptionRequest(subscriptionId); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + VaultModelListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = VaultModelListResult.DeserializeVaultModelListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string continuationToken) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateListNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string continuationToken) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Gets the list of vaults in the given subscription and resource group. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Continuation token from the previous call. + /// The cancellation token to use. + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + public async Task> ListNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string continuationToken = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + + using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, continuationToken); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + VaultModelListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = VaultModelListResult.DeserializeVaultModelListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Gets the list of vaults in the given subscription and resource group. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Continuation token from the previous call. + /// The cancellation token to use. + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + public Response ListNextPage(string nextLink, string subscriptionId, string resourceGroupName, string continuationToken = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + + using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, continuationToken); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + VaultModelListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = VaultModelListResult.DeserializeVaultModelListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListBySubscriptionNextPageRequestUri(string nextLink, string subscriptionId) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateListBySubscriptionNextPageRequest(string nextLink, string subscriptionId) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Gets the list of vaults in the given subscription. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + public async Task> ListBySubscriptionNextPageAsync(string nextLink, string subscriptionId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + + using var message = CreateListBySubscriptionNextPageRequest(nextLink, subscriptionId); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + VaultModelListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = VaultModelListResult.DeserializeVaultModelListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Gets the list of vaults in the given subscription. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + public Response ListBySubscriptionNextPage(string nextLink, string subscriptionId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + + using var message = CreateListBySubscriptionNextPageRequest(nextLink, subscriptionId); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + VaultModelListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = VaultModelListResult.DeserializeVaultModelListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/VaultModelCollection.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/VaultModelCollection.cs new file mode 100644 index 000000000000..47b20bb49438 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/VaultModelCollection.cs @@ -0,0 +1,496 @@ +// 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.RecoveryServicesDataReplication +{ + /// + /// 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 GetVaultModels method from an instance of . + /// + public partial class VaultModelCollection : ArmCollection, IEnumerable, IAsyncEnumerable + { + private readonly ClientDiagnostics _vaultModelVaultClientDiagnostics; + private readonly VaultRestOperations _vaultModelVaultRestClient; + + /// Initializes a new instance of the class for mocking. + protected VaultModelCollection() + { + } + + /// 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 VaultModelCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _vaultModelVaultClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.RecoveryServicesDataReplication", VaultModelResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(VaultModelResource.ResourceType, out string vaultModelVaultApiVersion); + _vaultModelVaultRestClient = new VaultRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, vaultModelVaultApiVersion); +#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)); + } + + /// + /// Creates the vault. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName} + /// + /// + /// Operation Id + /// VaultModel_Create + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// 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 vault name. + /// Vault properties. + /// 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 vaultName, VaultModelData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _vaultModelVaultClientDiagnostics.CreateScope("VaultModelCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = await _vaultModelVaultRestClient.CreateAsync(Id.SubscriptionId, Id.ResourceGroupName, vaultName, data, cancellationToken).ConfigureAwait(false); + var operation = new RecoveryServicesDataReplicationArmOperation(new VaultModelOperationSource(Client), _vaultModelVaultClientDiagnostics, Pipeline, _vaultModelVaultRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, vaultName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Creates the vault. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName} + /// + /// + /// Operation Id + /// VaultModel_Create + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// 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 vault name. + /// Vault properties. + /// 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 vaultName, VaultModelData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _vaultModelVaultClientDiagnostics.CreateScope("VaultModelCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = _vaultModelVaultRestClient.Create(Id.SubscriptionId, Id.ResourceGroupName, vaultName, data, cancellationToken); + var operation = new RecoveryServicesDataReplicationArmOperation(new VaultModelOperationSource(Client), _vaultModelVaultClientDiagnostics, Pipeline, _vaultModelVaultRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, vaultName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets the details of the vault. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName} + /// + /// + /// Operation Id + /// VaultModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The vault name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetAsync(string vaultName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + + using var scope = _vaultModelVaultClientDiagnostics.CreateScope("VaultModelCollection.Get"); + scope.Start(); + try + { + var response = await _vaultModelVaultRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, vaultName, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new VaultModelResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets the details of the vault. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName} + /// + /// + /// Operation Id + /// VaultModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The vault name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Get(string vaultName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + + using var scope = _vaultModelVaultClientDiagnostics.CreateScope("VaultModelCollection.Get"); + scope.Start(); + try + { + var response = _vaultModelVaultRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, vaultName, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new VaultModelResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets the list of vaults in the given subscription and resource group. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults + /// + /// + /// Operation Id + /// VaultModel_List + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Continuation token from the previous call. + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetAllAsync(string continuationToken = null, CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _vaultModelVaultRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, continuationToken); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _vaultModelVaultRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, continuationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new VaultModelResource(Client, VaultModelData.DeserializeVaultModelData(e)), _vaultModelVaultClientDiagnostics, Pipeline, "VaultModelCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Gets the list of vaults in the given subscription and resource group. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults + /// + /// + /// Operation Id + /// VaultModel_List + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Continuation token from the previous call. + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetAll(string continuationToken = null, CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _vaultModelVaultRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, continuationToken); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _vaultModelVaultRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, continuationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new VaultModelResource(Client, VaultModelData.DeserializeVaultModelData(e)), _vaultModelVaultClientDiagnostics, Pipeline, "VaultModelCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName} + /// + /// + /// Operation Id + /// VaultModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The vault name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> ExistsAsync(string vaultName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + + using var scope = _vaultModelVaultClientDiagnostics.CreateScope("VaultModelCollection.Exists"); + scope.Start(); + try + { + var response = await _vaultModelVaultRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, vaultName, 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.DataReplication/replicationVaults/{vaultName} + /// + /// + /// Operation Id + /// VaultModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The vault name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Exists(string vaultName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + + using var scope = _vaultModelVaultClientDiagnostics.CreateScope("VaultModelCollection.Exists"); + scope.Start(); + try + { + var response = _vaultModelVaultRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, vaultName, 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.DataReplication/replicationVaults/{vaultName} + /// + /// + /// Operation Id + /// VaultModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The vault name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetIfExistsAsync(string vaultName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + + using var scope = _vaultModelVaultClientDiagnostics.CreateScope("VaultModelCollection.GetIfExists"); + scope.Start(); + try + { + var response = await _vaultModelVaultRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, vaultName, cancellationToken: cancellationToken).ConfigureAwait(false); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new VaultModelResource(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.DataReplication/replicationVaults/{vaultName} + /// + /// + /// Operation Id + /// VaultModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The vault name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual NullableResponse GetIfExists(string vaultName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + + using var scope = _vaultModelVaultClientDiagnostics.CreateScope("VaultModelCollection.GetIfExists"); + scope.Start(); + try + { + var response = _vaultModelVaultRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, vaultName, cancellationToken: cancellationToken); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new VaultModelResource(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/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/VaultModelData.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/VaultModelData.Serialization.cs new file mode 100644 index 000000000000..743b44cf4425 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/VaultModelData.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.Models; +using Azure.ResourceManager.RecoveryServicesDataReplication.Models; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication +{ + public partial class VaultModelData : 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(VaultModelData)} 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); + } + } + + VaultModelData 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(VaultModelData)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeVaultModelData(document.RootElement, options); + } + + internal static VaultModelData DeserializeVaultModelData(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + VaultModelProperties 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 = VaultModelProperties.DeserializeVaultModelProperties(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 VaultModelData( + 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(VaultModelData)} does not support writing '{options.Format}' format."); + } + } + + VaultModelData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeVaultModelData(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(VaultModelData)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/VaultModelData.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/VaultModelData.cs new file mode 100644 index 000000000000..87137c9979dd --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/VaultModelData.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.Models; +using Azure.ResourceManager.RecoveryServicesDataReplication.Models; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication +{ + /// + /// A class representing the VaultModel data model. + /// Vault model. + /// + public partial class VaultModelData : 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 VaultModelData(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 VaultModelData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, VaultModelProperties 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 VaultModelData() + { + } + + /// The resource-specific properties for this resource. + public VaultModelProperties Properties { get; set; } + /// The managed service identities assigned to this resource. + public ManagedServiceIdentity Identity { get; set; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/VaultModelResource.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/VaultModelResource.Serialization.cs new file mode 100644 index 000000000000..eb898fb4776f --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/VaultModelResource.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.RecoveryServicesDataReplication +{ + public partial class VaultModelResource : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); + + VaultModelData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options); + + VaultModelData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options); + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/VaultModelResource.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/VaultModelResource.cs new file mode 100644 index 000000000000..d384c642e906 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/VaultModelResource.cs @@ -0,0 +1,1328 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.RecoveryServicesDataReplication.Models; +using Azure.ResourceManager.Resources; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication +{ + /// + /// A Class representing a VaultModel 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 GetVaultModelResource method. + /// Otherwise you can get one from its parent resource using the GetVaultModel method. + /// + public partial class VaultModelResource : ArmResource + { + /// Generate the resource identifier of a instance. + /// The subscriptionId. + /// The resourceGroupName. + /// The vaultName. + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string vaultName) + { + var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}"; + return new ResourceIdentifier(resourceId); + } + + private readonly ClientDiagnostics _vaultModelVaultClientDiagnostics; + private readonly VaultRestOperations _vaultModelVaultRestClient; + private readonly VaultModelData _data; + + /// Gets the resource type for the operations. + public static readonly ResourceType ResourceType = "Microsoft.DataReplication/replicationVaults"; + + /// Initializes a new instance of the class for mocking. + protected VaultModelResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal VaultModelResource(ArmClient client, VaultModelData 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 VaultModelResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _vaultModelVaultClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.RecoveryServicesDataReplication", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string vaultModelVaultApiVersion); + _vaultModelVaultRestClient = new VaultRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, vaultModelVaultApiVersion); +#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 VaultModelData 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)); + } + + /// Gets a collection of EmailConfigurationModelResources in the VaultModel. + /// An object representing collection of EmailConfigurationModelResources and their operations over a EmailConfigurationModelResource. + public virtual EmailConfigurationModelCollection GetEmailConfigurationModels() + { + return GetCachedClient(client => new EmailConfigurationModelCollection(client, Id)); + } + + /// + /// Gets the details of the alert configuration setting. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/alertSettings/{emailConfigurationName} + /// + /// + /// Operation Id + /// EmailConfigurationModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The email configuration name. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetEmailConfigurationModelAsync(string emailConfigurationName, CancellationToken cancellationToken = default) + { + return await GetEmailConfigurationModels().GetAsync(emailConfigurationName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets the details of the alert configuration setting. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/alertSettings/{emailConfigurationName} + /// + /// + /// Operation Id + /// EmailConfigurationModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The email configuration name. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetEmailConfigurationModel(string emailConfigurationName, CancellationToken cancellationToken = default) + { + return GetEmailConfigurationModels().Get(emailConfigurationName, cancellationToken); + } + + /// Gets a collection of EventModelResources in the VaultModel. + /// An object representing collection of EventModelResources and their operations over a EventModelResource. + public virtual EventModelCollection GetEventModels() + { + return GetCachedClient(client => new EventModelCollection(client, Id)); + } + + /// + /// Gets the details of the event. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/events/{eventName} + /// + /// + /// Operation Id + /// EventModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The event name. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetEventModelAsync(string eventName, CancellationToken cancellationToken = default) + { + return await GetEventModels().GetAsync(eventName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets the details of the event. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/events/{eventName} + /// + /// + /// Operation Id + /// EventModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The event name. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetEventModel(string eventName, CancellationToken cancellationToken = default) + { + return GetEventModels().Get(eventName, cancellationToken); + } + + /// Gets a collection of JobModelResources in the VaultModel. + /// An object representing collection of JobModelResources and their operations over a JobModelResource. + public virtual JobModelCollection GetJobModels() + { + return GetCachedClient(client => new JobModelCollection(client, Id)); + } + + /// + /// Gets the details of the job. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/jobs/{jobName} + /// + /// + /// Operation Id + /// JobModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The job name. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetJobModelAsync(string jobName, CancellationToken cancellationToken = default) + { + return await GetJobModels().GetAsync(jobName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets the details of the job. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/jobs/{jobName} + /// + /// + /// Operation Id + /// JobModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The job name. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetJobModel(string jobName, CancellationToken cancellationToken = default) + { + return GetJobModels().Get(jobName, cancellationToken); + } + + /// Gets a collection of PolicyModelResources in the VaultModel. + /// An object representing collection of PolicyModelResources and their operations over a PolicyModelResource. + public virtual PolicyModelCollection GetPolicyModels() + { + return GetCachedClient(client => new PolicyModelCollection(client, Id)); + } + + /// + /// Gets the details of the policy. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/replicationPolicies/{policyName} + /// + /// + /// Operation Id + /// PolicyModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The policy name. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetPolicyModelAsync(string policyName, CancellationToken cancellationToken = default) + { + return await GetPolicyModels().GetAsync(policyName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets the details of the policy. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/replicationPolicies/{policyName} + /// + /// + /// Operation Id + /// PolicyModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The policy name. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetPolicyModel(string policyName, CancellationToken cancellationToken = default) + { + return GetPolicyModels().Get(policyName, cancellationToken); + } + + /// Gets a collection of RecoveryServicesDataReplicationPrivateEndpointConnectionResources in the VaultModel. + /// An object representing collection of RecoveryServicesDataReplicationPrivateEndpointConnectionResources and their operations over a RecoveryServicesDataReplicationPrivateEndpointConnectionResource. + public virtual RecoveryServicesDataReplicationPrivateEndpointConnectionCollection GetRecoveryServicesDataReplicationPrivateEndpointConnections() + { + return GetCachedClient(client => new RecoveryServicesDataReplicationPrivateEndpointConnectionCollection(client, Id)); + } + + /// + /// Gets the private endpoint connection details. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/privateEndpointConnections/{privateEndpointConnectionName} + /// + /// + /// Operation Id + /// PrivateEndpointConnection_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The private endpoint connection name. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetRecoveryServicesDataReplicationPrivateEndpointConnectionAsync(string privateEndpointConnectionName, CancellationToken cancellationToken = default) + { + return await GetRecoveryServicesDataReplicationPrivateEndpointConnections().GetAsync(privateEndpointConnectionName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets the private endpoint connection details. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/privateEndpointConnections/{privateEndpointConnectionName} + /// + /// + /// Operation Id + /// PrivateEndpointConnection_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The private endpoint connection name. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetRecoveryServicesDataReplicationPrivateEndpointConnection(string privateEndpointConnectionName, CancellationToken cancellationToken = default) + { + return GetRecoveryServicesDataReplicationPrivateEndpointConnections().Get(privateEndpointConnectionName, cancellationToken); + } + + /// Gets a collection of PrivateEndpointConnectionProxyResources in the VaultModel. + /// An object representing collection of PrivateEndpointConnectionProxyResources and their operations over a PrivateEndpointConnectionProxyResource. + public virtual PrivateEndpointConnectionProxyCollection GetPrivateEndpointConnectionProxies() + { + return GetCachedClient(client => new PrivateEndpointConnectionProxyCollection(client, Id)); + } + + /// + /// Gets the private endpoint connection proxy details. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/privateEndpointConnectionProxies/{privateEndpointConnectionProxyName} + /// + /// + /// Operation Id + /// PrivateEndpointConnectionProxy_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The private endpoint connection proxy name. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetPrivateEndpointConnectionProxyAsync(string privateEndpointConnectionProxyName, CancellationToken cancellationToken = default) + { + return await GetPrivateEndpointConnectionProxies().GetAsync(privateEndpointConnectionProxyName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets the private endpoint connection proxy details. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/privateEndpointConnectionProxies/{privateEndpointConnectionProxyName} + /// + /// + /// Operation Id + /// PrivateEndpointConnectionProxy_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The private endpoint connection proxy name. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetPrivateEndpointConnectionProxy(string privateEndpointConnectionProxyName, CancellationToken cancellationToken = default) + { + return GetPrivateEndpointConnectionProxies().Get(privateEndpointConnectionProxyName, cancellationToken); + } + + /// Gets a collection of RecoveryServicesDataReplicationPrivateLinkResourceDataResources in the VaultModel. + /// An object representing collection of RecoveryServicesDataReplicationPrivateLinkResourceDataResources and their operations over a RecoveryServicesDataReplicationPrivateLinkResourceDataResource. + public virtual RecoveryServicesDataReplicationPrivateLinkResourceDataCollection GetAllRecoveryServicesDataReplicationPrivateLinkResourceData() + { + return GetCachedClient(client => new RecoveryServicesDataReplicationPrivateLinkResourceDataCollection(client, Id)); + } + + /// + /// Gets the details of site recovery private link resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/privateLinkResources/{privateLinkResourceName} + /// + /// + /// Operation Id + /// PrivateLinkResource_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The private link name. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetRecoveryServicesDataReplicationPrivateLinkResourceDataAsync(string privateLinkResourceName, CancellationToken cancellationToken = default) + { + return await GetAllRecoveryServicesDataReplicationPrivateLinkResourceData().GetAsync(privateLinkResourceName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets the details of site recovery private link resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/privateLinkResources/{privateLinkResourceName} + /// + /// + /// Operation Id + /// PrivateLinkResource_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The private link name. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetRecoveryServicesDataReplicationPrivateLinkResourceData(string privateLinkResourceName, CancellationToken cancellationToken = default) + { + return GetAllRecoveryServicesDataReplicationPrivateLinkResourceData().Get(privateLinkResourceName, cancellationToken); + } + + /// Gets a collection of ProtectedItemModelResources in the VaultModel. + /// An object representing collection of ProtectedItemModelResources and their operations over a ProtectedItemModelResource. + public virtual ProtectedItemModelCollection GetProtectedItemModels() + { + return GetCachedClient(client => new ProtectedItemModelCollection(client, Id)); + } + + /// + /// Gets the details of the protected item. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/protectedItems/{protectedItemName} + /// + /// + /// Operation Id + /// ProtectedItemModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The protected item name. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetProtectedItemModelAsync(string protectedItemName, CancellationToken cancellationToken = default) + { + return await GetProtectedItemModels().GetAsync(protectedItemName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets the details of the protected item. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/protectedItems/{protectedItemName} + /// + /// + /// Operation Id + /// ProtectedItemModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The protected item name. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetProtectedItemModel(string protectedItemName, CancellationToken cancellationToken = default) + { + return GetProtectedItemModels().Get(protectedItemName, cancellationToken); + } + + /// Gets a collection of ReplicationExtensionModelResources in the VaultModel. + /// An object representing collection of ReplicationExtensionModelResources and their operations over a ReplicationExtensionModelResource. + public virtual ReplicationExtensionModelCollection GetReplicationExtensionModels() + { + return GetCachedClient(client => new ReplicationExtensionModelCollection(client, Id)); + } + + /// + /// Gets the details of the replication extension. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/replicationExtensions/{replicationExtensionName} + /// + /// + /// Operation Id + /// ReplicationExtensionModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The replication extension name. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetReplicationExtensionModelAsync(string replicationExtensionName, CancellationToken cancellationToken = default) + { + return await GetReplicationExtensionModels().GetAsync(replicationExtensionName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets the details of the replication extension. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/replicationExtensions/{replicationExtensionName} + /// + /// + /// Operation Id + /// ReplicationExtensionModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The replication extension name. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetReplicationExtensionModel(string replicationExtensionName, CancellationToken cancellationToken = default) + { + return GetReplicationExtensionModels().Get(replicationExtensionName, cancellationToken); + } + + /// + /// Gets the details of the vault. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName} + /// + /// + /// Operation Id + /// VaultModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _vaultModelVaultClientDiagnostics.CreateScope("VaultModelResource.Get"); + scope.Start(); + try + { + var response = await _vaultModelVaultRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new VaultModelResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets the details of the vault. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName} + /// + /// + /// Operation Id + /// VaultModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _vaultModelVaultClientDiagnostics.CreateScope("VaultModelResource.Get"); + scope.Start(); + try + { + var response = _vaultModelVaultRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new VaultModelResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Removes the vault. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName} + /// + /// + /// Operation Id + /// VaultModel_Delete + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// 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 = _vaultModelVaultClientDiagnostics.CreateScope("VaultModelResource.Delete"); + scope.Start(); + try + { + var response = await _vaultModelVaultRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + var operation = new RecoveryServicesDataReplicationArmOperation(_vaultModelVaultClientDiagnostics, Pipeline, _vaultModelVaultRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Removes the vault. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName} + /// + /// + /// Operation Id + /// VaultModel_Delete + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// 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 = _vaultModelVaultClientDiagnostics.CreateScope("VaultModelResource.Delete"); + scope.Start(); + try + { + var response = _vaultModelVaultRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + var operation = new RecoveryServicesDataReplicationArmOperation(_vaultModelVaultClientDiagnostics, Pipeline, _vaultModelVaultRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletionResponse(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Performs update on the vault. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName} + /// + /// + /// Operation Id + /// VaultModel_Update + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// 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. + /// Vault properties. + /// The cancellation token to use. + /// is null. + public virtual async Task> UpdateAsync(WaitUntil waitUntil, VaultModelPatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(patch, nameof(patch)); + + using var scope = _vaultModelVaultClientDiagnostics.CreateScope("VaultModelResource.Update"); + scope.Start(); + try + { + var response = await _vaultModelVaultRestClient.UpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch, cancellationToken).ConfigureAwait(false); + var operation = new RecoveryServicesDataReplicationArmOperation(new VaultModelOperationSource(Client), _vaultModelVaultClientDiagnostics, Pipeline, _vaultModelVaultRestClient.CreateUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Performs update on the vault. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName} + /// + /// + /// Operation Id + /// VaultModel_Update + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// 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. + /// Vault properties. + /// The cancellation token to use. + /// is null. + public virtual ArmOperation Update(WaitUntil waitUntil, VaultModelPatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(patch, nameof(patch)); + + using var scope = _vaultModelVaultClientDiagnostics.CreateScope("VaultModelResource.Update"); + scope.Start(); + try + { + var response = _vaultModelVaultRestClient.Update(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch, cancellationToken); + var operation = new RecoveryServicesDataReplicationArmOperation(new VaultModelOperationSource(Client), _vaultModelVaultClientDiagnostics, Pipeline, _vaultModelVaultRestClient.CreateUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Add a tag to the current resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName} + /// + /// + /// Operation Id + /// VaultModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The key for the tag. + /// The value for the tag. + /// The cancellation token to use. + /// or is null. + public virtual async Task> AddTagAsync(string key, string value, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(key, nameof(key)); + Argument.AssertNotNull(value, nameof(value)); + + using var scope = _vaultModelVaultClientDiagnostics.CreateScope("VaultModelResource.AddTag"); + scope.Start(); + try + { + if (await CanUseTagResourceAsync(cancellationToken: cancellationToken).ConfigureAwait(false)) + { + var originalTags = await GetTagResource().GetAsync(cancellationToken).ConfigureAwait(false); + originalTags.Value.Data.TagValues[key] = value; + await GetTagResource().CreateOrUpdateAsync(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken).ConfigureAwait(false); + var originalResponse = await _vaultModelVaultRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new VaultModelResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; + var patch = new VaultModelPatch(); + foreach (var tag in current.Tags) + { + patch.Tags.Add(tag); + } + patch.Tags[key] = value; + var result = await UpdateAsync(WaitUntil.Completed, patch, cancellationToken: cancellationToken).ConfigureAwait(false); + return Response.FromValue(result.Value, result.GetRawResponse()); + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Add a tag to the current resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName} + /// + /// + /// Operation Id + /// VaultModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The key for the tag. + /// The value for the tag. + /// The cancellation token to use. + /// or is null. + public virtual Response AddTag(string key, string value, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(key, nameof(key)); + Argument.AssertNotNull(value, nameof(value)); + + using var scope = _vaultModelVaultClientDiagnostics.CreateScope("VaultModelResource.AddTag"); + scope.Start(); + try + { + if (CanUseTagResource(cancellationToken: cancellationToken)) + { + var originalTags = GetTagResource().Get(cancellationToken); + originalTags.Value.Data.TagValues[key] = value; + GetTagResource().CreateOrUpdate(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken); + var originalResponse = _vaultModelVaultRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + return Response.FromValue(new VaultModelResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = Get(cancellationToken: cancellationToken).Value.Data; + var patch = new VaultModelPatch(); + foreach (var tag in current.Tags) + { + patch.Tags.Add(tag); + } + patch.Tags[key] = value; + var result = Update(WaitUntil.Completed, patch, cancellationToken: cancellationToken); + return Response.FromValue(result.Value, result.GetRawResponse()); + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Replace the tags on the resource with the given set. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName} + /// + /// + /// Operation Id + /// VaultModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The set of tags to use as replacement. + /// The cancellation token to use. + /// is null. + public virtual async Task> SetTagsAsync(IDictionary tags, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(tags, nameof(tags)); + + using var scope = _vaultModelVaultClientDiagnostics.CreateScope("VaultModelResource.SetTags"); + scope.Start(); + try + { + if (await CanUseTagResourceAsync(cancellationToken: cancellationToken).ConfigureAwait(false)) + { + await GetTagResource().DeleteAsync(WaitUntil.Completed, cancellationToken: cancellationToken).ConfigureAwait(false); + var originalTags = await GetTagResource().GetAsync(cancellationToken).ConfigureAwait(false); + originalTags.Value.Data.TagValues.ReplaceWith(tags); + await GetTagResource().CreateOrUpdateAsync(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken).ConfigureAwait(false); + var originalResponse = await _vaultModelVaultRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new VaultModelResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; + var patch = new VaultModelPatch(); + patch.Tags.ReplaceWith(tags); + var result = await UpdateAsync(WaitUntil.Completed, patch, cancellationToken: cancellationToken).ConfigureAwait(false); + return Response.FromValue(result.Value, result.GetRawResponse()); + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Replace the tags on the resource with the given set. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName} + /// + /// + /// Operation Id + /// VaultModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The set of tags to use as replacement. + /// The cancellation token to use. + /// is null. + public virtual Response SetTags(IDictionary tags, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(tags, nameof(tags)); + + using var scope = _vaultModelVaultClientDiagnostics.CreateScope("VaultModelResource.SetTags"); + scope.Start(); + try + { + if (CanUseTagResource(cancellationToken: cancellationToken)) + { + GetTagResource().Delete(WaitUntil.Completed, cancellationToken: cancellationToken); + var originalTags = GetTagResource().Get(cancellationToken); + originalTags.Value.Data.TagValues.ReplaceWith(tags); + GetTagResource().CreateOrUpdate(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken); + var originalResponse = _vaultModelVaultRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + return Response.FromValue(new VaultModelResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = Get(cancellationToken: cancellationToken).Value.Data; + var patch = new VaultModelPatch(); + patch.Tags.ReplaceWith(tags); + var result = Update(WaitUntil.Completed, patch, cancellationToken: cancellationToken); + return Response.FromValue(result.Value, result.GetRawResponse()); + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Removes a tag by key from the resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName} + /// + /// + /// Operation Id + /// VaultModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The key for the tag. + /// The cancellation token to use. + /// is null. + public virtual async Task> RemoveTagAsync(string key, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(key, nameof(key)); + + using var scope = _vaultModelVaultClientDiagnostics.CreateScope("VaultModelResource.RemoveTag"); + scope.Start(); + try + { + if (await CanUseTagResourceAsync(cancellationToken: cancellationToken).ConfigureAwait(false)) + { + var originalTags = await GetTagResource().GetAsync(cancellationToken).ConfigureAwait(false); + originalTags.Value.Data.TagValues.Remove(key); + await GetTagResource().CreateOrUpdateAsync(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken).ConfigureAwait(false); + var originalResponse = await _vaultModelVaultRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new VaultModelResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; + var patch = new VaultModelPatch(); + foreach (var tag in current.Tags) + { + patch.Tags.Add(tag); + } + patch.Tags.Remove(key); + var result = await UpdateAsync(WaitUntil.Completed, patch, cancellationToken: cancellationToken).ConfigureAwait(false); + return Response.FromValue(result.Value, result.GetRawResponse()); + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Removes a tag by key from the resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName} + /// + /// + /// Operation Id + /// VaultModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The key for the tag. + /// The cancellation token to use. + /// is null. + public virtual Response RemoveTag(string key, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(key, nameof(key)); + + using var scope = _vaultModelVaultClientDiagnostics.CreateScope("VaultModelResource.RemoveTag"); + scope.Start(); + try + { + if (CanUseTagResource(cancellationToken: cancellationToken)) + { + var originalTags = GetTagResource().Get(cancellationToken); + originalTags.Value.Data.TagValues.Remove(key); + GetTagResource().CreateOrUpdate(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken); + var originalResponse = _vaultModelVaultRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + return Response.FromValue(new VaultModelResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = Get(cancellationToken: cancellationToken).Value.Data; + var patch = new VaultModelPatch(); + foreach (var tag in current.Tags) + { + patch.Tags.Add(tag); + } + patch.Tags.Remove(key); + var result = Update(WaitUntil.Completed, patch, cancellationToken: cancellationToken); + return Response.FromValue(result.Value, result.GetRawResponse()); + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Properties/AssemblyInfo.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Properties/AssemblyInfo.cs new file mode 100644 index 000000000000..f3484b477c5e --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Properties/AssemblyInfo.cs @@ -0,0 +1,11 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System.Runtime.CompilerServices; + +[assembly: InternalsVisibleTo("Azure.ResourceManager.RecoveryServicesDataReplication.Tests, PublicKey = 0024000004800000940000000602000000240000525341310004000001000100d15ddcb29688295338af4b7686603fe614abd555e09efba8fb88ee09e1f7b1ccaeed2e8f823fa9eef3fdd60217fc012ea67d2479751a0b8c087a4185541b851bd8b16f8d91b840e51b1cb0ba6fe647997e57429265e85ef62d565db50a69ae1647d54d7bd855e4db3d8a91510e5bcbd0edfbbecaa20a7bd9ae74593daa7b11b4")] + +// Replace Microsoft.Test with the correct resource provider namepace for your service and uncomment. +// See https://docs.microsoft.com/en-us/azure/azure-resource-manager/management/azure-services-resource-providers +// for the list of possible values. +[assembly: Azure.Core.AzureResourceProviderNamespace("RecoveryServicesDataReplication")] diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/tests/Azure.ResourceManager.RecoveryServicesDataReplication.Tests.csproj b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/tests/Azure.ResourceManager.RecoveryServicesDataReplication.Tests.csproj new file mode 100644 index 000000000000..28b8be380881 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/tests/Azure.ResourceManager.RecoveryServicesDataReplication.Tests.csproj @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/tests/RecoveryServicesDataReplicationManagementTestBase.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/tests/RecoveryServicesDataReplicationManagementTestBase.cs new file mode 100644 index 000000000000..c22207cd3bbc --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/tests/RecoveryServicesDataReplicationManagementTestBase.cs @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using Azure; +using Azure.Core; +using Azure.Core.TestFramework; +using Azure.ResourceManager; +using Azure.ResourceManager.Resources; +using Azure.ResourceManager.TestFramework; +using NUnit.Framework; +using System.Threading.Tasks; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Tests +{ + public class RecoveryServicesDataReplicationManagementTestBase : ManagementRecordedTestBase + { + protected ArmClient Client { get; private set; } + protected SubscriptionResource DefaultSubscription { get; private set; } + + protected RecoveryServicesDataReplicationManagementTestBase(bool isAsync, RecordedTestMode mode) + : base(isAsync, mode) + { + } + + protected RecoveryServicesDataReplicationManagementTestBase(bool isAsync) + : base(isAsync) + { + } + + [SetUp] + public async Task CreateCommonClient() + { + Client = GetArmClient(); + DefaultSubscription = await Client.GetDefaultSubscriptionAsync().ConfigureAwait(false); + } + + protected async Task CreateResourceGroup(SubscriptionResource subscription, string rgNamePrefix, AzureLocation location) + { + string rgName = Recording.GenerateAssetName(rgNamePrefix); + ResourceGroupData input = new ResourceGroupData(location); + var lro = await subscription.GetResourceGroups().CreateOrUpdateAsync(WaitUntil.Completed, rgName, input); + return lro.Value; + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/tests/RecoveryServicesDataReplicationManagementTestEnvironment.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/tests/RecoveryServicesDataReplicationManagementTestEnvironment.cs new file mode 100644 index 000000000000..f82e1be89d2f --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/tests/RecoveryServicesDataReplicationManagementTestEnvironment.cs @@ -0,0 +1,11 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using Azure.Core.TestFramework; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Tests +{ + public class RecoveryServicesDataReplicationManagementTestEnvironment : TestEnvironment + { + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/tsp-location.yaml b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/tsp-location.yaml new file mode 100644 index 000000000000..40d79247df68 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/tsp-location.yaml @@ -0,0 +1,4 @@ +directory: specification/recoveryservicesdatareplication/DataReplication.Management +commit: 676334a284e5136f0a0721d6ae844bb04332f579 +repo: Azure/azure-rest-api-specs +additionalDirectories: diff --git a/sdk/recoveryservicesdatareplication/ci.mgmt.yml b/sdk/recoveryservicesdatareplication/ci.mgmt.yml new file mode 100644 index 000000000000..cdff4215bc6b --- /dev/null +++ b/sdk/recoveryservicesdatareplication/ci.mgmt.yml @@ -0,0 +1,26 @@ +# NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. + +trigger: none + +pr: + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/recoveryservicesdatareplication /ci.mgmt.yml + - sdk/recoveryservicesdatareplication /Azure.ResourceManager.RecoveryServicesDataReplication / + + +extends: + template: /eng/pipelines/templates/stages/archetype-sdk-client.yml + parameters: + ServiceDirectory: recoveryservicesdatareplication + ArtifactName: packages + LimitForPullRequest: true + Artifacts: + - name: Azure.ResourceManager.RecoveryServicesDataReplication + safeName: AzureResourceManagerRecoveryServicesDataReplication diff --git a/sdk/resourcemanager/ci.mgmt.yml b/sdk/resourcemanager/ci.mgmt.yml index d8bf790b5988..ea319a5ddb07 100644 --- a/sdk/resourcemanager/ci.mgmt.yml +++ b/sdk/resourcemanager/ci.mgmt.yml @@ -12,6 +12,7 @@ trigger: - common/ManagementTestShared - common/ManagementCoreShared - sdk/advisor/Azure.ResourceManager.Advisor + - sdk/agricultureplatform/Azure.ResourceManager.AgriculturePlatform - sdk/agrifood/Azure.ResourceManager.AgFoodPlatform - sdk/alertsmanagement/Azure.ResourceManager.AlertsManagement - sdk/analysisservices/Azure.ResourceManager.Analysis @@ -56,6 +57,8 @@ trigger: - sdk/cosmosdbforpostgresql/Azure.ResourceManager.CosmosDBForPostgreSql - sdk/costmanagement/Azure.ResourceManager.CostManagement - sdk/customer-insights/Azure.ResourceManager.CustomerInsights + - sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager + - sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher - sdk/databox/Azure.ResourceManager.DataBox - sdk/databoxedge/Azure.ResourceManager.DataBoxEdge - sdk/datadog/Azure.ResourceManager.Datadog @@ -79,7 +82,7 @@ trigger: - sdk/dnsresolver/Azure.ResourceManager.DnsResolver - sdk/dynatrace/Azure.ResourceManager.Dynatrace - sdk/edgeorder/Azure.ResourceManager.EdgeOrder - - sdk/iotoperations/Azure.ResourceManager.IotOperations + - sdk/edgeworkloadsecurity/Azure.ResourceManager.SecretsStoreExtension - sdk/edgezones/Azure.ResourceManager.EdgeZones - sdk/elastic/Azure.ResourceManager.Elastic - sdk/elasticsan/Azure.ResourceManager.ElasticSan @@ -104,10 +107,12 @@ trigger: - sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity - sdk/hybridkubernetes/Azure.ResourceManager.Kubernetes - sdk/hybridnetwork/Azure.ResourceManager.HybridNetwork + - sdk/impactreporting/Azure.ResourceManager.ImpactReporting - sdk/informaticadatamanagement/Azure.ResourceManager.InformaticaDataManagement - sdk/iot/Azure.ResourceManager.IotFirmwareDefense - sdk/iotcentral/Azure.ResourceManager.IotCentral - sdk/iothub/Azure.ResourceManager.IotHub + - sdk/iotoperations/Azure.ResourceManager.IotOperations - sdk/keyvault/Azure.ResourceManager.KeyVault - sdk/kubernetesconfiguration/Azure.ResourceManager.KubernetesConfiguration - sdk/kusto/Azure.ResourceManager.Kusto @@ -161,6 +166,7 @@ trigger: - sdk/recoveryservices-backup/Azure.ResourceManager.RecoveryServicesBackup - sdk/recoveryservices-datareplication/Azure.ResourceManager.RecoveryServicesDataReplication - sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery + - sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication - sdk/redis/Azure.ResourceManager.Redis - sdk/redisenterprise/Azure.ResourceManager.RedisEnterprise - sdk/relay/Azure.ResourceManager.Relay @@ -204,6 +210,7 @@ trigger: - sdk/websites/Azure.ResourceManager.AppService - sdk/workloadmonitor/Azure.ResourceManager.WorkloadMonitor - sdk/workloads/Azure.ResourceManager.Workloads + - sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances pr: branches: @@ -218,6 +225,7 @@ pr: - common/ManagementTestShared - common/ManagementCoreShared - sdk/advisor/Azure.ResourceManager.Advisor + - sdk/agricultureplatform/Azure.ResourceManager.AgriculturePlatform - sdk/agrifood/Azure.ResourceManager.AgFoodPlatform - sdk/alertsmanagement/Azure.ResourceManager.AlertsManagement - sdk/analysisservices/Azure.ResourceManager.Analysis @@ -262,6 +270,8 @@ pr: - sdk/cosmosdbforpostgresql/Azure.ResourceManager.CosmosDBForPostgreSql - sdk/costmanagement/Azure.ResourceManager.CostManagement - sdk/customer-insights/Azure.ResourceManager.CustomerInsights + - sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager + - sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher - sdk/databox/Azure.ResourceManager.DataBox - sdk/databoxedge/Azure.ResourceManager.DataBoxEdge - sdk/datadog/Azure.ResourceManager.Datadog @@ -285,7 +295,7 @@ pr: - sdk/dnsresolver/Azure.ResourceManager.DnsResolver - sdk/dynatrace/Azure.ResourceManager.Dynatrace - sdk/edgeorder/Azure.ResourceManager.EdgeOrder - - sdk/iotoperations/Azure.ResourceManager.IotOperations + - sdk/edgeworkloadsecurity/Azure.ResourceManager.SecretsStoreExtension - sdk/edgezones/Azure.ResourceManager.EdgeZones - sdk/elastic/Azure.ResourceManager.Elastic - sdk/elasticsan/Azure.ResourceManager.ElasticSan @@ -310,10 +320,12 @@ pr: - sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity - sdk/hybridkubernetes/Azure.ResourceManager.Kubernetes - sdk/hybridnetwork/Azure.ResourceManager.HybridNetwork + - sdk/impactreporting/Azure.ResourceManager.ImpactReporting - sdk/informaticadatamanagement/Azure.ResourceManager.InformaticaDataManagement - sdk/iot/Azure.ResourceManager.IotFirmwareDefense - sdk/iotcentral/Azure.ResourceManager.IotCentral - sdk/iothub/Azure.ResourceManager.IotHub + - sdk/iotoperations/Azure.ResourceManager.IotOperations - sdk/keyvault/Azure.ResourceManager.KeyVault - sdk/kubernetesconfiguration/Azure.ResourceManager.KubernetesConfiguration - sdk/kusto/Azure.ResourceManager.Kusto @@ -367,6 +379,7 @@ pr: - sdk/recoveryservices-backup/Azure.ResourceManager.RecoveryServicesBackup - sdk/recoveryservices-datareplication/Azure.ResourceManager.RecoveryServicesDataReplication - sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery + - sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication - sdk/redis/Azure.ResourceManager.Redis - sdk/redisenterprise/Azure.ResourceManager.RedisEnterprise - sdk/relay/Azure.ResourceManager.Relay @@ -410,6 +423,7 @@ pr: - sdk/websites/Azure.ResourceManager.AppService - sdk/workloadmonitor/Azure.ResourceManager.WorkloadMonitor - sdk/workloads/Azure.ResourceManager.Workloads + - sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml diff --git a/sdk/standbypool/Azure.ResourceManager.StandbyPool/Configuration.json b/sdk/standbypool/Azure.ResourceManager.StandbyPool/Configuration.json new file mode 100644 index 000000000000..0a2d1af62ece --- /dev/null +++ b/sdk/standbypool/Azure.ResourceManager.StandbyPool/Configuration.json @@ -0,0 +1,12 @@ +{ + "output-folder": ".", + "namespace": "Azure.ResourceManager.StandbyPool", + "library-name": "Azure.ResourceManager.StandbyPool", + "flavor": "azure", + "use-model-reader-writer": true, + "shared-source-folders": [ + "../../TempTypeSpecFiles/node_modules/@autorest/csharp/Generator.Shared", + "../../TempTypeSpecFiles/node_modules/@autorest/csharp/Azure.Core.Shared" + ], + "azure-arm": true +} diff --git a/sdk/standbypool/Azure.ResourceManager.StandbyPool/tsp-location.yaml b/sdk/standbypool/Azure.ResourceManager.StandbyPool/tsp-location.yaml index cb68b5fb577a..20326bf231e3 100644 --- a/sdk/standbypool/Azure.ResourceManager.StandbyPool/tsp-location.yaml +++ b/sdk/standbypool/Azure.ResourceManager.StandbyPool/tsp-location.yaml @@ -1,3 +1,4 @@ -directory: specification\standbypool\StandbyPool.Management -commit: 3519c80fe510a268f6e59a29ccac8a53fdec15b6 -repo: Azure/azure-rest-api-specs \ No newline at end of file +directory: specification/standbypool/StandbyPool.Management +commit: 676334a284e5136f0a0721d6ae844bb04332f579 +repo: Azure/azure-rest-api-specs +additionalDirectories: diff --git a/sdk/standbypool/Azure.ResourceManager.StandbyPool/tspCodeModel.json b/sdk/standbypool/Azure.ResourceManager.StandbyPool/tspCodeModel.json new file mode 100644 index 000000000000..e4fd57d479e7 --- /dev/null +++ b/sdk/standbypool/Azure.ResourceManager.StandbyPool/tspCodeModel.json @@ -0,0 +1,13661 @@ +{ + "$id": "1", + "Name": "Microsoft.StandbyPool", + "ApiVersions": [ + "2024-03-01" + ], + "Enums": [ + { + "$id": "2", + "kind": "enum", + "name": "StandbyProvisioningState", + "crossLanguageDefinitionId": "Microsoft.StandbyPool.ProvisioningState", + "valueType": { + "$id": "3", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "4", + "kind": "enumvalue", + "name": "Succeeded", + "value": "Succeeded", + "valueType": { + "$id": "5", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "2" + }, + "doc": "Resource has been created.", + "decorators": [] + }, + { + "$id": "6", + "kind": "enumvalue", + "name": "Failed", + "value": "Failed", + "valueType": { + "$id": "7", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "2" + }, + "doc": "Resource creation failed.", + "decorators": [] + }, + { + "$id": "8", + "kind": "enumvalue", + "name": "Canceled", + "value": "Canceled", + "valueType": { + "$id": "9", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "2" + }, + "doc": "Resource creation was canceled.", + "decorators": [] + }, + { + "$id": "10", + "kind": "enumvalue", + "name": "Deleting", + "value": "Deleting", + "valueType": { + "$id": "11", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "2" + }, + "doc": "Resource is being deleted.", + "decorators": [] + } + ], + "clientNamespace": "Microsoft.StandbyPool", + "doc": "Provisioning state", + "isFixed": false, + "isFlags": false, + "usage": "Output,Json,LroInitial,LroPolling,LroFinalEnvelope", + "decorators": [] + }, + { + "$id": "12", + "kind": "enum", + "name": "createdByType", + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.createdByType", + "valueType": { + "$id": "13", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "14", + "kind": "enumvalue", + "name": "User", + "value": "User", + "valueType": { + "$id": "15", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "12" + }, + "doc": "The entity was created by a user.", + "decorators": [] + }, + { + "$id": "16", + "kind": "enumvalue", + "name": "Application", + "value": "Application", + "valueType": { + "$id": "17", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "12" + }, + "doc": "The entity was created by an application.", + "decorators": [] + }, + { + "$id": "18", + "kind": "enumvalue", + "name": "ManagedIdentity", + "value": "ManagedIdentity", + "valueType": { + "$id": "19", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "12" + }, + "doc": "The entity was created by a managed identity.", + "decorators": [] + }, + { + "$id": "20", + "kind": "enumvalue", + "name": "Key", + "value": "Key", + "valueType": { + "$id": "21", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "12" + }, + "doc": "The entity was created by a key.", + "decorators": [] + } + ], + "clientNamespace": "Azure.ResourceManager.CommonTypes", + "doc": "The kind of entity that created the resource.", + "isFixed": false, + "isFlags": false, + "usage": "Output,Json,LroInitial,LroPolling,LroFinalEnvelope", + "decorators": [] + }, + { + "$id": "22", + "kind": "enum", + "name": "StandbyRefillPolicy", + "crossLanguageDefinitionId": "Microsoft.StandbyPool.RefillPolicy", + "valueType": { + "$id": "23", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "24", + "kind": "enumvalue", + "name": "always", + "value": "always", + "valueType": { + "$id": "25", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "22" + }, + "doc": "A refill policy that standby pool is automatically refilled to maintain maxReadyCapacity.", + "decorators": [] + } + ], + "clientNamespace": "Microsoft.StandbyPool", + "doc": "Refill policy of standby pool", + "isFixed": false, + "isFlags": false, + "usage": "Input,Output,Json,LroInitial,LroPolling,LroFinalEnvelope", + "decorators": [] + }, + { + "$id": "26", + "kind": "enum", + "name": "ResourceProvisioningState", + "crossLanguageDefinitionId": "Azure.ResourceManager.ResourceProvisioningState", + "valueType": { + "$id": "27", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "28", + "kind": "enumvalue", + "name": "Succeeded", + "value": "Succeeded", + "valueType": { + "$id": "29", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "26" + }, + "doc": "Resource has been created.", + "decorators": [] + }, + { + "$id": "30", + "kind": "enumvalue", + "name": "Failed", + "value": "Failed", + "valueType": { + "$id": "31", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "26" + }, + "doc": "Resource creation failed.", + "decorators": [] + }, + { + "$id": "32", + "kind": "enumvalue", + "name": "Canceled", + "value": "Canceled", + "valueType": { + "$id": "33", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "26" + }, + "doc": "Resource creation was canceled.", + "decorators": [] + } + ], + "clientNamespace": "Azure.ResourceManager", + "doc": "The provisioning state of a resource type.", + "isFixed": false, + "isFlags": false, + "usage": "LroPolling", + "decorators": [] + }, + { + "$id": "34", + "kind": "enum", + "name": "StandbyVirtualMachineState", + "crossLanguageDefinitionId": "Microsoft.StandbyPool.VirtualMachineState", + "valueType": { + "$id": "35", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "36", + "kind": "enumvalue", + "name": "Running", + "value": "Running", + "valueType": { + "$id": "37", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "34" + }, + "doc": "The virtual machine is up and running.", + "decorators": [] + }, + { + "$id": "38", + "kind": "enumvalue", + "name": "Deallocated", + "value": "Deallocated", + "valueType": { + "$id": "39", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "34" + }, + "doc": "The virtual machine has released the lease on the underlying hardware and is powered off.", + "decorators": [] + } + ], + "clientNamespace": "Microsoft.StandbyPool", + "doc": "State of standby virtual machines", + "isFixed": false, + "isFlags": false, + "usage": "Input,Output,Json,LroInitial,LroPolling,LroFinalEnvelope", + "decorators": [] + }, + { + "$id": "40", + "kind": "enum", + "name": "Origin", + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.Origin", + "valueType": { + "$id": "41", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "42", + "kind": "enumvalue", + "name": "user", + "value": "user", + "valueType": { + "$id": "43", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "40" + }, + "doc": "Indicates the operation is initiated by a user.", + "decorators": [] + }, + { + "$id": "44", + "kind": "enumvalue", + "name": "system", + "value": "system", + "valueType": { + "$id": "45", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "40" + }, + "doc": "Indicates the operation is initiated by a system.", + "decorators": [] + }, + { + "$id": "46", + "kind": "enumvalue", + "name": "user,system", + "value": "user,system", + "valueType": { + "$id": "47", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "40" + }, + "doc": "Indicates the operation is initiated by a user or system.", + "decorators": [] + } + ], + "clientNamespace": "Azure.ResourceManager.CommonTypes", + "doc": "The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default value is \"user,system\"", + "isFixed": false, + "isFlags": false, + "usage": "Output,Json", + "decorators": [] + }, + { + "$id": "48", + "kind": "enum", + "name": "ActionType", + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.ActionType", + "valueType": { + "$id": "49", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "50", + "kind": "enumvalue", + "name": "Internal", + "value": "Internal", + "valueType": { + "$id": "51", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "48" + }, + "doc": "Actions are for internal-only APIs.", + "decorators": [] + } + ], + "clientNamespace": "Azure.ResourceManager.CommonTypes", + "doc": "Extensible enum. Indicates the action type. \"Internal\" refers to actions that are for internal only APIs.", + "isFixed": false, + "isFlags": false, + "usage": "Output,Json", + "decorators": [] + }, + { + "$id": "52", + "kind": "enum", + "name": "Versions", + "crossLanguageDefinitionId": "Microsoft.StandbyPool.Versions", + "valueType": { + "$id": "53", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "54", + "kind": "enumvalue", + "name": "2024-03-01", + "value": "2024-03-01", + "valueType": { + "$id": "55", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "52" + }, + "doc": "API Version 2024-03-01.", + "decorators": [] + } + ], + "clientNamespace": "Microsoft.StandbyPool", + "doc": "Supported API Versions for Microsoft.StandbyPool", + "isFixed": true, + "isFlags": false, + "usage": "ApiVersionEnum", + "decorators": [] + } + ], + "Models": [ + { + "$id": "56", + "kind": "model", + "name": "StandbyContainerGroupPoolRuntimeView", + "clientNamespace": "Microsoft.StandbyPool", + "crossLanguageDefinitionId": "Microsoft.StandbyPool.StandbyContainerGroupPoolRuntimeViewResource", + "usage": "Output,Json", + "doc": "Contains information about a standby container group pool as last known by the StandbyPool resource provider.", + "decorators": [], + "baseModel": { + "$id": "57", + "kind": "model", + "name": "ProxyResource", + "clientNamespace": "Azure.ResourceManager.CommonTypes", + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.ProxyResource", + "usage": "Output,Json", + "doc": "The resource model definition for a Azure Resource Manager proxy resource. It will not have tags and a location", + "decorators": [], + "baseModel": { + "$id": "58", + "kind": "model", + "name": "Resource", + "clientNamespace": "Azure.ResourceManager.CommonTypes", + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.Resource", + "usage": "Input,Output,Json,LroInitial,LroPolling,LroFinalEnvelope", + "doc": "Common fields that are returned in the response for all Azure Resource Manager resources", + "decorators": [], + "properties": [ + { + "$id": "59", + "kind": "property", + "name": "id", + "serializedName": "id", + "doc": "Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}", + "type": { + "$id": "60", + "kind": "string", + "name": "armResourceIdentifier", + "crossLanguageDefinitionId": "Azure.Core.armResourceIdentifier", + "baseType": { + "$id": "61", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.Resource.id", + "serializationOptions": { + "$id": "62", + "json": { + "$id": "63", + "name": "id" + } + } + }, + { + "$id": "64", + "kind": "property", + "name": "name", + "serializedName": "name", + "doc": "The name of the resource", + "type": { + "$id": "65", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.Resource.name", + "serializationOptions": { + "$id": "66", + "json": { + "$id": "67", + "name": "name" + } + } + }, + { + "$id": "68", + "kind": "property", + "name": "type", + "serializedName": "type", + "doc": "The type of the resource. E.g. \"Microsoft.Compute/virtualMachines\" or \"Microsoft.Storage/storageAccounts\"", + "type": { + "$id": "69", + "kind": "string", + "name": "armResourceType", + "crossLanguageDefinitionId": "Azure.Core.armResourceType", + "baseType": { + "$id": "70", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.Resource.type", + "serializationOptions": { + "$id": "71", + "json": { + "$id": "72", + "name": "type" + } + } + }, + { + "$id": "73", + "kind": "property", + "name": "systemData", + "serializedName": "systemData", + "doc": "Azure Resource Manager metadata containing createdBy and modifiedBy information.", + "type": { + "$id": "74", + "kind": "model", + "name": "SystemData", + "clientNamespace": "Azure.ResourceManager.CommonTypes", + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.SystemData", + "usage": "Output,Json,LroInitial,LroPolling,LroFinalEnvelope", + "doc": "Metadata pertaining to creation and last modification of the resource.", + "decorators": [], + "properties": [ + { + "$id": "75", + "kind": "property", + "name": "createdBy", + "serializedName": "createdBy", + "doc": "The identity that created the resource.", + "type": { + "$id": "76", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.SystemData.createdBy", + "serializationOptions": { + "$id": "77", + "json": { + "$id": "78", + "name": "createdBy" + } + } + }, + { + "$id": "79", + "kind": "property", + "name": "createdByType", + "serializedName": "createdByType", + "doc": "The type of identity that created the resource.", + "type": { + "$ref": "12" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.SystemData.createdByType", + "serializationOptions": { + "$id": "80", + "json": { + "$id": "81", + "name": "createdByType" + } + } + }, + { + "$id": "82", + "kind": "property", + "name": "createdAt", + "serializedName": "createdAt", + "doc": "The timestamp of resource creation (UTC).", + "type": { + "$id": "83", + "kind": "utcDateTime", + "name": "utcDateTime", + "encode": "rfc3339", + "wireType": { + "$id": "84", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.utcDateTime", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.SystemData.createdAt", + "serializationOptions": { + "$id": "85", + "json": { + "$id": "86", + "name": "createdAt" + } + } + }, + { + "$id": "87", + "kind": "property", + "name": "lastModifiedBy", + "serializedName": "lastModifiedBy", + "doc": "The identity that last modified the resource.", + "type": { + "$id": "88", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.SystemData.lastModifiedBy", + "serializationOptions": { + "$id": "89", + "json": { + "$id": "90", + "name": "lastModifiedBy" + } + } + }, + { + "$id": "91", + "kind": "property", + "name": "lastModifiedByType", + "serializedName": "lastModifiedByType", + "doc": "The type of identity that last modified the resource.", + "type": { + "$ref": "12" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.SystemData.lastModifiedByType", + "serializationOptions": { + "$id": "92", + "json": { + "$id": "93", + "name": "lastModifiedByType" + } + } + }, + { + "$id": "94", + "kind": "property", + "name": "lastModifiedAt", + "serializedName": "lastModifiedAt", + "doc": "The timestamp of resource last modification (UTC)", + "type": { + "$id": "95", + "kind": "utcDateTime", + "name": "utcDateTime", + "encode": "rfc3339", + "wireType": { + "$id": "96", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.utcDateTime", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.SystemData.lastModifiedAt", + "serializationOptions": { + "$id": "97", + "json": { + "$id": "98", + "name": "lastModifiedAt" + } + } + } + ] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.Resource.systemData", + "serializationOptions": { + "$id": "99", + "json": { + "$id": "100", + "name": "systemData" + } + } + } + ] + }, + "properties": [] + }, + "properties": [ + { + "$id": "101", + "kind": "property", + "name": "properties", + "serializedName": "properties", + "doc": "The resource-specific properties for this resource.", + "type": { + "$id": "102", + "kind": "model", + "name": "StandbyContainerGroupPoolRuntimeViewProperties", + "clientNamespace": "Microsoft.StandbyPool", + "crossLanguageDefinitionId": "Microsoft.StandbyPool.StandbyContainerGroupPoolRuntimeViewResourceProperties", + "usage": "Output,Json", + "doc": "Contains information about a standby pool as last known by the StandbyPool resource provider.", + "decorators": [], + "properties": [ + { + "$id": "103", + "kind": "property", + "name": "instanceCountSummary", + "serializedName": "instanceCountSummary", + "doc": "A list containing the counts of container groups in each possible state, as known by the StandbyPool resource provider.", + "type": { + "$id": "104", + "kind": "array", + "name": "ArrayContainerGroupInstanceCountSummary", + "valueType": { + "$id": "105", + "kind": "model", + "name": "ContainerGroupInstanceCountSummary", + "clientNamespace": "Microsoft.StandbyPool", + "crossLanguageDefinitionId": "Microsoft.StandbyPool.ContainerGroupInstanceCountSummary", + "usage": "Output,Json", + "doc": "Displays the counts of container groups in each state, as known by the StandbyPool resource provider.", + "decorators": [], + "properties": [ + { + "$id": "106", + "kind": "property", + "name": "instanceCountsByState", + "serializedName": "instanceCountsByState", + "doc": "The count of pooled resources in each state.", + "type": { + "$id": "107", + "kind": "array", + "name": "ArrayPoolResourceStateCount", + "valueType": { + "$id": "108", + "kind": "model", + "name": "PoolResourceStateCount", + "clientNamespace": "Microsoft.StandbyPool", + "crossLanguageDefinitionId": "Microsoft.StandbyPool.PoolResourceStateCount", + "usage": "Output,Json", + "doc": "Displays the counts of pooled resources in each state, as known by the StandbyPool resource provider.", + "decorators": [], + "properties": [ + { + "$id": "109", + "kind": "property", + "name": "state", + "serializedName": "state", + "doc": "The state that the pooled resources count is for.", + "type": { + "$id": "110", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.StandbyPool.PoolResourceStateCount.state", + "serializationOptions": { + "$id": "111", + "json": { + "$id": "112", + "name": "state" + } + } + }, + { + "$id": "113", + "kind": "property", + "name": "count", + "serializedName": "count", + "doc": "The count of pooled resources in the given state.", + "type": { + "$id": "114", + "kind": "int64", + "name": "int64", + "crossLanguageDefinitionId": "TypeSpec.int64", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.StandbyPool.PoolResourceStateCount.count", + "serializationOptions": { + "$id": "115", + "json": { + "$id": "116", + "name": "count" + } + } + } + ] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.StandbyPool.ContainerGroupInstanceCountSummary.instanceCountsByState", + "serializationOptions": { + "$id": "117", + "json": { + "$id": "118", + "name": "instanceCountsByState" + } + } + } + ] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": false, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.StandbyPool.StandbyContainerGroupPoolRuntimeViewResourceProperties.instanceCountSummary", + "serializationOptions": { + "$id": "119", + "json": { + "$id": "120", + "name": "instanceCountSummary" + } + } + }, + { + "$id": "121", + "kind": "property", + "name": "provisioningState", + "serializedName": "provisioningState", + "doc": "Displays the provisioning state of the standby pool", + "type": { + "$ref": "2" + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.StandbyPool.StandbyContainerGroupPoolRuntimeViewResourceProperties.provisioningState", + "serializationOptions": { + "$id": "122", + "json": { + "$id": "123", + "name": "provisioningState" + } + } + } + ] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.StandbyPool.StandbyContainerGroupPoolRuntimeViewResource.properties", + "serializationOptions": { + "$id": "124", + "json": { + "$id": "125", + "name": "properties" + } + } + } + ] + }, + { + "$ref": "102" + }, + { + "$ref": "105" + }, + { + "$ref": "108" + }, + { + "$ref": "57" + }, + { + "$ref": "58" + }, + { + "$ref": "74" + }, + { + "$id": "126", + "kind": "model", + "name": "ErrorResponse", + "clientNamespace": "Azure.ResourceManager.CommonTypes", + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.ErrorResponse", + "usage": "Error,Json,Exception", + "doc": "Common error response for all Azure Resource Manager APIs to return error details for failed operations.", + "decorators": [], + "properties": [ + { + "$id": "127", + "kind": "property", + "name": "error", + "serializedName": "error", + "doc": "The error object.", + "type": { + "$id": "128", + "kind": "model", + "name": "ErrorDetail", + "clientNamespace": "Azure.ResourceManager.CommonTypes", + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.ErrorDetail", + "usage": "Json,Exception,LroPolling", + "doc": "The error detail.", + "decorators": [], + "properties": [ + { + "$id": "129", + "kind": "property", + "name": "code", + "serializedName": "code", + "doc": "The error code.", + "type": { + "$id": "130", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.ErrorDetail.code", + "serializationOptions": { + "$id": "131", + "json": { + "$id": "132", + "name": "code" + } + } + }, + { + "$id": "133", + "kind": "property", + "name": "message", + "serializedName": "message", + "doc": "The error message.", + "type": { + "$id": "134", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.ErrorDetail.message", + "serializationOptions": { + "$id": "135", + "json": { + "$id": "136", + "name": "message" + } + } + }, + { + "$id": "137", + "kind": "property", + "name": "target", + "serializedName": "target", + "doc": "The error target.", + "type": { + "$id": "138", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.ErrorDetail.target", + "serializationOptions": { + "$id": "139", + "json": { + "$id": "140", + "name": "target" + } + } + }, + { + "$id": "141", + "kind": "property", + "name": "details", + "serializedName": "details", + "doc": "The error details.", + "type": { + "$id": "142", + "kind": "array", + "name": "ArrayErrorDetail", + "valueType": { + "$ref": "128" + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.ErrorDetail.details", + "serializationOptions": { + "$id": "143", + "json": { + "$id": "144", + "name": "details" + } + } + }, + { + "$id": "145", + "kind": "property", + "name": "additionalInfo", + "serializedName": "additionalInfo", + "doc": "The error additional info.", + "type": { + "$id": "146", + "kind": "array", + "name": "ArrayErrorAdditionalInfo", + "valueType": { + "$id": "147", + "kind": "model", + "name": "ErrorAdditionalInfo", + "clientNamespace": "Azure.ResourceManager.CommonTypes", + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.ErrorAdditionalInfo", + "usage": "Json,Exception,LroPolling", + "doc": "The resource management error additional info.", + "decorators": [], + "properties": [ + { + "$id": "148", + "kind": "property", + "name": "type", + "serializedName": "type", + "doc": "The additional info type.", + "type": { + "$id": "149", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.ErrorAdditionalInfo.type", + "serializationOptions": { + "$id": "150", + "json": { + "$id": "151", + "name": "type" + } + } + }, + { + "$id": "152", + "kind": "property", + "name": "info", + "serializedName": "info", + "doc": "The additional info.", + "type": { + "$id": "153", + "kind": "model", + "name": "ErrorAdditionalInfoInfo", + "clientNamespace": "Azure.ResourceManager.CommonTypes", + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.ErrorAdditionalInfo.info.anonymous", + "usage": "Json,Exception,LroPolling", + "decorators": [], + "properties": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.ErrorAdditionalInfo.info", + "serializationOptions": { + "$id": "154", + "json": { + "$id": "155", + "name": "info" + } + } + } + ] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.ErrorDetail.additionalInfo", + "serializationOptions": { + "$id": "156", + "json": { + "$id": "157", + "name": "additionalInfo" + } + } + } + ] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.ErrorResponse.error", + "serializationOptions": { + "$id": "158", + "json": { + "$id": "159", + "name": "error" + } + } + } + ] + }, + { + "$ref": "128" + }, + { + "$ref": "147" + }, + { + "$ref": "153" + }, + { + "$id": "160", + "kind": "model", + "name": "StandbyContainerGroupPoolRuntimeViewResourceListResult", + "clientNamespace": "Azure.ResourceManager", + "crossLanguageDefinitionId": "Azure.ResourceManager.ResourceListResult", + "usage": "Output,Json", + "doc": "The response of a StandbyContainerGroupPoolRuntimeViewResource list operation.", + "decorators": [], + "properties": [ + { + "$id": "161", + "kind": "property", + "name": "value", + "serializedName": "value", + "doc": "The StandbyContainerGroupPoolRuntimeViewResource items on this page", + "type": { + "$id": "162", + "kind": "array", + "name": "ArrayStandbyContainerGroupPoolRuntimeViewResource", + "valueType": { + "$ref": "56" + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.ResourceListResult.value", + "serializationOptions": { + "$id": "163", + "json": { + "$id": "164", + "name": "value" + } + } + }, + { + "$id": "165", + "kind": "property", + "name": "nextLink", + "serializedName": "nextLink", + "doc": "The link to the next page of items", + "type": { + "$id": "166", + "kind": "url", + "name": "ResourceLocation", + "crossLanguageDefinitionId": "TypeSpec.Rest.ResourceLocation", + "baseType": { + "$id": "167", + "kind": "url", + "name": "url", + "crossLanguageDefinitionId": "TypeSpec.url", + "decorators": [] + }, + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.ResourceListResult.nextLink", + "serializationOptions": { + "$id": "168", + "json": { + "$id": "169", + "name": "nextLink" + } + } + } + ] + }, + { + "$id": "170", + "kind": "model", + "name": "StandbyContainerGroupPool", + "clientNamespace": "Microsoft.StandbyPool", + "crossLanguageDefinitionId": "Microsoft.StandbyPool.StandbyContainerGroupPoolResource", + "usage": "Input,Output,Json,LroInitial,LroPolling,LroFinalEnvelope", + "doc": "A StandbyContainerGroupPoolResource.", + "decorators": [], + "baseModel": { + "$id": "171", + "kind": "model", + "name": "TrackedResource", + "clientNamespace": "Azure.ResourceManager.CommonTypes", + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.TrackedResource", + "usage": "Input,Output,Json,LroInitial,LroPolling,LroFinalEnvelope", + "doc": "The resource model definition for an Azure Resource Manager tracked top level resource which has 'tags' and a 'location'", + "decorators": [], + "baseModel": { + "$ref": "58" + }, + "properties": [ + { + "$id": "172", + "kind": "property", + "name": "tags", + "serializedName": "tags", + "doc": "Resource tags.", + "type": { + "$id": "173", + "kind": "dict", + "keyType": { + "$id": "174", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "valueType": { + "$id": "175", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.TrackedResource.tags", + "serializationOptions": { + "$id": "176", + "json": { + "$id": "177", + "name": "tags" + } + } + }, + { + "$id": "178", + "kind": "property", + "name": "location", + "serializedName": "location", + "doc": "The geo-location where the resource lives", + "type": { + "$id": "179", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.TrackedResource.location", + "serializationOptions": { + "$id": "180", + "json": { + "$id": "181", + "name": "location" + } + } + } + ] + }, + "properties": [ + { + "$id": "182", + "kind": "property", + "name": "properties", + "serializedName": "properties", + "doc": "The resource-specific properties for this resource.", + "type": { + "$id": "183", + "kind": "model", + "name": "StandbyContainerGroupPoolProperties", + "clientNamespace": "Microsoft.StandbyPool", + "crossLanguageDefinitionId": "Microsoft.StandbyPool.StandbyContainerGroupPoolResourceProperties", + "usage": "Input,Output,Json,LroInitial,LroPolling,LroFinalEnvelope", + "doc": "Details of the StandbyContainerGroupPool.", + "decorators": [], + "properties": [ + { + "$id": "184", + "kind": "property", + "name": "elasticityProfile", + "serializedName": "elasticityProfile", + "doc": "Specifies elasticity profile of standby container group pools.", + "type": { + "$id": "185", + "kind": "model", + "name": "StandbyContainerGroupPoolElasticityProfile", + "clientNamespace": "Microsoft.StandbyPool", + "crossLanguageDefinitionId": "Microsoft.StandbyPool.StandbyContainerGroupPoolElasticityProfile", + "usage": "Input,Output,Json,LroInitial,LroPolling,LroFinalEnvelope", + "doc": "Specifies the elasticity profile of the standby container group pools.", + "decorators": [], + "properties": [ + { + "$id": "186", + "kind": "property", + "name": "maxReadyCapacity", + "serializedName": "maxReadyCapacity", + "doc": "Specifies maximum number of standby container groups in the standby pool.", + "type": { + "$id": "187", + "kind": "int64", + "name": "int64", + "crossLanguageDefinitionId": "TypeSpec.int64", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.StandbyPool.StandbyContainerGroupPoolElasticityProfile.maxReadyCapacity", + "serializationOptions": { + "$id": "188", + "json": { + "$id": "189", + "name": "maxReadyCapacity" + } + } + }, + { + "$id": "190", + "kind": "property", + "name": "refillPolicy", + "serializedName": "refillPolicy", + "doc": "Specifies refill policy of the pool.", + "type": { + "$ref": "22" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.StandbyPool.StandbyContainerGroupPoolElasticityProfile.refillPolicy", + "serializationOptions": { + "$id": "191", + "json": { + "$id": "192", + "name": "refillPolicy" + } + } + } + ] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.StandbyPool.StandbyContainerGroupPoolResourceProperties.elasticityProfile", + "serializationOptions": { + "$id": "193", + "json": { + "$id": "194", + "name": "elasticityProfile" + } + } + }, + { + "$id": "195", + "kind": "property", + "name": "containerGroupProperties", + "serializedName": "containerGroupProperties", + "doc": "Specifies container group properties of standby container group pools.", + "type": { + "$id": "196", + "kind": "model", + "name": "StandbyContainerGroupProperties", + "clientNamespace": "Microsoft.StandbyPool", + "crossLanguageDefinitionId": "Microsoft.StandbyPool.ContainerGroupProperties", + "usage": "Input,Output,Json,LroInitial,LroPolling,LroFinalEnvelope", + "doc": "Details of the ContainerGroupProperties.", + "decorators": [], + "properties": [ + { + "$id": "197", + "kind": "property", + "name": "containerGroupProfile", + "serializedName": "containerGroupProfile", + "doc": "Specifies container group profile of standby container groups.", + "type": { + "$id": "198", + "kind": "model", + "name": "StandbyContainerGroupProfile", + "clientNamespace": "Microsoft.StandbyPool", + "crossLanguageDefinitionId": "Microsoft.StandbyPool.ContainerGroupProfile", + "usage": "Input,Output,Json,LroInitial,LroPolling,LroFinalEnvelope", + "doc": "Details of the ContainerGroupProfile.", + "decorators": [], + "properties": [ + { + "$id": "199", + "kind": "property", + "name": "id", + "serializedName": "id", + "doc": "Specifies container group profile id of standby container groups.", + "type": { + "$id": "200", + "kind": "string", + "name": "armResourceIdentifier", + "crossLanguageDefinitionId": "Azure.Core.armResourceIdentifier", + "baseType": { + "$id": "201", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.StandbyPool.ContainerGroupProfile.id", + "serializationOptions": { + "$id": "202", + "json": { + "$id": "203", + "name": "id" + } + } + }, + { + "$id": "204", + "kind": "property", + "name": "revision", + "serializedName": "revision", + "doc": "Specifies revision of container group profile.", + "type": { + "$id": "205", + "kind": "int64", + "name": "int64", + "crossLanguageDefinitionId": "TypeSpec.int64", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.StandbyPool.ContainerGroupProfile.revision", + "serializationOptions": { + "$id": "206", + "json": { + "$id": "207", + "name": "revision" + } + } + } + ] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.StandbyPool.ContainerGroupProperties.containerGroupProfile", + "serializationOptions": { + "$id": "208", + "json": { + "$id": "209", + "name": "containerGroupProfile" + } + } + }, + { + "$id": "210", + "kind": "property", + "name": "subnetIds", + "serializedName": "subnetIds", + "doc": "Specifies subnet Ids for container group.", + "type": { + "$id": "211", + "kind": "array", + "name": "ArraySubnet", + "valueType": { + "$id": "212", + "kind": "model", + "name": "Subnet", + "clientNamespace": "Microsoft.StandbyPool", + "crossLanguageDefinitionId": "Microsoft.StandbyPool.Subnet", + "usage": "Input,Output,Json,LroInitial,LroPolling,LroFinalEnvelope", + "doc": "Subnet of container group", + "decorators": [], + "properties": [ + { + "$id": "213", + "kind": "property", + "name": "id", + "serializedName": "id", + "doc": "Specifies ARM resource id of the subnet.", + "type": { + "$id": "214", + "kind": "string", + "name": "armResourceIdentifier", + "crossLanguageDefinitionId": "Azure.Core.armResourceIdentifier", + "baseType": { + "$id": "215", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.StandbyPool.Subnet.id", + "serializationOptions": { + "$id": "216", + "json": { + "$id": "217", + "name": "id" + } + } + } + ] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.StandbyPool.ContainerGroupProperties.subnetIds", + "serializationOptions": { + "$id": "218", + "json": { + "$id": "219", + "name": "subnetIds" + } + } + } + ] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.StandbyPool.StandbyContainerGroupPoolResourceProperties.containerGroupProperties", + "serializationOptions": { + "$id": "220", + "json": { + "$id": "221", + "name": "containerGroupProperties" + } + } + }, + { + "$id": "222", + "kind": "property", + "name": "provisioningState", + "serializedName": "provisioningState", + "doc": "The status of the last operation.", + "type": { + "$ref": "2" + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.StandbyPool.StandbyContainerGroupPoolResourceProperties.provisioningState", + "serializationOptions": { + "$id": "223", + "json": { + "$id": "224", + "name": "provisioningState" + } + } + } + ] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.StandbyPool.StandbyContainerGroupPoolResource.properties", + "serializationOptions": { + "$id": "225", + "json": { + "$id": "226", + "name": "properties" + } + } + } + ] + }, + { + "$ref": "183" + }, + { + "$ref": "185" + }, + { + "$ref": "196" + }, + { + "$ref": "198" + }, + { + "$ref": "212" + }, + { + "$ref": "171" + }, + { + "$id": "227", + "kind": "model", + "name": "ArmOperationStatusResourceProvisioningState", + "clientNamespace": "Azure.ResourceManager", + "crossLanguageDefinitionId": "Azure.ResourceManager.ArmOperationStatus", + "usage": "LroPolling", + "doc": "Standard Azure Resource Manager operation status response", + "decorators": [], + "properties": [ + { + "$id": "228", + "kind": "property", + "name": "status", + "serializedName": "status", + "doc": "The operation status", + "type": { + "$ref": "26" + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.ArmOperationStatus.status", + "serializationOptions": { + "$id": "229", + "json": { + "$id": "230", + "name": "status" + } + } + }, + { + "$id": "231", + "kind": "property", + "name": "name", + "serializedName": "name", + "doc": "The name of the operationStatus resource", + "type": { + "$id": "232", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.ArmOperationStatus.name", + "serializationOptions": { + "$id": "233", + "json": { + "$id": "234", + "name": "name" + } + } + }, + { + "$id": "235", + "kind": "property", + "name": "startTime", + "serializedName": "startTime", + "doc": "Operation start time", + "type": { + "$id": "236", + "kind": "utcDateTime", + "name": "utcDateTime", + "encode": "rfc3339", + "wireType": { + "$id": "237", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.utcDateTime", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.ArmOperationStatus.startTime", + "serializationOptions": { + "$id": "238", + "json": { + "$id": "239", + "name": "startTime" + } + } + }, + { + "$id": "240", + "kind": "property", + "name": "endTime", + "serializedName": "endTime", + "doc": "Operation complete time", + "type": { + "$id": "241", + "kind": "utcDateTime", + "name": "utcDateTime", + "encode": "rfc3339", + "wireType": { + "$id": "242", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.utcDateTime", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.ArmOperationStatus.endTime", + "serializationOptions": { + "$id": "243", + "json": { + "$id": "244", + "name": "endTime" + } + } + }, + { + "$id": "245", + "kind": "property", + "name": "percentComplete", + "serializedName": "percentComplete", + "doc": "The progress made toward completing the operation", + "type": { + "$id": "246", + "kind": "float64", + "name": "float64", + "crossLanguageDefinitionId": "TypeSpec.float64", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.ArmOperationStatus.percentComplete", + "serializationOptions": { + "$id": "247", + "json": { + "$id": "248", + "name": "percentComplete" + } + } + }, + { + "$id": "249", + "kind": "property", + "name": "error", + "serializedName": "error", + "doc": "Errors that occurred if the operation ended with Canceled or Failed status", + "type": { + "$ref": "128" + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.ArmOperationStatus.error", + "serializationOptions": { + "$id": "250", + "json": { + "$id": "251", + "name": "error" + } + } + } + ] + }, + { + "$id": "252", + "kind": "model", + "name": "StandbyContainerGroupPoolResourceUpdate", + "clientNamespace": "Azure.ResourceManager.Foundations", + "crossLanguageDefinitionId": "Azure.ResourceManager.Foundations.ResourceUpdateModel", + "usage": "Input,Json", + "doc": "The type used for update operations of the StandbyContainerGroupPoolResource.", + "decorators": [], + "properties": [ + { + "$id": "253", + "kind": "property", + "name": "tags", + "serializedName": "tags", + "doc": "Resource tags.", + "type": { + "$id": "254", + "kind": "dict", + "keyType": { + "$id": "255", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "valueType": { + "$id": "256", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.Foundations.ResourceUpdateModel.tags", + "serializationOptions": { + "$id": "257", + "json": { + "$id": "258", + "name": "tags" + } + } + }, + { + "$id": "259", + "kind": "property", + "name": "properties", + "serializedName": "properties", + "doc": "The resource-specific properties for this resource.", + "type": { + "$id": "260", + "kind": "model", + "name": "StandbyContainerGroupPoolResourceUpdateProperties", + "clientNamespace": "Azure.ResourceManager.Foundations", + "crossLanguageDefinitionId": "Azure.ResourceManager.Foundations.ResourceUpdateModelProperties", + "usage": "Input,Json", + "doc": "The updatable properties of the StandbyContainerGroupPoolResource.", + "decorators": [], + "properties": [ + { + "$id": "261", + "kind": "property", + "name": "elasticityProfile", + "serializedName": "elasticityProfile", + "doc": "Specifies elasticity profile of standby container group pools.", + "type": { + "$ref": "185" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.Foundations.ResourceUpdateModelProperties.elasticityProfile", + "serializationOptions": { + "$id": "262", + "json": { + "$id": "263", + "name": "elasticityProfile" + } + } + }, + { + "$id": "264", + "kind": "property", + "name": "containerGroupProperties", + "serializedName": "containerGroupProperties", + "doc": "Specifies container group properties of standby container group pools.", + "type": { + "$ref": "196" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.Foundations.ResourceUpdateModelProperties.containerGroupProperties", + "serializationOptions": { + "$id": "265", + "json": { + "$id": "266", + "name": "containerGroupProperties" + } + } + } + ] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.Foundations.ResourceUpdateModel.properties", + "serializationOptions": { + "$id": "267", + "json": { + "$id": "268", + "name": "properties" + } + } + } + ] + }, + { + "$ref": "260" + }, + { + "$id": "269", + "kind": "model", + "name": "StandbyContainerGroupPoolResourceListResult", + "clientNamespace": "Azure.ResourceManager", + "crossLanguageDefinitionId": "Azure.ResourceManager.ResourceListResult", + "usage": "Output,Json", + "doc": "The response of a StandbyContainerGroupPoolResource list operation.", + "decorators": [], + "properties": [ + { + "$id": "270", + "kind": "property", + "name": "value", + "serializedName": "value", + "doc": "The StandbyContainerGroupPoolResource items on this page", + "type": { + "$id": "271", + "kind": "array", + "name": "ArrayStandbyContainerGroupPoolResource", + "valueType": { + "$ref": "170" + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.ResourceListResult.value", + "serializationOptions": { + "$id": "272", + "json": { + "$id": "273", + "name": "value" + } + } + }, + { + "$id": "274", + "kind": "property", + "name": "nextLink", + "serializedName": "nextLink", + "doc": "The link to the next page of items", + "type": { + "$id": "275", + "kind": "url", + "name": "ResourceLocation", + "crossLanguageDefinitionId": "TypeSpec.Rest.ResourceLocation", + "baseType": { + "$id": "276", + "kind": "url", + "name": "url", + "crossLanguageDefinitionId": "TypeSpec.url", + "decorators": [] + }, + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.ResourceListResult.nextLink", + "serializationOptions": { + "$id": "277", + "json": { + "$id": "278", + "name": "nextLink" + } + } + } + ] + }, + { + "$id": "279", + "kind": "model", + "name": "StandbyVirtualMachinePoolRuntimeView", + "clientNamespace": "Microsoft.StandbyPool", + "crossLanguageDefinitionId": "Microsoft.StandbyPool.StandbyVirtualMachinePoolRuntimeViewResource", + "usage": "Output,Json", + "doc": "Contains information about a standby virtual machine pool as last known by the StandbyPool resource provider.", + "decorators": [], + "baseModel": { + "$ref": "57" + }, + "properties": [ + { + "$id": "280", + "kind": "property", + "name": "properties", + "serializedName": "properties", + "doc": "The resource-specific properties for this resource.", + "type": { + "$id": "281", + "kind": "model", + "name": "StandbyVirtualMachinePoolRuntimeViewProperties", + "clientNamespace": "Microsoft.StandbyPool", + "crossLanguageDefinitionId": "Microsoft.StandbyPool.StandbyVirtualMachinePoolRuntimeViewResourceProperties", + "usage": "Output,Json", + "doc": "Contains information about a standby pool as last known by the StandbyPool resource provider.", + "decorators": [], + "properties": [ + { + "$id": "282", + "kind": "property", + "name": "instanceCountSummary", + "serializedName": "instanceCountSummary", + "doc": "A list containing the counts of virtual machines in each possible power state for each zone if enabled, as known by the StandbyPool resource provider. If zones are not enabled on the attached VMSS, the list will contain a single entry without zone values. Note: any resources in the Running state may still be installing extensions / not fully provisioned.", + "type": { + "$id": "283", + "kind": "array", + "name": "ArrayVirtualMachineInstanceCountSummary", + "valueType": { + "$id": "284", + "kind": "model", + "name": "StandbyVirtualMachineInstanceCountSummary", + "clientNamespace": "Microsoft.StandbyPool", + "crossLanguageDefinitionId": "Microsoft.StandbyPool.VirtualMachineInstanceCountSummary", + "usage": "Output,Json", + "doc": "Contains the counts of VMs in each power state in a given zone, fault domain, as known by the StandbyPool resource provider. Note: any resources in the Running state may still be installing extensions / not fully provisioned.", + "decorators": [], + "properties": [ + { + "$id": "285", + "kind": "property", + "name": "zone", + "serializedName": "zone", + "doc": "The zone that the provided counts are in. This is null if zones are not enabled on the attached VMSS.", + "type": { + "$id": "286", + "kind": "int64", + "name": "int64", + "crossLanguageDefinitionId": "TypeSpec.int64", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.StandbyPool.VirtualMachineInstanceCountSummary.zone", + "serializationOptions": { + "$id": "287", + "json": { + "$id": "288", + "name": "zone" + } + } + }, + { + "$id": "289", + "kind": "property", + "name": "instanceCountsByState", + "serializedName": "instanceCountsByState", + "doc": "The count of pooled resources in each state for the given zone.", + "type": { + "$id": "290", + "kind": "array", + "name": "ArrayPoolResourceStateCount", + "valueType": { + "$ref": "108" + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.StandbyPool.VirtualMachineInstanceCountSummary.instanceCountsByState", + "serializationOptions": { + "$id": "291", + "json": { + "$id": "292", + "name": "instanceCountsByState" + } + } + } + ] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": false, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.StandbyPool.StandbyVirtualMachinePoolRuntimeViewResourceProperties.instanceCountSummary", + "serializationOptions": { + "$id": "293", + "json": { + "$id": "294", + "name": "instanceCountSummary" + } + } + }, + { + "$id": "295", + "kind": "property", + "name": "provisioningState", + "serializedName": "provisioningState", + "doc": "Displays the provisioning state of the standby pool", + "type": { + "$ref": "2" + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.StandbyPool.StandbyVirtualMachinePoolRuntimeViewResourceProperties.provisioningState", + "serializationOptions": { + "$id": "296", + "json": { + "$id": "297", + "name": "provisioningState" + } + } + } + ] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.StandbyPool.StandbyVirtualMachinePoolRuntimeViewResource.properties", + "serializationOptions": { + "$id": "298", + "json": { + "$id": "299", + "name": "properties" + } + } + } + ] + }, + { + "$ref": "281" + }, + { + "$ref": "284" + }, + { + "$id": "300", + "kind": "model", + "name": "StandbyVirtualMachinePoolRuntimeViewResourceListResult", + "clientNamespace": "Azure.ResourceManager", + "crossLanguageDefinitionId": "Azure.ResourceManager.ResourceListResult", + "usage": "Output,Json", + "doc": "The response of a StandbyVirtualMachinePoolRuntimeViewResource list operation.", + "decorators": [], + "properties": [ + { + "$id": "301", + "kind": "property", + "name": "value", + "serializedName": "value", + "doc": "The StandbyVirtualMachinePoolRuntimeViewResource items on this page", + "type": { + "$id": "302", + "kind": "array", + "name": "ArrayStandbyVirtualMachinePoolRuntimeViewResource", + "valueType": { + "$ref": "279" + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.ResourceListResult.value", + "serializationOptions": { + "$id": "303", + "json": { + "$id": "304", + "name": "value" + } + } + }, + { + "$id": "305", + "kind": "property", + "name": "nextLink", + "serializedName": "nextLink", + "doc": "The link to the next page of items", + "type": { + "$id": "306", + "kind": "url", + "name": "ResourceLocation", + "crossLanguageDefinitionId": "TypeSpec.Rest.ResourceLocation", + "baseType": { + "$id": "307", + "kind": "url", + "name": "url", + "crossLanguageDefinitionId": "TypeSpec.url", + "decorators": [] + }, + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.ResourceListResult.nextLink", + "serializationOptions": { + "$id": "308", + "json": { + "$id": "309", + "name": "nextLink" + } + } + } + ] + }, + { + "$id": "310", + "kind": "model", + "name": "StandbyVirtualMachine", + "clientNamespace": "Microsoft.StandbyPool", + "crossLanguageDefinitionId": "Microsoft.StandbyPool.StandbyVirtualMachineResource", + "usage": "Output,Json", + "doc": "Concrete proxy resource types can be created by aliasing this type using a specific property type.", + "decorators": [], + "baseModel": { + "$ref": "57" + }, + "properties": [ + { + "$id": "311", + "kind": "property", + "name": "properties", + "serializedName": "properties", + "doc": "The resource-specific properties for this resource.", + "type": { + "$id": "312", + "kind": "model", + "name": "StandbyVirtualMachineProperties", + "clientNamespace": "Microsoft.StandbyPool", + "crossLanguageDefinitionId": "Microsoft.StandbyPool.StandbyVirtualMachineResourceProperties", + "usage": "Output,Json", + "doc": "Details of the StandbyVirtualMachine.", + "decorators": [], + "properties": [ + { + "$id": "313", + "kind": "property", + "name": "virtualMachineResourceId", + "serializedName": "virtualMachineResourceId", + "doc": "Resource id of the virtual machine.", + "type": { + "$id": "314", + "kind": "string", + "name": "armResourceIdentifier", + "crossLanguageDefinitionId": "Azure.Core.armResourceIdentifier", + "baseType": { + "$id": "315", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.StandbyPool.StandbyVirtualMachineResourceProperties.virtualMachineResourceId", + "serializationOptions": { + "$id": "316", + "json": { + "$id": "317", + "name": "virtualMachineResourceId" + } + } + }, + { + "$id": "318", + "kind": "property", + "name": "provisioningState", + "serializedName": "provisioningState", + "doc": "The status of the last operation.", + "type": { + "$ref": "2" + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.StandbyPool.StandbyVirtualMachineResourceProperties.provisioningState", + "serializationOptions": { + "$id": "319", + "json": { + "$id": "320", + "name": "provisioningState" + } + } + } + ] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.StandbyPool.StandbyVirtualMachineResource.properties", + "serializationOptions": { + "$id": "321", + "json": { + "$id": "322", + "name": "properties" + } + } + } + ] + }, + { + "$ref": "312" + }, + { + "$id": "323", + "kind": "model", + "name": "StandbyVirtualMachineResourceListResult", + "clientNamespace": "Azure.ResourceManager", + "crossLanguageDefinitionId": "Azure.ResourceManager.ResourceListResult", + "usage": "Output,Json", + "doc": "The response of a StandbyVirtualMachineResource list operation.", + "decorators": [], + "properties": [ + { + "$id": "324", + "kind": "property", + "name": "value", + "serializedName": "value", + "doc": "The StandbyVirtualMachineResource items on this page", + "type": { + "$id": "325", + "kind": "array", + "name": "ArrayStandbyVirtualMachineResource", + "valueType": { + "$ref": "310" + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.ResourceListResult.value", + "serializationOptions": { + "$id": "326", + "json": { + "$id": "327", + "name": "value" + } + } + }, + { + "$id": "328", + "kind": "property", + "name": "nextLink", + "serializedName": "nextLink", + "doc": "The link to the next page of items", + "type": { + "$id": "329", + "kind": "url", + "name": "ResourceLocation", + "crossLanguageDefinitionId": "TypeSpec.Rest.ResourceLocation", + "baseType": { + "$id": "330", + "kind": "url", + "name": "url", + "crossLanguageDefinitionId": "TypeSpec.url", + "decorators": [] + }, + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.ResourceListResult.nextLink", + "serializationOptions": { + "$id": "331", + "json": { + "$id": "332", + "name": "nextLink" + } + } + } + ] + }, + { + "$id": "333", + "kind": "model", + "name": "StandbyVirtualMachinePool", + "clientNamespace": "Microsoft.StandbyPool", + "crossLanguageDefinitionId": "Microsoft.StandbyPool.StandbyVirtualMachinePoolResource", + "usage": "Input,Output,Json,LroInitial,LroPolling,LroFinalEnvelope", + "doc": "A StandbyVirtualMachinePoolResource.", + "decorators": [], + "baseModel": { + "$ref": "171" + }, + "properties": [ + { + "$id": "334", + "kind": "property", + "name": "properties", + "serializedName": "properties", + "doc": "The resource-specific properties for this resource.", + "type": { + "$id": "335", + "kind": "model", + "name": "StandbyVirtualMachinePoolProperties", + "clientNamespace": "Microsoft.StandbyPool", + "crossLanguageDefinitionId": "Microsoft.StandbyPool.StandbyVirtualMachinePoolResourceProperties", + "usage": "Input,Output,Json,LroInitial,LroPolling,LroFinalEnvelope", + "doc": "Details of the StandbyVirtualMachinePool.", + "decorators": [], + "properties": [ + { + "$id": "336", + "kind": "property", + "name": "elasticityProfile", + "serializedName": "elasticityProfile", + "doc": "Specifies the elasticity profile of the standby virtual machine pools.", + "type": { + "$id": "337", + "kind": "model", + "name": "StandbyVirtualMachinePoolElasticityProfile", + "clientNamespace": "Microsoft.StandbyPool", + "crossLanguageDefinitionId": "Microsoft.StandbyPool.StandbyVirtualMachinePoolElasticityProfile", + "usage": "Input,Output,Json,LroInitial,LroPolling,LroFinalEnvelope", + "doc": "Details of the elasticity profile.", + "decorators": [], + "properties": [ + { + "$id": "338", + "kind": "property", + "name": "maxReadyCapacity", + "serializedName": "maxReadyCapacity", + "doc": "Specifies the maximum number of virtual machines in the standby virtual machine pool.", + "type": { + "$id": "339", + "kind": "int64", + "name": "int64", + "crossLanguageDefinitionId": "TypeSpec.int64", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.StandbyPool.StandbyVirtualMachinePoolElasticityProfile.maxReadyCapacity", + "serializationOptions": { + "$id": "340", + "json": { + "$id": "341", + "name": "maxReadyCapacity" + } + } + }, + { + "$id": "342", + "kind": "property", + "name": "minReadyCapacity", + "serializedName": "minReadyCapacity", + "doc": "Specifies the desired minimum number of virtual machines in the standby virtual machine pool. MinReadyCapacity cannot exceed MaxReadyCapacity.", + "type": { + "$id": "343", + "kind": "int64", + "name": "int64", + "crossLanguageDefinitionId": "TypeSpec.int64", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.StandbyPool.StandbyVirtualMachinePoolElasticityProfile.minReadyCapacity", + "serializationOptions": { + "$id": "344", + "json": { + "$id": "345", + "name": "minReadyCapacity" + } + } + } + ] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.StandbyPool.StandbyVirtualMachinePoolResourceProperties.elasticityProfile", + "serializationOptions": { + "$id": "346", + "json": { + "$id": "347", + "name": "elasticityProfile" + } + } + }, + { + "$id": "348", + "kind": "property", + "name": "virtualMachineState", + "serializedName": "virtualMachineState", + "doc": "Specifies the desired state of virtual machines in the pool.", + "type": { + "$ref": "34" + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.StandbyPool.StandbyVirtualMachinePoolResourceProperties.virtualMachineState", + "serializationOptions": { + "$id": "349", + "json": { + "$id": "350", + "name": "virtualMachineState" + } + } + }, + { + "$id": "351", + "kind": "property", + "name": "attachedVirtualMachineScaleSetId", + "serializedName": "attachedVirtualMachineScaleSetId", + "doc": "Specifies the fully qualified resource ID of a virtual machine scale set the pool is attached to.", + "type": { + "$id": "352", + "kind": "string", + "name": "armResourceIdentifier", + "crossLanguageDefinitionId": "Azure.Core.armResourceIdentifier", + "baseType": { + "$id": "353", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.StandbyPool.StandbyVirtualMachinePoolResourceProperties.attachedVirtualMachineScaleSetId", + "serializationOptions": { + "$id": "354", + "json": { + "$id": "355", + "name": "attachedVirtualMachineScaleSetId" + } + } + }, + { + "$id": "356", + "kind": "property", + "name": "provisioningState", + "serializedName": "provisioningState", + "doc": "The status of the last operation.", + "type": { + "$ref": "2" + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.StandbyPool.StandbyVirtualMachinePoolResourceProperties.provisioningState", + "serializationOptions": { + "$id": "357", + "json": { + "$id": "358", + "name": "provisioningState" + } + } + } + ] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.StandbyPool.StandbyVirtualMachinePoolResource.properties", + "serializationOptions": { + "$id": "359", + "json": { + "$id": "360", + "name": "properties" + } + } + } + ] + }, + { + "$ref": "335" + }, + { + "$ref": "337" + }, + { + "$id": "361", + "kind": "model", + "name": "StandbyVirtualMachinePoolResourceUpdate", + "clientNamespace": "Azure.ResourceManager.Foundations", + "crossLanguageDefinitionId": "Azure.ResourceManager.Foundations.ResourceUpdateModel", + "usage": "Input,Json", + "doc": "The type used for update operations of the StandbyVirtualMachinePoolResource.", + "decorators": [], + "properties": [ + { + "$id": "362", + "kind": "property", + "name": "tags", + "serializedName": "tags", + "doc": "Resource tags.", + "type": { + "$id": "363", + "kind": "dict", + "keyType": { + "$id": "364", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "valueType": { + "$id": "365", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.Foundations.ResourceUpdateModel.tags", + "serializationOptions": { + "$id": "366", + "json": { + "$id": "367", + "name": "tags" + } + } + }, + { + "$id": "368", + "kind": "property", + "name": "properties", + "serializedName": "properties", + "doc": "The resource-specific properties for this resource.", + "type": { + "$id": "369", + "kind": "model", + "name": "StandbyVirtualMachinePoolResourceUpdateProperties", + "clientNamespace": "Azure.ResourceManager.Foundations", + "crossLanguageDefinitionId": "Azure.ResourceManager.Foundations.ResourceUpdateModelProperties", + "usage": "Input,Json", + "doc": "The updatable properties of the StandbyVirtualMachinePoolResource.", + "decorators": [], + "properties": [ + { + "$id": "370", + "kind": "property", + "name": "elasticityProfile", + "serializedName": "elasticityProfile", + "doc": "Specifies the elasticity profile of the standby virtual machine pools.", + "type": { + "$ref": "337" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.Foundations.ResourceUpdateModelProperties.elasticityProfile", + "serializationOptions": { + "$id": "371", + "json": { + "$id": "372", + "name": "elasticityProfile" + } + } + }, + { + "$id": "373", + "kind": "property", + "name": "virtualMachineState", + "serializedName": "virtualMachineState", + "doc": "Specifies the desired state of virtual machines in the pool.", + "type": { + "$ref": "34" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.Foundations.ResourceUpdateModelProperties.virtualMachineState", + "serializationOptions": { + "$id": "374", + "json": { + "$id": "375", + "name": "virtualMachineState" + } + } + }, + { + "$id": "376", + "kind": "property", + "name": "attachedVirtualMachineScaleSetId", + "serializedName": "attachedVirtualMachineScaleSetId", + "doc": "Specifies the fully qualified resource ID of a virtual machine scale set the pool is attached to.", + "type": { + "$id": "377", + "kind": "string", + "name": "armResourceIdentifier", + "crossLanguageDefinitionId": "Azure.Core.armResourceIdentifier", + "baseType": { + "$id": "378", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.Foundations.ResourceUpdateModelProperties.attachedVirtualMachineScaleSetId", + "serializationOptions": { + "$id": "379", + "json": { + "$id": "380", + "name": "attachedVirtualMachineScaleSetId" + } + } + } + ] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.Foundations.ResourceUpdateModel.properties", + "serializationOptions": { + "$id": "381", + "json": { + "$id": "382", + "name": "properties" + } + } + } + ] + }, + { + "$ref": "369" + }, + { + "$id": "383", + "kind": "model", + "name": "StandbyVirtualMachinePoolResourceListResult", + "clientNamespace": "Azure.ResourceManager", + "crossLanguageDefinitionId": "Azure.ResourceManager.ResourceListResult", + "usage": "Output,Json", + "doc": "The response of a StandbyVirtualMachinePoolResource list operation.", + "decorators": [], + "properties": [ + { + "$id": "384", + "kind": "property", + "name": "value", + "serializedName": "value", + "doc": "The StandbyVirtualMachinePoolResource items on this page", + "type": { + "$id": "385", + "kind": "array", + "name": "ArrayStandbyVirtualMachinePoolResource", + "valueType": { + "$ref": "333" + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.ResourceListResult.value", + "serializationOptions": { + "$id": "386", + "json": { + "$id": "387", + "name": "value" + } + } + }, + { + "$id": "388", + "kind": "property", + "name": "nextLink", + "serializedName": "nextLink", + "doc": "The link to the next page of items", + "type": { + "$id": "389", + "kind": "url", + "name": "ResourceLocation", + "crossLanguageDefinitionId": "TypeSpec.Rest.ResourceLocation", + "baseType": { + "$id": "390", + "kind": "url", + "name": "url", + "crossLanguageDefinitionId": "TypeSpec.url", + "decorators": [] + }, + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.ResourceListResult.nextLink", + "serializationOptions": { + "$id": "391", + "json": { + "$id": "392", + "name": "nextLink" + } + } + } + ] + }, + { + "$id": "393", + "kind": "model", + "name": "OperationListResult", + "clientNamespace": "Azure.ResourceManager.CommonTypes", + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.OperationListResult", + "usage": "Output,Json", + "doc": "A list of REST API operations supported by an Azure Resource Provider. It contains an URL link to get the next set of results.", + "decorators": [], + "properties": [ + { + "$id": "394", + "kind": "property", + "name": "value", + "serializedName": "value", + "doc": "The Operation items on this page", + "type": { + "$id": "395", + "kind": "array", + "name": "ArrayOperation", + "valueType": { + "$id": "396", + "kind": "model", + "name": "Operation", + "clientNamespace": "Azure.ResourceManager.CommonTypes", + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.Operation", + "usage": "Output,Json", + "doc": "Details of a REST API operation, returned from the Resource Provider Operations API", + "decorators": [], + "properties": [ + { + "$id": "397", + "kind": "property", + "name": "name", + "serializedName": "name", + "doc": "The name of the operation, as per Resource-Based Access Control (RBAC). Examples: \"Microsoft.Compute/virtualMachines/write\", \"Microsoft.Compute/virtualMachines/capture/action\"", + "type": { + "$id": "398", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.Operation.name", + "serializationOptions": { + "$id": "399", + "json": { + "$id": "400", + "name": "name" + } + } + }, + { + "$id": "401", + "kind": "property", + "name": "isDataAction", + "serializedName": "isDataAction", + "doc": "Whether the operation applies to data-plane. This is \"true\" for data-plane operations and \"false\" for Azure Resource Manager/control-plane operations.", + "type": { + "$id": "402", + "kind": "boolean", + "name": "boolean", + "crossLanguageDefinitionId": "TypeSpec.boolean", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.Operation.isDataAction", + "serializationOptions": { + "$id": "403", + "json": { + "$id": "404", + "name": "isDataAction" + } + } + }, + { + "$id": "405", + "kind": "property", + "name": "display", + "serializedName": "display", + "doc": "Localized display information for this particular operation.", + "type": { + "$id": "406", + "kind": "model", + "name": "OperationDisplay", + "clientNamespace": "Azure.ResourceManager.CommonTypes", + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.OperationDisplay", + "usage": "Output,Json", + "doc": "Localized display information for and operation.", + "decorators": [], + "properties": [ + { + "$id": "407", + "kind": "property", + "name": "provider", + "serializedName": "provider", + "doc": "The localized friendly form of the resource provider name, e.g. \"Microsoft Monitoring Insights\" or \"Microsoft Compute\".", + "type": { + "$id": "408", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.OperationDisplay.provider", + "serializationOptions": { + "$id": "409", + "json": { + "$id": "410", + "name": "provider" + } + } + }, + { + "$id": "411", + "kind": "property", + "name": "resource", + "serializedName": "resource", + "doc": "The localized friendly name of the resource type related to this operation. E.g. \"Virtual Machines\" or \"Job Schedule Collections\".", + "type": { + "$id": "412", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.OperationDisplay.resource", + "serializationOptions": { + "$id": "413", + "json": { + "$id": "414", + "name": "resource" + } + } + }, + { + "$id": "415", + "kind": "property", + "name": "operation", + "serializedName": "operation", + "doc": "The concise, localized friendly name for the operation; suitable for dropdowns. E.g. \"Create or Update Virtual Machine\", \"Restart Virtual Machine\".", + "type": { + "$id": "416", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.OperationDisplay.operation", + "serializationOptions": { + "$id": "417", + "json": { + "$id": "418", + "name": "operation" + } + } + }, + { + "$id": "419", + "kind": "property", + "name": "description", + "serializedName": "description", + "doc": "The short, localized friendly description of the operation; suitable for tool tips and detailed views.", + "type": { + "$id": "420", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.OperationDisplay.description", + "serializationOptions": { + "$id": "421", + "json": { + "$id": "422", + "name": "description" + } + } + } + ] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.Operation.display", + "serializationOptions": { + "$id": "423", + "json": { + "$id": "424", + "name": "display" + } + } + }, + { + "$id": "425", + "kind": "property", + "name": "origin", + "serializedName": "origin", + "doc": "The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default value is \"user,system\"", + "type": { + "$ref": "40" + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.Operation.origin", + "serializationOptions": { + "$id": "426", + "json": { + "$id": "427", + "name": "origin" + } + } + }, + { + "$id": "428", + "kind": "property", + "name": "actionType", + "serializedName": "actionType", + "doc": "Extensible enum. Indicates the action type. \"Internal\" refers to actions that are for internal only APIs.", + "type": { + "$ref": "48" + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.Operation.actionType", + "serializationOptions": { + "$id": "429", + "json": { + "$id": "430", + "name": "actionType" + } + } + } + ] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.OperationListResult.value", + "serializationOptions": { + "$id": "431", + "json": { + "$id": "432", + "name": "value" + } + } + }, + { + "$id": "433", + "kind": "property", + "name": "nextLink", + "serializedName": "nextLink", + "doc": "The link to the next page of items", + "type": { + "$id": "434", + "kind": "url", + "name": "ResourceLocation", + "crossLanguageDefinitionId": "TypeSpec.Rest.ResourceLocation", + "baseType": { + "$id": "435", + "kind": "url", + "name": "url", + "crossLanguageDefinitionId": "TypeSpec.url", + "decorators": [] + }, + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.OperationListResult.nextLink", + "serializationOptions": { + "$id": "436", + "json": { + "$id": "437", + "name": "nextLink" + } + } + } + ] + }, + { + "$ref": "396" + }, + { + "$ref": "406" + } + ], + "Clients": [ + { + "$id": "438", + "Name": "StandbyPoolClient", + "ClientNamespace": "Microsoft.StandbyPool", + "Operations": [], + "Protocol": { + "$id": "439" + }, + "Parameters": [ + { + "$id": "440", + "Name": "endpoint", + "NameInRequest": "endpoint", + "Doc": "Service host", + "Type": { + "$id": "441", + "kind": "url", + "name": "url", + "crossLanguageDefinitionId": "TypeSpec.url" + }, + "Location": "Uri", + "IsApiVersion": false, + "IsResourceParameter": false, + "IsContentType": false, + "IsRequired": true, + "IsEndpoint": true, + "SkipUrlEncoding": false, + "Explode": false, + "Kind": "Client", + "DefaultValue": { + "$id": "442", + "Type": { + "$id": "443", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "https://management.azure.com" + } + } + ], + "Decorators": [] + }, + { + "$id": "444", + "Name": "Operations", + "ClientNamespace": "Microsoft.StandbyPool", + "Operations": [ + { + "$id": "445", + "Name": "list", + "ResourceName": "Operations", + "Doc": "List the operations for the provider", + "Accessibility": "internal", + "Parameters": [ + { + "$id": "446", + "Name": "apiVersion", + "NameInRequest": "api-version", + "Doc": "The API version to use for this operation.", + "Type": { + "$id": "447", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": true, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "DefaultValue": { + "$id": "448", + "Type": { + "$id": "449", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "2024-03-01" + }, + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "450", + "Name": "accept", + "NameInRequest": "Accept", + "Type": { + "$id": "451", + "kind": "constant", + "valueType": { + "$id": "452", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "453", + "StatusCodes": [ + 200 + ], + "BodyType": { + "$ref": "393" + }, + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false, + "ContentTypes": [ + "application/json" + ] + } + ], + "HttpMethod": "GET", + "RequestBodyMediaType": "None", + "Uri": "{endpoint}", + "Path": "/providers/Microsoft.StandbyPool/operations", + "BufferResponse": true, + "Paging": { + "$id": "454", + "ItemName": "value", + "NextLinkName": "nextLink" + }, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Azure.ResourceManager.Operations.list", + "Decorators": [], + "Examples": [ + { + "$id": "455", + "kind": "http", + "name": "Operations_List", + "description": "Operations_List", + "filePath": "2024-03-01/Operations_List.json", + "parameters": [ + { + "$id": "456", + "parameter": { + "$ref": "446" + }, + "value": { + "$id": "457", + "kind": "string", + "type": { + "$ref": "447" + }, + "value": "2024-03-01" + } + } + ], + "responses": [ + { + "$id": "458", + "response": { + "$ref": "453" + }, + "statusCode": 200, + "bodyValue": { + "$id": "459", + "kind": "model", + "type": { + "$ref": "393" + }, + "value": { + "$id": "460", + "value": { + "$id": "461", + "kind": "array", + "type": { + "$ref": "395" + }, + "value": [ + { + "$id": "462", + "kind": "model", + "type": { + "$ref": "396" + }, + "value": { + "$id": "463", + "name": { + "$id": "464", + "kind": "string", + "type": { + "$ref": "398" + }, + "value": "Microsoft.StandbyPool/standbyContainerGroupPools/write" + }, + "isDataAction": { + "$id": "465", + "kind": "boolean", + "type": { + "$ref": "402" + }, + "value": true + }, + "display": { + "$id": "466", + "kind": "model", + "type": { + "$ref": "406" + }, + "value": { + "$id": "467", + "provider": { + "$id": "468", + "kind": "string", + "type": { + "$ref": "408" + }, + "value": "Microsoft.StandbyPool" + }, + "resource": { + "$id": "469", + "kind": "string", + "type": { + "$ref": "412" + }, + "value": "standbyContainerGroupPools" + }, + "operation": { + "$id": "470", + "kind": "string", + "type": { + "$ref": "416" + }, + "value": "StandbyContainerGroupPools_Create" + }, + "description": { + "$id": "471", + "kind": "string", + "type": { + "$ref": "420" + }, + "value": "Create a StandbyContainerGroupPools Resource" + } + } + }, + "origin": { + "$id": "472", + "kind": "string", + "type": { + "$ref": "40" + }, + "value": "user" + }, + "actionType": { + "$id": "473", + "kind": "string", + "type": { + "$ref": "48" + }, + "value": "Internal" + } + } + } + ] + }, + "nextLink": { + "$id": "474", + "kind": "string", + "type": { + "$ref": "434" + }, + "value": "https://example.com/providers/Microsoft.StandbyPool/operations" + } + } + } + } + ] + } + ] + } + ], + "Protocol": { + "$id": "475" + }, + "Parent": "StandbyPoolClient", + "Parameters": [ + { + "$id": "476", + "Name": "endpoint", + "NameInRequest": "endpoint", + "Doc": "Service host", + "Type": { + "$id": "477", + "kind": "url", + "name": "url", + "crossLanguageDefinitionId": "TypeSpec.url" + }, + "Location": "Uri", + "IsApiVersion": false, + "IsResourceParameter": false, + "IsContentType": false, + "IsRequired": true, + "IsEndpoint": true, + "SkipUrlEncoding": false, + "Explode": false, + "Kind": "Client", + "DefaultValue": { + "$id": "478", + "Type": { + "$id": "479", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "https://management.azure.com" + } + } + ], + "Decorators": [] + }, + { + "$id": "480", + "Name": "StandbyVirtualMachinePools", + "ClientNamespace": "Microsoft.StandbyPool", + "Operations": [ + { + "$id": "481", + "Name": "get", + "ResourceName": "StandbyVirtualMachinePoolResource", + "Doc": "Get a StandbyVirtualMachinePoolResource", + "Accessibility": "public", + "Parameters": [ + { + "$id": "482", + "Name": "apiVersion", + "NameInRequest": "api-version", + "Doc": "The API version to use for this operation.", + "Type": { + "$id": "483", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": true, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "DefaultValue": { + "$id": "484", + "Type": { + "$id": "485", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "2024-03-01" + }, + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "486", + "Name": "subscriptionId", + "NameInRequest": "subscriptionId", + "Doc": "The ID of the target subscription. The value must be an UUID.", + "Type": { + "$id": "487", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "488", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "489", + "Name": "resourceGroupName", + "NameInRequest": "resourceGroupName", + "Doc": "The name of the resource group. The name is case insensitive.", + "Type": { + "$id": "490", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "491", + "Name": "standbyVirtualMachinePoolName", + "NameInRequest": "standbyVirtualMachinePoolName", + "Doc": "Name of the standby virtual machine pool", + "Type": { + "$id": "492", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "493", + "Name": "accept", + "NameInRequest": "Accept", + "Type": { + "$id": "494", + "kind": "constant", + "valueType": { + "$id": "495", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "496", + "StatusCodes": [ + 200 + ], + "BodyType": { + "$ref": "333" + }, + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false, + "ContentTypes": [ + "application/json" + ] + } + ], + "HttpMethod": "GET", + "RequestBodyMediaType": "None", + "Uri": "{endpoint}", + "Path": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StandbyPool/standbyVirtualMachinePools/{standbyVirtualMachinePoolName}", + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Microsoft.StandbyPool.StandbyVirtualMachinePools.get", + "Decorators": [], + "Examples": [ + { + "$id": "497", + "kind": "http", + "name": "StandbyVirtualMachinePools_Get", + "description": "StandbyVirtualMachinePools_Get", + "filePath": "2024-03-01/StandbyVirtualMachinePools_Get.json", + "parameters": [ + { + "$id": "498", + "parameter": { + "$ref": "482" + }, + "value": { + "$id": "499", + "kind": "string", + "type": { + "$ref": "483" + }, + "value": "2024-03-01" + } + }, + { + "$id": "500", + "parameter": { + "$ref": "486" + }, + "value": { + "$id": "501", + "kind": "string", + "type": { + "$ref": "487" + }, + "value": "00000000-0000-0000-0000-000000000009" + } + }, + { + "$id": "502", + "parameter": { + "$ref": "489" + }, + "value": { + "$id": "503", + "kind": "string", + "type": { + "$ref": "490" + }, + "value": "rgstandbypool" + } + }, + { + "$id": "504", + "parameter": { + "$ref": "491" + }, + "value": { + "$id": "505", + "kind": "string", + "type": { + "$ref": "492" + }, + "value": "pool" + } + } + ], + "responses": [ + { + "$id": "506", + "response": { + "$ref": "496" + }, + "statusCode": 200, + "bodyValue": { + "$id": "507", + "kind": "model", + "type": { + "$ref": "333" + }, + "value": { + "$id": "508", + "properties": { + "$id": "509", + "kind": "model", + "type": { + "$ref": "335" + }, + "value": { + "$id": "510", + "elasticityProfile": { + "$id": "511", + "kind": "model", + "type": { + "$ref": "337" + }, + "value": { + "$id": "512", + "maxReadyCapacity": { + "$id": "513", + "kind": "number", + "type": { + "$ref": "339" + }, + "value": 304 + }, + "minReadyCapacity": { + "$id": "514", + "kind": "number", + "type": { + "$ref": "343" + }, + "value": 300 + } + } + }, + "virtualMachineState": { + "$id": "515", + "kind": "string", + "type": { + "$ref": "34" + }, + "value": "Running" + }, + "attachedVirtualMachineScaleSetId": { + "$id": "516", + "kind": "string", + "type": { + "$ref": "352" + }, + "value": "/subscriptions/00000000-0000-0000-0000-000000000009/resourceGroups/rgstandbypool/providers/Microsoft.Compute/virtualMachineScaleSets/myVmss" + }, + "provisioningState": { + "$id": "517", + "kind": "string", + "type": { + "$ref": "2" + }, + "value": "Succeeded" + } + } + }, + "tags": { + "$id": "518", + "kind": "dict", + "type": { + "$ref": "173" + }, + "value": { + "$id": "519" + } + }, + "location": { + "$id": "520", + "kind": "string", + "type": { + "$ref": "179" + }, + "value": "West US" + }, + "id": { + "$id": "521", + "kind": "string", + "type": { + "$ref": "60" + }, + "value": "/subscriptions/00000000-0000-0000-0000-000000000009/resourceGroups/rgstandbypool/providers/Microsoft.StandbyPool/standbyVirtualMachinePools/pool" + }, + "name": { + "$id": "522", + "kind": "string", + "type": { + "$ref": "65" + }, + "value": "pool" + }, + "type": { + "$id": "523", + "kind": "string", + "type": { + "$ref": "69" + }, + "value": "Microsoft.StandbyPool/standbyVirtualMachinePools" + }, + "systemData": { + "$id": "524", + "kind": "model", + "type": { + "$ref": "74" + }, + "value": { + "$id": "525", + "createdBy": { + "$id": "526", + "kind": "string", + "type": { + "$ref": "76" + }, + "value": "pooluser@microsoft.com" + }, + "createdByType": { + "$id": "527", + "kind": "string", + "type": { + "$ref": "12" + }, + "value": "User" + }, + "createdAt": { + "$id": "528", + "kind": "string", + "type": { + "$ref": "83" + }, + "value": "2023-09-07T16:33:22.210Z" + }, + "lastModifiedBy": { + "$id": "529", + "kind": "string", + "type": { + "$ref": "88" + }, + "value": "pooluser@microsoft.com" + }, + "lastModifiedByType": { + "$id": "530", + "kind": "string", + "type": { + "$ref": "12" + }, + "value": "User" + }, + "lastModifiedAt": { + "$id": "531", + "kind": "string", + "type": { + "$ref": "95" + }, + "value": "2023-09-07T16:33:22.210Z" + } + } + } + } + } + } + ] + } + ] + }, + { + "$id": "532", + "Name": "createOrUpdate", + "ResourceName": "StandbyVirtualMachinePoolResource", + "Doc": "Create a StandbyVirtualMachinePoolResource", + "Accessibility": "public", + "Parameters": [ + { + "$id": "533", + "Name": "apiVersion", + "NameInRequest": "api-version", + "Doc": "The API version to use for this operation.", + "Type": { + "$id": "534", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": true, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "DefaultValue": { + "$id": "535", + "Type": { + "$id": "536", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "2024-03-01" + }, + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "537", + "Name": "subscriptionId", + "NameInRequest": "subscriptionId", + "Doc": "The ID of the target subscription. The value must be an UUID.", + "Type": { + "$id": "538", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "539", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "540", + "Name": "resourceGroupName", + "NameInRequest": "resourceGroupName", + "Doc": "The name of the resource group. The name is case insensitive.", + "Type": { + "$id": "541", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "542", + "Name": "standbyVirtualMachinePoolName", + "NameInRequest": "standbyVirtualMachinePoolName", + "Doc": "Name of the standby virtual machine pool", + "Type": { + "$id": "543", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "544", + "Name": "contentType", + "NameInRequest": "Content-Type", + "Doc": "Body parameter's content type. Known values are application/json", + "Type": { + "$id": "545", + "kind": "constant", + "valueType": { + "$id": "546", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": true, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "547", + "Name": "accept", + "NameInRequest": "Accept", + "Type": { + "$id": "548", + "kind": "constant", + "valueType": { + "$id": "549", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "550", + "Name": "resource", + "NameInRequest": "resource", + "Doc": "Resource create parameters.", + "Type": { + "$ref": "333" + }, + "Location": "Body", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "551", + "StatusCodes": [ + 200 + ], + "BodyType": { + "$ref": "333" + }, + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false, + "ContentTypes": [ + "application/json" + ] + }, + { + "$id": "552", + "StatusCodes": [ + 201 + ], + "BodyType": { + "$ref": "333" + }, + "BodyMediaType": "Json", + "Headers": [ + { + "$id": "553", + "Name": "retryAfter", + "NameInResponse": "Retry-After", + "Doc": "The Retry-After header can indicate how long the client should wait before polling the operation status.", + "Type": { + "$id": "554", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + } + } + ], + "IsErrorResponse": false, + "ContentTypes": [ + "application/json" + ] + } + ], + "HttpMethod": "PUT", + "RequestBodyMediaType": "Json", + "Uri": "{endpoint}", + "Path": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StandbyPool/standbyVirtualMachinePools/{standbyVirtualMachinePoolName}", + "RequestMediaTypes": [ + "application/json" + ], + "BufferResponse": true, + "LongRunning": { + "$id": "555", + "FinalStateVia": 0, + "FinalResponse": { + "$id": "556", + "StatusCodes": [ + 200 + ], + "BodyType": { + "$ref": "333" + }, + "BodyMediaType": "Json" + } + }, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Microsoft.StandbyPool.StandbyVirtualMachinePools.createOrUpdate", + "Decorators": [ + { + "$id": "557", + "name": "Azure.Core.@useFinalStateVia", + "arguments": { + "$id": "558", + "finalState": "azure-async-operation" + } + } + ], + "Examples": [ + { + "$id": "559", + "kind": "http", + "name": "StandbyVirtualMachinePools_CreateOrUpdate", + "description": "StandbyVirtualMachinePools_CreateOrUpdate", + "filePath": "2024-03-01/StandbyVirtualMachinePools_CreateOrUpdate.json", + "parameters": [ + { + "$id": "560", + "parameter": { + "$ref": "533" + }, + "value": { + "$id": "561", + "kind": "string", + "type": { + "$ref": "534" + }, + "value": "2024-03-01" + } + }, + { + "$id": "562", + "parameter": { + "$ref": "537" + }, + "value": { + "$id": "563", + "kind": "string", + "type": { + "$ref": "538" + }, + "value": "00000000-0000-0000-0000-000000000009" + } + }, + { + "$id": "564", + "parameter": { + "$ref": "540" + }, + "value": { + "$id": "565", + "kind": "string", + "type": { + "$ref": "541" + }, + "value": "rgstandbypool" + } + }, + { + "$id": "566", + "parameter": { + "$ref": "542" + }, + "value": { + "$id": "567", + "kind": "string", + "type": { + "$ref": "543" + }, + "value": "pool" + } + }, + { + "$id": "568", + "parameter": { + "$ref": "550" + }, + "value": { + "$id": "569", + "kind": "model", + "type": { + "$ref": "333" + }, + "value": { + "$id": "570", + "properties": { + "$id": "571", + "kind": "model", + "type": { + "$ref": "335" + }, + "value": { + "$id": "572", + "elasticityProfile": { + "$id": "573", + "kind": "model", + "type": { + "$ref": "337" + }, + "value": { + "$id": "574", + "maxReadyCapacity": { + "$id": "575", + "kind": "number", + "type": { + "$ref": "339" + }, + "value": 304 + }, + "minReadyCapacity": { + "$id": "576", + "kind": "number", + "type": { + "$ref": "343" + }, + "value": 300 + } + } + }, + "virtualMachineState": { + "$id": "577", + "kind": "string", + "type": { + "$ref": "34" + }, + "value": "Running" + }, + "attachedVirtualMachineScaleSetId": { + "$id": "578", + "kind": "string", + "type": { + "$ref": "352" + }, + "value": "/subscriptions/00000000-0000-0000-0000-000000000009/resourceGroups/rgstandbypool/providers/Microsoft.Compute/virtualMachineScaleSets/myVmss" + } + } + }, + "tags": { + "$id": "579", + "kind": "dict", + "type": { + "$ref": "173" + }, + "value": { + "$id": "580" + } + }, + "location": { + "$id": "581", + "kind": "string", + "type": { + "$ref": "179" + }, + "value": "West US" + } + } + } + } + ], + "responses": [ + { + "$id": "582", + "response": { + "$ref": "551" + }, + "statusCode": 200, + "bodyValue": { + "$id": "583", + "kind": "model", + "type": { + "$ref": "333" + }, + "value": { + "$id": "584", + "properties": { + "$id": "585", + "kind": "model", + "type": { + "$ref": "335" + }, + "value": { + "$id": "586", + "elasticityProfile": { + "$id": "587", + "kind": "model", + "type": { + "$ref": "337" + }, + "value": { + "$id": "588", + "maxReadyCapacity": { + "$id": "589", + "kind": "number", + "type": { + "$ref": "339" + }, + "value": 304 + }, + "minReadyCapacity": { + "$id": "590", + "kind": "number", + "type": { + "$ref": "343" + }, + "value": 300 + } + } + }, + "virtualMachineState": { + "$id": "591", + "kind": "string", + "type": { + "$ref": "34" + }, + "value": "Running" + }, + "attachedVirtualMachineScaleSetId": { + "$id": "592", + "kind": "string", + "type": { + "$ref": "352" + }, + "value": "/subscriptions/00000000-0000-0000-0000-000000000009/resourceGroups/rgstandbypool/providers/Microsoft.Compute/virtualMachineScaleSets/myVmss" + }, + "provisioningState": { + "$id": "593", + "kind": "string", + "type": { + "$ref": "2" + }, + "value": "Succeeded" + } + } + }, + "tags": { + "$id": "594", + "kind": "dict", + "type": { + "$ref": "173" + }, + "value": { + "$id": "595" + } + }, + "location": { + "$id": "596", + "kind": "string", + "type": { + "$ref": "179" + }, + "value": "West US" + }, + "id": { + "$id": "597", + "kind": "string", + "type": { + "$ref": "60" + }, + "value": "/subscriptions/00000000-0000-0000-0000-000000000009/resourceGroups/rgstandbypool/providers/Microsoft.StandbyPool/standbyVirtualMachinePools/pool" + }, + "name": { + "$id": "598", + "kind": "string", + "type": { + "$ref": "65" + }, + "value": "pool" + }, + "type": { + "$id": "599", + "kind": "string", + "type": { + "$ref": "69" + }, + "value": "Microsoft.StandbyPool/standbyVirtualMachinePools" + }, + "systemData": { + "$id": "600", + "kind": "model", + "type": { + "$ref": "74" + }, + "value": { + "$id": "601", + "createdBy": { + "$id": "602", + "kind": "string", + "type": { + "$ref": "76" + }, + "value": "pooluser@microsoft.com" + }, + "createdByType": { + "$id": "603", + "kind": "string", + "type": { + "$ref": "12" + }, + "value": "User" + }, + "createdAt": { + "$id": "604", + "kind": "string", + "type": { + "$ref": "83" + }, + "value": "2023-09-07T16:33:22.210Z" + }, + "lastModifiedBy": { + "$id": "605", + "kind": "string", + "type": { + "$ref": "88" + }, + "value": "pooluser@microsoft.com" + }, + "lastModifiedByType": { + "$id": "606", + "kind": "string", + "type": { + "$ref": "12" + }, + "value": "User" + }, + "lastModifiedAt": { + "$id": "607", + "kind": "string", + "type": { + "$ref": "95" + }, + "value": "2023-09-07T16:33:22.210Z" + } + } + } + } + } + }, + { + "$id": "608", + "response": { + "$ref": "552" + }, + "statusCode": 201, + "bodyValue": { + "$id": "609", + "kind": "model", + "type": { + "$ref": "333" + }, + "value": { + "$id": "610", + "properties": { + "$id": "611", + "kind": "model", + "type": { + "$ref": "335" + }, + "value": { + "$id": "612", + "elasticityProfile": { + "$id": "613", + "kind": "model", + "type": { + "$ref": "337" + }, + "value": { + "$id": "614", + "maxReadyCapacity": { + "$id": "615", + "kind": "number", + "type": { + "$ref": "339" + }, + "value": 304 + }, + "minReadyCapacity": { + "$id": "616", + "kind": "number", + "type": { + "$ref": "343" + }, + "value": 300 + } + } + }, + "virtualMachineState": { + "$id": "617", + "kind": "string", + "type": { + "$ref": "34" + }, + "value": "Running" + }, + "attachedVirtualMachineScaleSetId": { + "$id": "618", + "kind": "string", + "type": { + "$ref": "352" + }, + "value": "/subscriptions/00000000-0000-0000-0000-000000000009/resourceGroups/rgstandbypool/providers/Microsoft.Compute/virtualMachineScaleSets/myVmss" + }, + "provisioningState": { + "$id": "619", + "kind": "string", + "type": { + "$ref": "2" + }, + "value": "Succeeded" + } + } + }, + "tags": { + "$id": "620", + "kind": "dict", + "type": { + "$ref": "173" + }, + "value": { + "$id": "621" + } + }, + "location": { + "$id": "622", + "kind": "string", + "type": { + "$ref": "179" + }, + "value": "West US" + }, + "id": { + "$id": "623", + "kind": "string", + "type": { + "$ref": "60" + }, + "value": "/subscriptions/00000000-0000-0000-0000-000000000009/resourceGroups/rgstandbypool/providers/Microsoft.StandbyPool/standbyVirtualMachinePools/pool" + }, + "name": { + "$id": "624", + "kind": "string", + "type": { + "$ref": "65" + }, + "value": "pool" + }, + "type": { + "$id": "625", + "kind": "string", + "type": { + "$ref": "69" + }, + "value": "Microsoft.StandbyPool/standbyVirtualMachinePools" + }, + "systemData": { + "$id": "626", + "kind": "model", + "type": { + "$ref": "74" + }, + "value": { + "$id": "627", + "createdBy": { + "$id": "628", + "kind": "string", + "type": { + "$ref": "76" + }, + "value": "pooluser@microsoft.com" + }, + "createdByType": { + "$id": "629", + "kind": "string", + "type": { + "$ref": "12" + }, + "value": "User" + }, + "createdAt": { + "$id": "630", + "kind": "string", + "type": { + "$ref": "83" + }, + "value": "2023-09-07T16:33:22.210Z" + }, + "lastModifiedBy": { + "$id": "631", + "kind": "string", + "type": { + "$ref": "88" + }, + "value": "pooluser@microsoft.com" + }, + "lastModifiedByType": { + "$id": "632", + "kind": "string", + "type": { + "$ref": "12" + }, + "value": "User" + }, + "lastModifiedAt": { + "$id": "633", + "kind": "string", + "type": { + "$ref": "95" + }, + "value": "2023-09-07T16:33:22.210Z" + } + } + } + } + } + } + ] + } + ] + }, + { + "$id": "634", + "Name": "delete", + "ResourceName": "StandbyVirtualMachinePoolResource", + "Doc": "Delete a StandbyVirtualMachinePoolResource", + "Accessibility": "public", + "Parameters": [ + { + "$id": "635", + "Name": "apiVersion", + "NameInRequest": "api-version", + "Doc": "The API version to use for this operation.", + "Type": { + "$id": "636", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": true, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "DefaultValue": { + "$id": "637", + "Type": { + "$id": "638", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "2024-03-01" + }, + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "639", + "Name": "subscriptionId", + "NameInRequest": "subscriptionId", + "Doc": "The ID of the target subscription. The value must be an UUID.", + "Type": { + "$id": "640", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "641", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "642", + "Name": "resourceGroupName", + "NameInRequest": "resourceGroupName", + "Doc": "The name of the resource group. The name is case insensitive.", + "Type": { + "$id": "643", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "644", + "Name": "standbyVirtualMachinePoolName", + "NameInRequest": "standbyVirtualMachinePoolName", + "Doc": "Name of the standby virtual machine pool", + "Type": { + "$id": "645", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "646", + "Name": "accept", + "NameInRequest": "Accept", + "Type": { + "$id": "647", + "kind": "constant", + "valueType": { + "$id": "648", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "649", + "StatusCodes": [ + 202 + ], + "BodyMediaType": "Json", + "Headers": [ + { + "$id": "650", + "Name": "location", + "NameInResponse": "Location", + "Doc": "The Location header contains the URL where the status of the long running operation can be checked.", + "Type": { + "$id": "651", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + } + }, + { + "$id": "652", + "Name": "retryAfter", + "NameInResponse": "Retry-After", + "Doc": "The Retry-After header can indicate how long the client should wait before polling the operation status.", + "Type": { + "$id": "653", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + } + } + ], + "IsErrorResponse": false + }, + { + "$id": "654", + "StatusCodes": [ + 204 + ], + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false + } + ], + "HttpMethod": "DELETE", + "RequestBodyMediaType": "None", + "Uri": "{endpoint}", + "Path": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StandbyPool/standbyVirtualMachinePools/{standbyVirtualMachinePoolName}", + "BufferResponse": true, + "LongRunning": { + "$id": "655", + "FinalStateVia": 1, + "FinalResponse": { + "$id": "656", + "StatusCodes": [ + 204 + ], + "BodyMediaType": "Json" + } + }, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Microsoft.StandbyPool.StandbyVirtualMachinePools.delete", + "Decorators": [], + "Examples": [ + { + "$id": "657", + "kind": "http", + "name": "StandbyVirtualMachinePools_Delete", + "description": "StandbyVirtualMachinePools_Delete", + "filePath": "2024-03-01/StandbyVirtualMachinePools_Delete.json", + "parameters": [ + { + "$id": "658", + "parameter": { + "$ref": "635" + }, + "value": { + "$id": "659", + "kind": "string", + "type": { + "$ref": "636" + }, + "value": "2024-03-01" + } + }, + { + "$id": "660", + "parameter": { + "$ref": "639" + }, + "value": { + "$id": "661", + "kind": "string", + "type": { + "$ref": "640" + }, + "value": "00000000-0000-0000-0000-000000000009" + } + }, + { + "$id": "662", + "parameter": { + "$ref": "642" + }, + "value": { + "$id": "663", + "kind": "string", + "type": { + "$ref": "643" + }, + "value": "rgstandbypool" + } + }, + { + "$id": "664", + "parameter": { + "$ref": "644" + }, + "value": { + "$id": "665", + "kind": "string", + "type": { + "$ref": "645" + }, + "value": "pool" + } + } + ], + "responses": [ + { + "$id": "666", + "response": { + "$ref": "649" + }, + "statusCode": 202 + }, + { + "$id": "667", + "response": { + "$ref": "654" + }, + "statusCode": 204 + } + ] + } + ] + }, + { + "$id": "668", + "Name": "update", + "ResourceName": "StandbyVirtualMachinePoolResource", + "Doc": "Update a StandbyVirtualMachinePoolResource", + "Accessibility": "public", + "Parameters": [ + { + "$id": "669", + "Name": "apiVersion", + "NameInRequest": "api-version", + "Doc": "The API version to use for this operation.", + "Type": { + "$id": "670", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": true, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "DefaultValue": { + "$id": "671", + "Type": { + "$id": "672", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "2024-03-01" + }, + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "673", + "Name": "subscriptionId", + "NameInRequest": "subscriptionId", + "Doc": "The ID of the target subscription. The value must be an UUID.", + "Type": { + "$id": "674", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "675", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "676", + "Name": "resourceGroupName", + "NameInRequest": "resourceGroupName", + "Doc": "The name of the resource group. The name is case insensitive.", + "Type": { + "$id": "677", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "678", + "Name": "standbyVirtualMachinePoolName", + "NameInRequest": "standbyVirtualMachinePoolName", + "Doc": "Name of the standby virtual machine pool", + "Type": { + "$id": "679", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "680", + "Name": "contentType", + "NameInRequest": "Content-Type", + "Doc": "Body parameter's content type. Known values are application/json", + "Type": { + "$id": "681", + "kind": "constant", + "valueType": { + "$id": "682", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": true, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "683", + "Name": "accept", + "NameInRequest": "Accept", + "Type": { + "$id": "684", + "kind": "constant", + "valueType": { + "$id": "685", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "686", + "Name": "properties", + "NameInRequest": "properties", + "Doc": "The resource properties to be updated.", + "Type": { + "$ref": "361" + }, + "Location": "Body", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "687", + "StatusCodes": [ + 200 + ], + "BodyType": { + "$ref": "333" + }, + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false, + "ContentTypes": [ + "application/json" + ] + } + ], + "HttpMethod": "PATCH", + "RequestBodyMediaType": "Json", + "Uri": "{endpoint}", + "Path": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StandbyPool/standbyVirtualMachinePools/{standbyVirtualMachinePoolName}", + "RequestMediaTypes": [ + "application/json" + ], + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": false, + "CrossLanguageDefinitionId": "Microsoft.StandbyPool.StandbyVirtualMachinePools.update", + "Decorators": [], + "Examples": [ + { + "$id": "688", + "kind": "http", + "name": "StandbyVirtualMachinePools_Update", + "description": "StandbyVirtualMachinePools_Update", + "filePath": "2024-03-01/StandbyVirtualMachinePools_Update.json", + "parameters": [ + { + "$id": "689", + "parameter": { + "$ref": "669" + }, + "value": { + "$id": "690", + "kind": "string", + "type": { + "$ref": "670" + }, + "value": "2024-03-01" + } + }, + { + "$id": "691", + "parameter": { + "$ref": "673" + }, + "value": { + "$id": "692", + "kind": "string", + "type": { + "$ref": "674" + }, + "value": "00000000-0000-0000-0000-000000000009" + } + }, + { + "$id": "693", + "parameter": { + "$ref": "676" + }, + "value": { + "$id": "694", + "kind": "string", + "type": { + "$ref": "677" + }, + "value": "rgstandbypool" + } + }, + { + "$id": "695", + "parameter": { + "$ref": "678" + }, + "value": { + "$id": "696", + "kind": "string", + "type": { + "$ref": "679" + }, + "value": "pool" + } + }, + { + "$id": "697", + "parameter": { + "$ref": "686" + }, + "value": { + "$id": "698", + "kind": "model", + "type": { + "$ref": "361" + }, + "value": { + "$id": "699", + "tags": { + "$id": "700", + "kind": "dict", + "type": { + "$ref": "363" + }, + "value": { + "$id": "701" + } + }, + "properties": { + "$id": "702", + "kind": "model", + "type": { + "$ref": "369" + }, + "value": { + "$id": "703", + "elasticityProfile": { + "$id": "704", + "kind": "model", + "type": { + "$ref": "337" + }, + "value": { + "$id": "705", + "maxReadyCapacity": { + "$id": "706", + "kind": "number", + "type": { + "$ref": "339" + }, + "value": 304 + }, + "minReadyCapacity": { + "$id": "707", + "kind": "number", + "type": { + "$ref": "343" + }, + "value": 300 + } + } + }, + "virtualMachineState": { + "$id": "708", + "kind": "string", + "type": { + "$ref": "34" + }, + "value": "Running" + }, + "attachedVirtualMachineScaleSetId": { + "$id": "709", + "kind": "string", + "type": { + "$ref": "377" + }, + "value": "/subscriptions/00000000-0000-0000-0000-000000000009/resourceGroups/rgstandbypool/providers/Microsoft.Compute/virtualMachineScaleSets/myVmss" + } + } + } + } + } + } + ], + "responses": [ + { + "$id": "710", + "response": { + "$ref": "687" + }, + "statusCode": 200, + "bodyValue": { + "$id": "711", + "kind": "model", + "type": { + "$ref": "333" + }, + "value": { + "$id": "712", + "properties": { + "$id": "713", + "kind": "model", + "type": { + "$ref": "335" + }, + "value": { + "$id": "714", + "elasticityProfile": { + "$id": "715", + "kind": "model", + "type": { + "$ref": "337" + }, + "value": { + "$id": "716", + "maxReadyCapacity": { + "$id": "717", + "kind": "number", + "type": { + "$ref": "339" + }, + "value": 304 + }, + "minReadyCapacity": { + "$id": "718", + "kind": "number", + "type": { + "$ref": "343" + }, + "value": 300 + } + } + }, + "virtualMachineState": { + "$id": "719", + "kind": "string", + "type": { + "$ref": "34" + }, + "value": "Running" + }, + "attachedVirtualMachineScaleSetId": { + "$id": "720", + "kind": "string", + "type": { + "$ref": "352" + }, + "value": "/subscriptions/00000000-0000-0000-0000-000000000009/resourceGroups/rgstandbypool/providers/Microsoft.Compute/virtualMachineScaleSets/myVmss" + }, + "provisioningState": { + "$id": "721", + "kind": "string", + "type": { + "$ref": "2" + }, + "value": "Succeeded" + } + } + }, + "tags": { + "$id": "722", + "kind": "dict", + "type": { + "$ref": "173" + }, + "value": { + "$id": "723" + } + }, + "location": { + "$id": "724", + "kind": "string", + "type": { + "$ref": "179" + }, + "value": "West US" + }, + "id": { + "$id": "725", + "kind": "string", + "type": { + "$ref": "60" + }, + "value": "/subscriptions/00000000-0000-0000-0000-000000000009/resourceGroups/rgstandbypool/providers/Microsoft.StandbyPool/standbyVirtualMachinePools/pool" + }, + "name": { + "$id": "726", + "kind": "string", + "type": { + "$ref": "65" + }, + "value": "pool" + }, + "type": { + "$id": "727", + "kind": "string", + "type": { + "$ref": "69" + }, + "value": "Microsoft.StandbyPool/standbyVirtualMachinePools" + }, + "systemData": { + "$id": "728", + "kind": "model", + "type": { + "$ref": "74" + }, + "value": { + "$id": "729", + "createdBy": { + "$id": "730", + "kind": "string", + "type": { + "$ref": "76" + }, + "value": "pooluser@microsoft.com" + }, + "createdByType": { + "$id": "731", + "kind": "string", + "type": { + "$ref": "12" + }, + "value": "User" + }, + "createdAt": { + "$id": "732", + "kind": "string", + "type": { + "$ref": "83" + }, + "value": "2023-09-07T16:33:22.210Z" + }, + "lastModifiedBy": { + "$id": "733", + "kind": "string", + "type": { + "$ref": "88" + }, + "value": "pooluser@microsoft.com" + }, + "lastModifiedByType": { + "$id": "734", + "kind": "string", + "type": { + "$ref": "12" + }, + "value": "User" + }, + "lastModifiedAt": { + "$id": "735", + "kind": "string", + "type": { + "$ref": "95" + }, + "value": "2023-09-07T16:33:22.210Z" + } + } + } + } + } + } + ] + } + ] + }, + { + "$id": "736", + "Name": "listByResourceGroup", + "ResourceName": "StandbyVirtualMachinePoolResource", + "Doc": "List StandbyVirtualMachinePoolResource resources by resource group", + "Accessibility": "public", + "Parameters": [ + { + "$id": "737", + "Name": "apiVersion", + "NameInRequest": "api-version", + "Doc": "The API version to use for this operation.", + "Type": { + "$id": "738", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": true, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "DefaultValue": { + "$id": "739", + "Type": { + "$id": "740", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "2024-03-01" + }, + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "741", + "Name": "subscriptionId", + "NameInRequest": "subscriptionId", + "Doc": "The ID of the target subscription. The value must be an UUID.", + "Type": { + "$id": "742", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "743", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "744", + "Name": "resourceGroupName", + "NameInRequest": "resourceGroupName", + "Doc": "The name of the resource group. The name is case insensitive.", + "Type": { + "$id": "745", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "746", + "Name": "accept", + "NameInRequest": "Accept", + "Type": { + "$id": "747", + "kind": "constant", + "valueType": { + "$id": "748", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "749", + "StatusCodes": [ + 200 + ], + "BodyType": { + "$ref": "383" + }, + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false, + "ContentTypes": [ + "application/json" + ] + } + ], + "HttpMethod": "GET", + "RequestBodyMediaType": "None", + "Uri": "{endpoint}", + "Path": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StandbyPool/standbyVirtualMachinePools", + "BufferResponse": true, + "Paging": { + "$id": "750", + "ItemName": "value", + "NextLinkName": "nextLink" + }, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Microsoft.StandbyPool.StandbyVirtualMachinePools.listByResourceGroup", + "Decorators": [], + "Examples": [ + { + "$id": "751", + "kind": "http", + "name": "StandbyVirtualMachinePools_ListByResourceGroup", + "description": "StandbyVirtualMachinePools_ListByResourceGroup", + "filePath": "2024-03-01/StandbyVirtualMachinePools_ListByResourceGroup.json", + "parameters": [ + { + "$id": "752", + "parameter": { + "$ref": "737" + }, + "value": { + "$id": "753", + "kind": "string", + "type": { + "$ref": "738" + }, + "value": "2024-03-01" + } + }, + { + "$id": "754", + "parameter": { + "$ref": "741" + }, + "value": { + "$id": "755", + "kind": "string", + "type": { + "$ref": "742" + }, + "value": "00000000-0000-0000-0000-000000000009" + } + }, + { + "$id": "756", + "parameter": { + "$ref": "744" + }, + "value": { + "$id": "757", + "kind": "string", + "type": { + "$ref": "745" + }, + "value": "rgstandbypool" + } + } + ], + "responses": [ + { + "$id": "758", + "response": { + "$ref": "749" + }, + "statusCode": 200, + "bodyValue": { + "$id": "759", + "kind": "model", + "type": { + "$ref": "383" + }, + "value": { + "$id": "760", + "value": { + "$id": "761", + "kind": "array", + "type": { + "$ref": "385" + }, + "value": [ + { + "$id": "762", + "kind": "model", + "type": { + "$ref": "333" + }, + "value": { + "$id": "763", + "properties": { + "$id": "764", + "kind": "model", + "type": { + "$ref": "335" + }, + "value": { + "$id": "765", + "elasticityProfile": { + "$id": "766", + "kind": "model", + "type": { + "$ref": "337" + }, + "value": { + "$id": "767", + "maxReadyCapacity": { + "$id": "768", + "kind": "number", + "type": { + "$ref": "339" + }, + "value": 304 + } + } + }, + "virtualMachineState": { + "$id": "769", + "kind": "string", + "type": { + "$ref": "34" + }, + "value": "Running" + }, + "attachedVirtualMachineScaleSetId": { + "$id": "770", + "kind": "string", + "type": { + "$ref": "352" + }, + "value": "/subscriptions/00000000-0000-0000-0000-000000000009/resourceGroups/rgstandbypool/providers/Microsoft.Compute/virtualMachineScaleSets/myVmss" + }, + "provisioningState": { + "$id": "771", + "kind": "string", + "type": { + "$ref": "2" + }, + "value": "Succeeded" + } + } + }, + "tags": { + "$id": "772", + "kind": "dict", + "type": { + "$ref": "173" + }, + "value": { + "$id": "773" + } + }, + "location": { + "$id": "774", + "kind": "string", + "type": { + "$ref": "179" + }, + "value": "West US" + }, + "id": { + "$id": "775", + "kind": "string", + "type": { + "$ref": "60" + }, + "value": "/subscriptions/00000000-0000-0000-0000-000000000009/resourceGroups/rgstandbypool/providers/Microsoft.StandbyPool/standbyVirtualMachinePools/pool" + }, + "name": { + "$id": "776", + "kind": "string", + "type": { + "$ref": "65" + }, + "value": "pool" + }, + "type": { + "$id": "777", + "kind": "string", + "type": { + "$ref": "69" + }, + "value": "Microsoft.StandbyPool/standbyVirtualMachinePools" + }, + "systemData": { + "$id": "778", + "kind": "model", + "type": { + "$ref": "74" + }, + "value": { + "$id": "779", + "createdBy": { + "$id": "780", + "kind": "string", + "type": { + "$ref": "76" + }, + "value": "pooluser@microsoft.com" + }, + "createdByType": { + "$id": "781", + "kind": "string", + "type": { + "$ref": "12" + }, + "value": "User" + }, + "createdAt": { + "$id": "782", + "kind": "string", + "type": { + "$ref": "83" + }, + "value": "2023-09-07T16:33:22.210Z" + }, + "lastModifiedBy": { + "$id": "783", + "kind": "string", + "type": { + "$ref": "88" + }, + "value": "pooluser@microsoft.com" + }, + "lastModifiedByType": { + "$id": "784", + "kind": "string", + "type": { + "$ref": "12" + }, + "value": "User" + }, + "lastModifiedAt": { + "$id": "785", + "kind": "string", + "type": { + "$ref": "95" + }, + "value": "2023-09-07T16:33:22.210Z" + } + } + } + } + } + ] + }, + "nextLink": { + "$id": "786", + "kind": "string", + "type": { + "$ref": "389" + }, + "value": "https://example.com/subscriptions/00000000-0000-0000-0000-000000000009/resourceGroups/rgstandbypool/providers/Microsoft.StandbyPool/standbyVirtualMachinePools" + } + } + } + } + ] + } + ] + }, + { + "$id": "787", + "Name": "listBySubscription", + "ResourceName": "StandbyVirtualMachinePoolResource", + "Doc": "List StandbyVirtualMachinePoolResource resources by subscription ID", + "Accessibility": "public", + "Parameters": [ + { + "$id": "788", + "Name": "apiVersion", + "NameInRequest": "api-version", + "Doc": "The API version to use for this operation.", + "Type": { + "$id": "789", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": true, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "DefaultValue": { + "$id": "790", + "Type": { + "$id": "791", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "2024-03-01" + }, + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "792", + "Name": "subscriptionId", + "NameInRequest": "subscriptionId", + "Doc": "The ID of the target subscription. The value must be an UUID.", + "Type": { + "$id": "793", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "794", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "795", + "Name": "accept", + "NameInRequest": "Accept", + "Type": { + "$id": "796", + "kind": "constant", + "valueType": { + "$id": "797", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "798", + "StatusCodes": [ + 200 + ], + "BodyType": { + "$ref": "383" + }, + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false, + "ContentTypes": [ + "application/json" + ] + } + ], + "HttpMethod": "GET", + "RequestBodyMediaType": "None", + "Uri": "{endpoint}", + "Path": "/subscriptions/{subscriptionId}/providers/Microsoft.StandbyPool/standbyVirtualMachinePools", + "BufferResponse": true, + "Paging": { + "$id": "799", + "ItemName": "value", + "NextLinkName": "nextLink" + }, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Microsoft.StandbyPool.StandbyVirtualMachinePools.listBySubscription", + "Decorators": [], + "Examples": [ + { + "$id": "800", + "kind": "http", + "name": "StandbyVirtualMachinePools_ListBySubscription", + "description": "StandbyVirtualMachinePools_ListBySubscription", + "filePath": "2024-03-01/StandbyVirtualMachinePools_ListBySubscription.json", + "parameters": [ + { + "$id": "801", + "parameter": { + "$ref": "788" + }, + "value": { + "$id": "802", + "kind": "string", + "type": { + "$ref": "789" + }, + "value": "2024-03-01" + } + }, + { + "$id": "803", + "parameter": { + "$ref": "792" + }, + "value": { + "$id": "804", + "kind": "string", + "type": { + "$ref": "793" + }, + "value": "00000000-0000-0000-0000-000000000009" + } + } + ], + "responses": [ + { + "$id": "805", + "response": { + "$ref": "798" + }, + "statusCode": 200, + "bodyValue": { + "$id": "806", + "kind": "model", + "type": { + "$ref": "383" + }, + "value": { + "$id": "807", + "value": { + "$id": "808", + "kind": "array", + "type": { + "$ref": "385" + }, + "value": [ + { + "$id": "809", + "kind": "model", + "type": { + "$ref": "333" + }, + "value": { + "$id": "810", + "properties": { + "$id": "811", + "kind": "model", + "type": { + "$ref": "335" + }, + "value": { + "$id": "812", + "elasticityProfile": { + "$id": "813", + "kind": "model", + "type": { + "$ref": "337" + }, + "value": { + "$id": "814", + "maxReadyCapacity": { + "$id": "815", + "kind": "number", + "type": { + "$ref": "339" + }, + "value": 304 + }, + "minReadyCapacity": { + "$id": "816", + "kind": "number", + "type": { + "$ref": "343" + }, + "value": 300 + } + } + }, + "virtualMachineState": { + "$id": "817", + "kind": "string", + "type": { + "$ref": "34" + }, + "value": "Running" + }, + "attachedVirtualMachineScaleSetId": { + "$id": "818", + "kind": "string", + "type": { + "$ref": "352" + }, + "value": "/subscriptions/00000000-0000-0000-0000-000000000009/resourceGroups/rgstandbypool/providers/Microsoft.Compute/virtualMachineScaleSets/myVmss" + }, + "provisioningState": { + "$id": "819", + "kind": "string", + "type": { + "$ref": "2" + }, + "value": "Succeeded" + } + } + }, + "tags": { + "$id": "820", + "kind": "dict", + "type": { + "$ref": "173" + }, + "value": { + "$id": "821" + } + }, + "location": { + "$id": "822", + "kind": "string", + "type": { + "$ref": "179" + }, + "value": "West US" + }, + "id": { + "$id": "823", + "kind": "string", + "type": { + "$ref": "60" + }, + "value": "/subscriptions/00000000-0000-0000-0000-000000000009/resourceGroups/rgstandbypool/providers/Microsoft.StandbyPool/standbyVirtualMachinePools/pool" + }, + "name": { + "$id": "824", + "kind": "string", + "type": { + "$ref": "65" + }, + "value": "pool" + }, + "type": { + "$id": "825", + "kind": "string", + "type": { + "$ref": "69" + }, + "value": "Microsoft.StandbyPool/standbyVirtualMachinePools" + }, + "systemData": { + "$id": "826", + "kind": "model", + "type": { + "$ref": "74" + }, + "value": { + "$id": "827", + "createdBy": { + "$id": "828", + "kind": "string", + "type": { + "$ref": "76" + }, + "value": "pooluser@microsoft.com" + }, + "createdByType": { + "$id": "829", + "kind": "string", + "type": { + "$ref": "12" + }, + "value": "User" + }, + "createdAt": { + "$id": "830", + "kind": "string", + "type": { + "$ref": "83" + }, + "value": "2023-09-07T16:33:22.210Z" + }, + "lastModifiedBy": { + "$id": "831", + "kind": "string", + "type": { + "$ref": "88" + }, + "value": "pooluser@microsoft.com" + }, + "lastModifiedByType": { + "$id": "832", + "kind": "string", + "type": { + "$ref": "12" + }, + "value": "User" + }, + "lastModifiedAt": { + "$id": "833", + "kind": "string", + "type": { + "$ref": "95" + }, + "value": "2023-09-07T16:33:22.210Z" + } + } + } + } + } + ] + }, + "nextLink": { + "$id": "834", + "kind": "string", + "type": { + "$ref": "389" + }, + "value": "https://example.com/subscriptions/00000000-0000-0000-0000-000000000009/resourceGroups/rgstandbypool/providers/Microsoft.StandbyPool/standbyVirtualMachinePools" + } + } + } + } + ] + } + ] + } + ], + "Protocol": { + "$id": "835" + }, + "Parent": "StandbyPoolClient", + "Parameters": [ + { + "$id": "836", + "Name": "endpoint", + "NameInRequest": "endpoint", + "Doc": "Service host", + "Type": { + "$id": "837", + "kind": "url", + "name": "url", + "crossLanguageDefinitionId": "TypeSpec.url" + }, + "Location": "Uri", + "IsApiVersion": false, + "IsResourceParameter": false, + "IsContentType": false, + "IsRequired": true, + "IsEndpoint": true, + "SkipUrlEncoding": false, + "Explode": false, + "Kind": "Client", + "DefaultValue": { + "$id": "838", + "Type": { + "$id": "839", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "https://management.azure.com" + } + } + ], + "Decorators": [] + }, + { + "$id": "840", + "Name": "StandbyVirtualMachines", + "ClientNamespace": "Microsoft.StandbyPool", + "Operations": [ + { + "$id": "841", + "Name": "get", + "ResourceName": "StandbyVirtualMachineResource", + "Doc": "Get a StandbyVirtualMachineResource", + "Accessibility": "public", + "Parameters": [ + { + "$id": "842", + "Name": "apiVersion", + "NameInRequest": "api-version", + "Doc": "The API version to use for this operation.", + "Type": { + "$id": "843", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": true, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "DefaultValue": { + "$id": "844", + "Type": { + "$id": "845", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "2024-03-01" + }, + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "846", + "Name": "subscriptionId", + "NameInRequest": "subscriptionId", + "Doc": "The ID of the target subscription. The value must be an UUID.", + "Type": { + "$id": "847", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "848", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "849", + "Name": "resourceGroupName", + "NameInRequest": "resourceGroupName", + "Doc": "The name of the resource group. The name is case insensitive.", + "Type": { + "$id": "850", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "851", + "Name": "standbyVirtualMachinePoolName", + "NameInRequest": "standbyVirtualMachinePoolName", + "Doc": "Name of the standby virtual machine pool", + "Type": { + "$id": "852", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "853", + "Name": "standbyVirtualMachineName", + "NameInRequest": "standbyVirtualMachineName", + "Doc": "Name of the standby virtual machine", + "Type": { + "$id": "854", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "855", + "Name": "accept", + "NameInRequest": "Accept", + "Type": { + "$id": "856", + "kind": "constant", + "valueType": { + "$id": "857", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "858", + "StatusCodes": [ + 200 + ], + "BodyType": { + "$ref": "310" + }, + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false, + "ContentTypes": [ + "application/json" + ] + } + ], + "HttpMethod": "GET", + "RequestBodyMediaType": "None", + "Uri": "{endpoint}", + "Path": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StandbyPool/standbyVirtualMachinePools/{standbyVirtualMachinePoolName}/standbyVirtualMachines/{standbyVirtualMachineName}", + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Microsoft.StandbyPool.StandbyVirtualMachines.get", + "Decorators": [], + "Examples": [ + { + "$id": "859", + "kind": "http", + "name": "StandbyVirtualMachines_Get", + "description": "StandbyVirtualMachines_Get", + "filePath": "2024-03-01/StandbyVirtualMachines_Get.json", + "parameters": [ + { + "$id": "860", + "parameter": { + "$ref": "842" + }, + "value": { + "$id": "861", + "kind": "string", + "type": { + "$ref": "843" + }, + "value": "2024-03-01" + } + }, + { + "$id": "862", + "parameter": { + "$ref": "846" + }, + "value": { + "$id": "863", + "kind": "string", + "type": { + "$ref": "847" + }, + "value": "00000000-0000-0000-0000-000000000009" + } + }, + { + "$id": "864", + "parameter": { + "$ref": "849" + }, + "value": { + "$id": "865", + "kind": "string", + "type": { + "$ref": "850" + }, + "value": "rgstandbypool" + } + }, + { + "$id": "866", + "parameter": { + "$ref": "851" + }, + "value": { + "$id": "867", + "kind": "string", + "type": { + "$ref": "852" + }, + "value": "pool" + } + }, + { + "$id": "868", + "parameter": { + "$ref": "853" + }, + "value": { + "$id": "869", + "kind": "string", + "type": { + "$ref": "854" + }, + "value": "virtualMachine" + } + } + ], + "responses": [ + { + "$id": "870", + "response": { + "$ref": "858" + }, + "statusCode": 200, + "bodyValue": { + "$id": "871", + "kind": "model", + "type": { + "$ref": "310" + }, + "value": { + "$id": "872", + "properties": { + "$id": "873", + "kind": "model", + "type": { + "$ref": "312" + }, + "value": { + "$id": "874", + "virtualMachineResourceId": { + "$id": "875", + "kind": "string", + "type": { + "$ref": "314" + }, + "value": "/subscriptions/00000000-0000-0000-0000-000000000009/resourceGroups/rgstandbypool/providers/Microsoft.Compute/virtualMachines/virtualMachine" + }, + "provisioningState": { + "$id": "876", + "kind": "string", + "type": { + "$ref": "2" + }, + "value": "Succeeded" + } + } + }, + "id": { + "$id": "877", + "kind": "string", + "type": { + "$ref": "60" + }, + "value": "/subscriptions/00000000-0000-0000-0000-000000000009/resourceGroups/rgstandbypool/providers/Microsoft.StandbyPool/standbyVirtualMachinePools/pool/standbyVirtualMachines/virtualMachine" + }, + "name": { + "$id": "878", + "kind": "string", + "type": { + "$ref": "65" + }, + "value": "pool" + }, + "type": { + "$id": "879", + "kind": "string", + "type": { + "$ref": "69" + }, + "value": "Microsoft.StandbyPool/standbyVirtualMachinePools/virtualMachines" + }, + "systemData": { + "$id": "880", + "kind": "model", + "type": { + "$ref": "74" + }, + "value": { + "$id": "881", + "createdBy": { + "$id": "882", + "kind": "string", + "type": { + "$ref": "76" + }, + "value": "pooluser@microsoft.com" + }, + "createdByType": { + "$id": "883", + "kind": "string", + "type": { + "$ref": "12" + }, + "value": "User" + }, + "createdAt": { + "$id": "884", + "kind": "string", + "type": { + "$ref": "83" + }, + "value": "2023-09-07T16:33:22.210Z" + }, + "lastModifiedBy": { + "$id": "885", + "kind": "string", + "type": { + "$ref": "88" + }, + "value": "pooluser@microsoft.com" + }, + "lastModifiedByType": { + "$id": "886", + "kind": "string", + "type": { + "$ref": "12" + }, + "value": "User" + }, + "lastModifiedAt": { + "$id": "887", + "kind": "string", + "type": { + "$ref": "95" + }, + "value": "2023-09-07T16:33:22.210Z" + } + } + } + } + } + } + ] + } + ] + }, + { + "$id": "888", + "Name": "listByStandbyVirtualMachinePoolResource", + "ResourceName": "StandbyVirtualMachineResource", + "Doc": "List StandbyVirtualMachineResource resources by StandbyVirtualMachinePoolResource", + "Accessibility": "public", + "Parameters": [ + { + "$id": "889", + "Name": "apiVersion", + "NameInRequest": "api-version", + "Doc": "The API version to use for this operation.", + "Type": { + "$id": "890", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": true, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "DefaultValue": { + "$id": "891", + "Type": { + "$id": "892", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "2024-03-01" + }, + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "893", + "Name": "subscriptionId", + "NameInRequest": "subscriptionId", + "Doc": "The ID of the target subscription. The value must be an UUID.", + "Type": { + "$id": "894", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "895", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "896", + "Name": "resourceGroupName", + "NameInRequest": "resourceGroupName", + "Doc": "The name of the resource group. The name is case insensitive.", + "Type": { + "$id": "897", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "898", + "Name": "standbyVirtualMachinePoolName", + "NameInRequest": "standbyVirtualMachinePoolName", + "Doc": "Name of the standby virtual machine pool", + "Type": { + "$id": "899", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "900", + "Name": "accept", + "NameInRequest": "Accept", + "Type": { + "$id": "901", + "kind": "constant", + "valueType": { + "$id": "902", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "903", + "StatusCodes": [ + 200 + ], + "BodyType": { + "$ref": "323" + }, + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false, + "ContentTypes": [ + "application/json" + ] + } + ], + "HttpMethod": "GET", + "RequestBodyMediaType": "None", + "Uri": "{endpoint}", + "Path": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StandbyPool/standbyVirtualMachinePools/{standbyVirtualMachinePoolName}/standbyVirtualMachines", + "BufferResponse": true, + "Paging": { + "$id": "904", + "ItemName": "value", + "NextLinkName": "nextLink" + }, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Microsoft.StandbyPool.StandbyVirtualMachines.listByStandbyVirtualMachinePoolResource", + "Decorators": [], + "Examples": [ + { + "$id": "905", + "kind": "http", + "name": "StandbyVirtualMachines_ListByStandbyVirtualMachinePoolResource", + "description": "StandbyVirtualMachines_ListByStandbyVirtualMachinePoolResource", + "filePath": "2024-03-01/StandbyVirtualMachines_ListByStandbyVirtualMachinePoolResource.json", + "parameters": [ + { + "$id": "906", + "parameter": { + "$ref": "889" + }, + "value": { + "$id": "907", + "kind": "string", + "type": { + "$ref": "890" + }, + "value": "2024-03-01" + } + }, + { + "$id": "908", + "parameter": { + "$ref": "893" + }, + "value": { + "$id": "909", + "kind": "string", + "type": { + "$ref": "894" + }, + "value": "00000000-0000-0000-0000-000000000009" + } + }, + { + "$id": "910", + "parameter": { + "$ref": "896" + }, + "value": { + "$id": "911", + "kind": "string", + "type": { + "$ref": "897" + }, + "value": "rgstandbypool" + } + }, + { + "$id": "912", + "parameter": { + "$ref": "898" + }, + "value": { + "$id": "913", + "kind": "string", + "type": { + "$ref": "899" + }, + "value": "pool" + } + } + ], + "responses": [ + { + "$id": "914", + "response": { + "$ref": "903" + }, + "statusCode": 200, + "bodyValue": { + "$id": "915", + "kind": "model", + "type": { + "$ref": "323" + }, + "value": { + "$id": "916", + "value": { + "$id": "917", + "kind": "array", + "type": { + "$ref": "325" + }, + "value": [ + { + "$id": "918", + "kind": "model", + "type": { + "$ref": "310" + }, + "value": { + "$id": "919", + "properties": { + "$id": "920", + "kind": "model", + "type": { + "$ref": "312" + }, + "value": { + "$id": "921", + "virtualMachineResourceId": { + "$id": "922", + "kind": "string", + "type": { + "$ref": "314" + }, + "value": "/subscriptions/00000000-0000-0000-0000-000000000009/resourceGroups/rgstandbypool/providers/Microsoft.Compute/virtualMachines/virtualMachine" + }, + "provisioningState": { + "$id": "923", + "kind": "string", + "type": { + "$ref": "2" + }, + "value": "Succeeded" + } + } + }, + "id": { + "$id": "924", + "kind": "string", + "type": { + "$ref": "60" + }, + "value": "/subscriptions/00000000-0000-0000-0000-000000000009/resourceGroups/rgstandbypool/providers/Microsoft.StandbyPool/standbyVirtualMachinePools/pool/standbyVirtualMachines/virtualMachine" + }, + "name": { + "$id": "925", + "kind": "string", + "type": { + "$ref": "65" + }, + "value": "pool" + }, + "type": { + "$id": "926", + "kind": "string", + "type": { + "$ref": "69" + }, + "value": "Microsoft.StandbyPool/standbyVirtualMachinePools/virtualMachines" + }, + "systemData": { + "$id": "927", + "kind": "model", + "type": { + "$ref": "74" + }, + "value": { + "$id": "928", + "createdBy": { + "$id": "929", + "kind": "string", + "type": { + "$ref": "76" + }, + "value": "pooluser@microsoft.com" + }, + "createdByType": { + "$id": "930", + "kind": "string", + "type": { + "$ref": "12" + }, + "value": "User" + }, + "createdAt": { + "$id": "931", + "kind": "string", + "type": { + "$ref": "83" + }, + "value": "2023-09-07T16:33:22.210Z" + }, + "lastModifiedBy": { + "$id": "932", + "kind": "string", + "type": { + "$ref": "88" + }, + "value": "pooluser@microsoft.com" + }, + "lastModifiedByType": { + "$id": "933", + "kind": "string", + "type": { + "$ref": "12" + }, + "value": "User" + }, + "lastModifiedAt": { + "$id": "934", + "kind": "string", + "type": { + "$ref": "95" + }, + "value": "2023-09-07T16:33:22.210Z" + } + } + } + } + } + ] + }, + "nextLink": { + "$id": "935", + "kind": "string", + "type": { + "$ref": "329" + }, + "value": "https://microsoft.com/a" + } + } + } + } + ] + } + ] + } + ], + "Protocol": { + "$id": "936" + }, + "Parent": "StandbyPoolClient", + "Parameters": [ + { + "$id": "937", + "Name": "endpoint", + "NameInRequest": "endpoint", + "Doc": "Service host", + "Type": { + "$id": "938", + "kind": "url", + "name": "url", + "crossLanguageDefinitionId": "TypeSpec.url" + }, + "Location": "Uri", + "IsApiVersion": false, + "IsResourceParameter": false, + "IsContentType": false, + "IsRequired": true, + "IsEndpoint": true, + "SkipUrlEncoding": false, + "Explode": false, + "Kind": "Client", + "DefaultValue": { + "$id": "939", + "Type": { + "$id": "940", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "https://management.azure.com" + } + } + ], + "Decorators": [] + }, + { + "$id": "941", + "Name": "StandbyVirtualMachinePoolRuntimeViews", + "ClientNamespace": "Microsoft.StandbyPool", + "Operations": [ + { + "$id": "942", + "Name": "get", + "ResourceName": "StandbyVirtualMachinePoolRuntimeViewResource", + "Doc": "Get a StandbyVirtualMachinePoolRuntimeViewResource", + "Accessibility": "public", + "Parameters": [ + { + "$id": "943", + "Name": "apiVersion", + "NameInRequest": "api-version", + "Doc": "The API version to use for this operation.", + "Type": { + "$id": "944", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": true, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "DefaultValue": { + "$id": "945", + "Type": { + "$id": "946", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "2024-03-01" + }, + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "947", + "Name": "subscriptionId", + "NameInRequest": "subscriptionId", + "Doc": "The ID of the target subscription. The value must be an UUID.", + "Type": { + "$id": "948", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "949", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "950", + "Name": "resourceGroupName", + "NameInRequest": "resourceGroupName", + "Doc": "The name of the resource group. The name is case insensitive.", + "Type": { + "$id": "951", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "952", + "Name": "standbyVirtualMachinePoolName", + "NameInRequest": "standbyVirtualMachinePoolName", + "Doc": "Name of the standby virtual machine pool", + "Type": { + "$id": "953", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "954", + "Name": "runtimeView", + "NameInRequest": "runtimeView", + "Doc": "The unique identifier for the runtime view. The input string should be the word 'latest', which will get the latest runtime view of the pool, otherwise the request will fail with NotFound exception.", + "Type": { + "$id": "955", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "956", + "Name": "accept", + "NameInRequest": "Accept", + "Type": { + "$id": "957", + "kind": "constant", + "valueType": { + "$id": "958", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "959", + "StatusCodes": [ + 200 + ], + "BodyType": { + "$ref": "279" + }, + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false, + "ContentTypes": [ + "application/json" + ] + } + ], + "HttpMethod": "GET", + "RequestBodyMediaType": "None", + "Uri": "{endpoint}", + "Path": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StandbyPool/standbyVirtualMachinePools/{standbyVirtualMachinePoolName}/runtimeViews/{runtimeView}", + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Microsoft.StandbyPool.StandbyVirtualMachinePoolRuntimeViews.get", + "Decorators": [], + "Examples": [ + { + "$id": "960", + "kind": "http", + "name": "StandbyVirtualMachinePoolRuntimeViews_Get", + "description": "StandbyVirtualMachinePoolRuntimeViews_Get", + "filePath": "2024-03-01/StandbyVirtualMachinePoolRuntimeViews_Get.json", + "parameters": [ + { + "$id": "961", + "parameter": { + "$ref": "943" + }, + "value": { + "$id": "962", + "kind": "string", + "type": { + "$ref": "944" + }, + "value": "2024-03-01" + } + }, + { + "$id": "963", + "parameter": { + "$ref": "947" + }, + "value": { + "$id": "964", + "kind": "string", + "type": { + "$ref": "948" + }, + "value": "00000000-0000-0000-0000-000000000009" + } + }, + { + "$id": "965", + "parameter": { + "$ref": "950" + }, + "value": { + "$id": "966", + "kind": "string", + "type": { + "$ref": "951" + }, + "value": "rgstandbypool" + } + }, + { + "$id": "967", + "parameter": { + "$ref": "952" + }, + "value": { + "$id": "968", + "kind": "string", + "type": { + "$ref": "953" + }, + "value": "pool" + } + }, + { + "$id": "969", + "parameter": { + "$ref": "954" + }, + "value": { + "$id": "970", + "kind": "string", + "type": { + "$ref": "955" + }, + "value": "latest" + } + } + ], + "responses": [ + { + "$id": "971", + "response": { + "$ref": "959" + }, + "statusCode": 200, + "bodyValue": { + "$id": "972", + "kind": "model", + "type": { + "$ref": "279" + }, + "value": { + "$id": "973", + "properties": { + "$id": "974", + "kind": "model", + "type": { + "$ref": "281" + }, + "value": { + "$id": "975", + "instanceCountSummary": { + "$id": "976", + "kind": "array", + "type": { + "$ref": "283" + }, + "value": [ + { + "$id": "977", + "kind": "model", + "type": { + "$ref": "284" + }, + "value": { + "$id": "978", + "zone": { + "$id": "979", + "kind": "number", + "type": { + "$ref": "286" + }, + "value": 1 + }, + "instanceCountsByState": { + "$id": "980", + "kind": "array", + "type": { + "$ref": "290" + }, + "value": [ + { + "$id": "981", + "kind": "model", + "type": { + "$ref": "108" + }, + "value": { + "$id": "982", + "state": { + "$id": "983", + "kind": "string", + "type": { + "$ref": "110" + }, + "value": "creating" + }, + "count": { + "$id": "984", + "kind": "number", + "type": { + "$ref": "114" + }, + "value": 100 + } + } + }, + { + "$id": "985", + "kind": "model", + "type": { + "$ref": "108" + }, + "value": { + "$id": "986", + "state": { + "$id": "987", + "kind": "string", + "type": { + "$ref": "110" + }, + "value": "running" + }, + "count": { + "$id": "988", + "kind": "number", + "type": { + "$ref": "114" + }, + "value": 20 + } + } + }, + { + "$id": "989", + "kind": "model", + "type": { + "$ref": "108" + }, + "value": { + "$id": "990", + "state": { + "$id": "991", + "kind": "string", + "type": { + "$ref": "110" + }, + "value": "deallocating" + }, + "count": { + "$id": "992", + "kind": "number", + "type": { + "$ref": "114" + }, + "value": 10 + } + } + }, + { + "$id": "993", + "kind": "model", + "type": { + "$ref": "108" + }, + "value": { + "$id": "994", + "state": { + "$id": "995", + "kind": "string", + "type": { + "$ref": "110" + }, + "value": "deallocated" + }, + "count": { + "$id": "996", + "kind": "number", + "type": { + "$ref": "114" + }, + "value": 100 + } + } + }, + { + "$id": "997", + "kind": "model", + "type": { + "$ref": "108" + }, + "value": { + "$id": "998", + "state": { + "$id": "999", + "kind": "string", + "type": { + "$ref": "110" + }, + "value": "starting" + }, + "count": { + "$id": "1000", + "kind": "number", + "type": { + "$ref": "114" + }, + "value": 0 + } + } + }, + { + "$id": "1001", + "kind": "model", + "type": { + "$ref": "108" + }, + "value": { + "$id": "1002", + "state": { + "$id": "1003", + "kind": "string", + "type": { + "$ref": "110" + }, + "value": "deleting" + }, + "count": { + "$id": "1004", + "kind": "number", + "type": { + "$ref": "114" + }, + "value": 0 + } + } + } + ] + } + } + }, + { + "$id": "1005", + "kind": "model", + "type": { + "$ref": "284" + }, + "value": { + "$id": "1006", + "zone": { + "$id": "1007", + "kind": "number", + "type": { + "$ref": "286" + }, + "value": 2 + }, + "instanceCountsByState": { + "$id": "1008", + "kind": "array", + "type": { + "$ref": "290" + }, + "value": [ + { + "$id": "1009", + "kind": "model", + "type": { + "$ref": "108" + }, + "value": { + "$id": "1010", + "state": { + "$id": "1011", + "kind": "string", + "type": { + "$ref": "110" + }, + "value": "creating" + }, + "count": { + "$id": "1012", + "kind": "number", + "type": { + "$ref": "114" + }, + "value": 100 + } + } + }, + { + "$id": "1013", + "kind": "model", + "type": { + "$ref": "108" + }, + "value": { + "$id": "1014", + "state": { + "$id": "1015", + "kind": "string", + "type": { + "$ref": "110" + }, + "value": "running" + }, + "count": { + "$id": "1016", + "kind": "number", + "type": { + "$ref": "114" + }, + "value": 20 + } + } + }, + { + "$id": "1017", + "kind": "model", + "type": { + "$ref": "108" + }, + "value": { + "$id": "1018", + "state": { + "$id": "1019", + "kind": "string", + "type": { + "$ref": "110" + }, + "value": "deallocating" + }, + "count": { + "$id": "1020", + "kind": "number", + "type": { + "$ref": "114" + }, + "value": 10 + } + } + }, + { + "$id": "1021", + "kind": "model", + "type": { + "$ref": "108" + }, + "value": { + "$id": "1022", + "state": { + "$id": "1023", + "kind": "string", + "type": { + "$ref": "110" + }, + "value": "deallocated" + }, + "count": { + "$id": "1024", + "kind": "number", + "type": { + "$ref": "114" + }, + "value": 100 + } + } + }, + { + "$id": "1025", + "kind": "model", + "type": { + "$ref": "108" + }, + "value": { + "$id": "1026", + "state": { + "$id": "1027", + "kind": "string", + "type": { + "$ref": "110" + }, + "value": "starting" + }, + "count": { + "$id": "1028", + "kind": "number", + "type": { + "$ref": "114" + }, + "value": 0 + } + } + }, + { + "$id": "1029", + "kind": "model", + "type": { + "$ref": "108" + }, + "value": { + "$id": "1030", + "state": { + "$id": "1031", + "kind": "string", + "type": { + "$ref": "110" + }, + "value": "deleting" + }, + "count": { + "$id": "1032", + "kind": "number", + "type": { + "$ref": "114" + }, + "value": 0 + } + } + } + ] + } + } + }, + { + "$id": "1033", + "kind": "model", + "type": { + "$ref": "284" + }, + "value": { + "$id": "1034", + "zone": { + "$id": "1035", + "kind": "number", + "type": { + "$ref": "286" + }, + "value": 3 + }, + "instanceCountsByState": { + "$id": "1036", + "kind": "array", + "type": { + "$ref": "290" + }, + "value": [ + { + "$id": "1037", + "kind": "model", + "type": { + "$ref": "108" + }, + "value": { + "$id": "1038", + "state": { + "$id": "1039", + "kind": "string", + "type": { + "$ref": "110" + }, + "value": "creating" + }, + "count": { + "$id": "1040", + "kind": "number", + "type": { + "$ref": "114" + }, + "value": 100 + } + } + }, + { + "$id": "1041", + "kind": "model", + "type": { + "$ref": "108" + }, + "value": { + "$id": "1042", + "state": { + "$id": "1043", + "kind": "string", + "type": { + "$ref": "110" + }, + "value": "running" + }, + "count": { + "$id": "1044", + "kind": "number", + "type": { + "$ref": "114" + }, + "value": 20 + } + } + }, + { + "$id": "1045", + "kind": "model", + "type": { + "$ref": "108" + }, + "value": { + "$id": "1046", + "state": { + "$id": "1047", + "kind": "string", + "type": { + "$ref": "110" + }, + "value": "deallocating" + }, + "count": { + "$id": "1048", + "kind": "number", + "type": { + "$ref": "114" + }, + "value": 10 + } + } + }, + { + "$id": "1049", + "kind": "model", + "type": { + "$ref": "108" + }, + "value": { + "$id": "1050", + "state": { + "$id": "1051", + "kind": "string", + "type": { + "$ref": "110" + }, + "value": "deallocated" + }, + "count": { + "$id": "1052", + "kind": "number", + "type": { + "$ref": "114" + }, + "value": 100 + } + } + }, + { + "$id": "1053", + "kind": "model", + "type": { + "$ref": "108" + }, + "value": { + "$id": "1054", + "state": { + "$id": "1055", + "kind": "string", + "type": { + "$ref": "110" + }, + "value": "starting" + }, + "count": { + "$id": "1056", + "kind": "number", + "type": { + "$ref": "114" + }, + "value": 0 + } + } + }, + { + "$id": "1057", + "kind": "model", + "type": { + "$ref": "108" + }, + "value": { + "$id": "1058", + "state": { + "$id": "1059", + "kind": "string", + "type": { + "$ref": "110" + }, + "value": "deleting" + }, + "count": { + "$id": "1060", + "kind": "number", + "type": { + "$ref": "114" + }, + "value": 0 + } + } + } + ] + } + } + } + ] + }, + "provisioningState": { + "$id": "1061", + "kind": "string", + "type": { + "$ref": "2" + }, + "value": "Succeeded" + } + } + }, + "id": { + "$id": "1062", + "kind": "string", + "type": { + "$ref": "60" + }, + "value": "/subscriptions/00000000-0000-0000-0000-000000000009/resourceGroups/rgstandbypool/providers/Microsoft.StandbyPool/standbyVirtualMachinePools/pool/runtimeViews/latest" + }, + "name": { + "$id": "1063", + "kind": "string", + "type": { + "$ref": "65" + }, + "value": "pool" + }, + "type": { + "$id": "1064", + "kind": "string", + "type": { + "$ref": "69" + }, + "value": "Microsoft.StandbyPool/standbyVirtualMachinePools/runtimeViews" + }, + "systemData": { + "$id": "1065", + "kind": "model", + "type": { + "$ref": "74" + }, + "value": { + "$id": "1066", + "createdBy": { + "$id": "1067", + "kind": "string", + "type": { + "$ref": "76" + }, + "value": "pooluser@microsoft.com" + }, + "createdByType": { + "$id": "1068", + "kind": "string", + "type": { + "$ref": "12" + }, + "value": "User" + }, + "createdAt": { + "$id": "1069", + "kind": "string", + "type": { + "$ref": "83" + }, + "value": "2024-02-14T23:31:59.679Z" + }, + "lastModifiedBy": { + "$id": "1070", + "kind": "string", + "type": { + "$ref": "88" + }, + "value": "pooluser@microsoft.com" + }, + "lastModifiedByType": { + "$id": "1071", + "kind": "string", + "type": { + "$ref": "12" + }, + "value": "User" + }, + "lastModifiedAt": { + "$id": "1072", + "kind": "string", + "type": { + "$ref": "95" + }, + "value": "2024-02-14T23:31:59.679Z" + } + } + } + } + } + } + ] + } + ] + }, + { + "$id": "1073", + "Name": "listByStandbyPool", + "ResourceName": "StandbyVirtualMachinePoolRuntimeViewResource", + "Doc": "List StandbyVirtualMachinePoolRuntimeViewResource resources by StandbyVirtualMachinePoolResource", + "Accessibility": "public", + "Parameters": [ + { + "$id": "1074", + "Name": "apiVersion", + "NameInRequest": "api-version", + "Doc": "The API version to use for this operation.", + "Type": { + "$id": "1075", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": true, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "DefaultValue": { + "$id": "1076", + "Type": { + "$id": "1077", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "2024-03-01" + }, + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1078", + "Name": "subscriptionId", + "NameInRequest": "subscriptionId", + "Doc": "The ID of the target subscription. The value must be an UUID.", + "Type": { + "$id": "1079", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "1080", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1081", + "Name": "resourceGroupName", + "NameInRequest": "resourceGroupName", + "Doc": "The name of the resource group. The name is case insensitive.", + "Type": { + "$id": "1082", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1083", + "Name": "standbyVirtualMachinePoolName", + "NameInRequest": "standbyVirtualMachinePoolName", + "Doc": "Name of the standby virtual machine pool", + "Type": { + "$id": "1084", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1085", + "Name": "accept", + "NameInRequest": "Accept", + "Type": { + "$id": "1086", + "kind": "constant", + "valueType": { + "$id": "1087", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "1088", + "StatusCodes": [ + 200 + ], + "BodyType": { + "$ref": "300" + }, + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false, + "ContentTypes": [ + "application/json" + ] + } + ], + "HttpMethod": "GET", + "RequestBodyMediaType": "None", + "Uri": "{endpoint}", + "Path": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StandbyPool/standbyVirtualMachinePools/{standbyVirtualMachinePoolName}/runtimeViews", + "BufferResponse": true, + "Paging": { + "$id": "1089", + "ItemName": "value", + "NextLinkName": "nextLink" + }, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Microsoft.StandbyPool.StandbyVirtualMachinePoolRuntimeViews.listByStandbyPool", + "Decorators": [], + "Examples": [ + { + "$id": "1090", + "kind": "http", + "name": "StandbyVirtualMachinePoolRuntimeViews_ListByStandbyPool", + "description": "StandbyVirtualMachinePoolRuntimeViews_ListByStandbyPool", + "filePath": "2024-03-01/StandbyVirtualMachinePoolRuntimeViews_ListByStandbyPool.json", + "parameters": [ + { + "$id": "1091", + "parameter": { + "$ref": "1074" + }, + "value": { + "$id": "1092", + "kind": "string", + "type": { + "$ref": "1075" + }, + "value": "2024-03-01" + } + }, + { + "$id": "1093", + "parameter": { + "$ref": "1078" + }, + "value": { + "$id": "1094", + "kind": "string", + "type": { + "$ref": "1079" + }, + "value": "00000000-0000-0000-0000-000000000009" + } + }, + { + "$id": "1095", + "parameter": { + "$ref": "1081" + }, + "value": { + "$id": "1096", + "kind": "string", + "type": { + "$ref": "1082" + }, + "value": "rgstandbypool" + } + }, + { + "$id": "1097", + "parameter": { + "$ref": "1083" + }, + "value": { + "$id": "1098", + "kind": "string", + "type": { + "$ref": "1084" + }, + "value": "pool" + } + } + ], + "responses": [ + { + "$id": "1099", + "response": { + "$ref": "1088" + }, + "statusCode": 200, + "bodyValue": { + "$id": "1100", + "kind": "model", + "type": { + "$ref": "300" + }, + "value": { + "$id": "1101", + "value": { + "$id": "1102", + "kind": "array", + "type": { + "$ref": "302" + }, + "value": [ + { + "$id": "1103", + "kind": "model", + "type": { + "$ref": "279" + }, + "value": { + "$id": "1104", + "properties": { + "$id": "1105", + "kind": "model", + "type": { + "$ref": "281" + }, + "value": { + "$id": "1106", + "instanceCountSummary": { + "$id": "1107", + "kind": "array", + "type": { + "$ref": "283" + }, + "value": [ + { + "$id": "1108", + "kind": "model", + "type": { + "$ref": "284" + }, + "value": { + "$id": "1109", + "zone": { + "$id": "1110", + "kind": "number", + "type": { + "$ref": "286" + }, + "value": 1 + }, + "instanceCountsByState": { + "$id": "1111", + "kind": "array", + "type": { + "$ref": "290" + }, + "value": [ + { + "$id": "1112", + "kind": "model", + "type": { + "$ref": "108" + }, + "value": { + "$id": "1113", + "state": { + "$id": "1114", + "kind": "string", + "type": { + "$ref": "110" + }, + "value": "creating" + }, + "count": { + "$id": "1115", + "kind": "number", + "type": { + "$ref": "114" + }, + "value": 100 + } + } + }, + { + "$id": "1116", + "kind": "model", + "type": { + "$ref": "108" + }, + "value": { + "$id": "1117", + "state": { + "$id": "1118", + "kind": "string", + "type": { + "$ref": "110" + }, + "value": "running" + }, + "count": { + "$id": "1119", + "kind": "number", + "type": { + "$ref": "114" + }, + "value": 20 + } + } + }, + { + "$id": "1120", + "kind": "model", + "type": { + "$ref": "108" + }, + "value": { + "$id": "1121", + "state": { + "$id": "1122", + "kind": "string", + "type": { + "$ref": "110" + }, + "value": "deallocating" + }, + "count": { + "$id": "1123", + "kind": "number", + "type": { + "$ref": "114" + }, + "value": 10 + } + } + }, + { + "$id": "1124", + "kind": "model", + "type": { + "$ref": "108" + }, + "value": { + "$id": "1125", + "state": { + "$id": "1126", + "kind": "string", + "type": { + "$ref": "110" + }, + "value": "deallocated" + }, + "count": { + "$id": "1127", + "kind": "number", + "type": { + "$ref": "114" + }, + "value": 100 + } + } + }, + { + "$id": "1128", + "kind": "model", + "type": { + "$ref": "108" + }, + "value": { + "$id": "1129", + "state": { + "$id": "1130", + "kind": "string", + "type": { + "$ref": "110" + }, + "value": "starting" + }, + "count": { + "$id": "1131", + "kind": "number", + "type": { + "$ref": "114" + }, + "value": 0 + } + } + }, + { + "$id": "1132", + "kind": "model", + "type": { + "$ref": "108" + }, + "value": { + "$id": "1133", + "state": { + "$id": "1134", + "kind": "string", + "type": { + "$ref": "110" + }, + "value": "deleting" + }, + "count": { + "$id": "1135", + "kind": "number", + "type": { + "$ref": "114" + }, + "value": 0 + } + } + } + ] + } + } + }, + { + "$id": "1136", + "kind": "model", + "type": { + "$ref": "284" + }, + "value": { + "$id": "1137", + "zone": { + "$id": "1138", + "kind": "number", + "type": { + "$ref": "286" + }, + "value": 2 + }, + "instanceCountsByState": { + "$id": "1139", + "kind": "array", + "type": { + "$ref": "290" + }, + "value": [ + { + "$id": "1140", + "kind": "model", + "type": { + "$ref": "108" + }, + "value": { + "$id": "1141", + "state": { + "$id": "1142", + "kind": "string", + "type": { + "$ref": "110" + }, + "value": "creating" + }, + "count": { + "$id": "1143", + "kind": "number", + "type": { + "$ref": "114" + }, + "value": 100 + } + } + }, + { + "$id": "1144", + "kind": "model", + "type": { + "$ref": "108" + }, + "value": { + "$id": "1145", + "state": { + "$id": "1146", + "kind": "string", + "type": { + "$ref": "110" + }, + "value": "running" + }, + "count": { + "$id": "1147", + "kind": "number", + "type": { + "$ref": "114" + }, + "value": 20 + } + } + }, + { + "$id": "1148", + "kind": "model", + "type": { + "$ref": "108" + }, + "value": { + "$id": "1149", + "state": { + "$id": "1150", + "kind": "string", + "type": { + "$ref": "110" + }, + "value": "deallocating" + }, + "count": { + "$id": "1151", + "kind": "number", + "type": { + "$ref": "114" + }, + "value": 10 + } + } + }, + { + "$id": "1152", + "kind": "model", + "type": { + "$ref": "108" + }, + "value": { + "$id": "1153", + "state": { + "$id": "1154", + "kind": "string", + "type": { + "$ref": "110" + }, + "value": "deallocated" + }, + "count": { + "$id": "1155", + "kind": "number", + "type": { + "$ref": "114" + }, + "value": 100 + } + } + }, + { + "$id": "1156", + "kind": "model", + "type": { + "$ref": "108" + }, + "value": { + "$id": "1157", + "state": { + "$id": "1158", + "kind": "string", + "type": { + "$ref": "110" + }, + "value": "starting" + }, + "count": { + "$id": "1159", + "kind": "number", + "type": { + "$ref": "114" + }, + "value": 0 + } + } + }, + { + "$id": "1160", + "kind": "model", + "type": { + "$ref": "108" + }, + "value": { + "$id": "1161", + "state": { + "$id": "1162", + "kind": "string", + "type": { + "$ref": "110" + }, + "value": "deleting" + }, + "count": { + "$id": "1163", + "kind": "number", + "type": { + "$ref": "114" + }, + "value": 0 + } + } + } + ] + } + } + }, + { + "$id": "1164", + "kind": "model", + "type": { + "$ref": "284" + }, + "value": { + "$id": "1165", + "zone": { + "$id": "1166", + "kind": "number", + "type": { + "$ref": "286" + }, + "value": 3 + }, + "instanceCountsByState": { + "$id": "1167", + "kind": "array", + "type": { + "$ref": "290" + }, + "value": [ + { + "$id": "1168", + "kind": "model", + "type": { + "$ref": "108" + }, + "value": { + "$id": "1169", + "state": { + "$id": "1170", + "kind": "string", + "type": { + "$ref": "110" + }, + "value": "creating" + }, + "count": { + "$id": "1171", + "kind": "number", + "type": { + "$ref": "114" + }, + "value": 100 + } + } + }, + { + "$id": "1172", + "kind": "model", + "type": { + "$ref": "108" + }, + "value": { + "$id": "1173", + "state": { + "$id": "1174", + "kind": "string", + "type": { + "$ref": "110" + }, + "value": "running" + }, + "count": { + "$id": "1175", + "kind": "number", + "type": { + "$ref": "114" + }, + "value": 20 + } + } + }, + { + "$id": "1176", + "kind": "model", + "type": { + "$ref": "108" + }, + "value": { + "$id": "1177", + "state": { + "$id": "1178", + "kind": "string", + "type": { + "$ref": "110" + }, + "value": "deallocating" + }, + "count": { + "$id": "1179", + "kind": "number", + "type": { + "$ref": "114" + }, + "value": 10 + } + } + }, + { + "$id": "1180", + "kind": "model", + "type": { + "$ref": "108" + }, + "value": { + "$id": "1181", + "state": { + "$id": "1182", + "kind": "string", + "type": { + "$ref": "110" + }, + "value": "deallocated" + }, + "count": { + "$id": "1183", + "kind": "number", + "type": { + "$ref": "114" + }, + "value": 100 + } + } + }, + { + "$id": "1184", + "kind": "model", + "type": { + "$ref": "108" + }, + "value": { + "$id": "1185", + "state": { + "$id": "1186", + "kind": "string", + "type": { + "$ref": "110" + }, + "value": "starting" + }, + "count": { + "$id": "1187", + "kind": "number", + "type": { + "$ref": "114" + }, + "value": 0 + } + } + }, + { + "$id": "1188", + "kind": "model", + "type": { + "$ref": "108" + }, + "value": { + "$id": "1189", + "state": { + "$id": "1190", + "kind": "string", + "type": { + "$ref": "110" + }, + "value": "deleting" + }, + "count": { + "$id": "1191", + "kind": "number", + "type": { + "$ref": "114" + }, + "value": 0 + } + } + } + ] + } + } + } + ] + }, + "provisioningState": { + "$id": "1192", + "kind": "string", + "type": { + "$ref": "2" + }, + "value": "Succeeded" + } + } + }, + "id": { + "$id": "1193", + "kind": "string", + "type": { + "$ref": "60" + }, + "value": "/subscriptions/00000000-0000-0000-0000-000000000009/resourceGroups/rgstandbypool/providers/Microsoft.StandbyPool/standbyVirtualMachinePools/pool/runtimeViews/latest" + }, + "name": { + "$id": "1194", + "kind": "string", + "type": { + "$ref": "65" + }, + "value": "pool" + }, + "type": { + "$id": "1195", + "kind": "string", + "type": { + "$ref": "69" + }, + "value": "Microsoft.StandbyPool/standbyVirtualMachinePools/runtimeViews" + }, + "systemData": { + "$id": "1196", + "kind": "model", + "type": { + "$ref": "74" + }, + "value": { + "$id": "1197", + "createdBy": { + "$id": "1198", + "kind": "string", + "type": { + "$ref": "76" + }, + "value": "pooluser@microsoft.com" + }, + "createdByType": { + "$id": "1199", + "kind": "string", + "type": { + "$ref": "12" + }, + "value": "User" + }, + "createdAt": { + "$id": "1200", + "kind": "string", + "type": { + "$ref": "83" + }, + "value": "2023-09-07T16:33:22.210Z" + }, + "lastModifiedBy": { + "$id": "1201", + "kind": "string", + "type": { + "$ref": "88" + }, + "value": "pooluser@microsoft.com" + }, + "lastModifiedByType": { + "$id": "1202", + "kind": "string", + "type": { + "$ref": "12" + }, + "value": "User" + }, + "lastModifiedAt": { + "$id": "1203", + "kind": "string", + "type": { + "$ref": "95" + }, + "value": "2023-09-07T16:33:22.210Z" + } + } + } + } + } + ] + }, + "nextLink": { + "$id": "1204", + "kind": "string", + "type": { + "$ref": "306" + }, + "value": "https://microsoft.com/a" + } + } + } + } + ] + } + ] + } + ], + "Protocol": { + "$id": "1205" + }, + "Parent": "StandbyPoolClient", + "Parameters": [ + { + "$id": "1206", + "Name": "endpoint", + "NameInRequest": "endpoint", + "Doc": "Service host", + "Type": { + "$id": "1207", + "kind": "url", + "name": "url", + "crossLanguageDefinitionId": "TypeSpec.url" + }, + "Location": "Uri", + "IsApiVersion": false, + "IsResourceParameter": false, + "IsContentType": false, + "IsRequired": true, + "IsEndpoint": true, + "SkipUrlEncoding": false, + "Explode": false, + "Kind": "Client", + "DefaultValue": { + "$id": "1208", + "Type": { + "$id": "1209", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "https://management.azure.com" + } + } + ], + "Decorators": [] + }, + { + "$id": "1210", + "Name": "StandbyContainerGroupPools", + "ClientNamespace": "Microsoft.StandbyPool", + "Operations": [ + { + "$id": "1211", + "Name": "get", + "ResourceName": "StandbyContainerGroupPoolResource", + "Doc": "Get a StandbyContainerGroupPoolResource", + "Accessibility": "public", + "Parameters": [ + { + "$id": "1212", + "Name": "apiVersion", + "NameInRequest": "api-version", + "Doc": "The API version to use for this operation.", + "Type": { + "$id": "1213", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": true, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "DefaultValue": { + "$id": "1214", + "Type": { + "$id": "1215", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "2024-03-01" + }, + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1216", + "Name": "subscriptionId", + "NameInRequest": "subscriptionId", + "Doc": "The ID of the target subscription. The value must be an UUID.", + "Type": { + "$id": "1217", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "1218", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1219", + "Name": "resourceGroupName", + "NameInRequest": "resourceGroupName", + "Doc": "The name of the resource group. The name is case insensitive.", + "Type": { + "$id": "1220", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1221", + "Name": "standbyContainerGroupPoolName", + "NameInRequest": "standbyContainerGroupPoolName", + "Doc": "Name of the standby container group pool", + "Type": { + "$id": "1222", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1223", + "Name": "accept", + "NameInRequest": "Accept", + "Type": { + "$id": "1224", + "kind": "constant", + "valueType": { + "$id": "1225", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "1226", + "StatusCodes": [ + 200 + ], + "BodyType": { + "$ref": "170" + }, + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false, + "ContentTypes": [ + "application/json" + ] + } + ], + "HttpMethod": "GET", + "RequestBodyMediaType": "None", + "Uri": "{endpoint}", + "Path": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StandbyPool/standbyContainerGroupPools/{standbyContainerGroupPoolName}", + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Microsoft.StandbyPool.StandbyContainerGroupPools.get", + "Decorators": [], + "Examples": [ + { + "$id": "1227", + "kind": "http", + "name": "StandbyContainerGroupPools_Get", + "description": "StandbyContainerGroupPools_Get", + "filePath": "2024-03-01/StandbyContainerGroupPools_Get.json", + "parameters": [ + { + "$id": "1228", + "parameter": { + "$ref": "1212" + }, + "value": { + "$id": "1229", + "kind": "string", + "type": { + "$ref": "1213" + }, + "value": "2024-03-01" + } + }, + { + "$id": "1230", + "parameter": { + "$ref": "1216" + }, + "value": { + "$id": "1231", + "kind": "string", + "type": { + "$ref": "1217" + }, + "value": "00000000-0000-0000-0000-000000000009" + } + }, + { + "$id": "1232", + "parameter": { + "$ref": "1219" + }, + "value": { + "$id": "1233", + "kind": "string", + "type": { + "$ref": "1220" + }, + "value": "rgstandbypool" + } + }, + { + "$id": "1234", + "parameter": { + "$ref": "1221" + }, + "value": { + "$id": "1235", + "kind": "string", + "type": { + "$ref": "1222" + }, + "value": "pool" + } + } + ], + "responses": [ + { + "$id": "1236", + "response": { + "$ref": "1226" + }, + "statusCode": 200, + "bodyValue": { + "$id": "1237", + "kind": "model", + "type": { + "$ref": "170" + }, + "value": { + "$id": "1238", + "properties": { + "$id": "1239", + "kind": "model", + "type": { + "$ref": "183" + }, + "value": { + "$id": "1240", + "elasticityProfile": { + "$id": "1241", + "kind": "model", + "type": { + "$ref": "185" + }, + "value": { + "$id": "1242", + "maxReadyCapacity": { + "$id": "1243", + "kind": "number", + "type": { + "$ref": "187" + }, + "value": 688 + }, + "refillPolicy": { + "$id": "1244", + "kind": "string", + "type": { + "$ref": "22" + }, + "value": "always" + } + } + }, + "provisioningState": { + "$id": "1245", + "kind": "string", + "type": { + "$ref": "2" + }, + "value": "Succeeded" + }, + "containerGroupProperties": { + "$id": "1246", + "kind": "model", + "type": { + "$ref": "196" + }, + "value": { + "$id": "1247", + "containerGroupProfile": { + "$id": "1248", + "kind": "model", + "type": { + "$ref": "198" + }, + "value": { + "$id": "1249", + "id": { + "$id": "1250", + "kind": "string", + "type": { + "$ref": "200" + }, + "value": "/subscriptions/00000000-0000-0000-0000-000000000009/resourceGroups/rgstandbypool/providers/Microsoft.ContainerInstance/containerGroupProfiles/cgProfile" + }, + "revision": { + "$id": "1251", + "kind": "number", + "type": { + "$ref": "205" + }, + "value": 1 + } + } + }, + "subnetIds": { + "$id": "1252", + "kind": "array", + "type": { + "$ref": "211" + }, + "value": [ + { + "$id": "1253", + "kind": "model", + "type": { + "$ref": "212" + }, + "value": { + "$id": "1254", + "id": { + "$id": "1255", + "kind": "string", + "type": { + "$ref": "214" + }, + "value": "/subscriptions/00000000-0000-0000-0000-000000000009/resourceGroups/rgstandbypool/providers/Microsoft.Network/virtualNetworks/cgSubnet/subnets/cgSubnet" + } + } + } + ] + } + } + } + } + }, + "tags": { + "$id": "1256", + "kind": "dict", + "type": { + "$ref": "173" + }, + "value": { + "$id": "1257" + } + }, + "location": { + "$id": "1258", + "kind": "string", + "type": { + "$ref": "179" + }, + "value": "West US" + }, + "id": { + "$id": "1259", + "kind": "string", + "type": { + "$ref": "60" + }, + "value": "/subscriptions/00000000-0000-0000-0000-000000000009/resourceGroups/rgstandbypool/providers/Microsoft.StandbyPool/standbyContainerGroupPools/pool" + }, + "name": { + "$id": "1260", + "kind": "string", + "type": { + "$ref": "65" + }, + "value": "pool" + }, + "type": { + "$id": "1261", + "kind": "string", + "type": { + "$ref": "69" + }, + "value": "Microsoft.StandbyPool/standbyContainerGroupPools" + }, + "systemData": { + "$id": "1262", + "kind": "model", + "type": { + "$ref": "74" + }, + "value": { + "$id": "1263", + "createdBy": { + "$id": "1264", + "kind": "string", + "type": { + "$ref": "76" + }, + "value": "pooluser@microsoft.com" + }, + "createdByType": { + "$id": "1265", + "kind": "string", + "type": { + "$ref": "12" + }, + "value": "User" + }, + "createdAt": { + "$id": "1266", + "kind": "string", + "type": { + "$ref": "83" + }, + "value": "2023-09-07T16:33:22.210Z" + }, + "lastModifiedBy": { + "$id": "1267", + "kind": "string", + "type": { + "$ref": "88" + }, + "value": "pooluser@microsoft.com" + }, + "lastModifiedByType": { + "$id": "1268", + "kind": "string", + "type": { + "$ref": "12" + }, + "value": "User" + }, + "lastModifiedAt": { + "$id": "1269", + "kind": "string", + "type": { + "$ref": "95" + }, + "value": "2023-09-07T16:33:22.210Z" + } + } + } + } + } + } + ] + } + ] + }, + { + "$id": "1270", + "Name": "createOrUpdate", + "ResourceName": "StandbyContainerGroupPoolResource", + "Doc": "Create a StandbyContainerGroupPoolResource", + "Accessibility": "public", + "Parameters": [ + { + "$id": "1271", + "Name": "apiVersion", + "NameInRequest": "api-version", + "Doc": "The API version to use for this operation.", + "Type": { + "$id": "1272", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": true, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "DefaultValue": { + "$id": "1273", + "Type": { + "$id": "1274", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "2024-03-01" + }, + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1275", + "Name": "subscriptionId", + "NameInRequest": "subscriptionId", + "Doc": "The ID of the target subscription. The value must be an UUID.", + "Type": { + "$id": "1276", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "1277", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1278", + "Name": "resourceGroupName", + "NameInRequest": "resourceGroupName", + "Doc": "The name of the resource group. The name is case insensitive.", + "Type": { + "$id": "1279", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1280", + "Name": "standbyContainerGroupPoolName", + "NameInRequest": "standbyContainerGroupPoolName", + "Doc": "Name of the standby container group pool", + "Type": { + "$id": "1281", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1282", + "Name": "contentType", + "NameInRequest": "Content-Type", + "Doc": "Body parameter's content type. Known values are application/json", + "Type": { + "$id": "1283", + "kind": "constant", + "valueType": { + "$id": "1284", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": true, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1285", + "Name": "accept", + "NameInRequest": "Accept", + "Type": { + "$id": "1286", + "kind": "constant", + "valueType": { + "$id": "1287", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1288", + "Name": "resource", + "NameInRequest": "resource", + "Doc": "Resource create parameters.", + "Type": { + "$ref": "170" + }, + "Location": "Body", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "1289", + "StatusCodes": [ + 200 + ], + "BodyType": { + "$ref": "170" + }, + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false, + "ContentTypes": [ + "application/json" + ] + }, + { + "$id": "1290", + "StatusCodes": [ + 201 + ], + "BodyType": { + "$ref": "170" + }, + "BodyMediaType": "Json", + "Headers": [ + { + "$id": "1291", + "Name": "retryAfter", + "NameInResponse": "Retry-After", + "Doc": "The Retry-After header can indicate how long the client should wait before polling the operation status.", + "Type": { + "$id": "1292", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + } + } + ], + "IsErrorResponse": false, + "ContentTypes": [ + "application/json" + ] + } + ], + "HttpMethod": "PUT", + "RequestBodyMediaType": "Json", + "Uri": "{endpoint}", + "Path": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StandbyPool/standbyContainerGroupPools/{standbyContainerGroupPoolName}", + "RequestMediaTypes": [ + "application/json" + ], + "BufferResponse": true, + "LongRunning": { + "$id": "1293", + "FinalStateVia": 0, + "FinalResponse": { + "$id": "1294", + "StatusCodes": [ + 200 + ], + "BodyType": { + "$ref": "170" + }, + "BodyMediaType": "Json" + } + }, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Microsoft.StandbyPool.StandbyContainerGroupPools.createOrUpdate", + "Decorators": [ + { + "$id": "1295", + "name": "Azure.Core.@useFinalStateVia", + "arguments": { + "$id": "1296", + "finalState": "azure-async-operation" + } + } + ], + "Examples": [ + { + "$id": "1297", + "kind": "http", + "name": "StandbyContainerGroupPools_CreateOrUpdate", + "description": "StandbyContainerGroupPools_CreateOrUpdate", + "filePath": "2024-03-01/StandbyContainerGroupPools_CreateOrUpdate.json", + "parameters": [ + { + "$id": "1298", + "parameter": { + "$ref": "1271" + }, + "value": { + "$id": "1299", + "kind": "string", + "type": { + "$ref": "1272" + }, + "value": "2024-03-01" + } + }, + { + "$id": "1300", + "parameter": { + "$ref": "1275" + }, + "value": { + "$id": "1301", + "kind": "string", + "type": { + "$ref": "1276" + }, + "value": "00000000-0000-0000-0000-000000000009" + } + }, + { + "$id": "1302", + "parameter": { + "$ref": "1278" + }, + "value": { + "$id": "1303", + "kind": "string", + "type": { + "$ref": "1279" + }, + "value": "rgstandbypool" + } + }, + { + "$id": "1304", + "parameter": { + "$ref": "1280" + }, + "value": { + "$id": "1305", + "kind": "string", + "type": { + "$ref": "1281" + }, + "value": "pool" + } + }, + { + "$id": "1306", + "parameter": { + "$ref": "1288" + }, + "value": { + "$id": "1307", + "kind": "model", + "type": { + "$ref": "170" + }, + "value": { + "$id": "1308", + "properties": { + "$id": "1309", + "kind": "model", + "type": { + "$ref": "183" + }, + "value": { + "$id": "1310", + "elasticityProfile": { + "$id": "1311", + "kind": "model", + "type": { + "$ref": "185" + }, + "value": { + "$id": "1312", + "maxReadyCapacity": { + "$id": "1313", + "kind": "number", + "type": { + "$ref": "187" + }, + "value": 688 + }, + "refillPolicy": { + "$id": "1314", + "kind": "string", + "type": { + "$ref": "22" + }, + "value": "always" + } + } + }, + "containerGroupProperties": { + "$id": "1315", + "kind": "model", + "type": { + "$ref": "196" + }, + "value": { + "$id": "1316", + "containerGroupProfile": { + "$id": "1317", + "kind": "model", + "type": { + "$ref": "198" + }, + "value": { + "$id": "1318", + "id": { + "$id": "1319", + "kind": "string", + "type": { + "$ref": "200" + }, + "value": "/subscriptions/00000000-0000-0000-0000-000000000009/resourceGroups/rgstandbypool/providers/Microsoft.ContainerInstance/containerGroupProfiles/cgProfile" + }, + "revision": { + "$id": "1320", + "kind": "number", + "type": { + "$ref": "205" + }, + "value": 1 + } + } + }, + "subnetIds": { + "$id": "1321", + "kind": "array", + "type": { + "$ref": "211" + }, + "value": [ + { + "$id": "1322", + "kind": "model", + "type": { + "$ref": "212" + }, + "value": { + "$id": "1323", + "id": { + "$id": "1324", + "kind": "string", + "type": { + "$ref": "214" + }, + "value": "/subscriptions/00000000-0000-0000-0000-000000000009/resourceGroups/rgstandbypool/providers/Microsoft.Network/virtualNetworks/cgSubnet/subnets/cgSubnet" + } + } + } + ] + } + } + } + } + }, + "tags": { + "$id": "1325", + "kind": "dict", + "type": { + "$ref": "173" + }, + "value": { + "$id": "1326" + } + }, + "location": { + "$id": "1327", + "kind": "string", + "type": { + "$ref": "179" + }, + "value": "West US" + } + } + } + } + ], + "responses": [ + { + "$id": "1328", + "response": { + "$ref": "1289" + }, + "statusCode": 200, + "bodyValue": { + "$id": "1329", + "kind": "model", + "type": { + "$ref": "170" + }, + "value": { + "$id": "1330", + "properties": { + "$id": "1331", + "kind": "model", + "type": { + "$ref": "183" + }, + "value": { + "$id": "1332", + "elasticityProfile": { + "$id": "1333", + "kind": "model", + "type": { + "$ref": "185" + }, + "value": { + "$id": "1334", + "maxReadyCapacity": { + "$id": "1335", + "kind": "number", + "type": { + "$ref": "187" + }, + "value": 688 + }, + "refillPolicy": { + "$id": "1336", + "kind": "string", + "type": { + "$ref": "22" + }, + "value": "always" + } + } + }, + "provisioningState": { + "$id": "1337", + "kind": "string", + "type": { + "$ref": "2" + }, + "value": "Succeeded" + }, + "containerGroupProperties": { + "$id": "1338", + "kind": "model", + "type": { + "$ref": "196" + }, + "value": { + "$id": "1339", + "containerGroupProfile": { + "$id": "1340", + "kind": "model", + "type": { + "$ref": "198" + }, + "value": { + "$id": "1341", + "id": { + "$id": "1342", + "kind": "string", + "type": { + "$ref": "200" + }, + "value": "/subscriptions/00000000-0000-0000-0000-000000000009/resourceGroups/rgstandbypool/providers/Microsoft.ContainerInstance/containerGroupProfiles/cgProfile" + }, + "revision": { + "$id": "1343", + "kind": "number", + "type": { + "$ref": "205" + }, + "value": 1 + } + } + }, + "subnetIds": { + "$id": "1344", + "kind": "array", + "type": { + "$ref": "211" + }, + "value": [ + { + "$id": "1345", + "kind": "model", + "type": { + "$ref": "212" + }, + "value": { + "$id": "1346", + "id": { + "$id": "1347", + "kind": "string", + "type": { + "$ref": "214" + }, + "value": "/subscriptions/00000000-0000-0000-0000-000000000009/resourceGroups/rgstandbypool/providers/Microsoft.Network/virtualNetworks/cgSubnet/subnets/cgSubnet" + } + } + } + ] + } + } + } + } + }, + "tags": { + "$id": "1348", + "kind": "dict", + "type": { + "$ref": "173" + }, + "value": { + "$id": "1349" + } + }, + "location": { + "$id": "1350", + "kind": "string", + "type": { + "$ref": "179" + }, + "value": "West US" + }, + "id": { + "$id": "1351", + "kind": "string", + "type": { + "$ref": "60" + }, + "value": "/subscriptions/00000000-0000-0000-0000-000000000009/resourceGroups/rgstandbypool/providers/Microsoft.StandbyPool/standbyContainerGroupPools/pool" + }, + "name": { + "$id": "1352", + "kind": "string", + "type": { + "$ref": "65" + }, + "value": "pool" + }, + "type": { + "$id": "1353", + "kind": "string", + "type": { + "$ref": "69" + }, + "value": "Microsoft.StandbyPool/standbyContainerGroupPools" + }, + "systemData": { + "$id": "1354", + "kind": "model", + "type": { + "$ref": "74" + }, + "value": { + "$id": "1355", + "createdBy": { + "$id": "1356", + "kind": "string", + "type": { + "$ref": "76" + }, + "value": "pooluser@microsoft.com" + }, + "createdByType": { + "$id": "1357", + "kind": "string", + "type": { + "$ref": "12" + }, + "value": "User" + }, + "createdAt": { + "$id": "1358", + "kind": "string", + "type": { + "$ref": "83" + }, + "value": "2023-09-07T16:33:22.210Z" + }, + "lastModifiedBy": { + "$id": "1359", + "kind": "string", + "type": { + "$ref": "88" + }, + "value": "pooluser@microsoft.com" + }, + "lastModifiedByType": { + "$id": "1360", + "kind": "string", + "type": { + "$ref": "12" + }, + "value": "User" + }, + "lastModifiedAt": { + "$id": "1361", + "kind": "string", + "type": { + "$ref": "95" + }, + "value": "2023-09-07T16:33:22.210Z" + } + } + } + } + } + }, + { + "$id": "1362", + "response": { + "$ref": "1290" + }, + "statusCode": 201, + "bodyValue": { + "$id": "1363", + "kind": "model", + "type": { + "$ref": "170" + }, + "value": { + "$id": "1364", + "properties": { + "$id": "1365", + "kind": "model", + "type": { + "$ref": "183" + }, + "value": { + "$id": "1366", + "elasticityProfile": { + "$id": "1367", + "kind": "model", + "type": { + "$ref": "185" + }, + "value": { + "$id": "1368", + "maxReadyCapacity": { + "$id": "1369", + "kind": "number", + "type": { + "$ref": "187" + }, + "value": 688 + }, + "refillPolicy": { + "$id": "1370", + "kind": "string", + "type": { + "$ref": "22" + }, + "value": "always" + } + } + }, + "provisioningState": { + "$id": "1371", + "kind": "string", + "type": { + "$ref": "2" + }, + "value": "Succeeded" + }, + "containerGroupProperties": { + "$id": "1372", + "kind": "model", + "type": { + "$ref": "196" + }, + "value": { + "$id": "1373", + "containerGroupProfile": { + "$id": "1374", + "kind": "model", + "type": { + "$ref": "198" + }, + "value": { + "$id": "1375", + "id": { + "$id": "1376", + "kind": "string", + "type": { + "$ref": "200" + }, + "value": "/subscriptions/00000000-0000-0000-0000-000000000009/resourceGroups/rgstandbypool/providers/Microsoft.ContainerInstance/containerGroupProfiles/cgProfile" + }, + "revision": { + "$id": "1377", + "kind": "number", + "type": { + "$ref": "205" + }, + "value": 1 + } + } + }, + "subnetIds": { + "$id": "1378", + "kind": "array", + "type": { + "$ref": "211" + }, + "value": [ + { + "$id": "1379", + "kind": "model", + "type": { + "$ref": "212" + }, + "value": { + "$id": "1380", + "id": { + "$id": "1381", + "kind": "string", + "type": { + "$ref": "214" + }, + "value": "/subscriptions/00000000-0000-0000-0000-000000000009/resourceGroups/rgstandbypool/providers/Microsoft.Network/virtualNetworks/cgSubnet/subnets/cgSubnet" + } + } + } + ] + } + } + } + } + }, + "tags": { + "$id": "1382", + "kind": "dict", + "type": { + "$ref": "173" + }, + "value": { + "$id": "1383" + } + }, + "location": { + "$id": "1384", + "kind": "string", + "type": { + "$ref": "179" + }, + "value": "West US" + }, + "id": { + "$id": "1385", + "kind": "string", + "type": { + "$ref": "60" + }, + "value": "/subscriptions/00000000-0000-0000-0000-000000000009/resourceGroups/rgstandbypool/providers/Microsoft.StandbyPool/standbyContainerGroupPools/pool" + }, + "name": { + "$id": "1386", + "kind": "string", + "type": { + "$ref": "65" + }, + "value": "pool" + }, + "type": { + "$id": "1387", + "kind": "string", + "type": { + "$ref": "69" + }, + "value": "Microsoft.StandbyPool/standbyContainerGroupPools" + }, + "systemData": { + "$id": "1388", + "kind": "model", + "type": { + "$ref": "74" + }, + "value": { + "$id": "1389", + "createdBy": { + "$id": "1390", + "kind": "string", + "type": { + "$ref": "76" + }, + "value": "pooluser@microsoft.com" + }, + "createdByType": { + "$id": "1391", + "kind": "string", + "type": { + "$ref": "12" + }, + "value": "User" + }, + "createdAt": { + "$id": "1392", + "kind": "string", + "type": { + "$ref": "83" + }, + "value": "2023-09-07T16:33:22.210Z" + }, + "lastModifiedBy": { + "$id": "1393", + "kind": "string", + "type": { + "$ref": "88" + }, + "value": "pooluser@microsoft.com" + }, + "lastModifiedByType": { + "$id": "1394", + "kind": "string", + "type": { + "$ref": "12" + }, + "value": "User" + }, + "lastModifiedAt": { + "$id": "1395", + "kind": "string", + "type": { + "$ref": "95" + }, + "value": "2023-09-07T16:33:22.210Z" + } + } + } + } + } + } + ] + } + ] + }, + { + "$id": "1396", + "Name": "delete", + "ResourceName": "StandbyContainerGroupPoolResource", + "Doc": "Delete a StandbyContainerGroupPoolResource", + "Accessibility": "public", + "Parameters": [ + { + "$id": "1397", + "Name": "apiVersion", + "NameInRequest": "api-version", + "Doc": "The API version to use for this operation.", + "Type": { + "$id": "1398", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": true, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "DefaultValue": { + "$id": "1399", + "Type": { + "$id": "1400", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "2024-03-01" + }, + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1401", + "Name": "subscriptionId", + "NameInRequest": "subscriptionId", + "Doc": "The ID of the target subscription. The value must be an UUID.", + "Type": { + "$id": "1402", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "1403", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1404", + "Name": "resourceGroupName", + "NameInRequest": "resourceGroupName", + "Doc": "The name of the resource group. The name is case insensitive.", + "Type": { + "$id": "1405", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1406", + "Name": "standbyContainerGroupPoolName", + "NameInRequest": "standbyContainerGroupPoolName", + "Doc": "Name of the standby container group pool", + "Type": { + "$id": "1407", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1408", + "Name": "accept", + "NameInRequest": "Accept", + "Type": { + "$id": "1409", + "kind": "constant", + "valueType": { + "$id": "1410", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "1411", + "StatusCodes": [ + 202 + ], + "BodyMediaType": "Json", + "Headers": [ + { + "$id": "1412", + "Name": "location", + "NameInResponse": "Location", + "Doc": "The Location header contains the URL where the status of the long running operation can be checked.", + "Type": { + "$id": "1413", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + } + }, + { + "$id": "1414", + "Name": "retryAfter", + "NameInResponse": "Retry-After", + "Doc": "The Retry-After header can indicate how long the client should wait before polling the operation status.", + "Type": { + "$id": "1415", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + } + } + ], + "IsErrorResponse": false + }, + { + "$id": "1416", + "StatusCodes": [ + 204 + ], + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false + } + ], + "HttpMethod": "DELETE", + "RequestBodyMediaType": "None", + "Uri": "{endpoint}", + "Path": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StandbyPool/standbyContainerGroupPools/{standbyContainerGroupPoolName}", + "BufferResponse": true, + "LongRunning": { + "$id": "1417", + "FinalStateVia": 1, + "FinalResponse": { + "$id": "1418", + "StatusCodes": [ + 204 + ], + "BodyMediaType": "Json" + } + }, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Microsoft.StandbyPool.StandbyContainerGroupPools.delete", + "Decorators": [], + "Examples": [ + { + "$id": "1419", + "kind": "http", + "name": "StandbyContainerGroupPools_Delete", + "description": "StandbyContainerGroupPools_Delete", + "filePath": "2024-03-01/StandbyContainerGroupPools_Delete.json", + "parameters": [ + { + "$id": "1420", + "parameter": { + "$ref": "1397" + }, + "value": { + "$id": "1421", + "kind": "string", + "type": { + "$ref": "1398" + }, + "value": "2024-03-01" + } + }, + { + "$id": "1422", + "parameter": { + "$ref": "1401" + }, + "value": { + "$id": "1423", + "kind": "string", + "type": { + "$ref": "1402" + }, + "value": "00000000-0000-0000-0000-000000000009" + } + }, + { + "$id": "1424", + "parameter": { + "$ref": "1404" + }, + "value": { + "$id": "1425", + "kind": "string", + "type": { + "$ref": "1405" + }, + "value": "rgstandbypool" + } + }, + { + "$id": "1426", + "parameter": { + "$ref": "1406" + }, + "value": { + "$id": "1427", + "kind": "string", + "type": { + "$ref": "1407" + }, + "value": "pool" + } + } + ], + "responses": [ + { + "$id": "1428", + "response": { + "$ref": "1411" + }, + "statusCode": 202 + }, + { + "$id": "1429", + "response": { + "$ref": "1416" + }, + "statusCode": 204 + } + ] + } + ] + }, + { + "$id": "1430", + "Name": "update", + "ResourceName": "StandbyContainerGroupPoolResource", + "Doc": "Update a StandbyContainerGroupPoolResource", + "Accessibility": "public", + "Parameters": [ + { + "$id": "1431", + "Name": "apiVersion", + "NameInRequest": "api-version", + "Doc": "The API version to use for this operation.", + "Type": { + "$id": "1432", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": true, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "DefaultValue": { + "$id": "1433", + "Type": { + "$id": "1434", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "2024-03-01" + }, + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1435", + "Name": "subscriptionId", + "NameInRequest": "subscriptionId", + "Doc": "The ID of the target subscription. The value must be an UUID.", + "Type": { + "$id": "1436", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "1437", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1438", + "Name": "resourceGroupName", + "NameInRequest": "resourceGroupName", + "Doc": "The name of the resource group. The name is case insensitive.", + "Type": { + "$id": "1439", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1440", + "Name": "standbyContainerGroupPoolName", + "NameInRequest": "standbyContainerGroupPoolName", + "Doc": "Name of the standby container group pool", + "Type": { + "$id": "1441", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1442", + "Name": "contentType", + "NameInRequest": "Content-Type", + "Doc": "Body parameter's content type. Known values are application/json", + "Type": { + "$id": "1443", + "kind": "constant", + "valueType": { + "$id": "1444", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": true, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1445", + "Name": "accept", + "NameInRequest": "Accept", + "Type": { + "$id": "1446", + "kind": "constant", + "valueType": { + "$id": "1447", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1448", + "Name": "properties", + "NameInRequest": "properties", + "Doc": "The resource properties to be updated.", + "Type": { + "$ref": "252" + }, + "Location": "Body", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "1449", + "StatusCodes": [ + 200 + ], + "BodyType": { + "$ref": "170" + }, + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false, + "ContentTypes": [ + "application/json" + ] + } + ], + "HttpMethod": "PATCH", + "RequestBodyMediaType": "Json", + "Uri": "{endpoint}", + "Path": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StandbyPool/standbyContainerGroupPools/{standbyContainerGroupPoolName}", + "RequestMediaTypes": [ + "application/json" + ], + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": false, + "CrossLanguageDefinitionId": "Microsoft.StandbyPool.StandbyContainerGroupPools.update", + "Decorators": [], + "Examples": [ + { + "$id": "1450", + "kind": "http", + "name": "StandbyContainerGroupPools_Update", + "description": "StandbyContainerGroupPools_Update", + "filePath": "2024-03-01/StandbyContainerGroupPools_Update.json", + "parameters": [ + { + "$id": "1451", + "parameter": { + "$ref": "1431" + }, + "value": { + "$id": "1452", + "kind": "string", + "type": { + "$ref": "1432" + }, + "value": "2024-03-01" + } + }, + { + "$id": "1453", + "parameter": { + "$ref": "1435" + }, + "value": { + "$id": "1454", + "kind": "string", + "type": { + "$ref": "1436" + }, + "value": "00000000-0000-0000-0000-000000000009" + } + }, + { + "$id": "1455", + "parameter": { + "$ref": "1438" + }, + "value": { + "$id": "1456", + "kind": "string", + "type": { + "$ref": "1439" + }, + "value": "rgstandbypool" + } + }, + { + "$id": "1457", + "parameter": { + "$ref": "1440" + }, + "value": { + "$id": "1458", + "kind": "string", + "type": { + "$ref": "1441" + }, + "value": "pool" + } + }, + { + "$id": "1459", + "parameter": { + "$ref": "1448" + }, + "value": { + "$id": "1460", + "kind": "model", + "type": { + "$ref": "252" + }, + "value": { + "$id": "1461", + "tags": { + "$id": "1462", + "kind": "dict", + "type": { + "$ref": "254" + }, + "value": { + "$id": "1463" + } + }, + "properties": { + "$id": "1464", + "kind": "model", + "type": { + "$ref": "260" + }, + "value": { + "$id": "1465", + "elasticityProfile": { + "$id": "1466", + "kind": "model", + "type": { + "$ref": "185" + }, + "value": { + "$id": "1467", + "maxReadyCapacity": { + "$id": "1468", + "kind": "number", + "type": { + "$ref": "187" + }, + "value": 1743 + }, + "refillPolicy": { + "$id": "1469", + "kind": "string", + "type": { + "$ref": "22" + }, + "value": "always" + } + } + }, + "containerGroupProperties": { + "$id": "1470", + "kind": "model", + "type": { + "$ref": "196" + }, + "value": { + "$id": "1471", + "containerGroupProfile": { + "$id": "1472", + "kind": "model", + "type": { + "$ref": "198" + }, + "value": { + "$id": "1473", + "id": { + "$id": "1474", + "kind": "string", + "type": { + "$ref": "200" + }, + "value": "/subscriptions/00000000-0000-0000-0000-000000000009/resourceGroups/rgstandbypool/providers/Microsoft.ContainerInstance/containerGroupProfiles/cgProfile" + }, + "revision": { + "$id": "1475", + "kind": "number", + "type": { + "$ref": "205" + }, + "value": 2 + } + } + }, + "subnetIds": { + "$id": "1476", + "kind": "array", + "type": { + "$ref": "211" + }, + "value": [ + { + "$id": "1477", + "kind": "model", + "type": { + "$ref": "212" + }, + "value": { + "$id": "1478", + "id": { + "$id": "1479", + "kind": "string", + "type": { + "$ref": "214" + }, + "value": "/subscriptions/00000000-0000-0000-0000-000000000009/resourceGroups/rgstandbypool/providers/Microsoft.Network/virtualNetworks/cgSubnet/subnets/cgSubnet" + } + } + } + ] + } + } + } + } + } + } + } + } + ], + "responses": [ + { + "$id": "1480", + "response": { + "$ref": "1449" + }, + "statusCode": 200, + "bodyValue": { + "$id": "1481", + "kind": "model", + "type": { + "$ref": "170" + }, + "value": { + "$id": "1482", + "properties": { + "$id": "1483", + "kind": "model", + "type": { + "$ref": "183" + }, + "value": { + "$id": "1484", + "elasticityProfile": { + "$id": "1485", + "kind": "model", + "type": { + "$ref": "185" + }, + "value": { + "$id": "1486", + "maxReadyCapacity": { + "$id": "1487", + "kind": "number", + "type": { + "$ref": "187" + }, + "value": 1743 + }, + "refillPolicy": { + "$id": "1488", + "kind": "string", + "type": { + "$ref": "22" + }, + "value": "always" + } + } + }, + "provisioningState": { + "$id": "1489", + "kind": "string", + "type": { + "$ref": "2" + }, + "value": "Succeeded" + }, + "containerGroupProperties": { + "$id": "1490", + "kind": "model", + "type": { + "$ref": "196" + }, + "value": { + "$id": "1491", + "containerGroupProfile": { + "$id": "1492", + "kind": "model", + "type": { + "$ref": "198" + }, + "value": { + "$id": "1493", + "id": { + "$id": "1494", + "kind": "string", + "type": { + "$ref": "200" + }, + "value": "/subscriptions/00000000-0000-0000-0000-000000000009/resourceGroups/rgstandbypool/providers/Microsoft.ContainerInstance/containerGroupProfiles/cgProfile" + }, + "revision": { + "$id": "1495", + "kind": "number", + "type": { + "$ref": "205" + }, + "value": 2 + } + } + }, + "subnetIds": { + "$id": "1496", + "kind": "array", + "type": { + "$ref": "211" + }, + "value": [ + { + "$id": "1497", + "kind": "model", + "type": { + "$ref": "212" + }, + "value": { + "$id": "1498", + "id": { + "$id": "1499", + "kind": "string", + "type": { + "$ref": "214" + }, + "value": "/subscriptions/00000000-0000-0000-0000-000000000009/resourceGroups/rgstandbypool/providers/Microsoft.Network/virtualNetworks/cgSubnet/subnets/cgSubnet" + } + } + } + ] + } + } + } + } + }, + "tags": { + "$id": "1500", + "kind": "dict", + "type": { + "$ref": "173" + }, + "value": { + "$id": "1501" + } + }, + "location": { + "$id": "1502", + "kind": "string", + "type": { + "$ref": "179" + }, + "value": "West US" + }, + "id": { + "$id": "1503", + "kind": "string", + "type": { + "$ref": "60" + }, + "value": "/subscriptions/00000000-0000-0000-0000-000000000009/resourceGroups/rgstandbypool/providers/Microsoft.StandbyPool/standbyContainerGroupPools/pool" + }, + "name": { + "$id": "1504", + "kind": "string", + "type": { + "$ref": "65" + }, + "value": "pool" + }, + "type": { + "$id": "1505", + "kind": "string", + "type": { + "$ref": "69" + }, + "value": "Microsoft.StandbyPool/standbyContainerGroupPools" + }, + "systemData": { + "$id": "1506", + "kind": "model", + "type": { + "$ref": "74" + }, + "value": { + "$id": "1507", + "createdBy": { + "$id": "1508", + "kind": "string", + "type": { + "$ref": "76" + }, + "value": "pooluser@microsoft.com" + }, + "createdByType": { + "$id": "1509", + "kind": "string", + "type": { + "$ref": "12" + }, + "value": "User" + }, + "createdAt": { + "$id": "1510", + "kind": "string", + "type": { + "$ref": "83" + }, + "value": "2023-09-07T16:33:22.210Z" + }, + "lastModifiedBy": { + "$id": "1511", + "kind": "string", + "type": { + "$ref": "88" + }, + "value": "pooluser@microsoft.com" + }, + "lastModifiedByType": { + "$id": "1512", + "kind": "string", + "type": { + "$ref": "12" + }, + "value": "User" + }, + "lastModifiedAt": { + "$id": "1513", + "kind": "string", + "type": { + "$ref": "95" + }, + "value": "2023-09-07T16:33:22.210Z" + } + } + } + } + } + } + ] + } + ] + }, + { + "$id": "1514", + "Name": "listByResourceGroup", + "ResourceName": "StandbyContainerGroupPoolResource", + "Doc": "List StandbyContainerGroupPoolResource resources by resource group", + "Accessibility": "public", + "Parameters": [ + { + "$id": "1515", + "Name": "apiVersion", + "NameInRequest": "api-version", + "Doc": "The API version to use for this operation.", + "Type": { + "$id": "1516", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": true, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "DefaultValue": { + "$id": "1517", + "Type": { + "$id": "1518", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "2024-03-01" + }, + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1519", + "Name": "subscriptionId", + "NameInRequest": "subscriptionId", + "Doc": "The ID of the target subscription. The value must be an UUID.", + "Type": { + "$id": "1520", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "1521", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1522", + "Name": "resourceGroupName", + "NameInRequest": "resourceGroupName", + "Doc": "The name of the resource group. The name is case insensitive.", + "Type": { + "$id": "1523", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1524", + "Name": "accept", + "NameInRequest": "Accept", + "Type": { + "$id": "1525", + "kind": "constant", + "valueType": { + "$id": "1526", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "1527", + "StatusCodes": [ + 200 + ], + "BodyType": { + "$ref": "269" + }, + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false, + "ContentTypes": [ + "application/json" + ] + } + ], + "HttpMethod": "GET", + "RequestBodyMediaType": "None", + "Uri": "{endpoint}", + "Path": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StandbyPool/standbyContainerGroupPools", + "BufferResponse": true, + "Paging": { + "$id": "1528", + "ItemName": "value", + "NextLinkName": "nextLink" + }, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Microsoft.StandbyPool.StandbyContainerGroupPools.listByResourceGroup", + "Decorators": [], + "Examples": [ + { + "$id": "1529", + "kind": "http", + "name": "StandbyContainerGroupPools_ListByResourceGroup", + "description": "StandbyContainerGroupPools_ListByResourceGroup", + "filePath": "2024-03-01/StandbyContainerGroupPools_ListByResourceGroup.json", + "parameters": [ + { + "$id": "1530", + "parameter": { + "$ref": "1515" + }, + "value": { + "$id": "1531", + "kind": "string", + "type": { + "$ref": "1516" + }, + "value": "2024-03-01" + } + }, + { + "$id": "1532", + "parameter": { + "$ref": "1519" + }, + "value": { + "$id": "1533", + "kind": "string", + "type": { + "$ref": "1520" + }, + "value": "00000000-0000-0000-0000-000000000009" + } + }, + { + "$id": "1534", + "parameter": { + "$ref": "1522" + }, + "value": { + "$id": "1535", + "kind": "string", + "type": { + "$ref": "1523" + }, + "value": "rgstandbypool" + } + } + ], + "responses": [ + { + "$id": "1536", + "response": { + "$ref": "1527" + }, + "statusCode": 200, + "bodyValue": { + "$id": "1537", + "kind": "model", + "type": { + "$ref": "269" + }, + "value": { + "$id": "1538", + "value": { + "$id": "1539", + "kind": "array", + "type": { + "$ref": "271" + }, + "value": [ + { + "$id": "1540", + "kind": "model", + "type": { + "$ref": "170" + }, + "value": { + "$id": "1541", + "properties": { + "$id": "1542", + "kind": "model", + "type": { + "$ref": "183" + }, + "value": { + "$id": "1543", + "elasticityProfile": { + "$id": "1544", + "kind": "model", + "type": { + "$ref": "185" + }, + "value": { + "$id": "1545", + "maxReadyCapacity": { + "$id": "1546", + "kind": "number", + "type": { + "$ref": "187" + }, + "value": 688 + }, + "refillPolicy": { + "$id": "1547", + "kind": "string", + "type": { + "$ref": "22" + }, + "value": "always" + } + } + }, + "provisioningState": { + "$id": "1548", + "kind": "string", + "type": { + "$ref": "2" + }, + "value": "Succeeded" + }, + "containerGroupProperties": { + "$id": "1549", + "kind": "model", + "type": { + "$ref": "196" + }, + "value": { + "$id": "1550", + "containerGroupProfile": { + "$id": "1551", + "kind": "model", + "type": { + "$ref": "198" + }, + "value": { + "$id": "1552", + "id": { + "$id": "1553", + "kind": "string", + "type": { + "$ref": "200" + }, + "value": "/subscriptions/00000000-0000-0000-0000-000000000009/resourceGroups/rgstandbypool/providers/Microsoft.ContainerInstance/containerGroupProfiles/cgProfile" + }, + "revision": { + "$id": "1554", + "kind": "number", + "type": { + "$ref": "205" + }, + "value": 1 + } + } + }, + "subnetIds": { + "$id": "1555", + "kind": "array", + "type": { + "$ref": "211" + }, + "value": [ + { + "$id": "1556", + "kind": "model", + "type": { + "$ref": "212" + }, + "value": { + "$id": "1557", + "id": { + "$id": "1558", + "kind": "string", + "type": { + "$ref": "214" + }, + "value": "/subscriptions/00000000-0000-0000-0000-000000000009/resourceGroups/rgstandbypool/providers/Microsoft.Network/virtualNetworks/cgSubnet/subnets/cgSubnet" + } + } + } + ] + } + } + } + } + }, + "tags": { + "$id": "1559", + "kind": "dict", + "type": { + "$ref": "173" + }, + "value": { + "$id": "1560" + } + }, + "location": { + "$id": "1561", + "kind": "string", + "type": { + "$ref": "179" + }, + "value": "West US" + }, + "id": { + "$id": "1562", + "kind": "string", + "type": { + "$ref": "60" + }, + "value": "/subscriptions/00000000-0000-0000-0000-000000000009/resourceGroups/rgstandbypool/providers/Microsoft.StandbyPool/standbyContainerGroupPools/pool" + }, + "name": { + "$id": "1563", + "kind": "string", + "type": { + "$ref": "65" + }, + "value": "pool" + }, + "type": { + "$id": "1564", + "kind": "string", + "type": { + "$ref": "69" + }, + "value": "Microsoft.StandbyPool/standbyContainerGroupPools" + }, + "systemData": { + "$id": "1565", + "kind": "model", + "type": { + "$ref": "74" + }, + "value": { + "$id": "1566", + "createdBy": { + "$id": "1567", + "kind": "string", + "type": { + "$ref": "76" + }, + "value": "pooluser@microsoft.com" + }, + "createdByType": { + "$id": "1568", + "kind": "string", + "type": { + "$ref": "12" + }, + "value": "User" + }, + "createdAt": { + "$id": "1569", + "kind": "string", + "type": { + "$ref": "83" + }, + "value": "2023-09-07T16:33:22.210Z" + }, + "lastModifiedBy": { + "$id": "1570", + "kind": "string", + "type": { + "$ref": "88" + }, + "value": "pooluser@microsoft.com" + }, + "lastModifiedByType": { + "$id": "1571", + "kind": "string", + "type": { + "$ref": "12" + }, + "value": "User" + }, + "lastModifiedAt": { + "$id": "1572", + "kind": "string", + "type": { + "$ref": "95" + }, + "value": "2023-09-07T16:33:22.210Z" + } + } + } + } + } + ] + }, + "nextLink": { + "$id": "1573", + "kind": "string", + "type": { + "$ref": "275" + }, + "value": "https://microsoft.com/a" + } + } + } + } + ] + } + ] + }, + { + "$id": "1574", + "Name": "listBySubscription", + "ResourceName": "StandbyContainerGroupPoolResource", + "Doc": "List StandbyContainerGroupPoolResource resources by subscription ID", + "Accessibility": "public", + "Parameters": [ + { + "$id": "1575", + "Name": "apiVersion", + "NameInRequest": "api-version", + "Doc": "The API version to use for this operation.", + "Type": { + "$id": "1576", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": true, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "DefaultValue": { + "$id": "1577", + "Type": { + "$id": "1578", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "2024-03-01" + }, + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1579", + "Name": "subscriptionId", + "NameInRequest": "subscriptionId", + "Doc": "The ID of the target subscription. The value must be an UUID.", + "Type": { + "$id": "1580", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "1581", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1582", + "Name": "accept", + "NameInRequest": "Accept", + "Type": { + "$id": "1583", + "kind": "constant", + "valueType": { + "$id": "1584", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "1585", + "StatusCodes": [ + 200 + ], + "BodyType": { + "$ref": "269" + }, + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false, + "ContentTypes": [ + "application/json" + ] + } + ], + "HttpMethod": "GET", + "RequestBodyMediaType": "None", + "Uri": "{endpoint}", + "Path": "/subscriptions/{subscriptionId}/providers/Microsoft.StandbyPool/standbyContainerGroupPools", + "BufferResponse": true, + "Paging": { + "$id": "1586", + "ItemName": "value", + "NextLinkName": "nextLink" + }, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Microsoft.StandbyPool.StandbyContainerGroupPools.listBySubscription", + "Decorators": [], + "Examples": [ + { + "$id": "1587", + "kind": "http", + "name": "StandbyContainerGroupPools_ListBySubscription", + "description": "StandbyContainerGroupPools_ListBySubscription", + "filePath": "2024-03-01/StandbyContainerGroupPools_ListBySubscription.json", + "parameters": [ + { + "$id": "1588", + "parameter": { + "$ref": "1575" + }, + "value": { + "$id": "1589", + "kind": "string", + "type": { + "$ref": "1576" + }, + "value": "2024-03-01" + } + }, + { + "$id": "1590", + "parameter": { + "$ref": "1579" + }, + "value": { + "$id": "1591", + "kind": "string", + "type": { + "$ref": "1580" + }, + "value": "00000000-0000-0000-0000-000000000009" + } + } + ], + "responses": [ + { + "$id": "1592", + "response": { + "$ref": "1585" + }, + "statusCode": 200, + "bodyValue": { + "$id": "1593", + "kind": "model", + "type": { + "$ref": "269" + }, + "value": { + "$id": "1594", + "value": { + "$id": "1595", + "kind": "array", + "type": { + "$ref": "271" + }, + "value": [ + { + "$id": "1596", + "kind": "model", + "type": { + "$ref": "170" + }, + "value": { + "$id": "1597", + "properties": { + "$id": "1598", + "kind": "model", + "type": { + "$ref": "183" + }, + "value": { + "$id": "1599", + "elasticityProfile": { + "$id": "1600", + "kind": "model", + "type": { + "$ref": "185" + }, + "value": { + "$id": "1601", + "maxReadyCapacity": { + "$id": "1602", + "kind": "number", + "type": { + "$ref": "187" + }, + "value": 688 + }, + "refillPolicy": { + "$id": "1603", + "kind": "string", + "type": { + "$ref": "22" + }, + "value": "always" + } + } + }, + "provisioningState": { + "$id": "1604", + "kind": "string", + "type": { + "$ref": "2" + }, + "value": "Succeeded" + }, + "containerGroupProperties": { + "$id": "1605", + "kind": "model", + "type": { + "$ref": "196" + }, + "value": { + "$id": "1606", + "containerGroupProfile": { + "$id": "1607", + "kind": "model", + "type": { + "$ref": "198" + }, + "value": { + "$id": "1608", + "id": { + "$id": "1609", + "kind": "string", + "type": { + "$ref": "200" + }, + "value": "/subscriptions/00000000-0000-0000-0000-000000000009/resourceGroups/rgstandbypool/providers/Microsoft.ContainerInstance/containerGroupProfiles/cgProfile" + }, + "revision": { + "$id": "1610", + "kind": "number", + "type": { + "$ref": "205" + }, + "value": 1 + } + } + }, + "subnetIds": { + "$id": "1611", + "kind": "array", + "type": { + "$ref": "211" + }, + "value": [ + { + "$id": "1612", + "kind": "model", + "type": { + "$ref": "212" + }, + "value": { + "$id": "1613", + "id": { + "$id": "1614", + "kind": "string", + "type": { + "$ref": "214" + }, + "value": "/subscriptions/00000000-0000-0000-0000-000000000009/resourceGroups/rgstandbypool/providers/Microsoft.Network/virtualNetworks/cgSubnet/subnets/cgSubnet" + } + } + } + ] + } + } + } + } + }, + "tags": { + "$id": "1615", + "kind": "dict", + "type": { + "$ref": "173" + }, + "value": { + "$id": "1616" + } + }, + "location": { + "$id": "1617", + "kind": "string", + "type": { + "$ref": "179" + }, + "value": "West US" + }, + "id": { + "$id": "1618", + "kind": "string", + "type": { + "$ref": "60" + }, + "value": "/subscriptions/00000000-0000-0000-0000-000000000009/resourceGroups/rgstandbypool/providers/Microsoft.StandbyPool/standbyContainerGroupPools/pool" + }, + "name": { + "$id": "1619", + "kind": "string", + "type": { + "$ref": "65" + }, + "value": "pool" + }, + "type": { + "$id": "1620", + "kind": "string", + "type": { + "$ref": "69" + }, + "value": "Microsoft.StandbyPool/standbyContainerGroupPools" + }, + "systemData": { + "$id": "1621", + "kind": "model", + "type": { + "$ref": "74" + }, + "value": { + "$id": "1622", + "createdBy": { + "$id": "1623", + "kind": "string", + "type": { + "$ref": "76" + }, + "value": "pooluser@microsoft.com" + }, + "createdByType": { + "$id": "1624", + "kind": "string", + "type": { + "$ref": "12" + }, + "value": "User" + }, + "createdAt": { + "$id": "1625", + "kind": "string", + "type": { + "$ref": "83" + }, + "value": "2023-09-07T16:33:22.210Z" + }, + "lastModifiedBy": { + "$id": "1626", + "kind": "string", + "type": { + "$ref": "88" + }, + "value": "pooluser@microsoft.com" + }, + "lastModifiedByType": { + "$id": "1627", + "kind": "string", + "type": { + "$ref": "12" + }, + "value": "User" + }, + "lastModifiedAt": { + "$id": "1628", + "kind": "string", + "type": { + "$ref": "95" + }, + "value": "2023-09-07T16:33:22.210Z" + } + } + } + } + } + ] + }, + "nextLink": { + "$id": "1629", + "kind": "string", + "type": { + "$ref": "275" + }, + "value": "https://microsoft.com/a" + } + } + } + } + ] + } + ] + } + ], + "Protocol": { + "$id": "1630" + }, + "Parent": "StandbyPoolClient", + "Parameters": [ + { + "$id": "1631", + "Name": "endpoint", + "NameInRequest": "endpoint", + "Doc": "Service host", + "Type": { + "$id": "1632", + "kind": "url", + "name": "url", + "crossLanguageDefinitionId": "TypeSpec.url" + }, + "Location": "Uri", + "IsApiVersion": false, + "IsResourceParameter": false, + "IsContentType": false, + "IsRequired": true, + "IsEndpoint": true, + "SkipUrlEncoding": false, + "Explode": false, + "Kind": "Client", + "DefaultValue": { + "$id": "1633", + "Type": { + "$id": "1634", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "https://management.azure.com" + } + } + ], + "Decorators": [] + }, + { + "$id": "1635", + "Name": "StandbyContainerGroupPoolRuntimeViews", + "ClientNamespace": "Microsoft.StandbyPool", + "Operations": [ + { + "$id": "1636", + "Name": "get", + "ResourceName": "StandbyContainerGroupPoolRuntimeViewResource", + "Doc": "Get a StandbyContainerGroupPoolRuntimeViewResource", + "Accessibility": "public", + "Parameters": [ + { + "$id": "1637", + "Name": "apiVersion", + "NameInRequest": "api-version", + "Doc": "The API version to use for this operation.", + "Type": { + "$id": "1638", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": true, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "DefaultValue": { + "$id": "1639", + "Type": { + "$id": "1640", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "2024-03-01" + }, + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1641", + "Name": "subscriptionId", + "NameInRequest": "subscriptionId", + "Doc": "The ID of the target subscription. The value must be an UUID.", + "Type": { + "$id": "1642", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "1643", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1644", + "Name": "resourceGroupName", + "NameInRequest": "resourceGroupName", + "Doc": "The name of the resource group. The name is case insensitive.", + "Type": { + "$id": "1645", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1646", + "Name": "standbyContainerGroupPoolName", + "NameInRequest": "standbyContainerGroupPoolName", + "Doc": "Name of the standby container group pool", + "Type": { + "$id": "1647", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1648", + "Name": "runtimeView", + "NameInRequest": "runtimeView", + "Doc": "The unique identifier for the runtime view. The input string should be the word 'latest', which will get the latest runtime view of the pool, otherwise the request will fail with NotFound exception.", + "Type": { + "$id": "1649", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1650", + "Name": "accept", + "NameInRequest": "Accept", + "Type": { + "$id": "1651", + "kind": "constant", + "valueType": { + "$id": "1652", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "1653", + "StatusCodes": [ + 200 + ], + "BodyType": { + "$ref": "56" + }, + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false, + "ContentTypes": [ + "application/json" + ] + } + ], + "HttpMethod": "GET", + "RequestBodyMediaType": "None", + "Uri": "{endpoint}", + "Path": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StandbyPool/standbyContainerGroupPools/{standbyContainerGroupPoolName}/runtimeViews/{runtimeView}", + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Microsoft.StandbyPool.StandbyContainerGroupPoolRuntimeViews.get", + "Decorators": [], + "Examples": [ + { + "$id": "1654", + "kind": "http", + "name": "StandbyContainerGroupPoolRuntimeViews_Get", + "description": "StandbyContainerGroupPoolRuntimeViews_Get", + "filePath": "2024-03-01/StandbyContainerGroupPoolRuntimeViews_Get.json", + "parameters": [ + { + "$id": "1655", + "parameter": { + "$ref": "1637" + }, + "value": { + "$id": "1656", + "kind": "string", + "type": { + "$ref": "1638" + }, + "value": "2024-03-01" + } + }, + { + "$id": "1657", + "parameter": { + "$ref": "1641" + }, + "value": { + "$id": "1658", + "kind": "string", + "type": { + "$ref": "1642" + }, + "value": "00000000-0000-0000-0000-000000000009" + } + }, + { + "$id": "1659", + "parameter": { + "$ref": "1644" + }, + "value": { + "$id": "1660", + "kind": "string", + "type": { + "$ref": "1645" + }, + "value": "rgstandbypool" + } + }, + { + "$id": "1661", + "parameter": { + "$ref": "1646" + }, + "value": { + "$id": "1662", + "kind": "string", + "type": { + "$ref": "1647" + }, + "value": "pool" + } + }, + { + "$id": "1663", + "parameter": { + "$ref": "1648" + }, + "value": { + "$id": "1664", + "kind": "string", + "type": { + "$ref": "1649" + }, + "value": "latest" + } + } + ], + "responses": [ + { + "$id": "1665", + "response": { + "$ref": "1653" + }, + "statusCode": 200, + "bodyValue": { + "$id": "1666", + "kind": "model", + "type": { + "$ref": "56" + }, + "value": { + "$id": "1667", + "properties": { + "$id": "1668", + "kind": "model", + "type": { + "$ref": "102" + }, + "value": { + "$id": "1669", + "instanceCountSummary": { + "$id": "1670", + "kind": "array", + "type": { + "$ref": "104" + }, + "value": [ + { + "$id": "1671", + "kind": "model", + "type": { + "$ref": "105" + }, + "value": { + "$id": "1672", + "instanceCountsByState": { + "$id": "1673", + "kind": "array", + "type": { + "$ref": "107" + }, + "value": [ + { + "$id": "1674", + "kind": "model", + "type": { + "$ref": "108" + }, + "value": { + "$id": "1675", + "state": { + "$id": "1676", + "kind": "string", + "type": { + "$ref": "110" + }, + "value": "creating" + }, + "count": { + "$id": "1677", + "kind": "number", + "type": { + "$ref": "114" + }, + "value": 100 + } + } + }, + { + "$id": "1678", + "kind": "model", + "type": { + "$ref": "108" + }, + "value": { + "$id": "1679", + "state": { + "$id": "1680", + "kind": "string", + "type": { + "$ref": "110" + }, + "value": "running" + }, + "count": { + "$id": "1681", + "kind": "number", + "type": { + "$ref": "114" + }, + "value": 500 + } + } + }, + { + "$id": "1682", + "kind": "model", + "type": { + "$ref": "108" + }, + "value": { + "$id": "1683", + "state": { + "$id": "1684", + "kind": "string", + "type": { + "$ref": "110" + }, + "value": "deleting" + }, + "count": { + "$id": "1685", + "kind": "number", + "type": { + "$ref": "114" + }, + "value": 20 + } + } + } + ] + } + } + } + ] + }, + "provisioningState": { + "$id": "1686", + "kind": "string", + "type": { + "$ref": "2" + }, + "value": "Succeeded" + } + } + }, + "id": { + "$id": "1687", + "kind": "string", + "type": { + "$ref": "60" + }, + "value": "/subscriptions/00000000-0000-0000-0000-000000000009/resourceGroups/rgstandbypool/providers/Microsoft.StandbyPool/standbyContainerGroupPools/pool/runtimeViews/latest" + }, + "name": { + "$id": "1688", + "kind": "string", + "type": { + "$ref": "65" + }, + "value": "pool" + }, + "type": { + "$id": "1689", + "kind": "string", + "type": { + "$ref": "69" + }, + "value": "Microsoft.StandbyPool/standbyContainerGroupPools/runtimeViews" + }, + "systemData": { + "$id": "1690", + "kind": "model", + "type": { + "$ref": "74" + }, + "value": { + "$id": "1691", + "createdBy": { + "$id": "1692", + "kind": "string", + "type": { + "$ref": "76" + }, + "value": "pooluser@microsoft.com" + }, + "createdByType": { + "$id": "1693", + "kind": "string", + "type": { + "$ref": "12" + }, + "value": "User" + }, + "createdAt": { + "$id": "1694", + "kind": "string", + "type": { + "$ref": "83" + }, + "value": "2023-09-07T16:33:22.210Z" + }, + "lastModifiedBy": { + "$id": "1695", + "kind": "string", + "type": { + "$ref": "88" + }, + "value": "pooluser@microsoft.com" + }, + "lastModifiedByType": { + "$id": "1696", + "kind": "string", + "type": { + "$ref": "12" + }, + "value": "User" + }, + "lastModifiedAt": { + "$id": "1697", + "kind": "string", + "type": { + "$ref": "95" + }, + "value": "2023-09-07T16:33:22.210Z" + } + } + } + } + } + } + ] + } + ] + }, + { + "$id": "1698", + "Name": "listByStandbyPool", + "ResourceName": "StandbyContainerGroupPoolRuntimeViewResource", + "Doc": "List StandbyContainerGroupPoolRuntimeViewResource resources by StandbyContainerGroupPoolResource", + "Accessibility": "public", + "Parameters": [ + { + "$id": "1699", + "Name": "apiVersion", + "NameInRequest": "api-version", + "Doc": "The API version to use for this operation.", + "Type": { + "$id": "1700", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": true, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "DefaultValue": { + "$id": "1701", + "Type": { + "$id": "1702", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "2024-03-01" + }, + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1703", + "Name": "subscriptionId", + "NameInRequest": "subscriptionId", + "Doc": "The ID of the target subscription. The value must be an UUID.", + "Type": { + "$id": "1704", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "1705", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1706", + "Name": "resourceGroupName", + "NameInRequest": "resourceGroupName", + "Doc": "The name of the resource group. The name is case insensitive.", + "Type": { + "$id": "1707", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1708", + "Name": "standbyContainerGroupPoolName", + "NameInRequest": "standbyContainerGroupPoolName", + "Doc": "Name of the standby container group pool", + "Type": { + "$id": "1709", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1710", + "Name": "accept", + "NameInRequest": "Accept", + "Type": { + "$id": "1711", + "kind": "constant", + "valueType": { + "$id": "1712", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "1713", + "StatusCodes": [ + 200 + ], + "BodyType": { + "$ref": "160" + }, + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false, + "ContentTypes": [ + "application/json" + ] + } + ], + "HttpMethod": "GET", + "RequestBodyMediaType": "None", + "Uri": "{endpoint}", + "Path": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StandbyPool/standbyContainerGroupPools/{standbyContainerGroupPoolName}/runtimeViews", + "BufferResponse": true, + "Paging": { + "$id": "1714", + "ItemName": "value", + "NextLinkName": "nextLink" + }, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Microsoft.StandbyPool.StandbyContainerGroupPoolRuntimeViews.listByStandbyPool", + "Decorators": [], + "Examples": [ + { + "$id": "1715", + "kind": "http", + "name": "StandbyContainerGroupPoolRuntimeViews_ListByStandbyPool", + "description": "StandbyContainerGroupPoolRuntimeViews_ListByStandbyPool", + "filePath": "2024-03-01/StandbyContainerGroupPoolRuntimeViews_ListByStandbyPool.json", + "parameters": [ + { + "$id": "1716", + "parameter": { + "$ref": "1699" + }, + "value": { + "$id": "1717", + "kind": "string", + "type": { + "$ref": "1700" + }, + "value": "2024-03-01" + } + }, + { + "$id": "1718", + "parameter": { + "$ref": "1703" + }, + "value": { + "$id": "1719", + "kind": "string", + "type": { + "$ref": "1704" + }, + "value": "00000000-0000-0000-0000-000000000009" + } + }, + { + "$id": "1720", + "parameter": { + "$ref": "1706" + }, + "value": { + "$id": "1721", + "kind": "string", + "type": { + "$ref": "1707" + }, + "value": "rgstandbypool" + } + }, + { + "$id": "1722", + "parameter": { + "$ref": "1708" + }, + "value": { + "$id": "1723", + "kind": "string", + "type": { + "$ref": "1709" + }, + "value": "pool" + } + } + ], + "responses": [ + { + "$id": "1724", + "response": { + "$ref": "1713" + }, + "statusCode": 200, + "bodyValue": { + "$id": "1725", + "kind": "model", + "type": { + "$ref": "160" + }, + "value": { + "$id": "1726", + "value": { + "$id": "1727", + "kind": "array", + "type": { + "$ref": "162" + }, + "value": [ + { + "$id": "1728", + "kind": "model", + "type": { + "$ref": "56" + }, + "value": { + "$id": "1729", + "properties": { + "$id": "1730", + "kind": "model", + "type": { + "$ref": "102" + }, + "value": { + "$id": "1731", + "instanceCountSummary": { + "$id": "1732", + "kind": "array", + "type": { + "$ref": "104" + }, + "value": [ + { + "$id": "1733", + "kind": "model", + "type": { + "$ref": "105" + }, + "value": { + "$id": "1734", + "instanceCountsByState": { + "$id": "1735", + "kind": "array", + "type": { + "$ref": "107" + }, + "value": [ + { + "$id": "1736", + "kind": "model", + "type": { + "$ref": "108" + }, + "value": { + "$id": "1737", + "state": { + "$id": "1738", + "kind": "string", + "type": { + "$ref": "110" + }, + "value": "creating" + }, + "count": { + "$id": "1739", + "kind": "number", + "type": { + "$ref": "114" + }, + "value": 100 + } + } + }, + { + "$id": "1740", + "kind": "model", + "type": { + "$ref": "108" + }, + "value": { + "$id": "1741", + "state": { + "$id": "1742", + "kind": "string", + "type": { + "$ref": "110" + }, + "value": "running" + }, + "count": { + "$id": "1743", + "kind": "number", + "type": { + "$ref": "114" + }, + "value": 500 + } + } + }, + { + "$id": "1744", + "kind": "model", + "type": { + "$ref": "108" + }, + "value": { + "$id": "1745", + "state": { + "$id": "1746", + "kind": "string", + "type": { + "$ref": "110" + }, + "value": "deleting" + }, + "count": { + "$id": "1747", + "kind": "number", + "type": { + "$ref": "114" + }, + "value": 20 + } + } + } + ] + } + } + } + ] + }, + "provisioningState": { + "$id": "1748", + "kind": "string", + "type": { + "$ref": "2" + }, + "value": "Succeeded" + } + } + }, + "id": { + "$id": "1749", + "kind": "string", + "type": { + "$ref": "60" + }, + "value": "/subscriptions/00000000-0000-0000-0000-000000000009/resourceGroups/rgstandbypool/providers/Microsoft.StandbyPool/standbyContainerGroupPools/pool/runtimeViews/latest" + }, + "name": { + "$id": "1750", + "kind": "string", + "type": { + "$ref": "65" + }, + "value": "pool" + }, + "type": { + "$id": "1751", + "kind": "string", + "type": { + "$ref": "69" + }, + "value": "Microsoft.StandbyPool/standbyContainerGroupPools/runtimeViews" + }, + "systemData": { + "$id": "1752", + "kind": "model", + "type": { + "$ref": "74" + }, + "value": { + "$id": "1753", + "createdBy": { + "$id": "1754", + "kind": "string", + "type": { + "$ref": "76" + }, + "value": "pooluser@microsoft.com" + }, + "createdByType": { + "$id": "1755", + "kind": "string", + "type": { + "$ref": "12" + }, + "value": "User" + }, + "createdAt": { + "$id": "1756", + "kind": "string", + "type": { + "$ref": "83" + }, + "value": "2023-09-07T16:33:22.210Z" + }, + "lastModifiedBy": { + "$id": "1757", + "kind": "string", + "type": { + "$ref": "88" + }, + "value": "pooluser@microsoft.com" + }, + "lastModifiedByType": { + "$id": "1758", + "kind": "string", + "type": { + "$ref": "12" + }, + "value": "User" + }, + "lastModifiedAt": { + "$id": "1759", + "kind": "string", + "type": { + "$ref": "95" + }, + "value": "2023-09-07T16:33:22.210Z" + } + } + } + } + } + ] + }, + "nextLink": { + "$id": "1760", + "kind": "string", + "type": { + "$ref": "166" + }, + "value": "https://microsoft.com/a" + } + } + } + } + ] + } + ] + } + ], + "Protocol": { + "$id": "1761" + }, + "Parent": "StandbyPoolClient", + "Parameters": [ + { + "$id": "1762", + "Name": "endpoint", + "NameInRequest": "endpoint", + "Doc": "Service host", + "Type": { + "$id": "1763", + "kind": "url", + "name": "url", + "crossLanguageDefinitionId": "TypeSpec.url" + }, + "Location": "Uri", + "IsApiVersion": false, + "IsResourceParameter": false, + "IsContentType": false, + "IsRequired": true, + "IsEndpoint": true, + "SkipUrlEncoding": false, + "Explode": false, + "Kind": "Client", + "DefaultValue": { + "$id": "1764", + "Type": { + "$id": "1765", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "https://management.azure.com" + } + } + ], + "Decorators": [] + } + ], + "Auth": { + "$id": "1766", + "OAuth2": { + "$id": "1767", + "Scopes": [ + "user_impersonation" + ] + } + } +} diff --git a/sdk/terraform/Azure.ResourceManager.Terraform/api/Azure.ResourceManager.Terraform.net8.0.cs b/sdk/terraform/Azure.ResourceManager.Terraform/api/Azure.ResourceManager.Terraform.net8.0.cs index 6ba77b806a8b..0fc04bdf06eb 100644 --- a/sdk/terraform/Azure.ResourceManager.Terraform/api/Azure.ResourceManager.Terraform.net8.0.cs +++ b/sdk/terraform/Azure.ResourceManager.Terraform/api/Azure.ResourceManager.Terraform.net8.0.cs @@ -19,11 +19,31 @@ namespace Azure.ResourceManager.Terraform.Models { public static partial class ArmTerraformModelFactory { - public static Azure.ResourceManager.Terraform.Models.ExportQueryTerraform ExportQueryTerraform(Azure.ResourceManager.Terraform.Models.TargetTerraformProvider? targetProvider = default(Azure.ResourceManager.Terraform.Models.TargetTerraformProvider?), bool? isOutputFullPropertiesEnabled = default(bool?), bool? isMaskSensitiveEnabled = default(bool?), string query = null, string namePattern = null, bool? isRecursive = default(bool?)) { throw null; } + public static Azure.ResourceManager.Terraform.Models.ExportQueryTerraform ExportQueryTerraform(Azure.ResourceManager.Terraform.Models.TargetTerraformProvider? targetProvider = default(Azure.ResourceManager.Terraform.Models.TargetTerraformProvider?), bool? isOutputFullPropertiesEnabled = default(bool?), bool? isMaskSensitiveEnabled = default(bool?), string query = null, string namePattern = null, bool? isRecursive = default(bool?), string table = null, Azure.ResourceManager.Terraform.Models.AuthorizationScopeFilter? authorizationScopeFilter = default(Azure.ResourceManager.Terraform.Models.AuthorizationScopeFilter?)) { throw null; } public static Azure.ResourceManager.Terraform.Models.ExportResourceGroupTerraform ExportResourceGroupTerraform(Azure.ResourceManager.Terraform.Models.TargetTerraformProvider? targetProvider = default(Azure.ResourceManager.Terraform.Models.TargetTerraformProvider?), bool? isOutputFullPropertiesEnabled = default(bool?), bool? isMaskSensitiveEnabled = default(bool?), string resourceGroupName = null, string namePattern = null) { throw null; } - public static Azure.ResourceManager.Terraform.Models.TerraformExportResult TerraformExportResult(string configuration = null, System.Collections.Generic.IEnumerable skippedResourceIds = null, System.Collections.Generic.IEnumerable errors = null) { throw null; } + public static Azure.ResourceManager.Terraform.Models.TerraformExportResult TerraformExportResult(string configuration = null, string import = null, System.Collections.Generic.IEnumerable skippedResourceIds = null, System.Collections.Generic.IEnumerable errors = null) { throw null; } public static Azure.ResourceManager.Terraform.Models.TerraformOperationStatus TerraformOperationStatus(Azure.ResourceManager.Terraform.Models.TerraformExportResult properties = null, Azure.ResourceManager.Terraform.Models.TerraformResourceProvisioningState status = default(Azure.ResourceManager.Terraform.Models.TerraformResourceProvisioningState), string name = null, System.DateTimeOffset? startOn = default(System.DateTimeOffset?), System.DateTimeOffset? endOn = default(System.DateTimeOffset?), double? percentComplete = default(double?), Azure.ResponseError error = null) { throw null; } } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct AuthorizationScopeFilter : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public AuthorizationScopeFilter(string value) { throw null; } + public static Azure.ResourceManager.Terraform.Models.AuthorizationScopeFilter AtScopeAboveAndBelow { get { throw null; } } + public static Azure.ResourceManager.Terraform.Models.AuthorizationScopeFilter AtScopeAndAbove { get { throw null; } } + public static Azure.ResourceManager.Terraform.Models.AuthorizationScopeFilter AtScopeAndBelow { get { throw null; } } + public static Azure.ResourceManager.Terraform.Models.AuthorizationScopeFilter AtScopeExact { get { throw null; } } + public bool Equals(Azure.ResourceManager.Terraform.Models.AuthorizationScopeFilter other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.Terraform.Models.AuthorizationScopeFilter left, Azure.ResourceManager.Terraform.Models.AuthorizationScopeFilter right) { throw null; } + public static implicit operator Azure.ResourceManager.Terraform.Models.AuthorizationScopeFilter (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Terraform.Models.AuthorizationScopeFilter left, Azure.ResourceManager.Terraform.Models.AuthorizationScopeFilter right) { throw null; } + public override string ToString() { throw null; } + } public abstract partial class CommonExportProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { protected CommonExportProperties() { } @@ -40,9 +60,11 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer public partial class ExportQueryTerraform : Azure.ResourceManager.Terraform.Models.CommonExportProperties, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public ExportQueryTerraform(string query) { } + public Azure.ResourceManager.Terraform.Models.AuthorizationScopeFilter? AuthorizationScopeFilter { get { throw null; } set { } } public bool? IsRecursive { get { throw null; } set { } } public string NamePattern { get { throw null; } set { } } public string Query { get { throw null; } } + public string Table { get { throw null; } set { } } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Terraform.Models.ExportQueryTerraform System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } @@ -99,6 +121,7 @@ public partial class TerraformExportResult : System.ClientModel.Primitives.IJson internal TerraformExportResult() { } public string Configuration { get { throw null; } } public System.Collections.Generic.IReadOnlyList Errors { get { throw null; } } + public string Import { get { throw null; } } public System.Collections.Generic.IReadOnlyList SkippedResourceIds { get { throw null; } } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Terraform.Models.TerraformExportResult System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } diff --git a/sdk/terraform/Azure.ResourceManager.Terraform/api/Azure.ResourceManager.Terraform.netstandard2.0.cs b/sdk/terraform/Azure.ResourceManager.Terraform/api/Azure.ResourceManager.Terraform.netstandard2.0.cs index 6ba77b806a8b..0fc04bdf06eb 100644 --- a/sdk/terraform/Azure.ResourceManager.Terraform/api/Azure.ResourceManager.Terraform.netstandard2.0.cs +++ b/sdk/terraform/Azure.ResourceManager.Terraform/api/Azure.ResourceManager.Terraform.netstandard2.0.cs @@ -19,11 +19,31 @@ namespace Azure.ResourceManager.Terraform.Models { public static partial class ArmTerraformModelFactory { - public static Azure.ResourceManager.Terraform.Models.ExportQueryTerraform ExportQueryTerraform(Azure.ResourceManager.Terraform.Models.TargetTerraformProvider? targetProvider = default(Azure.ResourceManager.Terraform.Models.TargetTerraformProvider?), bool? isOutputFullPropertiesEnabled = default(bool?), bool? isMaskSensitiveEnabled = default(bool?), string query = null, string namePattern = null, bool? isRecursive = default(bool?)) { throw null; } + public static Azure.ResourceManager.Terraform.Models.ExportQueryTerraform ExportQueryTerraform(Azure.ResourceManager.Terraform.Models.TargetTerraformProvider? targetProvider = default(Azure.ResourceManager.Terraform.Models.TargetTerraformProvider?), bool? isOutputFullPropertiesEnabled = default(bool?), bool? isMaskSensitiveEnabled = default(bool?), string query = null, string namePattern = null, bool? isRecursive = default(bool?), string table = null, Azure.ResourceManager.Terraform.Models.AuthorizationScopeFilter? authorizationScopeFilter = default(Azure.ResourceManager.Terraform.Models.AuthorizationScopeFilter?)) { throw null; } public static Azure.ResourceManager.Terraform.Models.ExportResourceGroupTerraform ExportResourceGroupTerraform(Azure.ResourceManager.Terraform.Models.TargetTerraformProvider? targetProvider = default(Azure.ResourceManager.Terraform.Models.TargetTerraformProvider?), bool? isOutputFullPropertiesEnabled = default(bool?), bool? isMaskSensitiveEnabled = default(bool?), string resourceGroupName = null, string namePattern = null) { throw null; } - public static Azure.ResourceManager.Terraform.Models.TerraformExportResult TerraformExportResult(string configuration = null, System.Collections.Generic.IEnumerable skippedResourceIds = null, System.Collections.Generic.IEnumerable errors = null) { throw null; } + public static Azure.ResourceManager.Terraform.Models.TerraformExportResult TerraformExportResult(string configuration = null, string import = null, System.Collections.Generic.IEnumerable skippedResourceIds = null, System.Collections.Generic.IEnumerable errors = null) { throw null; } public static Azure.ResourceManager.Terraform.Models.TerraformOperationStatus TerraformOperationStatus(Azure.ResourceManager.Terraform.Models.TerraformExportResult properties = null, Azure.ResourceManager.Terraform.Models.TerraformResourceProvisioningState status = default(Azure.ResourceManager.Terraform.Models.TerraformResourceProvisioningState), string name = null, System.DateTimeOffset? startOn = default(System.DateTimeOffset?), System.DateTimeOffset? endOn = default(System.DateTimeOffset?), double? percentComplete = default(double?), Azure.ResponseError error = null) { throw null; } } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct AuthorizationScopeFilter : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public AuthorizationScopeFilter(string value) { throw null; } + public static Azure.ResourceManager.Terraform.Models.AuthorizationScopeFilter AtScopeAboveAndBelow { get { throw null; } } + public static Azure.ResourceManager.Terraform.Models.AuthorizationScopeFilter AtScopeAndAbove { get { throw null; } } + public static Azure.ResourceManager.Terraform.Models.AuthorizationScopeFilter AtScopeAndBelow { get { throw null; } } + public static Azure.ResourceManager.Terraform.Models.AuthorizationScopeFilter AtScopeExact { get { throw null; } } + public bool Equals(Azure.ResourceManager.Terraform.Models.AuthorizationScopeFilter other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.Terraform.Models.AuthorizationScopeFilter left, Azure.ResourceManager.Terraform.Models.AuthorizationScopeFilter right) { throw null; } + public static implicit operator Azure.ResourceManager.Terraform.Models.AuthorizationScopeFilter (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Terraform.Models.AuthorizationScopeFilter left, Azure.ResourceManager.Terraform.Models.AuthorizationScopeFilter right) { throw null; } + public override string ToString() { throw null; } + } public abstract partial class CommonExportProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { protected CommonExportProperties() { } @@ -40,9 +60,11 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer public partial class ExportQueryTerraform : Azure.ResourceManager.Terraform.Models.CommonExportProperties, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public ExportQueryTerraform(string query) { } + public Azure.ResourceManager.Terraform.Models.AuthorizationScopeFilter? AuthorizationScopeFilter { get { throw null; } set { } } public bool? IsRecursive { get { throw null; } set { } } public string NamePattern { get { throw null; } set { } } public string Query { get { throw null; } } + public string Table { get { throw null; } set { } } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Terraform.Models.ExportQueryTerraform System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } @@ -99,6 +121,7 @@ public partial class TerraformExportResult : System.ClientModel.Primitives.IJson internal TerraformExportResult() { } public string Configuration { get { throw null; } } public System.Collections.Generic.IReadOnlyList Errors { get { throw null; } } + public string Import { get { throw null; } } public System.Collections.Generic.IReadOnlyList SkippedResourceIds { get { throw null; } } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Terraform.Models.TerraformExportResult System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } diff --git a/sdk/terraform/Azure.ResourceManager.Terraform/src/Generated/ArmTerraformModelFactory.cs b/sdk/terraform/Azure.ResourceManager.Terraform/src/Generated/ArmTerraformModelFactory.cs index 72b56c7b2a60..ba1de21e590c 100644 --- a/sdk/terraform/Azure.ResourceManager.Terraform/src/Generated/ArmTerraformModelFactory.cs +++ b/sdk/terraform/Azure.ResourceManager.Terraform/src/Generated/ArmTerraformModelFactory.cs @@ -22,8 +22,10 @@ public static partial class ArmTerraformModelFactory /// The ARG where predicate. Note that you can combine multiple conditions in one `where` predicate, e.g. `resourceGroup =~ "my-rg" and type =~ "microsoft.network/virtualnetworks"`. /// The name pattern of the Terraform resources. /// Whether to recursively list child resources of the query result. + /// The ARG table name. + /// The ARG Scope Filter parameter. /// A new instance for mocking. - public static ExportQueryTerraform ExportQueryTerraform(TargetTerraformProvider? targetProvider = null, bool? isOutputFullPropertiesEnabled = null, bool? isMaskSensitiveEnabled = null, string query = null, string namePattern = null, bool? isRecursive = null) + public static ExportQueryTerraform ExportQueryTerraform(TargetTerraformProvider? targetProvider = null, bool? isOutputFullPropertiesEnabled = null, bool? isMaskSensitiveEnabled = null, string query = null, string namePattern = null, bool? isRecursive = null, string table = null, AuthorizationScopeFilter? authorizationScopeFilter = null) { return new ExportQueryTerraform( CommonExportType.ExportQuery, @@ -33,7 +35,9 @@ public static ExportQueryTerraform ExportQueryTerraform(TargetTerraformProvider? serializedAdditionalRawData: null, query, namePattern, - isRecursive); + isRecursive, + table, + authorizationScopeFilter); } /// Initializes a new instance of . @@ -79,15 +83,16 @@ public static TerraformOperationStatus TerraformOperationStatus(TerraformExportR /// Initializes a new instance of . /// The Terraform configuration content. + /// The Terraform import blocks for the current export, which users can use to run "terraform plan" with to import the resources. /// A list of Azure resources which are not exported to Terraform due to there is no corresponding resources in Terraform. /// A list of errors derived during exporting each resource. /// A new instance for mocking. - public static TerraformExportResult TerraformExportResult(string configuration = null, IEnumerable skippedResourceIds = null, IEnumerable errors = null) + public static TerraformExportResult TerraformExportResult(string configuration = null, string import = null, IEnumerable skippedResourceIds = null, IEnumerable errors = null) { skippedResourceIds ??= new List(); errors ??= new List(); - return new TerraformExportResult(configuration, skippedResourceIds?.ToList(), errors?.ToList(), serializedAdditionalRawData: null); + return new TerraformExportResult(configuration, import, skippedResourceIds?.ToList(), errors?.ToList(), serializedAdditionalRawData: null); } } } diff --git a/sdk/terraform/Azure.ResourceManager.Terraform/src/Generated/Models/AuthorizationScopeFilter.cs b/sdk/terraform/Azure.ResourceManager.Terraform/src/Generated/Models/AuthorizationScopeFilter.cs new file mode 100644 index 000000000000..70c537b28d37 --- /dev/null +++ b/sdk/terraform/Azure.ResourceManager.Terraform/src/Generated/Models/AuthorizationScopeFilter.cs @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.Terraform.Models +{ + /// The Azure Resource Graph Authorization Scope Filter parameter. + public readonly partial struct AuthorizationScopeFilter : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public AuthorizationScopeFilter(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string AtScopeAndBelowValue = "AtScopeAndBelow"; + private const string AtScopeAndAboveValue = "AtScopeAndAbove"; + private const string AtScopeAboveAndBelowValue = "AtScopeAboveAndBelow"; + private const string AtScopeExactValue = "AtScopeExact"; + + /// Returns assignments for the given scope and all child scopes. + public static AuthorizationScopeFilter AtScopeAndBelow { get; } = new AuthorizationScopeFilter(AtScopeAndBelowValue); + /// Returns assignments for the given scope and all parent scopes, but not child scopes. + public static AuthorizationScopeFilter AtScopeAndAbove { get; } = new AuthorizationScopeFilter(AtScopeAndAboveValue); + /// Returns assignments for the given scope, all parent scopes, and all child scopes. + public static AuthorizationScopeFilter AtScopeAboveAndBelow { get; } = new AuthorizationScopeFilter(AtScopeAboveAndBelowValue); + /// Returns assignments only for the given scope; no parent or child scopes are included. + public static AuthorizationScopeFilter AtScopeExact { get; } = new AuthorizationScopeFilter(AtScopeExactValue); + /// Determines if two values are the same. + public static bool operator ==(AuthorizationScopeFilter left, AuthorizationScopeFilter right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(AuthorizationScopeFilter left, AuthorizationScopeFilter right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator AuthorizationScopeFilter(string value) => new AuthorizationScopeFilter(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is AuthorizationScopeFilter other && Equals(other); + /// + public bool Equals(AuthorizationScopeFilter other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/terraform/Azure.ResourceManager.Terraform/src/Generated/Models/ExportQueryTerraform.Serialization.cs b/sdk/terraform/Azure.ResourceManager.Terraform/src/Generated/Models/ExportQueryTerraform.Serialization.cs index 78e075500430..f5ed9d89d081 100644 --- a/sdk/terraform/Azure.ResourceManager.Terraform/src/Generated/Models/ExportQueryTerraform.Serialization.cs +++ b/sdk/terraform/Azure.ResourceManager.Terraform/src/Generated/Models/ExportQueryTerraform.Serialization.cs @@ -47,6 +47,16 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri writer.WritePropertyName("recursive"u8); writer.WriteBooleanValue(IsRecursive.Value); } + if (Optional.IsDefined(Table)) + { + writer.WritePropertyName("table"u8); + writer.WriteStringValue(Table); + } + if (Optional.IsDefined(AuthorizationScopeFilter)) + { + writer.WritePropertyName("authorizationScopeFilter"u8); + writer.WriteStringValue(AuthorizationScopeFilter.Value.ToString()); + } } ExportQueryTerraform IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) @@ -72,6 +82,8 @@ internal static ExportQueryTerraform DeserializeExportQueryTerraform(JsonElement string query = default; string namePattern = default; bool? recursive = default; + string table = default; + AuthorizationScopeFilter? authorizationScopeFilter = default; CommonExportType type = default; TargetTerraformProvider? targetProvider = default; bool? fullProperties = default; @@ -99,6 +111,20 @@ internal static ExportQueryTerraform DeserializeExportQueryTerraform(JsonElement recursive = property.Value.GetBoolean(); continue; } + if (property.NameEquals("table"u8)) + { + table = property.Value.GetString(); + continue; + } + if (property.NameEquals("authorizationScopeFilter"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + authorizationScopeFilter = new AuthorizationScopeFilter(property.Value.GetString()); + continue; + } if (property.NameEquals("type"u8)) { type = new CommonExportType(property.Value.GetString()); @@ -145,7 +171,9 @@ internal static ExportQueryTerraform DeserializeExportQueryTerraform(JsonElement serializedAdditionalRawData, query, namePattern, - recursive); + recursive, + table, + authorizationScopeFilter); } BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) diff --git a/sdk/terraform/Azure.ResourceManager.Terraform/src/Generated/Models/ExportQueryTerraform.cs b/sdk/terraform/Azure.ResourceManager.Terraform/src/Generated/Models/ExportQueryTerraform.cs index 2d7c71a05d0c..13812280ac56 100644 --- a/sdk/terraform/Azure.ResourceManager.Terraform/src/Generated/Models/ExportQueryTerraform.cs +++ b/sdk/terraform/Azure.ResourceManager.Terraform/src/Generated/Models/ExportQueryTerraform.cs @@ -33,11 +33,15 @@ public ExportQueryTerraform(string query) /// The ARG where predicate. Note that you can combine multiple conditions in one `where` predicate, e.g. `resourceGroup =~ "my-rg" and type =~ "microsoft.network/virtualnetworks"`. /// The name pattern of the Terraform resources. /// Whether to recursively list child resources of the query result. - internal ExportQueryTerraform(CommonExportType type, TargetTerraformProvider? targetProvider, bool? isOutputFullPropertiesEnabled, bool? isMaskSensitiveEnabled, IDictionary serializedAdditionalRawData, string query, string namePattern, bool? isRecursive) : base(type, targetProvider, isOutputFullPropertiesEnabled, isMaskSensitiveEnabled, serializedAdditionalRawData) + /// The ARG table name. + /// The ARG Scope Filter parameter. + internal ExportQueryTerraform(CommonExportType type, TargetTerraformProvider? targetProvider, bool? isOutputFullPropertiesEnabled, bool? isMaskSensitiveEnabled, IDictionary serializedAdditionalRawData, string query, string namePattern, bool? isRecursive, string table, AuthorizationScopeFilter? authorizationScopeFilter) : base(type, targetProvider, isOutputFullPropertiesEnabled, isMaskSensitiveEnabled, serializedAdditionalRawData) { Query = query; NamePattern = namePattern; IsRecursive = isRecursive; + Table = table; + AuthorizationScopeFilter = authorizationScopeFilter; Type = type; } @@ -52,5 +56,9 @@ internal ExportQueryTerraform() public string NamePattern { get; set; } /// Whether to recursively list child resources of the query result. public bool? IsRecursive { get; set; } + /// The ARG table name. + public string Table { get; set; } + /// The ARG Scope Filter parameter. + public AuthorizationScopeFilter? AuthorizationScopeFilter { get; set; } } } diff --git a/sdk/terraform/Azure.ResourceManager.Terraform/src/Generated/Models/TerraformExportResult.Serialization.cs b/sdk/terraform/Azure.ResourceManager.Terraform/src/Generated/Models/TerraformExportResult.Serialization.cs index e08eb4e6a8c7..2cf047f63e9d 100644 --- a/sdk/terraform/Azure.ResourceManager.Terraform/src/Generated/Models/TerraformExportResult.Serialization.cs +++ b/sdk/terraform/Azure.ResourceManager.Terraform/src/Generated/Models/TerraformExportResult.Serialization.cs @@ -39,6 +39,11 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("configuration"u8); writer.WriteStringValue(Configuration); } + if (Optional.IsDefined(Import)) + { + writer.WritePropertyName("import"u8); + writer.WriteStringValue(Import); + } if (Optional.IsCollectionDefined(SkippedResourceIds)) { writer.WritePropertyName("skippedResources"u8); @@ -102,6 +107,7 @@ internal static TerraformExportResult DeserializeTerraformExportResult(JsonEleme return null; } string configuration = default; + string import = default; IReadOnlyList skippedResources = default; IReadOnlyList errors = default; IDictionary serializedAdditionalRawData = default; @@ -113,6 +119,11 @@ internal static TerraformExportResult DeserializeTerraformExportResult(JsonEleme configuration = property.Value.GetString(); continue; } + if (property.NameEquals("import"u8)) + { + import = property.Value.GetString(); + continue; + } if (property.NameEquals("skippedResources"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -154,7 +165,7 @@ internal static TerraformExportResult DeserializeTerraformExportResult(JsonEleme } } serializedAdditionalRawData = rawDataDictionary; - return new TerraformExportResult(configuration, skippedResources ?? new ChangeTrackingList(), errors ?? new ChangeTrackingList(), serializedAdditionalRawData); + return new TerraformExportResult(configuration, import, skippedResources ?? new ChangeTrackingList(), errors ?? new ChangeTrackingList(), serializedAdditionalRawData); } BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) diff --git a/sdk/terraform/Azure.ResourceManager.Terraform/src/Generated/Models/TerraformExportResult.cs b/sdk/terraform/Azure.ResourceManager.Terraform/src/Generated/Models/TerraformExportResult.cs index 68a442fa99f7..2151ce67b5c2 100644 --- a/sdk/terraform/Azure.ResourceManager.Terraform/src/Generated/Models/TerraformExportResult.cs +++ b/sdk/terraform/Azure.ResourceManager.Terraform/src/Generated/Models/TerraformExportResult.cs @@ -55,12 +55,14 @@ internal TerraformExportResult() /// Initializes a new instance of . /// The Terraform configuration content. + /// The Terraform import blocks for the current export, which users can use to run "terraform plan" with to import the resources. /// A list of Azure resources which are not exported to Terraform due to there is no corresponding resources in Terraform. /// A list of errors derived during exporting each resource. /// Keeps track of any properties unknown to the library. - internal TerraformExportResult(string configuration, IReadOnlyList skippedResourceIds, IReadOnlyList errors, IDictionary serializedAdditionalRawData) + internal TerraformExportResult(string configuration, string import, IReadOnlyList skippedResourceIds, IReadOnlyList errors, IDictionary serializedAdditionalRawData) { Configuration = configuration; + Import = import; SkippedResourceIds = skippedResourceIds; Errors = errors; _serializedAdditionalRawData = serializedAdditionalRawData; @@ -68,6 +70,8 @@ internal TerraformExportResult(string configuration, IReadOnlyList The Terraform configuration content. public string Configuration { get; } + /// The Terraform import blocks for the current export, which users can use to run "terraform plan" with to import the resources. + public string Import { get; } /// A list of Azure resources which are not exported to Terraform due to there is no corresponding resources in Terraform. public IReadOnlyList SkippedResourceIds { get; } /// A list of errors derived during exporting each resource. diff --git a/sdk/terraform/Azure.ResourceManager.Terraform/tsp-location.yaml b/sdk/terraform/Azure.ResourceManager.Terraform/tsp-location.yaml index d676e0dde7f9..cd686282fe7d 100644 --- a/sdk/terraform/Azure.ResourceManager.Terraform/tsp-location.yaml +++ b/sdk/terraform/Azure.ResourceManager.Terraform/tsp-location.yaml @@ -1,3 +1,4 @@ directory: specification/terraform/Microsoft.AzureTerraform.Management -commit: a4fc4c6bda9ff2315671bca69f9de40a43e2bd8c +commit: 676334a284e5136f0a0721d6ae844bb04332f579 repo: Azure/azure-rest-api-specs +additionalDirectories: diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/Azure.ResourceManager.SapVirtualInstances.sln b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/Azure.ResourceManager.SapVirtualInstances.sln new file mode 100644 index 000000000000..fa67d228e160 --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/Azure.ResourceManager.SapVirtualInstances.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.SapVirtualInstances.Samples", "samples\Azure.ResourceManager.SapVirtualInstances.Samples.csproj", "{7A2DFF15-5746-49F4-BD0F-C6C35337088A}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Azure.ResourceManager.SapVirtualInstances", "src\Azure.ResourceManager.SapVirtualInstances.csproj", "{28FF4005-4467-4E36-92E7-DEA27DEB1519}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Azure.ResourceManager.SapVirtualInstances.Tests", "tests\Azure.ResourceManager.SapVirtualInstances.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/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/CHANGELOG.md b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/CHANGELOG.md new file mode 100644 index 000000000000..8b33f0fedccc --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/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/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/Directory.Build.props b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/Directory.Build.props new file mode 100644 index 000000000000..63bd836ad44b --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/Directory.Build.props @@ -0,0 +1,6 @@ + + + + diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/README.md b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/README.md new file mode 100644 index 000000000000..bcc48b7af026 --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/README.md @@ -0,0 +1,80 @@ +# Microsoft Azure SapVirtualInstances 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 SapVirtualInstances management library for .NET with [NuGet](https://www.nuget.org/): + +```dotnetcli +dotnet add package Azure.ResourceManager.SapVirtualInstances --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/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/assets.json b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/assets.json new file mode 100644 index 000000000000..e269976e380b --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/assets.json @@ -0,0 +1,7 @@ + +{ + "AssetsRepo": "Azure/azure-sdk-assets", + "AssetsRepoPrefixPath": "net", + "TagPrefix": "net/sapvirtualinstances/Azure.ResourceManager.SapVirtualInstances", + "Tag": "" +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/samples/Azure.ResourceManager.SapVirtualInstances.Samples.csproj b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/samples/Azure.ResourceManager.SapVirtualInstances.Samples.csproj new file mode 100644 index 000000000000..5507e60845be --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/samples/Azure.ResourceManager.SapVirtualInstances.Samples.csproj @@ -0,0 +1,13 @@ + + + + + + + + + + + + + diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/samples/Generated/Samples/Sample_SapApplicationServerInstanceCollection.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/samples/Generated/Samples/Sample_SapApplicationServerInstanceCollection.cs new file mode 100644 index 000000000000..70a19c898099 --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/samples/Generated/Samples/Sample_SapApplicationServerInstanceCollection.cs @@ -0,0 +1,241 @@ +// 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.SapVirtualInstances.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.SapVirtualInstances.Samples +{ + public partial class Sample_SapApplicationServerInstanceCollection + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task CreateOrUpdate_SAPApplicationServerInstancesCreate() + { + // Generated from example definition: 2024-09-01/SapApplicationServerInstances_Create.json + // this example is just showing the usage of "SAPApplicationServerInstance_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 SapVirtualInstanceResource created on azure + // for more information of creating SapVirtualInstanceResource, please refer to the document of SapVirtualInstanceResource + string subscriptionId = "6d875e77-e412-4d7d-9af4-8895278b4443"; + string resourceGroupName = "test-rg"; + string sapVirtualInstanceName = "X00"; + ResourceIdentifier sapVirtualInstanceResourceId = SapVirtualInstanceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, sapVirtualInstanceName); + SapVirtualInstanceResource sapVirtualInstance = client.GetSapVirtualInstanceResource(sapVirtualInstanceResourceId); + + // get the collection of this SapApplicationServerInstanceResource + SapApplicationServerInstanceCollection collection = sapVirtualInstance.GetSapApplicationServerInstances(); + + // invoke the operation + string applicationInstanceName = "app01"; + SapApplicationServerInstanceData data = new SapApplicationServerInstanceData(new AzureLocation("westcentralus")) + { + Properties = new SapApplicationServerProperties(), + Tags = { }, + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, applicationInstanceName, data); + SapApplicationServerInstanceResource 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 + SapApplicationServerInstanceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task CreateOrUpdate_CreateSAPApplicationServerInstancesForHASystemWithAvailabilitySet() + { + // Generated from example definition: 2024-09-01/SapApplicationServerInstances_CreateForHaWithAvailabilitySet.json + // this example is just showing the usage of "SAPApplicationServerInstance_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 SapVirtualInstanceResource created on azure + // for more information of creating SapVirtualInstanceResource, please refer to the document of SapVirtualInstanceResource + string subscriptionId = "6d875e77-e412-4d7d-9af4-8895278b4443"; + string resourceGroupName = "test-rg"; + string sapVirtualInstanceName = "X00"; + ResourceIdentifier sapVirtualInstanceResourceId = SapVirtualInstanceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, sapVirtualInstanceName); + SapVirtualInstanceResource sapVirtualInstance = client.GetSapVirtualInstanceResource(sapVirtualInstanceResourceId); + + // get the collection of this SapApplicationServerInstanceResource + SapApplicationServerInstanceCollection collection = sapVirtualInstance.GetSapApplicationServerInstances(); + + // invoke the operation + string applicationInstanceName = "app01"; + SapApplicationServerInstanceData data = new SapApplicationServerInstanceData(new AzureLocation("westcentralus")) + { + Properties = new SapApplicationServerProperties(), + Tags = { }, + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, applicationInstanceName, data); + SapApplicationServerInstanceResource 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 + SapApplicationServerInstanceData 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_SAPApplicationServerInstancesGet() + { + // Generated from example definition: 2024-09-01/SapApplicationServerInstances_Get.json + // this example is just showing the usage of "SAPApplicationServerInstance_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 SapVirtualInstanceResource created on azure + // for more information of creating SapVirtualInstanceResource, please refer to the document of SapVirtualInstanceResource + string subscriptionId = "6d875e77-e412-4d7d-9af4-8895278b4443"; + string resourceGroupName = "test-rg"; + string sapVirtualInstanceName = "X00"; + ResourceIdentifier sapVirtualInstanceResourceId = SapVirtualInstanceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, sapVirtualInstanceName); + SapVirtualInstanceResource sapVirtualInstance = client.GetSapVirtualInstanceResource(sapVirtualInstanceResourceId); + + // get the collection of this SapApplicationServerInstanceResource + SapApplicationServerInstanceCollection collection = sapVirtualInstance.GetSapApplicationServerInstances(); + + // invoke the operation + string applicationInstanceName = "app01"; + SapApplicationServerInstanceResource result = await collection.GetAsync(applicationInstanceName); + + // 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 + SapApplicationServerInstanceData 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_SapApplicationServerInstancesListBySAPVirtualInstance() + { + // Generated from example definition: 2024-09-01/SapApplicationServerInstances_ListBySapVirtualInstance.json + // this example is just showing the usage of "SAPApplicationServerInstance_List" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this SapVirtualInstanceResource created on azure + // for more information of creating SapVirtualInstanceResource, please refer to the document of SapVirtualInstanceResource + string subscriptionId = "6d875e77-e412-4d7d-9af4-8895278b4443"; + string resourceGroupName = "test-rg"; + string sapVirtualInstanceName = "X00"; + ResourceIdentifier sapVirtualInstanceResourceId = SapVirtualInstanceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, sapVirtualInstanceName); + SapVirtualInstanceResource sapVirtualInstance = client.GetSapVirtualInstanceResource(sapVirtualInstanceResourceId); + + // get the collection of this SapApplicationServerInstanceResource + SapApplicationServerInstanceCollection collection = sapVirtualInstance.GetSapApplicationServerInstances(); + + // invoke the operation and iterate over the result + await foreach (SapApplicationServerInstanceResource 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 + SapApplicationServerInstanceData 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_SAPApplicationServerInstancesGet() + { + // Generated from example definition: 2024-09-01/SapApplicationServerInstances_Get.json + // this example is just showing the usage of "SAPApplicationServerInstance_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 SapVirtualInstanceResource created on azure + // for more information of creating SapVirtualInstanceResource, please refer to the document of SapVirtualInstanceResource + string subscriptionId = "6d875e77-e412-4d7d-9af4-8895278b4443"; + string resourceGroupName = "test-rg"; + string sapVirtualInstanceName = "X00"; + ResourceIdentifier sapVirtualInstanceResourceId = SapVirtualInstanceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, sapVirtualInstanceName); + SapVirtualInstanceResource sapVirtualInstance = client.GetSapVirtualInstanceResource(sapVirtualInstanceResourceId); + + // get the collection of this SapApplicationServerInstanceResource + SapApplicationServerInstanceCollection collection = sapVirtualInstance.GetSapApplicationServerInstances(); + + // invoke the operation + string applicationInstanceName = "app01"; + bool result = await collection.ExistsAsync(applicationInstanceName); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetIfExists_SAPApplicationServerInstancesGet() + { + // Generated from example definition: 2024-09-01/SapApplicationServerInstances_Get.json + // this example is just showing the usage of "SAPApplicationServerInstance_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 SapVirtualInstanceResource created on azure + // for more information of creating SapVirtualInstanceResource, please refer to the document of SapVirtualInstanceResource + string subscriptionId = "6d875e77-e412-4d7d-9af4-8895278b4443"; + string resourceGroupName = "test-rg"; + string sapVirtualInstanceName = "X00"; + ResourceIdentifier sapVirtualInstanceResourceId = SapVirtualInstanceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, sapVirtualInstanceName); + SapVirtualInstanceResource sapVirtualInstance = client.GetSapVirtualInstanceResource(sapVirtualInstanceResourceId); + + // get the collection of this SapApplicationServerInstanceResource + SapApplicationServerInstanceCollection collection = sapVirtualInstance.GetSapApplicationServerInstances(); + + // invoke the operation + string applicationInstanceName = "app01"; + NullableResponse response = await collection.GetIfExistsAsync(applicationInstanceName); + SapApplicationServerInstanceResource 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 + SapApplicationServerInstanceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/samples/Generated/Samples/Sample_SapApplicationServerInstanceResource.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/samples/Generated/Samples/Sample_SapApplicationServerInstanceResource.cs new file mode 100644 index 000000000000..a754e7233cd3 --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/samples/Generated/Samples/Sample_SapApplicationServerInstanceResource.cs @@ -0,0 +1,306 @@ +// 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.SapVirtualInstances.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.SapVirtualInstances.Samples +{ + public partial class Sample_SapApplicationServerInstanceResource + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_SAPApplicationServerInstancesGet() + { + // Generated from example definition: 2024-09-01/SapApplicationServerInstances_Get.json + // this example is just showing the usage of "SAPApplicationServerInstance_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 SapApplicationServerInstanceResource created on azure + // for more information of creating SapApplicationServerInstanceResource, please refer to the document of SapApplicationServerInstanceResource + string subscriptionId = "6d875e77-e412-4d7d-9af4-8895278b4443"; + string resourceGroupName = "test-rg"; + string sapVirtualInstanceName = "X00"; + string applicationInstanceName = "app01"; + ResourceIdentifier sapApplicationServerInstanceResourceId = SapApplicationServerInstanceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, sapVirtualInstanceName, applicationInstanceName); + SapApplicationServerInstanceResource sapApplicationServerInstance = client.GetSapApplicationServerInstanceResource(sapApplicationServerInstanceResourceId); + + // invoke the operation + SapApplicationServerInstanceResource result = await sapApplicationServerInstance.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 + SapApplicationServerInstanceData 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_SAPApplicationServerInstancesDelete() + { + // Generated from example definition: 2024-09-01/SapApplicationServerInstances_Delete.json + // this example is just showing the usage of "SAPApplicationServerInstance_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 SapApplicationServerInstanceResource created on azure + // for more information of creating SapApplicationServerInstanceResource, please refer to the document of SapApplicationServerInstanceResource + string subscriptionId = "6d875e77-e412-4d7d-9af4-8895278b4443"; + string resourceGroupName = "test-rg"; + string sapVirtualInstanceName = "X00"; + string applicationInstanceName = "app01"; + ResourceIdentifier sapApplicationServerInstanceResourceId = SapApplicationServerInstanceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, sapVirtualInstanceName, applicationInstanceName); + SapApplicationServerInstanceResource sapApplicationServerInstance = client.GetSapApplicationServerInstanceResource(sapApplicationServerInstanceResourceId); + + // invoke the operation + await sapApplicationServerInstance.DeleteAsync(WaitUntil.Completed); + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Update_SAPApplicationServerInstancesUpdate() + { + // Generated from example definition: 2024-09-01/SapApplicationServerInstances_Update.json + // this example is just showing the usage of "SAPApplicationServerInstance_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 SapApplicationServerInstanceResource created on azure + // for more information of creating SapApplicationServerInstanceResource, please refer to the document of SapApplicationServerInstanceResource + string subscriptionId = "6d875e77-e412-4d7d-9af4-8895278b4443"; + string resourceGroupName = "test-rg"; + string sapVirtualInstanceName = "X00"; + string applicationInstanceName = "app01"; + ResourceIdentifier sapApplicationServerInstanceResourceId = SapApplicationServerInstanceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, sapVirtualInstanceName, applicationInstanceName); + SapApplicationServerInstanceResource sapApplicationServerInstance = client.GetSapApplicationServerInstanceResource(sapApplicationServerInstanceResourceId); + + // invoke the operation + SapApplicationServerInstancePatch patch = new SapApplicationServerInstancePatch + { + Tags = +{ +["tag1"] = "value1" +}, + }; + SapApplicationServerInstanceResource result = await sapApplicationServerInstance.UpdateAsync(patch); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + SapApplicationServerInstanceData 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 Start_StartTheSAPApplicationServerInstance() + { + // Generated from example definition: 2024-09-01/SapApplicationServerInstances_StartInstance.json + // this example is just showing the usage of "SAPApplicationServerInstances_Start" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details 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 SapApplicationServerInstanceResource created on azure + // for more information of creating SapApplicationServerInstanceResource, please refer to the document of SapApplicationServerInstanceResource + string subscriptionId = "8e17e36c-42e9-4cd5-a078-7b44883414e0"; + string resourceGroupName = "test-rg"; + string sapVirtualInstanceName = "X00"; + string applicationInstanceName = "app01"; + ResourceIdentifier sapApplicationServerInstanceResourceId = SapApplicationServerInstanceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, sapVirtualInstanceName, applicationInstanceName); + SapApplicationServerInstanceResource sapApplicationServerInstance = client.GetSapApplicationServerInstanceResource(sapApplicationServerInstanceResourceId); + + // invoke the operation + StartContent content = new StartContent(); + ArmOperation lro = await sapApplicationServerInstance.StartAsync(WaitUntil.Completed, content: content); + OperationStatusResult result = lro.Value; + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Start_StartVirtualMachineAndTheSAPApplicationServerInstanceOnIt() + { + // Generated from example definition: 2024-09-01/SapApplicationServerInstances_StartInstanceVM.json + // this example is just showing the usage of "SAPApplicationServerInstances_Start" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details 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 SapApplicationServerInstanceResource created on azure + // for more information of creating SapApplicationServerInstanceResource, please refer to the document of SapApplicationServerInstanceResource + string subscriptionId = "8e17e36c-42e9-4cd5-a078-7b44883414e0"; + string resourceGroupName = "test-rg"; + string sapVirtualInstanceName = "X00"; + string applicationInstanceName = "app01"; + ResourceIdentifier sapApplicationServerInstanceResourceId = SapApplicationServerInstanceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, sapVirtualInstanceName, applicationInstanceName); + SapApplicationServerInstanceResource sapApplicationServerInstance = client.GetSapApplicationServerInstanceResource(sapApplicationServerInstanceResourceId); + + // invoke the operation + StartContent content = new StartContent + { + StartVm = true, + }; + ArmOperation lro = await sapApplicationServerInstance.StartAsync(WaitUntil.Completed, content: content); + OperationStatusResult result = lro.Value; + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Stop_StopTheSAPApplicationServerInstance() + { + // Generated from example definition: 2024-09-01/SapApplicationServerInstances_StopInstance.json + // this example is just showing the usage of "SAPApplicationServerInstances_Stop" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details 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 SapApplicationServerInstanceResource created on azure + // for more information of creating SapApplicationServerInstanceResource, please refer to the document of SapApplicationServerInstanceResource + string subscriptionId = "8e17e36c-42e9-4cd5-a078-7b44883414e0"; + string resourceGroupName = "test-rg"; + string sapVirtualInstanceName = "X00"; + string applicationInstanceName = "app01"; + ResourceIdentifier sapApplicationServerInstanceResourceId = SapApplicationServerInstanceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, sapVirtualInstanceName, applicationInstanceName); + SapApplicationServerInstanceResource sapApplicationServerInstance = client.GetSapApplicationServerInstanceResource(sapApplicationServerInstanceResourceId); + + // invoke the operation + StopContent content = new StopContent + { + SoftStopTimeoutSeconds = 0L, + }; + ArmOperation lro = await sapApplicationServerInstance.StopAsync(WaitUntil.Completed, content: content); + OperationStatusResult result = lro.Value; + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Stop_StopTheSAPApplicationServerInstanceAndItSInfrastructure() + { + // Generated from example definition: 2024-09-01/SapApplicationServerInstances_StopInstanceInfrastructure.json + // this example is just showing the usage of "SAPApplicationServerInstances_Stop" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details 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 SapApplicationServerInstanceResource created on azure + // for more information of creating SapApplicationServerInstanceResource, please refer to the document of SapApplicationServerInstanceResource + string subscriptionId = "8e17e36c-42e9-4cd5-a078-7b44883414e0"; + string resourceGroupName = "test-rg"; + string sapVirtualInstanceName = "X00"; + string applicationInstanceName = "app01"; + ResourceIdentifier sapApplicationServerInstanceResourceId = SapApplicationServerInstanceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, sapVirtualInstanceName, applicationInstanceName); + SapApplicationServerInstanceResource sapApplicationServerInstance = client.GetSapApplicationServerInstanceResource(sapApplicationServerInstanceResourceId); + + // invoke the operation + StopContent content = new StopContent + { + SoftStopTimeoutSeconds = 0L, + DeallocateVm = true, + }; + ArmOperation lro = await sapApplicationServerInstance.StopAsync(WaitUntil.Completed, content: content); + OperationStatusResult result = lro.Value; + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Stop_SoftStopTheSAPApplicationServerInstance() + { + // Generated from example definition: 2024-09-01/SapApplicationServerInstances_StopInstanceSoft.json + // this example is just showing the usage of "SAPApplicationServerInstances_Stop" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details 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 SapApplicationServerInstanceResource created on azure + // for more information of creating SapApplicationServerInstanceResource, please refer to the document of SapApplicationServerInstanceResource + string subscriptionId = "8e17e36c-42e9-4cd5-a078-7b44883414e0"; + string resourceGroupName = "test-rg"; + string sapVirtualInstanceName = "X00"; + string applicationInstanceName = "app01"; + ResourceIdentifier sapApplicationServerInstanceResourceId = SapApplicationServerInstanceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, sapVirtualInstanceName, applicationInstanceName); + SapApplicationServerInstanceResource sapApplicationServerInstance = client.GetSapApplicationServerInstanceResource(sapApplicationServerInstanceResourceId); + + // invoke the operation + StopContent content = new StopContent + { + SoftStopTimeoutSeconds = 300L, + }; + ArmOperation lro = await sapApplicationServerInstance.StopAsync(WaitUntil.Completed, content: content); + OperationStatusResult result = lro.Value; + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Stop_SoftStopTheSAPApplicationServerInstanceAndItSInfrastructure() + { + // Generated from example definition: 2024-09-01/SapApplicationServerInstances_StopInstanceSoftInfrastructure.json + // this example is just showing the usage of "SAPApplicationServerInstances_Stop" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details 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 SapApplicationServerInstanceResource created on azure + // for more information of creating SapApplicationServerInstanceResource, please refer to the document of SapApplicationServerInstanceResource + string subscriptionId = "8e17e36c-42e9-4cd5-a078-7b44883414e0"; + string resourceGroupName = "test-rg"; + string sapVirtualInstanceName = "X00"; + string applicationInstanceName = "app01"; + ResourceIdentifier sapApplicationServerInstanceResourceId = SapApplicationServerInstanceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, sapVirtualInstanceName, applicationInstanceName); + SapApplicationServerInstanceResource sapApplicationServerInstance = client.GetSapApplicationServerInstanceResource(sapApplicationServerInstanceResourceId); + + // invoke the operation + StopContent content = new StopContent + { + SoftStopTimeoutSeconds = 300L, + DeallocateVm = true, + }; + ArmOperation lro = await sapApplicationServerInstance.StopAsync(WaitUntil.Completed, content: content); + OperationStatusResult result = lro.Value; + + Console.WriteLine($"Succeeded: {result}"); + } + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/samples/Generated/Samples/Sample_SapCentralServerInstanceCollection.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/samples/Generated/Samples/Sample_SapCentralServerInstanceCollection.cs new file mode 100644 index 000000000000..6984bc34d5d5 --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/samples/Generated/Samples/Sample_SapCentralServerInstanceCollection.cs @@ -0,0 +1,241 @@ +// 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.SapVirtualInstances.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.SapVirtualInstances.Samples +{ + public partial class Sample_SapCentralServerInstanceCollection + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task CreateOrUpdate_SapCentralServerInstancesCreate() + { + // Generated from example definition: 2024-09-01/SapCentralInstances_Create.json + // this example is just showing the usage of "SAPCentralServerInstance_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 SapVirtualInstanceResource created on azure + // for more information of creating SapVirtualInstanceResource, please refer to the document of SapVirtualInstanceResource + string subscriptionId = "6d875e77-e412-4d7d-9af4-8895278b4443"; + string resourceGroupName = "test-rg"; + string sapVirtualInstanceName = "X00"; + ResourceIdentifier sapVirtualInstanceResourceId = SapVirtualInstanceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, sapVirtualInstanceName); + SapVirtualInstanceResource sapVirtualInstance = client.GetSapVirtualInstanceResource(sapVirtualInstanceResourceId); + + // get the collection of this SapCentralServerInstanceResource + SapCentralServerInstanceCollection collection = sapVirtualInstance.GetSapCentralServerInstances(); + + // invoke the operation + string centralInstanceName = "centralServer"; + SapCentralServerInstanceData data = new SapCentralServerInstanceData(new AzureLocation("westcentralus")) + { + Properties = new SapCentralServerProperties(), + Tags = { }, + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, centralInstanceName, data); + SapCentralServerInstanceResource 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 + SapCentralServerInstanceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task CreateOrUpdate_CreateSAPCentralInstancesForHASystemWithAvailabilitySet() + { + // Generated from example definition: 2024-09-01/SapCentralInstances_CreateForHaWithAvailabilitySet.json + // this example is just showing the usage of "SAPCentralServerInstance_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 SapVirtualInstanceResource created on azure + // for more information of creating SapVirtualInstanceResource, please refer to the document of SapVirtualInstanceResource + string subscriptionId = "6d875e77-e412-4d7d-9af4-8895278b4443"; + string resourceGroupName = "test-rg"; + string sapVirtualInstanceName = "X00"; + ResourceIdentifier sapVirtualInstanceResourceId = SapVirtualInstanceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, sapVirtualInstanceName); + SapVirtualInstanceResource sapVirtualInstance = client.GetSapVirtualInstanceResource(sapVirtualInstanceResourceId); + + // get the collection of this SapCentralServerInstanceResource + SapCentralServerInstanceCollection collection = sapVirtualInstance.GetSapCentralServerInstances(); + + // invoke the operation + string centralInstanceName = "centralServer"; + SapCentralServerInstanceData data = new SapCentralServerInstanceData(new AzureLocation("westcentralus")) + { + Properties = new SapCentralServerProperties(), + Tags = { }, + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, centralInstanceName, data); + SapCentralServerInstanceResource 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 + SapCentralServerInstanceData 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_SapCentralServerInstancesGet() + { + // Generated from example definition: 2024-09-01/SapCentralInstances_Get.json + // this example is just showing the usage of "SAPCentralServerInstance_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 SapVirtualInstanceResource created on azure + // for more information of creating SapVirtualInstanceResource, please refer to the document of SapVirtualInstanceResource + string subscriptionId = "6d875e77-e412-4d7d-9af4-8895278b4443"; + string resourceGroupName = "test-rg"; + string sapVirtualInstanceName = "X00"; + ResourceIdentifier sapVirtualInstanceResourceId = SapVirtualInstanceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, sapVirtualInstanceName); + SapVirtualInstanceResource sapVirtualInstance = client.GetSapVirtualInstanceResource(sapVirtualInstanceResourceId); + + // get the collection of this SapCentralServerInstanceResource + SapCentralServerInstanceCollection collection = sapVirtualInstance.GetSapCentralServerInstances(); + + // invoke the operation + string centralInstanceName = "centralServer"; + SapCentralServerInstanceResource result = await collection.GetAsync(centralInstanceName); + + // 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 + SapCentralServerInstanceData 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_SAPCentralInstancesListBySAPVirtualInstance() + { + // Generated from example definition: 2024-09-01/SapCentralServerInstances_ListBySapVirtualInstance.json + // this example is just showing the usage of "SAPCentralServerInstance_List" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this SapVirtualInstanceResource created on azure + // for more information of creating SapVirtualInstanceResource, please refer to the document of SapVirtualInstanceResource + string subscriptionId = "6d875e77-e412-4d7d-9af4-8895278b4443"; + string resourceGroupName = "test-rg"; + string sapVirtualInstanceName = "X00"; + ResourceIdentifier sapVirtualInstanceResourceId = SapVirtualInstanceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, sapVirtualInstanceName); + SapVirtualInstanceResource sapVirtualInstance = client.GetSapVirtualInstanceResource(sapVirtualInstanceResourceId); + + // get the collection of this SapCentralServerInstanceResource + SapCentralServerInstanceCollection collection = sapVirtualInstance.GetSapCentralServerInstances(); + + // invoke the operation and iterate over the result + await foreach (SapCentralServerInstanceResource 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 + SapCentralServerInstanceData 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_SapCentralServerInstancesGet() + { + // Generated from example definition: 2024-09-01/SapCentralInstances_Get.json + // this example is just showing the usage of "SAPCentralServerInstance_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 SapVirtualInstanceResource created on azure + // for more information of creating SapVirtualInstanceResource, please refer to the document of SapVirtualInstanceResource + string subscriptionId = "6d875e77-e412-4d7d-9af4-8895278b4443"; + string resourceGroupName = "test-rg"; + string sapVirtualInstanceName = "X00"; + ResourceIdentifier sapVirtualInstanceResourceId = SapVirtualInstanceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, sapVirtualInstanceName); + SapVirtualInstanceResource sapVirtualInstance = client.GetSapVirtualInstanceResource(sapVirtualInstanceResourceId); + + // get the collection of this SapCentralServerInstanceResource + SapCentralServerInstanceCollection collection = sapVirtualInstance.GetSapCentralServerInstances(); + + // invoke the operation + string centralInstanceName = "centralServer"; + bool result = await collection.ExistsAsync(centralInstanceName); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetIfExists_SapCentralServerInstancesGet() + { + // Generated from example definition: 2024-09-01/SapCentralInstances_Get.json + // this example is just showing the usage of "SAPCentralServerInstance_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 SapVirtualInstanceResource created on azure + // for more information of creating SapVirtualInstanceResource, please refer to the document of SapVirtualInstanceResource + string subscriptionId = "6d875e77-e412-4d7d-9af4-8895278b4443"; + string resourceGroupName = "test-rg"; + string sapVirtualInstanceName = "X00"; + ResourceIdentifier sapVirtualInstanceResourceId = SapVirtualInstanceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, sapVirtualInstanceName); + SapVirtualInstanceResource sapVirtualInstance = client.GetSapVirtualInstanceResource(sapVirtualInstanceResourceId); + + // get the collection of this SapCentralServerInstanceResource + SapCentralServerInstanceCollection collection = sapVirtualInstance.GetSapCentralServerInstances(); + + // invoke the operation + string centralInstanceName = "centralServer"; + NullableResponse response = await collection.GetIfExistsAsync(centralInstanceName); + SapCentralServerInstanceResource 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 + SapCentralServerInstanceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/samples/Generated/Samples/Sample_SapCentralServerInstanceResource.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/samples/Generated/Samples/Sample_SapCentralServerInstanceResource.cs new file mode 100644 index 000000000000..c51a9b913e79 --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/samples/Generated/Samples/Sample_SapCentralServerInstanceResource.cs @@ -0,0 +1,240 @@ +// 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.SapVirtualInstances.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.SapVirtualInstances.Samples +{ + public partial class Sample_SapCentralServerInstanceResource + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_SapCentralServerInstancesGet() + { + // Generated from example definition: 2024-09-01/SapCentralInstances_Get.json + // this example is just showing the usage of "SAPCentralServerInstance_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 SapCentralServerInstanceResource created on azure + // for more information of creating SapCentralServerInstanceResource, please refer to the document of SapCentralServerInstanceResource + string subscriptionId = "6d875e77-e412-4d7d-9af4-8895278b4443"; + string resourceGroupName = "test-rg"; + string sapVirtualInstanceName = "X00"; + string centralInstanceName = "centralServer"; + ResourceIdentifier sapCentralServerInstanceResourceId = SapCentralServerInstanceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, sapVirtualInstanceName, centralInstanceName); + SapCentralServerInstanceResource sapCentralServerInstance = client.GetSapCentralServerInstanceResource(sapCentralServerInstanceResourceId); + + // invoke the operation + SapCentralServerInstanceResource result = await sapCentralServerInstance.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 + SapCentralServerInstanceData 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_SapCentralServerInstancesDelete() + { + // Generated from example definition: 2024-09-01/SapCentralInstances_Delete.json + // this example is just showing the usage of "SAPCentralServerInstance_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 SapCentralServerInstanceResource created on azure + // for more information of creating SapCentralServerInstanceResource, please refer to the document of SapCentralServerInstanceResource + string subscriptionId = "6d875e77-e412-4d7d-9af4-8895278b4443"; + string resourceGroupName = "test-rg"; + string sapVirtualInstanceName = "X00"; + string centralInstanceName = "centralServer"; + ResourceIdentifier sapCentralServerInstanceResourceId = SapCentralServerInstanceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, sapVirtualInstanceName, centralInstanceName); + SapCentralServerInstanceResource sapCentralServerInstance = client.GetSapCentralServerInstanceResource(sapCentralServerInstanceResourceId); + + // invoke the operation + await sapCentralServerInstance.DeleteAsync(WaitUntil.Completed); + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Update_SapCentralServerInstancesUpdate() + { + // Generated from example definition: 2024-09-01/SapCentralInstances_Update.json + // this example is just showing the usage of "SAPCentralServerInstance_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 SapCentralServerInstanceResource created on azure + // for more information of creating SapCentralServerInstanceResource, please refer to the document of SapCentralServerInstanceResource + string subscriptionId = "6d875e77-e412-4d7d-9af4-8895278b4443"; + string resourceGroupName = "test-rg"; + string sapVirtualInstanceName = "X00"; + string centralInstanceName = "centralServer"; + ResourceIdentifier sapCentralServerInstanceResourceId = SapCentralServerInstanceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, sapVirtualInstanceName, centralInstanceName); + SapCentralServerInstanceResource sapCentralServerInstance = client.GetSapCentralServerInstanceResource(sapCentralServerInstanceResourceId); + + // invoke the operation + SapCentralServerInstancePatch patch = new SapCentralServerInstancePatch + { + Tags = +{ +["tag1"] = "value1" +}, + }; + SapCentralServerInstanceResource result = await sapCentralServerInstance.UpdateAsync(patch); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + SapCentralServerInstanceData 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 Start_StartTheSAPCentralServicesInstance() + { + // Generated from example definition: 2024-09-01/SapCentralInstances_StartInstance.json + // this example is just showing the usage of "SAPCentralServerInstances_Start" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details 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 SapCentralServerInstanceResource created on azure + // for more information of creating SapCentralServerInstanceResource, please refer to the document of SapCentralServerInstanceResource + string subscriptionId = "8e17e36c-42e9-4cd5-a078-7b44883414e0"; + string resourceGroupName = "test-rg"; + string sapVirtualInstanceName = "X00"; + string centralInstanceName = "centralServer"; + ResourceIdentifier sapCentralServerInstanceResourceId = SapCentralServerInstanceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, sapVirtualInstanceName, centralInstanceName); + SapCentralServerInstanceResource sapCentralServerInstance = client.GetSapCentralServerInstanceResource(sapCentralServerInstanceResourceId); + + // invoke the operation + StartContent content = new StartContent(); + ArmOperation lro = await sapCentralServerInstance.StartAsync(WaitUntil.Completed, content: content); + OperationStatusResult result = lro.Value; + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Start_StartTheVirtualMachineSAndTheSAPCentralServicesInstanceOnIt() + { + // Generated from example definition: 2024-09-01/SapCentralInstances_StartInstanceVM.json + // this example is just showing the usage of "SAPCentralServerInstances_Start" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details 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 SapCentralServerInstanceResource created on azure + // for more information of creating SapCentralServerInstanceResource, please refer to the document of SapCentralServerInstanceResource + string subscriptionId = "8e17e36c-42e9-4cd5-a078-7b44883414e0"; + string resourceGroupName = "test-rg"; + string sapVirtualInstanceName = "X00"; + string centralInstanceName = "centralServer"; + ResourceIdentifier sapCentralServerInstanceResourceId = SapCentralServerInstanceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, sapVirtualInstanceName, centralInstanceName); + SapCentralServerInstanceResource sapCentralServerInstance = client.GetSapCentralServerInstanceResource(sapCentralServerInstanceResourceId); + + // invoke the operation + StartContent content = new StartContent + { + StartVm = true, + }; + ArmOperation lro = await sapCentralServerInstance.StartAsync(WaitUntil.Completed, content: content); + OperationStatusResult result = lro.Value; + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Stop_StopTheSAPCentralServicesInstance() + { + // Generated from example definition: 2024-09-01/SapCentralInstances_StopInstance.json + // this example is just showing the usage of "SAPCentralServerInstances_Stop" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details 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 SapCentralServerInstanceResource created on azure + // for more information of creating SapCentralServerInstanceResource, please refer to the document of SapCentralServerInstanceResource + string subscriptionId = "8e17e36c-42e9-4cd5-a078-7b44883414e0"; + string resourceGroupName = "test-rg"; + string sapVirtualInstanceName = "X00"; + string centralInstanceName = "centralServer"; + ResourceIdentifier sapCentralServerInstanceResourceId = SapCentralServerInstanceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, sapVirtualInstanceName, centralInstanceName); + SapCentralServerInstanceResource sapCentralServerInstance = client.GetSapCentralServerInstanceResource(sapCentralServerInstanceResourceId); + + // invoke the operation + StopContent content = new StopContent + { + SoftStopTimeoutSeconds = 1200L, + }; + ArmOperation lro = await sapCentralServerInstance.StopAsync(WaitUntil.Completed, content: content); + OperationStatusResult result = lro.Value; + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Stop_StopTheSAPCentralServicesInstanceAndItsUnderlyingVirtualMachineS() + { + // Generated from example definition: 2024-09-01/SapCentralInstances_StopInstanceVM.json + // this example is just showing the usage of "SAPCentralServerInstances_Stop" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details 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 SapCentralServerInstanceResource created on azure + // for more information of creating SapCentralServerInstanceResource, please refer to the document of SapCentralServerInstanceResource + string subscriptionId = "8e17e36c-42e9-4cd5-a078-7b44883414e0"; + string resourceGroupName = "test-rg"; + string sapVirtualInstanceName = "X00"; + string centralInstanceName = "centralServer"; + ResourceIdentifier sapCentralServerInstanceResourceId = SapCentralServerInstanceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, sapVirtualInstanceName, centralInstanceName); + SapCentralServerInstanceResource sapCentralServerInstance = client.GetSapCentralServerInstanceResource(sapCentralServerInstanceResourceId); + + // invoke the operation + StopContent content = new StopContent + { + DeallocateVm = true, + }; + ArmOperation lro = await sapCentralServerInstance.StopAsync(WaitUntil.Completed, content: content); + OperationStatusResult result = lro.Value; + + Console.WriteLine($"Succeeded: {result}"); + } + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/samples/Generated/Samples/Sample_SapDatabaseInstanceCollection.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/samples/Generated/Samples/Sample_SapDatabaseInstanceCollection.cs new file mode 100644 index 000000000000..57e19fd4683b --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/samples/Generated/Samples/Sample_SapDatabaseInstanceCollection.cs @@ -0,0 +1,241 @@ +// 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.SapVirtualInstances.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.SapVirtualInstances.Samples +{ + public partial class Sample_SapDatabaseInstanceCollection + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task CreateOrUpdate_SAPDatabaseInstancesCreate() + { + // Generated from example definition: 2024-09-01/SapDatabaseInstances_Create.json + // this example is just showing the usage of "SAPDatabaseInstance_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 SapVirtualInstanceResource created on azure + // for more information of creating SapVirtualInstanceResource, please refer to the document of SapVirtualInstanceResource + string subscriptionId = "6d875e77-e412-4d7d-9af4-8895278b4443"; + string resourceGroupName = "test-rg"; + string sapVirtualInstanceName = "X00"; + ResourceIdentifier sapVirtualInstanceResourceId = SapVirtualInstanceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, sapVirtualInstanceName); + SapVirtualInstanceResource sapVirtualInstance = client.GetSapVirtualInstanceResource(sapVirtualInstanceResourceId); + + // get the collection of this SapDatabaseInstanceResource + SapDatabaseInstanceCollection collection = sapVirtualInstance.GetSapDatabaseInstances(); + + // invoke the operation + string databaseInstanceName = "databaseServer"; + SapDatabaseInstanceData data = new SapDatabaseInstanceData(new AzureLocation("westcentralus")) + { + Properties = new SapDatabaseProperties(), + Tags = { }, + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, databaseInstanceName, data); + SapDatabaseInstanceResource 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 + SapDatabaseInstanceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task CreateOrUpdate_CreateSAPDatabaseInstancesForHASystemWithAvailabilitySet() + { + // Generated from example definition: 2024-09-01/SapDatabaseInstances_CreateForHaWithAvailabilitySet.json + // this example is just showing the usage of "SAPDatabaseInstance_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 SapVirtualInstanceResource created on azure + // for more information of creating SapVirtualInstanceResource, please refer to the document of SapVirtualInstanceResource + string subscriptionId = "6d875e77-e412-4d7d-9af4-8895278b4443"; + string resourceGroupName = "test-rg"; + string sapVirtualInstanceName = "X00"; + ResourceIdentifier sapVirtualInstanceResourceId = SapVirtualInstanceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, sapVirtualInstanceName); + SapVirtualInstanceResource sapVirtualInstance = client.GetSapVirtualInstanceResource(sapVirtualInstanceResourceId); + + // get the collection of this SapDatabaseInstanceResource + SapDatabaseInstanceCollection collection = sapVirtualInstance.GetSapDatabaseInstances(); + + // invoke the operation + string databaseInstanceName = "databaseServer"; + SapDatabaseInstanceData data = new SapDatabaseInstanceData(new AzureLocation("westcentralus")) + { + Properties = new SapDatabaseProperties(), + Tags = { }, + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, databaseInstanceName, data); + SapDatabaseInstanceResource 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 + SapDatabaseInstanceData 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_SAPDatabaseInstancesGet() + { + // Generated from example definition: 2024-09-01/SapDatabaseInstances_Get.json + // this example is just showing the usage of "SAPDatabaseInstance_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 SapVirtualInstanceResource created on azure + // for more information of creating SapVirtualInstanceResource, please refer to the document of SapVirtualInstanceResource + string subscriptionId = "6d875e77-e412-4d7d-9af4-8895278b4443"; + string resourceGroupName = "test-rg"; + string sapVirtualInstanceName = "X00"; + ResourceIdentifier sapVirtualInstanceResourceId = SapVirtualInstanceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, sapVirtualInstanceName); + SapVirtualInstanceResource sapVirtualInstance = client.GetSapVirtualInstanceResource(sapVirtualInstanceResourceId); + + // get the collection of this SapDatabaseInstanceResource + SapDatabaseInstanceCollection collection = sapVirtualInstance.GetSapDatabaseInstances(); + + // invoke the operation + string databaseInstanceName = "databaseServer"; + SapDatabaseInstanceResource result = await collection.GetAsync(databaseInstanceName); + + // 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 + SapDatabaseInstanceData 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_SAPDatabaseInstancesListBySAPVirtualInstance() + { + // Generated from example definition: 2024-09-01/SapDatabaseInstances_List.json + // this example is just showing the usage of "SAPDatabaseInstance_List" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this SapVirtualInstanceResource created on azure + // for more information of creating SapVirtualInstanceResource, please refer to the document of SapVirtualInstanceResource + string subscriptionId = "6d875e77-e412-4d7d-9af4-8895278b4443"; + string resourceGroupName = "test-rg"; + string sapVirtualInstanceName = "X00"; + ResourceIdentifier sapVirtualInstanceResourceId = SapVirtualInstanceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, sapVirtualInstanceName); + SapVirtualInstanceResource sapVirtualInstance = client.GetSapVirtualInstanceResource(sapVirtualInstanceResourceId); + + // get the collection of this SapDatabaseInstanceResource + SapDatabaseInstanceCollection collection = sapVirtualInstance.GetSapDatabaseInstances(); + + // invoke the operation and iterate over the result + await foreach (SapDatabaseInstanceResource 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 + SapDatabaseInstanceData 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_SAPDatabaseInstancesGet() + { + // Generated from example definition: 2024-09-01/SapDatabaseInstances_Get.json + // this example is just showing the usage of "SAPDatabaseInstance_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 SapVirtualInstanceResource created on azure + // for more information of creating SapVirtualInstanceResource, please refer to the document of SapVirtualInstanceResource + string subscriptionId = "6d875e77-e412-4d7d-9af4-8895278b4443"; + string resourceGroupName = "test-rg"; + string sapVirtualInstanceName = "X00"; + ResourceIdentifier sapVirtualInstanceResourceId = SapVirtualInstanceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, sapVirtualInstanceName); + SapVirtualInstanceResource sapVirtualInstance = client.GetSapVirtualInstanceResource(sapVirtualInstanceResourceId); + + // get the collection of this SapDatabaseInstanceResource + SapDatabaseInstanceCollection collection = sapVirtualInstance.GetSapDatabaseInstances(); + + // invoke the operation + string databaseInstanceName = "databaseServer"; + bool result = await collection.ExistsAsync(databaseInstanceName); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetIfExists_SAPDatabaseInstancesGet() + { + // Generated from example definition: 2024-09-01/SapDatabaseInstances_Get.json + // this example is just showing the usage of "SAPDatabaseInstance_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 SapVirtualInstanceResource created on azure + // for more information of creating SapVirtualInstanceResource, please refer to the document of SapVirtualInstanceResource + string subscriptionId = "6d875e77-e412-4d7d-9af4-8895278b4443"; + string resourceGroupName = "test-rg"; + string sapVirtualInstanceName = "X00"; + ResourceIdentifier sapVirtualInstanceResourceId = SapVirtualInstanceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, sapVirtualInstanceName); + SapVirtualInstanceResource sapVirtualInstance = client.GetSapVirtualInstanceResource(sapVirtualInstanceResourceId); + + // get the collection of this SapDatabaseInstanceResource + SapDatabaseInstanceCollection collection = sapVirtualInstance.GetSapDatabaseInstances(); + + // invoke the operation + string databaseInstanceName = "databaseServer"; + NullableResponse response = await collection.GetIfExistsAsync(databaseInstanceName); + SapDatabaseInstanceResource 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 + SapDatabaseInstanceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/samples/Generated/Samples/Sample_SapDatabaseInstanceResource.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/samples/Generated/Samples/Sample_SapDatabaseInstanceResource.cs new file mode 100644 index 000000000000..de8c748921e3 --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/samples/Generated/Samples/Sample_SapDatabaseInstanceResource.cs @@ -0,0 +1,306 @@ +// 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.SapVirtualInstances.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.SapVirtualInstances.Samples +{ + public partial class Sample_SapDatabaseInstanceResource + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_SAPDatabaseInstancesGet() + { + // Generated from example definition: 2024-09-01/SapDatabaseInstances_Get.json + // this example is just showing the usage of "SAPDatabaseInstance_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 SapDatabaseInstanceResource created on azure + // for more information of creating SapDatabaseInstanceResource, please refer to the document of SapDatabaseInstanceResource + string subscriptionId = "6d875e77-e412-4d7d-9af4-8895278b4443"; + string resourceGroupName = "test-rg"; + string sapVirtualInstanceName = "X00"; + string databaseInstanceName = "databaseServer"; + ResourceIdentifier sapDatabaseInstanceResourceId = SapDatabaseInstanceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, sapVirtualInstanceName, databaseInstanceName); + SapDatabaseInstanceResource sapDatabaseInstance = client.GetSapDatabaseInstanceResource(sapDatabaseInstanceResourceId); + + // invoke the operation + SapDatabaseInstanceResource result = await sapDatabaseInstance.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 + SapDatabaseInstanceData 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_SAPDatabaseInstancesDelete() + { + // Generated from example definition: 2024-09-01/SapDatabaseInstances_Delete.json + // this example is just showing the usage of "SAPDatabaseInstance_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 SapDatabaseInstanceResource created on azure + // for more information of creating SapDatabaseInstanceResource, please refer to the document of SapDatabaseInstanceResource + string subscriptionId = "6d875e77-e412-4d7d-9af4-8895278b4443"; + string resourceGroupName = "test-rg"; + string sapVirtualInstanceName = "X00"; + string databaseInstanceName = "databaseServer"; + ResourceIdentifier sapDatabaseInstanceResourceId = SapDatabaseInstanceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, sapVirtualInstanceName, databaseInstanceName); + SapDatabaseInstanceResource sapDatabaseInstance = client.GetSapDatabaseInstanceResource(sapDatabaseInstanceResourceId); + + // invoke the operation + await sapDatabaseInstance.DeleteAsync(WaitUntil.Completed); + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Update_SAPDatabaseInstancesUpdate() + { + // Generated from example definition: 2024-09-01/SapDatabaseInstances_Update.json + // this example is just showing the usage of "SAPDatabaseInstance_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 SapDatabaseInstanceResource created on azure + // for more information of creating SapDatabaseInstanceResource, please refer to the document of SapDatabaseInstanceResource + string subscriptionId = "6d875e77-e412-4d7d-9af4-8895278b4443"; + string resourceGroupName = "test-rg"; + string sapVirtualInstanceName = "X00"; + string databaseInstanceName = "databaseServer"; + ResourceIdentifier sapDatabaseInstanceResourceId = SapDatabaseInstanceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, sapVirtualInstanceName, databaseInstanceName); + SapDatabaseInstanceResource sapDatabaseInstance = client.GetSapDatabaseInstanceResource(sapDatabaseInstanceResourceId); + + // invoke the operation + SapDatabaseInstancePatch patch = new SapDatabaseInstancePatch + { + Tags = +{ +["key1"] = "value1" +}, + }; + SapDatabaseInstanceResource result = await sapDatabaseInstance.UpdateAsync(patch); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + SapDatabaseInstanceData 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 Start_StartTheDatabaseInstanceOfTheSAPSystem() + { + // Generated from example definition: 2024-09-01/SapDatabaseInstances_StartInstance.json + // this example is just showing the usage of "SAPDatabaseInstances_Start" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details 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 SapDatabaseInstanceResource created on azure + // for more information of creating SapDatabaseInstanceResource, please refer to the document of SapDatabaseInstanceResource + string subscriptionId = "8e17e36c-42e9-4cd5-a078-7b44883414e0"; + string resourceGroupName = "test-rg"; + string sapVirtualInstanceName = "X00"; + string databaseInstanceName = "db0"; + ResourceIdentifier sapDatabaseInstanceResourceId = SapDatabaseInstanceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, sapVirtualInstanceName, databaseInstanceName); + SapDatabaseInstanceResource sapDatabaseInstance = client.GetSapDatabaseInstanceResource(sapDatabaseInstanceResourceId); + + // invoke the operation + StartContent content = new StartContent(); + ArmOperation lro = await sapDatabaseInstance.StartAsync(WaitUntil.Completed, content: content); + OperationStatusResult result = lro.Value; + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Start_StartVirtualMachineAndTheDatabaseInstanceOfTheSAPSystemOnIt() + { + // Generated from example definition: 2024-09-01/SapDatabaseInstances_StartInstanceVM.json + // this example is just showing the usage of "SAPDatabaseInstances_Start" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details 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 SapDatabaseInstanceResource created on azure + // for more information of creating SapDatabaseInstanceResource, please refer to the document of SapDatabaseInstanceResource + string subscriptionId = "8e17e36c-42e9-4cd5-a078-7b44883414e0"; + string resourceGroupName = "test-rg"; + string sapVirtualInstanceName = "X00"; + string databaseInstanceName = "db0"; + ResourceIdentifier sapDatabaseInstanceResourceId = SapDatabaseInstanceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, sapVirtualInstanceName, databaseInstanceName); + SapDatabaseInstanceResource sapDatabaseInstance = client.GetSapDatabaseInstanceResource(sapDatabaseInstanceResourceId); + + // invoke the operation + StartContent content = new StartContent + { + StartVm = true, + }; + ArmOperation lro = await sapDatabaseInstance.StartAsync(WaitUntil.Completed, content: content); + OperationStatusResult result = lro.Value; + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Stop_StopTheDatabaseInstanceOfTheSAPSystem() + { + // Generated from example definition: 2024-09-01/SapDatabaseInstances_StopInstance.json + // this example is just showing the usage of "SAPDatabaseInstances_Stop" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details 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 SapDatabaseInstanceResource created on azure + // for more information of creating SapDatabaseInstanceResource, please refer to the document of SapDatabaseInstanceResource + string subscriptionId = "8e17e36c-42e9-4cd5-a078-7b44883414e0"; + string resourceGroupName = "test-rg"; + string sapVirtualInstanceName = "X00"; + string databaseInstanceName = "db0"; + ResourceIdentifier sapDatabaseInstanceResourceId = SapDatabaseInstanceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, sapVirtualInstanceName, databaseInstanceName); + SapDatabaseInstanceResource sapDatabaseInstance = client.GetSapDatabaseInstanceResource(sapDatabaseInstanceResourceId); + + // invoke the operation + StopContent content = new StopContent + { + SoftStopTimeoutSeconds = 0L, + }; + ArmOperation lro = await sapDatabaseInstance.StopAsync(WaitUntil.Completed, content: content); + OperationStatusResult result = lro.Value; + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Stop_SoftStopTheDatabaseInstanceOfTheSAPSystem() + { + // Generated from example definition: 2024-09-01/SapDatabaseInstances_StopInstanceSoft.json + // this example is just showing the usage of "SAPDatabaseInstances_Stop" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details 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 SapDatabaseInstanceResource created on azure + // for more information of creating SapDatabaseInstanceResource, please refer to the document of SapDatabaseInstanceResource + string subscriptionId = "8e17e36c-42e9-4cd5-a078-7b44883414e0"; + string resourceGroupName = "test-rg"; + string sapVirtualInstanceName = "X00"; + string databaseInstanceName = "db0"; + ResourceIdentifier sapDatabaseInstanceResourceId = SapDatabaseInstanceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, sapVirtualInstanceName, databaseInstanceName); + SapDatabaseInstanceResource sapDatabaseInstance = client.GetSapDatabaseInstanceResource(sapDatabaseInstanceResourceId); + + // invoke the operation + StopContent content = new StopContent + { + SoftStopTimeoutSeconds = 300L, + }; + ArmOperation lro = await sapDatabaseInstance.StopAsync(WaitUntil.Completed, content: content); + OperationStatusResult result = lro.Value; + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Stop_SoftStopTheDatabaseInstanceOfTheSAPSystemAndTheUnderlyingVirtualMachineS() + { + // Generated from example definition: 2024-09-01/SapDatabaseInstances_StopInstanceSoftVM.json + // this example is just showing the usage of "SAPDatabaseInstances_Stop" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details 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 SapDatabaseInstanceResource created on azure + // for more information of creating SapDatabaseInstanceResource, please refer to the document of SapDatabaseInstanceResource + string subscriptionId = "8e17e36c-42e9-4cd5-a078-7b44883414e0"; + string resourceGroupName = "test-rg"; + string sapVirtualInstanceName = "X00"; + string databaseInstanceName = "db0"; + ResourceIdentifier sapDatabaseInstanceResourceId = SapDatabaseInstanceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, sapVirtualInstanceName, databaseInstanceName); + SapDatabaseInstanceResource sapDatabaseInstance = client.GetSapDatabaseInstanceResource(sapDatabaseInstanceResourceId); + + // invoke the operation + StopContent content = new StopContent + { + SoftStopTimeoutSeconds = 300L, + DeallocateVm = true, + }; + ArmOperation lro = await sapDatabaseInstance.StopAsync(WaitUntil.Completed, content: content); + OperationStatusResult result = lro.Value; + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Stop_StopTheDatabaseInstanceOfTheSAPSystemAndTheUnderlyingVirtualMachineS() + { + // Generated from example definition: 2024-09-01/SapDatabaseInstances_StopInstanceVM.json + // this example is just showing the usage of "SAPDatabaseInstances_Stop" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details 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 SapDatabaseInstanceResource created on azure + // for more information of creating SapDatabaseInstanceResource, please refer to the document of SapDatabaseInstanceResource + string subscriptionId = "8e17e36c-42e9-4cd5-a078-7b44883414e0"; + string resourceGroupName = "test-rg"; + string sapVirtualInstanceName = "X00"; + string databaseInstanceName = "db0"; + ResourceIdentifier sapDatabaseInstanceResourceId = SapDatabaseInstanceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, sapVirtualInstanceName, databaseInstanceName); + SapDatabaseInstanceResource sapDatabaseInstance = client.GetSapDatabaseInstanceResource(sapDatabaseInstanceResourceId); + + // invoke the operation + StopContent content = new StopContent + { + SoftStopTimeoutSeconds = 0L, + DeallocateVm = true, + }; + ArmOperation lro = await sapDatabaseInstance.StopAsync(WaitUntil.Completed, content: content); + OperationStatusResult result = lro.Value; + + Console.WriteLine($"Succeeded: {result}"); + } + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/samples/Generated/Samples/Sample_SapVirtualInstanceCollection.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/samples/Generated/Samples/Sample_SapVirtualInstanceCollection.cs new file mode 100644 index 000000000000..9bfc4d5ca023 --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/samples/Generated/Samples/Sample_SapVirtualInstanceCollection.cs @@ -0,0 +1,3485 @@ +// 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 Azure.ResourceManager.SapVirtualInstances.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.SapVirtualInstances.Samples +{ + public partial class Sample_SapVirtualInstanceCollection + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task CreateOrUpdate_DetectSAPSoftwareInstallationOnADistributedSystem() + { + // Generated from example definition: 2024-09-01/SapVirtualInstances_CreateDetectDS.json + // this example is just showing the usage of "SAPVirtualInstance_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 = "8e17e36c-42e9-4cd5-a078-7b44883414e0"; + string resourceGroupName = "test-rg"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this SapVirtualInstanceResource + SapVirtualInstanceCollection collection = resourceGroupResource.GetSapVirtualInstances(); + + // invoke the operation + string sapVirtualInstanceName = "X00"; + SapVirtualInstanceData data = new SapVirtualInstanceData(new AzureLocation("eastus2")) + { + Properties = new SapVirtualInstanceProperties(SapEnvironmentType.Prod, SapProductType.S4HANA, new DeploymentWithOSConfiguration + { + AppLocation = "eastus", + InfrastructureConfiguration = new ThreeTierConfiguration("{{resourcegrp}}", new CentralServerConfiguration("/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/app", new VirtualMachineConfiguration("Standard_E4ds_v4", new ImageReference + { + Publisher = "RedHat", + Offer = "RHEL-SAP-HA", + Sku = "84sapha-gen2", + Version = "latest", + }, new OSProfile + { + AdminUsername = "azureuser", + OSConfiguration = new LinuxConfiguration + { + DisablePasswordAuthentication = true, + SshKeyPair = new SshKeyPair + { + PublicKey = "{{sshkey}}", + PrivateKey = "{{privateKey}}", + }, + }, + }), 1L), new ApplicationServerConfiguration("/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/app", new VirtualMachineConfiguration("Standard_E4ds_v4", new ImageReference + { + Publisher = "RedHat", + Offer = "RHEL-SAP-HA", + Sku = "84sapha-gen2", + Version = "latest", + }, new OSProfile + { + AdminUsername = "azureuser", + OSConfiguration = new LinuxConfiguration + { + DisablePasswordAuthentication = true, + SshKeyPair = new SshKeyPair + { + PublicKey = "{{sshkey}}", + PrivateKey = "{{privateKey}}", + }, + }, + }), 2L), new DatabaseConfiguration("/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/app", new VirtualMachineConfiguration("Standard_M32ts", new ImageReference + { + Publisher = "RedHat", + Offer = "RHEL-SAP-HA", + Sku = "84sapha-gen2", + Version = "latest", + }, new OSProfile + { + AdminUsername = "azureuser", + OSConfiguration = new LinuxConfiguration + { + DisablePasswordAuthentication = true, + SshKeyPair = new SshKeyPair + { + PublicKey = "{{sshkey}}", + PrivateKey = "{{privateKey}}", + }, + }, + }), 1L)) + { + IsSecondaryIPEnabled = true, + }, + SoftwareConfiguration = new ExternalInstallationSoftwareConfiguration + { + CentralServerVmId = "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Compute/virtualMachines/sapq20scsvm0", + }, + OSSapConfiguration = new OSSapConfiguration + { + SapFqdn = "sap.bpaas.com", + }, + }), + Tags = +{ +["created by"] = "azureuser" +}, + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, sapVirtualInstanceName, data); + SapVirtualInstanceResource 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 + SapVirtualInstanceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task CreateOrUpdate_DetectSAPSoftwareInstallationOnAnHASystemWithAvailabilitySet() + { + // Generated from example definition: 2024-09-01/SapVirtualInstances_CreateDetectHaAvailabilitySet.json + // this example is just showing the usage of "SAPVirtualInstance_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 = "8e17e36c-42e9-4cd5-a078-7b44883414e0"; + string resourceGroupName = "test-rg"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this SapVirtualInstanceResource + SapVirtualInstanceCollection collection = resourceGroupResource.GetSapVirtualInstances(); + + // invoke the operation + string sapVirtualInstanceName = "X00"; + SapVirtualInstanceData data = new SapVirtualInstanceData(new AzureLocation("westcentralus")) + { + Properties = new SapVirtualInstanceProperties(SapEnvironmentType.Prod, SapProductType.S4HANA, new DeploymentWithOSConfiguration + { + AppLocation = "eastus", + InfrastructureConfiguration = new ThreeTierConfiguration("X00-RG", new CentralServerConfiguration("/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet", new VirtualMachineConfiguration("Standard_E16ds_v4", new ImageReference + { + Publisher = "RedHat", + Offer = "RHEL-SAP-HA", + Sku = "84sapha-gen2", + Version = "latest", + }, new OSProfile + { + AdminUsername = "{your-username}", + OSConfiguration = new LinuxConfiguration + { + DisablePasswordAuthentication = true, + SshKeyPair = new SshKeyPair + { + PublicKey = "abc", + PrivateKey = "xyz", + }, + }, + }), 2L), new ApplicationServerConfiguration("/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet", new VirtualMachineConfiguration("Standard_E32ds_v4", new ImageReference + { + Publisher = "RedHat", + Offer = "RHEL-SAP-HA", + Sku = "84sapha-gen2", + Version = "latest", + }, new OSProfile + { + AdminUsername = "{your-username}", + OSConfiguration = new LinuxConfiguration + { + DisablePasswordAuthentication = true, + SshKeyPair = new SshKeyPair + { + PublicKey = "abc", + PrivateKey = "xyz", + }, + }, + }), 6L), new DatabaseConfiguration("/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/dbsubnet", new VirtualMachineConfiguration("Standard_M32ts", new ImageReference + { + Publisher = "RedHat", + Offer = "RHEL-SAP-HA", + Sku = "84sapha-gen2", + Version = "latest", + }, new OSProfile + { + AdminUsername = "{your-username}", + OSConfiguration = new LinuxConfiguration + { + DisablePasswordAuthentication = true, + SshKeyPair = new SshKeyPair + { + PublicKey = "abc", + PrivateKey = "xyz", + }, + }, + }), 2L) + { + DatabaseType = SapDatabaseType.HANA, + }) + { + HighAvailabilityType = SapHighAvailabilityType.AvailabilitySet, + }, + SoftwareConfiguration = new ExternalInstallationSoftwareConfiguration + { + CentralServerVmId = "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Compute/virtualMachines/sapq20scsvm0", + }, + OSSapConfiguration = new OSSapConfiguration + { + SapFqdn = "xyz.test.com", + }, + }), + Tags = { }, + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, sapVirtualInstanceName, data); + SapVirtualInstanceResource 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 + SapVirtualInstanceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task CreateOrUpdate_DetectSAPSoftwareInstallationOnAnHASystemWithAvailabilityZone() + { + // Generated from example definition: 2024-09-01/SapVirtualInstances_CreateDetectHaAvailabilityZone.json + // this example is just showing the usage of "SAPVirtualInstance_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 = "8e17e36c-42e9-4cd5-a078-7b44883414e0"; + string resourceGroupName = "test-rg"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this SapVirtualInstanceResource + SapVirtualInstanceCollection collection = resourceGroupResource.GetSapVirtualInstances(); + + // invoke the operation + string sapVirtualInstanceName = "X00"; + SapVirtualInstanceData data = new SapVirtualInstanceData(new AzureLocation("westcentralus")) + { + Properties = new SapVirtualInstanceProperties(SapEnvironmentType.Prod, SapProductType.S4HANA, new DeploymentWithOSConfiguration + { + AppLocation = "eastus", + InfrastructureConfiguration = new ThreeTierConfiguration("X00-RG", new CentralServerConfiguration("/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet", new VirtualMachineConfiguration("Standard_E16ds_v4", new ImageReference + { + Publisher = "RedHat", + Offer = "RHEL-SAP-HA", + Sku = "84sapha-gen2", + Version = "latest", + }, new OSProfile + { + AdminUsername = "{your-username}", + OSConfiguration = new LinuxConfiguration + { + DisablePasswordAuthentication = true, + SshKeyPair = new SshKeyPair + { + PublicKey = "abc", + PrivateKey = "xyz", + }, + }, + }), 2L), new ApplicationServerConfiguration("/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet", new VirtualMachineConfiguration("Standard_E32ds_v4", new ImageReference + { + Publisher = "RedHat", + Offer = "RHEL-SAP-HA", + Sku = "84sapha-gen2", + Version = "latest", + }, new OSProfile + { + AdminUsername = "{your-username}", + OSConfiguration = new LinuxConfiguration + { + DisablePasswordAuthentication = true, + SshKeyPair = new SshKeyPair + { + PublicKey = "abc", + PrivateKey = "xyz", + }, + }, + }), 6L), new DatabaseConfiguration("/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/dbsubnet", new VirtualMachineConfiguration("Standard_M32ts", new ImageReference + { + Publisher = "RedHat", + Offer = "RHEL-SAP-HA", + Sku = "84sapha-gen2", + Version = "latest", + }, new OSProfile + { + AdminUsername = "{your-username}", + OSConfiguration = new LinuxConfiguration + { + DisablePasswordAuthentication = true, + SshKeyPair = new SshKeyPair + { + PublicKey = "abc", + PrivateKey = "xyz", + }, + }, + }), 2L) + { + DatabaseType = SapDatabaseType.HANA, + }) + { + HighAvailabilityType = SapHighAvailabilityType.AvailabilityZone, + }, + SoftwareConfiguration = new ExternalInstallationSoftwareConfiguration + { + CentralServerVmId = "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Compute/virtualMachines/sapq20scsvm0", + }, + OSSapConfiguration = new OSSapConfiguration + { + SapFqdn = "xyz.test.com", + }, + }), + Tags = { }, + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, sapVirtualInstanceName, data); + SapVirtualInstanceResource 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 + SapVirtualInstanceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task CreateOrUpdate_DetectSAPSoftwareInstallationOnASingleServerSystem() + { + // Generated from example definition: 2024-09-01/SapVirtualInstances_CreateDetectSingleServer.json + // this example is just showing the usage of "SAPVirtualInstance_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 = "8e17e36c-42e9-4cd5-a078-7b44883414e0"; + string resourceGroupName = "test-rg"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this SapVirtualInstanceResource + SapVirtualInstanceCollection collection = resourceGroupResource.GetSapVirtualInstances(); + + // invoke the operation + string sapVirtualInstanceName = "X00"; + SapVirtualInstanceData data = new SapVirtualInstanceData(new AzureLocation("westcentralus")) + { + Properties = new SapVirtualInstanceProperties(SapEnvironmentType.NonProd, SapProductType.S4HANA, new DeploymentWithOSConfiguration + { + AppLocation = "eastus", + InfrastructureConfiguration = new SingleServerConfiguration("X00-RG", "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet", new VirtualMachineConfiguration("Standard_E32ds_v4", new ImageReference + { + Publisher = "RedHat", + Offer = "RHEL-SAP-HA", + Sku = "84sapha-gen2", + Version = "latest", + }, new OSProfile + { + AdminUsername = "{your-username}", + OSConfiguration = new LinuxConfiguration + { + DisablePasswordAuthentication = true, + SshKeyPair = new SshKeyPair + { + PublicKey = "abc", + PrivateKey = "xyz", + }, + }, + })) + { + IsSecondaryIPEnabled = true, + DatabaseType = SapDatabaseType.HANA, + }, + SoftwareConfiguration = new ExternalInstallationSoftwareConfiguration + { + CentralServerVmId = "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Compute/virtualMachines/sapq20scsvm0", + }, + OSSapConfiguration = new OSSapConfiguration + { + SapFqdn = "xyz.test.com", + }, + }), + Tags = { }, + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, sapVirtualInstanceName, data); + SapVirtualInstanceResource 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 + SapVirtualInstanceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task CreateOrUpdate_CreateInfrastructureOnlyForDistributedSystem() + { + // Generated from example definition: 2024-09-01/SapVirtualInstances_CreateInfraDS.json + // this example is just showing the usage of "SAPVirtualInstance_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 = "8e17e36c-42e9-4cd5-a078-7b44883414e0"; + string resourceGroupName = "test-rg"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this SapVirtualInstanceResource + SapVirtualInstanceCollection collection = resourceGroupResource.GetSapVirtualInstances(); + + // invoke the operation + string sapVirtualInstanceName = "X00"; + SapVirtualInstanceData data = new SapVirtualInstanceData(new AzureLocation("westcentralus")) + { + Properties = new SapVirtualInstanceProperties(SapEnvironmentType.Prod, SapProductType.S4HANA, new DeploymentConfiguration + { + AppLocation = "eastus", + InfrastructureConfiguration = new ThreeTierConfiguration("X00-RG", new CentralServerConfiguration("/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet", new VirtualMachineConfiguration("Standard_E16ds_v4", new ImageReference + { + Publisher = "RedHat", + Offer = "RHEL-SAP", + Sku = "84sapha-gen2", + Version = "latest", + }, new OSProfile + { + AdminUsername = "{your-username}", + OSConfiguration = new LinuxConfiguration + { + DisablePasswordAuthentication = true, + SshPublicKeys = {new SshPublicKey +{ +KeyData = "ssh-rsa public key", +}}, + }, + }), 1L), new ApplicationServerConfiguration("/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet", new VirtualMachineConfiguration("Standard_E32ds_v4", new ImageReference + { + Publisher = "RedHat", + Offer = "RHEL-SAP", + Sku = "84sapha-gen2", + Version = "latest", + }, new OSProfile + { + AdminUsername = "{your-username}", + OSConfiguration = new LinuxConfiguration + { + DisablePasswordAuthentication = true, + SshPublicKeys = {new SshPublicKey +{ +KeyData = "ssh-rsa public key", +}}, + }, + }), 6L), new DatabaseConfiguration("/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/dbsubnet", new VirtualMachineConfiguration("Standard_M32ts", new ImageReference + { + Publisher = "RedHat", + Offer = "RHEL-SAP", + Sku = "84sapha-gen2", + Version = "latest", + }, new OSProfile + { + AdminUsername = "{your-username}", + OSConfiguration = new LinuxConfiguration + { + DisablePasswordAuthentication = true, + SshPublicKeys = {new SshPublicKey +{ +KeyData = "ssh-rsa public key", +}}, + }, + }), 1L) + { + DatabaseType = SapDatabaseType.HANA, + }), + }), + Tags = { }, + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, sapVirtualInstanceName, data); + SapVirtualInstanceResource 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 + SapVirtualInstanceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task CreateOrUpdate_CreateInfrastructureWithDiskAndOSConfigurationForDistributedSystemRecommended() + { + // Generated from example definition: 2024-09-01/SapVirtualInstances_CreateInfraDiskOsDSRecommended.json + // this example is just showing the usage of "SAPVirtualInstance_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 = "8e17e36c-42e9-4cd5-a078-7b44883414e0"; + string resourceGroupName = "test-rg"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this SapVirtualInstanceResource + SapVirtualInstanceCollection collection = resourceGroupResource.GetSapVirtualInstances(); + + // invoke the operation + string sapVirtualInstanceName = "X00"; + SapVirtualInstanceData data = new SapVirtualInstanceData(new AzureLocation("westcentralus")) + { + Properties = new SapVirtualInstanceProperties(SapEnvironmentType.Prod, SapProductType.S4HANA, new DeploymentWithOSConfiguration + { + AppLocation = "eastus", + InfrastructureConfiguration = new ThreeTierConfiguration("X00-RG", new CentralServerConfiguration("/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/dindurkhya-e2etesting/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet", new VirtualMachineConfiguration("Standard_E16ds_v4", new ImageReference + { + Publisher = "RedHat", + Offer = "RHEL-SAP", + Sku = "84sapha-gen2", + Version = "latest", + }, new OSProfile + { + AdminUsername = "{your-username}", + OSConfiguration = new LinuxConfiguration + { + DisablePasswordAuthentication = true, + SshKeyPair = new SshKeyPair + { + PublicKey = "abc", + PrivateKey = "xyz", + }, + }, + }), 1L), new ApplicationServerConfiguration("/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/dindurkhya-e2etesting/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet", new VirtualMachineConfiguration("Standard_E32ds_v4", new ImageReference + { + Publisher = "RedHat", + Offer = "RHEL-SAP", + Sku = "84sapha-gen2", + Version = "latest", + }, new OSProfile + { + AdminUsername = "{your-username}", + OSConfiguration = new LinuxConfiguration + { + DisablePasswordAuthentication = true, + SshKeyPair = new SshKeyPair + { + PublicKey = "abc", + PrivateKey = "xyz", + }, + }, + }), 6L), new DatabaseConfiguration("/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/dindurkhya-e2etesting/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/dbsubnet", new VirtualMachineConfiguration("Standard_M32ts", new ImageReference + { + Publisher = "RedHat", + Offer = "RHEL-SAP", + Sku = "84sapha-gen2", + Version = "latest", + }, new OSProfile + { + AdminUsername = "{your-username}", + OSConfiguration = new LinuxConfiguration + { + DisablePasswordAuthentication = true, + SshKeyPair = new SshKeyPair + { + PublicKey = "abc", + PrivateKey = "xyz", + }, + }, + }), 1L) + { + DatabaseType = SapDatabaseType.HANA, + DiskVolumeConfigurations = +{ +["backup"] = new DiskVolumeConfiguration +{ +Count = 2L, +SizeGB = 256L, +SkuName = DiskSkuName.StandardSSDLRS, +}, +["hana/data"] = new DiskVolumeConfiguration +{ +Count = 4L, +SizeGB = 128L, +SkuName = DiskSkuName.PremiumLRS, +}, +["hana/log"] = new DiskVolumeConfiguration +{ +Count = 3L, +SizeGB = 128L, +SkuName = DiskSkuName.PremiumLRS, +}, +["hana/shared"] = new DiskVolumeConfiguration +{ +Count = 1L, +SizeGB = 256L, +SkuName = DiskSkuName.StandardSSDLRS, +}, +["os"] = new DiskVolumeConfiguration +{ +Count = 1L, +SizeGB = 64L, +SkuName = DiskSkuName.StandardSSDLRS, +}, +["usr/sap"] = new DiskVolumeConfiguration +{ +Count = 1L, +SizeGB = 128L, +SkuName = DiskSkuName.PremiumLRS, +} +}, + }), + OSSapConfiguration = new OSSapConfiguration + { + SapFqdn = "xyz.test.com", + }, + }), + Tags = { }, + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, sapVirtualInstanceName, data); + SapVirtualInstanceResource 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 + SapVirtualInstanceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task CreateOrUpdate_CreateInfrastructureWithDiskAndOSConfigurationForHASystemWithAvailabilitySetRecommended() + { + // Generated from example definition: 2024-09-01/SapVirtualInstances_CreateInfraDiskOsHaAvailabilitySetRecommended.json + // this example is just showing the usage of "SAPVirtualInstance_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 = "8e17e36c-42e9-4cd5-a078-7b44883414e0"; + string resourceGroupName = "test-rg"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this SapVirtualInstanceResource + SapVirtualInstanceCollection collection = resourceGroupResource.GetSapVirtualInstances(); + + // invoke the operation + string sapVirtualInstanceName = "X00"; + SapVirtualInstanceData data = new SapVirtualInstanceData(new AzureLocation("westcentralus")) + { + Properties = new SapVirtualInstanceProperties(SapEnvironmentType.Prod, SapProductType.S4HANA, new DeploymentWithOSConfiguration + { + AppLocation = "eastus", + InfrastructureConfiguration = new ThreeTierConfiguration("X00-RG", new CentralServerConfiguration("/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/dindurkhya-e2etesting/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet", new VirtualMachineConfiguration("Standard_E16ds_v4", new ImageReference + { + Publisher = "RedHat", + Offer = "RHEL-SAP", + Sku = "84sapha-gen2", + Version = "latest", + }, new OSProfile + { + AdminUsername = "{your-username}", + OSConfiguration = new LinuxConfiguration + { + DisablePasswordAuthentication = true, + SshKeyPair = new SshKeyPair + { + PublicKey = "abc", + PrivateKey = "xyz", + }, + }, + }), 2L), new ApplicationServerConfiguration("/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/dindurkhya-e2etesting/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet", new VirtualMachineConfiguration("Standard_E32ds_v4", new ImageReference + { + Publisher = "RedHat", + Offer = "RHEL-SAP", + Sku = "84sapha-gen2", + Version = "latest", + }, new OSProfile + { + AdminUsername = "{your-username}", + OSConfiguration = new LinuxConfiguration + { + DisablePasswordAuthentication = true, + SshKeyPair = new SshKeyPair + { + PublicKey = "abc", + PrivateKey = "xyz", + }, + }, + }), 6L), new DatabaseConfiguration("/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/dindurkhya-e2etesting/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/dbsubnet", new VirtualMachineConfiguration("Standard_M32ts", new ImageReference + { + Publisher = "RedHat", + Offer = "RHEL-SAP", + Sku = "84sapha-gen2", + Version = "latest", + }, new OSProfile + { + AdminUsername = "{your-username}", + OSConfiguration = new LinuxConfiguration + { + DisablePasswordAuthentication = true, + SshKeyPair = new SshKeyPair + { + PublicKey = "abc", + PrivateKey = "xyz", + }, + }, + }), 2L) + { + DatabaseType = SapDatabaseType.HANA, + DiskVolumeConfigurations = +{ +["backup"] = new DiskVolumeConfiguration +{ +Count = 2L, +SizeGB = 256L, +SkuName = DiskSkuName.StandardSSDLRS, +}, +["hana/data"] = new DiskVolumeConfiguration +{ +Count = 4L, +SizeGB = 128L, +SkuName = DiskSkuName.PremiumLRS, +}, +["hana/log"] = new DiskVolumeConfiguration +{ +Count = 3L, +SizeGB = 128L, +SkuName = DiskSkuName.PremiumLRS, +}, +["hana/shared"] = new DiskVolumeConfiguration +{ +Count = 1L, +SizeGB = 256L, +SkuName = DiskSkuName.StandardSSDLRS, +}, +["os"] = new DiskVolumeConfiguration +{ +Count = 1L, +SizeGB = 64L, +SkuName = DiskSkuName.StandardSSDLRS, +}, +["usr/sap"] = new DiskVolumeConfiguration +{ +Count = 1L, +SizeGB = 128L, +SkuName = DiskSkuName.PremiumLRS, +} +}, + }) + { + HighAvailabilityType = SapHighAvailabilityType.AvailabilitySet, + }, + OSSapConfiguration = new OSSapConfiguration + { + SapFqdn = "xyz.test.com", + }, + }), + Tags = { }, + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, sapVirtualInstanceName, data); + SapVirtualInstanceResource 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 + SapVirtualInstanceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task CreateOrUpdate_CreateInfrastructureWithDiskAndOSConfigurationForHASystemWithAvailabilityZoneRecommended() + { + // Generated from example definition: 2024-09-01/SapVirtualInstances_CreateInfraDiskOsHaAvailabilityZoneRecommended.json + // this example is just showing the usage of "SAPVirtualInstance_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 = "8e17e36c-42e9-4cd5-a078-7b44883414e0"; + string resourceGroupName = "test-rg"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this SapVirtualInstanceResource + SapVirtualInstanceCollection collection = resourceGroupResource.GetSapVirtualInstances(); + + // invoke the operation + string sapVirtualInstanceName = "X00"; + SapVirtualInstanceData data = new SapVirtualInstanceData(new AzureLocation("westcentralus")) + { + Properties = new SapVirtualInstanceProperties(SapEnvironmentType.Prod, SapProductType.S4HANA, new DeploymentWithOSConfiguration + { + AppLocation = "eastus", + InfrastructureConfiguration = new ThreeTierConfiguration("X00-RG", new CentralServerConfiguration("/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/dindurkhya-e2etesting/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet", new VirtualMachineConfiguration("Standard_E16ds_v4", new ImageReference + { + Publisher = "RedHat", + Offer = "RHEL-SAP", + Sku = "84sapha-gen2", + Version = "latest", + }, new OSProfile + { + AdminUsername = "{your-username}", + OSConfiguration = new LinuxConfiguration + { + DisablePasswordAuthentication = true, + SshKeyPair = new SshKeyPair + { + PublicKey = "abc", + PrivateKey = "xyz", + }, + }, + }), 2L), new ApplicationServerConfiguration("/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/dindurkhya-e2etesting/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet", new VirtualMachineConfiguration("Standard_E32ds_v4", new ImageReference + { + Publisher = "RedHat", + Offer = "RHEL-SAP", + Sku = "84sapha-gen2", + Version = "latest", + }, new OSProfile + { + AdminUsername = "{your-username}", + OSConfiguration = new LinuxConfiguration + { + DisablePasswordAuthentication = true, + SshKeyPair = new SshKeyPair + { + PublicKey = "abc", + PrivateKey = "xyz", + }, + }, + }), 6L), new DatabaseConfiguration("/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/dindurkhya-e2etesting/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/dbsubnet", new VirtualMachineConfiguration("Standard_M32ts", new ImageReference + { + Publisher = "RedHat", + Offer = "RHEL-SAP", + Sku = "84sapha-gen2", + Version = "latest", + }, new OSProfile + { + AdminUsername = "{your-username}", + OSConfiguration = new LinuxConfiguration + { + DisablePasswordAuthentication = true, + SshKeyPair = new SshKeyPair + { + PublicKey = "abc", + PrivateKey = "xyz", + }, + }, + }), 2L) + { + DatabaseType = SapDatabaseType.HANA, + DiskVolumeConfigurations = +{ +["backup"] = new DiskVolumeConfiguration +{ +Count = 2L, +SizeGB = 256L, +SkuName = DiskSkuName.StandardSSDLRS, +}, +["hana/data"] = new DiskVolumeConfiguration +{ +Count = 4L, +SizeGB = 128L, +SkuName = DiskSkuName.PremiumLRS, +}, +["hana/log"] = new DiskVolumeConfiguration +{ +Count = 3L, +SizeGB = 128L, +SkuName = DiskSkuName.PremiumLRS, +}, +["hana/shared"] = new DiskVolumeConfiguration +{ +Count = 1L, +SizeGB = 256L, +SkuName = DiskSkuName.StandardSSDLRS, +}, +["os"] = new DiskVolumeConfiguration +{ +Count = 1L, +SizeGB = 64L, +SkuName = DiskSkuName.StandardSSDLRS, +}, +["usr/sap"] = new DiskVolumeConfiguration +{ +Count = 1L, +SizeGB = 128L, +SkuName = DiskSkuName.PremiumLRS, +} +}, + }) + { + HighAvailabilityType = SapHighAvailabilityType.AvailabilityZone, + }, + OSSapConfiguration = new OSSapConfiguration + { + SapFqdn = "xyz.test.com", + }, + }), + Tags = { }, + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, sapVirtualInstanceName, data); + SapVirtualInstanceResource 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 + SapVirtualInstanceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task CreateOrUpdate_CreateInfrastructureWithDiskAndOSConfigurationsForSingleServerSystemRecommended() + { + // Generated from example definition: 2024-09-01/SapVirtualInstances_CreateInfraDiskOsSingleServerRecommended.json + // this example is just showing the usage of "SAPVirtualInstance_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 = "8e17e36c-42e9-4cd5-a078-7b44883414e0"; + string resourceGroupName = "test-rg"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this SapVirtualInstanceResource + SapVirtualInstanceCollection collection = resourceGroupResource.GetSapVirtualInstances(); + + // invoke the operation + string sapVirtualInstanceName = "X00"; + SapVirtualInstanceData data = new SapVirtualInstanceData(new AzureLocation("westcentralus")) + { + Properties = new SapVirtualInstanceProperties(SapEnvironmentType.NonProd, SapProductType.S4HANA, new DeploymentWithOSConfiguration + { + AppLocation = "eastus", + InfrastructureConfiguration = new SingleServerConfiguration("X00-RG", "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/dindurkhya-e2etesting/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet", new VirtualMachineConfiguration("Standard_E32ds_v4", new ImageReference + { + Publisher = "RedHat", + Offer = "RHEL-SAP", + Sku = "84sapha-gen2", + Version = "latest", + }, new OSProfile + { + AdminUsername = "{your-username}", + OSConfiguration = new LinuxConfiguration + { + DisablePasswordAuthentication = true, + SshKeyPair = new SshKeyPair + { + PublicKey = "abc", + PrivateKey = "xyz", + }, + }, + })) + { + IsSecondaryIPEnabled = true, + DatabaseType = SapDatabaseType.HANA, + DiskVolumeConfigurations = +{ +["backup"] = new DiskVolumeConfiguration +{ +Count = 2L, +SizeGB = 256L, +SkuName = DiskSkuName.StandardSSDLRS, +}, +["hana/data"] = new DiskVolumeConfiguration +{ +Count = 4L, +SizeGB = 128L, +SkuName = DiskSkuName.PremiumLRS, +}, +["hana/log"] = new DiskVolumeConfiguration +{ +Count = 3L, +SizeGB = 128L, +SkuName = DiskSkuName.PremiumLRS, +}, +["hana/shared"] = new DiskVolumeConfiguration +{ +Count = 1L, +SizeGB = 256L, +SkuName = DiskSkuName.StandardSSDLRS, +}, +["os"] = new DiskVolumeConfiguration +{ +Count = 1L, +SizeGB = 64L, +SkuName = DiskSkuName.StandardSSDLRS, +}, +["usr/sap"] = new DiskVolumeConfiguration +{ +Count = 1L, +SizeGB = 128L, +SkuName = DiskSkuName.PremiumLRS, +} +}, + }, + OSSapConfiguration = new OSSapConfiguration + { + SapFqdn = "xyz.test.com", + }, + }), + Tags = { }, + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, sapVirtualInstanceName, data); + SapVirtualInstanceResource 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 + SapVirtualInstanceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task CreateOrUpdate_CreateInfrastructureOnlyForHASystemWithAvailabilitySet() + { + // Generated from example definition: 2024-09-01/SapVirtualInstances_CreateInfraHaAvailabilitySet.json + // this example is just showing the usage of "SAPVirtualInstance_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 = "8e17e36c-42e9-4cd5-a078-7b44883414e0"; + string resourceGroupName = "test-rg"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this SapVirtualInstanceResource + SapVirtualInstanceCollection collection = resourceGroupResource.GetSapVirtualInstances(); + + // invoke the operation + string sapVirtualInstanceName = "X00"; + SapVirtualInstanceData data = new SapVirtualInstanceData(new AzureLocation("westcentralus")) + { + Properties = new SapVirtualInstanceProperties(SapEnvironmentType.Prod, SapProductType.S4HANA, new DeploymentConfiguration + { + AppLocation = "eastus", + InfrastructureConfiguration = new ThreeTierConfiguration("X00-RG", new CentralServerConfiguration("/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet", new VirtualMachineConfiguration("Standard_E16ds_v4", new ImageReference + { + Publisher = "RedHat", + Offer = "RHEL-SAP", + Sku = "84sapha-gen2", + Version = "latest", + }, new OSProfile + { + AdminUsername = "{your-username}", + OSConfiguration = new LinuxConfiguration + { + DisablePasswordAuthentication = true, + SshPublicKeys = {new SshPublicKey +{ +KeyData = "ssh-rsa public key", +}}, + }, + }), 2L), new ApplicationServerConfiguration("/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet", new VirtualMachineConfiguration("Standard_E32ds_v4", new ImageReference + { + Publisher = "RedHat", + Offer = "RHEL-SAP", + Sku = "84sapha-gen2", + Version = "latest", + }, new OSProfile + { + AdminUsername = "{your-username}", + OSConfiguration = new LinuxConfiguration + { + DisablePasswordAuthentication = true, + SshPublicKeys = {new SshPublicKey +{ +KeyData = "ssh-rsa public key", +}}, + }, + }), 5L), new DatabaseConfiguration("/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/dbsubnet", new VirtualMachineConfiguration("Standard_M32ts", new ImageReference + { + Publisher = "RedHat", + Offer = "RHEL-SAP", + Sku = "84sapha-gen2", + Version = "latest", + }, new OSProfile + { + AdminUsername = "{your-username}", + OSConfiguration = new LinuxConfiguration + { + DisablePasswordAuthentication = true, + SshPublicKeys = {new SshPublicKey +{ +KeyData = "ssh-rsa public key", +}}, + }, + }), 2L) + { + DatabaseType = SapDatabaseType.HANA, + }) + { + HighAvailabilityType = SapHighAvailabilityType.AvailabilitySet, + }, + }), + Tags = { }, + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, sapVirtualInstanceName, data); + SapVirtualInstanceResource 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 + SapVirtualInstanceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task CreateOrUpdate_CreateInfrastructureOnlyForHASystemWithAvailabilityZone() + { + // Generated from example definition: 2024-09-01/SapVirtualInstances_CreateInfraHaAvailabilityZone.json + // this example is just showing the usage of "SAPVirtualInstance_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 = "8e17e36c-42e9-4cd5-a078-7b44883414e0"; + string resourceGroupName = "test-rg"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this SapVirtualInstanceResource + SapVirtualInstanceCollection collection = resourceGroupResource.GetSapVirtualInstances(); + + // invoke the operation + string sapVirtualInstanceName = "X00"; + SapVirtualInstanceData data = new SapVirtualInstanceData(new AzureLocation("westcentralus")) + { + Properties = new SapVirtualInstanceProperties(SapEnvironmentType.Prod, SapProductType.S4HANA, new DeploymentConfiguration + { + AppLocation = "eastus", + InfrastructureConfiguration = new ThreeTierConfiguration("X00-RG", new CentralServerConfiguration("/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet", new VirtualMachineConfiguration("Standard_E16ds_v4", new ImageReference + { + Publisher = "RedHat", + Offer = "RHEL-SAP", + Sku = "84sapha-gen2", + Version = "latest", + }, new OSProfile + { + AdminUsername = "{your-username}", + OSConfiguration = new LinuxConfiguration + { + DisablePasswordAuthentication = true, + SshPublicKeys = {new SshPublicKey +{ +KeyData = "ssh-rsa public key", +}}, + }, + }), 2L), new ApplicationServerConfiguration("/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet", new VirtualMachineConfiguration("Standard_E32ds_v4", new ImageReference + { + Publisher = "RedHat", + Offer = "RHEL-SAP", + Sku = "84sapha-gen2", + Version = "latest", + }, new OSProfile + { + AdminUsername = "{your-username}", + OSConfiguration = new LinuxConfiguration + { + DisablePasswordAuthentication = true, + SshPublicKeys = {new SshPublicKey +{ +KeyData = "ssh-rsa public key", +}}, + }, + }), 6L), new DatabaseConfiguration("/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/dbsubnet", new VirtualMachineConfiguration("Standard_M32ts", new ImageReference + { + Publisher = "RedHat", + Offer = "RHEL-SAP", + Sku = "84sapha-gen2", + Version = "latest", + }, new OSProfile + { + AdminUsername = "{your-username}", + OSConfiguration = new LinuxConfiguration + { + DisablePasswordAuthentication = true, + SshPublicKeys = {new SshPublicKey +{ +KeyData = "ssh-rsa public key", +}}, + }, + }), 2L) + { + DatabaseType = SapDatabaseType.HANA, + }) + { + HighAvailabilityType = SapHighAvailabilityType.AvailabilityZone, + }, + }), + Tags = { }, + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, sapVirtualInstanceName, data); + SapVirtualInstanceResource 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 + SapVirtualInstanceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task CreateOrUpdate_CreateInfrastructureWithOSConfigurationWithAzureComputeGalleryImage() + { + // Generated from example definition: 2024-09-01/SapVirtualInstances_CreateInfraOsComputeGalleryImage.json + // this example is just showing the usage of "SAPVirtualInstance_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 = "8e17e36c-42e9-4cd5-a078-7b44883414e0"; + string resourceGroupName = "test-rg"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this SapVirtualInstanceResource + SapVirtualInstanceCollection collection = resourceGroupResource.GetSapVirtualInstances(); + + // invoke the operation + string sapVirtualInstanceName = "X00"; + SapVirtualInstanceData data = new SapVirtualInstanceData(new AzureLocation("westcentralus")) + { + Properties = new SapVirtualInstanceProperties(SapEnvironmentType.Prod, SapProductType.S4HANA, new DeploymentConfiguration + { + AppLocation = "eastus", + InfrastructureConfiguration = new ThreeTierConfiguration("X00-RG", new CentralServerConfiguration("/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet", new VirtualMachineConfiguration("Standard_E16ds_v4", new ImageReference + { + Id = new ResourceIdentifier("/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Compute/galleries/testgallery/images/rhelimagetest/versions/0.0.1"), + }, new OSProfile + { + AdminUsername = "{your-username}", + OSConfiguration = new LinuxConfiguration + { + DisablePasswordAuthentication = true, + SshPublicKeys = {new SshPublicKey +{ +KeyData = "ssh-rsa public key", +}}, + }, + }), 2L), new ApplicationServerConfiguration("/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet", new VirtualMachineConfiguration("Standard_E32ds_v4", new ImageReference + { + Id = new ResourceIdentifier("/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Compute/galleries/testgallery/images/rhelimagetest/versions/0.0.1"), + }, new OSProfile + { + AdminUsername = "{your-username}", + OSConfiguration = new LinuxConfiguration + { + DisablePasswordAuthentication = true, + SshPublicKeys = {new SshPublicKey +{ +KeyData = "ssh-rsa public key", +}}, + }, + }), 6L), new DatabaseConfiguration("/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/dbsubnet", new VirtualMachineConfiguration("Standard_M32ts", new ImageReference + { + Id = new ResourceIdentifier("/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Compute/galleries/testgallery/images/rhelimagetest/versions/0.0.1"), + }, new OSProfile + { + AdminUsername = "{your-username}", + OSConfiguration = new LinuxConfiguration + { + DisablePasswordAuthentication = true, + SshPublicKeys = {new SshPublicKey +{ +KeyData = "ssh-rsa public key", +}}, + }, + }), 2L) + { + DatabaseType = SapDatabaseType.HANA, + }) + { + HighAvailabilityType = SapHighAvailabilityType.AvailabilityZone, + }, + }), + Tags = { }, + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, sapVirtualInstanceName, data); + SapVirtualInstanceResource 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 + SapVirtualInstanceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task CreateOrUpdate_CreateInfrastructureWithOSConfigurationWithCustomResourceNamesForDistributedSystem() + { + // Generated from example definition: 2024-09-01/SapVirtualInstances_CreateInfraOsCustomResourceNamesDS.json + // this example is just showing the usage of "SAPVirtualInstance_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 = "8e17e36c-42e9-4cd5-a078-7b44883414e0"; + string resourceGroupName = "test-rg"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this SapVirtualInstanceResource + SapVirtualInstanceCollection collection = resourceGroupResource.GetSapVirtualInstances(); + + // invoke the operation + string sapVirtualInstanceName = "X00"; + SapVirtualInstanceData data = new SapVirtualInstanceData(new AzureLocation("westcentralus")) + { + Properties = new SapVirtualInstanceProperties(SapEnvironmentType.Prod, SapProductType.S4HANA, new DeploymentWithOSConfiguration + { + AppLocation = "eastus", + InfrastructureConfiguration = new ThreeTierConfiguration("X00-RG", new CentralServerConfiguration("/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet", new VirtualMachineConfiguration("Standard_E16ds_v4", new ImageReference + { + Publisher = "RedHat", + Offer = "RHEL-SAP", + Sku = "84sapha-gen2", + Version = "latest", + }, new OSProfile + { + AdminUsername = "{your-username}", + OSConfiguration = new LinuxConfiguration + { + DisablePasswordAuthentication = true, + SshKeyPair = new SshKeyPair + { + PublicKey = "abc", + PrivateKey = "xyz", + }, + }, + }), 1L), new ApplicationServerConfiguration("/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet", new VirtualMachineConfiguration("Standard_E32ds_v4", new ImageReference + { + Publisher = "RedHat", + Offer = "RHEL-SAP", + Sku = "84sapha-gen2", + Version = "latest", + }, new OSProfile + { + AdminUsername = "{your-username}", + OSConfiguration = new LinuxConfiguration + { + DisablePasswordAuthentication = true, + SshKeyPair = new SshKeyPair + { + PublicKey = "abc", + PrivateKey = "xyz", + }, + }, + }), 6L), new DatabaseConfiguration("/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/dbsubnet", new VirtualMachineConfiguration("Standard_M32ts", new ImageReference + { + Publisher = "RedHat", + Offer = "RHEL-SAP", + Sku = "84sapha-gen2", + Version = "latest", + }, new OSProfile + { + AdminUsername = "{your-username}", + OSConfiguration = new LinuxConfiguration + { + DisablePasswordAuthentication = true, + SshKeyPair = new SshKeyPair + { + PublicKey = "abc", + PrivateKey = "xyz", + }, + }, + }), 1L) + { + DatabaseType = SapDatabaseType.HANA, + }) + { + CustomResourceNames = new ThreeTierFullResourceNames + { + CentralServer = new CentralServerFullResourceNames + { + VirtualMachines = {new VirtualMachineResourceNames +{ +VmName = "ascsvm", +HostName = "ascshostName", +NetworkInterfaces = {new NetworkInterfaceResourceNames +{ +NetworkInterfaceName = "ascsnic", +}}, +OSDiskName = "ascsosdisk", +DataDiskNames = +{ +["default"] = new string[]{"ascsdisk0"} +}, +}}, + }, + ApplicationServer = new ApplicationServerFullResourceNames + { + VirtualMachines = {new VirtualMachineResourceNames +{ +VmName = "appvm0", +HostName = "apphostName0", +NetworkInterfaces = {new NetworkInterfaceResourceNames +{ +NetworkInterfaceName = "appnic0", +}}, +OSDiskName = "app0osdisk", +DataDiskNames = +{ +["default"] = new string[]{"app0disk0"} +}, +}, new VirtualMachineResourceNames +{ +VmName = "appvm1", +HostName = "apphostName1", +NetworkInterfaces = {new NetworkInterfaceResourceNames +{ +NetworkInterfaceName = "appnic1", +}}, +OSDiskName = "app1osdisk", +DataDiskNames = +{ +["default"] = new string[]{"app1disk0"} +}, +}}, + AvailabilitySetName = "appAvSet", + }, + DatabaseServer = new DatabaseServerFullResourceNames + { + VirtualMachines = {new VirtualMachineResourceNames +{ +VmName = "dbvm", +HostName = "dbhostName", +NetworkInterfaces = {new NetworkInterfaceResourceNames +{ +NetworkInterfaceName = "dbnic", +}}, +OSDiskName = "dbosdisk", +DataDiskNames = +{ +["hanaData"] = new string[]{"hanadata0", "hanadata1"}, +["hanaLog"] = new string[]{"hanalog0", "hanalog1", "hanalog2"}, +["hanaShared"] = new string[]{"hanashared0", "hanashared1"}, +["usrSap"] = new string[]{"usrsap0"} +}, +}}, + }, + SharedStorage = new SharedStorageResourceNames + { + SharedStorageAccountName = "storageacc", + SharedStorageAccountPrivateEndPointName = "peForxNFS", + }, + }, + }, + OSSapConfiguration = new OSSapConfiguration + { + SapFqdn = "xyz.test.com", + }, + }), + Tags = { }, + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, sapVirtualInstanceName, data); + SapVirtualInstanceResource 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 + SapVirtualInstanceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task CreateOrUpdate_CreateInfrastructureWithOSConfigurationWithCustomResourceNamesForHASystemWithAvailabilitySet() + { + // Generated from example definition: 2024-09-01/SapVirtualInstances_CreateInfraOsCustomResourceNamesHaAvailabilitySet.json + // this example is just showing the usage of "SAPVirtualInstance_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 = "8e17e36c-42e9-4cd5-a078-7b44883414e0"; + string resourceGroupName = "test-rg"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this SapVirtualInstanceResource + SapVirtualInstanceCollection collection = resourceGroupResource.GetSapVirtualInstances(); + + // invoke the operation + string sapVirtualInstanceName = "X00"; + SapVirtualInstanceData data = new SapVirtualInstanceData(new AzureLocation("westcentralus")) + { + Properties = new SapVirtualInstanceProperties(SapEnvironmentType.Prod, SapProductType.S4HANA, new DeploymentWithOSConfiguration + { + AppLocation = "eastus", + InfrastructureConfiguration = new ThreeTierConfiguration("X00-RG", new CentralServerConfiguration("/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet", new VirtualMachineConfiguration("Standard_E16ds_v4", new ImageReference + { + Publisher = "RedHat", + Offer = "RHEL-SAP", + Sku = "84sapha-gen2", + Version = "latest", + }, new OSProfile + { + AdminUsername = "{your-username}", + OSConfiguration = new LinuxConfiguration + { + DisablePasswordAuthentication = true, + SshKeyPair = new SshKeyPair + { + PublicKey = "abc", + PrivateKey = "xyz", + }, + }, + }), 2L), new ApplicationServerConfiguration("/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet", new VirtualMachineConfiguration("Standard_E32ds_v4", new ImageReference + { + Publisher = "RedHat", + Offer = "RHEL-SAP", + Sku = "84sapha-gen2", + Version = "latest", + }, new OSProfile + { + AdminUsername = "{your-username}", + OSConfiguration = new LinuxConfiguration + { + DisablePasswordAuthentication = true, + SshKeyPair = new SshKeyPair + { + PublicKey = "abc", + PrivateKey = "xyz", + }, + }, + }), 6L), new DatabaseConfiguration("/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/dbsubnet", new VirtualMachineConfiguration("Standard_M32ts", new ImageReference + { + Publisher = "RedHat", + Offer = "RHEL-SAP", + Sku = "84sapha-gen2", + Version = "latest", + }, new OSProfile + { + AdminUsername = "{your-username}", + OSConfiguration = new LinuxConfiguration + { + DisablePasswordAuthentication = true, + SshKeyPair = new SshKeyPair + { + PublicKey = "abc", + PrivateKey = "xyz", + }, + }, + }), 2L) + { + DatabaseType = SapDatabaseType.HANA, + }) + { + HighAvailabilityType = SapHighAvailabilityType.AvailabilitySet, + CustomResourceNames = new ThreeTierFullResourceNames + { + CentralServer = new CentralServerFullResourceNames + { + VirtualMachines = {new VirtualMachineResourceNames +{ +VmName = "ascsvm", +HostName = "ascshostName", +NetworkInterfaces = {new NetworkInterfaceResourceNames +{ +NetworkInterfaceName = "ascsnic", +}}, +OSDiskName = "ascsosdisk", +}, new VirtualMachineResourceNames +{ +VmName = "ersvm", +HostName = "ershostName", +NetworkInterfaces = {new NetworkInterfaceResourceNames +{ +NetworkInterfaceName = "ersnic", +}}, +OSDiskName = "ersosdisk", +}}, + AvailabilitySetName = "csAvSet", + LoadBalancer = new LoadBalancerResourceNames + { + LoadBalancerName = "ascslb", + FrontendIPConfigurationNames = { "ascsip0", "ersip0" }, + BackendPoolNames = { "ascsBackendPool" }, + HealthProbeNames = { "ascsHealthProbe", "ersHealthProbe" }, + }, + }, + ApplicationServer = new ApplicationServerFullResourceNames + { + VirtualMachines = {new VirtualMachineResourceNames +{ +VmName = "appvm0", +HostName = "apphostName0", +NetworkInterfaces = {new NetworkInterfaceResourceNames +{ +NetworkInterfaceName = "appnic0", +}}, +OSDiskName = "app0osdisk", +DataDiskNames = +{ +["default"] = new string[]{"app0disk0"} +}, +}, new VirtualMachineResourceNames +{ +VmName = "appvm1", +HostName = "apphostName1", +NetworkInterfaces = {new NetworkInterfaceResourceNames +{ +NetworkInterfaceName = "appnic1", +}}, +OSDiskName = "app1osdisk", +DataDiskNames = +{ +["default"] = new string[]{"app1disk0"} +}, +}}, + AvailabilitySetName = "appAvSet", + }, + DatabaseServer = new DatabaseServerFullResourceNames + { + VirtualMachines = {new VirtualMachineResourceNames +{ +VmName = "dbvmpr", +HostName = "dbprhostName", +NetworkInterfaces = {new NetworkInterfaceResourceNames +{ +NetworkInterfaceName = "dbprnic", +}}, +OSDiskName = "dbprosdisk", +DataDiskNames = +{ +["hanaData"] = new string[]{"hanadatapr0", "hanadatapr1"}, +["hanaLog"] = new string[]{"hanalogpr0", "hanalogpr1", "hanalogpr2"}, +["hanaShared"] = new string[]{"hanasharedpr0", "hanasharedpr1"}, +["usrSap"] = new string[]{"usrsappr0"} +}, +}, new VirtualMachineResourceNames +{ +VmName = "dbvmsr", +HostName = "dbsrhostName", +NetworkInterfaces = {new NetworkInterfaceResourceNames +{ +NetworkInterfaceName = "dbsrnic", +}}, +OSDiskName = "dbsrosdisk", +DataDiskNames = +{ +["hanaData"] = new string[]{"hanadatasr0", "hanadatasr1"}, +["hanaLog"] = new string[]{"hanalogsr0", "hanalogsr1", "hanalogsr2"}, +["hanaShared"] = new string[]{"hanasharedsr0", "hanasharedsr1"}, +["usrSap"] = new string[]{"usrsapsr0"} +}, +}}, + AvailabilitySetName = "dbAvSet", + LoadBalancer = new LoadBalancerResourceNames + { + LoadBalancerName = "dblb", + FrontendIPConfigurationNames = { "dbip" }, + BackendPoolNames = { "dbBackendPool" }, + HealthProbeNames = { "dbHealthProbe" }, + }, + }, + SharedStorage = new SharedStorageResourceNames + { + SharedStorageAccountName = "storageacc", + SharedStorageAccountPrivateEndPointName = "peForxNFS", + }, + }, + }, + OSSapConfiguration = new OSSapConfiguration + { + SapFqdn = "xyz.test.com", + }, + }), + Tags = { }, + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, sapVirtualInstanceName, data); + SapVirtualInstanceResource 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 + SapVirtualInstanceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task CreateOrUpdate_CreateInfrastructureWithOSConfigurationWithCustomResourceNamesForHASystemWithAvailabilityZone() + { + // Generated from example definition: 2024-09-01/SapVirtualInstances_CreateInfraOsCustomResourceNamesHaAvailabilityZone.json + // this example is just showing the usage of "SAPVirtualInstance_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 = "8e17e36c-42e9-4cd5-a078-7b44883414e0"; + string resourceGroupName = "test-rg"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this SapVirtualInstanceResource + SapVirtualInstanceCollection collection = resourceGroupResource.GetSapVirtualInstances(); + + // invoke the operation + string sapVirtualInstanceName = "X00"; + SapVirtualInstanceData data = new SapVirtualInstanceData(new AzureLocation("westcentralus")) + { + Properties = new SapVirtualInstanceProperties(SapEnvironmentType.Prod, SapProductType.S4HANA, new DeploymentWithOSConfiguration + { + AppLocation = "eastus", + InfrastructureConfiguration = new ThreeTierConfiguration("X00-RG", new CentralServerConfiguration("/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet", new VirtualMachineConfiguration("Standard_E16ds_v4", new ImageReference + { + Publisher = "RedHat", + Offer = "RHEL-SAP", + Sku = "84sapha-gen2", + Version = "latest", + }, new OSProfile + { + AdminUsername = "{your-username}", + OSConfiguration = new LinuxConfiguration + { + DisablePasswordAuthentication = true, + SshKeyPair = new SshKeyPair + { + PublicKey = "abc", + PrivateKey = "xyz", + }, + }, + }), 2L), new ApplicationServerConfiguration("/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet", new VirtualMachineConfiguration("Standard_E32ds_v4", new ImageReference + { + Publisher = "RedHat", + Offer = "RHEL-SAP", + Sku = "84sapha-gen2", + Version = "latest", + }, new OSProfile + { + AdminUsername = "{your-username}", + OSConfiguration = new LinuxConfiguration + { + DisablePasswordAuthentication = true, + SshKeyPair = new SshKeyPair + { + PublicKey = "abc", + PrivateKey = "xyz", + }, + }, + }), 6L), new DatabaseConfiguration("/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/dbsubnet", new VirtualMachineConfiguration("Standard_M32ts", new ImageReference + { + Publisher = "RedHat", + Offer = "RHEL-SAP", + Sku = "84sapha-gen2", + Version = "latest", + }, new OSProfile + { + AdminUsername = "{your-username}", + OSConfiguration = new LinuxConfiguration + { + DisablePasswordAuthentication = true, + SshKeyPair = new SshKeyPair + { + PublicKey = "abc", + PrivateKey = "xyz", + }, + }, + }), 2L) + { + DatabaseType = SapDatabaseType.HANA, + }) + { + HighAvailabilityType = SapHighAvailabilityType.AvailabilityZone, + CustomResourceNames = new ThreeTierFullResourceNames + { + CentralServer = new CentralServerFullResourceNames + { + VirtualMachines = {new VirtualMachineResourceNames +{ +VmName = "ascsvm", +HostName = "ascshostName", +NetworkInterfaces = {new NetworkInterfaceResourceNames +{ +NetworkInterfaceName = "ascsnic", +}}, +OSDiskName = "ascsosdisk", +}, new VirtualMachineResourceNames +{ +VmName = "ersvm", +HostName = "ershostName", +NetworkInterfaces = {new NetworkInterfaceResourceNames +{ +NetworkInterfaceName = "ersnic", +}}, +OSDiskName = "ersosdisk", +}}, + LoadBalancer = new LoadBalancerResourceNames + { + LoadBalancerName = "ascslb", + FrontendIPConfigurationNames = { "ascsip0", "ersip0" }, + BackendPoolNames = { "ascsBackendPool" }, + HealthProbeNames = { "ascsHealthProbe", "ersHealthProbe" }, + }, + }, + ApplicationServer = new ApplicationServerFullResourceNames + { + VirtualMachines = {new VirtualMachineResourceNames +{ +VmName = "appvm0", +HostName = "apphostName0", +NetworkInterfaces = {new NetworkInterfaceResourceNames +{ +NetworkInterfaceName = "appnic0", +}}, +OSDiskName = "app0osdisk", +DataDiskNames = +{ +["default"] = new string[]{"app0disk0"} +}, +}, new VirtualMachineResourceNames +{ +VmName = "appvm1", +HostName = "apphostName1", +NetworkInterfaces = {new NetworkInterfaceResourceNames +{ +NetworkInterfaceName = "appnic1", +}}, +OSDiskName = "app1osdisk", +DataDiskNames = +{ +["default"] = new string[]{"app1disk0"} +}, +}}, + }, + DatabaseServer = new DatabaseServerFullResourceNames + { + VirtualMachines = {new VirtualMachineResourceNames +{ +VmName = "dbvmpr", +HostName = "dbprhostName", +NetworkInterfaces = {new NetworkInterfaceResourceNames +{ +NetworkInterfaceName = "dbprnic", +}}, +OSDiskName = "dbprosdisk", +DataDiskNames = +{ +["hanaData"] = new string[]{"hanadatapr0", "hanadatapr1"}, +["hanaLog"] = new string[]{"hanalogpr0", "hanalogpr1", "hanalogpr2"}, +["hanaShared"] = new string[]{"hanasharedpr0", "hanasharedpr1"}, +["usrSap"] = new string[]{"usrsappr0"} +}, +}, new VirtualMachineResourceNames +{ +VmName = "dbvmsr", +HostName = "dbsrhostName", +NetworkInterfaces = {new NetworkInterfaceResourceNames +{ +NetworkInterfaceName = "dbsrnic", +}}, +OSDiskName = "dbsrosdisk", +DataDiskNames = +{ +["hanaData"] = new string[]{"hanadatasr0", "hanadatasr1"}, +["hanaLog"] = new string[]{"hanalogsr0", "hanalogsr1", "hanalogsr2"}, +["hanaShared"] = new string[]{"hanasharedsr0", "hanasharedsr1"}, +["usrSap"] = new string[]{"usrsapsr0"} +}, +}}, + LoadBalancer = new LoadBalancerResourceNames + { + LoadBalancerName = "dblb", + FrontendIPConfigurationNames = { "dbip" }, + BackendPoolNames = { "dbBackendPool" }, + HealthProbeNames = { "dbHealthProbe" }, + }, + }, + SharedStorage = new SharedStorageResourceNames + { + SharedStorageAccountName = "storageacc", + SharedStorageAccountPrivateEndPointName = "peForxNFS", + }, + }, + }, + OSSapConfiguration = new OSSapConfiguration + { + SapFqdn = "xyz.test.com", + }, + }), + Tags = { }, + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, sapVirtualInstanceName, data); + SapVirtualInstanceResource 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 + SapVirtualInstanceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task CreateOrUpdate_CreateInfrastructureWithOSConfigurationWithCustomResourceNamesForSingleServerSystem() + { + // Generated from example definition: 2024-09-01/SapVirtualInstances_CreateInfraOsCustomResourceNamesSingleServer.json + // this example is just showing the usage of "SAPVirtualInstance_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 = "8e17e36c-42e9-4cd5-a078-7b44883414e0"; + string resourceGroupName = "test-rg"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this SapVirtualInstanceResource + SapVirtualInstanceCollection collection = resourceGroupResource.GetSapVirtualInstances(); + + // invoke the operation + string sapVirtualInstanceName = "X00"; + SapVirtualInstanceData data = new SapVirtualInstanceData(new AzureLocation("westcentralus")) + { + Properties = new SapVirtualInstanceProperties(SapEnvironmentType.NonProd, SapProductType.S4HANA, new DeploymentWithOSConfiguration + { + AppLocation = "eastus", + InfrastructureConfiguration = new SingleServerConfiguration("X00-RG", "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet", new VirtualMachineConfiguration("Standard_E32ds_v4", new ImageReference + { + Publisher = "RedHat", + Offer = "RHEL-SAP", + Sku = "84sapha-gen2", + Version = "latest", + }, new OSProfile + { + AdminUsername = "{your-username}", + OSConfiguration = new LinuxConfiguration + { + DisablePasswordAuthentication = true, + SshKeyPair = new SshKeyPair + { + PublicKey = "abc", + PrivateKey = "xyz", + }, + }, + })) + { + IsSecondaryIPEnabled = true, + DatabaseType = SapDatabaseType.HANA, + }, + OSSapConfiguration = new OSSapConfiguration + { + SapFqdn = "xyz.test.com", + }, + }), + Tags = { }, + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, sapVirtualInstanceName, data); + SapVirtualInstanceResource 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 + SapVirtualInstanceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task CreateOrUpdate_CreateInfrastructureWithOSConfigurationForDistributedSystemRecommended() + { + // Generated from example definition: 2024-09-01/SapVirtualInstances_CreateInfraOsDSRecommended.json + // this example is just showing the usage of "SAPVirtualInstance_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 = "8e17e36c-42e9-4cd5-a078-7b44883414e0"; + string resourceGroupName = "test-rg"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this SapVirtualInstanceResource + SapVirtualInstanceCollection collection = resourceGroupResource.GetSapVirtualInstances(); + + // invoke the operation + string sapVirtualInstanceName = "X00"; + SapVirtualInstanceData data = new SapVirtualInstanceData(new AzureLocation("westcentralus")) + { + Properties = new SapVirtualInstanceProperties(SapEnvironmentType.Prod, SapProductType.S4HANA, new DeploymentWithOSConfiguration + { + AppLocation = "eastus", + InfrastructureConfiguration = new ThreeTierConfiguration("X00-RG", new CentralServerConfiguration("/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet", new VirtualMachineConfiguration("Standard_E16ds_v4", new ImageReference + { + Publisher = "RedHat", + Offer = "RHEL-SAP", + Sku = "84sapha-gen2", + Version = "latest", + }, new OSProfile + { + AdminUsername = "{your-username}", + OSConfiguration = new LinuxConfiguration + { + DisablePasswordAuthentication = true, + SshKeyPair = new SshKeyPair + { + PublicKey = "abc", + PrivateKey = "xyz", + }, + }, + }), 1L), new ApplicationServerConfiguration("/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet", new VirtualMachineConfiguration("Standard_E32ds_v4", new ImageReference + { + Publisher = "RedHat", + Offer = "RHEL-SAP", + Sku = "84sapha-gen2", + Version = "latest", + }, new OSProfile + { + AdminUsername = "{your-username}", + OSConfiguration = new LinuxConfiguration + { + DisablePasswordAuthentication = true, + SshKeyPair = new SshKeyPair + { + PublicKey = "abc", + PrivateKey = "xyz", + }, + }, + }), 6L), new DatabaseConfiguration("/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/dbsubnet", new VirtualMachineConfiguration("Standard_M32ts", new ImageReference + { + Publisher = "RedHat", + Offer = "RHEL-SAP", + Sku = "84sapha-gen2", + Version = "latest", + }, new OSProfile + { + AdminUsername = "{your-username}", + OSConfiguration = new LinuxConfiguration + { + DisablePasswordAuthentication = true, + SshKeyPair = new SshKeyPair + { + PublicKey = "abc", + PrivateKey = "xyz", + }, + }, + }), 1L) + { + DatabaseType = SapDatabaseType.HANA, + }), + OSSapConfiguration = new OSSapConfiguration + { + SapFqdn = "xyz.test.com", + }, + }), + Tags = { }, + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, sapVirtualInstanceName, data); + SapVirtualInstanceResource 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 + SapVirtualInstanceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task CreateOrUpdate_CreateInfrastructureWithOSConfigurationForHASystemWithAvailabilitySetRecommended() + { + // Generated from example definition: 2024-09-01/SapVirtualInstances_CreateInfraOsHaAvailabilitySetRecommended.json + // this example is just showing the usage of "SAPVirtualInstance_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 = "8e17e36c-42e9-4cd5-a078-7b44883414e0"; + string resourceGroupName = "test-rg"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this SapVirtualInstanceResource + SapVirtualInstanceCollection collection = resourceGroupResource.GetSapVirtualInstances(); + + // invoke the operation + string sapVirtualInstanceName = "X00"; + SapVirtualInstanceData data = new SapVirtualInstanceData(new AzureLocation("westcentralus")) + { + Properties = new SapVirtualInstanceProperties(SapEnvironmentType.Prod, SapProductType.S4HANA, new DeploymentWithOSConfiguration + { + AppLocation = "eastus", + InfrastructureConfiguration = new ThreeTierConfiguration("X00-RG", new CentralServerConfiguration("/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet", new VirtualMachineConfiguration("Standard_E16ds_v4", new ImageReference + { + Publisher = "RedHat", + Offer = "RHEL-SAP", + Sku = "84sapha-gen2", + Version = "latest", + }, new OSProfile + { + AdminUsername = "{your-username}", + OSConfiguration = new LinuxConfiguration + { + DisablePasswordAuthentication = true, + SshKeyPair = new SshKeyPair + { + PublicKey = "abc", + PrivateKey = "xyz", + }, + }, + }), 2L), new ApplicationServerConfiguration("/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet", new VirtualMachineConfiguration("Standard_E32ds_v4", new ImageReference + { + Publisher = "RedHat", + Offer = "RHEL-SAP", + Sku = "84sapha-gen2", + Version = "latest", + }, new OSProfile + { + AdminUsername = "{your-username}", + OSConfiguration = new LinuxConfiguration + { + DisablePasswordAuthentication = true, + SshKeyPair = new SshKeyPair + { + PublicKey = "abc", + PrivateKey = "xyz", + }, + }, + }), 6L), new DatabaseConfiguration("/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/dbsubnet", new VirtualMachineConfiguration("Standard_M32ts", new ImageReference + { + Publisher = "RedHat", + Offer = "RHEL-SAP", + Sku = "84sapha-gen2", + Version = "latest", + }, new OSProfile + { + AdminUsername = "{your-username}", + OSConfiguration = new LinuxConfiguration + { + DisablePasswordAuthentication = true, + SshKeyPair = new SshKeyPair + { + PublicKey = "abc", + PrivateKey = "xyz", + }, + }, + }), 2L) + { + DatabaseType = SapDatabaseType.HANA, + }) + { + HighAvailabilityType = SapHighAvailabilityType.AvailabilitySet, + }, + OSSapConfiguration = new OSSapConfiguration + { + SapFqdn = "xyz.test.com", + }, + }), + Tags = { }, + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, sapVirtualInstanceName, data); + SapVirtualInstanceResource 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 + SapVirtualInstanceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task CreateOrUpdate_CreateInfrastructureWithOSConfigurationForHASystemWithAvailabilityZoneRecommended() + { + // Generated from example definition: 2024-09-01/SapVirtualInstances_CreateInfraOsHaAvailabilityZoneRecommended.json + // this example is just showing the usage of "SAPVirtualInstance_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 = "8e17e36c-42e9-4cd5-a078-7b44883414e0"; + string resourceGroupName = "test-rg"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this SapVirtualInstanceResource + SapVirtualInstanceCollection collection = resourceGroupResource.GetSapVirtualInstances(); + + // invoke the operation + string sapVirtualInstanceName = "X00"; + SapVirtualInstanceData data = new SapVirtualInstanceData(new AzureLocation("westcentralus")) + { + Properties = new SapVirtualInstanceProperties(SapEnvironmentType.Prod, SapProductType.S4HANA, new DeploymentWithOSConfiguration + { + AppLocation = "eastus", + InfrastructureConfiguration = new ThreeTierConfiguration("X00-RG", new CentralServerConfiguration("/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet", new VirtualMachineConfiguration("Standard_E16ds_v4", new ImageReference + { + Publisher = "RedHat", + Offer = "RHEL-SAP", + Sku = "84sapha-gen2", + Version = "latest", + }, new OSProfile + { + AdminUsername = "{your-username}", + OSConfiguration = new LinuxConfiguration + { + DisablePasswordAuthentication = true, + SshKeyPair = new SshKeyPair + { + PublicKey = "abc", + PrivateKey = "xyz", + }, + }, + }), 2L), new ApplicationServerConfiguration("/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet", new VirtualMachineConfiguration("Standard_E32ds_v4", new ImageReference + { + Publisher = "RedHat", + Offer = "RHEL-SAP", + Sku = "84sapha-gen2", + Version = "latest", + }, new OSProfile + { + AdminUsername = "{your-username}", + OSConfiguration = new LinuxConfiguration + { + DisablePasswordAuthentication = true, + SshKeyPair = new SshKeyPair + { + PublicKey = "abc", + PrivateKey = "xyz", + }, + }, + }), 6L), new DatabaseConfiguration("/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/dbsubnet", new VirtualMachineConfiguration("Standard_M32ts", new ImageReference + { + Publisher = "RedHat", + Offer = "RHEL-SAP", + Sku = "84sapha-gen2", + Version = "latest", + }, new OSProfile + { + AdminUsername = "{your-username}", + OSConfiguration = new LinuxConfiguration + { + DisablePasswordAuthentication = true, + SshKeyPair = new SshKeyPair + { + PublicKey = "abc", + PrivateKey = "xyz", + }, + }, + }), 2L) + { + DatabaseType = SapDatabaseType.HANA, + }) + { + HighAvailabilityType = SapHighAvailabilityType.AvailabilityZone, + }, + OSSapConfiguration = new OSSapConfiguration + { + SapFqdn = "xyz.test.com", + }, + }), + Tags = { }, + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, sapVirtualInstanceName, data); + SapVirtualInstanceResource 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 + SapVirtualInstanceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task CreateOrUpdate_CreateInfrastructureWithOSConfigurationForSingleServerSystemRecommended() + { + // Generated from example definition: 2024-09-01/SapVirtualInstances_CreateInfraOsSIngleServerRecommended.json + // this example is just showing the usage of "SAPVirtualInstance_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 = "8e17e36c-42e9-4cd5-a078-7b44883414e0"; + string resourceGroupName = "test-rg"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this SapVirtualInstanceResource + SapVirtualInstanceCollection collection = resourceGroupResource.GetSapVirtualInstances(); + + // invoke the operation + string sapVirtualInstanceName = "X00"; + SapVirtualInstanceData data = new SapVirtualInstanceData(new AzureLocation("westcentralus")) + { + Properties = new SapVirtualInstanceProperties(SapEnvironmentType.NonProd, SapProductType.S4HANA, new DeploymentWithOSConfiguration + { + AppLocation = "eastus", + InfrastructureConfiguration = new SingleServerConfiguration("X00-RG", "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet", new VirtualMachineConfiguration("Standard_E32ds_v4", new ImageReference + { + Publisher = "RedHat", + Offer = "RHEL-SAP", + Sku = "84sapha-gen2", + Version = "latest", + }, new OSProfile + { + AdminUsername = "{your-username}", + OSConfiguration = new LinuxConfiguration + { + DisablePasswordAuthentication = true, + SshKeyPair = new SshKeyPair + { + PublicKey = "abc", + PrivateKey = "xyz", + }, + }, + })) + { + IsSecondaryIPEnabled = true, + DatabaseType = SapDatabaseType.HANA, + }, + OSSapConfiguration = new OSSapConfiguration + { + SapFqdn = "xyz.test.com", + }, + }), + Tags = { }, + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, sapVirtualInstanceName, data); + SapVirtualInstanceResource 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 + SapVirtualInstanceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task CreateOrUpdate_CreateInfrastructureOnlyForSingleServerSystem() + { + // Generated from example definition: 2024-09-01/SapVirtualInstances_CreateInfraSingleServer.json + // this example is just showing the usage of "SAPVirtualInstance_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 = "8e17e36c-42e9-4cd5-a078-7b44883414e0"; + string resourceGroupName = "test-rg"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this SapVirtualInstanceResource + SapVirtualInstanceCollection collection = resourceGroupResource.GetSapVirtualInstances(); + + // invoke the operation + string sapVirtualInstanceName = "X00"; + SapVirtualInstanceData data = new SapVirtualInstanceData(new AzureLocation("westcentralus")) + { + Properties = new SapVirtualInstanceProperties(SapEnvironmentType.NonProd, SapProductType.S4HANA, new DeploymentConfiguration + { + AppLocation = "eastus", + InfrastructureConfiguration = new SingleServerConfiguration("X00-RG", "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet", new VirtualMachineConfiguration("Standard_E32ds_v4", new ImageReference + { + Publisher = "RedHat", + Offer = "RHEL-SAP", + Sku = "84sapha-gen2", + Version = "latest", + }, new OSProfile + { + AdminUsername = "{your-username}", + OSConfiguration = new LinuxConfiguration + { + DisablePasswordAuthentication = true, + SshPublicKeys = {new SshPublicKey +{ +KeyData = "ssh-rsa public key", +}}, + }, + })) + { + IsSecondaryIPEnabled = true, + DatabaseType = SapDatabaseType.HANA, + }, + }), + Tags = { }, + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, sapVirtualInstanceName, data); + SapVirtualInstanceResource 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 + SapVirtualInstanceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task CreateOrUpdate_CreateInfrastructureWithAnExistingSAPTransportDirectoryFileshare() + { + // Generated from example definition: 2024-09-01/SapVirtualInstances_CreateInfraWithExistingFileshare.json + // this example is just showing the usage of "SAPVirtualInstance_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 = "8e17e36c-42e9-4cd5-a078-7b44883414e0"; + string resourceGroupName = "test-rg"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this SapVirtualInstanceResource + SapVirtualInstanceCollection collection = resourceGroupResource.GetSapVirtualInstances(); + + // invoke the operation + string sapVirtualInstanceName = "X00"; + SapVirtualInstanceData data = new SapVirtualInstanceData(new AzureLocation("westcentralus")) + { + Properties = new SapVirtualInstanceProperties(SapEnvironmentType.Prod, SapProductType.S4HANA, new DeploymentWithOSConfiguration + { + AppLocation = "eastus", + InfrastructureConfiguration = new ThreeTierConfiguration("X00-RG", new CentralServerConfiguration("/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet", new VirtualMachineConfiguration("Standard_E16ds_v4", new ImageReference + { + Publisher = "RedHat", + Offer = "RHEL-SAP", + Sku = "84sapha-gen2", + Version = "latest", + }, new OSProfile + { + AdminUsername = "{your-username}", + OSConfiguration = new LinuxConfiguration + { + DisablePasswordAuthentication = true, + SshKeyPair = new SshKeyPair + { + PublicKey = "abc", + PrivateKey = "xyz", + }, + }, + }), 1L), new ApplicationServerConfiguration("/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet", new VirtualMachineConfiguration("Standard_E32ds_v4", new ImageReference + { + Publisher = "RedHat", + Offer = "RHEL-SAP", + Sku = "84sapha-gen2", + Version = "latest", + }, new OSProfile + { + AdminUsername = "{your-username}", + OSConfiguration = new LinuxConfiguration + { + DisablePasswordAuthentication = true, + SshKeyPair = new SshKeyPair + { + PublicKey = "abc", + PrivateKey = "xyz", + }, + }, + }), 6L), new DatabaseConfiguration("/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/dbsubnet", new VirtualMachineConfiguration("Standard_M32ts", new ImageReference + { + Publisher = "RedHat", + Offer = "RHEL-SAP", + Sku = "84sapha-gen2", + Version = "latest", + }, new OSProfile + { + AdminUsername = "{your-username}", + OSConfiguration = new LinuxConfiguration + { + DisablePasswordAuthentication = true, + SshKeyPair = new SshKeyPair + { + PublicKey = "abc", + PrivateKey = "xyz", + }, + }, + }), 1L) + { + DatabaseType = SapDatabaseType.HANA, + }) + { + StorageTransportFileShareConfiguration = new MountFileShareConfiguration("/subscriptions/49d64d54-e888-4c46-a868-1936802b762c/resourceGroups/testrg/providers/Microsoft.Network/privateEndpoints/endpoint", "/subscriptions/49d64d54-e888-4c46-a868-1936802b762c/resourceGroups/testrg/providers/Microsoft.Network/privateEndpoints/endpoint"), + }, + OSSapConfiguration = new OSSapConfiguration + { + SapFqdn = "xyz.test.com", + }, + }), + Tags = { }, + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, sapVirtualInstanceName, data); + SapVirtualInstanceResource 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 + SapVirtualInstanceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task CreateOrUpdate_CreateInfrastructureWithANewSAPTransportDirectoryFileshare() + { + // Generated from example definition: 2024-09-01/SapVirtualInstances_CreateInfraWithNewFileshare.json + // this example is just showing the usage of "SAPVirtualInstance_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 = "8e17e36c-42e9-4cd5-a078-7b44883414e0"; + string resourceGroupName = "test-rg"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this SapVirtualInstanceResource + SapVirtualInstanceCollection collection = resourceGroupResource.GetSapVirtualInstances(); + + // invoke the operation + string sapVirtualInstanceName = "X00"; + SapVirtualInstanceData data = new SapVirtualInstanceData(new AzureLocation("westcentralus")) + { + Properties = new SapVirtualInstanceProperties(SapEnvironmentType.Prod, SapProductType.S4HANA, new DeploymentWithOSConfiguration + { + AppLocation = "eastus", + InfrastructureConfiguration = new ThreeTierConfiguration("X00-RG", new CentralServerConfiguration("/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet", new VirtualMachineConfiguration("Standard_E16ds_v4", new ImageReference + { + Publisher = "RedHat", + Offer = "RHEL-SAP", + Sku = "84sapha-gen2", + Version = "latest", + }, new OSProfile + { + AdminUsername = "{your-username}", + OSConfiguration = new LinuxConfiguration + { + DisablePasswordAuthentication = true, + SshKeyPair = new SshKeyPair + { + PublicKey = "abc", + PrivateKey = "xyz", + }, + }, + }), 1L), new ApplicationServerConfiguration("/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet", new VirtualMachineConfiguration("Standard_E32ds_v4", new ImageReference + { + Publisher = "RedHat", + Offer = "RHEL-SAP", + Sku = "84sapha-gen2", + Version = "latest", + }, new OSProfile + { + AdminUsername = "{your-username}", + OSConfiguration = new LinuxConfiguration + { + DisablePasswordAuthentication = true, + SshKeyPair = new SshKeyPair + { + PublicKey = "abc", + PrivateKey = "xyz", + }, + }, + }), 6L), new DatabaseConfiguration("/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/dbsubnet", new VirtualMachineConfiguration("Standard_M32ts", new ImageReference + { + Publisher = "RedHat", + Offer = "RHEL-SAP", + Sku = "84sapha-gen2", + Version = "latest", + }, new OSProfile + { + AdminUsername = "{your-username}", + OSConfiguration = new LinuxConfiguration + { + DisablePasswordAuthentication = true, + SshKeyPair = new SshKeyPair + { + PublicKey = "abc", + PrivateKey = "xyz", + }, + }, + }), 1L) + { + DatabaseType = SapDatabaseType.HANA, + }) + { + StorageTransportFileShareConfiguration = new CreateAndMountFileShareConfiguration + { + ResourceGroup = "rgName", + StorageAccountName = "storageName", + }, + }, + OSSapConfiguration = new OSSapConfiguration + { + SapFqdn = "xyz.test.com", + }, + }), + Tags = { }, + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, sapVirtualInstanceName, data); + SapVirtualInstanceResource 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 + SapVirtualInstanceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task CreateOrUpdate_CreateInfrastructureWithOSConfigurationWithTrustedAccessEnabled() + { + // Generated from example definition: 2024-09-01/SapVirtualInstances_CreateInfraWithOsTrustedAccess.json + // this example is just showing the usage of "SAPVirtualInstance_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 = "8e17e36c-42e9-4cd5-a078-7b44883414e0"; + string resourceGroupName = "test-rg"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this SapVirtualInstanceResource + SapVirtualInstanceCollection collection = resourceGroupResource.GetSapVirtualInstances(); + + // invoke the operation + string sapVirtualInstanceName = "X00"; + SapVirtualInstanceData data = new SapVirtualInstanceData(new AzureLocation("westcentralus")) + { + Properties = new SapVirtualInstanceProperties(SapEnvironmentType.Prod, SapProductType.S4HANA, new DeploymentWithOSConfiguration + { + AppLocation = "eastus", + InfrastructureConfiguration = new ThreeTierConfiguration("X00-RG", new CentralServerConfiguration("/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet", new VirtualMachineConfiguration("Standard_E16ds_v4", new ImageReference + { + Publisher = "RedHat", + Offer = "RHEL-SAP", + Sku = "84sapha-gen2", + Version = "latest", + }, new OSProfile + { + AdminUsername = "{your-username}", + OSConfiguration = new LinuxConfiguration + { + DisablePasswordAuthentication = true, + SshKeyPair = new SshKeyPair + { + PublicKey = "abc", + PrivateKey = "xyz", + }, + }, + }), 1L), new ApplicationServerConfiguration("/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet", new VirtualMachineConfiguration("Standard_E32ds_v4", new ImageReference + { + Publisher = "RedHat", + Offer = "RHEL-SAP", + Sku = "84sapha-gen2", + Version = "latest", + }, new OSProfile + { + AdminUsername = "{your-username}", + OSConfiguration = new LinuxConfiguration + { + DisablePasswordAuthentication = true, + SshKeyPair = new SshKeyPair + { + PublicKey = "abc", + PrivateKey = "xyz", + }, + }, + }), 6L), new DatabaseConfiguration("/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/dbsubnet", new VirtualMachineConfiguration("Standard_M32ts", new ImageReference + { + Publisher = "RedHat", + Offer = "RHEL-SAP", + Sku = "84sapha-gen2", + Version = "latest", + }, new OSProfile + { + AdminUsername = "{your-username}", + OSConfiguration = new LinuxConfiguration + { + DisablePasswordAuthentication = true, + SshKeyPair = new SshKeyPair + { + PublicKey = "abc", + PrivateKey = "xyz", + }, + }, + }), 1L) + { + DatabaseType = SapDatabaseType.HANA, + }), + OSSapConfiguration = new OSSapConfiguration + { + SapFqdn = "xyz.test.com", + }, + }) + { + ManagedResourcesNetworkAccessType = ManagedResourcesNetworkAccessType.Private, + }, + Tags = { }, + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, sapVirtualInstanceName, data); + SapVirtualInstanceResource 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 + SapVirtualInstanceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task CreateOrUpdate_CreateInfrastructureWithoutASAPTransportDirectoryFileshare() + { + // Generated from example definition: 2024-09-01/SapVirtualInstances_CreateInfraWithoutFileshare.json + // this example is just showing the usage of "SAPVirtualInstance_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 = "8e17e36c-42e9-4cd5-a078-7b44883414e0"; + string resourceGroupName = "test-rg"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this SapVirtualInstanceResource + SapVirtualInstanceCollection collection = resourceGroupResource.GetSapVirtualInstances(); + + // invoke the operation + string sapVirtualInstanceName = "X00"; + SapVirtualInstanceData data = new SapVirtualInstanceData(new AzureLocation("westcentralus")) + { + Properties = new SapVirtualInstanceProperties(SapEnvironmentType.Prod, SapProductType.S4HANA, new DeploymentWithOSConfiguration + { + AppLocation = "eastus", + InfrastructureConfiguration = new ThreeTierConfiguration("X00-RG", new CentralServerConfiguration("/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet", new VirtualMachineConfiguration("Standard_E16ds_v4", new ImageReference + { + Publisher = "RedHat", + Offer = "RHEL-SAP", + Sku = "84sapha-gen2", + Version = "latest", + }, new OSProfile + { + AdminUsername = "{your-username}", + OSConfiguration = new LinuxConfiguration + { + DisablePasswordAuthentication = true, + SshKeyPair = new SshKeyPair + { + PublicKey = "abc", + PrivateKey = "xyz", + }, + }, + }), 1L), new ApplicationServerConfiguration("/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet", new VirtualMachineConfiguration("Standard_E32ds_v4", new ImageReference + { + Publisher = "RedHat", + Offer = "RHEL-SAP", + Sku = "84sapha-gen2", + Version = "latest", + }, new OSProfile + { + AdminUsername = "{your-username}", + OSConfiguration = new LinuxConfiguration + { + DisablePasswordAuthentication = true, + SshKeyPair = new SshKeyPair + { + PublicKey = "abc", + PrivateKey = "xyz", + }, + }, + }), 6L), new DatabaseConfiguration("/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/dbsubnet", new VirtualMachineConfiguration("Standard_M32ts", new ImageReference + { + Publisher = "RedHat", + Offer = "RHEL-SAP", + Sku = "84sapha-gen2", + Version = "latest", + }, new OSProfile + { + AdminUsername = "{your-username}", + OSConfiguration = new LinuxConfiguration + { + DisablePasswordAuthentication = true, + SshKeyPair = new SshKeyPair + { + PublicKey = "abc", + PrivateKey = "xyz", + }, + }, + }), 1L) + { + DatabaseType = SapDatabaseType.HANA, + }) + { + StorageTransportFileShareConfiguration = new SkipFileShareConfiguration(), + }, + OSSapConfiguration = new OSSapConfiguration + { + SapFqdn = "xyz.test.com", + }, + }), + Tags = { }, + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, sapVirtualInstanceName, data); + SapVirtualInstanceResource 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 + SapVirtualInstanceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task CreateOrUpdate_InstallSAPSoftwareOnDistributedSystem() + { + // Generated from example definition: 2024-09-01/SapVirtualInstances_CreateInstallDS.json + // this example is just showing the usage of "SAPVirtualInstance_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 = "8e17e36c-42e9-4cd5-a078-7b44883414e0"; + string resourceGroupName = "test-rg"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this SapVirtualInstanceResource + SapVirtualInstanceCollection collection = resourceGroupResource.GetSapVirtualInstances(); + + // invoke the operation + string sapVirtualInstanceName = "X00"; + SapVirtualInstanceData data = new SapVirtualInstanceData(new AzureLocation("eastus2")) + { + Properties = new SapVirtualInstanceProperties(SapEnvironmentType.Prod, SapProductType.S4HANA, new DeploymentWithOSConfiguration + { + AppLocation = "eastus", + InfrastructureConfiguration = new ThreeTierConfiguration("{{resourcegrp}}", new CentralServerConfiguration("/subscriptions/8e17e36c-42e9-4cd5-a078-7b44883414e0/resourceGroups/test-rg/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/app", new VirtualMachineConfiguration("Standard_E4ds_v4", new ImageReference + { + Publisher = "RedHat", + Offer = "RHEL-SAP-HA", + Sku = "8.2", + Version = "8.2.2021091201", + }, new OSProfile + { + AdminUsername = "azureuser", + OSConfiguration = new LinuxConfiguration + { + DisablePasswordAuthentication = true, + SshKeyPair = new SshKeyPair + { + PublicKey = "{{sshkey}}", + PrivateKey = "{{privateKey}}", + }, + }, + }), 1L), new ApplicationServerConfiguration("/subscriptions/8e17e36c-42e9-4cd5-a078-7b44883414e0/resourceGroups/test-rg/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/app", new VirtualMachineConfiguration("Standard_E4ds_v4", new ImageReference + { + Publisher = "RedHat", + Offer = "RHEL-SAP-HA", + Sku = "8.2", + Version = "8.2.2021091201", + }, new OSProfile + { + AdminUsername = "azureuser", + OSConfiguration = new LinuxConfiguration + { + DisablePasswordAuthentication = true, + SshKeyPair = new SshKeyPair + { + PublicKey = "{{sshkey}}", + PrivateKey = "{{privateKey}}", + }, + }, + }), 2L), new DatabaseConfiguration("/subscriptions/8e17e36c-42e9-4cd5-a078-7b44883414e0/resourceGroups/test-rg/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/app", new VirtualMachineConfiguration("Standard_M32ts", new ImageReference + { + Publisher = "RedHat", + Offer = "RHEL-SAP-HA", + Sku = "8.2", + Version = "8.2.2021091201", + }, new OSProfile + { + AdminUsername = "azureuser", + OSConfiguration = new LinuxConfiguration + { + DisablePasswordAuthentication = true, + SshKeyPair = new SshKeyPair + { + PublicKey = "{{sshkey}}", + PrivateKey = "{{privateKey}}", + }, + }, + }), 1L)) + { + IsSecondaryIPEnabled = true, + }, + SoftwareConfiguration = new SapInstallWithoutOSConfigSoftwareConfiguration("https://teststorageaccount.blob.core.windows.net/sapbits/sapfiles/boms/S41909SPS03_v0011ms/S41909SPS03_v0011ms.yaml", "/subscriptions/8e17e36c-42e9-4cd5-a078-7b44883414e0/resourceGroups/test-rg/providers/Microsoft.Storage/storageAccounts/teststorageaccount", "SAP S/4HANA 1909 SPS 03"), + OSSapConfiguration = new OSSapConfiguration + { + SapFqdn = "sap.bpaas.com", + }, + }), + Tags = +{ +["created by"] = "azureuser" +}, + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, sapVirtualInstanceName, data); + SapVirtualInstanceResource 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 + SapVirtualInstanceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task CreateOrUpdate_InstallSAPSoftwareOnSingleServerSystem() + { + // Generated from example definition: 2024-09-01/SapVirtualInstances_CreateInstallSingleServer.json + // this example is just showing the usage of "SAPVirtualInstance_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 = "8e17e36c-42e9-4cd5-a078-7b44883414e0"; + string resourceGroupName = "test-rg"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this SapVirtualInstanceResource + SapVirtualInstanceCollection collection = resourceGroupResource.GetSapVirtualInstances(); + + // invoke the operation + string sapVirtualInstanceName = "X00"; + SapVirtualInstanceData data = new SapVirtualInstanceData(new AzureLocation("eastus2")) + { + Properties = new SapVirtualInstanceProperties(SapEnvironmentType.NonProd, SapProductType.S4HANA, new DeploymentWithOSConfiguration + { + AppLocation = "eastus", + InfrastructureConfiguration = new SingleServerConfiguration("test-rg", "/subscriptions/8e17e36c-42e9-4cd5-a078-7b44883414e0/resourceGroups/test-rg/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/testsubnet", new VirtualMachineConfiguration("Standard_E32ds_v4", new ImageReference + { + Publisher = "SUSE", + Offer = "SLES-SAP", + Sku = "12-sp4-gen2", + Version = "2022.02.01", + }, new OSProfile + { + AdminUsername = "azureappadmin", + OSConfiguration = new LinuxConfiguration + { + DisablePasswordAuthentication = true, + SshKeyPair = new SshKeyPair + { + PublicKey = "{{sshkey}}", + PrivateKey = "{{privateKey}}", + }, + }, + })), + SoftwareConfiguration = new SapInstallWithoutOSConfigSoftwareConfiguration("https://teststorageaccount.blob.core.windows.net/sapbits/sapfiles/boms/S41909SPS03_v0011ms/S41909SPS03_v0011ms.yaml", "/subscriptions/8e17e36c-42e9-4cd5-a078-7b44883414e0/resourceGroups/test-rg/providers/Microsoft.Storage/storageAccounts/teststorageaccount", "SAP S/4HANA 1909 SPS 03"), + OSSapConfiguration = new OSSapConfiguration + { + SapFqdn = "sap.bpaas.com", + }, + }), + Tags = { }, + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, sapVirtualInstanceName, data); + SapVirtualInstanceResource 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 + SapVirtualInstanceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task CreateOrUpdate_RegisterExistingSAPSystemAsVirtualInstanceForSAPSolutions() + { + // Generated from example definition: 2024-09-01/SapVirtualInstances_CreateRegisterSapSolutions.json + // this example is just showing the usage of "SAPVirtualInstance_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 = "8e17e36c-42e9-4cd5-a078-7b44883414e0"; + string resourceGroupName = "test-rg"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this SapVirtualInstanceResource + SapVirtualInstanceCollection collection = resourceGroupResource.GetSapVirtualInstances(); + + // invoke the operation + string sapVirtualInstanceName = "X00"; + SapVirtualInstanceData data = new SapVirtualInstanceData(new AzureLocation("northeurope")) + { + Properties = new SapVirtualInstanceProperties(SapEnvironmentType.NonProd, SapProductType.S4HANA, new DiscoveryConfiguration + { + CentralServerVmId = "/subscriptions/8e17e36c-42e9-4cd5-a078-7b44883414e0/resourceGroups/test-rg/providers/Microsoft.Compute/virtualMachines/sapq20scsvm0", + }), + Tags = +{ +["createdby"] = "abc@microsoft.com", +["test"] = "abc" +}, + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, sapVirtualInstanceName, data); + SapVirtualInstanceResource 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 + SapVirtualInstanceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task CreateOrUpdate_RegisterExistingSAPSystemAsVirtualInstanceForSAPSolutionsWithOptionalCustomizations() + { + // Generated from example definition: 2024-09-01/SapVirtualInstances_CreateRegisterSapSolutionsCustom.json + // this example is just showing the usage of "SAPVirtualInstance_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 = "8e17e36c-42e9-4cd5-a078-7b44883414e0"; + string resourceGroupName = "test-rg"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this SapVirtualInstanceResource + SapVirtualInstanceCollection collection = resourceGroupResource.GetSapVirtualInstances(); + + // invoke the operation + string sapVirtualInstanceName = "X00"; + SapVirtualInstanceData data = new SapVirtualInstanceData(new AzureLocation("northeurope")) + { + Properties = new SapVirtualInstanceProperties(SapEnvironmentType.NonProd, SapProductType.S4HANA, new DiscoveryConfiguration + { + CentralServerVmId = "/subscriptions/8e17e36c-42e9-4cd5-a078-7b44883414e0/resourceGroups/test-rg/providers/Microsoft.Compute/virtualMachines/sapq20scsvm0", + ManagedRgStorageAccountName = "q20saacssgrs", + }), + Tags = +{ +["createdby"] = "abc@microsoft.com", +["test"] = "abc" +}, + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, sapVirtualInstanceName, data); + SapVirtualInstanceResource 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 + SapVirtualInstanceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task CreateOrUpdate_RegisterWithTrustedAccessEnabled() + { + // Generated from example definition: 2024-09-01/SapVirtualInstances_CreateRegisterWithTrustedAccess.json + // this example is just showing the usage of "SAPVirtualInstance_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 = "8e17e36c-42e9-4cd5-a078-7b44883414e0"; + string resourceGroupName = "test-rg"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this SapVirtualInstanceResource + SapVirtualInstanceCollection collection = resourceGroupResource.GetSapVirtualInstances(); + + // invoke the operation + string sapVirtualInstanceName = "X00"; + SapVirtualInstanceData data = new SapVirtualInstanceData(new AzureLocation("northeurope")) + { + Properties = new SapVirtualInstanceProperties(SapEnvironmentType.NonProd, SapProductType.S4HANA, new DiscoveryConfiguration + { + CentralServerVmId = "/subscriptions/8e17e36c-42e9-4cd5-a078-7b44883414e0/resourceGroups/test-rg/providers/Microsoft.Compute/virtualMachines/sapq20scsvm0", + }) + { + ManagedResourcesNetworkAccessType = ManagedResourcesNetworkAccessType.Private, + }, + Tags = +{ +["createdby"] = "abc@microsoft.com", +["test"] = "abc" +}, + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, sapVirtualInstanceName, data); + SapVirtualInstanceResource 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 + SapVirtualInstanceData 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_SAPVirtualInstancesGet() + { + // Generated from example definition: 2024-09-01/SapVirtualInstances_Get.json + // this example is just showing the usage of "SAPVirtualInstance_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 = "8e17e36c-42e9-4cd5-a078-7b44883414e0"; + string resourceGroupName = "test-rg"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this SapVirtualInstanceResource + SapVirtualInstanceCollection collection = resourceGroupResource.GetSapVirtualInstances(); + + // invoke the operation + string sapVirtualInstanceName = "X00"; + SapVirtualInstanceResource result = await collection.GetAsync(sapVirtualInstanceName); + + // 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 + SapVirtualInstanceData 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_SAPVirtualInstancesGetWithACSSInstallationBlocked() + { + // Generated from example definition: 2024-09-01/SapVirtualInstances_GetAcssInstallationBlocked.json + // this example is just showing the usage of "SAPVirtualInstance_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 = "8e17e36c-42e9-4cd5-a078-7b44883414e0"; + string resourceGroupName = "test-rg"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this SapVirtualInstanceResource + SapVirtualInstanceCollection collection = resourceGroupResource.GetSapVirtualInstances(); + + // invoke the operation + string sapVirtualInstanceName = "X00"; + SapVirtualInstanceResource result = await collection.GetAsync(sapVirtualInstanceName); + + // 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 + SapVirtualInstanceData 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_SAPVirtualInstancesListByResourceGroup() + { + // Generated from example definition: 2024-09-01/SapVirtualInstances_ListByResourceGroup.json + // this example is just showing the usage of "SAPVirtualInstance_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 = "6d875e77-e412-4d7d-9af4-8895278b4443"; + string resourceGroupName = "test-rg"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this SapVirtualInstanceResource + SapVirtualInstanceCollection collection = resourceGroupResource.GetSapVirtualInstances(); + + // invoke the operation and iterate over the result + await foreach (SapVirtualInstanceResource 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 + SapVirtualInstanceData 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_SAPVirtualInstancesGet() + { + // Generated from example definition: 2024-09-01/SapVirtualInstances_Get.json + // this example is just showing the usage of "SAPVirtualInstance_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 = "8e17e36c-42e9-4cd5-a078-7b44883414e0"; + string resourceGroupName = "test-rg"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this SapVirtualInstanceResource + SapVirtualInstanceCollection collection = resourceGroupResource.GetSapVirtualInstances(); + + // invoke the operation + string sapVirtualInstanceName = "X00"; + bool result = await collection.ExistsAsync(sapVirtualInstanceName); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Exists_SAPVirtualInstancesGetWithACSSInstallationBlocked() + { + // Generated from example definition: 2024-09-01/SapVirtualInstances_GetAcssInstallationBlocked.json + // this example is just showing the usage of "SAPVirtualInstance_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 = "8e17e36c-42e9-4cd5-a078-7b44883414e0"; + string resourceGroupName = "test-rg"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this SapVirtualInstanceResource + SapVirtualInstanceCollection collection = resourceGroupResource.GetSapVirtualInstances(); + + // invoke the operation + string sapVirtualInstanceName = "X00"; + bool result = await collection.ExistsAsync(sapVirtualInstanceName); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetIfExists_SAPVirtualInstancesGet() + { + // Generated from example definition: 2024-09-01/SapVirtualInstances_Get.json + // this example is just showing the usage of "SAPVirtualInstance_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 = "8e17e36c-42e9-4cd5-a078-7b44883414e0"; + string resourceGroupName = "test-rg"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this SapVirtualInstanceResource + SapVirtualInstanceCollection collection = resourceGroupResource.GetSapVirtualInstances(); + + // invoke the operation + string sapVirtualInstanceName = "X00"; + NullableResponse response = await collection.GetIfExistsAsync(sapVirtualInstanceName); + SapVirtualInstanceResource 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 + SapVirtualInstanceData 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 GetIfExists_SAPVirtualInstancesGetWithACSSInstallationBlocked() + { + // Generated from example definition: 2024-09-01/SapVirtualInstances_GetAcssInstallationBlocked.json + // this example is just showing the usage of "SAPVirtualInstance_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 = "8e17e36c-42e9-4cd5-a078-7b44883414e0"; + string resourceGroupName = "test-rg"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this SapVirtualInstanceResource + SapVirtualInstanceCollection collection = resourceGroupResource.GetSapVirtualInstances(); + + // invoke the operation + string sapVirtualInstanceName = "X00"; + NullableResponse response = await collection.GetIfExistsAsync(sapVirtualInstanceName); + SapVirtualInstanceResource 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 + SapVirtualInstanceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/samples/Generated/Samples/Sample_SapVirtualInstanceResource.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/samples/Generated/Samples/Sample_SapVirtualInstanceResource.cs new file mode 100644 index 000000000000..e9b0f6980c31 --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/samples/Generated/Samples/Sample_SapVirtualInstanceResource.cs @@ -0,0 +1,372 @@ +// 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.SapVirtualInstances.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.SapVirtualInstances.Samples +{ + public partial class Sample_SapVirtualInstanceResource + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_SAPVirtualInstancesGet() + { + // Generated from example definition: 2024-09-01/SapVirtualInstances_Get.json + // this example is just showing the usage of "SAPVirtualInstance_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 SapVirtualInstanceResource created on azure + // for more information of creating SapVirtualInstanceResource, please refer to the document of SapVirtualInstanceResource + string subscriptionId = "8e17e36c-42e9-4cd5-a078-7b44883414e0"; + string resourceGroupName = "test-rg"; + string sapVirtualInstanceName = "X00"; + ResourceIdentifier sapVirtualInstanceResourceId = SapVirtualInstanceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, sapVirtualInstanceName); + SapVirtualInstanceResource sapVirtualInstance = client.GetSapVirtualInstanceResource(sapVirtualInstanceResourceId); + + // invoke the operation + SapVirtualInstanceResource result = await sapVirtualInstance.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 + SapVirtualInstanceData 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_SAPVirtualInstancesGetWithACSSInstallationBlocked() + { + // Generated from example definition: 2024-09-01/SapVirtualInstances_GetAcssInstallationBlocked.json + // this example is just showing the usage of "SAPVirtualInstance_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 SapVirtualInstanceResource created on azure + // for more information of creating SapVirtualInstanceResource, please refer to the document of SapVirtualInstanceResource + string subscriptionId = "8e17e36c-42e9-4cd5-a078-7b44883414e0"; + string resourceGroupName = "test-rg"; + string sapVirtualInstanceName = "X00"; + ResourceIdentifier sapVirtualInstanceResourceId = SapVirtualInstanceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, sapVirtualInstanceName); + SapVirtualInstanceResource sapVirtualInstance = client.GetSapVirtualInstanceResource(sapVirtualInstanceResourceId); + + // invoke the operation + SapVirtualInstanceResource result = await sapVirtualInstance.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 + SapVirtualInstanceData 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_SAPVirtualInstancesDelete() + { + // Generated from example definition: 2024-09-01/SapVirtualInstances_Delete.json + // this example is just showing the usage of "SAPVirtualInstance_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 SapVirtualInstanceResource created on azure + // for more information of creating SapVirtualInstanceResource, please refer to the document of SapVirtualInstanceResource + string subscriptionId = "6d875e77-e412-4d7d-9af4-8895278b4443"; + string resourceGroupName = "test-rg"; + string sapVirtualInstanceName = "X00"; + ResourceIdentifier sapVirtualInstanceResourceId = SapVirtualInstanceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, sapVirtualInstanceName); + SapVirtualInstanceResource sapVirtualInstance = client.GetSapVirtualInstanceResource(sapVirtualInstanceResourceId); + + // invoke the operation + await sapVirtualInstance.DeleteAsync(WaitUntil.Completed); + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Update_SAPVirtualInstancesUpdate() + { + // Generated from example definition: 2024-09-01/SapVirtualInstances_Update.json + // this example is just showing the usage of "SAPVirtualInstance_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 SapVirtualInstanceResource created on azure + // for more information of creating SapVirtualInstanceResource, please refer to the document of SapVirtualInstanceResource + string subscriptionId = "8e17e36c-42e9-4cd5-a078-7b44883414e0"; + string resourceGroupName = "test-rg"; + string sapVirtualInstanceName = "X00"; + ResourceIdentifier sapVirtualInstanceResourceId = SapVirtualInstanceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, sapVirtualInstanceName); + SapVirtualInstanceResource sapVirtualInstance = client.GetSapVirtualInstanceResource(sapVirtualInstanceResourceId); + + // invoke the operation + SapVirtualInstancePatch patch = new SapVirtualInstancePatch + { + Tags = +{ +["key1"] = "svi1" +}, + Identity = new SAPVirtualInstanceIdentity(SAPVirtualInstanceIdentityType.None), + }; + ArmOperation lro = await sapVirtualInstance.UpdateAsync(WaitUntil.Completed, patch); + SapVirtualInstanceResource 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 + SapVirtualInstanceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Update_SAPVirtualInstancesTrustedAccessEnableUpdate() + { + // Generated from example definition: 2024-09-01/SapVirtualInstances_UpdateTrustedAccess.json + // this example is just showing the usage of "SAPVirtualInstance_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 SapVirtualInstanceResource created on azure + // for more information of creating SapVirtualInstanceResource, please refer to the document of SapVirtualInstanceResource + string subscriptionId = "8e17e36c-42e9-4cd5-a078-7b44883414e0"; + string resourceGroupName = "test-rg"; + string sapVirtualInstanceName = "X00"; + ResourceIdentifier sapVirtualInstanceResourceId = SapVirtualInstanceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, sapVirtualInstanceName); + SapVirtualInstanceResource sapVirtualInstance = client.GetSapVirtualInstanceResource(sapVirtualInstanceResourceId); + + // invoke the operation + SapVirtualInstancePatch patch = new SapVirtualInstancePatch + { + Tags = +{ +["key1"] = "svi1" +}, + Identity = new SAPVirtualInstanceIdentity(SAPVirtualInstanceIdentityType.None), + UpdateSapVirtualInstanceManagedResourcesNetworkAccessType = ManagedResourcesNetworkAccessType.Private, + }; + ArmOperation lro = await sapVirtualInstance.UpdateAsync(WaitUntil.Completed, patch); + SapVirtualInstanceResource 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 + SapVirtualInstanceData 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 Start_SAPVirtualInstancesStart() + { + // Generated from example definition: 2024-09-01/SapVirtualInstances_Start.json + // this example is just showing the usage of "SAPVirtualInstances_Start" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details 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 SapVirtualInstanceResource created on azure + // for more information of creating SapVirtualInstanceResource, please refer to the document of SapVirtualInstanceResource + string subscriptionId = "8e17e36c-42e9-4cd5-a078-7b44883414e0"; + string resourceGroupName = "test-rg"; + string sapVirtualInstanceName = "X00"; + ResourceIdentifier sapVirtualInstanceResourceId = SapVirtualInstanceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, sapVirtualInstanceName); + SapVirtualInstanceResource sapVirtualInstance = client.GetSapVirtualInstanceResource(sapVirtualInstanceResourceId); + + // invoke the operation + StartContent content = new StartContent + { + StartVm = true, + }; + ArmOperation lro = await sapVirtualInstance.StartAsync(WaitUntil.Completed, content: content); + OperationStatusResult result = lro.Value; + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Start_SAPVirtualInstancesStartWithInfraOperations() + { + // Generated from example definition: 2024-09-01/SapVirtualInstances_StartWithInfraOperations.json + // this example is just showing the usage of "SAPVirtualInstances_Start" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details 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 SapVirtualInstanceResource created on azure + // for more information of creating SapVirtualInstanceResource, please refer to the document of SapVirtualInstanceResource + string subscriptionId = "8e17e36c-42e9-4cd5-a078-7b44883414e0"; + string resourceGroupName = "test-rg"; + string sapVirtualInstanceName = "X00"; + ResourceIdentifier sapVirtualInstanceResourceId = SapVirtualInstanceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, sapVirtualInstanceName); + SapVirtualInstanceResource sapVirtualInstance = client.GetSapVirtualInstanceResource(sapVirtualInstanceResourceId); + + // invoke the operation + StartContent content = new StartContent + { + StartVm = true, + }; + ArmOperation lro = await sapVirtualInstance.StartAsync(WaitUntil.Completed, content: content); + OperationStatusResult result = lro.Value; + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Stop_SoftStopOfSapVirtualInstancesStop() + { + // Generated from example definition: 2024-09-01/SapVirtualInstances_SoftStop.json + // this example is just showing the usage of "SAPVirtualInstances_Stop" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details 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 SapVirtualInstanceResource created on azure + // for more information of creating SapVirtualInstanceResource, please refer to the document of SapVirtualInstanceResource + string subscriptionId = "8e17e36c-42e9-4cd5-a078-7b44883414e0"; + string resourceGroupName = "test-rg"; + string sapVirtualInstanceName = "X00"; + ResourceIdentifier sapVirtualInstanceResourceId = SapVirtualInstanceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, sapVirtualInstanceName); + SapVirtualInstanceResource sapVirtualInstance = client.GetSapVirtualInstanceResource(sapVirtualInstanceResourceId); + + // invoke the operation + StopContent content = new StopContent + { + SoftStopTimeoutSeconds = 300L, + }; + ArmOperation lro = await sapVirtualInstance.StopAsync(WaitUntil.Completed, content: content); + OperationStatusResult result = lro.Value; + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Stop_SoftStopTheVirtualMachineSAndTheSAPSystemOnIt() + { + // Generated from example definition: 2024-09-01/SapVirtualInstances_SoftStopVMAndSystem.json + // this example is just showing the usage of "SAPVirtualInstances_Stop" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details 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 SapVirtualInstanceResource created on azure + // for more information of creating SapVirtualInstanceResource, please refer to the document of SapVirtualInstanceResource + string subscriptionId = "8e17e36c-42e9-4cd5-a078-7b44883414e0"; + string resourceGroupName = "test-rg"; + string sapVirtualInstanceName = "X00"; + ResourceIdentifier sapVirtualInstanceResourceId = SapVirtualInstanceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, sapVirtualInstanceName); + SapVirtualInstanceResource sapVirtualInstance = client.GetSapVirtualInstanceResource(sapVirtualInstanceResourceId); + + // invoke the operation + StopContent content = new StopContent + { + SoftStopTimeoutSeconds = 300L, + DeallocateVm = true, + }; + ArmOperation lro = await sapVirtualInstance.StopAsync(WaitUntil.Completed, content: content); + OperationStatusResult result = lro.Value; + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Stop_SAPVirtualInstancesStop() + { + // Generated from example definition: 2024-09-01/SapVirtualInstances_Stop.json + // this example is just showing the usage of "SAPVirtualInstances_Stop" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details 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 SapVirtualInstanceResource created on azure + // for more information of creating SapVirtualInstanceResource, please refer to the document of SapVirtualInstanceResource + string subscriptionId = "8e17e36c-42e9-4cd5-a078-7b44883414e0"; + string resourceGroupName = "test-rg"; + string sapVirtualInstanceName = "X00"; + ResourceIdentifier sapVirtualInstanceResourceId = SapVirtualInstanceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, sapVirtualInstanceName); + SapVirtualInstanceResource sapVirtualInstance = client.GetSapVirtualInstanceResource(sapVirtualInstanceResourceId); + + // invoke the operation + StopContent content = new StopContent + { + SoftStopTimeoutSeconds = 0L, + }; + ArmOperation lro = await sapVirtualInstance.StopAsync(WaitUntil.Completed, content: content); + OperationStatusResult result = lro.Value; + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Stop_StopTheVirtualMachineSAndTheSAPSystemOnIt() + { + // Generated from example definition: 2024-09-01/SapVirtualInstances_StopVMAndSystem.json + // this example is just showing the usage of "SAPVirtualInstances_Stop" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details 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 SapVirtualInstanceResource created on azure + // for more information of creating SapVirtualInstanceResource, please refer to the document of SapVirtualInstanceResource + string subscriptionId = "8e17e36c-42e9-4cd5-a078-7b44883414e0"; + string resourceGroupName = "test-rg"; + string sapVirtualInstanceName = "X00"; + ResourceIdentifier sapVirtualInstanceResourceId = SapVirtualInstanceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, sapVirtualInstanceName); + SapVirtualInstanceResource sapVirtualInstance = client.GetSapVirtualInstanceResource(sapVirtualInstanceResourceId); + + // invoke the operation + StopContent content = new StopContent + { + SoftStopTimeoutSeconds = 0L, + DeallocateVm = true, + }; + ArmOperation lro = await sapVirtualInstance.StopAsync(WaitUntil.Completed, content: content); + OperationStatusResult result = lro.Value; + + Console.WriteLine($"Succeeded: {result}"); + } + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/samples/Generated/Samples/Sample_SubscriptionResourceExtensions.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/samples/Generated/Samples/Sample_SubscriptionResourceExtensions.cs new file mode 100644 index 000000000000..69c4c67630cd --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/samples/Generated/Samples/Sample_SubscriptionResourceExtensions.cs @@ -0,0 +1,423 @@ +// 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 Azure.ResourceManager.SapVirtualInstances.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.SapVirtualInstances.Samples +{ + public partial class Sample_SubscriptionResourceExtensions + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetSapVirtualInstances_SAPVirtualInstancesListBySubscription() + { + // Generated from example definition: 2024-09-01/SapVirtualInstances_ListBySubscription.json + // this example is just showing the usage of "SAPVirtualInstance_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 = "6d875e77-e412-4d7d-9af4-8895278b4443"; + ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(subscriptionId); + SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId); + + // invoke the operation and iterate over the result + await foreach (SapVirtualInstanceResource item in subscriptionResource.GetSapVirtualInstancesAsync()) + { + // 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 + SapVirtualInstanceData 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 GetSizingRecommendationsSapVirtualInstance_SAPSizingRecommendationsForNonHADistributedSystem() + { + // Generated from example definition: 2024-09-01/SapVirtualInstances_InvokeSizingRecommendations_S4HANA_Distributed.json + // this example is just showing the usage of "SAPVirtualInstances_GetSizingRecommendations" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details 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 = "8e17e36c-42e9-4cd5-a078-7b44883414e0"; + ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(subscriptionId); + SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId); + + // invoke the operation + AzureLocation location = new AzureLocation("centralus"); + SapSizingRecommendationContent content = new SapSizingRecommendationContent( + "eastus", + SapEnvironmentType.Prod, + SapProductType.S4HANA, + SapDeploymentType.ThreeTier, + 20000L, + 1024L, + SapDatabaseType.HANA) + { + DbScaleMethod = SapDatabaseScaleMethod.ScaleUp, + }; + SapSizingRecommendationResult result = await subscriptionResource.GetSizingRecommendationsSapVirtualInstanceAsync(location, content); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetSizingRecommendationsSapVirtualInstance_SAPSizingRecommendationsForHAWithAvailabilitySet() + { + // Generated from example definition: 2024-09-01/SapVirtualInstances_InvokeSizingRecommendations_S4HANA_HA_AvSet.json + // this example is just showing the usage of "SAPVirtualInstances_GetSizingRecommendations" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details 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 = "8e17e36c-42e9-4cd5-a078-7b44883414e0"; + ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(subscriptionId); + SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId); + + // invoke the operation + AzureLocation location = new AzureLocation("centralus"); + SapSizingRecommendationContent content = new SapSizingRecommendationContent( + "eastus", + SapEnvironmentType.Prod, + SapProductType.S4HANA, + SapDeploymentType.ThreeTier, + 75000L, + 1024L, + SapDatabaseType.HANA) + { + DbScaleMethod = SapDatabaseScaleMethod.ScaleUp, + HighAvailabilityType = SapHighAvailabilityType.AvailabilitySet, + }; + SapSizingRecommendationResult result = await subscriptionResource.GetSizingRecommendationsSapVirtualInstanceAsync(location, content); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetSizingRecommendationsSapVirtualInstance_SAPSizingRecommendationsForHAWithAvailabilityZone() + { + // Generated from example definition: 2024-09-01/SapVirtualInstances_InvokeSizingRecommendations_S4HANA_HA_AvZone.json + // this example is just showing the usage of "SAPVirtualInstances_GetSizingRecommendations" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details 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 = "8e17e36c-42e9-4cd5-a078-7b44883414e0"; + ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(subscriptionId); + SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId); + + // invoke the operation + AzureLocation location = new AzureLocation("centralus"); + SapSizingRecommendationContent content = new SapSizingRecommendationContent( + "eastus", + SapEnvironmentType.Prod, + SapProductType.S4HANA, + SapDeploymentType.ThreeTier, + 75000L, + 1024L, + SapDatabaseType.HANA) + { + DbScaleMethod = SapDatabaseScaleMethod.ScaleUp, + HighAvailabilityType = SapHighAvailabilityType.AvailabilityZone, + }; + SapSizingRecommendationResult result = await subscriptionResource.GetSizingRecommendationsSapVirtualInstanceAsync(location, content); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetSizingRecommendationsSapVirtualInstance_SAPSizingRecommendationsForSingleServer() + { + // Generated from example definition: 2024-09-01/SapVirtualInstances_InvokeSizingRecommendations_S4HANA_SingleServer.json + // this example is just showing the usage of "SAPVirtualInstances_GetSizingRecommendations" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details 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 = "8e17e36c-42e9-4cd5-a078-7b44883414e0"; + ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(subscriptionId); + SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId); + + // invoke the operation + AzureLocation location = new AzureLocation("centralus"); + SapSizingRecommendationContent content = new SapSizingRecommendationContent( + "eastus", + SapEnvironmentType.NonProd, + SapProductType.S4HANA, + SapDeploymentType.SingleServer, + 60000L, + 2000L, + SapDatabaseType.HANA) + { + DbScaleMethod = SapDatabaseScaleMethod.ScaleUp, + }; + SapSizingRecommendationResult result = await subscriptionResource.GetSizingRecommendationsSapVirtualInstanceAsync(location, content); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetSapSupportedSkuSapVirtualInstance_SAPSupportedSKUsForDistributedNonHAEnvironment() + { + // Generated from example definition: 2024-09-01/SapVirtualInstances_InvokeSapSupportedSku_Distributed.json + // this example is just showing the usage of "SAPVirtualInstances_GetSapSupportedSku" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details 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 = "8e17e36c-42e9-4cd5-a078-7b44883414e0"; + ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(subscriptionId); + SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId); + + // invoke the operation + AzureLocation location = new AzureLocation("centralus"); + SapSupportedSkusContent content = new SapSupportedSkusContent("eastus", SapEnvironmentType.Prod, SapProductType.S4HANA, SapDeploymentType.ThreeTier, SapDatabaseType.HANA); + SapSupportedResourceSkusResult result = await subscriptionResource.GetSapSupportedSkuSapVirtualInstanceAsync(location, content); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetSapSupportedSkuSapVirtualInstance_SAPSupportedSKUsForDistributedHAEnvironmentWithAvailabilitySet() + { + // Generated from example definition: 2024-09-01/SapVirtualInstances_InvokeSapSupportedSku_DistributedHA_AvSet.json + // this example is just showing the usage of "SAPVirtualInstances_GetSapSupportedSku" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details 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 = "8e17e36c-42e9-4cd5-a078-7b44883414e0"; + ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(subscriptionId); + SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId); + + // invoke the operation + AzureLocation location = new AzureLocation("centralus"); + SapSupportedSkusContent content = new SapSupportedSkusContent("eastus", SapEnvironmentType.Prod, SapProductType.S4HANA, SapDeploymentType.ThreeTier, SapDatabaseType.HANA) + { + HighAvailabilityType = SapHighAvailabilityType.AvailabilitySet, + }; + SapSupportedResourceSkusResult result = await subscriptionResource.GetSapSupportedSkuSapVirtualInstanceAsync(location, content); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetSapSupportedSkuSapVirtualInstance_SAPSupportedSkusForHAWithAvailabilityZone() + { + // Generated from example definition: 2024-09-01/SapVirtualInstances_InvokeSapSupportedSku_DistributedHA_AvZone.json + // this example is just showing the usage of "SAPVirtualInstances_GetSapSupportedSku" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details 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 = "8e17e36c-42e9-4cd5-a078-7b44883414e0"; + ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(subscriptionId); + SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId); + + // invoke the operation + AzureLocation location = new AzureLocation("centralus"); + SapSupportedSkusContent content = new SapSupportedSkusContent("eastus", SapEnvironmentType.Prod, SapProductType.S4HANA, SapDeploymentType.ThreeTier, SapDatabaseType.HANA) + { + HighAvailabilityType = SapHighAvailabilityType.AvailabilityZone, + }; + SapSupportedResourceSkusResult result = await subscriptionResource.GetSapSupportedSkuSapVirtualInstanceAsync(location, content); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetSapSupportedSkuSapVirtualInstance_SAPSupportedSKUsForSingleServer() + { + // Generated from example definition: 2024-09-01/SapVirtualInstances_InvokeSapSupportedSku_SingleServer.json + // this example is just showing the usage of "SAPVirtualInstances_GetSapSupportedSku" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details 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 = "8e17e36c-42e9-4cd5-a078-7b44883414e0"; + ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(subscriptionId); + SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId); + + // invoke the operation + AzureLocation location = new AzureLocation("centralus"); + SapSupportedSkusContent content = new SapSupportedSkusContent("eastus", SapEnvironmentType.NonProd, SapProductType.S4HANA, SapDeploymentType.SingleServer, SapDatabaseType.HANA); + SapSupportedResourceSkusResult result = await subscriptionResource.GetSapSupportedSkuSapVirtualInstanceAsync(location, content); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetDiskConfigurationsSapVirtualInstance_SAPDiskConfigurationsForInputEnvironmentNonProd() + { + // Generated from example definition: 2024-09-01/SapVirtualInstances_InvokeDiskConfigurations_NonProd.json + // this example is just showing the usage of "SAPVirtualInstances_GetDiskConfigurations" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details 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 = "8e17e36c-42e9-4cd5-a078-7b44883414e0"; + ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(subscriptionId); + SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId); + + // invoke the operation + AzureLocation location = new AzureLocation("centralus"); + SapDiskConfigurationsContent content = new SapDiskConfigurationsContent( + "eastus", + SapEnvironmentType.NonProd, + SapProductType.S4HANA, + SapDatabaseType.HANA, + SapDeploymentType.ThreeTier, + "Standard_M32ts"); + SapDiskConfigurationsResult result = await subscriptionResource.GetDiskConfigurationsSapVirtualInstanceAsync(location, content); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetDiskConfigurationsSapVirtualInstance_SAPDiskConfigurationsForInputEnvironmentProd() + { + // Generated from example definition: 2024-09-01/SapVirtualInstances_InvokeDiskConfigurations_Prod.json + // this example is just showing the usage of "SAPVirtualInstances_GetDiskConfigurations" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details 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 = "8e17e36c-42e9-4cd5-a078-7b44883414e0"; + ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(subscriptionId); + SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId); + + // invoke the operation + AzureLocation location = new AzureLocation("centralus"); + SapDiskConfigurationsContent content = new SapDiskConfigurationsContent( + "eastus", + SapEnvironmentType.Prod, + SapProductType.S4HANA, + SapDatabaseType.HANA, + SapDeploymentType.ThreeTier, + "Standard_M32ts"); + SapDiskConfigurationsResult result = await subscriptionResource.GetDiskConfigurationsSapVirtualInstanceAsync(location, content); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetAvailabilityZoneDetailsSapVirtualInstance_SAPAvailabilityZoneDetailsInEastUs() + { + // Generated from example definition: 2024-09-01/SapVirtualInstances_InvokeAvailabilityZoneDetails_eastus.json + // this example is just showing the usage of "SAPVirtualInstances_GetAvailabilityZoneDetails" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details 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 = "8e17e36c-42e9-4cd5-a078-7b44883414e0"; + ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(subscriptionId); + SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId); + + // invoke the operation + AzureLocation location = new AzureLocation("eastus"); + SapAvailabilityZoneDetailsContent content = new SapAvailabilityZoneDetailsContent("eastus", SapProductType.S4HANA, SapDatabaseType.HANA); + SapAvailabilityZoneDetailsResult result = await subscriptionResource.GetAvailabilityZoneDetailsSapVirtualInstanceAsync(location, content); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetAvailabilityZoneDetailsSapVirtualInstance_SAPAvailabilityZoneDetailsInNorthEurope() + { + // Generated from example definition: 2024-09-01/SapVirtualInstances_InvokeAvailabilityZoneDetails_northeurope.json + // this example is just showing the usage of "SAPVirtualInstances_GetAvailabilityZoneDetails" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details 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 = "8e17e36c-42e9-4cd5-a078-7b44883414e0"; + ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(subscriptionId); + SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId); + + // invoke the operation + AzureLocation location = new AzureLocation("northeurope"); + SapAvailabilityZoneDetailsContent content = new SapAvailabilityZoneDetailsContent("northeurope", SapProductType.S4HANA, SapDatabaseType.HANA); + SapAvailabilityZoneDetailsResult result = await subscriptionResource.GetAvailabilityZoneDetailsSapVirtualInstanceAsync(location, content); + + Console.WriteLine($"Succeeded: {result}"); + } + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Azure.ResourceManager.SapVirtualInstances.csproj b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Azure.ResourceManager.SapVirtualInstances.csproj new file mode 100644 index 000000000000..03db45f9d8cf --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Azure.ResourceManager.SapVirtualInstances.csproj @@ -0,0 +1,8 @@ + + + Azure Resource Manager client SDK for Azure resource provider SapVirtualInstances. + 1.0.0-beta.1 + azure;management;arm;resource manager;sapvirtualinstances + Azure.ResourceManager.SapVirtualInstances + + diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/ArmSapVirtualInstancesModelFactory.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/ArmSapVirtualInstancesModelFactory.cs new file mode 100644 index 000000000000..17829d826737 --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/ArmSapVirtualInstancesModelFactory.cs @@ -0,0 +1,565 @@ +// 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; +using Azure.ResourceManager.Resources.Models; + +namespace Azure.ResourceManager.SapVirtualInstances.Models +{ + /// Model factory for models. + public static partial class ArmSapVirtualInstancesModelFactory + { + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The tags. + /// The location. + /// The resource-specific properties for this resource. + /// A new instance for mocking. + public static SapApplicationServerInstanceData SapApplicationServerInstanceData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, SapApplicationServerProperties properties = null) + { + tags ??= new Dictionary(); + + return new SapApplicationServerInstanceData( + id, + name, + resourceType, + systemData, + tags, + location, + properties, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Application server Instance Number. + /// Application server Subnet. + /// Application server instance SAP hostname. + /// Application server instance SAP Kernel Version. + /// Application server instance SAP Kernel Patch level. + /// Application server instance SAP IP Address. + /// Application server instance gateway Port. + /// Application server instance ICM HTTP Port. + /// Application server instance ICM HTTPS Port. + /// Application server instance dispatcher status. + /// The Load Balancer details such as LoadBalancer ID attached to Application Server Virtual Machines. + /// The list of virtual machines. + /// Defines the SAP Instance status. + /// Defines the health of SAP Instances. + /// Defines the provisioning states. + /// Defines the Application Instance errors. + /// A new instance for mocking. + public static SapApplicationServerProperties SapApplicationServerProperties(string instanceNo = null, string subnet = null, string hostname = null, string kernelVersion = null, string kernelPatch = null, string ipAddress = null, long? gatewayPort = null, long? icmHttpPort = null, long? icmHttpsPort = null, string dispatcherStatus = null, ResourceIdentifier loadBalancerDetailsId = null, IEnumerable vmDetails = null, SapVirtualInstanceStatus? status = null, SapHealthState? health = null, SapVirtualInstanceProvisioningState? provisioningState = null, ErrorInformation errorsProperties = null) + { + vmDetails ??= new List(); + + return new SapApplicationServerProperties( + instanceNo, + subnet, + hostname, + kernelVersion, + kernelPatch, + ipAddress, + gatewayPort, + icmHttpPort, + icmHttpsPort, + dispatcherStatus, + loadBalancerDetailsId != null ? ResourceManagerModelFactory.SubResource(loadBalancerDetailsId) : null, + vmDetails?.ToList(), + status, + health, + provisioningState, + errorsProperties != null ? new SapVirtualInstanceError(errorsProperties, serializedAdditionalRawData: null) : null, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Defines the type of application server VM. + /// The virtual machine id. + /// Storage details of all the Storage Accounts attached to the App Virtual Machine. For e.g. NFS on AFS Shared Storage. + /// A new instance for mocking. + public static ApplicationServerVmDetails ApplicationServerVmDetails(ApplicationServerVirtualMachineType? type = null, string virtualMachineId = null, IEnumerable storageDetails = null) + { + storageDetails ??= new List(); + + return new ApplicationServerVmDetails(type, virtualMachineId, storageDetails?.ToList(), serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Service specific error code which serves as the substatus for the HTTP error code. + /// Description of the error. + /// Internal error details. + /// A new instance for mocking. + public static ErrorInformation ErrorInformation(string code = null, string message = null, IEnumerable details = null) + { + details ??= new List(); + + return new ErrorInformation(code, message, details?.ToList(), serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Fully qualified ID for the async operation. + /// Name of the async operation. + /// Operation status. + /// Percent of the operation that is complete. + /// The start time of the operation. + /// The end time of the operation. + /// The operations list. + /// If present, details of the operation error. + /// Fully qualified ID of the resource against which the original async operation was started. + /// A new instance for mocking. + public static OperationStatusResult OperationStatusResult(ResourceIdentifier id = null, string name = null, string status = null, double? percentComplete = null, DateTimeOffset? startOn = null, DateTimeOffset? endOn = null, IEnumerable operations = null, ResponseError error = null, string resourceId = null) + { + operations ??= new List(); + + return new OperationStatusResult( + id, + name, + status, + percentComplete, + startOn, + endOn, + operations?.ToList(), + error, + resourceId, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The tags. + /// The location. + /// The resource-specific properties for this resource. + /// A new instance for mocking. + public static SapDatabaseInstanceData SapDatabaseInstanceData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, SapDatabaseProperties properties = null) + { + tags ??= new Dictionary(); + + return new SapDatabaseInstanceData( + id, + name, + resourceType, + systemData, + tags, + location, + properties, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Database subnet. + /// Database SID name. + /// Database type, that is if the DB is HANA, DB2, Oracle, SAP ASE, Max DB or MS SQL Server. + /// Database IP Address. + /// The Load Balancer details such as LoadBalancer ID attached to Database Virtual Machines. + /// The list of virtual machines corresponding to the Database resource. + /// Defines the SAP Instance status. + /// Defines the provisioning states. + /// Defines the errors related to Database resource. + /// A new instance for mocking. + public static SapDatabaseProperties SapDatabaseProperties(string subnet = null, string databaseSid = null, string databaseType = null, string ipAddress = null, ResourceIdentifier loadBalancerDetailsId = null, IEnumerable vmDetails = null, SapVirtualInstanceStatus? status = null, SapVirtualInstanceProvisioningState? provisioningState = null, ErrorInformation errorsProperties = null) + { + vmDetails ??= new List(); + + return new SapDatabaseProperties( + subnet, + databaseSid, + databaseType, + ipAddress, + loadBalancerDetailsId != null ? ResourceManagerModelFactory.SubResource(loadBalancerDetailsId) : null, + vmDetails?.ToList(), + status, + provisioningState, + errorsProperties != null ? new SapVirtualInstanceError(errorsProperties, serializedAdditionalRawData: null) : null, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The virtual machine id. + /// Defines the SAP Instance status. + /// Storage details of all the Storage Accounts attached to the Database Virtual Machine. For e.g. NFS on AFS Shared Storage. + /// A new instance for mocking. + public static DatabaseVmDetails DatabaseVmDetails(string virtualMachineId = null, SapVirtualInstanceStatus? status = null, IEnumerable storageDetails = null) + { + storageDetails ??= new List(); + + return new DatabaseVmDetails(virtualMachineId, status, storageDetails?.ToList(), serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The tags. + /// The location. + /// The resource-specific properties for this resource. + /// A new instance for mocking. + public static SapCentralServerInstanceData SapCentralServerInstanceData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, SapCentralServerProperties properties = null) + { + tags ??= new Dictionary(); + + return new SapCentralServerInstanceData( + id, + name, + resourceType, + systemData, + tags, + location, + properties, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The central services instance number. + /// The central services instance subnet. + /// Defines the SAP message server properties. + /// Defines the SAP Enqueue Server properties. + /// Defines the SAP Gateway Server properties. + /// Defines the SAP Enqueue Replication Server (ERS) properties. + /// The central services instance Kernel Version. + /// The central services instance Kernel Patch level. + /// The Load Balancer details such as LoadBalancer ID attached to ASCS Virtual Machines. + /// The list of virtual machines corresponding to the Central Services instance. + /// Defines the SAP Instance status. + /// Defines the health of SAP Instances. + /// Defines the provisioning states. + /// Defines the errors related to SAP Central Services Instance resource. + /// A new instance for mocking. + public static SapCentralServerProperties SapCentralServerProperties(string instanceNo = null, string subnet = null, MessageServerProperties messageServerProperties = null, EnqueueServerProperties enqueueServerProperties = null, GatewayServerProperties gatewayServerProperties = null, EnqueueReplicationServerProperties enqueueReplicationServerProperties = null, string kernelVersion = null, string kernelPatch = null, ResourceIdentifier loadBalancerDetailsId = null, IEnumerable vmDetails = null, SapVirtualInstanceStatus? status = null, SapHealthState? health = null, SapVirtualInstanceProvisioningState? provisioningState = null, ErrorInformation errorsProperties = null) + { + vmDetails ??= new List(); + + return new SapCentralServerProperties( + instanceNo, + subnet, + messageServerProperties, + enqueueServerProperties, + gatewayServerProperties, + enqueueReplicationServerProperties, + kernelVersion, + kernelPatch, + loadBalancerDetailsId != null ? ResourceManagerModelFactory.SubResource(loadBalancerDetailsId) : null, + vmDetails?.ToList(), + status, + health, + provisioningState, + errorsProperties != null ? new SapVirtualInstanceError(errorsProperties, serializedAdditionalRawData: null) : null, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// message server port. + /// message server internal MS port. + /// message server HTTP Port. + /// message server HTTPS Port. + /// message server SAP Hostname. + /// message server IP Address. + /// Defines the health of SAP Instances. + /// A new instance for mocking. + public static MessageServerProperties MessageServerProperties(long? msPort = null, long? internalMsPort = null, long? httpPort = null, long? httpsPort = null, string hostname = null, string ipAddress = null, SapHealthState? health = null) + { + return new MessageServerProperties( + msPort, + internalMsPort, + httpPort, + httpsPort, + hostname, + ipAddress, + health, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Enqueue Server SAP Hostname. + /// Enqueue Server SAP IP Address. + /// Enqueue Server Port. + /// Defines the health of SAP Instances. + /// A new instance for mocking. + public static EnqueueServerProperties EnqueueServerProperties(string hostname = null, string ipAddress = null, long? port = null, SapHealthState? health = null) + { + return new EnqueueServerProperties(hostname, ipAddress, port, health, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Gateway Port. + /// Defines the health of SAP Instances. + /// A new instance for mocking. + public static GatewayServerProperties GatewayServerProperties(long? port = null, SapHealthState? health = null) + { + return new GatewayServerProperties(port, health, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Defines the type of Enqueue Replication Server. + /// ERS Instance Number. + /// ERS SAP Hostname. + /// ERS SAP Kernel Version. + /// ERS SAP Kernel Patch level. + /// ERS SAP IP Address. + /// Defines the health of SAP Instances. + /// A new instance for mocking. + public static EnqueueReplicationServerProperties EnqueueReplicationServerProperties(EnqueueReplicationServerType? ersVersion = null, string instanceNo = null, string hostname = null, string kernelVersion = null, string kernelPatch = null, string ipAddress = null, SapHealthState? health = null) + { + return new EnqueueReplicationServerProperties( + ersVersion, + instanceNo, + hostname, + kernelVersion, + kernelPatch, + ipAddress, + health, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Defines the type of central server VM. + /// The virtual machine id. + /// Storage details of all the Storage Accounts attached to the ASCS Virtual Machine. For e.g. NFS on AFS Shared Storage. + /// A new instance for mocking. + public static CentralServerVmDetails CentralServerVmDetails(CentralServerVirtualMachineType? type = null, string virtualMachineId = null, IEnumerable storageDetails = null) + { + storageDetails ??= new List(); + + return new CentralServerVmDetails(type, virtualMachineId, storageDetails?.ToList(), serializedAdditionalRawData: null); + } + + /// 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 SapVirtualInstanceData SapVirtualInstanceData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, SapVirtualInstanceProperties properties = null, SAPVirtualInstanceIdentity identity = null) + { + tags ??= new Dictionary(); + + return new SapVirtualInstanceData( + id, + name, + resourceType, + systemData, + tags, + location, + properties, + identity, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Defines the environment type - Production/Non Production. + /// Defines the SAP Product type. + /// Specifies the network access configuration for the resources that will be deployed in the Managed Resource Group. The options to choose from are Public and Private. If 'Private' is chosen, the Storage Account service tag should be enabled on the subnets in which the SAP VMs exist. This is required for establishing connectivity between VM extensions and the managed resource group storage account. This setting is currently applicable only to Storage Account. Learn more here https://go.microsoft.com/fwlink/?linkid=2247228. + /// + /// Defines if the SAP system is being created using Azure Center for SAP solutions (ACSS) or if an existing SAP system is being registered with ACSS + /// 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 . + /// + /// Managed resource group configuration. + /// Defines the SAP Instance status. + /// Defines the health of SAP Instances. + /// Defines the Virtual Instance for SAP state. + /// Defines the provisioning states. + /// Indicates any errors on the Virtual Instance for SAP solutions resource. + /// A new instance for mocking. + public static SapVirtualInstanceProperties SapVirtualInstanceProperties(SapEnvironmentType environment = default, SapProductType sapProduct = default, ManagedResourcesNetworkAccessType? managedResourcesNetworkAccessType = null, SapConfiguration configuration = null, string managedResourceGroupName = null, SapVirtualInstanceStatus? status = null, SapHealthState? health = null, SapVirtualInstanceState? state = null, SapVirtualInstanceProvisioningState? provisioningState = null, ErrorInformation errorsProperties = null) + { + return new SapVirtualInstanceProperties( + environment, + sapProduct, + managedResourcesNetworkAccessType, + configuration, + managedResourceGroupName != null ? new ManagedRGConfiguration(managedResourceGroupName, serializedAdditionalRawData: null) : null, + status, + health, + state, + provisioningState, + errorsProperties != null ? new SapVirtualInstanceError(errorsProperties, serializedAdditionalRawData: null) : null, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The virtual machine ID of the Central Server. + /// The custom storage account name for the storage account created by the service in the managed resource group created as part of VIS deployment.<br><br>Refer to the storage account naming rules [here](https://learn.microsoft.com/azure/azure-resource-manager/management/resource-name-rules#microsoftstorage).<br><br>If not provided, the service will create the storage account with a random name. + /// The geo-location where the SAP system exists. + /// A new instance for mocking. + public static DiscoveryConfiguration DiscoveryConfiguration(string centralServerVmId = null, string managedRgStorageAccountName = null, string appLocation = null) + { + return new DiscoveryConfiguration(SapConfigurationType.Discovery, serializedAdditionalRawData: null, centralServerVmId, managedRgStorageAccountName, appLocation); + } + + /// Initializes a new instance of . + /// The geo-location where the resource is to be created. + /// Defines the environment type - Production/Non Production. + /// Defines the SAP Product type. + /// The deployment type. Eg: SingleServer/ThreeTier. + /// The SAP Application Performance Standard measurement. + /// The database memory configuration. + /// The database type. + /// The DB scale method. + /// The high availability type. + /// A new instance for mocking. + public static SapSizingRecommendationContent SapSizingRecommendationContent(string appLocation = null, SapEnvironmentType environment = default, SapProductType sapProduct = default, SapDeploymentType deploymentType = default, long saps = default, long dbMemory = default, SapDatabaseType databaseType = default, SapDatabaseScaleMethod? dbScaleMethod = null, SapHighAvailabilityType? highAvailabilityType = null) + { + return new SapSizingRecommendationContent( + appLocation, + environment, + sapProduct, + deploymentType, + saps, + dbMemory, + databaseType, + dbScaleMethod, + highAvailabilityType, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The recommended VM SKU for single server. + /// A new instance for mocking. + public static SingleServerRecommendationResult SingleServerRecommendationResult(string vmSku = null) + { + return new SingleServerRecommendationResult(SapDeploymentType.SingleServer, serializedAdditionalRawData: null, vmSku); + } + + /// Initializes a new instance of . + /// The database VM SKU. + /// The database server instance count. + /// The central server VM SKU. + /// The central server instance count. + /// The application server VM SKU. + /// The application server instance count. + /// A new instance for mocking. + public static ThreeTierRecommendationResult ThreeTierRecommendationResult(string dbVmSku = null, long? databaseInstanceCount = null, string centralServerVmSku = null, long? centralServerInstanceCount = null, string applicationServerVmSku = null, long? applicationServerInstanceCount = null) + { + return new ThreeTierRecommendationResult( + SapDeploymentType.ThreeTier, + serializedAdditionalRawData: null, + dbVmSku, + databaseInstanceCount, + centralServerVmSku, + centralServerInstanceCount, + applicationServerVmSku, + applicationServerInstanceCount); + } + + /// Initializes a new instance of . + /// The geo-location where the resource is to be created. + /// Defines the environment type - Production/Non Production. + /// Defines the SAP Product type. + /// The deployment type. Eg: SingleServer/ThreeTier. + /// The database type. Eg: HANA, DB2, etc. + /// The high availability type. + /// A new instance for mocking. + public static SapSupportedSkusContent SapSupportedSkusContent(string appLocation = null, SapEnvironmentType environment = default, SapProductType sapProduct = default, SapDeploymentType deploymentType = default, SapDatabaseType databaseType = default, SapHighAvailabilityType? highAvailabilityType = null) + { + return new SapSupportedSkusContent( + appLocation, + environment, + sapProduct, + deploymentType, + databaseType, + highAvailabilityType, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Gets the list of SAP supported SKUs. + /// A new instance for mocking. + public static SapSupportedResourceSkusResult SapSupportedResourceSkusResult(IEnumerable supportedSkus = null) + { + supportedSkus ??= new List(); + + return new SapSupportedResourceSkusResult(supportedSkus?.ToList(), serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The VM Sku. + /// True if the Sku is certified for App server in the SAP system. + /// True if the Sku is certified for Database server in the SAP system. + /// A new instance for mocking. + public static SapSupportedSku SapSupportedSku(string vmSku = null, bool? isAppServerCertified = null, bool? isDatabaseCertified = null) + { + return new SapSupportedSku(vmSku, isAppServerCertified, isDatabaseCertified, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The disk configuration for the db volume. For HANA, Required volumes are: ['hana/data', 'hana/log', hana/shared', 'usr/sap', 'os'], Optional volume : ['backup']. + /// A new instance for mocking. + public static SapDiskConfigurationsResult SapDiskConfigurationsResult(IReadOnlyDictionary volumeConfigurations = null) + { + volumeConfigurations ??= new Dictionary(); + + return new SapDiskConfigurationsResult(volumeConfigurations, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The recommended disk details for a given VM Sku. + /// The list of supported disks for a given VM Sku. + /// A new instance for mocking. + public static SapDiskConfiguration SapDiskConfiguration(DiskVolumeConfiguration recommendedConfiguration = null, IEnumerable supportedConfigurations = null) + { + supportedConfigurations ??= new List(); + + return new SapDiskConfiguration(recommendedConfiguration, supportedConfigurations?.ToList(), serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The type of disk sku. For example, Standard_LRS, Standard_ZRS, Premium_LRS, Premium_ZRS. + /// The disk size in GB. + /// The minimum supported disk count. + /// The maximum supported disk count. + /// The disk Iops. + /// The disk provisioned throughput in MBps. + /// The disk tier, e.g. P10, E10. + /// A new instance for mocking. + public static DiskDetails DiskDetails(DiskSkuName? skuName = null, long? sizeGB = null, long? minimumSupportedDiskCount = null, long? maximumSupportedDiskCount = null, long? iopsReadWrite = null, long? mbpsReadWrite = null, string diskTier = null) + { + return new DiskDetails( + skuName != null ? new DiskSku(skuName, serializedAdditionalRawData: null) : null, + sizeGB, + minimumSupportedDiskCount, + maximumSupportedDiskCount, + iopsReadWrite, + mbpsReadWrite, + diskTier, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Gets the list of availability zone pairs. + /// A new instance for mocking. + public static SapAvailabilityZoneDetailsResult SapAvailabilityZoneDetailsResult(IEnumerable availabilityZonePairs = null) + { + availabilityZonePairs ??= new List(); + + return new SapAvailabilityZoneDetailsResult(availabilityZonePairs?.ToList(), serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The zone A. + /// The zone B. + /// A new instance for mocking. + public static SapAvailabilityZonePair SapAvailabilityZonePair(long? zoneA = null, long? zoneB = null) + { + return new SapAvailabilityZonePair(zoneA, zoneB, serializedAdditionalRawData: null); + } + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Extensions/MockableSapVirtualInstancesArmClient.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Extensions/MockableSapVirtualInstancesArmClient.cs new file mode 100644 index 000000000000..aad5abbcbc9e --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Extensions/MockableSapVirtualInstancesArmClient.cs @@ -0,0 +1,85 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using Azure.Core; + +namespace Azure.ResourceManager.SapVirtualInstances.Mocking +{ + /// A class to add extension methods to ArmClient. + public partial class MockableSapVirtualInstancesArmClient : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected MockableSapVirtualInstancesArmClient() + { + } + + /// 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 MockableSapVirtualInstancesArmClient(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + internal MockableSapVirtualInstancesArmClient(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 SapVirtualInstanceResource GetSapVirtualInstanceResource(ResourceIdentifier id) + { + SapVirtualInstanceResource.ValidateResourceId(id); + return new SapVirtualInstanceResource(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 SapCentralServerInstanceResource GetSapCentralServerInstanceResource(ResourceIdentifier id) + { + SapCentralServerInstanceResource.ValidateResourceId(id); + return new SapCentralServerInstanceResource(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 SapDatabaseInstanceResource GetSapDatabaseInstanceResource(ResourceIdentifier id) + { + SapDatabaseInstanceResource.ValidateResourceId(id); + return new SapDatabaseInstanceResource(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 SapApplicationServerInstanceResource GetSapApplicationServerInstanceResource(ResourceIdentifier id) + { + SapApplicationServerInstanceResource.ValidateResourceId(id); + return new SapApplicationServerInstanceResource(Client, id); + } + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Extensions/MockableSapVirtualInstancesResourceGroupResource.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Extensions/MockableSapVirtualInstancesResourceGroupResource.cs new file mode 100644 index 000000000000..ca026e2cf97d --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Extensions/MockableSapVirtualInstancesResourceGroupResource.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.SapVirtualInstances.Mocking +{ + /// A class to add extension methods to ResourceGroupResource. + public partial class MockableSapVirtualInstancesResourceGroupResource : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected MockableSapVirtualInstancesResourceGroupResource() + { + } + + /// 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 MockableSapVirtualInstancesResourceGroupResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// Gets a collection of SapVirtualInstanceResources in the ResourceGroupResource. + /// An object representing collection of SapVirtualInstanceResources and their operations over a SapVirtualInstanceResource. + public virtual SapVirtualInstanceCollection GetSapVirtualInstances() + { + return GetCachedClient(client => new SapVirtualInstanceCollection(client, Id)); + } + + /// + /// Gets a Virtual Instance for SAP solutions resource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName} + /// + /// + /// Operation Id + /// SAPVirtualInstance_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the Virtual Instances for SAP solutions resource. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetSapVirtualInstanceAsync(string sapVirtualInstanceName, CancellationToken cancellationToken = default) + { + return await GetSapVirtualInstances().GetAsync(sapVirtualInstanceName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets a Virtual Instance for SAP solutions resource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName} + /// + /// + /// Operation Id + /// SAPVirtualInstance_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the Virtual Instances for SAP solutions resource. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetSapVirtualInstance(string sapVirtualInstanceName, CancellationToken cancellationToken = default) + { + return GetSapVirtualInstances().Get(sapVirtualInstanceName, cancellationToken); + } + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Extensions/MockableSapVirtualInstancesSubscriptionResource.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Extensions/MockableSapVirtualInstancesSubscriptionResource.cs new file mode 100644 index 000000000000..e11cf5279920 --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Extensions/MockableSapVirtualInstancesSubscriptionResource.cs @@ -0,0 +1,449 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading; +using System.Threading.Tasks; +using Autorest.CSharp.Core; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.SapVirtualInstances.Models; + +namespace Azure.ResourceManager.SapVirtualInstances.Mocking +{ + /// A class to add extension methods to SubscriptionResource. + public partial class MockableSapVirtualInstancesSubscriptionResource : ArmResource + { + private ClientDiagnostics _sapVirtualInstanceClientDiagnostics; + private SapVirtualInstancesRestOperations _sapVirtualInstanceRestClient; + + /// Initializes a new instance of the class for mocking. + protected MockableSapVirtualInstancesSubscriptionResource() + { + } + + /// 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 MockableSapVirtualInstancesSubscriptionResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + private ClientDiagnostics SapVirtualInstanceClientDiagnostics => _sapVirtualInstanceClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.SapVirtualInstances", SapVirtualInstanceResource.ResourceType.Namespace, Diagnostics); + private SapVirtualInstancesRestOperations SapVirtualInstanceRestClient => _sapVirtualInstanceRestClient ??= new SapVirtualInstancesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, GetApiVersionOrNull(SapVirtualInstanceResource.ResourceType)); + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// + /// Gets all Virtual Instances for SAP solutions resources in a Subscription. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.Workloads/sapVirtualInstances + /// + /// + /// Operation Id + /// SAPVirtualInstance_ListBySubscription + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetSapVirtualInstancesAsync(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => SapVirtualInstanceRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => SapVirtualInstanceRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new SapVirtualInstanceResource(Client, SapVirtualInstanceData.DeserializeSapVirtualInstanceData(e)), SapVirtualInstanceClientDiagnostics, Pipeline, "MockableSapVirtualInstancesSubscriptionResource.GetSapVirtualInstances", "value", "nextLink", cancellationToken); + } + + /// + /// Gets all Virtual Instances for SAP solutions resources in a Subscription. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.Workloads/sapVirtualInstances + /// + /// + /// Operation Id + /// SAPVirtualInstance_ListBySubscription + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetSapVirtualInstances(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => SapVirtualInstanceRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => SapVirtualInstanceRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new SapVirtualInstanceResource(Client, SapVirtualInstanceData.DeserializeSapVirtualInstanceData(e)), SapVirtualInstanceClientDiagnostics, Pipeline, "MockableSapVirtualInstancesSubscriptionResource.GetSapVirtualInstances", "value", "nextLink", cancellationToken); + } + + /// + /// Gets the sizing recommendations. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.Workloads/locations/{location}/sapVirtualInstanceMetadata/default/getSizingRecommendations + /// + /// + /// Operation Id + /// SAPVirtualInstances_GetSizingRecommendations + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the Azure region. + /// The content of the action request. + /// The cancellation token to use. + /// is null. + public virtual async Task> GetSizingRecommendationsSapVirtualInstanceAsync(AzureLocation location, SapSizingRecommendationContent content, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(content, nameof(content)); + + using var scope = SapVirtualInstanceClientDiagnostics.CreateScope("MockableSapVirtualInstancesSubscriptionResource.GetSizingRecommendationsSapVirtualInstance"); + scope.Start(); + try + { + var response = await SapVirtualInstanceRestClient.GetSizingRecommendationsAsync(Id.SubscriptionId, location, content, cancellationToken).ConfigureAwait(false); + return response; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets the sizing recommendations. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.Workloads/locations/{location}/sapVirtualInstanceMetadata/default/getSizingRecommendations + /// + /// + /// Operation Id + /// SAPVirtualInstances_GetSizingRecommendations + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the Azure region. + /// The content of the action request. + /// The cancellation token to use. + /// is null. + public virtual Response GetSizingRecommendationsSapVirtualInstance(AzureLocation location, SapSizingRecommendationContent content, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(content, nameof(content)); + + using var scope = SapVirtualInstanceClientDiagnostics.CreateScope("MockableSapVirtualInstancesSubscriptionResource.GetSizingRecommendationsSapVirtualInstance"); + scope.Start(); + try + { + var response = SapVirtualInstanceRestClient.GetSizingRecommendations(Id.SubscriptionId, location, content, cancellationToken); + return response; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a list of SAP supported SKUs for ASCS, Application and Database tier. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.Workloads/locations/{location}/sapVirtualInstanceMetadata/default/getSapSupportedSku + /// + /// + /// Operation Id + /// SAPVirtualInstances_GetSapSupportedSku + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the Azure region. + /// The content of the action request. + /// The cancellation token to use. + /// is null. + public virtual async Task> GetSapSupportedSkuSapVirtualInstanceAsync(AzureLocation location, SapSupportedSkusContent content, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(content, nameof(content)); + + using var scope = SapVirtualInstanceClientDiagnostics.CreateScope("MockableSapVirtualInstancesSubscriptionResource.GetSapSupportedSkuSapVirtualInstance"); + scope.Start(); + try + { + var response = await SapVirtualInstanceRestClient.GetSapSupportedSkuAsync(Id.SubscriptionId, location, content, cancellationToken).ConfigureAwait(false); + return response; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a list of SAP supported SKUs for ASCS, Application and Database tier. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.Workloads/locations/{location}/sapVirtualInstanceMetadata/default/getSapSupportedSku + /// + /// + /// Operation Id + /// SAPVirtualInstances_GetSapSupportedSku + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the Azure region. + /// The content of the action request. + /// The cancellation token to use. + /// is null. + public virtual Response GetSapSupportedSkuSapVirtualInstance(AzureLocation location, SapSupportedSkusContent content, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(content, nameof(content)); + + using var scope = SapVirtualInstanceClientDiagnostics.CreateScope("MockableSapVirtualInstancesSubscriptionResource.GetSapSupportedSkuSapVirtualInstance"); + scope.Start(); + try + { + var response = SapVirtualInstanceRestClient.GetSapSupportedSku(Id.SubscriptionId, location, content, cancellationToken); + return response; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get the SAP Disk Configuration Layout prod/non-prod SAP System. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.Workloads/locations/{location}/sapVirtualInstanceMetadata/default/getDiskConfigurations + /// + /// + /// Operation Id + /// SAPVirtualInstances_GetDiskConfigurations + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the Azure region. + /// The content of the action request. + /// The cancellation token to use. + /// is null. + public virtual async Task> GetDiskConfigurationsSapVirtualInstanceAsync(AzureLocation location, SapDiskConfigurationsContent content, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(content, nameof(content)); + + using var scope = SapVirtualInstanceClientDiagnostics.CreateScope("MockableSapVirtualInstancesSubscriptionResource.GetDiskConfigurationsSapVirtualInstance"); + scope.Start(); + try + { + var response = await SapVirtualInstanceRestClient.GetDiskConfigurationsAsync(Id.SubscriptionId, location, content, cancellationToken).ConfigureAwait(false); + return response; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get the SAP Disk Configuration Layout prod/non-prod SAP System. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.Workloads/locations/{location}/sapVirtualInstanceMetadata/default/getDiskConfigurations + /// + /// + /// Operation Id + /// SAPVirtualInstances_GetDiskConfigurations + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the Azure region. + /// The content of the action request. + /// The cancellation token to use. + /// is null. + public virtual Response GetDiskConfigurationsSapVirtualInstance(AzureLocation location, SapDiskConfigurationsContent content, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(content, nameof(content)); + + using var scope = SapVirtualInstanceClientDiagnostics.CreateScope("MockableSapVirtualInstancesSubscriptionResource.GetDiskConfigurationsSapVirtualInstance"); + scope.Start(); + try + { + var response = SapVirtualInstanceRestClient.GetDiskConfigurations(Id.SubscriptionId, location, content, cancellationToken); + return response; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get the recommended SAP Availability Zone Pair Details for your region. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.Workloads/locations/{location}/sapVirtualInstanceMetadata/default/getAvailabilityZoneDetails + /// + /// + /// Operation Id + /// SAPVirtualInstances_GetAvailabilityZoneDetails + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the Azure region. + /// The content of the action request. + /// The cancellation token to use. + /// is null. + public virtual async Task> GetAvailabilityZoneDetailsSapVirtualInstanceAsync(AzureLocation location, SapAvailabilityZoneDetailsContent content, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(content, nameof(content)); + + using var scope = SapVirtualInstanceClientDiagnostics.CreateScope("MockableSapVirtualInstancesSubscriptionResource.GetAvailabilityZoneDetailsSapVirtualInstance"); + scope.Start(); + try + { + var response = await SapVirtualInstanceRestClient.GetAvailabilityZoneDetailsAsync(Id.SubscriptionId, location, content, cancellationToken).ConfigureAwait(false); + return response; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get the recommended SAP Availability Zone Pair Details for your region. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.Workloads/locations/{location}/sapVirtualInstanceMetadata/default/getAvailabilityZoneDetails + /// + /// + /// Operation Id + /// SAPVirtualInstances_GetAvailabilityZoneDetails + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the Azure region. + /// The content of the action request. + /// The cancellation token to use. + /// is null. + public virtual Response GetAvailabilityZoneDetailsSapVirtualInstance(AzureLocation location, SapAvailabilityZoneDetailsContent content, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(content, nameof(content)); + + using var scope = SapVirtualInstanceClientDiagnostics.CreateScope("MockableSapVirtualInstancesSubscriptionResource.GetAvailabilityZoneDetailsSapVirtualInstance"); + scope.Start(); + try + { + var response = SapVirtualInstanceRestClient.GetAvailabilityZoneDetails(Id.SubscriptionId, location, content, cancellationToken); + return response; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Extensions/SapVirtualInstancesExtensions.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Extensions/SapVirtualInstancesExtensions.cs new file mode 100644 index 000000000000..4ec5c61ddb30 --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Extensions/SapVirtualInstancesExtensions.cs @@ -0,0 +1,573 @@ +// 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.Resources; +using Azure.ResourceManager.SapVirtualInstances.Mocking; +using Azure.ResourceManager.SapVirtualInstances.Models; + +namespace Azure.ResourceManager.SapVirtualInstances +{ + /// A class to add extension methods to Azure.ResourceManager.SapVirtualInstances. + public static partial class SapVirtualInstancesExtensions + { + private static MockableSapVirtualInstancesArmClient GetMockableSapVirtualInstancesArmClient(ArmClient client) + { + return client.GetCachedClient(client0 => new MockableSapVirtualInstancesArmClient(client0)); + } + + private static MockableSapVirtualInstancesResourceGroupResource GetMockableSapVirtualInstancesResourceGroupResource(ArmResource resource) + { + return resource.GetCachedClient(client => new MockableSapVirtualInstancesResourceGroupResource(client, resource.Id)); + } + + private static MockableSapVirtualInstancesSubscriptionResource GetMockableSapVirtualInstancesSubscriptionResource(ArmResource resource) + { + return resource.GetCachedClient(client => new MockableSapVirtualInstancesSubscriptionResource(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 SapVirtualInstanceResource GetSapVirtualInstanceResource(this ArmClient client, ResourceIdentifier id) + { + Argument.AssertNotNull(client, nameof(client)); + + return GetMockableSapVirtualInstancesArmClient(client).GetSapVirtualInstanceResource(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 SapCentralServerInstanceResource GetSapCentralServerInstanceResource(this ArmClient client, ResourceIdentifier id) + { + Argument.AssertNotNull(client, nameof(client)); + + return GetMockableSapVirtualInstancesArmClient(client).GetSapCentralServerInstanceResource(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 SapDatabaseInstanceResource GetSapDatabaseInstanceResource(this ArmClient client, ResourceIdentifier id) + { + Argument.AssertNotNull(client, nameof(client)); + + return GetMockableSapVirtualInstancesArmClient(client).GetSapDatabaseInstanceResource(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 SapApplicationServerInstanceResource GetSapApplicationServerInstanceResource(this ArmClient client, ResourceIdentifier id) + { + Argument.AssertNotNull(client, nameof(client)); + + return GetMockableSapVirtualInstancesArmClient(client).GetSapApplicationServerInstanceResource(id); + } + + /// + /// Gets a collection of SapVirtualInstanceResources 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 SapVirtualInstanceResources and their operations over a SapVirtualInstanceResource. + public static SapVirtualInstanceCollection GetSapVirtualInstances(this ResourceGroupResource resourceGroupResource) + { + Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource)); + + return GetMockableSapVirtualInstancesResourceGroupResource(resourceGroupResource).GetSapVirtualInstances(); + } + + /// + /// Gets a Virtual Instance for SAP solutions resource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName} + /// + /// + /// Operation Id + /// SAPVirtualInstance_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The name of the Virtual Instances for SAP solutions 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> GetSapVirtualInstanceAsync(this ResourceGroupResource resourceGroupResource, string sapVirtualInstanceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource)); + + return await GetMockableSapVirtualInstancesResourceGroupResource(resourceGroupResource).GetSapVirtualInstanceAsync(sapVirtualInstanceName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets a Virtual Instance for SAP solutions resource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName} + /// + /// + /// Operation Id + /// SAPVirtualInstance_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The name of the Virtual Instances for SAP solutions resource. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public static Response GetSapVirtualInstance(this ResourceGroupResource resourceGroupResource, string sapVirtualInstanceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource)); + + return GetMockableSapVirtualInstancesResourceGroupResource(resourceGroupResource).GetSapVirtualInstance(sapVirtualInstanceName, cancellationToken); + } + + /// + /// Gets all Virtual Instances for SAP solutions resources in a Subscription. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.Workloads/sapVirtualInstances + /// + /// + /// Operation Id + /// SAPVirtualInstance_ListBySubscription + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// 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 GetSapVirtualInstancesAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); + + return GetMockableSapVirtualInstancesSubscriptionResource(subscriptionResource).GetSapVirtualInstancesAsync(cancellationToken); + } + + /// + /// Gets all Virtual Instances for SAP solutions resources in a Subscription. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.Workloads/sapVirtualInstances + /// + /// + /// Operation Id + /// SAPVirtualInstance_ListBySubscription + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// 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 GetSapVirtualInstances(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); + + return GetMockableSapVirtualInstancesSubscriptionResource(subscriptionResource).GetSapVirtualInstances(cancellationToken); + } + + /// + /// Gets the sizing recommendations. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.Workloads/locations/{location}/sapVirtualInstanceMetadata/default/getSizingRecommendations + /// + /// + /// Operation Id + /// SAPVirtualInstances_GetSizingRecommendations + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The name of the Azure region. + /// The content of the action request. + /// The cancellation token to use. + /// or is null. + public static async Task> GetSizingRecommendationsSapVirtualInstanceAsync(this SubscriptionResource subscriptionResource, AzureLocation location, SapSizingRecommendationContent content, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); + + return await GetMockableSapVirtualInstancesSubscriptionResource(subscriptionResource).GetSizingRecommendationsSapVirtualInstanceAsync(location, content, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets the sizing recommendations. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.Workloads/locations/{location}/sapVirtualInstanceMetadata/default/getSizingRecommendations + /// + /// + /// Operation Id + /// SAPVirtualInstances_GetSizingRecommendations + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The name of the Azure region. + /// The content of the action request. + /// The cancellation token to use. + /// or is null. + public static Response GetSizingRecommendationsSapVirtualInstance(this SubscriptionResource subscriptionResource, AzureLocation location, SapSizingRecommendationContent content, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); + + return GetMockableSapVirtualInstancesSubscriptionResource(subscriptionResource).GetSizingRecommendationsSapVirtualInstance(location, content, cancellationToken); + } + + /// + /// Get a list of SAP supported SKUs for ASCS, Application and Database tier. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.Workloads/locations/{location}/sapVirtualInstanceMetadata/default/getSapSupportedSku + /// + /// + /// Operation Id + /// SAPVirtualInstances_GetSapSupportedSku + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The name of the Azure region. + /// The content of the action request. + /// The cancellation token to use. + /// or is null. + public static async Task> GetSapSupportedSkuSapVirtualInstanceAsync(this SubscriptionResource subscriptionResource, AzureLocation location, SapSupportedSkusContent content, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); + + return await GetMockableSapVirtualInstancesSubscriptionResource(subscriptionResource).GetSapSupportedSkuSapVirtualInstanceAsync(location, content, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get a list of SAP supported SKUs for ASCS, Application and Database tier. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.Workloads/locations/{location}/sapVirtualInstanceMetadata/default/getSapSupportedSku + /// + /// + /// Operation Id + /// SAPVirtualInstances_GetSapSupportedSku + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The name of the Azure region. + /// The content of the action request. + /// The cancellation token to use. + /// or is null. + public static Response GetSapSupportedSkuSapVirtualInstance(this SubscriptionResource subscriptionResource, AzureLocation location, SapSupportedSkusContent content, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); + + return GetMockableSapVirtualInstancesSubscriptionResource(subscriptionResource).GetSapSupportedSkuSapVirtualInstance(location, content, cancellationToken); + } + + /// + /// Get the SAP Disk Configuration Layout prod/non-prod SAP System. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.Workloads/locations/{location}/sapVirtualInstanceMetadata/default/getDiskConfigurations + /// + /// + /// Operation Id + /// SAPVirtualInstances_GetDiskConfigurations + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The name of the Azure region. + /// The content of the action request. + /// The cancellation token to use. + /// or is null. + public static async Task> GetDiskConfigurationsSapVirtualInstanceAsync(this SubscriptionResource subscriptionResource, AzureLocation location, SapDiskConfigurationsContent content, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); + + return await GetMockableSapVirtualInstancesSubscriptionResource(subscriptionResource).GetDiskConfigurationsSapVirtualInstanceAsync(location, content, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get the SAP Disk Configuration Layout prod/non-prod SAP System. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.Workloads/locations/{location}/sapVirtualInstanceMetadata/default/getDiskConfigurations + /// + /// + /// Operation Id + /// SAPVirtualInstances_GetDiskConfigurations + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The name of the Azure region. + /// The content of the action request. + /// The cancellation token to use. + /// or is null. + public static Response GetDiskConfigurationsSapVirtualInstance(this SubscriptionResource subscriptionResource, AzureLocation location, SapDiskConfigurationsContent content, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); + + return GetMockableSapVirtualInstancesSubscriptionResource(subscriptionResource).GetDiskConfigurationsSapVirtualInstance(location, content, cancellationToken); + } + + /// + /// Get the recommended SAP Availability Zone Pair Details for your region. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.Workloads/locations/{location}/sapVirtualInstanceMetadata/default/getAvailabilityZoneDetails + /// + /// + /// Operation Id + /// SAPVirtualInstances_GetAvailabilityZoneDetails + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The name of the Azure region. + /// The content of the action request. + /// The cancellation token to use. + /// or is null. + public static async Task> GetAvailabilityZoneDetailsSapVirtualInstanceAsync(this SubscriptionResource subscriptionResource, AzureLocation location, SapAvailabilityZoneDetailsContent content, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); + + return await GetMockableSapVirtualInstancesSubscriptionResource(subscriptionResource).GetAvailabilityZoneDetailsSapVirtualInstanceAsync(location, content, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get the recommended SAP Availability Zone Pair Details for your region. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.Workloads/locations/{location}/sapVirtualInstanceMetadata/default/getAvailabilityZoneDetails + /// + /// + /// Operation Id + /// SAPVirtualInstances_GetAvailabilityZoneDetails + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The name of the Azure region. + /// The content of the action request. + /// The cancellation token to use. + /// or is null. + public static Response GetAvailabilityZoneDetailsSapVirtualInstance(this SubscriptionResource subscriptionResource, AzureLocation location, SapAvailabilityZoneDetailsContent content, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); + + return GetMockableSapVirtualInstancesSubscriptionResource(subscriptionResource).GetAvailabilityZoneDetailsSapVirtualInstance(location, content, cancellationToken); + } + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Internal/Argument.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Internal/Argument.cs new file mode 100644 index 000000000000..058a05ba4c78 --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Internal/Argument.cs @@ -0,0 +1,129 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections; +using System.Collections.Generic; + +namespace Azure.ResourceManager.SapVirtualInstances +{ + internal static class Argument + { + public static void AssertNotNull(T value, string name) + { + if (value is null) + { + throw new ArgumentNullException(name); + } + } + + public static void AssertNotNull(T? value, string name) + where T : struct + { + if (!value.HasValue) + { + throw new ArgumentNullException(name); + } + } + + public static void AssertNotNullOrEmpty(IEnumerable value, string name) + { + if (value is null) + { + throw new ArgumentNullException(name); + } + if (value is ICollection collectionOfT && collectionOfT.Count == 0) + { + throw new ArgumentException("Value cannot be an empty collection.", name); + } + if (value is ICollection collection && collection.Count == 0) + { + throw new ArgumentException("Value cannot be an empty collection.", name); + } + using IEnumerator e = value.GetEnumerator(); + if (!e.MoveNext()) + { + throw new ArgumentException("Value cannot be an empty collection.", name); + } + } + + public static void AssertNotNullOrEmpty(string value, string name) + { + if (value is null) + { + throw new ArgumentNullException(name); + } + if (value.Length == 0) + { + throw new ArgumentException("Value cannot be an empty string.", name); + } + } + + public static void AssertNotNullOrWhiteSpace(string value, string name) + { + if (value is null) + { + throw new ArgumentNullException(name); + } + if (string.IsNullOrWhiteSpace(value)) + { + throw new ArgumentException("Value cannot be empty or contain only white-space characters.", name); + } + } + + public static void AssertNotDefault(ref T value, string name) + where T : struct, IEquatable + { + if (value.Equals(default)) + { + throw new ArgumentException("Value cannot be empty.", name); + } + } + + public static void AssertInRange(T value, T minimum, T maximum, string name) + where T : notnull, IComparable + { + if (minimum.CompareTo(value) > 0) + { + throw new ArgumentOutOfRangeException(name, "Value is less than the minimum allowed."); + } + if (maximum.CompareTo(value) < 0) + { + throw new ArgumentOutOfRangeException(name, "Value is greater than the maximum allowed."); + } + } + + public static void AssertEnumDefined(Type enumType, object value, string name) + { + if (!Enum.IsDefined(enumType, value)) + { + throw new ArgumentException($"Value not defined for {enumType.FullName}.", name); + } + } + + public static T CheckNotNull(T value, string name) + where T : class + { + AssertNotNull(value, name); + return value; + } + + public static string CheckNotNullOrEmpty(string value, string name) + { + AssertNotNullOrEmpty(value, name); + return value; + } + + public static void AssertNull(T value, string name, string message = null) + { + if (value != null) + { + throw new ArgumentException(message ?? "Value must be null.", name); + } + } + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Internal/ChangeTrackingDictionary.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Internal/ChangeTrackingDictionary.cs new file mode 100644 index 000000000000..dd179878f74f --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Internal/ChangeTrackingDictionary.cs @@ -0,0 +1,167 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections; +using System.Collections.Generic; + +namespace Azure.ResourceManager.SapVirtualInstances +{ + internal class ChangeTrackingDictionary : IDictionary, IReadOnlyDictionary where TKey : notnull + { + private IDictionary _innerDictionary; + + public ChangeTrackingDictionary() + { + } + + public ChangeTrackingDictionary(IDictionary dictionary) + { + if (dictionary == null) + { + return; + } + _innerDictionary = new Dictionary(dictionary); + } + + public ChangeTrackingDictionary(IReadOnlyDictionary dictionary) + { + if (dictionary == null) + { + return; + } + _innerDictionary = new Dictionary(); + foreach (var pair in dictionary) + { + _innerDictionary.Add(pair); + } + } + + public bool IsUndefined => _innerDictionary == null; + + public int Count => IsUndefined ? 0 : EnsureDictionary().Count; + + public bool IsReadOnly => IsUndefined ? false : EnsureDictionary().IsReadOnly; + + public ICollection Keys => IsUndefined ? Array.Empty() : EnsureDictionary().Keys; + + public ICollection Values => IsUndefined ? Array.Empty() : EnsureDictionary().Values; + + public TValue this[TKey key] + { + get + { + if (IsUndefined) + { + throw new KeyNotFoundException(nameof(key)); + } + return EnsureDictionary()[key]; + } + set + { + EnsureDictionary()[key] = value; + } + } + + IEnumerable IReadOnlyDictionary.Keys => Keys; + + IEnumerable IReadOnlyDictionary.Values => Values; + + public IEnumerator> GetEnumerator() + { + if (IsUndefined) + { + IEnumerator> enumerateEmpty() + { + yield break; + } + return enumerateEmpty(); + } + return EnsureDictionary().GetEnumerator(); + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetEnumerator(); + } + + public void Add(KeyValuePair item) + { + EnsureDictionary().Add(item); + } + + public void Clear() + { + EnsureDictionary().Clear(); + } + + public bool Contains(KeyValuePair item) + { + if (IsUndefined) + { + return false; + } + return EnsureDictionary().Contains(item); + } + + public void CopyTo(KeyValuePair[] array, int index) + { + if (IsUndefined) + { + return; + } + EnsureDictionary().CopyTo(array, index); + } + + public bool Remove(KeyValuePair item) + { + if (IsUndefined) + { + return false; + } + return EnsureDictionary().Remove(item); + } + + public void Add(TKey key, TValue value) + { + EnsureDictionary().Add(key, value); + } + + public bool ContainsKey(TKey key) + { + if (IsUndefined) + { + return false; + } + return EnsureDictionary().ContainsKey(key); + } + + public bool Remove(TKey key) + { + if (IsUndefined) + { + return false; + } + return EnsureDictionary().Remove(key); + } + + public bool TryGetValue(TKey key, out TValue value) + { + if (IsUndefined) + { + value = default; + return false; + } + return EnsureDictionary().TryGetValue(key, out value); + } + + public IDictionary EnsureDictionary() + { + return _innerDictionary ??= new Dictionary(); + } + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Internal/ChangeTrackingList.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Internal/ChangeTrackingList.cs new file mode 100644 index 000000000000..7579b8ecf8b4 --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Internal/ChangeTrackingList.cs @@ -0,0 +1,153 @@ +// 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.Linq; + +namespace Azure.ResourceManager.SapVirtualInstances +{ + internal class ChangeTrackingList : IList, IReadOnlyList + { + private IList _innerList; + + public ChangeTrackingList() + { + } + + public ChangeTrackingList(IList innerList) + { + if (innerList != null) + { + _innerList = innerList; + } + } + + public ChangeTrackingList(IReadOnlyList innerList) + { + if (innerList != null) + { + _innerList = innerList.ToList(); + } + } + + public bool IsUndefined => _innerList == null; + + public int Count => IsUndefined ? 0 : EnsureList().Count; + + public bool IsReadOnly => IsUndefined ? false : EnsureList().IsReadOnly; + + public T this[int index] + { + get + { + if (IsUndefined) + { + throw new ArgumentOutOfRangeException(nameof(index)); + } + return EnsureList()[index]; + } + set + { + if (IsUndefined) + { + throw new ArgumentOutOfRangeException(nameof(index)); + } + EnsureList()[index] = value; + } + } + + public void Reset() + { + _innerList = null; + } + + public IEnumerator GetEnumerator() + { + if (IsUndefined) + { + IEnumerator enumerateEmpty() + { + yield break; + } + return enumerateEmpty(); + } + return EnsureList().GetEnumerator(); + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetEnumerator(); + } + + public void Add(T item) + { + EnsureList().Add(item); + } + + public void Clear() + { + EnsureList().Clear(); + } + + public bool Contains(T item) + { + if (IsUndefined) + { + return false; + } + return EnsureList().Contains(item); + } + + public void CopyTo(T[] array, int arrayIndex) + { + if (IsUndefined) + { + return; + } + EnsureList().CopyTo(array, arrayIndex); + } + + public bool Remove(T item) + { + if (IsUndefined) + { + return false; + } + return EnsureList().Remove(item); + } + + public int IndexOf(T item) + { + if (IsUndefined) + { + return -1; + } + return EnsureList().IndexOf(item); + } + + public void Insert(int index, T item) + { + EnsureList().Insert(index, item); + } + + public void RemoveAt(int index) + { + if (IsUndefined) + { + throw new ArgumentOutOfRangeException(nameof(index)); + } + EnsureList().RemoveAt(index); + } + + public IList EnsureList() + { + return _innerList ??= new List(); + } + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Internal/ModelSerializationExtensions.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Internal/ModelSerializationExtensions.cs new file mode 100644 index 000000000000..5facb4eb97d3 --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Internal/ModelSerializationExtensions.cs @@ -0,0 +1,398 @@ +// 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.Diagnostics; +using System.Globalization; +using System.Text.Json; +using System.Xml; +using Azure.Core; + +namespace Azure.ResourceManager.SapVirtualInstances +{ + internal static class ModelSerializationExtensions + { + internal static readonly ModelReaderWriterOptions WireOptions = new ModelReaderWriterOptions("W"); + + public static object GetObject(this JsonElement element) + { + switch (element.ValueKind) + { + case JsonValueKind.String: + return element.GetString(); + case JsonValueKind.Number: + if (element.TryGetInt32(out int intValue)) + { + return intValue; + } + if (element.TryGetInt64(out long longValue)) + { + return longValue; + } + return element.GetDouble(); + case JsonValueKind.True: + return true; + case JsonValueKind.False: + return false; + case JsonValueKind.Undefined: + case JsonValueKind.Null: + return null; + case JsonValueKind.Object: + var dictionary = new Dictionary(); + foreach (var jsonProperty in element.EnumerateObject()) + { + dictionary.Add(jsonProperty.Name, jsonProperty.Value.GetObject()); + } + return dictionary; + case JsonValueKind.Array: + var list = new List(); + foreach (var item in element.EnumerateArray()) + { + list.Add(item.GetObject()); + } + return list.ToArray(); + default: + throw new NotSupportedException($"Not supported value kind {element.ValueKind}"); + } + } + + public static byte[] GetBytesFromBase64(this JsonElement element, string format) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + + return format switch + { + "U" => TypeFormatters.FromBase64UrlString(element.GetRequiredString()), + "D" => element.GetBytesFromBase64(), + _ => throw new ArgumentException($"Format is not supported: '{format}'", nameof(format)) + }; + } + + public static DateTimeOffset GetDateTimeOffset(this JsonElement element, string format) => format switch + { + "U" when element.ValueKind == JsonValueKind.Number => DateTimeOffset.FromUnixTimeSeconds(element.GetInt64()), + _ => TypeFormatters.ParseDateTimeOffset(element.GetString(), format) + }; + + public static TimeSpan GetTimeSpan(this JsonElement element, string format) => TypeFormatters.ParseTimeSpan(element.GetString(), format); + + public static char GetChar(this JsonElement element) + { + if (element.ValueKind == JsonValueKind.String) + { + var text = element.GetString(); + if (text == null || text.Length != 1) + { + throw new NotSupportedException($"Cannot convert \"{text}\" to a char"); + } + return text[0]; + } + else + { + throw new NotSupportedException($"Cannot convert {element.ValueKind} to a char"); + } + } + + [Conditional("DEBUG")] + public static void ThrowNonNullablePropertyIsNull(this JsonProperty property) + { + throw new JsonException($"A property '{property.Name}' defined as non-nullable but received as null from the service. This exception only happens in DEBUG builds of the library and would be ignored in the release build"); + } + + public static string GetRequiredString(this JsonElement element) + { + var value = element.GetString(); + if (value == null) + { + throw new InvalidOperationException($"The requested operation requires an element of type 'String', but the target element has type '{element.ValueKind}'."); + } + return value; + } + + public static void WriteStringValue(this Utf8JsonWriter writer, DateTimeOffset value, string format) + { + writer.WriteStringValue(TypeFormatters.ToString(value, format)); + } + + public static void WriteStringValue(this Utf8JsonWriter writer, DateTime value, string format) + { + writer.WriteStringValue(TypeFormatters.ToString(value, format)); + } + + public static void WriteStringValue(this Utf8JsonWriter writer, TimeSpan value, string format) + { + writer.WriteStringValue(TypeFormatters.ToString(value, format)); + } + + public static void WriteStringValue(this Utf8JsonWriter writer, char value) + { + writer.WriteStringValue(value.ToString(CultureInfo.InvariantCulture)); + } + + public static void WriteBase64StringValue(this Utf8JsonWriter writer, byte[] value, string format) + { + if (value == null) + { + writer.WriteNullValue(); + return; + } + switch (format) + { + case "U": + writer.WriteStringValue(TypeFormatters.ToBase64UrlString(value)); + break; + case "D": + writer.WriteBase64StringValue(value); + break; + default: + throw new ArgumentException($"Format is not supported: '{format}'", nameof(format)); + } + } + + public static void WriteNumberValue(this Utf8JsonWriter writer, DateTimeOffset value, string format) + { + if (format != "U") + { + throw new ArgumentOutOfRangeException(nameof(format), "Only 'U' format is supported when writing a DateTimeOffset as a Number."); + } + writer.WriteNumberValue(value.ToUnixTimeSeconds()); + } + + public static void WriteObjectValue(this Utf8JsonWriter writer, T value, ModelReaderWriterOptions options = null) + { + switch (value) + { + case null: + writer.WriteNullValue(); + break; + case IJsonModel jsonModel: + jsonModel.Write(writer, options ?? WireOptions); + break; + case IUtf8JsonSerializable serializable: + serializable.Write(writer); + break; + case byte[] bytes: + writer.WriteBase64StringValue(bytes); + break; + case BinaryData bytes0: + writer.WriteBase64StringValue(bytes0); + break; + case JsonElement json: + json.WriteTo(writer); + break; + case int i: + writer.WriteNumberValue(i); + break; + case decimal d: + writer.WriteNumberValue(d); + break; + case double d0: + if (double.IsNaN(d0)) + { + writer.WriteStringValue("NaN"); + } + else + { + writer.WriteNumberValue(d0); + } + break; + case float f: + writer.WriteNumberValue(f); + break; + case long l: + writer.WriteNumberValue(l); + break; + case string s: + writer.WriteStringValue(s); + break; + case bool b: + writer.WriteBooleanValue(b); + break; + case Guid g: + writer.WriteStringValue(g); + break; + case DateTimeOffset dateTimeOffset: + writer.WriteStringValue(dateTimeOffset, "O"); + break; + case DateTime dateTime: + writer.WriteStringValue(dateTime, "O"); + break; + case IEnumerable> enumerable: + writer.WriteStartObject(); + foreach (var pair in enumerable) + { + writer.WritePropertyName(pair.Key); + writer.WriteObjectValue(pair.Value, options); + } + writer.WriteEndObject(); + break; + case IEnumerable objectEnumerable: + writer.WriteStartArray(); + foreach (var item in objectEnumerable) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + break; + case TimeSpan timeSpan: + writer.WriteStringValue(timeSpan, "P"); + break; + default: + throw new NotSupportedException($"Not supported type {value.GetType()}"); + } + } + + public static void WriteObjectValue(this Utf8JsonWriter writer, object value, ModelReaderWriterOptions options = null) + { + writer.WriteObjectValue(value, options); + } + + internal static class TypeFormatters + { + private const string RoundtripZFormat = "yyyy-MM-ddTHH:mm:ss.fffffffZ"; + public const string DefaultNumberFormat = "G"; + + public static string ToString(bool value) => value ? "true" : "false"; + + public static string ToString(DateTime value, string format) => value.Kind switch + { + DateTimeKind.Utc => ToString((DateTimeOffset)value, format), + _ => throw new NotSupportedException($"DateTime {value} has a Kind of {value.Kind}. Azure SDK requires it to be UTC. You can call DateTime.SpecifyKind to change Kind property value to DateTimeKind.Utc.") + }; + + public static string ToString(DateTimeOffset value, string format) => format switch + { + "D" => value.ToString("yyyy-MM-dd", CultureInfo.InvariantCulture), + "U" => value.ToUnixTimeSeconds().ToString(CultureInfo.InvariantCulture), + "O" => value.ToUniversalTime().ToString(RoundtripZFormat, CultureInfo.InvariantCulture), + "o" => value.ToUniversalTime().ToString(RoundtripZFormat, CultureInfo.InvariantCulture), + "R" => value.ToString("r", CultureInfo.InvariantCulture), + _ => value.ToString(format, CultureInfo.InvariantCulture) + }; + + public static string ToString(TimeSpan value, string format) => format switch + { + "P" => XmlConvert.ToString(value), + _ => value.ToString(format, CultureInfo.InvariantCulture) + }; + + public static string ToString(byte[] value, string format) => format switch + { + "U" => ToBase64UrlString(value), + "D" => Convert.ToBase64String(value), + _ => throw new ArgumentException($"Format is not supported: '{format}'", nameof(format)) + }; + + public static string ToBase64UrlString(byte[] value) + { + int numWholeOrPartialInputBlocks = checked(value.Length + 2) / 3; + int size = checked(numWholeOrPartialInputBlocks * 4); + char[] output = new char[size]; + + int numBase64Chars = Convert.ToBase64CharArray(value, 0, value.Length, output, 0); + + int i = 0; + for (; i < numBase64Chars; i++) + { + char ch = output[i]; + if (ch == '+') + { + output[i] = '-'; + } + else + { + if (ch == '/') + { + output[i] = '_'; + } + else + { + if (ch == '=') + { + break; + } + } + } + } + + return new string(output, 0, i); + } + + public static byte[] FromBase64UrlString(string value) + { + int paddingCharsToAdd = (value.Length % 4) switch + { + 0 => 0, + 2 => 2, + 3 => 1, + _ => throw new InvalidOperationException("Malformed input") + }; + char[] output = new char[(value.Length + paddingCharsToAdd)]; + int i = 0; + for (; i < value.Length; i++) + { + char ch = value[i]; + if (ch == '-') + { + output[i] = '+'; + } + else + { + if (ch == '_') + { + output[i] = '/'; + } + else + { + output[i] = ch; + } + } + } + + for (; i < output.Length; i++) + { + output[i] = '='; + } + + return Convert.FromBase64CharArray(output, 0, output.Length); + } + + public static DateTimeOffset ParseDateTimeOffset(string value, string format) => format switch + { + "U" => DateTimeOffset.FromUnixTimeSeconds(long.Parse(value, CultureInfo.InvariantCulture)), + _ => DateTimeOffset.Parse(value, CultureInfo.InvariantCulture, DateTimeStyles.AssumeUniversal) + }; + + public static TimeSpan ParseTimeSpan(string value, string format) => format switch + { + "P" => XmlConvert.ToTimeSpan(value), + _ => TimeSpan.ParseExact(value, format, CultureInfo.InvariantCulture) + }; + + public static string ConvertToString(object value, string format = null) => value switch + { + null => "null", + string s => s, + bool b => ToString(b), + int or float or double or long or decimal => ((IFormattable)value).ToString(DefaultNumberFormat, CultureInfo.InvariantCulture), + byte[] b0 when format != null => ToString(b0, format), + IEnumerable s0 => string.Join(",", s0), + DateTimeOffset dateTime when format != null => ToString(dateTime, format), + TimeSpan timeSpan when format != null => ToString(timeSpan, format), + TimeSpan timeSpan0 => XmlConvert.ToString(timeSpan0), + Guid guid => guid.ToString(), + BinaryData binaryData => ConvertToString(binaryData.ToArray(), format), + _ => value.ToString() + }; + } + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Internal/Optional.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Internal/Optional.cs new file mode 100644 index 000000000000..6e81f2408f30 --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Internal/Optional.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; + +namespace Azure.ResourceManager.SapVirtualInstances +{ + internal static class Optional + { + public static bool IsCollectionDefined(IEnumerable collection) + { + return !(collection is ChangeTrackingList changeTrackingList && changeTrackingList.IsUndefined); + } + + public static bool IsCollectionDefined(IDictionary collection) + { + return !(collection is ChangeTrackingDictionary changeTrackingDictionary && changeTrackingDictionary.IsUndefined); + } + + public static bool IsCollectionDefined(IReadOnlyDictionary collection) + { + return !(collection is ChangeTrackingDictionary changeTrackingDictionary && changeTrackingDictionary.IsUndefined); + } + + public static bool IsDefined(T? value) + where T : struct + { + return value.HasValue; + } + + public static bool IsDefined(object value) + { + return value != null; + } + + public static bool IsDefined(JsonElement value) + { + return value.ValueKind != JsonValueKind.Undefined; + } + + public static bool IsDefined(string value) + { + return value != null; + } + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Internal/Utf8JsonRequestContent.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Internal/Utf8JsonRequestContent.cs new file mode 100644 index 000000000000..041d71542846 --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Internal/Utf8JsonRequestContent.cs @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.IO; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; + +namespace Azure.ResourceManager.SapVirtualInstances +{ + internal class Utf8JsonRequestContent : RequestContent + { + private readonly MemoryStream _stream; + private readonly RequestContent _content; + + public Utf8JsonRequestContent() + { + _stream = new MemoryStream(); + _content = Create(_stream); + JsonWriter = new Utf8JsonWriter(_stream); + } + + public Utf8JsonWriter JsonWriter { get; } + + public override async Task WriteToAsync(Stream stream, CancellationToken cancellationToken = default) + { + await JsonWriter.FlushAsync().ConfigureAwait(false); + await _content.WriteToAsync(stream, cancellationToken).ConfigureAwait(false); + } + + public override void WriteTo(Stream stream, CancellationToken cancellationToken = default) + { + JsonWriter.Flush(); + _content.WriteTo(stream, cancellationToken); + } + + public override bool TryComputeLength(out long length) + { + length = JsonWriter.BytesCommitted + JsonWriter.BytesPending; + return true; + } + + public override void Dispose() + { + JsonWriter.Dispose(); + _content.Dispose(); + _stream.Dispose(); + } + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/LongRunningOperation/OperationStatusResultOperationSource.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/LongRunningOperation/OperationStatusResultOperationSource.cs new file mode 100644 index 000000000000..3937aa05c15a --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/LongRunningOperation/OperationStatusResultOperationSource.cs @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.ResourceManager.SapVirtualInstances.Models; + +namespace Azure.ResourceManager.SapVirtualInstances +{ + internal class OperationStatusResultOperationSource : IOperationSource + { + OperationStatusResult IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) + { + using var document = JsonDocument.Parse(response.ContentStream); + return OperationStatusResult.DeserializeOperationStatusResult(document.RootElement); + } + + async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) + { + using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false); + return OperationStatusResult.DeserializeOperationStatusResult(document.RootElement); + } + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/LongRunningOperation/SapApplicationServerInstanceOperationSource.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/LongRunningOperation/SapApplicationServerInstanceOperationSource.cs new file mode 100644 index 000000000000..28fa72281674 --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/LongRunningOperation/SapApplicationServerInstanceOperationSource.cs @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; + +namespace Azure.ResourceManager.SapVirtualInstances +{ + internal class SapApplicationServerInstanceOperationSource : IOperationSource + { + private readonly ArmClient _client; + + internal SapApplicationServerInstanceOperationSource(ArmClient client) + { + _client = client; + } + + SapApplicationServerInstanceResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) + { + using var document = JsonDocument.Parse(response.ContentStream); + var data = SapApplicationServerInstanceData.DeserializeSapApplicationServerInstanceData(document.RootElement); + return new SapApplicationServerInstanceResource(_client, data); + } + + async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) + { + using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false); + var data = SapApplicationServerInstanceData.DeserializeSapApplicationServerInstanceData(document.RootElement); + return new SapApplicationServerInstanceResource(_client, data); + } + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/LongRunningOperation/SapCentralServerInstanceOperationSource.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/LongRunningOperation/SapCentralServerInstanceOperationSource.cs new file mode 100644 index 000000000000..f123e9663d38 --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/LongRunningOperation/SapCentralServerInstanceOperationSource.cs @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; + +namespace Azure.ResourceManager.SapVirtualInstances +{ + internal class SapCentralServerInstanceOperationSource : IOperationSource + { + private readonly ArmClient _client; + + internal SapCentralServerInstanceOperationSource(ArmClient client) + { + _client = client; + } + + SapCentralServerInstanceResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) + { + using var document = JsonDocument.Parse(response.ContentStream); + var data = SapCentralServerInstanceData.DeserializeSapCentralServerInstanceData(document.RootElement); + return new SapCentralServerInstanceResource(_client, data); + } + + async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) + { + using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false); + var data = SapCentralServerInstanceData.DeserializeSapCentralServerInstanceData(document.RootElement); + return new SapCentralServerInstanceResource(_client, data); + } + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/LongRunningOperation/SapDatabaseInstanceOperationSource.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/LongRunningOperation/SapDatabaseInstanceOperationSource.cs new file mode 100644 index 000000000000..a3d3d6b74de8 --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/LongRunningOperation/SapDatabaseInstanceOperationSource.cs @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; + +namespace Azure.ResourceManager.SapVirtualInstances +{ + internal class SapDatabaseInstanceOperationSource : IOperationSource + { + private readonly ArmClient _client; + + internal SapDatabaseInstanceOperationSource(ArmClient client) + { + _client = client; + } + + SapDatabaseInstanceResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) + { + using var document = JsonDocument.Parse(response.ContentStream); + var data = SapDatabaseInstanceData.DeserializeSapDatabaseInstanceData(document.RootElement); + return new SapDatabaseInstanceResource(_client, data); + } + + async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) + { + using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false); + var data = SapDatabaseInstanceData.DeserializeSapDatabaseInstanceData(document.RootElement); + return new SapDatabaseInstanceResource(_client, data); + } + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/LongRunningOperation/SapVirtualInstanceOperationSource.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/LongRunningOperation/SapVirtualInstanceOperationSource.cs new file mode 100644 index 000000000000..02fa7ad0a4b4 --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/LongRunningOperation/SapVirtualInstanceOperationSource.cs @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; + +namespace Azure.ResourceManager.SapVirtualInstances +{ + internal class SapVirtualInstanceOperationSource : IOperationSource + { + private readonly ArmClient _client; + + internal SapVirtualInstanceOperationSource(ArmClient client) + { + _client = client; + } + + SapVirtualInstanceResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) + { + using var document = JsonDocument.Parse(response.ContentStream); + var data = SapVirtualInstanceData.DeserializeSapVirtualInstanceData(document.RootElement); + return new SapVirtualInstanceResource(_client, data); + } + + async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) + { + using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false); + var data = SapVirtualInstanceData.DeserializeSapVirtualInstanceData(document.RootElement); + return new SapVirtualInstanceResource(_client, data); + } + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/LongRunningOperation/SapVirtualInstancesArmOperation.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/LongRunningOperation/SapVirtualInstancesArmOperation.cs new file mode 100644 index 000000000000..36f0f8397130 --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/LongRunningOperation/SapVirtualInstancesArmOperation.cs @@ -0,0 +1,94 @@ +// 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.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.SapVirtualInstances +{ +#pragma warning disable SA1649 // File name should match first type name + internal class SapVirtualInstancesArmOperation : ArmOperation +#pragma warning restore SA1649 // File name should match first type name + { + private readonly OperationInternal _operation; + private readonly RehydrationToken? _completeRehydrationToken; + private readonly NextLinkOperationImplementation _nextLinkOperation; + private readonly string _operationId; + + /// Initializes a new instance of SapVirtualInstancesArmOperation for mocking. + protected SapVirtualInstancesArmOperation() + { + } + + internal SapVirtualInstancesArmOperation(Response response, RehydrationToken? rehydrationToken = null) + { + _operation = OperationInternal.Succeeded(response); + _completeRehydrationToken = rehydrationToken; + _operationId = GetOperationId(rehydrationToken); + } + + internal SapVirtualInstancesArmOperation(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, Request request, Response response, OperationFinalStateVia finalStateVia, bool skipApiVersionOverride = false, string apiVersionOverrideValue = null) + { + var nextLinkOperation = NextLinkOperationImplementation.Create(pipeline, request.Method, request.Uri.ToUri(), response, finalStateVia, skipApiVersionOverride, apiVersionOverrideValue); + if (nextLinkOperation is NextLinkOperationImplementation nextLinkOperationValue) + { + _nextLinkOperation = nextLinkOperationValue; + _operationId = _nextLinkOperation.OperationId; + } + else + { + _completeRehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(request.Method, request.Uri.ToUri(), response, finalStateVia); + _operationId = GetOperationId(_completeRehydrationToken); + } + _operation = new OperationInternal(nextLinkOperation, clientDiagnostics, response, "SapVirtualInstancesArmOperation", fallbackStrategy: new SequentialDelayStrategy()); + } + + private string GetOperationId(RehydrationToken? rehydrationToken) + { + if (rehydrationToken is null) + { + return null; + } + var lroDetails = ModelReaderWriter.Write(rehydrationToken, ModelReaderWriterOptions.Json).ToObjectFromJson>(); + return lroDetails["id"]; + } + /// + public override string Id => _operationId ?? NextLinkOperationImplementation.NotSet; + + /// + public override RehydrationToken? GetRehydrationToken() => _nextLinkOperation?.GetRehydrationToken() ?? _completeRehydrationToken; + + /// + public override bool HasCompleted => _operation.HasCompleted; + + /// + public override Response GetRawResponse() => _operation.RawResponse; + + /// + public override Response UpdateStatus(CancellationToken cancellationToken = default) => _operation.UpdateStatus(cancellationToken); + + /// + public override ValueTask UpdateStatusAsync(CancellationToken cancellationToken = default) => _operation.UpdateStatusAsync(cancellationToken); + + /// + public override Response WaitForCompletionResponse(CancellationToken cancellationToken = default) => _operation.WaitForCompletionResponse(cancellationToken); + + /// + public override Response WaitForCompletionResponse(TimeSpan pollingInterval, CancellationToken cancellationToken = default) => _operation.WaitForCompletionResponse(pollingInterval, cancellationToken); + + /// + public override ValueTask WaitForCompletionResponseAsync(CancellationToken cancellationToken = default) => _operation.WaitForCompletionResponseAsync(cancellationToken); + + /// + public override ValueTask WaitForCompletionResponseAsync(TimeSpan pollingInterval, CancellationToken cancellationToken = default) => _operation.WaitForCompletionResponseAsync(pollingInterval, cancellationToken); + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/LongRunningOperation/SapVirtualInstancesArmOperationOfT.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/LongRunningOperation/SapVirtualInstancesArmOperationOfT.cs new file mode 100644 index 000000000000..ca203c47d1af --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/LongRunningOperation/SapVirtualInstancesArmOperationOfT.cs @@ -0,0 +1,100 @@ +// 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.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.SapVirtualInstances +{ +#pragma warning disable SA1649 // File name should match first type name + internal class SapVirtualInstancesArmOperation : ArmOperation +#pragma warning restore SA1649 // File name should match first type name + { + private readonly OperationInternal _operation; + private readonly RehydrationToken? _completeRehydrationToken; + private readonly NextLinkOperationImplementation _nextLinkOperation; + private readonly string _operationId; + + /// Initializes a new instance of SapVirtualInstancesArmOperation for mocking. + protected SapVirtualInstancesArmOperation() + { + } + + internal SapVirtualInstancesArmOperation(Response response, RehydrationToken? rehydrationToken = null) + { + _operation = OperationInternal.Succeeded(response.GetRawResponse(), response.Value); + _completeRehydrationToken = rehydrationToken; + _operationId = GetOperationId(rehydrationToken); + } + + internal SapVirtualInstancesArmOperation(IOperationSource source, ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, Request request, Response response, OperationFinalStateVia finalStateVia, bool skipApiVersionOverride = false, string apiVersionOverrideValue = null) + { + var nextLinkOperation = NextLinkOperationImplementation.Create(pipeline, request.Method, request.Uri.ToUri(), response, finalStateVia, skipApiVersionOverride, apiVersionOverrideValue); + if (nextLinkOperation is NextLinkOperationImplementation nextLinkOperationValue) + { + _nextLinkOperation = nextLinkOperationValue; + _operationId = _nextLinkOperation.OperationId; + } + else + { + _completeRehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(request.Method, request.Uri.ToUri(), response, finalStateVia); + _operationId = GetOperationId(_completeRehydrationToken); + } + _operation = new OperationInternal(NextLinkOperationImplementation.Create(source, nextLinkOperation), clientDiagnostics, response, "SapVirtualInstancesArmOperation", fallbackStrategy: new SequentialDelayStrategy()); + } + + private string GetOperationId(RehydrationToken? rehydrationToken) + { + if (rehydrationToken is null) + { + return null; + } + var lroDetails = ModelReaderWriter.Write(rehydrationToken, ModelReaderWriterOptions.Json).ToObjectFromJson>(); + return lroDetails["id"]; + } + /// + public override string Id => _operationId ?? NextLinkOperationImplementation.NotSet; + + /// + public override RehydrationToken? GetRehydrationToken() => _nextLinkOperation?.GetRehydrationToken() ?? _completeRehydrationToken; + + /// + public override T Value => _operation.Value; + + /// + public override bool HasValue => _operation.HasValue; + + /// + public override bool HasCompleted => _operation.HasCompleted; + + /// + public override Response GetRawResponse() => _operation.RawResponse; + + /// + public override Response UpdateStatus(CancellationToken cancellationToken = default) => _operation.UpdateStatus(cancellationToken); + + /// + public override ValueTask UpdateStatusAsync(CancellationToken cancellationToken = default) => _operation.UpdateStatusAsync(cancellationToken); + + /// + public override Response WaitForCompletion(CancellationToken cancellationToken = default) => _operation.WaitForCompletion(cancellationToken); + + /// + public override Response WaitForCompletion(TimeSpan pollingInterval, CancellationToken cancellationToken = default) => _operation.WaitForCompletion(pollingInterval, cancellationToken); + + /// + public override ValueTask> WaitForCompletionAsync(CancellationToken cancellationToken = default) => _operation.WaitForCompletionAsync(cancellationToken); + + /// + public override ValueTask> WaitForCompletionAsync(TimeSpan pollingInterval, CancellationToken cancellationToken = default) => _operation.WaitForCompletionAsync(pollingInterval, cancellationToken); + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/ApplicationServerConfiguration.Serialization.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/ApplicationServerConfiguration.Serialization.cs new file mode 100644 index 000000000000..e41bb2c331cd --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/ApplicationServerConfiguration.Serialization.cs @@ -0,0 +1,142 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.SapVirtualInstances.Models +{ + public partial class ApplicationServerConfiguration : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ApplicationServerConfiguration)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("subnetId"u8); + writer.WriteStringValue(SubnetId); + writer.WritePropertyName("virtualMachineConfiguration"u8); + writer.WriteObjectValue(VirtualMachineConfiguration, options); + writer.WritePropertyName("instanceCount"u8); + writer.WriteNumberValue(InstanceCount); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + ApplicationServerConfiguration 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(ApplicationServerConfiguration)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeApplicationServerConfiguration(document.RootElement, options); + } + + internal static ApplicationServerConfiguration DeserializeApplicationServerConfiguration(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string subnetId = default; + VirtualMachineConfiguration virtualMachineConfiguration = default; + long instanceCount = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("subnetId"u8)) + { + subnetId = property.Value.GetString(); + continue; + } + if (property.NameEquals("virtualMachineConfiguration"u8)) + { + virtualMachineConfiguration = VirtualMachineConfiguration.DeserializeVirtualMachineConfiguration(property.Value, options); + continue; + } + if (property.NameEquals("instanceCount"u8)) + { + instanceCount = property.Value.GetInt64(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ApplicationServerConfiguration(subnetId, virtualMachineConfiguration, instanceCount, 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(ApplicationServerConfiguration)} does not support writing '{options.Format}' format."); + } + } + + ApplicationServerConfiguration IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeApplicationServerConfiguration(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ApplicationServerConfiguration)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/ApplicationServerConfiguration.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/ApplicationServerConfiguration.cs new file mode 100644 index 000000000000..f21ab55ca189 --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/ApplicationServerConfiguration.cs @@ -0,0 +1,88 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.SapVirtualInstances.Models +{ + /// Gets or sets the application server configuration. + public partial class ApplicationServerConfiguration + { + /// + /// 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 subnet id. + /// Gets or sets the virtual machine configuration. + /// The number of app server instances. + /// or is null. + public ApplicationServerConfiguration(string subnetId, VirtualMachineConfiguration virtualMachineConfiguration, long instanceCount) + { + Argument.AssertNotNull(subnetId, nameof(subnetId)); + Argument.AssertNotNull(virtualMachineConfiguration, nameof(virtualMachineConfiguration)); + + SubnetId = subnetId; + VirtualMachineConfiguration = virtualMachineConfiguration; + InstanceCount = instanceCount; + } + + /// Initializes a new instance of . + /// The subnet id. + /// Gets or sets the virtual machine configuration. + /// The number of app server instances. + /// Keeps track of any properties unknown to the library. + internal ApplicationServerConfiguration(string subnetId, VirtualMachineConfiguration virtualMachineConfiguration, long instanceCount, IDictionary serializedAdditionalRawData) + { + SubnetId = subnetId; + VirtualMachineConfiguration = virtualMachineConfiguration; + InstanceCount = instanceCount; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal ApplicationServerConfiguration() + { + } + + /// The subnet id. + public string SubnetId { get; set; } + /// Gets or sets the virtual machine configuration. + public VirtualMachineConfiguration VirtualMachineConfiguration { get; set; } + /// The number of app server instances. + public long InstanceCount { get; set; } + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/ApplicationServerFullResourceNames.Serialization.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/ApplicationServerFullResourceNames.Serialization.cs new file mode 100644 index 000000000000..48dfea2666f5 --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/ApplicationServerFullResourceNames.Serialization.cs @@ -0,0 +1,154 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.SapVirtualInstances.Models +{ + public partial class ApplicationServerFullResourceNames : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ApplicationServerFullResourceNames)} does not support writing '{format}' format."); + } + + if (Optional.IsCollectionDefined(VirtualMachines)) + { + writer.WritePropertyName("virtualMachines"u8); + writer.WriteStartArray(); + foreach (var item in VirtualMachines) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(AvailabilitySetName)) + { + writer.WritePropertyName("availabilitySetName"u8); + writer.WriteStringValue(AvailabilitySetName); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + ApplicationServerFullResourceNames 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(ApplicationServerFullResourceNames)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeApplicationServerFullResourceNames(document.RootElement, options); + } + + internal static ApplicationServerFullResourceNames DeserializeApplicationServerFullResourceNames(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IList virtualMachines = default; + string availabilitySetName = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("virtualMachines"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(VirtualMachineResourceNames.DeserializeVirtualMachineResourceNames(item, options)); + } + virtualMachines = array; + continue; + } + if (property.NameEquals("availabilitySetName"u8)) + { + availabilitySetName = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ApplicationServerFullResourceNames(virtualMachines ?? new ChangeTrackingList(), availabilitySetName, 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(ApplicationServerFullResourceNames)} does not support writing '{options.Format}' format."); + } + } + + ApplicationServerFullResourceNames IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeApplicationServerFullResourceNames(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ApplicationServerFullResourceNames)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/ApplicationServerFullResourceNames.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/ApplicationServerFullResourceNames.cs new file mode 100644 index 000000000000..2684ded71ef5 --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/ApplicationServerFullResourceNames.cs @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.SapVirtualInstances.Models +{ + /// The full resource names object for application layer resources. The number of entries in this list should be equal to the number VMs to be created for application layer. + public partial class ApplicationServerFullResourceNames + { + /// + /// 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 ApplicationServerFullResourceNames() + { + VirtualMachines = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// The list of virtual machine naming details. + /// The full name for availability set. In case name is not provided, it will be defaulted to {SID}-App-AvSet. + /// Keeps track of any properties unknown to the library. + internal ApplicationServerFullResourceNames(IList virtualMachines, string availabilitySetName, IDictionary serializedAdditionalRawData) + { + VirtualMachines = virtualMachines; + AvailabilitySetName = availabilitySetName; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The list of virtual machine naming details. + public IList VirtualMachines { get; } + /// The full name for availability set. In case name is not provided, it will be defaulted to {SID}-App-AvSet. + public string AvailabilitySetName { get; set; } + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/ApplicationServerVirtualMachineType.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/ApplicationServerVirtualMachineType.cs new file mode 100644 index 000000000000..67767c76873c --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/ApplicationServerVirtualMachineType.cs @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.SapVirtualInstances.Models +{ + /// Defines the type of application server VM. + public readonly partial struct ApplicationServerVirtualMachineType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public ApplicationServerVirtualMachineType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string ActiveValue = "Active"; + private const string StandbyValue = "Standby"; + private const string UnknownValue = "Unknown"; + + /// Active Application server vm type. + public static ApplicationServerVirtualMachineType Active { get; } = new ApplicationServerVirtualMachineType(ActiveValue); + /// Standby Application server vm type. + public static ApplicationServerVirtualMachineType Standby { get; } = new ApplicationServerVirtualMachineType(StandbyValue); + /// Unknown Application server vm type. + public static ApplicationServerVirtualMachineType Unknown { get; } = new ApplicationServerVirtualMachineType(UnknownValue); + /// Determines if two values are the same. + public static bool operator ==(ApplicationServerVirtualMachineType left, ApplicationServerVirtualMachineType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(ApplicationServerVirtualMachineType left, ApplicationServerVirtualMachineType right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator ApplicationServerVirtualMachineType(string value) => new ApplicationServerVirtualMachineType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is ApplicationServerVirtualMachineType other && Equals(other); + /// + public bool Equals(ApplicationServerVirtualMachineType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/ApplicationServerVmDetails.Serialization.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/ApplicationServerVmDetails.Serialization.cs new file mode 100644 index 000000000000..45b6de179310 --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/ApplicationServerVmDetails.Serialization.cs @@ -0,0 +1,170 @@ +// 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.Resources.Models; + +namespace Azure.ResourceManager.SapVirtualInstances.Models +{ + public partial class ApplicationServerVmDetails : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ApplicationServerVmDetails)} does not support writing '{format}' format."); + } + + if (options.Format != "W" && Optional.IsDefined(Type)) + { + writer.WritePropertyName("type"u8); + writer.WriteStringValue(Type.Value.ToString()); + } + if (options.Format != "W" && Optional.IsDefined(VirtualMachineId)) + { + writer.WritePropertyName("virtualMachineId"u8); + writer.WriteStringValue(VirtualMachineId); + } + if (options.Format != "W" && Optional.IsCollectionDefined(StorageDetails)) + { + writer.WritePropertyName("storageDetails"u8); + writer.WriteStartArray(); + foreach (var item in StorageDetails) + { + JsonSerializer.Serialize(writer, item); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + ApplicationServerVmDetails 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(ApplicationServerVmDetails)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeApplicationServerVmDetails(document.RootElement, options); + } + + internal static ApplicationServerVmDetails DeserializeApplicationServerVmDetails(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ApplicationServerVirtualMachineType? type = default; + string virtualMachineId = default; + IReadOnlyList storageDetails = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("type"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + type = new ApplicationServerVirtualMachineType(property.Value.GetString()); + continue; + } + if (property.NameEquals("virtualMachineId"u8)) + { + virtualMachineId = property.Value.GetString(); + continue; + } + if (property.NameEquals("storageDetails"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(JsonSerializer.Deserialize(item.GetRawText())); + } + storageDetails = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ApplicationServerVmDetails(type, virtualMachineId, storageDetails ?? new ChangeTrackingList(), serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ApplicationServerVmDetails)} does not support writing '{options.Format}' format."); + } + } + + ApplicationServerVmDetails IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeApplicationServerVmDetails(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ApplicationServerVmDetails)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/ApplicationServerVmDetails.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/ApplicationServerVmDetails.cs new file mode 100644 index 000000000000..e6ca6f6ac72e --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/ApplicationServerVmDetails.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.ResourceManager.Resources.Models; + +namespace Azure.ResourceManager.SapVirtualInstances.Models +{ + /// The Application Server VM Details. + public partial class ApplicationServerVmDetails + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + internal ApplicationServerVmDetails() + { + StorageDetails = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// Defines the type of application server VM. + /// The virtual machine id. + /// Storage details of all the Storage Accounts attached to the App Virtual Machine. For e.g. NFS on AFS Shared Storage. + /// Keeps track of any properties unknown to the library. + internal ApplicationServerVmDetails(ApplicationServerVirtualMachineType? type, string virtualMachineId, IReadOnlyList storageDetails, IDictionary serializedAdditionalRawData) + { + Type = type; + VirtualMachineId = virtualMachineId; + StorageDetails = storageDetails; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Defines the type of application server VM. + public ApplicationServerVirtualMachineType? Type { get; } + /// The virtual machine id. + public string VirtualMachineId { get; } + /// Storage details of all the Storage Accounts attached to the App Virtual Machine. For e.g. NFS on AFS Shared Storage. + public IReadOnlyList StorageDetails { get; } + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/CentralServerConfiguration.Serialization.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/CentralServerConfiguration.Serialization.cs new file mode 100644 index 000000000000..ae0e4029986d --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/CentralServerConfiguration.Serialization.cs @@ -0,0 +1,142 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.SapVirtualInstances.Models +{ + public partial class CentralServerConfiguration : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(CentralServerConfiguration)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("subnetId"u8); + writer.WriteStringValue(SubnetId); + writer.WritePropertyName("virtualMachineConfiguration"u8); + writer.WriteObjectValue(VirtualMachineConfiguration, options); + writer.WritePropertyName("instanceCount"u8); + writer.WriteNumberValue(InstanceCount); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + CentralServerConfiguration 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(CentralServerConfiguration)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeCentralServerConfiguration(document.RootElement, options); + } + + internal static CentralServerConfiguration DeserializeCentralServerConfiguration(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string subnetId = default; + VirtualMachineConfiguration virtualMachineConfiguration = default; + long instanceCount = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("subnetId"u8)) + { + subnetId = property.Value.GetString(); + continue; + } + if (property.NameEquals("virtualMachineConfiguration"u8)) + { + virtualMachineConfiguration = VirtualMachineConfiguration.DeserializeVirtualMachineConfiguration(property.Value, options); + continue; + } + if (property.NameEquals("instanceCount"u8)) + { + instanceCount = property.Value.GetInt64(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new CentralServerConfiguration(subnetId, virtualMachineConfiguration, instanceCount, 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(CentralServerConfiguration)} does not support writing '{options.Format}' format."); + } + } + + CentralServerConfiguration IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeCentralServerConfiguration(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(CentralServerConfiguration)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/CentralServerConfiguration.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/CentralServerConfiguration.cs new file mode 100644 index 000000000000..53b7f9ec28b2 --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/CentralServerConfiguration.cs @@ -0,0 +1,88 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.SapVirtualInstances.Models +{ + /// Gets or sets the central server configuration. + public partial class CentralServerConfiguration + { + /// + /// 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 subnet id. + /// Gets or sets the virtual machine configuration. + /// The number of central server VMs. + /// or is null. + public CentralServerConfiguration(string subnetId, VirtualMachineConfiguration virtualMachineConfiguration, long instanceCount) + { + Argument.AssertNotNull(subnetId, nameof(subnetId)); + Argument.AssertNotNull(virtualMachineConfiguration, nameof(virtualMachineConfiguration)); + + SubnetId = subnetId; + VirtualMachineConfiguration = virtualMachineConfiguration; + InstanceCount = instanceCount; + } + + /// Initializes a new instance of . + /// The subnet id. + /// Gets or sets the virtual machine configuration. + /// The number of central server VMs. + /// Keeps track of any properties unknown to the library. + internal CentralServerConfiguration(string subnetId, VirtualMachineConfiguration virtualMachineConfiguration, long instanceCount, IDictionary serializedAdditionalRawData) + { + SubnetId = subnetId; + VirtualMachineConfiguration = virtualMachineConfiguration; + InstanceCount = instanceCount; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal CentralServerConfiguration() + { + } + + /// The subnet id. + public string SubnetId { get; set; } + /// Gets or sets the virtual machine configuration. + public VirtualMachineConfiguration VirtualMachineConfiguration { get; set; } + /// The number of central server VMs. + public long InstanceCount { get; set; } + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/CentralServerFullResourceNames.Serialization.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/CentralServerFullResourceNames.Serialization.cs new file mode 100644 index 000000000000..ed5c1a680adf --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/CentralServerFullResourceNames.Serialization.cs @@ -0,0 +1,169 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.SapVirtualInstances.Models +{ + public partial class CentralServerFullResourceNames : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(CentralServerFullResourceNames)} does not support writing '{format}' format."); + } + + if (Optional.IsCollectionDefined(VirtualMachines)) + { + writer.WritePropertyName("virtualMachines"u8); + writer.WriteStartArray(); + foreach (var item in VirtualMachines) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(AvailabilitySetName)) + { + writer.WritePropertyName("availabilitySetName"u8); + writer.WriteStringValue(AvailabilitySetName); + } + if (Optional.IsDefined(LoadBalancer)) + { + writer.WritePropertyName("loadBalancer"u8); + writer.WriteObjectValue(LoadBalancer, options); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + CentralServerFullResourceNames 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(CentralServerFullResourceNames)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeCentralServerFullResourceNames(document.RootElement, options); + } + + internal static CentralServerFullResourceNames DeserializeCentralServerFullResourceNames(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IList virtualMachines = default; + string availabilitySetName = default; + LoadBalancerResourceNames loadBalancer = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("virtualMachines"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(VirtualMachineResourceNames.DeserializeVirtualMachineResourceNames(item, options)); + } + virtualMachines = array; + continue; + } + if (property.NameEquals("availabilitySetName"u8)) + { + availabilitySetName = property.Value.GetString(); + continue; + } + if (property.NameEquals("loadBalancer"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + loadBalancer = LoadBalancerResourceNames.DeserializeLoadBalancerResourceNames(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new CentralServerFullResourceNames(virtualMachines ?? new ChangeTrackingList(), availabilitySetName, loadBalancer, 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(CentralServerFullResourceNames)} does not support writing '{options.Format}' format."); + } + } + + CentralServerFullResourceNames IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeCentralServerFullResourceNames(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(CentralServerFullResourceNames)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/CentralServerFullResourceNames.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/CentralServerFullResourceNames.cs new file mode 100644 index 000000000000..dbfcd78a10e8 --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/CentralServerFullResourceNames.cs @@ -0,0 +1,74 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.SapVirtualInstances.Models +{ + /// The full resource names object for central server layer resources. + public partial class CentralServerFullResourceNames + { + /// + /// 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 CentralServerFullResourceNames() + { + VirtualMachines = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// The list of names for all ASCS virtual machines to be deployed. The number of entries in this list should be equal to the number VMs to be created for ASCS layer. At maximum, there can be two virtual machines at this layer: ASCS and ERS. + /// The full name for availability set. In case name is not provided, it will be defaulted to {SID}-ASCS-AvSet. + /// The resource names object for load balancer and related resources. + /// Keeps track of any properties unknown to the library. + internal CentralServerFullResourceNames(IList virtualMachines, string availabilitySetName, LoadBalancerResourceNames loadBalancer, IDictionary serializedAdditionalRawData) + { + VirtualMachines = virtualMachines; + AvailabilitySetName = availabilitySetName; + LoadBalancer = loadBalancer; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The list of names for all ASCS virtual machines to be deployed. The number of entries in this list should be equal to the number VMs to be created for ASCS layer. At maximum, there can be two virtual machines at this layer: ASCS and ERS. + public IList VirtualMachines { get; } + /// The full name for availability set. In case name is not provided, it will be defaulted to {SID}-ASCS-AvSet. + public string AvailabilitySetName { get; set; } + /// The resource names object for load balancer and related resources. + public LoadBalancerResourceNames LoadBalancer { get; set; } + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/CentralServerVirtualMachineType.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/CentralServerVirtualMachineType.cs new file mode 100644 index 000000000000..49877dfa61b0 --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/CentralServerVirtualMachineType.cs @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.SapVirtualInstances.Models +{ + /// Defines the type of central server VM. + public readonly partial struct CentralServerVirtualMachineType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public CentralServerVirtualMachineType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string PrimaryValue = "Primary"; + private const string SecondaryValue = "Secondary"; + private const string UnknownValue = "Unknown"; + private const string ASCSValue = "ASCS"; + private const string ERSInactiveValue = "ERSInactive"; + private const string ERSValue = "ERS"; + private const string StandbyValue = "Standby"; + + /// Primary central server vm. + public static CentralServerVirtualMachineType Primary { get; } = new CentralServerVirtualMachineType(PrimaryValue); + /// Secondary central server vm. + public static CentralServerVirtualMachineType Secondary { get; } = new CentralServerVirtualMachineType(SecondaryValue); + /// Central server vm type unknown. + public static CentralServerVirtualMachineType Unknown { get; } = new CentralServerVirtualMachineType(UnknownValue); + /// ASCS Central server vm type. + public static CentralServerVirtualMachineType ASCS { get; } = new CentralServerVirtualMachineType(ASCSValue); + /// ERSInactive Central server vm type. + public static CentralServerVirtualMachineType ERSInactive { get; } = new CentralServerVirtualMachineType(ERSInactiveValue); + /// ERS Central server vm type. + public static CentralServerVirtualMachineType ERS { get; } = new CentralServerVirtualMachineType(ERSValue); + /// Standby Central server vm type. + public static CentralServerVirtualMachineType Standby { get; } = new CentralServerVirtualMachineType(StandbyValue); + /// Determines if two values are the same. + public static bool operator ==(CentralServerVirtualMachineType left, CentralServerVirtualMachineType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(CentralServerVirtualMachineType left, CentralServerVirtualMachineType right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator CentralServerVirtualMachineType(string value) => new CentralServerVirtualMachineType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is CentralServerVirtualMachineType other && Equals(other); + /// + public bool Equals(CentralServerVirtualMachineType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/CentralServerVmDetails.Serialization.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/CentralServerVmDetails.Serialization.cs new file mode 100644 index 000000000000..5a5ece362f2f --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/CentralServerVmDetails.Serialization.cs @@ -0,0 +1,170 @@ +// 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.Resources.Models; + +namespace Azure.ResourceManager.SapVirtualInstances.Models +{ + public partial class CentralServerVmDetails : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(CentralServerVmDetails)} does not support writing '{format}' format."); + } + + if (options.Format != "W" && Optional.IsDefined(Type)) + { + writer.WritePropertyName("type"u8); + writer.WriteStringValue(Type.Value.ToString()); + } + if (options.Format != "W" && Optional.IsDefined(VirtualMachineId)) + { + writer.WritePropertyName("virtualMachineId"u8); + writer.WriteStringValue(VirtualMachineId); + } + if (options.Format != "W" && Optional.IsCollectionDefined(StorageDetails)) + { + writer.WritePropertyName("storageDetails"u8); + writer.WriteStartArray(); + foreach (var item in StorageDetails) + { + JsonSerializer.Serialize(writer, item); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + CentralServerVmDetails 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(CentralServerVmDetails)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeCentralServerVmDetails(document.RootElement, options); + } + + internal static CentralServerVmDetails DeserializeCentralServerVmDetails(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + CentralServerVirtualMachineType? type = default; + string virtualMachineId = default; + IReadOnlyList storageDetails = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("type"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + type = new CentralServerVirtualMachineType(property.Value.GetString()); + continue; + } + if (property.NameEquals("virtualMachineId"u8)) + { + virtualMachineId = property.Value.GetString(); + continue; + } + if (property.NameEquals("storageDetails"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(JsonSerializer.Deserialize(item.GetRawText())); + } + storageDetails = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new CentralServerVmDetails(type, virtualMachineId, storageDetails ?? new ChangeTrackingList(), serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(CentralServerVmDetails)} does not support writing '{options.Format}' format."); + } + } + + CentralServerVmDetails IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeCentralServerVmDetails(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(CentralServerVmDetails)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/CentralServerVmDetails.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/CentralServerVmDetails.cs new file mode 100644 index 000000000000..626e32d3317b --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/CentralServerVmDetails.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.ResourceManager.Resources.Models; + +namespace Azure.ResourceManager.SapVirtualInstances.Models +{ + /// The SAP Central Services Instance VM details. + public partial class CentralServerVmDetails + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + internal CentralServerVmDetails() + { + StorageDetails = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// Defines the type of central server VM. + /// The virtual machine id. + /// Storage details of all the Storage Accounts attached to the ASCS Virtual Machine. For e.g. NFS on AFS Shared Storage. + /// Keeps track of any properties unknown to the library. + internal CentralServerVmDetails(CentralServerVirtualMachineType? type, string virtualMachineId, IReadOnlyList storageDetails, IDictionary serializedAdditionalRawData) + { + Type = type; + VirtualMachineId = virtualMachineId; + StorageDetails = storageDetails; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Defines the type of central server VM. + public CentralServerVirtualMachineType? Type { get; } + /// The virtual machine id. + public string VirtualMachineId { get; } + /// Storage details of all the Storage Accounts attached to the ASCS Virtual Machine. For e.g. NFS on AFS Shared Storage. + public IReadOnlyList StorageDetails { get; } + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/CreateAndMountFileShareConfiguration.Serialization.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/CreateAndMountFileShareConfiguration.Serialization.cs new file mode 100644 index 000000000000..21eb3e603547 --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/CreateAndMountFileShareConfiguration.Serialization.cs @@ -0,0 +1,132 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.SapVirtualInstances.Models +{ + public partial class CreateAndMountFileShareConfiguration : 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(CreateAndMountFileShareConfiguration)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (Optional.IsDefined(ResourceGroup)) + { + writer.WritePropertyName("resourceGroup"u8); + writer.WriteStringValue(ResourceGroup); + } + if (Optional.IsDefined(StorageAccountName)) + { + writer.WritePropertyName("storageAccountName"u8); + writer.WriteStringValue(StorageAccountName); + } + } + + CreateAndMountFileShareConfiguration 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(CreateAndMountFileShareConfiguration)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeCreateAndMountFileShareConfiguration(document.RootElement, options); + } + + internal static CreateAndMountFileShareConfiguration DeserializeCreateAndMountFileShareConfiguration(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string resourceGroup = default; + string storageAccountName = default; + FileShareConfigurationType configurationType = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("resourceGroup"u8)) + { + resourceGroup = property.Value.GetString(); + continue; + } + if (property.NameEquals("storageAccountName"u8)) + { + storageAccountName = property.Value.GetString(); + continue; + } + if (property.NameEquals("configurationType"u8)) + { + configurationType = new FileShareConfigurationType(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new CreateAndMountFileShareConfiguration(configurationType, serializedAdditionalRawData, resourceGroup, storageAccountName); + } + + 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(CreateAndMountFileShareConfiguration)} does not support writing '{options.Format}' format."); + } + } + + CreateAndMountFileShareConfiguration IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeCreateAndMountFileShareConfiguration(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(CreateAndMountFileShareConfiguration)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/CreateAndMountFileShareConfiguration.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/CreateAndMountFileShareConfiguration.cs new file mode 100644 index 000000000000..fc2dbbd2fecb --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/CreateAndMountFileShareConfiguration.cs @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.SapVirtualInstances.Models +{ + /// Gets or sets the file share configuration where the transport directory fileshare is created and mounted as a part of the create infra flow. Please pre-create the resource group you intend to place the transport directory in. The storage account and fileshare will be auto-created by the ACSS and doesn't need to be pre-created. + public partial class CreateAndMountFileShareConfiguration : FileShareConfiguration + { + /// Initializes a new instance of . + public CreateAndMountFileShareConfiguration() + { + ConfigurationType = FileShareConfigurationType.CreateAndMount; + } + + /// Initializes a new instance of . + /// The type of file share config, eg: Mount/CreateAndMount/Skip. + /// Keeps track of any properties unknown to the library. + /// The name of transport file share resource group. This should be pre created by the customer. The app rg is used in case of missing input. + /// The name of file share storage account name . A custom name is used in case of missing input. + internal CreateAndMountFileShareConfiguration(FileShareConfigurationType configurationType, IDictionary serializedAdditionalRawData, string resourceGroup, string storageAccountName) : base(configurationType, serializedAdditionalRawData) + { + ResourceGroup = resourceGroup; + StorageAccountName = storageAccountName; + ConfigurationType = configurationType; + } + + /// The name of transport file share resource group. This should be pre created by the customer. The app rg is used in case of missing input. + public string ResourceGroup { get; set; } + /// The name of file share storage account name . A custom name is used in case of missing input. + public string StorageAccountName { get; set; } + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/DatabaseConfiguration.Serialization.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/DatabaseConfiguration.Serialization.cs new file mode 100644 index 000000000000..3fd349895ade --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/DatabaseConfiguration.Serialization.cs @@ -0,0 +1,178 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.SapVirtualInstances.Models +{ + public partial class DatabaseConfiguration : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DatabaseConfiguration)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(DatabaseType)) + { + writer.WritePropertyName("databaseType"u8); + writer.WriteStringValue(DatabaseType.Value.ToString()); + } + writer.WritePropertyName("subnetId"u8); + writer.WriteStringValue(SubnetId); + writer.WritePropertyName("virtualMachineConfiguration"u8); + writer.WriteObjectValue(VirtualMachineConfiguration, options); + writer.WritePropertyName("instanceCount"u8); + writer.WriteNumberValue(InstanceCount); + if (Optional.IsDefined(DiskConfiguration)) + { + writer.WritePropertyName("diskConfiguration"u8); + writer.WriteObjectValue(DiskConfiguration, options); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + DatabaseConfiguration 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(DatabaseConfiguration)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDatabaseConfiguration(document.RootElement, options); + } + + internal static DatabaseConfiguration DeserializeDatabaseConfiguration(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + SapDatabaseType? databaseType = default; + string subnetId = default; + VirtualMachineConfiguration virtualMachineConfiguration = default; + long instanceCount = default; + DiskConfiguration diskConfiguration = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("databaseType"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + databaseType = new SapDatabaseType(property.Value.GetString()); + continue; + } + if (property.NameEquals("subnetId"u8)) + { + subnetId = property.Value.GetString(); + continue; + } + if (property.NameEquals("virtualMachineConfiguration"u8)) + { + virtualMachineConfiguration = VirtualMachineConfiguration.DeserializeVirtualMachineConfiguration(property.Value, options); + continue; + } + if (property.NameEquals("instanceCount"u8)) + { + instanceCount = property.Value.GetInt64(); + continue; + } + if (property.NameEquals("diskConfiguration"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + diskConfiguration = DiskConfiguration.DeserializeDiskConfiguration(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DatabaseConfiguration( + databaseType, + subnetId, + virtualMachineConfiguration, + instanceCount, + diskConfiguration, + 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(DatabaseConfiguration)} does not support writing '{options.Format}' format."); + } + } + + DatabaseConfiguration IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeDatabaseConfiguration(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DatabaseConfiguration)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/DatabaseConfiguration.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/DatabaseConfiguration.cs new file mode 100644 index 000000000000..69aee508d675 --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/DatabaseConfiguration.cs @@ -0,0 +1,106 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.SapVirtualInstances.Models +{ + /// Gets or sets the database configuration. + public partial class DatabaseConfiguration + { + /// + /// 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 subnet id. + /// Gets or sets the virtual machine configuration. + /// The number of database VMs. + /// or is null. + public DatabaseConfiguration(string subnetId, VirtualMachineConfiguration virtualMachineConfiguration, long instanceCount) + { + Argument.AssertNotNull(subnetId, nameof(subnetId)); + Argument.AssertNotNull(virtualMachineConfiguration, nameof(virtualMachineConfiguration)); + + SubnetId = subnetId; + VirtualMachineConfiguration = virtualMachineConfiguration; + InstanceCount = instanceCount; + } + + /// Initializes a new instance of . + /// The database type. + /// The subnet id. + /// Gets or sets the virtual machine configuration. + /// The number of database VMs. + /// Gets or sets the disk configuration. + /// Keeps track of any properties unknown to the library. + internal DatabaseConfiguration(SapDatabaseType? databaseType, string subnetId, VirtualMachineConfiguration virtualMachineConfiguration, long instanceCount, DiskConfiguration diskConfiguration, IDictionary serializedAdditionalRawData) + { + DatabaseType = databaseType; + SubnetId = subnetId; + VirtualMachineConfiguration = virtualMachineConfiguration; + InstanceCount = instanceCount; + DiskConfiguration = diskConfiguration; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal DatabaseConfiguration() + { + } + + /// The database type. + public SapDatabaseType? DatabaseType { get; set; } + /// The subnet id. + public string SubnetId { get; set; } + /// Gets or sets the virtual machine configuration. + public VirtualMachineConfiguration VirtualMachineConfiguration { get; set; } + /// The number of database VMs. + public long InstanceCount { get; set; } + /// Gets or sets the disk configuration. + internal DiskConfiguration DiskConfiguration { get; set; } + /// The disk configuration for the db volume. For HANA, Required volumes are: ['hana/data', 'hana/log', hana/shared', 'usr/sap', 'os'], Optional volume : ['backup']. + public IDictionary DiskVolumeConfigurations + { + get + { + if (DiskConfiguration is null) + DiskConfiguration = new DiskConfiguration(); + return DiskConfiguration.DiskVolumeConfigurations; + } + } + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/DatabaseServerFullResourceNames.Serialization.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/DatabaseServerFullResourceNames.Serialization.cs new file mode 100644 index 000000000000..e6f3e2c1a6e5 --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/DatabaseServerFullResourceNames.Serialization.cs @@ -0,0 +1,169 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.SapVirtualInstances.Models +{ + public partial class DatabaseServerFullResourceNames : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DatabaseServerFullResourceNames)} does not support writing '{format}' format."); + } + + if (Optional.IsCollectionDefined(VirtualMachines)) + { + writer.WritePropertyName("virtualMachines"u8); + writer.WriteStartArray(); + foreach (var item in VirtualMachines) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(AvailabilitySetName)) + { + writer.WritePropertyName("availabilitySetName"u8); + writer.WriteStringValue(AvailabilitySetName); + } + if (Optional.IsDefined(LoadBalancer)) + { + writer.WritePropertyName("loadBalancer"u8); + writer.WriteObjectValue(LoadBalancer, options); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + DatabaseServerFullResourceNames 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(DatabaseServerFullResourceNames)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDatabaseServerFullResourceNames(document.RootElement, options); + } + + internal static DatabaseServerFullResourceNames DeserializeDatabaseServerFullResourceNames(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IList virtualMachines = default; + string availabilitySetName = default; + LoadBalancerResourceNames loadBalancer = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("virtualMachines"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(VirtualMachineResourceNames.DeserializeVirtualMachineResourceNames(item, options)); + } + virtualMachines = array; + continue; + } + if (property.NameEquals("availabilitySetName"u8)) + { + availabilitySetName = property.Value.GetString(); + continue; + } + if (property.NameEquals("loadBalancer"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + loadBalancer = LoadBalancerResourceNames.DeserializeLoadBalancerResourceNames(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DatabaseServerFullResourceNames(virtualMachines ?? new ChangeTrackingList(), availabilitySetName, loadBalancer, 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(DatabaseServerFullResourceNames)} does not support writing '{options.Format}' format."); + } + } + + DatabaseServerFullResourceNames IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeDatabaseServerFullResourceNames(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DatabaseServerFullResourceNames)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/DatabaseServerFullResourceNames.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/DatabaseServerFullResourceNames.cs new file mode 100644 index 000000000000..b2b72f89a779 --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/DatabaseServerFullResourceNames.cs @@ -0,0 +1,74 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.SapVirtualInstances.Models +{ + /// The full resource names object for database layer resources. The number of entries in this list should be equal to the number VMs to be created for database layer. + public partial class DatabaseServerFullResourceNames + { + /// + /// 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 DatabaseServerFullResourceNames() + { + VirtualMachines = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// The list of virtual machine naming details. + /// The full name for availability set. In case name is not provided, it will be defaulted to {SID}-DB-AvSet. + /// The resource names object for load balancer and related resources. + /// Keeps track of any properties unknown to the library. + internal DatabaseServerFullResourceNames(IList virtualMachines, string availabilitySetName, LoadBalancerResourceNames loadBalancer, IDictionary serializedAdditionalRawData) + { + VirtualMachines = virtualMachines; + AvailabilitySetName = availabilitySetName; + LoadBalancer = loadBalancer; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The list of virtual machine naming details. + public IList VirtualMachines { get; } + /// The full name for availability set. In case name is not provided, it will be defaulted to {SID}-DB-AvSet. + public string AvailabilitySetName { get; set; } + /// The resource names object for load balancer and related resources. + public LoadBalancerResourceNames LoadBalancer { get; set; } + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/DatabaseVmDetails.Serialization.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/DatabaseVmDetails.Serialization.cs new file mode 100644 index 000000000000..7038446499e2 --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/DatabaseVmDetails.Serialization.cs @@ -0,0 +1,170 @@ +// 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.Resources.Models; + +namespace Azure.ResourceManager.SapVirtualInstances.Models +{ + public partial class DatabaseVmDetails : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DatabaseVmDetails)} does not support writing '{format}' format."); + } + + if (options.Format != "W" && Optional.IsDefined(VirtualMachineId)) + { + writer.WritePropertyName("virtualMachineId"u8); + writer.WriteStringValue(VirtualMachineId); + } + if (options.Format != "W" && Optional.IsDefined(Status)) + { + writer.WritePropertyName("status"u8); + writer.WriteStringValue(Status.Value.ToString()); + } + if (options.Format != "W" && Optional.IsCollectionDefined(StorageDetails)) + { + writer.WritePropertyName("storageDetails"u8); + writer.WriteStartArray(); + foreach (var item in StorageDetails) + { + JsonSerializer.Serialize(writer, item); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + DatabaseVmDetails 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(DatabaseVmDetails)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDatabaseVmDetails(document.RootElement, options); + } + + internal static DatabaseVmDetails DeserializeDatabaseVmDetails(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string virtualMachineId = default; + SapVirtualInstanceStatus? status = default; + IReadOnlyList storageDetails = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("virtualMachineId"u8)) + { + virtualMachineId = property.Value.GetString(); + continue; + } + if (property.NameEquals("status"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + status = new SapVirtualInstanceStatus(property.Value.GetString()); + continue; + } + if (property.NameEquals("storageDetails"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(JsonSerializer.Deserialize(item.GetRawText())); + } + storageDetails = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DatabaseVmDetails(virtualMachineId, status, storageDetails ?? new ChangeTrackingList(), serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(DatabaseVmDetails)} does not support writing '{options.Format}' format."); + } + } + + DatabaseVmDetails IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeDatabaseVmDetails(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DatabaseVmDetails)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/DatabaseVmDetails.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/DatabaseVmDetails.cs new file mode 100644 index 000000000000..374863a609ff --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/DatabaseVmDetails.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.ResourceManager.Resources.Models; + +namespace Azure.ResourceManager.SapVirtualInstances.Models +{ + /// Database VM details. + public partial class DatabaseVmDetails + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + internal DatabaseVmDetails() + { + StorageDetails = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// The virtual machine id. + /// Defines the SAP Instance status. + /// Storage details of all the Storage Accounts attached to the Database Virtual Machine. For e.g. NFS on AFS Shared Storage. + /// Keeps track of any properties unknown to the library. + internal DatabaseVmDetails(string virtualMachineId, SapVirtualInstanceStatus? status, IReadOnlyList storageDetails, IDictionary serializedAdditionalRawData) + { + VirtualMachineId = virtualMachineId; + Status = status; + StorageDetails = storageDetails; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The virtual machine id. + public string VirtualMachineId { get; } + /// Defines the SAP Instance status. + public SapVirtualInstanceStatus? Status { get; } + /// Storage details of all the Storage Accounts attached to the Database Virtual Machine. For e.g. NFS on AFS Shared Storage. + public IReadOnlyList StorageDetails { get; } + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/DeployerVmPackages.Serialization.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/DeployerVmPackages.Serialization.cs new file mode 100644 index 000000000000..c0bfb4cd7fd2 --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/DeployerVmPackages.Serialization.cs @@ -0,0 +1,140 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.SapVirtualInstances.Models +{ + public partial class DeployerVmPackages : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DeployerVmPackages)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(Uri)) + { + writer.WritePropertyName("url"u8); + writer.WriteStringValue(Uri); + } + if (Optional.IsDefined(StorageAccountId)) + { + writer.WritePropertyName("storageAccountId"u8); + writer.WriteStringValue(StorageAccountId); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + DeployerVmPackages 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(DeployerVmPackages)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDeployerVmPackages(document.RootElement, options); + } + + internal static DeployerVmPackages DeserializeDeployerVmPackages(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string url = default; + string storageAccountId = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("url"u8)) + { + url = property.Value.GetString(); + continue; + } + if (property.NameEquals("storageAccountId"u8)) + { + storageAccountId = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DeployerVmPackages(url, storageAccountId, 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(DeployerVmPackages)} does not support writing '{options.Format}' format."); + } + } + + DeployerVmPackages IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeDeployerVmPackages(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DeployerVmPackages)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/DeployerVmPackages.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/DeployerVmPackages.cs new file mode 100644 index 000000000000..37d42b92156b --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/DeployerVmPackages.cs @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.SapVirtualInstances.Models +{ + /// Defines the url and storage account ID where deployer VM packages are uploaded. + public partial class DeployerVmPackages + { + /// + /// 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 DeployerVmPackages() + { + } + + /// Initializes a new instance of . + /// The URL to the deployer VM packages file. + /// The deployer VM packages storage account id. + /// Keeps track of any properties unknown to the library. + internal DeployerVmPackages(string uri, string storageAccountId, IDictionary serializedAdditionalRawData) + { + Uri = uri; + StorageAccountId = storageAccountId; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The URL to the deployer VM packages file. + public string Uri { get; set; } + /// The deployer VM packages storage account id. + public string StorageAccountId { get; set; } + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/DeploymentConfiguration.Serialization.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/DeploymentConfiguration.Serialization.cs new file mode 100644 index 000000000000..2b74d7ab6290 --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/DeploymentConfiguration.Serialization.cs @@ -0,0 +1,151 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.SapVirtualInstances.Models +{ + public partial class DeploymentConfiguration : 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(DeploymentConfiguration)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (Optional.IsDefined(AppLocation)) + { + writer.WritePropertyName("appLocation"u8); + writer.WriteStringValue(AppLocation); + } + if (Optional.IsDefined(InfrastructureConfiguration)) + { + writer.WritePropertyName("infrastructureConfiguration"u8); + writer.WriteObjectValue(InfrastructureConfiguration, options); + } + if (Optional.IsDefined(SoftwareConfiguration)) + { + writer.WritePropertyName("softwareConfiguration"u8); + writer.WriteObjectValue(SoftwareConfiguration, options); + } + } + + DeploymentConfiguration 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(DeploymentConfiguration)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDeploymentConfiguration(document.RootElement, options); + } + + internal static DeploymentConfiguration DeserializeDeploymentConfiguration(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string appLocation = default; + InfrastructureConfiguration infrastructureConfiguration = default; + SoftwareConfiguration softwareConfiguration = default; + SapConfigurationType configurationType = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("appLocation"u8)) + { + appLocation = property.Value.GetString(); + continue; + } + if (property.NameEquals("infrastructureConfiguration"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + infrastructureConfiguration = InfrastructureConfiguration.DeserializeInfrastructureConfiguration(property.Value, options); + continue; + } + if (property.NameEquals("softwareConfiguration"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + softwareConfiguration = SoftwareConfiguration.DeserializeSoftwareConfiguration(property.Value, options); + continue; + } + if (property.NameEquals("configurationType"u8)) + { + configurationType = new SapConfigurationType(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DeploymentConfiguration(configurationType, serializedAdditionalRawData, appLocation, infrastructureConfiguration, softwareConfiguration); + } + + 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(DeploymentConfiguration)} does not support writing '{options.Format}' format."); + } + } + + DeploymentConfiguration IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeDeploymentConfiguration(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DeploymentConfiguration)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/DeploymentConfiguration.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/DeploymentConfiguration.cs new file mode 100644 index 000000000000..0721863185e0 --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/DeploymentConfiguration.cs @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.SapVirtualInstances.Models +{ + /// Deployment Configuration. + public partial class DeploymentConfiguration : SapConfiguration + { + /// Initializes a new instance of . + public DeploymentConfiguration() + { + ConfigurationType = SapConfigurationType.Deployment; + } + + /// Initializes a new instance of . + /// The configuration type. Eg: Deployment/Discovery. + /// Keeps track of any properties unknown to the library. + /// The geo-location where the SAP system is to be created. + /// + /// The infrastructure configuration. + /// 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 . + /// + /// + /// The software configuration. + /// 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 . + /// + internal DeploymentConfiguration(SapConfigurationType configurationType, IDictionary serializedAdditionalRawData, string appLocation, InfrastructureConfiguration infrastructureConfiguration, SoftwareConfiguration softwareConfiguration) : base(configurationType, serializedAdditionalRawData) + { + AppLocation = appLocation; + InfrastructureConfiguration = infrastructureConfiguration; + SoftwareConfiguration = softwareConfiguration; + ConfigurationType = configurationType; + } + + /// The geo-location where the SAP system is to be created. + public string AppLocation { get; set; } + /// + /// The infrastructure configuration. + /// 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 . + /// + public InfrastructureConfiguration InfrastructureConfiguration { get; set; } + /// + /// The software configuration. + /// 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 . + /// + public SoftwareConfiguration SoftwareConfiguration { get; set; } + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/DeploymentWithOSConfiguration.Serialization.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/DeploymentWithOSConfiguration.Serialization.cs new file mode 100644 index 000000000000..dccb2765bd67 --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/DeploymentWithOSConfiguration.Serialization.cs @@ -0,0 +1,172 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.SapVirtualInstances.Models +{ + public partial class DeploymentWithOSConfiguration : 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(DeploymentWithOSConfiguration)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (Optional.IsDefined(AppLocation)) + { + writer.WritePropertyName("appLocation"u8); + writer.WriteStringValue(AppLocation); + } + if (Optional.IsDefined(InfrastructureConfiguration)) + { + writer.WritePropertyName("infrastructureConfiguration"u8); + writer.WriteObjectValue(InfrastructureConfiguration, options); + } + if (Optional.IsDefined(SoftwareConfiguration)) + { + writer.WritePropertyName("softwareConfiguration"u8); + writer.WriteObjectValue(SoftwareConfiguration, options); + } + if (Optional.IsDefined(OSSapConfiguration)) + { + writer.WritePropertyName("osSapConfiguration"u8); + writer.WriteObjectValue(OSSapConfiguration, options); + } + } + + DeploymentWithOSConfiguration 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(DeploymentWithOSConfiguration)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDeploymentWithOSConfiguration(document.RootElement, options); + } + + internal static DeploymentWithOSConfiguration DeserializeDeploymentWithOSConfiguration(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string appLocation = default; + InfrastructureConfiguration infrastructureConfiguration = default; + SoftwareConfiguration softwareConfiguration = default; + OSSapConfiguration osSapConfiguration = default; + SapConfigurationType configurationType = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("appLocation"u8)) + { + appLocation = property.Value.GetString(); + continue; + } + if (property.NameEquals("infrastructureConfiguration"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + infrastructureConfiguration = InfrastructureConfiguration.DeserializeInfrastructureConfiguration(property.Value, options); + continue; + } + if (property.NameEquals("softwareConfiguration"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + softwareConfiguration = SoftwareConfiguration.DeserializeSoftwareConfiguration(property.Value, options); + continue; + } + if (property.NameEquals("osSapConfiguration"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + osSapConfiguration = OSSapConfiguration.DeserializeOSSapConfiguration(property.Value, options); + continue; + } + if (property.NameEquals("configurationType"u8)) + { + configurationType = new SapConfigurationType(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DeploymentWithOSConfiguration( + configurationType, + serializedAdditionalRawData, + appLocation, + infrastructureConfiguration, + softwareConfiguration, + osSapConfiguration); + } + + 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(DeploymentWithOSConfiguration)} does not support writing '{options.Format}' format."); + } + } + + DeploymentWithOSConfiguration IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeDeploymentWithOSConfiguration(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DeploymentWithOSConfiguration)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/DeploymentWithOSConfiguration.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/DeploymentWithOSConfiguration.cs new file mode 100644 index 000000000000..224d0e3f3b25 --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/DeploymentWithOSConfiguration.cs @@ -0,0 +1,63 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.SapVirtualInstances.Models +{ + /// Deployment along with OS Configuration. + public partial class DeploymentWithOSConfiguration : SapConfiguration + { + /// Initializes a new instance of . + public DeploymentWithOSConfiguration() + { + ConfigurationType = SapConfigurationType.DeploymentWithOSConfig; + } + + /// Initializes a new instance of . + /// The configuration type. Eg: Deployment/Discovery. + /// Keeps track of any properties unknown to the library. + /// The geo-location where the SAP system is to be created. + /// + /// The infrastructure configuration. + /// 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 . + /// + /// + /// The software configuration. + /// 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 . + /// + /// The OS and SAP configuration. + internal DeploymentWithOSConfiguration(SapConfigurationType configurationType, IDictionary serializedAdditionalRawData, string appLocation, InfrastructureConfiguration infrastructureConfiguration, SoftwareConfiguration softwareConfiguration, OSSapConfiguration osSapConfiguration) : base(configurationType, serializedAdditionalRawData) + { + AppLocation = appLocation; + InfrastructureConfiguration = infrastructureConfiguration; + SoftwareConfiguration = softwareConfiguration; + OSSapConfiguration = osSapConfiguration; + ConfigurationType = configurationType; + } + + /// The geo-location where the SAP system is to be created. + public string AppLocation { get; set; } + /// + /// The infrastructure configuration. + /// 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 . + /// + public InfrastructureConfiguration InfrastructureConfiguration { get; set; } + /// + /// The software configuration. + /// 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 . + /// + public SoftwareConfiguration SoftwareConfiguration { get; set; } + /// The OS and SAP configuration. + public OSSapConfiguration OSSapConfiguration { get; set; } + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/DiscoveryConfiguration.Serialization.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/DiscoveryConfiguration.Serialization.cs new file mode 100644 index 000000000000..bb6e8cc752fe --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/DiscoveryConfiguration.Serialization.cs @@ -0,0 +1,143 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.SapVirtualInstances.Models +{ + public partial class DiscoveryConfiguration : 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(DiscoveryConfiguration)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (Optional.IsDefined(CentralServerVmId)) + { + writer.WritePropertyName("centralServerVmId"u8); + writer.WriteStringValue(CentralServerVmId); + } + if (Optional.IsDefined(ManagedRgStorageAccountName)) + { + writer.WritePropertyName("managedRgStorageAccountName"u8); + writer.WriteStringValue(ManagedRgStorageAccountName); + } + if (options.Format != "W" && Optional.IsDefined(AppLocation)) + { + writer.WritePropertyName("appLocation"u8); + writer.WriteStringValue(AppLocation); + } + } + + DiscoveryConfiguration 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(DiscoveryConfiguration)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDiscoveryConfiguration(document.RootElement, options); + } + + internal static DiscoveryConfiguration DeserializeDiscoveryConfiguration(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string centralServerVmId = default; + string managedRgStorageAccountName = default; + string appLocation = default; + SapConfigurationType configurationType = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("centralServerVmId"u8)) + { + centralServerVmId = property.Value.GetString(); + continue; + } + if (property.NameEquals("managedRgStorageAccountName"u8)) + { + managedRgStorageAccountName = property.Value.GetString(); + continue; + } + if (property.NameEquals("appLocation"u8)) + { + appLocation = property.Value.GetString(); + continue; + } + if (property.NameEquals("configurationType"u8)) + { + configurationType = new SapConfigurationType(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DiscoveryConfiguration(configurationType, serializedAdditionalRawData, centralServerVmId, managedRgStorageAccountName, appLocation); + } + + 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(DiscoveryConfiguration)} does not support writing '{options.Format}' format."); + } + } + + DiscoveryConfiguration IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeDiscoveryConfiguration(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DiscoveryConfiguration)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/DiscoveryConfiguration.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/DiscoveryConfiguration.cs new file mode 100644 index 000000000000..84ebbd127936 --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/DiscoveryConfiguration.cs @@ -0,0 +1,43 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.SapVirtualInstances.Models +{ + /// Discovery Details. + public partial class DiscoveryConfiguration : SapConfiguration + { + /// Initializes a new instance of . + public DiscoveryConfiguration() + { + ConfigurationType = SapConfigurationType.Discovery; + } + + /// Initializes a new instance of . + /// The configuration type. Eg: Deployment/Discovery. + /// Keeps track of any properties unknown to the library. + /// The virtual machine ID of the Central Server. + /// The custom storage account name for the storage account created by the service in the managed resource group created as part of VIS deployment.<br><br>Refer to the storage account naming rules [here](https://learn.microsoft.com/azure/azure-resource-manager/management/resource-name-rules#microsoftstorage).<br><br>If not provided, the service will create the storage account with a random name. + /// The geo-location where the SAP system exists. + internal DiscoveryConfiguration(SapConfigurationType configurationType, IDictionary serializedAdditionalRawData, string centralServerVmId, string managedRgStorageAccountName, string appLocation) : base(configurationType, serializedAdditionalRawData) + { + CentralServerVmId = centralServerVmId; + ManagedRgStorageAccountName = managedRgStorageAccountName; + AppLocation = appLocation; + ConfigurationType = configurationType; + } + + /// The virtual machine ID of the Central Server. + public string CentralServerVmId { get; set; } + /// The custom storage account name for the storage account created by the service in the managed resource group created as part of VIS deployment.<br><br>Refer to the storage account naming rules [here](https://learn.microsoft.com/azure/azure-resource-manager/management/resource-name-rules#microsoftstorage).<br><br>If not provided, the service will create the storage account with a random name. + public string ManagedRgStorageAccountName { get; set; } + /// The geo-location where the SAP system exists. + public string AppLocation { get; } + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/DiskConfiguration.Serialization.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/DiskConfiguration.Serialization.cs new file mode 100644 index 000000000000..c7288d092ad4 --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/DiskConfiguration.Serialization.cs @@ -0,0 +1,144 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.SapVirtualInstances.Models +{ + internal partial class DiskConfiguration : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DiskConfiguration)} does not support writing '{format}' format."); + } + + if (Optional.IsCollectionDefined(DiskVolumeConfigurations)) + { + writer.WritePropertyName("diskVolumeConfigurations"u8); + writer.WriteStartObject(); + foreach (var item in DiskVolumeConfigurations) + { + writer.WritePropertyName(item.Key); + writer.WriteObjectValue(item.Value, options); + } + writer.WriteEndObject(); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + DiskConfiguration 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(DiskConfiguration)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDiskConfiguration(document.RootElement, options); + } + + internal static DiskConfiguration DeserializeDiskConfiguration(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IDictionary diskVolumeConfigurations = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("diskVolumeConfigurations"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var property0 in property.Value.EnumerateObject()) + { + dictionary.Add(property0.Name, DiskVolumeConfiguration.DeserializeDiskVolumeConfiguration(property0.Value, options)); + } + diskVolumeConfigurations = dictionary; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DiskConfiguration(diskVolumeConfigurations ?? new ChangeTrackingDictionary(), 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(DiskConfiguration)} does not support writing '{options.Format}' format."); + } + } + + DiskConfiguration IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeDiskConfiguration(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DiskConfiguration)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/DiskConfiguration.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/DiskConfiguration.cs new file mode 100644 index 000000000000..acbc18a0e4fc --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/DiskConfiguration.cs @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.SapVirtualInstances.Models +{ + /// The Disk Configuration Details. + internal partial class DiskConfiguration + { + /// + /// 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 DiskConfiguration() + { + DiskVolumeConfigurations = new ChangeTrackingDictionary(); + } + + /// Initializes a new instance of . + /// The disk configuration for the db volume. For HANA, Required volumes are: ['hana/data', 'hana/log', hana/shared', 'usr/sap', 'os'], Optional volume : ['backup']. + /// Keeps track of any properties unknown to the library. + internal DiskConfiguration(IDictionary diskVolumeConfigurations, IDictionary serializedAdditionalRawData) + { + DiskVolumeConfigurations = diskVolumeConfigurations; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The disk configuration for the db volume. For HANA, Required volumes are: ['hana/data', 'hana/log', hana/shared', 'usr/sap', 'os'], Optional volume : ['backup']. + public IDictionary DiskVolumeConfigurations { get; } + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/DiskDetails.Serialization.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/DiskDetails.Serialization.cs new file mode 100644 index 000000000000..85e7bca85acf --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/DiskDetails.Serialization.cs @@ -0,0 +1,227 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.SapVirtualInstances.Models +{ + public partial class DiskDetails : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DiskDetails)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(Sku)) + { + writer.WritePropertyName("sku"u8); + writer.WriteObjectValue(Sku, options); + } + if (Optional.IsDefined(SizeGB)) + { + writer.WritePropertyName("sizeGB"u8); + writer.WriteNumberValue(SizeGB.Value); + } + if (Optional.IsDefined(MinimumSupportedDiskCount)) + { + writer.WritePropertyName("minimumSupportedDiskCount"u8); + writer.WriteNumberValue(MinimumSupportedDiskCount.Value); + } + if (Optional.IsDefined(MaximumSupportedDiskCount)) + { + writer.WritePropertyName("maximumSupportedDiskCount"u8); + writer.WriteNumberValue(MaximumSupportedDiskCount.Value); + } + if (Optional.IsDefined(IopsReadWrite)) + { + writer.WritePropertyName("iopsReadWrite"u8); + writer.WriteNumberValue(IopsReadWrite.Value); + } + if (Optional.IsDefined(MbpsReadWrite)) + { + writer.WritePropertyName("mbpsReadWrite"u8); + writer.WriteNumberValue(MbpsReadWrite.Value); + } + if (Optional.IsDefined(DiskTier)) + { + writer.WritePropertyName("diskTier"u8); + writer.WriteStringValue(DiskTier); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + DiskDetails 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(DiskDetails)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDiskDetails(document.RootElement, options); + } + + internal static DiskDetails DeserializeDiskDetails(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + DiskSku sku = default; + long? sizeGB = default; + long? minimumSupportedDiskCount = default; + long? maximumSupportedDiskCount = default; + long? iopsReadWrite = default; + long? mbpsReadWrite = default; + string diskTier = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("sku"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + sku = DiskSku.DeserializeDiskSku(property.Value, options); + continue; + } + if (property.NameEquals("sizeGB"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + sizeGB = property.Value.GetInt64(); + continue; + } + if (property.NameEquals("minimumSupportedDiskCount"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + minimumSupportedDiskCount = property.Value.GetInt64(); + continue; + } + if (property.NameEquals("maximumSupportedDiskCount"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + maximumSupportedDiskCount = property.Value.GetInt64(); + continue; + } + if (property.NameEquals("iopsReadWrite"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + iopsReadWrite = property.Value.GetInt64(); + continue; + } + if (property.NameEquals("mbpsReadWrite"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + mbpsReadWrite = property.Value.GetInt64(); + continue; + } + if (property.NameEquals("diskTier"u8)) + { + diskTier = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DiskDetails( + sku, + sizeGB, + minimumSupportedDiskCount, + maximumSupportedDiskCount, + iopsReadWrite, + mbpsReadWrite, + diskTier, + 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(DiskDetails)} does not support writing '{options.Format}' format."); + } + } + + DiskDetails IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeDiskDetails(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DiskDetails)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/DiskDetails.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/DiskDetails.cs new file mode 100644 index 000000000000..287917b944e9 --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/DiskDetails.cs @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.SapVirtualInstances.Models +{ + /// The supported disk size details for a disk type. + public partial class DiskDetails + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + internal DiskDetails() + { + } + + /// Initializes a new instance of . + /// The type of disk sku. For example, Standard_LRS, Standard_ZRS, Premium_LRS, Premium_ZRS. + /// The disk size in GB. + /// The minimum supported disk count. + /// The maximum supported disk count. + /// The disk Iops. + /// The disk provisioned throughput in MBps. + /// The disk tier, e.g. P10, E10. + /// Keeps track of any properties unknown to the library. + internal DiskDetails(DiskSku sku, long? sizeGB, long? minimumSupportedDiskCount, long? maximumSupportedDiskCount, long? iopsReadWrite, long? mbpsReadWrite, string diskTier, IDictionary serializedAdditionalRawData) + { + Sku = sku; + SizeGB = sizeGB; + MinimumSupportedDiskCount = minimumSupportedDiskCount; + MaximumSupportedDiskCount = maximumSupportedDiskCount; + IopsReadWrite = iopsReadWrite; + MbpsReadWrite = mbpsReadWrite; + DiskTier = diskTier; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The type of disk sku. For example, Standard_LRS, Standard_ZRS, Premium_LRS, Premium_ZRS. + internal DiskSku Sku { get; } + /// Defines the disk sku name. + public DiskSkuName? SkuName + { + get => Sku?.Name; + } + + /// The disk size in GB. + public long? SizeGB { get; } + /// The minimum supported disk count. + public long? MinimumSupportedDiskCount { get; } + /// The maximum supported disk count. + public long? MaximumSupportedDiskCount { get; } + /// The disk Iops. + public long? IopsReadWrite { get; } + /// The disk provisioned throughput in MBps. + public long? MbpsReadWrite { get; } + /// The disk tier, e.g. P10, E10. + public string DiskTier { get; } + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/DiskSku.Serialization.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/DiskSku.Serialization.cs new file mode 100644 index 000000000000..605a8db25228 --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/DiskSku.Serialization.cs @@ -0,0 +1,133 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.SapVirtualInstances.Models +{ + internal partial class DiskSku : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DiskSku)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(Name)) + { + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name.Value.ToString()); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + DiskSku 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(DiskSku)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDiskSku(document.RootElement, options); + } + + internal static DiskSku DeserializeDiskSku(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + DiskSkuName? name = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("name"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + name = new DiskSkuName(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DiskSku(name, 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(DiskSku)} does not support writing '{options.Format}' format."); + } + } + + DiskSku IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeDiskSku(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DiskSku)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/DiskSku.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/DiskSku.cs new file mode 100644 index 000000000000..60a805bbce3b --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/DiskSku.cs @@ -0,0 +1,65 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.SapVirtualInstances.Models +{ + /// The type of disk sku. For example, Standard_LRS, Standard_ZRS, Premium_LRS, Premium_ZRS. + internal partial class DiskSku + { + /// + /// 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 DiskSku() + { + } + + /// Initializes a new instance of . + /// Defines the disk sku name. + /// Keeps track of any properties unknown to the library. + internal DiskSku(DiskSkuName? name, IDictionary serializedAdditionalRawData) + { + Name = name; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Defines the disk sku name. + public DiskSkuName? Name { get; set; } + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/DiskSkuName.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/DiskSkuName.cs new file mode 100644 index 000000000000..63def1a37360 --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/DiskSkuName.cs @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.SapVirtualInstances.Models +{ + /// Defines the disk sku name. + public readonly partial struct DiskSkuName : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public DiskSkuName(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string StandardLRSValue = "Standard_LRS"; + private const string PremiumLRSValue = "Premium_LRS"; + private const string StandardSSDLRSValue = "StandardSSD_LRS"; + private const string UltraSSDLRSValue = "UltraSSD_LRS"; + private const string PremiumZRSValue = "Premium_ZRS"; + private const string StandardSSDZRSValue = "StandardSSD_ZRS"; + private const string PremiumV2LRSValue = "PremiumV2_LRS"; + + /// Standard LRS Disk SKU. + public static DiskSkuName StandardLRS { get; } = new DiskSkuName(StandardLRSValue); + /// Premium_LRS Disk SKU. + public static DiskSkuName PremiumLRS { get; } = new DiskSkuName(PremiumLRSValue); + /// StandardSSD_LRS Disk SKU. + public static DiskSkuName StandardSSDLRS { get; } = new DiskSkuName(StandardSSDLRSValue); + /// UltraSSD_LRS Disk SKU. + public static DiskSkuName UltraSSDLRS { get; } = new DiskSkuName(UltraSSDLRSValue); + /// Premium_ZRS Disk SKU. + public static DiskSkuName PremiumZRS { get; } = new DiskSkuName(PremiumZRSValue); + /// StandardSSD_ZRS Disk SKU. + public static DiskSkuName StandardSSDZRS { get; } = new DiskSkuName(StandardSSDZRSValue); + /// PremiumV2_LRS Disk SKU. + public static DiskSkuName PremiumV2LRS { get; } = new DiskSkuName(PremiumV2LRSValue); + /// Determines if two values are the same. + public static bool operator ==(DiskSkuName left, DiskSkuName right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(DiskSkuName left, DiskSkuName right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator DiskSkuName(string value) => new DiskSkuName(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is DiskSkuName other && Equals(other); + /// + public bool Equals(DiskSkuName other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/DiskVolumeConfiguration.Serialization.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/DiskVolumeConfiguration.Serialization.cs new file mode 100644 index 000000000000..a94f422c03da --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/DiskVolumeConfiguration.Serialization.cs @@ -0,0 +1,163 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.SapVirtualInstances.Models +{ + public partial class DiskVolumeConfiguration : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DiskVolumeConfiguration)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(Count)) + { + writer.WritePropertyName("count"u8); + writer.WriteNumberValue(Count.Value); + } + if (Optional.IsDefined(SizeGB)) + { + writer.WritePropertyName("sizeGB"u8); + writer.WriteNumberValue(SizeGB.Value); + } + if (Optional.IsDefined(Sku)) + { + writer.WritePropertyName("sku"u8); + writer.WriteObjectValue(Sku, options); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + DiskVolumeConfiguration 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(DiskVolumeConfiguration)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDiskVolumeConfiguration(document.RootElement, options); + } + + internal static DiskVolumeConfiguration DeserializeDiskVolumeConfiguration(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + long? count = default; + long? sizeGB = default; + DiskSku sku = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("count"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + count = property.Value.GetInt64(); + continue; + } + if (property.NameEquals("sizeGB"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + sizeGB = property.Value.GetInt64(); + continue; + } + if (property.NameEquals("sku"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + sku = DiskSku.DeserializeDiskSku(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DiskVolumeConfiguration(count, sizeGB, sku, 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(DiskVolumeConfiguration)} does not support writing '{options.Format}' format."); + } + } + + DiskVolumeConfiguration IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeDiskVolumeConfiguration(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DiskVolumeConfiguration)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/DiskVolumeConfiguration.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/DiskVolumeConfiguration.cs new file mode 100644 index 000000000000..2c23bc66fa35 --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/DiskVolumeConfiguration.cs @@ -0,0 +1,84 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.SapVirtualInstances.Models +{ + /// The disk configuration required for the selected volume. + public partial class DiskVolumeConfiguration + { + /// + /// 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 DiskVolumeConfiguration() + { + } + + /// Initializes a new instance of . + /// The total number of disks required for the concerned volume. + /// The disk size in GB. + /// The disk SKU details. + /// Keeps track of any properties unknown to the library. + internal DiskVolumeConfiguration(long? count, long? sizeGB, DiskSku sku, IDictionary serializedAdditionalRawData) + { + Count = count; + SizeGB = sizeGB; + Sku = sku; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The total number of disks required for the concerned volume. + public long? Count { get; set; } + /// The disk size in GB. + public long? SizeGB { get; set; } + /// The disk SKU details. + internal DiskSku Sku { get; set; } + /// Defines the disk sku name. + public DiskSkuName? SkuName + { + get => Sku is null ? default : Sku.Name; + set + { + if (Sku is null) + Sku = new DiskSku(); + Sku.Name = value; + } + } + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/EnqueueReplicationServerProperties.Serialization.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/EnqueueReplicationServerProperties.Serialization.cs new file mode 100644 index 000000000000..326a0ff0cf18 --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/EnqueueReplicationServerProperties.Serialization.cs @@ -0,0 +1,211 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.SapVirtualInstances.Models +{ + public partial class EnqueueReplicationServerProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(EnqueueReplicationServerProperties)} does not support writing '{format}' format."); + } + + if (options.Format != "W" && Optional.IsDefined(ErsVersion)) + { + writer.WritePropertyName("ersVersion"u8); + writer.WriteStringValue(ErsVersion.Value.ToString()); + } + if (options.Format != "W" && Optional.IsDefined(InstanceNo)) + { + writer.WritePropertyName("instanceNo"u8); + writer.WriteStringValue(InstanceNo); + } + if (options.Format != "W" && Optional.IsDefined(Hostname)) + { + writer.WritePropertyName("hostname"u8); + writer.WriteStringValue(Hostname); + } + if (options.Format != "W" && Optional.IsDefined(KernelVersion)) + { + writer.WritePropertyName("kernelVersion"u8); + writer.WriteStringValue(KernelVersion); + } + if (options.Format != "W" && Optional.IsDefined(KernelPatch)) + { + writer.WritePropertyName("kernelPatch"u8); + writer.WriteStringValue(KernelPatch); + } + if (options.Format != "W" && Optional.IsDefined(IPAddress)) + { + writer.WritePropertyName("ipAddress"u8); + writer.WriteStringValue(IPAddress); + } + if (options.Format != "W" && Optional.IsDefined(Health)) + { + writer.WritePropertyName("health"u8); + writer.WriteStringValue(Health.Value.ToString()); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + EnqueueReplicationServerProperties 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(EnqueueReplicationServerProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeEnqueueReplicationServerProperties(document.RootElement, options); + } + + internal static EnqueueReplicationServerProperties DeserializeEnqueueReplicationServerProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + EnqueueReplicationServerType? ersVersion = default; + string instanceNo = default; + string hostname = default; + string kernelVersion = default; + string kernelPatch = default; + string ipAddress = default; + SapHealthState? health = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("ersVersion"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + ersVersion = new EnqueueReplicationServerType(property.Value.GetString()); + continue; + } + if (property.NameEquals("instanceNo"u8)) + { + instanceNo = property.Value.GetString(); + continue; + } + if (property.NameEquals("hostname"u8)) + { + hostname = property.Value.GetString(); + continue; + } + if (property.NameEquals("kernelVersion"u8)) + { + kernelVersion = property.Value.GetString(); + continue; + } + if (property.NameEquals("kernelPatch"u8)) + { + kernelPatch = property.Value.GetString(); + continue; + } + if (property.NameEquals("ipAddress"u8)) + { + ipAddress = property.Value.GetString(); + continue; + } + if (property.NameEquals("health"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + health = new SapHealthState(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new EnqueueReplicationServerProperties( + ersVersion, + instanceNo, + hostname, + kernelVersion, + kernelPatch, + ipAddress, + health, + 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(EnqueueReplicationServerProperties)} does not support writing '{options.Format}' format."); + } + } + + EnqueueReplicationServerProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeEnqueueReplicationServerProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(EnqueueReplicationServerProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/EnqueueReplicationServerProperties.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/EnqueueReplicationServerProperties.cs new file mode 100644 index 000000000000..2a2556a09feb --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/EnqueueReplicationServerProperties.cs @@ -0,0 +1,89 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.SapVirtualInstances.Models +{ + /// Defines the SAP Enqueue Replication Server (ERS) properties. + public partial class EnqueueReplicationServerProperties + { + /// + /// 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 EnqueueReplicationServerProperties() + { + } + + /// Initializes a new instance of . + /// Defines the type of Enqueue Replication Server. + /// ERS Instance Number. + /// ERS SAP Hostname. + /// ERS SAP Kernel Version. + /// ERS SAP Kernel Patch level. + /// ERS SAP IP Address. + /// Defines the health of SAP Instances. + /// Keeps track of any properties unknown to the library. + internal EnqueueReplicationServerProperties(EnqueueReplicationServerType? ersVersion, string instanceNo, string hostname, string kernelVersion, string kernelPatch, string ipAddress, SapHealthState? health, IDictionary serializedAdditionalRawData) + { + ErsVersion = ersVersion; + InstanceNo = instanceNo; + Hostname = hostname; + KernelVersion = kernelVersion; + KernelPatch = kernelPatch; + IPAddress = ipAddress; + Health = health; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Defines the type of Enqueue Replication Server. + public EnqueueReplicationServerType? ErsVersion { get; } + /// ERS Instance Number. + public string InstanceNo { get; } + /// ERS SAP Hostname. + public string Hostname { get; } + /// ERS SAP Kernel Version. + public string KernelVersion { get; } + /// ERS SAP Kernel Patch level. + public string KernelPatch { get; } + /// ERS SAP IP Address. + public string IPAddress { get; } + /// Defines the health of SAP Instances. + public SapHealthState? Health { get; } + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/EnqueueReplicationServerType.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/EnqueueReplicationServerType.cs new file mode 100644 index 000000000000..7ca6390ea71e --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/EnqueueReplicationServerType.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.SapVirtualInstances.Models +{ + /// Defines the type of Enqueue Replication Server. + public readonly partial struct EnqueueReplicationServerType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public EnqueueReplicationServerType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string EnqueueReplicator1Value = "EnqueueReplicator1"; + private const string EnqueueReplicator2Value = "EnqueueReplicator2"; + + /// Enqueue Replication server type 1. + public static EnqueueReplicationServerType EnqueueReplicator1 { get; } = new EnqueueReplicationServerType(EnqueueReplicator1Value); + /// Enqueue Replication server type 2. + public static EnqueueReplicationServerType EnqueueReplicator2 { get; } = new EnqueueReplicationServerType(EnqueueReplicator2Value); + /// Determines if two values are the same. + public static bool operator ==(EnqueueReplicationServerType left, EnqueueReplicationServerType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(EnqueueReplicationServerType left, EnqueueReplicationServerType right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator EnqueueReplicationServerType(string value) => new EnqueueReplicationServerType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is EnqueueReplicationServerType other && Equals(other); + /// + public bool Equals(EnqueueReplicationServerType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/EnqueueServerProperties.Serialization.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/EnqueueServerProperties.Serialization.cs new file mode 100644 index 000000000000..af47b7bc300e --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/EnqueueServerProperties.Serialization.cs @@ -0,0 +1,170 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.SapVirtualInstances.Models +{ + public partial class EnqueueServerProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(EnqueueServerProperties)} does not support writing '{format}' format."); + } + + if (options.Format != "W" && Optional.IsDefined(Hostname)) + { + writer.WritePropertyName("hostname"u8); + writer.WriteStringValue(Hostname); + } + if (options.Format != "W" && Optional.IsDefined(IPAddress)) + { + writer.WritePropertyName("ipAddress"u8); + writer.WriteStringValue(IPAddress); + } + if (options.Format != "W" && Optional.IsDefined(Port)) + { + writer.WritePropertyName("port"u8); + writer.WriteNumberValue(Port.Value); + } + if (options.Format != "W" && Optional.IsDefined(Health)) + { + writer.WritePropertyName("health"u8); + writer.WriteStringValue(Health.Value.ToString()); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + EnqueueServerProperties 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(EnqueueServerProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeEnqueueServerProperties(document.RootElement, options); + } + + internal static EnqueueServerProperties DeserializeEnqueueServerProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string hostname = default; + string ipAddress = default; + long? port = default; + SapHealthState? health = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("hostname"u8)) + { + hostname = property.Value.GetString(); + continue; + } + if (property.NameEquals("ipAddress"u8)) + { + ipAddress = property.Value.GetString(); + continue; + } + if (property.NameEquals("port"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + port = property.Value.GetInt64(); + continue; + } + if (property.NameEquals("health"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + health = new SapHealthState(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new EnqueueServerProperties(hostname, ipAddress, port, health, 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(EnqueueServerProperties)} does not support writing '{options.Format}' format."); + } + } + + EnqueueServerProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeEnqueueServerProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(EnqueueServerProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/EnqueueServerProperties.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/EnqueueServerProperties.cs new file mode 100644 index 000000000000..b93b8f3fa2fc --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/EnqueueServerProperties.cs @@ -0,0 +1,77 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.SapVirtualInstances.Models +{ + /// Defines the SAP Enqueue Server properties. + public partial class EnqueueServerProperties + { + /// + /// 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 EnqueueServerProperties() + { + } + + /// Initializes a new instance of . + /// Enqueue Server SAP Hostname. + /// Enqueue Server SAP IP Address. + /// Enqueue Server Port. + /// Defines the health of SAP Instances. + /// Keeps track of any properties unknown to the library. + internal EnqueueServerProperties(string hostname, string ipAddress, long? port, SapHealthState? health, IDictionary serializedAdditionalRawData) + { + Hostname = hostname; + IPAddress = ipAddress; + Port = port; + Health = health; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Enqueue Server SAP Hostname. + public string Hostname { get; } + /// Enqueue Server SAP IP Address. + public string IPAddress { get; } + /// Enqueue Server Port. + public long? Port { get; } + /// Defines the health of SAP Instances. + public SapHealthState? Health { get; } + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/ErrorInformation.Serialization.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/ErrorInformation.Serialization.cs new file mode 100644 index 000000000000..b69c53650402 --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/ErrorInformation.Serialization.cs @@ -0,0 +1,165 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.SapVirtualInstances.Models +{ + public partial class ErrorInformation : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ErrorInformation)} does not support writing '{format}' format."); + } + + if (options.Format != "W" && Optional.IsDefined(Code)) + { + writer.WritePropertyName("code"u8); + writer.WriteStringValue(Code); + } + if (options.Format != "W" && Optional.IsDefined(Message)) + { + writer.WritePropertyName("message"u8); + writer.WriteStringValue(Message); + } + if (options.Format != "W" && Optional.IsCollectionDefined(Details)) + { + writer.WritePropertyName("details"u8); + writer.WriteStartArray(); + foreach (var item in Details) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + ErrorInformation 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(ErrorInformation)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeErrorInformation(document.RootElement, options); + } + + internal static ErrorInformation DeserializeErrorInformation(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string code = default; + string message = default; + IReadOnlyList details = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("code"u8)) + { + code = property.Value.GetString(); + continue; + } + if (property.NameEquals("message"u8)) + { + message = property.Value.GetString(); + continue; + } + if (property.NameEquals("details"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(DeserializeErrorInformation(item, options)); + } + details = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ErrorInformation(code, message, details ?? new ChangeTrackingList(), serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ErrorInformation)} does not support writing '{options.Format}' format."); + } + } + + ErrorInformation IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeErrorInformation(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ErrorInformation)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/ErrorInformation.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/ErrorInformation.cs new file mode 100644 index 000000000000..bd6490030f9c --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/ErrorInformation.cs @@ -0,0 +1,74 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.SapVirtualInstances.Models +{ + /// Error definition. + public partial class ErrorInformation + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + internal ErrorInformation() + { + Details = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// Service specific error code which serves as the substatus for the HTTP error code. + /// Description of the error. + /// Internal error details. + /// Keeps track of any properties unknown to the library. + internal ErrorInformation(string code, string message, IReadOnlyList details, IDictionary serializedAdditionalRawData) + { + Code = code; + Message = message; + Details = details; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Service specific error code which serves as the substatus for the HTTP error code. + public string Code { get; } + /// Description of the error. + public string Message { get; } + /// Internal error details. + public IReadOnlyList Details { get; } + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/ExternalInstallationSoftwareConfiguration.Serialization.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/ExternalInstallationSoftwareConfiguration.Serialization.cs new file mode 100644 index 000000000000..66b3a24a35b6 --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/ExternalInstallationSoftwareConfiguration.Serialization.cs @@ -0,0 +1,121 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.SapVirtualInstances.Models +{ + public partial class ExternalInstallationSoftwareConfiguration : 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(ExternalInstallationSoftwareConfiguration)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (Optional.IsDefined(CentralServerVmId)) + { + writer.WritePropertyName("centralServerVmId"u8); + writer.WriteStringValue(CentralServerVmId); + } + } + + ExternalInstallationSoftwareConfiguration 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(ExternalInstallationSoftwareConfiguration)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeExternalInstallationSoftwareConfiguration(document.RootElement, options); + } + + internal static ExternalInstallationSoftwareConfiguration DeserializeExternalInstallationSoftwareConfiguration(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string centralServerVmId = default; + SapSoftwareInstallationType softwareInstallationType = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("centralServerVmId"u8)) + { + centralServerVmId = property.Value.GetString(); + continue; + } + if (property.NameEquals("softwareInstallationType"u8)) + { + softwareInstallationType = new SapSoftwareInstallationType(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ExternalInstallationSoftwareConfiguration(softwareInstallationType, serializedAdditionalRawData, centralServerVmId); + } + + 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(ExternalInstallationSoftwareConfiguration)} does not support writing '{options.Format}' format."); + } + } + + ExternalInstallationSoftwareConfiguration IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeExternalInstallationSoftwareConfiguration(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ExternalInstallationSoftwareConfiguration)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/ExternalInstallationSoftwareConfiguration.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/ExternalInstallationSoftwareConfiguration.cs new file mode 100644 index 000000000000..c3b397f6d40e --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/ExternalInstallationSoftwareConfiguration.cs @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.SapVirtualInstances.Models +{ + /// The SAP Software configuration Input when the software is installed externally outside the service. + public partial class ExternalInstallationSoftwareConfiguration : SoftwareConfiguration + { + /// Initializes a new instance of . + public ExternalInstallationSoftwareConfiguration() + { + SoftwareInstallationType = SapSoftwareInstallationType.External; + } + + /// Initializes a new instance of . + /// The SAP software installation type. + /// Keeps track of any properties unknown to the library. + /// The resource ID of the virtual machine containing the central server instance. + internal ExternalInstallationSoftwareConfiguration(SapSoftwareInstallationType softwareInstallationType, IDictionary serializedAdditionalRawData, string centralServerVmId) : base(softwareInstallationType, serializedAdditionalRawData) + { + CentralServerVmId = centralServerVmId; + SoftwareInstallationType = softwareInstallationType; + } + + /// The resource ID of the virtual machine containing the central server instance. + public string CentralServerVmId { get; set; } + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/FileShareConfiguration.Serialization.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/FileShareConfiguration.Serialization.cs new file mode 100644 index 000000000000..51660a6f3b2e --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/FileShareConfiguration.Serialization.cs @@ -0,0 +1,119 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.SapVirtualInstances.Models +{ + [PersistableModelProxy(typeof(UnknownFileShareConfiguration))] + public partial class FileShareConfiguration : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(FileShareConfiguration)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("configurationType"u8); + writer.WriteStringValue(ConfigurationType.ToString()); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + FileShareConfiguration 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(FileShareConfiguration)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeFileShareConfiguration(document.RootElement, options); + } + + internal static FileShareConfiguration DeserializeFileShareConfiguration(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + if (element.TryGetProperty("configurationType", out JsonElement discriminator)) + { + switch (discriminator.GetString()) + { + case "CreateAndMount": return CreateAndMountFileShareConfiguration.DeserializeCreateAndMountFileShareConfiguration(element, options); + case "Mount": return MountFileShareConfiguration.DeserializeMountFileShareConfiguration(element, options); + case "Skip": return SkipFileShareConfiguration.DeserializeSkipFileShareConfiguration(element, options); + } + } + return UnknownFileShareConfiguration.DeserializeUnknownFileShareConfiguration(element, options); + } + + 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(FileShareConfiguration)} does not support writing '{options.Format}' format."); + } + } + + FileShareConfiguration IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeFileShareConfiguration(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(FileShareConfiguration)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/FileShareConfiguration.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/FileShareConfiguration.cs new file mode 100644 index 000000000000..72ea38306a60 --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/FileShareConfiguration.cs @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.SapVirtualInstances.Models +{ + /// + /// File Share configuration details, populated with information on storage configuration mounted on the VIS. The createAndMount option is selected in case of missing input. + /// 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 . + /// + public abstract partial class FileShareConfiguration + { + /// + /// 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 protected IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + protected FileShareConfiguration() + { + } + + /// Initializes a new instance of . + /// The type of file share config, eg: Mount/CreateAndMount/Skip. + /// Keeps track of any properties unknown to the library. + internal FileShareConfiguration(FileShareConfigurationType configurationType, IDictionary serializedAdditionalRawData) + { + ConfigurationType = configurationType; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The type of file share config, eg: Mount/CreateAndMount/Skip. + internal FileShareConfigurationType ConfigurationType { get; set; } + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/FileShareConfigurationType.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/FileShareConfigurationType.cs new file mode 100644 index 000000000000..8230c74a73e0 --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/FileShareConfigurationType.cs @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.SapVirtualInstances.Models +{ + /// The type of file share config. + internal readonly partial struct FileShareConfigurationType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public FileShareConfigurationType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string SkipValue = "Skip"; + private const string CreateAndMountValue = "CreateAndMount"; + private const string MountValue = "Mount"; + + /// Skip creating the file share. + public static FileShareConfigurationType Skip { get; } = new FileShareConfigurationType(SkipValue); + /// Fileshare will be created and mounted by service. + public static FileShareConfigurationType CreateAndMount { get; } = new FileShareConfigurationType(CreateAndMountValue); + /// Existing fileshare provided will be mounted by service. + public static FileShareConfigurationType Mount { get; } = new FileShareConfigurationType(MountValue); + /// Determines if two values are the same. + public static bool operator ==(FileShareConfigurationType left, FileShareConfigurationType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(FileShareConfigurationType left, FileShareConfigurationType right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator FileShareConfigurationType(string value) => new FileShareConfigurationType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is FileShareConfigurationType other && Equals(other); + /// + public bool Equals(FileShareConfigurationType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/GatewayServerProperties.Serialization.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/GatewayServerProperties.Serialization.cs new file mode 100644 index 000000000000..f5bcb907ce26 --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/GatewayServerProperties.Serialization.cs @@ -0,0 +1,148 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.SapVirtualInstances.Models +{ + public partial class GatewayServerProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(GatewayServerProperties)} does not support writing '{format}' format."); + } + + if (options.Format != "W" && Optional.IsDefined(Port)) + { + writer.WritePropertyName("port"u8); + writer.WriteNumberValue(Port.Value); + } + if (options.Format != "W" && Optional.IsDefined(Health)) + { + writer.WritePropertyName("health"u8); + writer.WriteStringValue(Health.Value.ToString()); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + GatewayServerProperties 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(GatewayServerProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeGatewayServerProperties(document.RootElement, options); + } + + internal static GatewayServerProperties DeserializeGatewayServerProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + long? port = default; + SapHealthState? health = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("port"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + port = property.Value.GetInt64(); + continue; + } + if (property.NameEquals("health"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + health = new SapHealthState(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new GatewayServerProperties(port, health, 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(GatewayServerProperties)} does not support writing '{options.Format}' format."); + } + } + + GatewayServerProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeGatewayServerProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(GatewayServerProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/GatewayServerProperties.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/GatewayServerProperties.cs new file mode 100644 index 000000000000..0127fde8ef92 --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/GatewayServerProperties.cs @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.SapVirtualInstances.Models +{ + /// Defines the SAP Gateway Server properties. + public partial class GatewayServerProperties + { + /// + /// 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 GatewayServerProperties() + { + } + + /// Initializes a new instance of . + /// Gateway Port. + /// Defines the health of SAP Instances. + /// Keeps track of any properties unknown to the library. + internal GatewayServerProperties(long? port, SapHealthState? health, IDictionary serializedAdditionalRawData) + { + Port = port; + Health = health; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Gateway Port. + public long? Port { get; } + /// Defines the health of SAP Instances. + public SapHealthState? Health { get; } + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/HighAvailabilityConfiguration.Serialization.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/HighAvailabilityConfiguration.Serialization.cs new file mode 100644 index 000000000000..df19e48cbb52 --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/HighAvailabilityConfiguration.Serialization.cs @@ -0,0 +1,126 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.SapVirtualInstances.Models +{ + internal partial class HighAvailabilityConfiguration : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(HighAvailabilityConfiguration)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("highAvailabilityType"u8); + writer.WriteStringValue(HighAvailabilityType.ToString()); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + HighAvailabilityConfiguration 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(HighAvailabilityConfiguration)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeHighAvailabilityConfiguration(document.RootElement, options); + } + + internal static HighAvailabilityConfiguration DeserializeHighAvailabilityConfiguration(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + SapHighAvailabilityType highAvailabilityType = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("highAvailabilityType"u8)) + { + highAvailabilityType = new SapHighAvailabilityType(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new HighAvailabilityConfiguration(highAvailabilityType, 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(HighAvailabilityConfiguration)} does not support writing '{options.Format}' format."); + } + } + + HighAvailabilityConfiguration IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeHighAvailabilityConfiguration(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(HighAvailabilityConfiguration)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/HighAvailabilityConfiguration.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/HighAvailabilityConfiguration.cs new file mode 100644 index 000000000000..a7d32d1ab84e --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/HighAvailabilityConfiguration.cs @@ -0,0 +1,72 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.SapVirtualInstances.Models +{ + /// Gets or sets the high availability configuration. + internal partial class HighAvailabilityConfiguration + { + /// + /// 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 high availability type. + public HighAvailabilityConfiguration(SapHighAvailabilityType highAvailabilityType) + { + HighAvailabilityType = highAvailabilityType; + } + + /// Initializes a new instance of . + /// The high availability type. + /// Keeps track of any properties unknown to the library. + internal HighAvailabilityConfiguration(SapHighAvailabilityType highAvailabilityType, IDictionary serializedAdditionalRawData) + { + HighAvailabilityType = highAvailabilityType; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal HighAvailabilityConfiguration() + { + } + + /// The high availability type. + public SapHighAvailabilityType HighAvailabilityType { get; set; } + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/HighAvailabilitySoftwareConfiguration.Serialization.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/HighAvailabilitySoftwareConfiguration.Serialization.cs new file mode 100644 index 000000000000..9a8f6785ba9b --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/HighAvailabilitySoftwareConfiguration.Serialization.cs @@ -0,0 +1,134 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.SapVirtualInstances.Models +{ + public partial class HighAvailabilitySoftwareConfiguration : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(HighAvailabilitySoftwareConfiguration)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("fencingClientId"u8); + writer.WriteStringValue(FencingClientId); + writer.WritePropertyName("fencingClientPassword"u8); + writer.WriteStringValue(FencingClientPassword); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + HighAvailabilitySoftwareConfiguration 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(HighAvailabilitySoftwareConfiguration)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeHighAvailabilitySoftwareConfiguration(document.RootElement, options); + } + + internal static HighAvailabilitySoftwareConfiguration DeserializeHighAvailabilitySoftwareConfiguration(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string fencingClientId = default; + string fencingClientPassword = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("fencingClientId"u8)) + { + fencingClientId = property.Value.GetString(); + continue; + } + if (property.NameEquals("fencingClientPassword"u8)) + { + fencingClientPassword = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new HighAvailabilitySoftwareConfiguration(fencingClientId, fencingClientPassword, 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(HighAvailabilitySoftwareConfiguration)} does not support writing '{options.Format}' format."); + } + } + + HighAvailabilitySoftwareConfiguration IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeHighAvailabilitySoftwareConfiguration(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(HighAvailabilitySoftwareConfiguration)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/HighAvailabilitySoftwareConfiguration.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/HighAvailabilitySoftwareConfiguration.cs new file mode 100644 index 000000000000..14c9a64c0718 --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/HighAvailabilitySoftwareConfiguration.cs @@ -0,0 +1,82 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.SapVirtualInstances.Models +{ + /// Gets or sets the HA software configuration. + public partial class HighAvailabilitySoftwareConfiguration + { + /// + /// 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 fencing client id. + /// The fencing client id secret/password. The secret should never expire. This will be used pacemaker to start/stop the cluster VMs. + /// or is null. + public HighAvailabilitySoftwareConfiguration(string fencingClientId, string fencingClientPassword) + { + Argument.AssertNotNull(fencingClientId, nameof(fencingClientId)); + Argument.AssertNotNull(fencingClientPassword, nameof(fencingClientPassword)); + + FencingClientId = fencingClientId; + FencingClientPassword = fencingClientPassword; + } + + /// Initializes a new instance of . + /// The fencing client id. + /// The fencing client id secret/password. The secret should never expire. This will be used pacemaker to start/stop the cluster VMs. + /// Keeps track of any properties unknown to the library. + internal HighAvailabilitySoftwareConfiguration(string fencingClientId, string fencingClientPassword, IDictionary serializedAdditionalRawData) + { + FencingClientId = fencingClientId; + FencingClientPassword = fencingClientPassword; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal HighAvailabilitySoftwareConfiguration() + { + } + + /// The fencing client id. + public string FencingClientId { get; set; } + /// The fencing client id secret/password. The secret should never expire. This will be used pacemaker to start/stop the cluster VMs. + public string FencingClientPassword { get; set; } + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/ImageReference.Serialization.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/ImageReference.Serialization.cs new file mode 100644 index 000000000000..a2e2db5c02c5 --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/ImageReference.Serialization.cs @@ -0,0 +1,183 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.SapVirtualInstances.Models +{ + public partial class ImageReference : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ImageReference)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(Publisher)) + { + writer.WritePropertyName("publisher"u8); + writer.WriteStringValue(Publisher); + } + if (Optional.IsDefined(Offer)) + { + writer.WritePropertyName("offer"u8); + writer.WriteStringValue(Offer); + } + if (Optional.IsDefined(Sku)) + { + writer.WritePropertyName("sku"u8); + writer.WriteStringValue(Sku); + } + if (Optional.IsDefined(Version)) + { + writer.WritePropertyName("version"u8); + writer.WriteStringValue(Version); + } + if (Optional.IsDefined(Id)) + { + writer.WritePropertyName("id"u8); + writer.WriteStringValue(Id); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + ImageReference 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(ImageReference)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeImageReference(document.RootElement, options); + } + + internal static ImageReference DeserializeImageReference(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string publisher = default; + string offer = default; + string sku = default; + string version = default; + ResourceIdentifier id = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("publisher"u8)) + { + publisher = property.Value.GetString(); + continue; + } + if (property.NameEquals("offer"u8)) + { + offer = property.Value.GetString(); + continue; + } + if (property.NameEquals("sku"u8)) + { + sku = property.Value.GetString(); + continue; + } + if (property.NameEquals("version"u8)) + { + version = property.Value.GetString(); + continue; + } + if (property.NameEquals("id"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + id = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ImageReference( + publisher, + offer, + sku, + version, + id, + 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(ImageReference)} does not support writing '{options.Format}' format."); + } + } + + ImageReference IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeImageReference(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ImageReference)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/ImageReference.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/ImageReference.cs new file mode 100644 index 000000000000..a55799521852 --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/ImageReference.cs @@ -0,0 +1,82 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.ResourceManager.SapVirtualInstances.Models +{ + /// Specifies information about the image to use. You can specify information about platform images, marketplace images, or virtual machine images. This element is required when you want to use a platform image, marketplace image, or virtual machine image, but is not used in other creation operations. NOTE: Image reference publisher and offer can only be set when you create the scale set. + public partial class ImageReference + { + /// + /// 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 ImageReference() + { + } + + /// Initializes a new instance of . + /// The image publisher. + /// Specifies the offer of the platform image or marketplace image used to create the virtual machine. + /// The image SKU. + /// Specifies the version of the platform image or marketplace image used to create the virtual machine. The allowed formats are Major.Minor.Build or 'latest'. Major, Minor, and Build are decimal numbers. Specify 'latest' to use the latest version of an image available at deploy time. Even if you use 'latest', the VM image will not automatically update after deploy time even if a new version becomes available. + /// Specifies the ARM resource ID of the Azure Compute Gallery image version used for creating ACSS VMs. You will need to provide this input when you choose to deploy virtual machines in ACSS with OS image from the Azure Compute gallery. + /// Keeps track of any properties unknown to the library. + internal ImageReference(string publisher, string offer, string sku, string version, ResourceIdentifier id, IDictionary serializedAdditionalRawData) + { + Publisher = publisher; + Offer = offer; + Sku = sku; + Version = version; + Id = id; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The image publisher. + public string Publisher { get; set; } + /// Specifies the offer of the platform image or marketplace image used to create the virtual machine. + public string Offer { get; set; } + /// The image SKU. + public string Sku { get; set; } + /// Specifies the version of the platform image or marketplace image used to create the virtual machine. The allowed formats are Major.Minor.Build or 'latest'. Major, Minor, and Build are decimal numbers. Specify 'latest' to use the latest version of an image available at deploy time. Even if you use 'latest', the VM image will not automatically update after deploy time even if a new version becomes available. + public string Version { get; set; } + /// Specifies the ARM resource ID of the Azure Compute Gallery image version used for creating ACSS VMs. You will need to provide this input when you choose to deploy virtual machines in ACSS with OS image from the Azure Compute gallery. + public ResourceIdentifier Id { get; set; } + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/InfrastructureConfiguration.Serialization.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/InfrastructureConfiguration.Serialization.cs new file mode 100644 index 000000000000..7e8dbe89b985 --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/InfrastructureConfiguration.Serialization.cs @@ -0,0 +1,120 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.SapVirtualInstances.Models +{ + [PersistableModelProxy(typeof(UnknownInfrastructureConfiguration))] + public partial class InfrastructureConfiguration : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(InfrastructureConfiguration)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("appResourceGroup"u8); + writer.WriteStringValue(AppResourceGroup); + writer.WritePropertyName("deploymentType"u8); + writer.WriteStringValue(DeploymentType.ToString()); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + InfrastructureConfiguration 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(InfrastructureConfiguration)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeInfrastructureConfiguration(document.RootElement, options); + } + + internal static InfrastructureConfiguration DeserializeInfrastructureConfiguration(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + if (element.TryGetProperty("deploymentType", out JsonElement discriminator)) + { + switch (discriminator.GetString()) + { + case "SingleServer": return SingleServerConfiguration.DeserializeSingleServerConfiguration(element, options); + case "ThreeTier": return ThreeTierConfiguration.DeserializeThreeTierConfiguration(element, options); + } + } + return UnknownInfrastructureConfiguration.DeserializeUnknownInfrastructureConfiguration(element, options); + } + + 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(InfrastructureConfiguration)} does not support writing '{options.Format}' format."); + } + } + + InfrastructureConfiguration IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeInfrastructureConfiguration(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(InfrastructureConfiguration)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/InfrastructureConfiguration.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/InfrastructureConfiguration.cs new file mode 100644 index 000000000000..5b41b47e9932 --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/InfrastructureConfiguration.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; + +namespace Azure.ResourceManager.SapVirtualInstances.Models +{ + /// + /// Deploy SAP Infrastructure Details. + /// 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 . + /// + public abstract partial class InfrastructureConfiguration + { + /// + /// 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 protected IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The application resource group where SAP system resources will be deployed. + /// is null. + protected InfrastructureConfiguration(string appResourceGroup) + { + Argument.AssertNotNull(appResourceGroup, nameof(appResourceGroup)); + + AppResourceGroup = appResourceGroup; + } + + /// Initializes a new instance of . + /// The application resource group where SAP system resources will be deployed. + /// The SAP deployment type. Eg: SingleServer/ThreeTier. + /// Keeps track of any properties unknown to the library. + internal InfrastructureConfiguration(string appResourceGroup, SapDeploymentType deploymentType, IDictionary serializedAdditionalRawData) + { + AppResourceGroup = appResourceGroup; + DeploymentType = deploymentType; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal InfrastructureConfiguration() + { + } + + /// The application resource group where SAP system resources will be deployed. + public string AppResourceGroup { get; set; } + /// The SAP deployment type. Eg: SingleServer/ThreeTier. + internal SapDeploymentType DeploymentType { get; set; } + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/LinuxConfiguration.Serialization.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/LinuxConfiguration.Serialization.cs new file mode 100644 index 000000000000..9e280c1c8d6f --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/LinuxConfiguration.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; + +namespace Azure.ResourceManager.SapVirtualInstances.Models +{ + public partial class LinuxConfiguration : 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(LinuxConfiguration)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (Optional.IsDefined(DisablePasswordAuthentication)) + { + writer.WritePropertyName("disablePasswordAuthentication"u8); + writer.WriteBooleanValue(DisablePasswordAuthentication.Value); + } + if (Optional.IsDefined(Ssh)) + { + writer.WritePropertyName("ssh"u8); + writer.WriteObjectValue(Ssh, options); + } + if (Optional.IsDefined(SshKeyPair)) + { + writer.WritePropertyName("sshKeyPair"u8); + writer.WriteObjectValue(SshKeyPair, options); + } + } + + LinuxConfiguration 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(LinuxConfiguration)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeLinuxConfiguration(document.RootElement, options); + } + + internal static LinuxConfiguration DeserializeLinuxConfiguration(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + bool? disablePasswordAuthentication = default; + SshConfiguration ssh = default; + SshKeyPair sshKeyPair = default; + OSType osType = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("disablePasswordAuthentication"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + disablePasswordAuthentication = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("ssh"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + ssh = SshConfiguration.DeserializeSshConfiguration(property.Value, options); + continue; + } + if (property.NameEquals("sshKeyPair"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + sshKeyPair = SshKeyPair.DeserializeSshKeyPair(property.Value, options); + continue; + } + if (property.NameEquals("osType"u8)) + { + osType = new OSType(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new LinuxConfiguration(osType, serializedAdditionalRawData, disablePasswordAuthentication, ssh, sshKeyPair); + } + + 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(LinuxConfiguration)} does not support writing '{options.Format}' format."); + } + } + + LinuxConfiguration IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeLinuxConfiguration(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(LinuxConfiguration)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/LinuxConfiguration.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/LinuxConfiguration.cs new file mode 100644 index 000000000000..cbab30ff0f28 --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/LinuxConfiguration.cs @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.SapVirtualInstances.Models +{ + /// Specifies the Linux operating system settings on the virtual machine. For a list of supported Linux distributions, see [Linux on Azure-Endorsed Distributions](https://learn.microsoft.com/azure/virtual-machines/linux/endorsed-distros). + public partial class LinuxConfiguration : OSConfiguration + { + /// Initializes a new instance of . + public LinuxConfiguration() + { + OSType = OSType.Linux; + } + + /// Initializes a new instance of . + /// The OS Type. + /// Keeps track of any properties unknown to the library. + /// Specifies whether password authentication should be disabled. + /// Specifies the ssh key configuration for a Linux OS. (This property is deprecated, please use 'sshKeyPair' instead). + /// The SSH Key-pair used to authenticate with the VM's. + internal LinuxConfiguration(OSType osType, IDictionary serializedAdditionalRawData, bool? disablePasswordAuthentication, SshConfiguration ssh, SshKeyPair sshKeyPair) : base(osType, serializedAdditionalRawData) + { + DisablePasswordAuthentication = disablePasswordAuthentication; + Ssh = ssh; + SshKeyPair = sshKeyPair; + OSType = osType; + } + + /// Specifies whether password authentication should be disabled. + public bool? DisablePasswordAuthentication { get; set; } + /// Specifies the ssh key configuration for a Linux OS. (This property is deprecated, please use 'sshKeyPair' instead). + internal SshConfiguration Ssh { get; set; } + /// The list of SSH public keys used to authenticate with linux based VMs. + public IList SshPublicKeys + { + get + { + if (Ssh is null) + Ssh = new SshConfiguration(); + return Ssh.PublicKeys; + } + } + + /// The SSH Key-pair used to authenticate with the VM's. + public SshKeyPair SshKeyPair { get; set; } + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/LoadBalancerResourceNames.Serialization.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/LoadBalancerResourceNames.Serialization.cs new file mode 100644 index 000000000000..901f359bd4bd --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/LoadBalancerResourceNames.Serialization.cs @@ -0,0 +1,204 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.SapVirtualInstances.Models +{ + public partial class LoadBalancerResourceNames : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(LoadBalancerResourceNames)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(LoadBalancerName)) + { + writer.WritePropertyName("loadBalancerName"u8); + writer.WriteStringValue(LoadBalancerName); + } + if (Optional.IsCollectionDefined(FrontendIPConfigurationNames)) + { + writer.WritePropertyName("frontendIpConfigurationNames"u8); + writer.WriteStartArray(); + foreach (var item in FrontendIPConfigurationNames) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(BackendPoolNames)) + { + writer.WritePropertyName("backendPoolNames"u8); + writer.WriteStartArray(); + foreach (var item in BackendPoolNames) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(HealthProbeNames)) + { + writer.WritePropertyName("healthProbeNames"u8); + writer.WriteStartArray(); + foreach (var item in HealthProbeNames) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + LoadBalancerResourceNames 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(LoadBalancerResourceNames)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeLoadBalancerResourceNames(document.RootElement, options); + } + + internal static LoadBalancerResourceNames DeserializeLoadBalancerResourceNames(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string loadBalancerName = default; + IList frontendIPConfigurationNames = default; + IList backendPoolNames = default; + IList healthProbeNames = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("loadBalancerName"u8)) + { + loadBalancerName = property.Value.GetString(); + continue; + } + if (property.NameEquals("frontendIpConfigurationNames"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + frontendIPConfigurationNames = array; + continue; + } + if (property.NameEquals("backendPoolNames"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + backendPoolNames = array; + continue; + } + if (property.NameEquals("healthProbeNames"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + healthProbeNames = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new LoadBalancerResourceNames(loadBalancerName, frontendIPConfigurationNames ?? new ChangeTrackingList(), backendPoolNames ?? new ChangeTrackingList(), healthProbeNames ?? new ChangeTrackingList(), serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(LoadBalancerResourceNames)} does not support writing '{options.Format}' format."); + } + } + + LoadBalancerResourceNames IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeLoadBalancerResourceNames(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(LoadBalancerResourceNames)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/LoadBalancerResourceNames.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/LoadBalancerResourceNames.cs new file mode 100644 index 000000000000..e3bf1c626759 --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/LoadBalancerResourceNames.cs @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.SapVirtualInstances.Models +{ + /// The resource names object for load balancer and related resources. + public partial class LoadBalancerResourceNames + { + /// + /// 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 LoadBalancerResourceNames() + { + FrontendIPConfigurationNames = new ChangeTrackingList(); + BackendPoolNames = new ChangeTrackingList(); + HealthProbeNames = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// The full resource name for load balancer. If this value is not provided, load balancer will be name as {ASCS/DB}-loadBalancer. + /// The list of frontend IP configuration names. If provided as input, size of this list should be 2 for cs layer and should be 1 for database layer. + /// The list of backend pool names. Currently, ACSS deploys only one backend pool and hence, size of this list should be 1. + /// The list of health probe names. If provided as input, size of this list should be 2 for cs layer and should be 1 for database layer. + /// Keeps track of any properties unknown to the library. + internal LoadBalancerResourceNames(string loadBalancerName, IList frontendIPConfigurationNames, IList backendPoolNames, IList healthProbeNames, IDictionary serializedAdditionalRawData) + { + LoadBalancerName = loadBalancerName; + FrontendIPConfigurationNames = frontendIPConfigurationNames; + BackendPoolNames = backendPoolNames; + HealthProbeNames = healthProbeNames; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The full resource name for load balancer. If this value is not provided, load balancer will be name as {ASCS/DB}-loadBalancer. + public string LoadBalancerName { get; set; } + /// The list of frontend IP configuration names. If provided as input, size of this list should be 2 for cs layer and should be 1 for database layer. + public IList FrontendIPConfigurationNames { get; } + /// The list of backend pool names. Currently, ACSS deploys only one backend pool and hence, size of this list should be 1. + public IList BackendPoolNames { get; } + /// The list of health probe names. If provided as input, size of this list should be 2 for cs layer and should be 1 for database layer. + public IList HealthProbeNames { get; } + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/ManagedRGConfiguration.Serialization.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/ManagedRGConfiguration.Serialization.cs new file mode 100644 index 000000000000..671fbda680d1 --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/ManagedRGConfiguration.Serialization.cs @@ -0,0 +1,129 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.SapVirtualInstances.Models +{ + internal partial class ManagedRGConfiguration : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ManagedRGConfiguration)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(Name)) + { + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + ManagedRGConfiguration 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(ManagedRGConfiguration)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeManagedRGConfiguration(document.RootElement, options); + } + + internal static ManagedRGConfiguration DeserializeManagedRGConfiguration(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string name = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ManagedRGConfiguration(name, 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(ManagedRGConfiguration)} does not support writing '{options.Format}' format."); + } + } + + ManagedRGConfiguration IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeManagedRGConfiguration(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ManagedRGConfiguration)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/ManagedRGConfiguration.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/ManagedRGConfiguration.cs new file mode 100644 index 000000000000..97925c7a1239 --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/ManagedRGConfiguration.cs @@ -0,0 +1,65 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.SapVirtualInstances.Models +{ + /// Managed resource group configuration. + internal partial class ManagedRGConfiguration + { + /// + /// 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 ManagedRGConfiguration() + { + } + + /// Initializes a new instance of . + /// Managed resource group name. + /// Keeps track of any properties unknown to the library. + internal ManagedRGConfiguration(string name, IDictionary serializedAdditionalRawData) + { + Name = name; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Managed resource group name. + public string Name { get; set; } + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/ManagedResourcesNetworkAccessType.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/ManagedResourcesNetworkAccessType.cs new file mode 100644 index 000000000000..77453b9854c6 --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/ManagedResourcesNetworkAccessType.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.SapVirtualInstances.Models +{ + /// Defines the network access type for managed resources. + public readonly partial struct ManagedResourcesNetworkAccessType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public ManagedResourcesNetworkAccessType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string PublicValue = "Public"; + private const string PrivateValue = "Private"; + + /// Managed resources will be deployed with public network access enabled. + public static ManagedResourcesNetworkAccessType Public { get; } = new ManagedResourcesNetworkAccessType(PublicValue); + /// Managed resources will be deployed with public network access disabled. + public static ManagedResourcesNetworkAccessType Private { get; } = new ManagedResourcesNetworkAccessType(PrivateValue); + /// Determines if two values are the same. + public static bool operator ==(ManagedResourcesNetworkAccessType left, ManagedResourcesNetworkAccessType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(ManagedResourcesNetworkAccessType left, ManagedResourcesNetworkAccessType right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator ManagedResourcesNetworkAccessType(string value) => new ManagedResourcesNetworkAccessType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is ManagedResourcesNetworkAccessType other && Equals(other); + /// + public bool Equals(ManagedResourcesNetworkAccessType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/MessageServerProperties.Serialization.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/MessageServerProperties.Serialization.cs new file mode 100644 index 000000000000..0434ab79a18d --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/MessageServerProperties.Serialization.cs @@ -0,0 +1,223 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.SapVirtualInstances.Models +{ + public partial class MessageServerProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(MessageServerProperties)} does not support writing '{format}' format."); + } + + if (options.Format != "W" && Optional.IsDefined(MsPort)) + { + writer.WritePropertyName("msPort"u8); + writer.WriteNumberValue(MsPort.Value); + } + if (options.Format != "W" && Optional.IsDefined(InternalMsPort)) + { + writer.WritePropertyName("internalMsPort"u8); + writer.WriteNumberValue(InternalMsPort.Value); + } + if (options.Format != "W" && Optional.IsDefined(HttpPort)) + { + writer.WritePropertyName("httpPort"u8); + writer.WriteNumberValue(HttpPort.Value); + } + if (options.Format != "W" && Optional.IsDefined(HttpsPort)) + { + writer.WritePropertyName("httpsPort"u8); + writer.WriteNumberValue(HttpsPort.Value); + } + if (options.Format != "W" && Optional.IsDefined(Hostname)) + { + writer.WritePropertyName("hostname"u8); + writer.WriteStringValue(Hostname); + } + if (options.Format != "W" && Optional.IsDefined(IPAddress)) + { + writer.WritePropertyName("ipAddress"u8); + writer.WriteStringValue(IPAddress); + } + if (options.Format != "W" && Optional.IsDefined(Health)) + { + writer.WritePropertyName("health"u8); + writer.WriteStringValue(Health.Value.ToString()); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + MessageServerProperties 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(MessageServerProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeMessageServerProperties(document.RootElement, options); + } + + internal static MessageServerProperties DeserializeMessageServerProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + long? msPort = default; + long? internalMsPort = default; + long? httpPort = default; + long? httpsPort = default; + string hostname = default; + string ipAddress = default; + SapHealthState? health = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("msPort"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + msPort = property.Value.GetInt64(); + continue; + } + if (property.NameEquals("internalMsPort"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + internalMsPort = property.Value.GetInt64(); + continue; + } + if (property.NameEquals("httpPort"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + httpPort = property.Value.GetInt64(); + continue; + } + if (property.NameEquals("httpsPort"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + httpsPort = property.Value.GetInt64(); + continue; + } + if (property.NameEquals("hostname"u8)) + { + hostname = property.Value.GetString(); + continue; + } + if (property.NameEquals("ipAddress"u8)) + { + ipAddress = property.Value.GetString(); + continue; + } + if (property.NameEquals("health"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + health = new SapHealthState(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new MessageServerProperties( + msPort, + internalMsPort, + httpPort, + httpsPort, + hostname, + ipAddress, + health, + 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(MessageServerProperties)} does not support writing '{options.Format}' format."); + } + } + + MessageServerProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeMessageServerProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(MessageServerProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/MessageServerProperties.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/MessageServerProperties.cs new file mode 100644 index 000000000000..d1c6765d55c6 --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/MessageServerProperties.cs @@ -0,0 +1,89 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.SapVirtualInstances.Models +{ + /// Defines the SAP message server properties. + public partial class MessageServerProperties + { + /// + /// 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 MessageServerProperties() + { + } + + /// Initializes a new instance of . + /// message server port. + /// message server internal MS port. + /// message server HTTP Port. + /// message server HTTPS Port. + /// message server SAP Hostname. + /// message server IP Address. + /// Defines the health of SAP Instances. + /// Keeps track of any properties unknown to the library. + internal MessageServerProperties(long? msPort, long? internalMsPort, long? httpPort, long? httpsPort, string hostname, string ipAddress, SapHealthState? health, IDictionary serializedAdditionalRawData) + { + MsPort = msPort; + InternalMsPort = internalMsPort; + HttpPort = httpPort; + HttpsPort = httpsPort; + Hostname = hostname; + IPAddress = ipAddress; + Health = health; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// message server port. + public long? MsPort { get; } + /// message server internal MS port. + public long? InternalMsPort { get; } + /// message server HTTP Port. + public long? HttpPort { get; } + /// message server HTTPS Port. + public long? HttpsPort { get; } + /// message server SAP Hostname. + public string Hostname { get; } + /// message server IP Address. + public string IPAddress { get; } + /// Defines the health of SAP Instances. + public SapHealthState? Health { get; } + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/MountFileShareConfiguration.Serialization.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/MountFileShareConfiguration.Serialization.cs new file mode 100644 index 000000000000..37f3772f7d6b --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/MountFileShareConfiguration.Serialization.cs @@ -0,0 +1,126 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.SapVirtualInstances.Models +{ + public partial class MountFileShareConfiguration : 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(MountFileShareConfiguration)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + writer.WritePropertyName("id"u8); + writer.WriteStringValue(Id); + writer.WritePropertyName("privateEndpointId"u8); + writer.WriteStringValue(PrivateEndpointId); + } + + MountFileShareConfiguration 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(MountFileShareConfiguration)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeMountFileShareConfiguration(document.RootElement, options); + } + + internal static MountFileShareConfiguration DeserializeMountFileShareConfiguration(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string id = default; + string privateEndpointId = default; + FileShareConfigurationType configurationType = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("id"u8)) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("privateEndpointId"u8)) + { + privateEndpointId = property.Value.GetString(); + continue; + } + if (property.NameEquals("configurationType"u8)) + { + configurationType = new FileShareConfigurationType(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new MountFileShareConfiguration(configurationType, serializedAdditionalRawData, id, privateEndpointId); + } + + 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(MountFileShareConfiguration)} does not support writing '{options.Format}' format."); + } + } + + MountFileShareConfiguration IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeMountFileShareConfiguration(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(MountFileShareConfiguration)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/MountFileShareConfiguration.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/MountFileShareConfiguration.cs new file mode 100644 index 000000000000..97b436cc473b --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/MountFileShareConfiguration.cs @@ -0,0 +1,52 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.SapVirtualInstances.Models +{ + /// Gets or sets the file share configuration where the transport directory fileshare already exists, and user wishes to mount the fileshare as a part of the create infra flow. + public partial class MountFileShareConfiguration : FileShareConfiguration + { + /// Initializes a new instance of . + /// The fileshare resource ID. + /// The private endpoint resource ID. + /// or is null. + public MountFileShareConfiguration(string id, string privateEndpointId) + { + Argument.AssertNotNull(id, nameof(id)); + Argument.AssertNotNull(privateEndpointId, nameof(privateEndpointId)); + + Id = id; + PrivateEndpointId = privateEndpointId; + ConfigurationType = FileShareConfigurationType.Mount; + } + + /// Initializes a new instance of . + /// The type of file share config, eg: Mount/CreateAndMount/Skip. + /// Keeps track of any properties unknown to the library. + /// The fileshare resource ID. + /// The private endpoint resource ID. + internal MountFileShareConfiguration(FileShareConfigurationType configurationType, IDictionary serializedAdditionalRawData, string id, string privateEndpointId) : base(configurationType, serializedAdditionalRawData) + { + Id = id; + PrivateEndpointId = privateEndpointId; + ConfigurationType = configurationType; + } + + /// Initializes a new instance of for deserialization. + internal MountFileShareConfiguration() + { + } + + /// The fileshare resource ID. + public string Id { get; set; } + /// The private endpoint resource ID. + public string PrivateEndpointId { get; set; } + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/NamingPatternType.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/NamingPatternType.cs new file mode 100644 index 000000000000..f80495efa1ed --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/NamingPatternType.cs @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.SapVirtualInstances.Models +{ + /// The pattern type to be used for resource naming. + internal readonly partial struct NamingPatternType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public NamingPatternType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string FullResourceNameValue = "FullResourceName"; + + /// Full resource names that will be created by service. + public static NamingPatternType FullResourceName { get; } = new NamingPatternType(FullResourceNameValue); + /// Determines if two values are the same. + public static bool operator ==(NamingPatternType left, NamingPatternType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(NamingPatternType left, NamingPatternType right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator NamingPatternType(string value) => new NamingPatternType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is NamingPatternType other && Equals(other); + /// + public bool Equals(NamingPatternType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/NetworkConfiguration.Serialization.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/NetworkConfiguration.Serialization.cs new file mode 100644 index 000000000000..c6f2d0737bfd --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/NetworkConfiguration.Serialization.cs @@ -0,0 +1,133 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.SapVirtualInstances.Models +{ + internal partial class NetworkConfiguration : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(NetworkConfiguration)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(IsSecondaryIPEnabled)) + { + writer.WritePropertyName("isSecondaryIpEnabled"u8); + writer.WriteBooleanValue(IsSecondaryIPEnabled.Value); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + NetworkConfiguration 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(NetworkConfiguration)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeNetworkConfiguration(document.RootElement, options); + } + + internal static NetworkConfiguration DeserializeNetworkConfiguration(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + bool? isSecondaryIPEnabled = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("isSecondaryIpEnabled"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + isSecondaryIPEnabled = property.Value.GetBoolean(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new NetworkConfiguration(isSecondaryIPEnabled, 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(NetworkConfiguration)} does not support writing '{options.Format}' format."); + } + } + + NetworkConfiguration IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeNetworkConfiguration(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(NetworkConfiguration)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/NetworkConfiguration.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/NetworkConfiguration.cs new file mode 100644 index 000000000000..ef284cd37b59 --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/NetworkConfiguration.cs @@ -0,0 +1,65 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.SapVirtualInstances.Models +{ + /// Defines the network configuration type for SAP system infrastructure that is being deployed. + internal partial class NetworkConfiguration + { + /// + /// 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 NetworkConfiguration() + { + } + + /// Initializes a new instance of . + /// Specifies whether a secondary IP address should be added to the network interface on all VMs of the SAP system being deployed. + /// Keeps track of any properties unknown to the library. + internal NetworkConfiguration(bool? isSecondaryIPEnabled, IDictionary serializedAdditionalRawData) + { + IsSecondaryIPEnabled = isSecondaryIPEnabled; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Specifies whether a secondary IP address should be added to the network interface on all VMs of the SAP system being deployed. + public bool? IsSecondaryIPEnabled { get; set; } + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/NetworkInterfaceResourceNames.Serialization.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/NetworkInterfaceResourceNames.Serialization.cs new file mode 100644 index 000000000000..105826063e86 --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/NetworkInterfaceResourceNames.Serialization.cs @@ -0,0 +1,129 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.SapVirtualInstances.Models +{ + public partial class NetworkInterfaceResourceNames : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(NetworkInterfaceResourceNames)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(NetworkInterfaceName)) + { + writer.WritePropertyName("networkInterfaceName"u8); + writer.WriteStringValue(NetworkInterfaceName); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + NetworkInterfaceResourceNames 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(NetworkInterfaceResourceNames)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeNetworkInterfaceResourceNames(document.RootElement, options); + } + + internal static NetworkInterfaceResourceNames DeserializeNetworkInterfaceResourceNames(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string networkInterfaceName = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("networkInterfaceName"u8)) + { + networkInterfaceName = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new NetworkInterfaceResourceNames(networkInterfaceName, 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(NetworkInterfaceResourceNames)} does not support writing '{options.Format}' format."); + } + } + + NetworkInterfaceResourceNames IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeNetworkInterfaceResourceNames(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(NetworkInterfaceResourceNames)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/NetworkInterfaceResourceNames.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/NetworkInterfaceResourceNames.cs new file mode 100644 index 000000000000..44b73d795b66 --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/NetworkInterfaceResourceNames.cs @@ -0,0 +1,65 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.SapVirtualInstances.Models +{ + /// The resource names object for network interface and related resources. + public partial class NetworkInterfaceResourceNames + { + /// + /// 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 NetworkInterfaceResourceNames() + { + } + + /// Initializes a new instance of . + /// The full name for network interface. If name is not provided, service uses a default name based on the deployment type. For SingleServer, default name is {SID}-Nic. In case of HA-AvZone systems, default name will be {SID}-{App/ASCS/DB}-Zone{A/B}-Nic with an incrementor at the end in case of more than 1 instance per layer. For distributed and HA-AvSet systems, default name will be {SID}-{App/ASCS/DB}-Nic with an incrementor at the end in case of more than 1 instance per layer. + /// Keeps track of any properties unknown to the library. + internal NetworkInterfaceResourceNames(string networkInterfaceName, IDictionary serializedAdditionalRawData) + { + NetworkInterfaceName = networkInterfaceName; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The full name for network interface. If name is not provided, service uses a default name based on the deployment type. For SingleServer, default name is {SID}-Nic. In case of HA-AvZone systems, default name will be {SID}-{App/ASCS/DB}-Zone{A/B}-Nic with an incrementor at the end in case of more than 1 instance per layer. For distributed and HA-AvSet systems, default name will be {SID}-{App/ASCS/DB}-Nic with an incrementor at the end in case of more than 1 instance per layer. + public string NetworkInterfaceName { get; set; } + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/OSConfiguration.Serialization.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/OSConfiguration.Serialization.cs new file mode 100644 index 000000000000..35b8f94a8edb --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/OSConfiguration.Serialization.cs @@ -0,0 +1,118 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.SapVirtualInstances.Models +{ + [PersistableModelProxy(typeof(UnknownOSConfiguration))] + public partial class OSConfiguration : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(OSConfiguration)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("osType"u8); + writer.WriteStringValue(OSType.ToString()); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + OSConfiguration 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(OSConfiguration)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeOSConfiguration(document.RootElement, options); + } + + internal static OSConfiguration DeserializeOSConfiguration(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + if (element.TryGetProperty("osType", out JsonElement discriminator)) + { + switch (discriminator.GetString()) + { + case "Linux": return LinuxConfiguration.DeserializeLinuxConfiguration(element, options); + case "Windows": return WindowsConfiguration.DeserializeWindowsConfiguration(element, options); + } + } + return UnknownOSConfiguration.DeserializeUnknownOSConfiguration(element, options); + } + + 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(OSConfiguration)} does not support writing '{options.Format}' format."); + } + } + + OSConfiguration IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeOSConfiguration(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(OSConfiguration)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/OSConfiguration.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/OSConfiguration.cs new file mode 100644 index 000000000000..f5348cf70e97 --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/OSConfiguration.cs @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.SapVirtualInstances.Models +{ + /// + /// Defines the OS configuration. + /// 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 . + /// + public abstract partial class OSConfiguration + { + /// + /// 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 protected IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + protected OSConfiguration() + { + } + + /// Initializes a new instance of . + /// The OS Type. + /// Keeps track of any properties unknown to the library. + internal OSConfiguration(OSType osType, IDictionary serializedAdditionalRawData) + { + OSType = osType; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The OS Type. + internal OSType OSType { get; set; } + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/OSProfile.Serialization.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/OSProfile.Serialization.cs new file mode 100644 index 000000000000..2b0a50a790df --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/OSProfile.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; + +namespace Azure.ResourceManager.SapVirtualInstances.Models +{ + public partial class OSProfile : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(OSProfile)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(AdminUsername)) + { + writer.WritePropertyName("adminUsername"u8); + writer.WriteStringValue(AdminUsername); + } + if (Optional.IsDefined(AdminPassword)) + { + writer.WritePropertyName("adminPassword"u8); + writer.WriteStringValue(AdminPassword); + } + if (Optional.IsDefined(OSConfiguration)) + { + writer.WritePropertyName("osConfiguration"u8); + writer.WriteObjectValue(OSConfiguration, options); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + OSProfile 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(OSProfile)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeOSProfile(document.RootElement, options); + } + + internal static OSProfile DeserializeOSProfile(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string adminUsername = default; + string adminPassword = default; + OSConfiguration osConfiguration = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("adminUsername"u8)) + { + adminUsername = property.Value.GetString(); + continue; + } + if (property.NameEquals("adminPassword"u8)) + { + adminPassword = property.Value.GetString(); + continue; + } + if (property.NameEquals("osConfiguration"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + osConfiguration = OSConfiguration.DeserializeOSConfiguration(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new OSProfile(adminUsername, adminPassword, osConfiguration, 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(OSProfile)} does not support writing '{options.Format}' format."); + } + } + + OSProfile IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeOSProfile(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(OSProfile)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/OSProfile.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/OSProfile.cs new file mode 100644 index 000000000000..b90bef9c789e --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/OSProfile.cs @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.SapVirtualInstances.Models +{ + /// Specifies the operating system settings for the virtual machine. Some of the settings cannot be changed once VM is provisioned. + public partial class OSProfile + { + /// + /// 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 OSProfile() + { + } + + /// Initializes a new instance of . + /// Specifies the name of the administrator account. <br><br> This property cannot be updated after the VM is created. <br><br> **Windows-only restriction:** Cannot end in "." <br><br> **Disallowed values:** "administrator", "admin", "user", "user1", "test", "user2", "test1", "user3", "admin1", "1", "123", "a", "actuser", "adm", "admin2", "aspnet", "backup", "console", "david", "guest", "john", "owner", "root", "server", "sql", "support", "support_388945a0", "sys", "test2", "test3", "user4", "user5". <br><br> **Minimum-length (Linux):** 1 character <br><br> **Max-length (Linux):** 64 characters <br><br> **Max-length (Windows):** 20 characters. + /// Specifies the password of the administrator account. <br><br> **Minimum-length (Windows):** 8 characters <br><br> **Minimum-length (Linux):** 6 characters <br><br> **Max-length (Windows):** 123 characters <br><br> **Max-length (Linux):** 72 characters <br><br> **Complexity requirements:** 3 out of 4 conditions below need to be fulfilled <br> Has lower characters <br>Has upper characters <br> Has a digit <br> Has a special character (Regex match [\W_]) <br><br> **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", "iloveyou!" <br><br> For resetting the password, see [How to reset the Remote Desktop service or its login password in a Windows VM](https://learn.microsoft.com/troubleshoot/azure/virtual-machines/reset-rdp) <br><br> For resetting root password, see [Manage users, SSH, and check or repair disks on Azure Linux VMs using the VMAccess Extension](https://learn.microsoft.com/troubleshoot/azure/virtual-machines/troubleshoot-ssh-connection). + /// + /// Specifies Windows operating system settings on the virtual machine. + /// 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 . + /// + /// Keeps track of any properties unknown to the library. + internal OSProfile(string adminUsername, string adminPassword, OSConfiguration osConfiguration, IDictionary serializedAdditionalRawData) + { + AdminUsername = adminUsername; + AdminPassword = adminPassword; + OSConfiguration = osConfiguration; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Specifies the name of the administrator account. <br><br> This property cannot be updated after the VM is created. <br><br> **Windows-only restriction:** Cannot end in "." <br><br> **Disallowed values:** "administrator", "admin", "user", "user1", "test", "user2", "test1", "user3", "admin1", "1", "123", "a", "actuser", "adm", "admin2", "aspnet", "backup", "console", "david", "guest", "john", "owner", "root", "server", "sql", "support", "support_388945a0", "sys", "test2", "test3", "user4", "user5". <br><br> **Minimum-length (Linux):** 1 character <br><br> **Max-length (Linux):** 64 characters <br><br> **Max-length (Windows):** 20 characters. + public string AdminUsername { get; set; } + /// Specifies the password of the administrator account. <br><br> **Minimum-length (Windows):** 8 characters <br><br> **Minimum-length (Linux):** 6 characters <br><br> **Max-length (Windows):** 123 characters <br><br> **Max-length (Linux):** 72 characters <br><br> **Complexity requirements:** 3 out of 4 conditions below need to be fulfilled <br> Has lower characters <br>Has upper characters <br> Has a digit <br> Has a special character (Regex match [\W_]) <br><br> **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", "iloveyou!" <br><br> For resetting the password, see [How to reset the Remote Desktop service or its login password in a Windows VM](https://learn.microsoft.com/troubleshoot/azure/virtual-machines/reset-rdp) <br><br> For resetting root password, see [Manage users, SSH, and check or repair disks on Azure Linux VMs using the VMAccess Extension](https://learn.microsoft.com/troubleshoot/azure/virtual-machines/troubleshoot-ssh-connection). + public string AdminPassword { get; set; } + /// + /// Specifies Windows operating system settings on the virtual machine. + /// 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 . + /// + public OSConfiguration OSConfiguration { get; set; } + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/OSSapConfiguration.Serialization.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/OSSapConfiguration.Serialization.cs new file mode 100644 index 000000000000..c01bc57963b7 --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/OSSapConfiguration.Serialization.cs @@ -0,0 +1,144 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.SapVirtualInstances.Models +{ + public partial class OSSapConfiguration : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(OSSapConfiguration)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(DeployerVmPackages)) + { + writer.WritePropertyName("deployerVmPackages"u8); + writer.WriteObjectValue(DeployerVmPackages, options); + } + if (Optional.IsDefined(SapFqdn)) + { + writer.WritePropertyName("sapFqdn"u8); + writer.WriteStringValue(SapFqdn); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + OSSapConfiguration 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(OSSapConfiguration)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeOSSapConfiguration(document.RootElement, options); + } + + internal static OSSapConfiguration DeserializeOSSapConfiguration(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + DeployerVmPackages deployerVmPackages = default; + string sapFqdn = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("deployerVmPackages"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + deployerVmPackages = DeployerVmPackages.DeserializeDeployerVmPackages(property.Value, options); + continue; + } + if (property.NameEquals("sapFqdn"u8)) + { + sapFqdn = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new OSSapConfiguration(deployerVmPackages, sapFqdn, 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(OSSapConfiguration)} does not support writing '{options.Format}' format."); + } + } + + OSSapConfiguration IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeOSSapConfiguration(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(OSSapConfiguration)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/OSSapConfiguration.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/OSSapConfiguration.cs new file mode 100644 index 000000000000..c1435f2ce3f4 --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/OSSapConfiguration.cs @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.SapVirtualInstances.Models +{ + /// Defines the OS and SAP Configurations for Deployment. + public partial class OSSapConfiguration + { + /// + /// 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 OSSapConfiguration() + { + } + + /// Initializes a new instance of . + /// The url and storage account ID where deployer VM packages are uploaded. + /// The FQDN to set for the SAP system. + /// Keeps track of any properties unknown to the library. + internal OSSapConfiguration(DeployerVmPackages deployerVmPackages, string sapFqdn, IDictionary serializedAdditionalRawData) + { + DeployerVmPackages = deployerVmPackages; + SapFqdn = sapFqdn; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The url and storage account ID where deployer VM packages are uploaded. + public DeployerVmPackages DeployerVmPackages { get; set; } + /// The FQDN to set for the SAP system. + public string SapFqdn { get; set; } + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/OSType.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/OSType.cs new file mode 100644 index 000000000000..c7ee614b79b8 --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/OSType.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.SapVirtualInstances.Models +{ + /// The OS Type. + internal readonly partial struct OSType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public OSType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string LinuxValue = "Linux"; + private const string WindowsValue = "Windows"; + + /// Linux OS Type. + public static OSType Linux { get; } = new OSType(LinuxValue); + /// Windows OS Type. + public static OSType Windows { get; } = new OSType(WindowsValue); + /// Determines if two values are the same. + public static bool operator ==(OSType left, OSType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(OSType left, OSType right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator OSType(string value) => new OSType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is OSType other && Equals(other); + /// + public bool Equals(OSType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/OperationStatusResult.Serialization.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/OperationStatusResult.Serialization.cs new file mode 100644 index 000000000000..98e830268a0f --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/OperationStatusResult.Serialization.cs @@ -0,0 +1,258 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.SapVirtualInstances.Models +{ + public partial class OperationStatusResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(OperationStatusResult)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(Id)) + { + writer.WritePropertyName("id"u8); + writer.WriteStringValue(Id); + } + if (Optional.IsDefined(Name)) + { + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name); + } + writer.WritePropertyName("status"u8); + writer.WriteStringValue(Status); + if (Optional.IsDefined(PercentComplete)) + { + writer.WritePropertyName("percentComplete"u8); + writer.WriteNumberValue(PercentComplete.Value); + } + if (Optional.IsDefined(StartOn)) + { + writer.WritePropertyName("startTime"u8); + writer.WriteStringValue(StartOn.Value, "O"); + } + if (Optional.IsDefined(EndOn)) + { + writer.WritePropertyName("endTime"u8); + writer.WriteStringValue(EndOn.Value, "O"); + } + if (Optional.IsCollectionDefined(Operations)) + { + writer.WritePropertyName("operations"u8); + writer.WriteStartArray(); + foreach (var item in Operations) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(Error)) + { + writer.WritePropertyName("error"u8); + JsonSerializer.Serialize(writer, Error); + } + if (options.Format != "W" && Optional.IsDefined(ResourceId)) + { + writer.WritePropertyName("resourceId"u8); + writer.WriteStringValue(ResourceId); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + OperationStatusResult 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(OperationStatusResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeOperationStatusResult(document.RootElement, options); + } + + internal static OperationStatusResult DeserializeOperationStatusResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ResourceIdentifier id = default; + string name = default; + string status = default; + double? percentComplete = default; + DateTimeOffset? startTime = default; + DateTimeOffset? endTime = default; + IReadOnlyList operations = default; + ResponseError error = default; + string resourceId = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("id"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + id = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("status"u8)) + { + status = property.Value.GetString(); + continue; + } + if (property.NameEquals("percentComplete"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + percentComplete = property.Value.GetDouble(); + continue; + } + if (property.NameEquals("startTime"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + startTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("endTime"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + endTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("operations"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(DeserializeOperationStatusResult(item, options)); + } + operations = array; + continue; + } + if (property.NameEquals("error"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + error = JsonSerializer.Deserialize(property.Value.GetRawText()); + continue; + } + if (property.NameEquals("resourceId"u8)) + { + resourceId = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new OperationStatusResult( + id, + name, + status, + percentComplete, + startTime, + endTime, + operations ?? new ChangeTrackingList(), + error, + resourceId, + 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(OperationStatusResult)} does not support writing '{options.Format}' format."); + } + } + + OperationStatusResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeOperationStatusResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(OperationStatusResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/OperationStatusResult.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/OperationStatusResult.cs new file mode 100644 index 000000000000..37b47a98223c --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/OperationStatusResult.cs @@ -0,0 +1,109 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.ResourceManager.SapVirtualInstances.Models +{ + /// The current status of an async operation. + public partial class OperationStatusResult + { + /// + /// 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 . + /// Operation status. + /// is null. + internal OperationStatusResult(string status) + { + Argument.AssertNotNull(status, nameof(status)); + + Status = status; + Operations = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// Fully qualified ID for the async operation. + /// Name of the async operation. + /// Operation status. + /// Percent of the operation that is complete. + /// The start time of the operation. + /// The end time of the operation. + /// The operations list. + /// If present, details of the operation error. + /// Fully qualified ID of the resource against which the original async operation was started. + /// Keeps track of any properties unknown to the library. + internal OperationStatusResult(ResourceIdentifier id, string name, string status, double? percentComplete, DateTimeOffset? startOn, DateTimeOffset? endOn, IReadOnlyList operations, ResponseError error, string resourceId, IDictionary serializedAdditionalRawData) + { + Id = id; + Name = name; + Status = status; + PercentComplete = percentComplete; + StartOn = startOn; + EndOn = endOn; + Operations = operations; + Error = error; + ResourceId = resourceId; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal OperationStatusResult() + { + } + + /// Fully qualified ID for the async operation. + public ResourceIdentifier Id { get; } + /// Name of the async operation. + public string Name { get; } + /// Operation status. + public string Status { get; } + /// Percent of the operation that is complete. + public double? PercentComplete { get; } + /// The start time of the operation. + public DateTimeOffset? StartOn { get; } + /// The end time of the operation. + public DateTimeOffset? EndOn { get; } + /// The operations list. + public IReadOnlyList Operations { get; } + /// If present, details of the operation error. + public ResponseError Error { get; } + /// Fully qualified ID of the resource against which the original async operation was started. + public string ResourceId { get; } + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SAPApplicationServerInstanceListResult.Serialization.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SAPApplicationServerInstanceListResult.Serialization.cs new file mode 100644 index 000000000000..22a662a426b7 --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SAPApplicationServerInstanceListResult.Serialization.cs @@ -0,0 +1,151 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.SapVirtualInstances.Models +{ + internal partial class SAPApplicationServerInstanceListResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SAPApplicationServerInstanceListResult)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var item in Value) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + if (Optional.IsDefined(NextLink)) + { + writer.WritePropertyName("nextLink"u8); + writer.WriteStringValue(NextLink.AbsoluteUri); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + SAPApplicationServerInstanceListResult 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(SAPApplicationServerInstanceListResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeSAPApplicationServerInstanceListResult(document.RootElement, options); + } + + internal static SAPApplicationServerInstanceListResult DeserializeSAPApplicationServerInstanceListResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IReadOnlyList value = default; + Uri nextLink = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(SapApplicationServerInstanceData.DeserializeSapApplicationServerInstanceData(item, options)); + } + value = array; + continue; + } + if (property.NameEquals("nextLink"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + nextLink = new Uri(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new SAPApplicationServerInstanceListResult(value, nextLink, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(SAPApplicationServerInstanceListResult)} does not support writing '{options.Format}' format."); + } + } + + SAPApplicationServerInstanceListResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeSAPApplicationServerInstanceListResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(SAPApplicationServerInstanceListResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SAPApplicationServerInstanceListResult.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SAPApplicationServerInstanceListResult.cs new file mode 100644 index 000000000000..489d532757e6 --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SAPApplicationServerInstanceListResult.cs @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.ResourceManager.SapVirtualInstances.Models +{ + /// The response of a SAPApplicationServerInstance list operation. + internal partial class SAPApplicationServerInstanceListResult + { + /// + /// 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 SAPApplicationServerInstance items on this page. + /// is null. + internal SAPApplicationServerInstanceListResult(IEnumerable value) + { + Argument.AssertNotNull(value, nameof(value)); + + Value = value.ToList(); + } + + /// Initializes a new instance of . + /// The SAPApplicationServerInstance items on this page. + /// The link to the next page of items. + /// Keeps track of any properties unknown to the library. + internal SAPApplicationServerInstanceListResult(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) + { + Value = value; + NextLink = nextLink; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal SAPApplicationServerInstanceListResult() + { + } + + /// The SAPApplicationServerInstance items on this page. + public IReadOnlyList Value { get; } + /// The link to the next page of items. + public Uri NextLink { get; } + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SAPCentralServerInstanceListResult.Serialization.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SAPCentralServerInstanceListResult.Serialization.cs new file mode 100644 index 000000000000..9f732b1b82f8 --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SAPCentralServerInstanceListResult.Serialization.cs @@ -0,0 +1,151 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.SapVirtualInstances.Models +{ + internal partial class SAPCentralServerInstanceListResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SAPCentralServerInstanceListResult)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var item in Value) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + if (Optional.IsDefined(NextLink)) + { + writer.WritePropertyName("nextLink"u8); + writer.WriteStringValue(NextLink.AbsoluteUri); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + SAPCentralServerInstanceListResult 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(SAPCentralServerInstanceListResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeSAPCentralServerInstanceListResult(document.RootElement, options); + } + + internal static SAPCentralServerInstanceListResult DeserializeSAPCentralServerInstanceListResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IReadOnlyList value = default; + Uri nextLink = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(SapCentralServerInstanceData.DeserializeSapCentralServerInstanceData(item, options)); + } + value = array; + continue; + } + if (property.NameEquals("nextLink"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + nextLink = new Uri(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new SAPCentralServerInstanceListResult(value, nextLink, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(SAPCentralServerInstanceListResult)} does not support writing '{options.Format}' format."); + } + } + + SAPCentralServerInstanceListResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeSAPCentralServerInstanceListResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(SAPCentralServerInstanceListResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SAPCentralServerInstanceListResult.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SAPCentralServerInstanceListResult.cs new file mode 100644 index 000000000000..e96dcd7dc003 --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SAPCentralServerInstanceListResult.cs @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.ResourceManager.SapVirtualInstances.Models +{ + /// The response of a SAPCentralServerInstance list operation. + internal partial class SAPCentralServerInstanceListResult + { + /// + /// 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 SAPCentralServerInstance items on this page. + /// is null. + internal SAPCentralServerInstanceListResult(IEnumerable value) + { + Argument.AssertNotNull(value, nameof(value)); + + Value = value.ToList(); + } + + /// Initializes a new instance of . + /// The SAPCentralServerInstance items on this page. + /// The link to the next page of items. + /// Keeps track of any properties unknown to the library. + internal SAPCentralServerInstanceListResult(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) + { + Value = value; + NextLink = nextLink; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal SAPCentralServerInstanceListResult() + { + } + + /// The SAPCentralServerInstance items on this page. + public IReadOnlyList Value { get; } + /// The link to the next page of items. + public Uri NextLink { get; } + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SAPDatabaseInstanceListResult.Serialization.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SAPDatabaseInstanceListResult.Serialization.cs new file mode 100644 index 000000000000..e8c3ab2c54a4 --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SAPDatabaseInstanceListResult.Serialization.cs @@ -0,0 +1,151 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.SapVirtualInstances.Models +{ + internal partial class SAPDatabaseInstanceListResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SAPDatabaseInstanceListResult)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var item in Value) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + if (Optional.IsDefined(NextLink)) + { + writer.WritePropertyName("nextLink"u8); + writer.WriteStringValue(NextLink.AbsoluteUri); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + SAPDatabaseInstanceListResult 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(SAPDatabaseInstanceListResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeSAPDatabaseInstanceListResult(document.RootElement, options); + } + + internal static SAPDatabaseInstanceListResult DeserializeSAPDatabaseInstanceListResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IReadOnlyList value = default; + Uri nextLink = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(SapDatabaseInstanceData.DeserializeSapDatabaseInstanceData(item, options)); + } + value = array; + continue; + } + if (property.NameEquals("nextLink"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + nextLink = new Uri(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new SAPDatabaseInstanceListResult(value, nextLink, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(SAPDatabaseInstanceListResult)} does not support writing '{options.Format}' format."); + } + } + + SAPDatabaseInstanceListResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeSAPDatabaseInstanceListResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(SAPDatabaseInstanceListResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SAPDatabaseInstanceListResult.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SAPDatabaseInstanceListResult.cs new file mode 100644 index 000000000000..e1105767d0dc --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SAPDatabaseInstanceListResult.cs @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.ResourceManager.SapVirtualInstances.Models +{ + /// The response of a SAPDatabaseInstance list operation. + internal partial class SAPDatabaseInstanceListResult + { + /// + /// 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 SAPDatabaseInstance items on this page. + /// is null. + internal SAPDatabaseInstanceListResult(IEnumerable value) + { + Argument.AssertNotNull(value, nameof(value)); + + Value = value.ToList(); + } + + /// Initializes a new instance of . + /// The SAPDatabaseInstance items on this page. + /// The link to the next page of items. + /// Keeps track of any properties unknown to the library. + internal SAPDatabaseInstanceListResult(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) + { + Value = value; + NextLink = nextLink; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal SAPDatabaseInstanceListResult() + { + } + + /// The SAPDatabaseInstance items on this page. + public IReadOnlyList Value { get; } + /// The link to the next page of items. + public Uri NextLink { get; } + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SAPVirtualInstanceIdentity.Serialization.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SAPVirtualInstanceIdentity.Serialization.cs new file mode 100644 index 000000000000..9de6cb670062 --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SAPVirtualInstanceIdentity.Serialization.cs @@ -0,0 +1,153 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.SapVirtualInstances.Models +{ + public partial class SAPVirtualInstanceIdentity : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SAPVirtualInstanceIdentity)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("type"u8); + writer.WriteStringValue(Type.ToString()); + if (Optional.IsCollectionDefined(UserAssignedIdentities)) + { + writer.WritePropertyName("userAssignedIdentities"u8); + writer.WriteStartObject(); + foreach (var item in UserAssignedIdentities) + { + writer.WritePropertyName(item.Key); + JsonSerializer.Serialize(writer, item.Value); + } + writer.WriteEndObject(); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + SAPVirtualInstanceIdentity 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(SAPVirtualInstanceIdentity)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeSAPVirtualInstanceIdentity(document.RootElement, options); + } + + internal static SAPVirtualInstanceIdentity DeserializeSAPVirtualInstanceIdentity(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + SAPVirtualInstanceIdentityType type = default; + IDictionary userAssignedIdentities = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("type"u8)) + { + type = new SAPVirtualInstanceIdentityType(property.Value.GetString()); + continue; + } + if (property.NameEquals("userAssignedIdentities"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var property0 in property.Value.EnumerateObject()) + { + dictionary.Add(property0.Name, JsonSerializer.Deserialize(property0.Value.GetRawText())); + } + userAssignedIdentities = dictionary; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new SAPVirtualInstanceIdentity(type, userAssignedIdentities ?? new ChangeTrackingDictionary(), 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(SAPVirtualInstanceIdentity)} does not support writing '{options.Format}' format."); + } + } + + SAPVirtualInstanceIdentity IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeSAPVirtualInstanceIdentity(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(SAPVirtualInstanceIdentity)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SAPVirtualInstanceIdentity.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SAPVirtualInstanceIdentity.cs new file mode 100644 index 000000000000..8067eca50865 --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SAPVirtualInstanceIdentity.cs @@ -0,0 +1,78 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.SapVirtualInstances.Models +{ + /// Managed service identity (user assigned identities). + public partial class SAPVirtualInstanceIdentity + { + /// + /// 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 type of managed identity assigned to this resource. + public SAPVirtualInstanceIdentity(SAPVirtualInstanceIdentityType type) + { + Type = type; + UserAssignedIdentities = new ChangeTrackingDictionary(); + } + + /// Initializes a new instance of . + /// The type of managed identity assigned to this resource. + /// The identities assigned to this resource by the user. + /// Keeps track of any properties unknown to the library. + internal SAPVirtualInstanceIdentity(SAPVirtualInstanceIdentityType type, IDictionary userAssignedIdentities, IDictionary serializedAdditionalRawData) + { + Type = type; + UserAssignedIdentities = userAssignedIdentities; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal SAPVirtualInstanceIdentity() + { + } + + /// The type of managed identity assigned to this resource. + public SAPVirtualInstanceIdentityType Type { get; set; } + /// The identities assigned to this resource by the user. + public IDictionary UserAssignedIdentities { get; } + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SAPVirtualInstanceIdentityType.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SAPVirtualInstanceIdentityType.cs new file mode 100644 index 000000000000..8d542c8db648 --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SAPVirtualInstanceIdentityType.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.SapVirtualInstances.Models +{ + /// Type of managed service identity (where only None and UserAssigned types are allowed). + public readonly partial struct SAPVirtualInstanceIdentityType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public SAPVirtualInstanceIdentityType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string NoneValue = "None"; + private const string UserAssignedValue = "UserAssigned"; + + /// No managed identity. + public static SAPVirtualInstanceIdentityType None { get; } = new SAPVirtualInstanceIdentityType(NoneValue); + /// User assigned managed identity. + public static SAPVirtualInstanceIdentityType UserAssigned { get; } = new SAPVirtualInstanceIdentityType(UserAssignedValue); + /// Determines if two values are the same. + public static bool operator ==(SAPVirtualInstanceIdentityType left, SAPVirtualInstanceIdentityType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(SAPVirtualInstanceIdentityType left, SAPVirtualInstanceIdentityType right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator SAPVirtualInstanceIdentityType(string value) => new SAPVirtualInstanceIdentityType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is SAPVirtualInstanceIdentityType other && Equals(other); + /// + public bool Equals(SAPVirtualInstanceIdentityType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SAPVirtualInstanceListResult.Serialization.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SAPVirtualInstanceListResult.Serialization.cs new file mode 100644 index 000000000000..9c446629ca95 --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SAPVirtualInstanceListResult.Serialization.cs @@ -0,0 +1,151 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.SapVirtualInstances.Models +{ + internal partial class SAPVirtualInstanceListResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SAPVirtualInstanceListResult)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var item in Value) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + if (Optional.IsDefined(NextLink)) + { + writer.WritePropertyName("nextLink"u8); + writer.WriteStringValue(NextLink.AbsoluteUri); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + SAPVirtualInstanceListResult 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(SAPVirtualInstanceListResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeSAPVirtualInstanceListResult(document.RootElement, options); + } + + internal static SAPVirtualInstanceListResult DeserializeSAPVirtualInstanceListResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IReadOnlyList value = default; + Uri nextLink = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(SapVirtualInstanceData.DeserializeSapVirtualInstanceData(item, options)); + } + value = array; + continue; + } + if (property.NameEquals("nextLink"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + nextLink = new Uri(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new SAPVirtualInstanceListResult(value, nextLink, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(SAPVirtualInstanceListResult)} does not support writing '{options.Format}' format."); + } + } + + SAPVirtualInstanceListResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeSAPVirtualInstanceListResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(SAPVirtualInstanceListResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SAPVirtualInstanceListResult.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SAPVirtualInstanceListResult.cs new file mode 100644 index 000000000000..5b521df7e308 --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SAPVirtualInstanceListResult.cs @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.ResourceManager.SapVirtualInstances.Models +{ + /// The response of a SAPVirtualInstance list operation. + internal partial class SAPVirtualInstanceListResult + { + /// + /// 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 SAPVirtualInstance items on this page. + /// is null. + internal SAPVirtualInstanceListResult(IEnumerable value) + { + Argument.AssertNotNull(value, nameof(value)); + + Value = value.ToList(); + } + + /// Initializes a new instance of . + /// The SAPVirtualInstance items on this page. + /// The link to the next page of items. + /// Keeps track of any properties unknown to the library. + internal SAPVirtualInstanceListResult(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) + { + Value = value; + NextLink = nextLink; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal SAPVirtualInstanceListResult() + { + } + + /// The SAPVirtualInstance items on this page. + public IReadOnlyList Value { get; } + /// The link to the next page of items. + public Uri NextLink { get; } + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapApplicationServerInstancePatch.Serialization.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapApplicationServerInstancePatch.Serialization.cs new file mode 100644 index 000000000000..9c0677dca39d --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapApplicationServerInstancePatch.Serialization.cs @@ -0,0 +1,144 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.SapVirtualInstances.Models +{ + public partial class SapApplicationServerInstancePatch : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SapApplicationServerInstancePatch)} does not support writing '{format}' format."); + } + + if (Optional.IsCollectionDefined(Tags)) + { + writer.WritePropertyName("tags"u8); + writer.WriteStartObject(); + foreach (var item in Tags) + { + writer.WritePropertyName(item.Key); + writer.WriteStringValue(item.Value); + } + writer.WriteEndObject(); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + SapApplicationServerInstancePatch 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(SapApplicationServerInstancePatch)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeSapApplicationServerInstancePatch(document.RootElement, options); + } + + internal static SapApplicationServerInstancePatch DeserializeSapApplicationServerInstancePatch(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IDictionary tags = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("tags"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var property0 in property.Value.EnumerateObject()) + { + dictionary.Add(property0.Name, property0.Value.GetString()); + } + tags = dictionary; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new SapApplicationServerInstancePatch(tags ?? new ChangeTrackingDictionary(), 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(SapApplicationServerInstancePatch)} does not support writing '{options.Format}' format."); + } + } + + SapApplicationServerInstancePatch IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeSapApplicationServerInstancePatch(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(SapApplicationServerInstancePatch)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapApplicationServerInstancePatch.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapApplicationServerInstancePatch.cs new file mode 100644 index 000000000000..15de09ef1995 --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapApplicationServerInstancePatch.cs @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.SapVirtualInstances.Models +{ + /// Defines the request body for updating SAP Application Instance. + public partial class SapApplicationServerInstancePatch + { + /// + /// 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 SapApplicationServerInstancePatch() + { + Tags = new ChangeTrackingDictionary(); + } + + /// Initializes a new instance of . + /// Gets or sets the Resource tags. + /// Keeps track of any properties unknown to the library. + internal SapApplicationServerInstancePatch(IDictionary tags, IDictionary serializedAdditionalRawData) + { + Tags = tags; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Gets or sets the Resource tags. + public IDictionary Tags { get; } + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapApplicationServerProperties.Serialization.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapApplicationServerProperties.Serialization.cs new file mode 100644 index 000000000000..ffcb4c291695 --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapApplicationServerProperties.Serialization.cs @@ -0,0 +1,358 @@ +// 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.Resources.Models; + +namespace Azure.ResourceManager.SapVirtualInstances.Models +{ + public partial class SapApplicationServerProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SapApplicationServerProperties)} does not support writing '{format}' format."); + } + + if (options.Format != "W" && Optional.IsDefined(InstanceNo)) + { + writer.WritePropertyName("instanceNo"u8); + writer.WriteStringValue(InstanceNo); + } + if (options.Format != "W" && Optional.IsDefined(Subnet)) + { + writer.WritePropertyName("subnet"u8); + writer.WriteStringValue(Subnet); + } + if (options.Format != "W" && Optional.IsDefined(Hostname)) + { + writer.WritePropertyName("hostname"u8); + writer.WriteStringValue(Hostname); + } + if (options.Format != "W" && Optional.IsDefined(KernelVersion)) + { + writer.WritePropertyName("kernelVersion"u8); + writer.WriteStringValue(KernelVersion); + } + if (options.Format != "W" && Optional.IsDefined(KernelPatch)) + { + writer.WritePropertyName("kernelPatch"u8); + writer.WriteStringValue(KernelPatch); + } + if (options.Format != "W" && Optional.IsDefined(IPAddress)) + { + writer.WritePropertyName("ipAddress"u8); + writer.WriteStringValue(IPAddress); + } + if (options.Format != "W" && Optional.IsDefined(GatewayPort)) + { + writer.WritePropertyName("gatewayPort"u8); + writer.WriteNumberValue(GatewayPort.Value); + } + if (options.Format != "W" && Optional.IsDefined(IcmHttpPort)) + { + writer.WritePropertyName("icmHttpPort"u8); + writer.WriteNumberValue(IcmHttpPort.Value); + } + if (options.Format != "W" && Optional.IsDefined(IcmHttpsPort)) + { + writer.WritePropertyName("icmHttpsPort"u8); + writer.WriteNumberValue(IcmHttpsPort.Value); + } + if (options.Format != "W" && Optional.IsDefined(DispatcherStatus)) + { + writer.WritePropertyName("dispatcherStatus"u8); + writer.WriteStringValue(DispatcherStatus); + } + if (options.Format != "W" && Optional.IsDefined(LoadBalancerDetails)) + { + writer.WritePropertyName("loadBalancerDetails"u8); + JsonSerializer.Serialize(writer, LoadBalancerDetails); + } + if (options.Format != "W" && Optional.IsCollectionDefined(VmDetails)) + { + writer.WritePropertyName("vmDetails"u8); + writer.WriteStartArray(); + foreach (var item in VmDetails) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && Optional.IsDefined(Status)) + { + writer.WritePropertyName("status"u8); + writer.WriteStringValue(Status.Value.ToString()); + } + if (options.Format != "W" && Optional.IsDefined(Health)) + { + writer.WritePropertyName("health"u8); + writer.WriteStringValue(Health.Value.ToString()); + } + if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) + { + writer.WritePropertyName("provisioningState"u8); + writer.WriteStringValue(ProvisioningState.Value.ToString()); + } + if (options.Format != "W" && Optional.IsDefined(Errors)) + { + writer.WritePropertyName("errors"u8); + writer.WriteObjectValue(Errors, options); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + SapApplicationServerProperties 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(SapApplicationServerProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeSapApplicationServerProperties(document.RootElement, options); + } + + internal static SapApplicationServerProperties DeserializeSapApplicationServerProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string instanceNo = default; + string subnet = default; + string hostname = default; + string kernelVersion = default; + string kernelPatch = default; + string ipAddress = default; + long? gatewayPort = default; + long? icmHttpPort = default; + long? icmHttpsPort = default; + string dispatcherStatus = default; + SubResource loadBalancerDetails = default; + IReadOnlyList vmDetails = default; + SapVirtualInstanceStatus? status = default; + SapHealthState? health = default; + SapVirtualInstanceProvisioningState? provisioningState = default; + SapVirtualInstanceError errors = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("instanceNo"u8)) + { + instanceNo = property.Value.GetString(); + continue; + } + if (property.NameEquals("subnet"u8)) + { + subnet = property.Value.GetString(); + continue; + } + if (property.NameEquals("hostname"u8)) + { + hostname = property.Value.GetString(); + continue; + } + if (property.NameEquals("kernelVersion"u8)) + { + kernelVersion = property.Value.GetString(); + continue; + } + if (property.NameEquals("kernelPatch"u8)) + { + kernelPatch = property.Value.GetString(); + continue; + } + if (property.NameEquals("ipAddress"u8)) + { + ipAddress = property.Value.GetString(); + continue; + } + if (property.NameEquals("gatewayPort"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + gatewayPort = property.Value.GetInt64(); + continue; + } + if (property.NameEquals("icmHttpPort"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + icmHttpPort = property.Value.GetInt64(); + continue; + } + if (property.NameEquals("icmHttpsPort"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + icmHttpsPort = property.Value.GetInt64(); + continue; + } + if (property.NameEquals("dispatcherStatus"u8)) + { + dispatcherStatus = property.Value.GetString(); + continue; + } + if (property.NameEquals("loadBalancerDetails"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + loadBalancerDetails = JsonSerializer.Deserialize(property.Value.GetRawText()); + continue; + } + if (property.NameEquals("vmDetails"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ApplicationServerVmDetails.DeserializeApplicationServerVmDetails(item, options)); + } + vmDetails = array; + continue; + } + if (property.NameEquals("status"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + status = new SapVirtualInstanceStatus(property.Value.GetString()); + continue; + } + if (property.NameEquals("health"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + health = new SapHealthState(property.Value.GetString()); + continue; + } + if (property.NameEquals("provisioningState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + provisioningState = new SapVirtualInstanceProvisioningState(property.Value.GetString()); + continue; + } + if (property.NameEquals("errors"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + errors = SapVirtualInstanceError.DeserializeSapVirtualInstanceError(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new SapApplicationServerProperties( + instanceNo, + subnet, + hostname, + kernelVersion, + kernelPatch, + ipAddress, + gatewayPort, + icmHttpPort, + icmHttpsPort, + dispatcherStatus, + loadBalancerDetails, + vmDetails ?? new ChangeTrackingList(), + status, + health, + provisioningState, + errors, + 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(SapApplicationServerProperties)} does not support writing '{options.Format}' format."); + } + } + + SapApplicationServerProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeSapApplicationServerProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(SapApplicationServerProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapApplicationServerProperties.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapApplicationServerProperties.cs new file mode 100644 index 000000000000..d3d6af0f324d --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapApplicationServerProperties.cs @@ -0,0 +1,139 @@ +// 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.Resources.Models; + +namespace Azure.ResourceManager.SapVirtualInstances.Models +{ + /// Defines the SAP Application Server instance properties. + public partial class SapApplicationServerProperties + { + /// + /// 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 SapApplicationServerProperties() + { + VmDetails = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// Application server Instance Number. + /// Application server Subnet. + /// Application server instance SAP hostname. + /// Application server instance SAP Kernel Version. + /// Application server instance SAP Kernel Patch level. + /// Application server instance SAP IP Address. + /// Application server instance gateway Port. + /// Application server instance ICM HTTP Port. + /// Application server instance ICM HTTPS Port. + /// Application server instance dispatcher status. + /// The Load Balancer details such as LoadBalancer ID attached to Application Server Virtual Machines. + /// The list of virtual machines. + /// Defines the SAP Instance status. + /// Defines the health of SAP Instances. + /// Defines the provisioning states. + /// Defines the Application Instance errors. + /// Keeps track of any properties unknown to the library. + internal SapApplicationServerProperties(string instanceNo, string subnet, string hostname, string kernelVersion, string kernelPatch, string ipAddress, long? gatewayPort, long? icmHttpPort, long? icmHttpsPort, string dispatcherStatus, SubResource loadBalancerDetails, IReadOnlyList vmDetails, SapVirtualInstanceStatus? status, SapHealthState? health, SapVirtualInstanceProvisioningState? provisioningState, SapVirtualInstanceError errors, IDictionary serializedAdditionalRawData) + { + InstanceNo = instanceNo; + Subnet = subnet; + Hostname = hostname; + KernelVersion = kernelVersion; + KernelPatch = kernelPatch; + IPAddress = ipAddress; + GatewayPort = gatewayPort; + IcmHttpPort = icmHttpPort; + IcmHttpsPort = icmHttpsPort; + DispatcherStatus = dispatcherStatus; + LoadBalancerDetails = loadBalancerDetails; + VmDetails = vmDetails; + Status = status; + Health = health; + ProvisioningState = provisioningState; + Errors = errors; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Application server Instance Number. + public string InstanceNo { get; } + /// Application server Subnet. + public string Subnet { get; } + /// Application server instance SAP hostname. + public string Hostname { get; } + /// Application server instance SAP Kernel Version. + public string KernelVersion { get; } + /// Application server instance SAP Kernel Patch level. + public string KernelPatch { get; } + /// Application server instance SAP IP Address. + public string IPAddress { get; } + /// Application server instance gateway Port. + public long? GatewayPort { get; } + /// Application server instance ICM HTTP Port. + public long? IcmHttpPort { get; } + /// Application server instance ICM HTTPS Port. + public long? IcmHttpsPort { get; } + /// Application server instance dispatcher status. + public string DispatcherStatus { get; } + /// The Load Balancer details such as LoadBalancer ID attached to Application Server Virtual Machines. + internal SubResource LoadBalancerDetails { get; } + /// Gets Id. + public ResourceIdentifier LoadBalancerDetailsId + { + get => LoadBalancerDetails?.Id; + } + + /// The list of virtual machines. + public IReadOnlyList VmDetails { get; } + /// Defines the SAP Instance status. + public SapVirtualInstanceStatus? Status { get; } + /// Defines the health of SAP Instances. + public SapHealthState? Health { get; } + /// Defines the provisioning states. + public SapVirtualInstanceProvisioningState? ProvisioningState { get; } + /// Defines the Application Instance errors. + internal SapVirtualInstanceError Errors { get; } + /// The Virtual Instance for SAP error body. + public ErrorInformation ErrorsProperties + { + get => Errors?.Properties; + } + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapAvailabilityZoneDetailsContent.Serialization.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapAvailabilityZoneDetailsContent.Serialization.cs new file mode 100644 index 000000000000..8e7729759a88 --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapAvailabilityZoneDetailsContent.Serialization.cs @@ -0,0 +1,142 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.SapVirtualInstances.Models +{ + public partial class SapAvailabilityZoneDetailsContent : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SapAvailabilityZoneDetailsContent)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("appLocation"u8); + writer.WriteStringValue(AppLocation); + writer.WritePropertyName("sapProduct"u8); + writer.WriteStringValue(SapProduct.ToString()); + writer.WritePropertyName("databaseType"u8); + writer.WriteStringValue(DatabaseType.ToString()); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + SapAvailabilityZoneDetailsContent 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(SapAvailabilityZoneDetailsContent)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeSapAvailabilityZoneDetailsContent(document.RootElement, options); + } + + internal static SapAvailabilityZoneDetailsContent DeserializeSapAvailabilityZoneDetailsContent(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string appLocation = default; + SapProductType sapProduct = default; + SapDatabaseType databaseType = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("appLocation"u8)) + { + appLocation = property.Value.GetString(); + continue; + } + if (property.NameEquals("sapProduct"u8)) + { + sapProduct = new SapProductType(property.Value.GetString()); + continue; + } + if (property.NameEquals("databaseType"u8)) + { + databaseType = new SapDatabaseType(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new SapAvailabilityZoneDetailsContent(appLocation, sapProduct, databaseType, 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(SapAvailabilityZoneDetailsContent)} does not support writing '{options.Format}' format."); + } + } + + SapAvailabilityZoneDetailsContent IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeSapAvailabilityZoneDetailsContent(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(SapAvailabilityZoneDetailsContent)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapAvailabilityZoneDetailsContent.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapAvailabilityZoneDetailsContent.cs new file mode 100644 index 000000000000..1e7a1d088400 --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapAvailabilityZoneDetailsContent.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; + +namespace Azure.ResourceManager.SapVirtualInstances.Models +{ + /// The SAP request to get list of availability zones. + public partial class SapAvailabilityZoneDetailsContent + { + /// + /// 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 geo-location where the SAP resources will be created. + /// Defines the SAP Product type. + /// The database type. Eg: HANA, DB2, etc. + /// is null. + public SapAvailabilityZoneDetailsContent(string appLocation, SapProductType sapProduct, SapDatabaseType databaseType) + { + Argument.AssertNotNull(appLocation, nameof(appLocation)); + + AppLocation = appLocation; + SapProduct = sapProduct; + DatabaseType = databaseType; + } + + /// Initializes a new instance of . + /// The geo-location where the SAP resources will be created. + /// Defines the SAP Product type. + /// The database type. Eg: HANA, DB2, etc. + /// Keeps track of any properties unknown to the library. + internal SapAvailabilityZoneDetailsContent(string appLocation, SapProductType sapProduct, SapDatabaseType databaseType, IDictionary serializedAdditionalRawData) + { + AppLocation = appLocation; + SapProduct = sapProduct; + DatabaseType = databaseType; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal SapAvailabilityZoneDetailsContent() + { + } + + /// The geo-location where the SAP resources will be created. + public string AppLocation { get; } + /// Defines the SAP Product type. + public SapProductType SapProduct { get; } + /// The database type. Eg: HANA, DB2, etc. + public SapDatabaseType DatabaseType { get; } + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapAvailabilityZoneDetailsResult.Serialization.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapAvailabilityZoneDetailsResult.Serialization.cs new file mode 100644 index 000000000000..f881f34c7485 --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapAvailabilityZoneDetailsResult.Serialization.cs @@ -0,0 +1,143 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.SapVirtualInstances.Models +{ + public partial class SapAvailabilityZoneDetailsResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SapAvailabilityZoneDetailsResult)} does not support writing '{format}' format."); + } + + if (Optional.IsCollectionDefined(AvailabilityZonePairs)) + { + writer.WritePropertyName("availabilityZonePairs"u8); + writer.WriteStartArray(); + foreach (var item in AvailabilityZonePairs) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + SapAvailabilityZoneDetailsResult 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(SapAvailabilityZoneDetailsResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeSapAvailabilityZoneDetailsResult(document.RootElement, options); + } + + internal static SapAvailabilityZoneDetailsResult DeserializeSapAvailabilityZoneDetailsResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IReadOnlyList availabilityZonePairs = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("availabilityZonePairs"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(SapAvailabilityZonePair.DeserializeSapAvailabilityZonePair(item, options)); + } + availabilityZonePairs = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new SapAvailabilityZoneDetailsResult(availabilityZonePairs ?? new ChangeTrackingList(), serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(SapAvailabilityZoneDetailsResult)} does not support writing '{options.Format}' format."); + } + } + + SapAvailabilityZoneDetailsResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeSapAvailabilityZoneDetailsResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(SapAvailabilityZoneDetailsResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapAvailabilityZoneDetailsResult.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapAvailabilityZoneDetailsResult.cs new file mode 100644 index 000000000000..d0f35ceb0bb2 --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapAvailabilityZoneDetailsResult.cs @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.SapVirtualInstances.Models +{ + /// The list of supported availability zone pairs which are part of SAP HA deployment. + public partial class SapAvailabilityZoneDetailsResult + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + internal SapAvailabilityZoneDetailsResult() + { + AvailabilityZonePairs = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// Gets the list of availability zone pairs. + /// Keeps track of any properties unknown to the library. + internal SapAvailabilityZoneDetailsResult(IReadOnlyList availabilityZonePairs, IDictionary serializedAdditionalRawData) + { + AvailabilityZonePairs = availabilityZonePairs; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Gets the list of availability zone pairs. + public IReadOnlyList AvailabilityZonePairs { get; } + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapAvailabilityZonePair.Serialization.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapAvailabilityZonePair.Serialization.cs new file mode 100644 index 000000000000..c38cbf30d325 --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapAvailabilityZonePair.Serialization.cs @@ -0,0 +1,148 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.SapVirtualInstances.Models +{ + public partial class SapAvailabilityZonePair : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SapAvailabilityZonePair)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(ZoneA)) + { + writer.WritePropertyName("zoneA"u8); + writer.WriteNumberValue(ZoneA.Value); + } + if (Optional.IsDefined(ZoneB)) + { + writer.WritePropertyName("zoneB"u8); + writer.WriteNumberValue(ZoneB.Value); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + SapAvailabilityZonePair 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(SapAvailabilityZonePair)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeSapAvailabilityZonePair(document.RootElement, options); + } + + internal static SapAvailabilityZonePair DeserializeSapAvailabilityZonePair(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + long? zoneA = default; + long? zoneB = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("zoneA"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + zoneA = property.Value.GetInt64(); + continue; + } + if (property.NameEquals("zoneB"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + zoneB = property.Value.GetInt64(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new SapAvailabilityZonePair(zoneA, zoneB, 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(SapAvailabilityZonePair)} does not support writing '{options.Format}' format."); + } + } + + SapAvailabilityZonePair IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeSapAvailabilityZonePair(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(SapAvailabilityZonePair)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapAvailabilityZonePair.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapAvailabilityZonePair.cs new file mode 100644 index 000000000000..81233b446ae0 --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapAvailabilityZonePair.cs @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.SapVirtualInstances.Models +{ + /// The SAP Availability Zone Pair. + public partial class SapAvailabilityZonePair + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + internal SapAvailabilityZonePair() + { + } + + /// Initializes a new instance of . + /// The zone A. + /// The zone B. + /// Keeps track of any properties unknown to the library. + internal SapAvailabilityZonePair(long? zoneA, long? zoneB, IDictionary serializedAdditionalRawData) + { + ZoneA = zoneA; + ZoneB = zoneB; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The zone A. + public long? ZoneA { get; } + /// The zone B. + public long? ZoneB { get; } + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapCentralServerInstancePatch.Serialization.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapCentralServerInstancePatch.Serialization.cs new file mode 100644 index 000000000000..241a2d1f6d27 --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapCentralServerInstancePatch.Serialization.cs @@ -0,0 +1,144 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.SapVirtualInstances.Models +{ + public partial class SapCentralServerInstancePatch : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SapCentralServerInstancePatch)} does not support writing '{format}' format."); + } + + if (Optional.IsCollectionDefined(Tags)) + { + writer.WritePropertyName("tags"u8); + writer.WriteStartObject(); + foreach (var item in Tags) + { + writer.WritePropertyName(item.Key); + writer.WriteStringValue(item.Value); + } + writer.WriteEndObject(); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + SapCentralServerInstancePatch 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(SapCentralServerInstancePatch)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeSapCentralServerInstancePatch(document.RootElement, options); + } + + internal static SapCentralServerInstancePatch DeserializeSapCentralServerInstancePatch(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IDictionary tags = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("tags"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var property0 in property.Value.EnumerateObject()) + { + dictionary.Add(property0.Name, property0.Value.GetString()); + } + tags = dictionary; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new SapCentralServerInstancePatch(tags ?? new ChangeTrackingDictionary(), 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(SapCentralServerInstancePatch)} does not support writing '{options.Format}' format."); + } + } + + SapCentralServerInstancePatch IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeSapCentralServerInstancePatch(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(SapCentralServerInstancePatch)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapCentralServerInstancePatch.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapCentralServerInstancePatch.cs new file mode 100644 index 000000000000..9b4349b1b46b --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapCentralServerInstancePatch.cs @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.SapVirtualInstances.Models +{ + /// Defines the request body for updating SAP Central Instance. + public partial class SapCentralServerInstancePatch + { + /// + /// 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 SapCentralServerInstancePatch() + { + Tags = new ChangeTrackingDictionary(); + } + + /// Initializes a new instance of . + /// Gets or sets the Resource tags. + /// Keeps track of any properties unknown to the library. + internal SapCentralServerInstancePatch(IDictionary tags, IDictionary serializedAdditionalRawData) + { + Tags = tags; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Gets or sets the Resource tags. + public IDictionary Tags { get; } + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapCentralServerProperties.Serialization.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapCentralServerProperties.Serialization.cs new file mode 100644 index 000000000000..dd06b3a4f44f --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapCentralServerProperties.Serialization.cs @@ -0,0 +1,338 @@ +// 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.Resources.Models; + +namespace Azure.ResourceManager.SapVirtualInstances.Models +{ + public partial class SapCentralServerProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SapCentralServerProperties)} does not support writing '{format}' format."); + } + + if (options.Format != "W" && Optional.IsDefined(InstanceNo)) + { + writer.WritePropertyName("instanceNo"u8); + writer.WriteStringValue(InstanceNo); + } + if (options.Format != "W" && Optional.IsDefined(Subnet)) + { + writer.WritePropertyName("subnet"u8); + writer.WriteStringValue(Subnet); + } + if (Optional.IsDefined(MessageServerProperties)) + { + writer.WritePropertyName("messageServerProperties"u8); + writer.WriteObjectValue(MessageServerProperties, options); + } + if (Optional.IsDefined(EnqueueServerProperties)) + { + writer.WritePropertyName("enqueueServerProperties"u8); + writer.WriteObjectValue(EnqueueServerProperties, options); + } + if (Optional.IsDefined(GatewayServerProperties)) + { + writer.WritePropertyName("gatewayServerProperties"u8); + writer.WriteObjectValue(GatewayServerProperties, options); + } + if (Optional.IsDefined(EnqueueReplicationServerProperties)) + { + writer.WritePropertyName("enqueueReplicationServerProperties"u8); + writer.WriteObjectValue(EnqueueReplicationServerProperties, options); + } + if (options.Format != "W" && Optional.IsDefined(KernelVersion)) + { + writer.WritePropertyName("kernelVersion"u8); + writer.WriteStringValue(KernelVersion); + } + if (options.Format != "W" && Optional.IsDefined(KernelPatch)) + { + writer.WritePropertyName("kernelPatch"u8); + writer.WriteStringValue(KernelPatch); + } + if (options.Format != "W" && Optional.IsDefined(LoadBalancerDetails)) + { + writer.WritePropertyName("loadBalancerDetails"u8); + JsonSerializer.Serialize(writer, LoadBalancerDetails); + } + if (options.Format != "W" && Optional.IsCollectionDefined(VmDetails)) + { + writer.WritePropertyName("vmDetails"u8); + writer.WriteStartArray(); + foreach (var item in VmDetails) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && Optional.IsDefined(Status)) + { + writer.WritePropertyName("status"u8); + writer.WriteStringValue(Status.Value.ToString()); + } + if (options.Format != "W" && Optional.IsDefined(Health)) + { + writer.WritePropertyName("health"u8); + writer.WriteStringValue(Health.Value.ToString()); + } + if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) + { + writer.WritePropertyName("provisioningState"u8); + writer.WriteStringValue(ProvisioningState.Value.ToString()); + } + if (options.Format != "W" && Optional.IsDefined(Errors)) + { + writer.WritePropertyName("errors"u8); + writer.WriteObjectValue(Errors, options); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + SapCentralServerProperties 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(SapCentralServerProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeSapCentralServerProperties(document.RootElement, options); + } + + internal static SapCentralServerProperties DeserializeSapCentralServerProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string instanceNo = default; + string subnet = default; + MessageServerProperties messageServerProperties = default; + EnqueueServerProperties enqueueServerProperties = default; + GatewayServerProperties gatewayServerProperties = default; + EnqueueReplicationServerProperties enqueueReplicationServerProperties = default; + string kernelVersion = default; + string kernelPatch = default; + SubResource loadBalancerDetails = default; + IReadOnlyList vmDetails = default; + SapVirtualInstanceStatus? status = default; + SapHealthState? health = default; + SapVirtualInstanceProvisioningState? provisioningState = default; + SapVirtualInstanceError errors = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("instanceNo"u8)) + { + instanceNo = property.Value.GetString(); + continue; + } + if (property.NameEquals("subnet"u8)) + { + subnet = property.Value.GetString(); + continue; + } + if (property.NameEquals("messageServerProperties"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + messageServerProperties = MessageServerProperties.DeserializeMessageServerProperties(property.Value, options); + continue; + } + if (property.NameEquals("enqueueServerProperties"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + enqueueServerProperties = EnqueueServerProperties.DeserializeEnqueueServerProperties(property.Value, options); + continue; + } + if (property.NameEquals("gatewayServerProperties"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + gatewayServerProperties = GatewayServerProperties.DeserializeGatewayServerProperties(property.Value, options); + continue; + } + if (property.NameEquals("enqueueReplicationServerProperties"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + enqueueReplicationServerProperties = EnqueueReplicationServerProperties.DeserializeEnqueueReplicationServerProperties(property.Value, options); + continue; + } + if (property.NameEquals("kernelVersion"u8)) + { + kernelVersion = property.Value.GetString(); + continue; + } + if (property.NameEquals("kernelPatch"u8)) + { + kernelPatch = property.Value.GetString(); + continue; + } + if (property.NameEquals("loadBalancerDetails"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + loadBalancerDetails = JsonSerializer.Deserialize(property.Value.GetRawText()); + continue; + } + if (property.NameEquals("vmDetails"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(CentralServerVmDetails.DeserializeCentralServerVmDetails(item, options)); + } + vmDetails = array; + continue; + } + if (property.NameEquals("status"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + status = new SapVirtualInstanceStatus(property.Value.GetString()); + continue; + } + if (property.NameEquals("health"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + health = new SapHealthState(property.Value.GetString()); + continue; + } + if (property.NameEquals("provisioningState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + provisioningState = new SapVirtualInstanceProvisioningState(property.Value.GetString()); + continue; + } + if (property.NameEquals("errors"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + errors = SapVirtualInstanceError.DeserializeSapVirtualInstanceError(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new SapCentralServerProperties( + instanceNo, + subnet, + messageServerProperties, + enqueueServerProperties, + gatewayServerProperties, + enqueueReplicationServerProperties, + kernelVersion, + kernelPatch, + loadBalancerDetails, + vmDetails ?? new ChangeTrackingList(), + status, + health, + provisioningState, + errors, + 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(SapCentralServerProperties)} does not support writing '{options.Format}' format."); + } + } + + SapCentralServerProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeSapCentralServerProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(SapCentralServerProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapCentralServerProperties.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapCentralServerProperties.cs new file mode 100644 index 000000000000..2c46c90b32bd --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapCentralServerProperties.cs @@ -0,0 +1,131 @@ +// 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.Resources.Models; + +namespace Azure.ResourceManager.SapVirtualInstances.Models +{ + /// Defines the SAP Central Services Instance properties. + public partial class SapCentralServerProperties + { + /// + /// 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 SapCentralServerProperties() + { + VmDetails = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// The central services instance number. + /// The central services instance subnet. + /// Defines the SAP message server properties. + /// Defines the SAP Enqueue Server properties. + /// Defines the SAP Gateway Server properties. + /// Defines the SAP Enqueue Replication Server (ERS) properties. + /// The central services instance Kernel Version. + /// The central services instance Kernel Patch level. + /// The Load Balancer details such as LoadBalancer ID attached to ASCS Virtual Machines. + /// The list of virtual machines corresponding to the Central Services instance. + /// Defines the SAP Instance status. + /// Defines the health of SAP Instances. + /// Defines the provisioning states. + /// Defines the errors related to SAP Central Services Instance resource. + /// Keeps track of any properties unknown to the library. + internal SapCentralServerProperties(string instanceNo, string subnet, MessageServerProperties messageServerProperties, EnqueueServerProperties enqueueServerProperties, GatewayServerProperties gatewayServerProperties, EnqueueReplicationServerProperties enqueueReplicationServerProperties, string kernelVersion, string kernelPatch, SubResource loadBalancerDetails, IReadOnlyList vmDetails, SapVirtualInstanceStatus? status, SapHealthState? health, SapVirtualInstanceProvisioningState? provisioningState, SapVirtualInstanceError errors, IDictionary serializedAdditionalRawData) + { + InstanceNo = instanceNo; + Subnet = subnet; + MessageServerProperties = messageServerProperties; + EnqueueServerProperties = enqueueServerProperties; + GatewayServerProperties = gatewayServerProperties; + EnqueueReplicationServerProperties = enqueueReplicationServerProperties; + KernelVersion = kernelVersion; + KernelPatch = kernelPatch; + LoadBalancerDetails = loadBalancerDetails; + VmDetails = vmDetails; + Status = status; + Health = health; + ProvisioningState = provisioningState; + Errors = errors; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The central services instance number. + public string InstanceNo { get; } + /// The central services instance subnet. + public string Subnet { get; } + /// Defines the SAP message server properties. + public MessageServerProperties MessageServerProperties { get; set; } + /// Defines the SAP Enqueue Server properties. + public EnqueueServerProperties EnqueueServerProperties { get; set; } + /// Defines the SAP Gateway Server properties. + public GatewayServerProperties GatewayServerProperties { get; set; } + /// Defines the SAP Enqueue Replication Server (ERS) properties. + public EnqueueReplicationServerProperties EnqueueReplicationServerProperties { get; set; } + /// The central services instance Kernel Version. + public string KernelVersion { get; } + /// The central services instance Kernel Patch level. + public string KernelPatch { get; } + /// The Load Balancer details such as LoadBalancer ID attached to ASCS Virtual Machines. + internal SubResource LoadBalancerDetails { get; } + /// Gets Id. + public ResourceIdentifier LoadBalancerDetailsId + { + get => LoadBalancerDetails?.Id; + } + + /// The list of virtual machines corresponding to the Central Services instance. + public IReadOnlyList VmDetails { get; } + /// Defines the SAP Instance status. + public SapVirtualInstanceStatus? Status { get; } + /// Defines the health of SAP Instances. + public SapHealthState? Health { get; } + /// Defines the provisioning states. + public SapVirtualInstanceProvisioningState? ProvisioningState { get; } + /// Defines the errors related to SAP Central Services Instance resource. + internal SapVirtualInstanceError Errors { get; } + /// The Virtual Instance for SAP error body. + public ErrorInformation ErrorsProperties + { + get => Errors?.Properties; + } + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapConfiguration.Serialization.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapConfiguration.Serialization.cs new file mode 100644 index 000000000000..e6ccff69d1d9 --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapConfiguration.Serialization.cs @@ -0,0 +1,119 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.SapVirtualInstances.Models +{ + [PersistableModelProxy(typeof(UnknownSapConfiguration))] + public partial class SapConfiguration : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SapConfiguration)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("configurationType"u8); + writer.WriteStringValue(ConfigurationType.ToString()); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + SapConfiguration 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(SapConfiguration)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeSapConfiguration(document.RootElement, options); + } + + internal static SapConfiguration DeserializeSapConfiguration(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + if (element.TryGetProperty("configurationType", out JsonElement discriminator)) + { + switch (discriminator.GetString()) + { + case "Deployment": return DeploymentConfiguration.DeserializeDeploymentConfiguration(element, options); + case "DeploymentWithOSConfig": return DeploymentWithOSConfiguration.DeserializeDeploymentWithOSConfiguration(element, options); + case "Discovery": return DiscoveryConfiguration.DeserializeDiscoveryConfiguration(element, options); + } + } + return UnknownSapConfiguration.DeserializeUnknownSapConfiguration(element, options); + } + + 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(SapConfiguration)} does not support writing '{options.Format}' format."); + } + } + + SapConfiguration IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeSapConfiguration(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(SapConfiguration)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapConfiguration.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapConfiguration.cs new file mode 100644 index 000000000000..1c62e1446f1c --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapConfiguration.cs @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.SapVirtualInstances.Models +{ + /// + /// The SAP Configuration. + /// 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 . + /// + public abstract partial class SapConfiguration + { + /// + /// 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 protected IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + protected SapConfiguration() + { + } + + /// Initializes a new instance of . + /// The configuration type. Eg: Deployment/Discovery. + /// Keeps track of any properties unknown to the library. + internal SapConfiguration(SapConfigurationType configurationType, IDictionary serializedAdditionalRawData) + { + ConfigurationType = configurationType; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The configuration type. Eg: Deployment/Discovery. + internal SapConfigurationType ConfigurationType { get; set; } + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapConfigurationType.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapConfigurationType.cs new file mode 100644 index 000000000000..967f3a80c04e --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapConfigurationType.cs @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.SapVirtualInstances.Models +{ + /// The configuration Type. + internal readonly partial struct SapConfigurationType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public SapConfigurationType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string DeploymentValue = "Deployment"; + private const string DiscoveryValue = "Discovery"; + private const string DeploymentWithOSConfigValue = "DeploymentWithOSConfig"; + + /// SAP system will be deployed by service. No OS configurations will be done. + public static SapConfigurationType Deployment { get; } = new SapConfigurationType(DeploymentValue); + /// Existing SAP system will be registered. + public static SapConfigurationType Discovery { get; } = new SapConfigurationType(DiscoveryValue); + /// SAP system will be deployed by service. OS configurations will be done. + public static SapConfigurationType DeploymentWithOSConfig { get; } = new SapConfigurationType(DeploymentWithOSConfigValue); + /// Determines if two values are the same. + public static bool operator ==(SapConfigurationType left, SapConfigurationType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(SapConfigurationType left, SapConfigurationType right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator SapConfigurationType(string value) => new SapConfigurationType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is SapConfigurationType other && Equals(other); + /// + public bool Equals(SapConfigurationType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapDatabaseInstancePatch.Serialization.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapDatabaseInstancePatch.Serialization.cs new file mode 100644 index 000000000000..8e80922c3f37 --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapDatabaseInstancePatch.Serialization.cs @@ -0,0 +1,144 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.SapVirtualInstances.Models +{ + public partial class SapDatabaseInstancePatch : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SapDatabaseInstancePatch)} does not support writing '{format}' format."); + } + + if (Optional.IsCollectionDefined(Tags)) + { + writer.WritePropertyName("tags"u8); + writer.WriteStartObject(); + foreach (var item in Tags) + { + writer.WritePropertyName(item.Key); + writer.WriteStringValue(item.Value); + } + writer.WriteEndObject(); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + SapDatabaseInstancePatch 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(SapDatabaseInstancePatch)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeSapDatabaseInstancePatch(document.RootElement, options); + } + + internal static SapDatabaseInstancePatch DeserializeSapDatabaseInstancePatch(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IDictionary tags = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("tags"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var property0 in property.Value.EnumerateObject()) + { + dictionary.Add(property0.Name, property0.Value.GetString()); + } + tags = dictionary; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new SapDatabaseInstancePatch(tags ?? new ChangeTrackingDictionary(), 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(SapDatabaseInstancePatch)} does not support writing '{options.Format}' format."); + } + } + + SapDatabaseInstancePatch IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeSapDatabaseInstancePatch(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(SapDatabaseInstancePatch)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapDatabaseInstancePatch.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapDatabaseInstancePatch.cs new file mode 100644 index 000000000000..69919b2cb4dc --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapDatabaseInstancePatch.cs @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.SapVirtualInstances.Models +{ + /// Defines the request body for updating SAP Database Instance. + public partial class SapDatabaseInstancePatch + { + /// + /// 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 SapDatabaseInstancePatch() + { + Tags = new ChangeTrackingDictionary(); + } + + /// Initializes a new instance of . + /// Gets or sets the Resource tags. + /// Keeps track of any properties unknown to the library. + internal SapDatabaseInstancePatch(IDictionary tags, IDictionary serializedAdditionalRawData) + { + Tags = tags; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Gets or sets the Resource tags. + public IDictionary Tags { get; } + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapDatabaseProperties.Serialization.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapDatabaseProperties.Serialization.cs new file mode 100644 index 000000000000..77513b2c1765 --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapDatabaseProperties.Serialization.cs @@ -0,0 +1,258 @@ +// 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.Resources.Models; + +namespace Azure.ResourceManager.SapVirtualInstances.Models +{ + public partial class SapDatabaseProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SapDatabaseProperties)} does not support writing '{format}' format."); + } + + if (options.Format != "W" && Optional.IsDefined(Subnet)) + { + writer.WritePropertyName("subnet"u8); + writer.WriteStringValue(Subnet); + } + if (options.Format != "W" && Optional.IsDefined(DatabaseSid)) + { + writer.WritePropertyName("databaseSid"u8); + writer.WriteStringValue(DatabaseSid); + } + if (options.Format != "W" && Optional.IsDefined(DatabaseType)) + { + writer.WritePropertyName("databaseType"u8); + writer.WriteStringValue(DatabaseType); + } + if (options.Format != "W" && Optional.IsDefined(IPAddress)) + { + writer.WritePropertyName("ipAddress"u8); + writer.WriteStringValue(IPAddress); + } + if (options.Format != "W" && Optional.IsDefined(LoadBalancerDetails)) + { + writer.WritePropertyName("loadBalancerDetails"u8); + JsonSerializer.Serialize(writer, LoadBalancerDetails); + } + if (options.Format != "W" && Optional.IsCollectionDefined(VmDetails)) + { + writer.WritePropertyName("vmDetails"u8); + writer.WriteStartArray(); + foreach (var item in VmDetails) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && Optional.IsDefined(Status)) + { + writer.WritePropertyName("status"u8); + writer.WriteStringValue(Status.Value.ToString()); + } + if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) + { + writer.WritePropertyName("provisioningState"u8); + writer.WriteStringValue(ProvisioningState.Value.ToString()); + } + if (options.Format != "W" && Optional.IsDefined(Errors)) + { + writer.WritePropertyName("errors"u8); + writer.WriteObjectValue(Errors, options); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + SapDatabaseProperties 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(SapDatabaseProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeSapDatabaseProperties(document.RootElement, options); + } + + internal static SapDatabaseProperties DeserializeSapDatabaseProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string subnet = default; + string databaseSid = default; + string databaseType = default; + string ipAddress = default; + SubResource loadBalancerDetails = default; + IReadOnlyList vmDetails = default; + SapVirtualInstanceStatus? status = default; + SapVirtualInstanceProvisioningState? provisioningState = default; + SapVirtualInstanceError errors = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("subnet"u8)) + { + subnet = property.Value.GetString(); + continue; + } + if (property.NameEquals("databaseSid"u8)) + { + databaseSid = property.Value.GetString(); + continue; + } + if (property.NameEquals("databaseType"u8)) + { + databaseType = property.Value.GetString(); + continue; + } + if (property.NameEquals("ipAddress"u8)) + { + ipAddress = property.Value.GetString(); + continue; + } + if (property.NameEquals("loadBalancerDetails"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + loadBalancerDetails = JsonSerializer.Deserialize(property.Value.GetRawText()); + continue; + } + if (property.NameEquals("vmDetails"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(DatabaseVmDetails.DeserializeDatabaseVmDetails(item, options)); + } + vmDetails = array; + continue; + } + if (property.NameEquals("status"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + status = new SapVirtualInstanceStatus(property.Value.GetString()); + continue; + } + if (property.NameEquals("provisioningState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + provisioningState = new SapVirtualInstanceProvisioningState(property.Value.GetString()); + continue; + } + if (property.NameEquals("errors"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + errors = SapVirtualInstanceError.DeserializeSapVirtualInstanceError(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new SapDatabaseProperties( + subnet, + databaseSid, + databaseType, + ipAddress, + loadBalancerDetails, + vmDetails ?? new ChangeTrackingList(), + status, + provisioningState, + errors, + 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(SapDatabaseProperties)} does not support writing '{options.Format}' format."); + } + } + + SapDatabaseProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeSapDatabaseProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(SapDatabaseProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapDatabaseProperties.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapDatabaseProperties.cs new file mode 100644 index 000000000000..e5c3d9feaeae --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapDatabaseProperties.cs @@ -0,0 +1,111 @@ +// 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.Resources.Models; + +namespace Azure.ResourceManager.SapVirtualInstances.Models +{ + /// Defines the Database properties. + public partial class SapDatabaseProperties + { + /// + /// 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 SapDatabaseProperties() + { + VmDetails = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// Database subnet. + /// Database SID name. + /// Database type, that is if the DB is HANA, DB2, Oracle, SAP ASE, Max DB or MS SQL Server. + /// Database IP Address. + /// The Load Balancer details such as LoadBalancer ID attached to Database Virtual Machines. + /// The list of virtual machines corresponding to the Database resource. + /// Defines the SAP Instance status. + /// Defines the provisioning states. + /// Defines the errors related to Database resource. + /// Keeps track of any properties unknown to the library. + internal SapDatabaseProperties(string subnet, string databaseSid, string databaseType, string ipAddress, SubResource loadBalancerDetails, IReadOnlyList vmDetails, SapVirtualInstanceStatus? status, SapVirtualInstanceProvisioningState? provisioningState, SapVirtualInstanceError errors, IDictionary serializedAdditionalRawData) + { + Subnet = subnet; + DatabaseSid = databaseSid; + DatabaseType = databaseType; + IPAddress = ipAddress; + LoadBalancerDetails = loadBalancerDetails; + VmDetails = vmDetails; + Status = status; + ProvisioningState = provisioningState; + Errors = errors; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Database subnet. + public string Subnet { get; } + /// Database SID name. + public string DatabaseSid { get; } + /// Database type, that is if the DB is HANA, DB2, Oracle, SAP ASE, Max DB or MS SQL Server. + public string DatabaseType { get; } + /// Database IP Address. + public string IPAddress { get; } + /// The Load Balancer details such as LoadBalancer ID attached to Database Virtual Machines. + internal SubResource LoadBalancerDetails { get; } + /// Gets Id. + public ResourceIdentifier LoadBalancerDetailsId + { + get => LoadBalancerDetails?.Id; + } + + /// The list of virtual machines corresponding to the Database resource. + public IReadOnlyList VmDetails { get; } + /// Defines the SAP Instance status. + public SapVirtualInstanceStatus? Status { get; } + /// Defines the provisioning states. + public SapVirtualInstanceProvisioningState? ProvisioningState { get; } + /// Defines the errors related to Database resource. + internal SapVirtualInstanceError Errors { get; } + /// The Virtual Instance for SAP error body. + public ErrorInformation ErrorsProperties + { + get => Errors?.Properties; + } + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapDatabaseScaleMethod.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapDatabaseScaleMethod.cs new file mode 100644 index 000000000000..32f8ad626a75 --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapDatabaseScaleMethod.cs @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.SapVirtualInstances.Models +{ + /// The database scale method. + public readonly partial struct SapDatabaseScaleMethod : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public SapDatabaseScaleMethod(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string ScaleUpValue = "ScaleUp"; + + /// ScaleUp Hana Database deployment type. + public static SapDatabaseScaleMethod ScaleUp { get; } = new SapDatabaseScaleMethod(ScaleUpValue); + /// Determines if two values are the same. + public static bool operator ==(SapDatabaseScaleMethod left, SapDatabaseScaleMethod right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(SapDatabaseScaleMethod left, SapDatabaseScaleMethod right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator SapDatabaseScaleMethod(string value) => new SapDatabaseScaleMethod(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is SapDatabaseScaleMethod other && Equals(other); + /// + public bool Equals(SapDatabaseScaleMethod other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapDatabaseType.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapDatabaseType.cs new file mode 100644 index 000000000000..d258a1c8ed0a --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapDatabaseType.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.SapVirtualInstances.Models +{ + /// Defines the supported SAP Database types. + public readonly partial struct SapDatabaseType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public SapDatabaseType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string HANAValue = "HANA"; + private const string DB2Value = "DB2"; + + /// HANA Database type of SAP system. + public static SapDatabaseType HANA { get; } = new SapDatabaseType(HANAValue); + /// DB2 database type of the SAP system. + public static SapDatabaseType DB2 { get; } = new SapDatabaseType(DB2Value); + /// Determines if two values are the same. + public static bool operator ==(SapDatabaseType left, SapDatabaseType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(SapDatabaseType left, SapDatabaseType right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator SapDatabaseType(string value) => new SapDatabaseType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is SapDatabaseType other && Equals(other); + /// + public bool Equals(SapDatabaseType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapDeploymentType.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapDeploymentType.cs new file mode 100644 index 000000000000..26f7a80b134f --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapDeploymentType.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.SapVirtualInstances.Models +{ + /// The type of SAP deployment, single server or Three tier. + public readonly partial struct SapDeploymentType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public SapDeploymentType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string SingleServerValue = "SingleServer"; + private const string ThreeTierValue = "ThreeTier"; + + /// SAP Single server deployment type. + public static SapDeploymentType SingleServer { get; } = new SapDeploymentType(SingleServerValue); + /// SAP Distributed deployment type. + public static SapDeploymentType ThreeTier { get; } = new SapDeploymentType(ThreeTierValue); + /// Determines if two values are the same. + public static bool operator ==(SapDeploymentType left, SapDeploymentType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(SapDeploymentType left, SapDeploymentType right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator SapDeploymentType(string value) => new SapDeploymentType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is SapDeploymentType other && Equals(other); + /// + public bool Equals(SapDeploymentType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapDiskConfiguration.Serialization.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapDiskConfiguration.Serialization.cs new file mode 100644 index 000000000000..95694f291fd2 --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapDiskConfiguration.Serialization.cs @@ -0,0 +1,158 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.SapVirtualInstances.Models +{ + public partial class SapDiskConfiguration : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SapDiskConfiguration)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(RecommendedConfiguration)) + { + writer.WritePropertyName("recommendedConfiguration"u8); + writer.WriteObjectValue(RecommendedConfiguration, options); + } + if (Optional.IsCollectionDefined(SupportedConfigurations)) + { + writer.WritePropertyName("supportedConfigurations"u8); + writer.WriteStartArray(); + foreach (var item in SupportedConfigurations) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + SapDiskConfiguration 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(SapDiskConfiguration)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeSapDiskConfiguration(document.RootElement, options); + } + + internal static SapDiskConfiguration DeserializeSapDiskConfiguration(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + DiskVolumeConfiguration recommendedConfiguration = default; + IReadOnlyList supportedConfigurations = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("recommendedConfiguration"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + recommendedConfiguration = DiskVolumeConfiguration.DeserializeDiskVolumeConfiguration(property.Value, options); + continue; + } + if (property.NameEquals("supportedConfigurations"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(DiskDetails.DeserializeDiskDetails(item, options)); + } + supportedConfigurations = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new SapDiskConfiguration(recommendedConfiguration, supportedConfigurations ?? new ChangeTrackingList(), serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(SapDiskConfiguration)} does not support writing '{options.Format}' format."); + } + } + + SapDiskConfiguration IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeSapDiskConfiguration(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(SapDiskConfiguration)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapDiskConfiguration.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapDiskConfiguration.cs new file mode 100644 index 000000000000..4518983516d1 --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapDiskConfiguration.cs @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.SapVirtualInstances.Models +{ + /// The SAP Disk Configuration contains 'recommended disk' details and list of supported disks detail for a volume type. + public partial class SapDiskConfiguration + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + internal SapDiskConfiguration() + { + SupportedConfigurations = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// The recommended disk details for a given VM Sku. + /// The list of supported disks for a given VM Sku. + /// Keeps track of any properties unknown to the library. + internal SapDiskConfiguration(DiskVolumeConfiguration recommendedConfiguration, IReadOnlyList supportedConfigurations, IDictionary serializedAdditionalRawData) + { + RecommendedConfiguration = recommendedConfiguration; + SupportedConfigurations = supportedConfigurations; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The recommended disk details for a given VM Sku. + public DiskVolumeConfiguration RecommendedConfiguration { get; } + /// The list of supported disks for a given VM Sku. + public IReadOnlyList SupportedConfigurations { get; } + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapDiskConfigurationsContent.Serialization.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapDiskConfigurationsContent.Serialization.cs new file mode 100644 index 000000000000..49b5e3dba56d --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapDiskConfigurationsContent.Serialization.cs @@ -0,0 +1,173 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.SapVirtualInstances.Models +{ + public partial class SapDiskConfigurationsContent : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SapDiskConfigurationsContent)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("appLocation"u8); + writer.WriteStringValue(AppLocation); + writer.WritePropertyName("environment"u8); + writer.WriteStringValue(Environment.ToString()); + writer.WritePropertyName("sapProduct"u8); + writer.WriteStringValue(SapProduct.ToString()); + writer.WritePropertyName("databaseType"u8); + writer.WriteStringValue(DatabaseType.ToString()); + writer.WritePropertyName("deploymentType"u8); + writer.WriteStringValue(DeploymentType.ToString()); + writer.WritePropertyName("dbVmSku"u8); + writer.WriteStringValue(DbVmSku); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + SapDiskConfigurationsContent 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(SapDiskConfigurationsContent)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeSapDiskConfigurationsContent(document.RootElement, options); + } + + internal static SapDiskConfigurationsContent DeserializeSapDiskConfigurationsContent(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string appLocation = default; + SapEnvironmentType environment = default; + SapProductType sapProduct = default; + SapDatabaseType databaseType = default; + SapDeploymentType deploymentType = default; + string dbVmSku = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("appLocation"u8)) + { + appLocation = property.Value.GetString(); + continue; + } + if (property.NameEquals("environment"u8)) + { + environment = new SapEnvironmentType(property.Value.GetString()); + continue; + } + if (property.NameEquals("sapProduct"u8)) + { + sapProduct = new SapProductType(property.Value.GetString()); + continue; + } + if (property.NameEquals("databaseType"u8)) + { + databaseType = new SapDatabaseType(property.Value.GetString()); + continue; + } + if (property.NameEquals("deploymentType"u8)) + { + deploymentType = new SapDeploymentType(property.Value.GetString()); + continue; + } + if (property.NameEquals("dbVmSku"u8)) + { + dbVmSku = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new SapDiskConfigurationsContent( + appLocation, + environment, + sapProduct, + databaseType, + deploymentType, + dbVmSku, + 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(SapDiskConfigurationsContent)} does not support writing '{options.Format}' format."); + } + } + + SapDiskConfigurationsContent IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeSapDiskConfigurationsContent(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(SapDiskConfigurationsContent)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapDiskConfigurationsContent.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapDiskConfigurationsContent.cs new file mode 100644 index 000000000000..50cb9596e7d2 --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapDiskConfigurationsContent.cs @@ -0,0 +1,106 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.SapVirtualInstances.Models +{ + /// The SAP request to get list of disk configurations. + public partial class SapDiskConfigurationsContent + { + /// + /// 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 geo-location where the SAP resources will be created. + /// Defines the environment type - Production/Non Production. + /// Defines the SAP Product type. + /// The database type. Eg: HANA, DB2, etc. + /// The deployment type. Eg: SingleServer/ThreeTier. + /// The VM SKU for database instance. + /// or is null. + public SapDiskConfigurationsContent(string appLocation, SapEnvironmentType environment, SapProductType sapProduct, SapDatabaseType databaseType, SapDeploymentType deploymentType, string dbVmSku) + { + Argument.AssertNotNull(appLocation, nameof(appLocation)); + Argument.AssertNotNull(dbVmSku, nameof(dbVmSku)); + + AppLocation = appLocation; + Environment = environment; + SapProduct = sapProduct; + DatabaseType = databaseType; + DeploymentType = deploymentType; + DbVmSku = dbVmSku; + } + + /// Initializes a new instance of . + /// The geo-location where the SAP resources will be created. + /// Defines the environment type - Production/Non Production. + /// Defines the SAP Product type. + /// The database type. Eg: HANA, DB2, etc. + /// The deployment type. Eg: SingleServer/ThreeTier. + /// The VM SKU for database instance. + /// Keeps track of any properties unknown to the library. + internal SapDiskConfigurationsContent(string appLocation, SapEnvironmentType environment, SapProductType sapProduct, SapDatabaseType databaseType, SapDeploymentType deploymentType, string dbVmSku, IDictionary serializedAdditionalRawData) + { + AppLocation = appLocation; + Environment = environment; + SapProduct = sapProduct; + DatabaseType = databaseType; + DeploymentType = deploymentType; + DbVmSku = dbVmSku; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal SapDiskConfigurationsContent() + { + } + + /// The geo-location where the SAP resources will be created. + public string AppLocation { get; } + /// Defines the environment type - Production/Non Production. + public SapEnvironmentType Environment { get; } + /// Defines the SAP Product type. + public SapProductType SapProduct { get; } + /// The database type. Eg: HANA, DB2, etc. + public SapDatabaseType DatabaseType { get; } + /// The deployment type. Eg: SingleServer/ThreeTier. + public SapDeploymentType DeploymentType { get; } + /// The VM SKU for database instance. + public string DbVmSku { get; } + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapDiskConfigurationsResult.Serialization.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapDiskConfigurationsResult.Serialization.cs new file mode 100644 index 000000000000..498b85a78954 --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapDiskConfigurationsResult.Serialization.cs @@ -0,0 +1,144 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.SapVirtualInstances.Models +{ + public partial class SapDiskConfigurationsResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SapDiskConfigurationsResult)} does not support writing '{format}' format."); + } + + if (Optional.IsCollectionDefined(VolumeConfigurations)) + { + writer.WritePropertyName("volumeConfigurations"u8); + writer.WriteStartObject(); + foreach (var item in VolumeConfigurations) + { + writer.WritePropertyName(item.Key); + writer.WriteObjectValue(item.Value, options); + } + writer.WriteEndObject(); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + SapDiskConfigurationsResult 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(SapDiskConfigurationsResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeSapDiskConfigurationsResult(document.RootElement, options); + } + + internal static SapDiskConfigurationsResult DeserializeSapDiskConfigurationsResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IReadOnlyDictionary volumeConfigurations = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("volumeConfigurations"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var property0 in property.Value.EnumerateObject()) + { + dictionary.Add(property0.Name, SapDiskConfiguration.DeserializeSapDiskConfiguration(property0.Value, options)); + } + volumeConfigurations = dictionary; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new SapDiskConfigurationsResult(volumeConfigurations ?? new ChangeTrackingDictionary(), 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(SapDiskConfigurationsResult)} does not support writing '{options.Format}' format."); + } + } + + SapDiskConfigurationsResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeSapDiskConfigurationsResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(SapDiskConfigurationsResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapDiskConfigurationsResult.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapDiskConfigurationsResult.cs new file mode 100644 index 000000000000..68b5bc63cbab --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapDiskConfigurationsResult.cs @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.SapVirtualInstances.Models +{ + /// The list of disk configuration for vmSku which are part of SAP deployment. + public partial class SapDiskConfigurationsResult + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + internal SapDiskConfigurationsResult() + { + VolumeConfigurations = new ChangeTrackingDictionary(); + } + + /// Initializes a new instance of . + /// The disk configuration for the db volume. For HANA, Required volumes are: ['hana/data', 'hana/log', hana/shared', 'usr/sap', 'os'], Optional volume : ['backup']. + /// Keeps track of any properties unknown to the library. + internal SapDiskConfigurationsResult(IReadOnlyDictionary volumeConfigurations, IDictionary serializedAdditionalRawData) + { + VolumeConfigurations = volumeConfigurations; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The disk configuration for the db volume. For HANA, Required volumes are: ['hana/data', 'hana/log', hana/shared', 'usr/sap', 'os'], Optional volume : ['backup']. + public IReadOnlyDictionary VolumeConfigurations { get; } + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapEnvironmentType.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapEnvironmentType.cs new file mode 100644 index 000000000000..bfe16bc5eba5 --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapEnvironmentType.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.SapVirtualInstances.Models +{ + /// Defines the environment type - Production/Non Production. + public readonly partial struct SapEnvironmentType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public SapEnvironmentType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string NonProdValue = "NonProd"; + private const string ProdValue = "Prod"; + + /// Non Production SAP system. + public static SapEnvironmentType NonProd { get; } = new SapEnvironmentType(NonProdValue); + /// Production SAP system. + public static SapEnvironmentType Prod { get; } = new SapEnvironmentType(ProdValue); + /// Determines if two values are the same. + public static bool operator ==(SapEnvironmentType left, SapEnvironmentType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(SapEnvironmentType left, SapEnvironmentType right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator SapEnvironmentType(string value) => new SapEnvironmentType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is SapEnvironmentType other && Equals(other); + /// + public bool Equals(SapEnvironmentType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapHealthState.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapHealthState.cs new file mode 100644 index 000000000000..b3db96529756 --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapHealthState.cs @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.SapVirtualInstances.Models +{ + /// Defines the health of SAP Instances. + public readonly partial struct SapHealthState : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public SapHealthState(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string UnknownValue = "Unknown"; + private const string HealthyValue = "Healthy"; + private const string UnhealthyValue = "Unhealthy"; + private const string DegradedValue = "Degraded"; + + /// SAP System health is unknown. + public static SapHealthState Unknown { get; } = new SapHealthState(UnknownValue); + /// SAP System health is healthy. + public static SapHealthState Healthy { get; } = new SapHealthState(HealthyValue); + /// SAP System is unhealthy. + public static SapHealthState Unhealthy { get; } = new SapHealthState(UnhealthyValue); + /// SAP System health is degraded. + public static SapHealthState Degraded { get; } = new SapHealthState(DegradedValue); + /// Determines if two values are the same. + public static bool operator ==(SapHealthState left, SapHealthState right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(SapHealthState left, SapHealthState right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator SapHealthState(string value) => new SapHealthState(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is SapHealthState other && Equals(other); + /// + public bool Equals(SapHealthState other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapHighAvailabilityType.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapHighAvailabilityType.cs new file mode 100644 index 000000000000..3e6a832aeff1 --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapHighAvailabilityType.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.SapVirtualInstances.Models +{ + /// The high availability type (AvailabilitySet or AvailabilityZone). + public readonly partial struct SapHighAvailabilityType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public SapHighAvailabilityType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string AvailabilitySetValue = "AvailabilitySet"; + private const string AvailabilityZoneValue = "AvailabilityZone"; + + /// HA deployment with availability sets. + public static SapHighAvailabilityType AvailabilitySet { get; } = new SapHighAvailabilityType(AvailabilitySetValue); + /// HA deployment with availability zones. + public static SapHighAvailabilityType AvailabilityZone { get; } = new SapHighAvailabilityType(AvailabilityZoneValue); + /// Determines if two values are the same. + public static bool operator ==(SapHighAvailabilityType left, SapHighAvailabilityType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(SapHighAvailabilityType left, SapHighAvailabilityType right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator SapHighAvailabilityType(string value) => new SapHighAvailabilityType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is SapHighAvailabilityType other && Equals(other); + /// + public bool Equals(SapHighAvailabilityType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapInstallWithoutOSConfigSoftwareConfiguration.Serialization.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapInstallWithoutOSConfigSoftwareConfiguration.Serialization.cs new file mode 100644 index 000000000000..404aa6b82063 --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapInstallWithoutOSConfigSoftwareConfiguration.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; + +namespace Azure.ResourceManager.SapVirtualInstances.Models +{ + public partial class SapInstallWithoutOSConfigSoftwareConfiguration : 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(SapInstallWithoutOSConfigSoftwareConfiguration)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + writer.WritePropertyName("bomUrl"u8); + writer.WriteStringValue(BomUri); + writer.WritePropertyName("sapBitsStorageAccountId"u8); + writer.WriteStringValue(SapBitsStorageAccountId); + writer.WritePropertyName("softwareVersion"u8); + writer.WriteStringValue(SoftwareVersion); + if (Optional.IsDefined(HighAvailabilitySoftwareConfiguration)) + { + writer.WritePropertyName("highAvailabilitySoftwareConfiguration"u8); + writer.WriteObjectValue(HighAvailabilitySoftwareConfiguration, options); + } + } + + SapInstallWithoutOSConfigSoftwareConfiguration 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(SapInstallWithoutOSConfigSoftwareConfiguration)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeSapInstallWithoutOSConfigSoftwareConfiguration(document.RootElement, options); + } + + internal static SapInstallWithoutOSConfigSoftwareConfiguration DeserializeSapInstallWithoutOSConfigSoftwareConfiguration(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string bomUrl = default; + string sapBitsStorageAccountId = default; + string softwareVersion = default; + HighAvailabilitySoftwareConfiguration highAvailabilitySoftwareConfiguration = default; + SapSoftwareInstallationType softwareInstallationType = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("bomUrl"u8)) + { + bomUrl = property.Value.GetString(); + continue; + } + if (property.NameEquals("sapBitsStorageAccountId"u8)) + { + sapBitsStorageAccountId = property.Value.GetString(); + continue; + } + if (property.NameEquals("softwareVersion"u8)) + { + softwareVersion = property.Value.GetString(); + continue; + } + if (property.NameEquals("highAvailabilitySoftwareConfiguration"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + highAvailabilitySoftwareConfiguration = HighAvailabilitySoftwareConfiguration.DeserializeHighAvailabilitySoftwareConfiguration(property.Value, options); + continue; + } + if (property.NameEquals("softwareInstallationType"u8)) + { + softwareInstallationType = new SapSoftwareInstallationType(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new SapInstallWithoutOSConfigSoftwareConfiguration( + softwareInstallationType, + serializedAdditionalRawData, + bomUrl, + sapBitsStorageAccountId, + softwareVersion, + highAvailabilitySoftwareConfiguration); + } + + 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(SapInstallWithoutOSConfigSoftwareConfiguration)} does not support writing '{options.Format}' format."); + } + } + + SapInstallWithoutOSConfigSoftwareConfiguration IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeSapInstallWithoutOSConfigSoftwareConfiguration(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(SapInstallWithoutOSConfigSoftwareConfiguration)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapInstallWithoutOSConfigSoftwareConfiguration.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapInstallWithoutOSConfigSoftwareConfiguration.cs new file mode 100644 index 000000000000..feb3c7735081 --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapInstallWithoutOSConfigSoftwareConfiguration.cs @@ -0,0 +1,63 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.SapVirtualInstances.Models +{ + /// The SAP Software configuration Input when the software is to be installed by service without OS Configurations. + public partial class SapInstallWithoutOSConfigSoftwareConfiguration : SoftwareConfiguration + { + /// Initializes a new instance of . + /// The URL to the SAP Build of Materials(BOM) file. + /// The SAP bits storage account id. + /// The software version to install. + /// , or is null. + public SapInstallWithoutOSConfigSoftwareConfiguration(string bomUri, string sapBitsStorageAccountId, string softwareVersion) + { + Argument.AssertNotNull(bomUri, nameof(bomUri)); + Argument.AssertNotNull(sapBitsStorageAccountId, nameof(sapBitsStorageAccountId)); + Argument.AssertNotNull(softwareVersion, nameof(softwareVersion)); + + BomUri = bomUri; + SapBitsStorageAccountId = sapBitsStorageAccountId; + SoftwareVersion = softwareVersion; + SoftwareInstallationType = SapSoftwareInstallationType.SAPInstallWithoutOSConfig; + } + + /// Initializes a new instance of . + /// The SAP software installation type. + /// Keeps track of any properties unknown to the library. + /// The URL to the SAP Build of Materials(BOM) file. + /// The SAP bits storage account id. + /// The software version to install. + /// Gets or sets the HA software configuration. + internal SapInstallWithoutOSConfigSoftwareConfiguration(SapSoftwareInstallationType softwareInstallationType, IDictionary serializedAdditionalRawData, string bomUri, string sapBitsStorageAccountId, string softwareVersion, HighAvailabilitySoftwareConfiguration highAvailabilitySoftwareConfiguration) : base(softwareInstallationType, serializedAdditionalRawData) + { + BomUri = bomUri; + SapBitsStorageAccountId = sapBitsStorageAccountId; + SoftwareVersion = softwareVersion; + HighAvailabilitySoftwareConfiguration = highAvailabilitySoftwareConfiguration; + SoftwareInstallationType = softwareInstallationType; + } + + /// Initializes a new instance of for deserialization. + internal SapInstallWithoutOSConfigSoftwareConfiguration() + { + } + + /// The URL to the SAP Build of Materials(BOM) file. + public string BomUri { get; set; } + /// The SAP bits storage account id. + public string SapBitsStorageAccountId { get; set; } + /// The software version to install. + public string SoftwareVersion { get; set; } + /// Gets or sets the HA software configuration. + public HighAvailabilitySoftwareConfiguration HighAvailabilitySoftwareConfiguration { get; set; } + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapProductType.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapProductType.cs new file mode 100644 index 000000000000..4f7c447c7964 --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapProductType.cs @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.SapVirtualInstances.Models +{ + /// Defines the SAP Product type. + public readonly partial struct SapProductType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public SapProductType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string ECCValue = "ECC"; + private const string S4HANAValue = "S4HANA"; + private const string OtherValue = "Other"; + + /// SAP Product ECC. + public static SapProductType ECC { get; } = new SapProductType(ECCValue); + /// SAP Product S4HANA. + public static SapProductType S4HANA { get; } = new SapProductType(S4HANAValue); + /// SAP Products other than the ones listed. + public static SapProductType Other { get; } = new SapProductType(OtherValue); + /// Determines if two values are the same. + public static bool operator ==(SapProductType left, SapProductType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(SapProductType left, SapProductType right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator SapProductType(string value) => new SapProductType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is SapProductType other && Equals(other); + /// + public bool Equals(SapProductType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapSizingRecommendationContent.Serialization.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapSizingRecommendationContent.Serialization.cs new file mode 100644 index 000000000000..bc973a8dca70 --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapSizingRecommendationContent.Serialization.cs @@ -0,0 +1,214 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.SapVirtualInstances.Models +{ + public partial class SapSizingRecommendationContent : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SapSizingRecommendationContent)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("appLocation"u8); + writer.WriteStringValue(AppLocation); + writer.WritePropertyName("environment"u8); + writer.WriteStringValue(Environment.ToString()); + writer.WritePropertyName("sapProduct"u8); + writer.WriteStringValue(SapProduct.ToString()); + writer.WritePropertyName("deploymentType"u8); + writer.WriteStringValue(DeploymentType.ToString()); + writer.WritePropertyName("saps"u8); + writer.WriteNumberValue(Saps); + writer.WritePropertyName("dbMemory"u8); + writer.WriteNumberValue(DbMemory); + writer.WritePropertyName("databaseType"u8); + writer.WriteStringValue(DatabaseType.ToString()); + if (Optional.IsDefined(DbScaleMethod)) + { + writer.WritePropertyName("dbScaleMethod"u8); + writer.WriteStringValue(DbScaleMethod.Value.ToString()); + } + if (Optional.IsDefined(HighAvailabilityType)) + { + writer.WritePropertyName("highAvailabilityType"u8); + writer.WriteStringValue(HighAvailabilityType.Value.ToString()); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + SapSizingRecommendationContent 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(SapSizingRecommendationContent)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeSapSizingRecommendationContent(document.RootElement, options); + } + + internal static SapSizingRecommendationContent DeserializeSapSizingRecommendationContent(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string appLocation = default; + SapEnvironmentType environment = default; + SapProductType sapProduct = default; + SapDeploymentType deploymentType = default; + long saps = default; + long dbMemory = default; + SapDatabaseType databaseType = default; + SapDatabaseScaleMethod? dbScaleMethod = default; + SapHighAvailabilityType? highAvailabilityType = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("appLocation"u8)) + { + appLocation = property.Value.GetString(); + continue; + } + if (property.NameEquals("environment"u8)) + { + environment = new SapEnvironmentType(property.Value.GetString()); + continue; + } + if (property.NameEquals("sapProduct"u8)) + { + sapProduct = new SapProductType(property.Value.GetString()); + continue; + } + if (property.NameEquals("deploymentType"u8)) + { + deploymentType = new SapDeploymentType(property.Value.GetString()); + continue; + } + if (property.NameEquals("saps"u8)) + { + saps = property.Value.GetInt64(); + continue; + } + if (property.NameEquals("dbMemory"u8)) + { + dbMemory = property.Value.GetInt64(); + continue; + } + if (property.NameEquals("databaseType"u8)) + { + databaseType = new SapDatabaseType(property.Value.GetString()); + continue; + } + if (property.NameEquals("dbScaleMethod"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + dbScaleMethod = new SapDatabaseScaleMethod(property.Value.GetString()); + continue; + } + if (property.NameEquals("highAvailabilityType"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + highAvailabilityType = new SapHighAvailabilityType(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new SapSizingRecommendationContent( + appLocation, + environment, + sapProduct, + deploymentType, + saps, + dbMemory, + databaseType, + dbScaleMethod, + highAvailabilityType, + 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(SapSizingRecommendationContent)} does not support writing '{options.Format}' format."); + } + } + + SapSizingRecommendationContent IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeSapSizingRecommendationContent(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(SapSizingRecommendationContent)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapSizingRecommendationContent.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapSizingRecommendationContent.cs new file mode 100644 index 000000000000..a0dd7fb0d49f --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapSizingRecommendationContent.cs @@ -0,0 +1,119 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.SapVirtualInstances.Models +{ + /// The SAP Sizing Recommendation request. + public partial class SapSizingRecommendationContent + { + /// + /// 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 geo-location where the resource is to be created. + /// Defines the environment type - Production/Non Production. + /// Defines the SAP Product type. + /// The deployment type. Eg: SingleServer/ThreeTier. + /// The SAP Application Performance Standard measurement. + /// The database memory configuration. + /// The database type. + /// is null. + public SapSizingRecommendationContent(string appLocation, SapEnvironmentType environment, SapProductType sapProduct, SapDeploymentType deploymentType, long saps, long dbMemory, SapDatabaseType databaseType) + { + Argument.AssertNotNull(appLocation, nameof(appLocation)); + + AppLocation = appLocation; + Environment = environment; + SapProduct = sapProduct; + DeploymentType = deploymentType; + Saps = saps; + DbMemory = dbMemory; + DatabaseType = databaseType; + } + + /// Initializes a new instance of . + /// The geo-location where the resource is to be created. + /// Defines the environment type - Production/Non Production. + /// Defines the SAP Product type. + /// The deployment type. Eg: SingleServer/ThreeTier. + /// The SAP Application Performance Standard measurement. + /// The database memory configuration. + /// The database type. + /// The DB scale method. + /// The high availability type. + /// Keeps track of any properties unknown to the library. + internal SapSizingRecommendationContent(string appLocation, SapEnvironmentType environment, SapProductType sapProduct, SapDeploymentType deploymentType, long saps, long dbMemory, SapDatabaseType databaseType, SapDatabaseScaleMethod? dbScaleMethod, SapHighAvailabilityType? highAvailabilityType, IDictionary serializedAdditionalRawData) + { + AppLocation = appLocation; + Environment = environment; + SapProduct = sapProduct; + DeploymentType = deploymentType; + Saps = saps; + DbMemory = dbMemory; + DatabaseType = databaseType; + DbScaleMethod = dbScaleMethod; + HighAvailabilityType = highAvailabilityType; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal SapSizingRecommendationContent() + { + } + + /// The geo-location where the resource is to be created. + public string AppLocation { get; } + /// Defines the environment type - Production/Non Production. + public SapEnvironmentType Environment { get; } + /// Defines the SAP Product type. + public SapProductType SapProduct { get; } + /// The deployment type. Eg: SingleServer/ThreeTier. + public SapDeploymentType DeploymentType { get; } + /// The SAP Application Performance Standard measurement. + public long Saps { get; } + /// The database memory configuration. + public long DbMemory { get; } + /// The database type. + public SapDatabaseType DatabaseType { get; } + /// The DB scale method. + public SapDatabaseScaleMethod? DbScaleMethod { get; set; } + /// The high availability type. + public SapHighAvailabilityType? HighAvailabilityType { get; set; } + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapSizingRecommendationResult.Serialization.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapSizingRecommendationResult.Serialization.cs new file mode 100644 index 000000000000..1693b8665507 --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapSizingRecommendationResult.Serialization.cs @@ -0,0 +1,118 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.SapVirtualInstances.Models +{ + [PersistableModelProxy(typeof(UnknownSapSizingRecommendationResult))] + public partial class SapSizingRecommendationResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SapSizingRecommendationResult)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("deploymentType"u8); + writer.WriteStringValue(DeploymentType.ToString()); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + SapSizingRecommendationResult 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(SapSizingRecommendationResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeSapSizingRecommendationResult(document.RootElement, options); + } + + internal static SapSizingRecommendationResult DeserializeSapSizingRecommendationResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + if (element.TryGetProperty("deploymentType", out JsonElement discriminator)) + { + switch (discriminator.GetString()) + { + case "SingleServer": return SingleServerRecommendationResult.DeserializeSingleServerRecommendationResult(element, options); + case "ThreeTier": return ThreeTierRecommendationResult.DeserializeThreeTierRecommendationResult(element, options); + } + } + return UnknownSapSizingRecommendationResult.DeserializeUnknownSapSizingRecommendationResult(element, options); + } + + 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(SapSizingRecommendationResult)} does not support writing '{options.Format}' format."); + } + } + + SapSizingRecommendationResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeSapSizingRecommendationResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(SapSizingRecommendationResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapSizingRecommendationResult.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapSizingRecommendationResult.cs new file mode 100644 index 000000000000..82bef0761e1c --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapSizingRecommendationResult.cs @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.SapVirtualInstances.Models +{ + /// + /// The SAP sizing recommendation result. + /// 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 . + /// + public abstract partial class SapSizingRecommendationResult + { + /// + /// 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 protected IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + protected SapSizingRecommendationResult() + { + } + + /// Initializes a new instance of . + /// The deployment type. Eg: SingleServer/ThreeTier. + /// Keeps track of any properties unknown to the library. + internal SapSizingRecommendationResult(SapDeploymentType deploymentType, IDictionary serializedAdditionalRawData) + { + DeploymentType = deploymentType; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The deployment type. Eg: SingleServer/ThreeTier. + internal SapDeploymentType DeploymentType { get; set; } + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapSoftwareInstallationType.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapSoftwareInstallationType.cs new file mode 100644 index 000000000000..e6f61a20b863 --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapSoftwareInstallationType.cs @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.SapVirtualInstances.Models +{ + /// The SAP software installation Type. + internal readonly partial struct SapSoftwareInstallationType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public SapSoftwareInstallationType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string ServiceInitiatedValue = "ServiceInitiated"; + private const string SAPInstallWithoutOSConfigValue = "SAPInstallWithoutOSConfig"; + private const string ExternalValue = "External"; + + /// SAP Install managed by service. + public static SapSoftwareInstallationType ServiceInitiated { get; } = new SapSoftwareInstallationType(ServiceInitiatedValue); + /// SAP Install without OS Config. + public static SapSoftwareInstallationType SAPInstallWithoutOSConfig { get; } = new SapSoftwareInstallationType(SAPInstallWithoutOSConfigValue); + /// External software installation type. + public static SapSoftwareInstallationType External { get; } = new SapSoftwareInstallationType(ExternalValue); + /// Determines if two values are the same. + public static bool operator ==(SapSoftwareInstallationType left, SapSoftwareInstallationType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(SapSoftwareInstallationType left, SapSoftwareInstallationType right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator SapSoftwareInstallationType(string value) => new SapSoftwareInstallationType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is SapSoftwareInstallationType other && Equals(other); + /// + public bool Equals(SapSoftwareInstallationType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapSupportedResourceSkusResult.Serialization.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapSupportedResourceSkusResult.Serialization.cs new file mode 100644 index 000000000000..b9540dccbf83 --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapSupportedResourceSkusResult.Serialization.cs @@ -0,0 +1,143 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.SapVirtualInstances.Models +{ + public partial class SapSupportedResourceSkusResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SapSupportedResourceSkusResult)} does not support writing '{format}' format."); + } + + if (Optional.IsCollectionDefined(SupportedSkus)) + { + writer.WritePropertyName("supportedSkus"u8); + writer.WriteStartArray(); + foreach (var item in SupportedSkus) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + SapSupportedResourceSkusResult 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(SapSupportedResourceSkusResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeSapSupportedResourceSkusResult(document.RootElement, options); + } + + internal static SapSupportedResourceSkusResult DeserializeSapSupportedResourceSkusResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IReadOnlyList supportedSkus = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("supportedSkus"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(SapSupportedSku.DeserializeSapSupportedSku(item, options)); + } + supportedSkus = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new SapSupportedResourceSkusResult(supportedSkus ?? new ChangeTrackingList(), serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(SapSupportedResourceSkusResult)} does not support writing '{options.Format}' format."); + } + } + + SapSupportedResourceSkusResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeSapSupportedResourceSkusResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(SapSupportedResourceSkusResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapSupportedResourceSkusResult.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapSupportedResourceSkusResult.cs new file mode 100644 index 000000000000..6eafd832c894 --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapSupportedResourceSkusResult.cs @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.SapVirtualInstances.Models +{ + /// The list of supported SKUs for different resources which are part of SAP deployment. + public partial class SapSupportedResourceSkusResult + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + internal SapSupportedResourceSkusResult() + { + SupportedSkus = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// Gets the list of SAP supported SKUs. + /// Keeps track of any properties unknown to the library. + internal SapSupportedResourceSkusResult(IReadOnlyList supportedSkus, IDictionary serializedAdditionalRawData) + { + SupportedSkus = supportedSkus; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Gets the list of SAP supported SKUs. + public IReadOnlyList SupportedSkus { get; } + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapSupportedSku.Serialization.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapSupportedSku.Serialization.cs new file mode 100644 index 000000000000..c49dd918f179 --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapSupportedSku.Serialization.cs @@ -0,0 +1,159 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.SapVirtualInstances.Models +{ + public partial class SapSupportedSku : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SapSupportedSku)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(VmSku)) + { + writer.WritePropertyName("vmSku"u8); + writer.WriteStringValue(VmSku); + } + if (Optional.IsDefined(IsAppServerCertified)) + { + writer.WritePropertyName("isAppServerCertified"u8); + writer.WriteBooleanValue(IsAppServerCertified.Value); + } + if (Optional.IsDefined(IsDatabaseCertified)) + { + writer.WritePropertyName("isDatabaseCertified"u8); + writer.WriteBooleanValue(IsDatabaseCertified.Value); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + SapSupportedSku 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(SapSupportedSku)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeSapSupportedSku(document.RootElement, options); + } + + internal static SapSupportedSku DeserializeSapSupportedSku(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string vmSku = default; + bool? isAppServerCertified = default; + bool? isDatabaseCertified = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("vmSku"u8)) + { + vmSku = property.Value.GetString(); + continue; + } + if (property.NameEquals("isAppServerCertified"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + isAppServerCertified = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("isDatabaseCertified"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + isDatabaseCertified = property.Value.GetBoolean(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new SapSupportedSku(vmSku, isAppServerCertified, isDatabaseCertified, 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(SapSupportedSku)} does not support writing '{options.Format}' format."); + } + } + + SapSupportedSku IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeSapSupportedSku(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(SapSupportedSku)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapSupportedSku.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapSupportedSku.cs new file mode 100644 index 000000000000..ab4e16fd5ea2 --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapSupportedSku.cs @@ -0,0 +1,73 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.SapVirtualInstances.Models +{ + /// The SAP supported SKU. + public partial class SapSupportedSku + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + internal SapSupportedSku() + { + } + + /// Initializes a new instance of . + /// The VM Sku. + /// True if the Sku is certified for App server in the SAP system. + /// True if the Sku is certified for Database server in the SAP system. + /// Keeps track of any properties unknown to the library. + internal SapSupportedSku(string vmSku, bool? isAppServerCertified, bool? isDatabaseCertified, IDictionary serializedAdditionalRawData) + { + VmSku = vmSku; + IsAppServerCertified = isAppServerCertified; + IsDatabaseCertified = isDatabaseCertified; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The VM Sku. + public string VmSku { get; } + /// True if the Sku is certified for App server in the SAP system. + public bool? IsAppServerCertified { get; } + /// True if the Sku is certified for Database server in the SAP system. + public bool? IsDatabaseCertified { get; } + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapSupportedSkusContent.Serialization.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapSupportedSkusContent.Serialization.cs new file mode 100644 index 000000000000..3c0264c582d8 --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapSupportedSkusContent.Serialization.cs @@ -0,0 +1,180 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.SapVirtualInstances.Models +{ + public partial class SapSupportedSkusContent : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SapSupportedSkusContent)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("appLocation"u8); + writer.WriteStringValue(AppLocation); + writer.WritePropertyName("environment"u8); + writer.WriteStringValue(Environment.ToString()); + writer.WritePropertyName("sapProduct"u8); + writer.WriteStringValue(SapProduct.ToString()); + writer.WritePropertyName("deploymentType"u8); + writer.WriteStringValue(DeploymentType.ToString()); + writer.WritePropertyName("databaseType"u8); + writer.WriteStringValue(DatabaseType.ToString()); + if (Optional.IsDefined(HighAvailabilityType)) + { + writer.WritePropertyName("highAvailabilityType"u8); + writer.WriteStringValue(HighAvailabilityType.Value.ToString()); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + SapSupportedSkusContent 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(SapSupportedSkusContent)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeSapSupportedSkusContent(document.RootElement, options); + } + + internal static SapSupportedSkusContent DeserializeSapSupportedSkusContent(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string appLocation = default; + SapEnvironmentType environment = default; + SapProductType sapProduct = default; + SapDeploymentType deploymentType = default; + SapDatabaseType databaseType = default; + SapHighAvailabilityType? highAvailabilityType = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("appLocation"u8)) + { + appLocation = property.Value.GetString(); + continue; + } + if (property.NameEquals("environment"u8)) + { + environment = new SapEnvironmentType(property.Value.GetString()); + continue; + } + if (property.NameEquals("sapProduct"u8)) + { + sapProduct = new SapProductType(property.Value.GetString()); + continue; + } + if (property.NameEquals("deploymentType"u8)) + { + deploymentType = new SapDeploymentType(property.Value.GetString()); + continue; + } + if (property.NameEquals("databaseType"u8)) + { + databaseType = new SapDatabaseType(property.Value.GetString()); + continue; + } + if (property.NameEquals("highAvailabilityType"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + highAvailabilityType = new SapHighAvailabilityType(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new SapSupportedSkusContent( + appLocation, + environment, + sapProduct, + deploymentType, + databaseType, + highAvailabilityType, + 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(SapSupportedSkusContent)} does not support writing '{options.Format}' format."); + } + } + + SapSupportedSkusContent IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeSapSupportedSkusContent(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(SapSupportedSkusContent)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapSupportedSkusContent.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapSupportedSkusContent.cs new file mode 100644 index 000000000000..9ff9a4a9fe75 --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapSupportedSkusContent.cs @@ -0,0 +1,103 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.SapVirtualInstances.Models +{ + /// The SAP request to get list of supported SKUs. + public partial class SapSupportedSkusContent + { + /// + /// 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 geo-location where the resource is to be created. + /// Defines the environment type - Production/Non Production. + /// Defines the SAP Product type. + /// The deployment type. Eg: SingleServer/ThreeTier. + /// The database type. Eg: HANA, DB2, etc. + /// is null. + public SapSupportedSkusContent(string appLocation, SapEnvironmentType environment, SapProductType sapProduct, SapDeploymentType deploymentType, SapDatabaseType databaseType) + { + Argument.AssertNotNull(appLocation, nameof(appLocation)); + + AppLocation = appLocation; + Environment = environment; + SapProduct = sapProduct; + DeploymentType = deploymentType; + DatabaseType = databaseType; + } + + /// Initializes a new instance of . + /// The geo-location where the resource is to be created. + /// Defines the environment type - Production/Non Production. + /// Defines the SAP Product type. + /// The deployment type. Eg: SingleServer/ThreeTier. + /// The database type. Eg: HANA, DB2, etc. + /// The high availability type. + /// Keeps track of any properties unknown to the library. + internal SapSupportedSkusContent(string appLocation, SapEnvironmentType environment, SapProductType sapProduct, SapDeploymentType deploymentType, SapDatabaseType databaseType, SapHighAvailabilityType? highAvailabilityType, IDictionary serializedAdditionalRawData) + { + AppLocation = appLocation; + Environment = environment; + SapProduct = sapProduct; + DeploymentType = deploymentType; + DatabaseType = databaseType; + HighAvailabilityType = highAvailabilityType; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal SapSupportedSkusContent() + { + } + + /// The geo-location where the resource is to be created. + public string AppLocation { get; } + /// Defines the environment type - Production/Non Production. + public SapEnvironmentType Environment { get; } + /// Defines the SAP Product type. + public SapProductType SapProduct { get; } + /// The deployment type. Eg: SingleServer/ThreeTier. + public SapDeploymentType DeploymentType { get; } + /// The database type. Eg: HANA, DB2, etc. + public SapDatabaseType DatabaseType { get; } + /// The high availability type. + public SapHighAvailabilityType? HighAvailabilityType { get; set; } + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapVirtualInstanceError.Serialization.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapVirtualInstanceError.Serialization.cs new file mode 100644 index 000000000000..4fd73960dc15 --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapVirtualInstanceError.Serialization.cs @@ -0,0 +1,133 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.SapVirtualInstances.Models +{ + internal partial class SapVirtualInstanceError : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SapVirtualInstanceError)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(Properties)) + { + writer.WritePropertyName("properties"u8); + writer.WriteObjectValue(Properties, options); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + SapVirtualInstanceError 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(SapVirtualInstanceError)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeSapVirtualInstanceError(document.RootElement, options); + } + + internal static SapVirtualInstanceError DeserializeSapVirtualInstanceError(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ErrorInformation properties = 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 = ErrorInformation.DeserializeErrorInformation(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new SapVirtualInstanceError(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(SapVirtualInstanceError)} does not support writing '{options.Format}' format."); + } + } + + SapVirtualInstanceError IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeSapVirtualInstanceError(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(SapVirtualInstanceError)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapVirtualInstanceError.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapVirtualInstanceError.cs new file mode 100644 index 000000000000..7ee793a33452 --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapVirtualInstanceError.cs @@ -0,0 +1,65 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.SapVirtualInstances.Models +{ + /// An error response from the Virtual Instance for SAP Workload service. + internal partial class SapVirtualInstanceError + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + internal SapVirtualInstanceError() + { + } + + /// Initializes a new instance of . + /// The Virtual Instance for SAP error body. + /// Keeps track of any properties unknown to the library. + internal SapVirtualInstanceError(ErrorInformation properties, IDictionary serializedAdditionalRawData) + { + Properties = properties; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The Virtual Instance for SAP error body. + public ErrorInformation Properties { get; } + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapVirtualInstancePatch.Serialization.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapVirtualInstancePatch.Serialization.cs new file mode 100644 index 000000000000..88de3f232e3b --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapVirtualInstancePatch.Serialization.cs @@ -0,0 +1,174 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.SapVirtualInstances.Models +{ + public partial class SapVirtualInstancePatch : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SapVirtualInstancePatch)} does not support writing '{format}' format."); + } + + if (Optional.IsCollectionDefined(Tags)) + { + writer.WritePropertyName("tags"u8); + writer.WriteStartObject(); + foreach (var item in Tags) + { + writer.WritePropertyName(item.Key); + writer.WriteStringValue(item.Value); + } + writer.WriteEndObject(); + } + if (Optional.IsDefined(Identity)) + { + writer.WritePropertyName("identity"u8); + writer.WriteObjectValue(Identity, options); + } + if (Optional.IsDefined(Properties)) + { + writer.WritePropertyName("properties"u8); + writer.WriteObjectValue(Properties, options); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + SapVirtualInstancePatch 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(SapVirtualInstancePatch)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeSapVirtualInstancePatch(document.RootElement, options); + } + + internal static SapVirtualInstancePatch DeserializeSapVirtualInstancePatch(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IDictionary tags = default; + SAPVirtualInstanceIdentity identity = default; + UpdateSapVirtualInstanceProperties properties = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("tags"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var property0 in property.Value.EnumerateObject()) + { + dictionary.Add(property0.Name, property0.Value.GetString()); + } + tags = dictionary; + continue; + } + if (property.NameEquals("identity"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + identity = SAPVirtualInstanceIdentity.DeserializeSAPVirtualInstanceIdentity(property.Value, options); + continue; + } + if (property.NameEquals("properties"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + properties = UpdateSapVirtualInstanceProperties.DeserializeUpdateSapVirtualInstanceProperties(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new SapVirtualInstancePatch(tags ?? new ChangeTrackingDictionary(), identity, 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(SapVirtualInstancePatch)} does not support writing '{options.Format}' format."); + } + } + + SapVirtualInstancePatch IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeSapVirtualInstancePatch(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(SapVirtualInstancePatch)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapVirtualInstancePatch.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapVirtualInstancePatch.cs new file mode 100644 index 000000000000..d38c79714ba2 --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapVirtualInstancePatch.cs @@ -0,0 +1,85 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.SapVirtualInstances.Models +{ + /// Defines the request body for updating Virtual Instance for SAP. + public partial class SapVirtualInstancePatch + { + /// + /// 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 SapVirtualInstancePatch() + { + Tags = new ChangeTrackingDictionary(); + } + + /// Initializes a new instance of . + /// Gets or sets the Resource tags. + /// Managed service identity (user assigned identities). + /// The update properties. + /// Keeps track of any properties unknown to the library. + internal SapVirtualInstancePatch(IDictionary tags, SAPVirtualInstanceIdentity identity, UpdateSapVirtualInstanceProperties properties, IDictionary serializedAdditionalRawData) + { + Tags = tags; + Identity = identity; + Properties = properties; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Gets or sets the Resource tags. + public IDictionary Tags { get; } + /// Managed service identity (user assigned identities). + public SAPVirtualInstanceIdentity Identity { get; set; } + /// The update properties. + internal UpdateSapVirtualInstanceProperties Properties { get; set; } + /// Specifies the network access configuration for the resources that will be deployed in the Managed Resource Group. The options to choose from are Public and Private. If 'Private' is chosen, the Storage Account service tag should be enabled on the subnets in which the SAP VMs exist. This is required for establishing connectivity between VM extensions and the managed resource group storage account. This setting is currently applicable only to Storage Account. Learn more here https://go.microsoft.com/fwlink/?linkid=2247228. + public ManagedResourcesNetworkAccessType? UpdateSapVirtualInstanceManagedResourcesNetworkAccessType + { + get => Properties is null ? default : Properties.ManagedResourcesNetworkAccessType; + set + { + if (Properties is null) + Properties = new UpdateSapVirtualInstanceProperties(); + Properties.ManagedResourcesNetworkAccessType = value; + } + } + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapVirtualInstanceProperties.Serialization.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapVirtualInstanceProperties.Serialization.cs new file mode 100644 index 000000000000..8366b33ee996 --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapVirtualInstanceProperties.Serialization.cs @@ -0,0 +1,258 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.SapVirtualInstances.Models +{ + public partial class SapVirtualInstanceProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SapVirtualInstanceProperties)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("environment"u8); + writer.WriteStringValue(Environment.ToString()); + writer.WritePropertyName("sapProduct"u8); + writer.WriteStringValue(SapProduct.ToString()); + if (Optional.IsDefined(ManagedResourcesNetworkAccessType)) + { + writer.WritePropertyName("managedResourcesNetworkAccessType"u8); + writer.WriteStringValue(ManagedResourcesNetworkAccessType.Value.ToString()); + } + writer.WritePropertyName("configuration"u8); + writer.WriteObjectValue(Configuration, options); + if (Optional.IsDefined(ManagedResourceGroupConfiguration)) + { + writer.WritePropertyName("managedResourceGroupConfiguration"u8); + writer.WriteObjectValue(ManagedResourceGroupConfiguration, options); + } + if (options.Format != "W" && Optional.IsDefined(Status)) + { + writer.WritePropertyName("status"u8); + writer.WriteStringValue(Status.Value.ToString()); + } + if (options.Format != "W" && Optional.IsDefined(Health)) + { + writer.WritePropertyName("health"u8); + writer.WriteStringValue(Health.Value.ToString()); + } + if (options.Format != "W" && Optional.IsDefined(State)) + { + writer.WritePropertyName("state"u8); + writer.WriteStringValue(State.Value.ToString()); + } + if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) + { + writer.WritePropertyName("provisioningState"u8); + writer.WriteStringValue(ProvisioningState.Value.ToString()); + } + if (options.Format != "W" && Optional.IsDefined(Errors)) + { + writer.WritePropertyName("errors"u8); + writer.WriteObjectValue(Errors, options); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + SapVirtualInstanceProperties 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(SapVirtualInstanceProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeSapVirtualInstanceProperties(document.RootElement, options); + } + + internal static SapVirtualInstanceProperties DeserializeSapVirtualInstanceProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + SapEnvironmentType environment = default; + SapProductType sapProduct = default; + ManagedResourcesNetworkAccessType? managedResourcesNetworkAccessType = default; + SapConfiguration configuration = default; + ManagedRGConfiguration managedResourceGroupConfiguration = default; + SapVirtualInstanceStatus? status = default; + SapHealthState? health = default; + SapVirtualInstanceState? state = default; + SapVirtualInstanceProvisioningState? provisioningState = default; + SapVirtualInstanceError errors = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("environment"u8)) + { + environment = new SapEnvironmentType(property.Value.GetString()); + continue; + } + if (property.NameEquals("sapProduct"u8)) + { + sapProduct = new SapProductType(property.Value.GetString()); + continue; + } + if (property.NameEquals("managedResourcesNetworkAccessType"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + managedResourcesNetworkAccessType = new ManagedResourcesNetworkAccessType(property.Value.GetString()); + continue; + } + if (property.NameEquals("configuration"u8)) + { + configuration = SapConfiguration.DeserializeSapConfiguration(property.Value, options); + continue; + } + if (property.NameEquals("managedResourceGroupConfiguration"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + managedResourceGroupConfiguration = ManagedRGConfiguration.DeserializeManagedRGConfiguration(property.Value, options); + continue; + } + if (property.NameEquals("status"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + status = new SapVirtualInstanceStatus(property.Value.GetString()); + continue; + } + if (property.NameEquals("health"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + health = new SapHealthState(property.Value.GetString()); + continue; + } + if (property.NameEquals("state"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + state = new SapVirtualInstanceState(property.Value.GetString()); + continue; + } + if (property.NameEquals("provisioningState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + provisioningState = new SapVirtualInstanceProvisioningState(property.Value.GetString()); + continue; + } + if (property.NameEquals("errors"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + errors = SapVirtualInstanceError.DeserializeSapVirtualInstanceError(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new SapVirtualInstanceProperties( + environment, + sapProduct, + managedResourcesNetworkAccessType, + configuration, + managedResourceGroupConfiguration, + status, + health, + state, + provisioningState, + errors, + 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(SapVirtualInstanceProperties)} does not support writing '{options.Format}' format."); + } + } + + SapVirtualInstanceProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeSapVirtualInstanceProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(SapVirtualInstanceProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapVirtualInstanceProperties.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapVirtualInstanceProperties.cs new file mode 100644 index 000000000000..cd9723a6f3a6 --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapVirtualInstanceProperties.cs @@ -0,0 +1,144 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.SapVirtualInstances.Models +{ + /// Defines the Virtual Instance for SAP solutions resource properties. + public partial class SapVirtualInstanceProperties + { + /// + /// 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 . + /// Defines the environment type - Production/Non Production. + /// Defines the SAP Product type. + /// + /// Defines if the SAP system is being created using Azure Center for SAP solutions (ACSS) or if an existing SAP system is being registered with ACSS + /// 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 . + /// + /// is null. + public SapVirtualInstanceProperties(SapEnvironmentType environment, SapProductType sapProduct, SapConfiguration configuration) + { + Argument.AssertNotNull(configuration, nameof(configuration)); + + Environment = environment; + SapProduct = sapProduct; + Configuration = configuration; + } + + /// Initializes a new instance of . + /// Defines the environment type - Production/Non Production. + /// Defines the SAP Product type. + /// Specifies the network access configuration for the resources that will be deployed in the Managed Resource Group. The options to choose from are Public and Private. If 'Private' is chosen, the Storage Account service tag should be enabled on the subnets in which the SAP VMs exist. This is required for establishing connectivity between VM extensions and the managed resource group storage account. This setting is currently applicable only to Storage Account. Learn more here https://go.microsoft.com/fwlink/?linkid=2247228. + /// + /// Defines if the SAP system is being created using Azure Center for SAP solutions (ACSS) or if an existing SAP system is being registered with ACSS + /// 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 . + /// + /// Managed resource group configuration. + /// Defines the SAP Instance status. + /// Defines the health of SAP Instances. + /// Defines the Virtual Instance for SAP state. + /// Defines the provisioning states. + /// Indicates any errors on the Virtual Instance for SAP solutions resource. + /// Keeps track of any properties unknown to the library. + internal SapVirtualInstanceProperties(SapEnvironmentType environment, SapProductType sapProduct, ManagedResourcesNetworkAccessType? managedResourcesNetworkAccessType, SapConfiguration configuration, ManagedRGConfiguration managedResourceGroupConfiguration, SapVirtualInstanceStatus? status, SapHealthState? health, SapVirtualInstanceState? state, SapVirtualInstanceProvisioningState? provisioningState, SapVirtualInstanceError errors, IDictionary serializedAdditionalRawData) + { + Environment = environment; + SapProduct = sapProduct; + ManagedResourcesNetworkAccessType = managedResourcesNetworkAccessType; + Configuration = configuration; + ManagedResourceGroupConfiguration = managedResourceGroupConfiguration; + Status = status; + Health = health; + State = state; + ProvisioningState = provisioningState; + Errors = errors; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal SapVirtualInstanceProperties() + { + } + + /// Defines the environment type - Production/Non Production. + public SapEnvironmentType Environment { get; set; } + /// Defines the SAP Product type. + public SapProductType SapProduct { get; set; } + /// Specifies the network access configuration for the resources that will be deployed in the Managed Resource Group. The options to choose from are Public and Private. If 'Private' is chosen, the Storage Account service tag should be enabled on the subnets in which the SAP VMs exist. This is required for establishing connectivity between VM extensions and the managed resource group storage account. This setting is currently applicable only to Storage Account. Learn more here https://go.microsoft.com/fwlink/?linkid=2247228. + public ManagedResourcesNetworkAccessType? ManagedResourcesNetworkAccessType { get; set; } + /// + /// Defines if the SAP system is being created using Azure Center for SAP solutions (ACSS) or if an existing SAP system is being registered with ACSS + /// 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 . + /// + public SapConfiguration Configuration { get; set; } + /// Managed resource group configuration. + internal ManagedRGConfiguration ManagedResourceGroupConfiguration { get; set; } + /// Managed resource group name. + public string ManagedResourceGroupName + { + get => ManagedResourceGroupConfiguration is null ? default : ManagedResourceGroupConfiguration.Name; + set + { + if (ManagedResourceGroupConfiguration is null) + ManagedResourceGroupConfiguration = new ManagedRGConfiguration(); + ManagedResourceGroupConfiguration.Name = value; + } + } + + /// Defines the SAP Instance status. + public SapVirtualInstanceStatus? Status { get; } + /// Defines the health of SAP Instances. + public SapHealthState? Health { get; } + /// Defines the Virtual Instance for SAP state. + public SapVirtualInstanceState? State { get; } + /// Defines the provisioning states. + public SapVirtualInstanceProvisioningState? ProvisioningState { get; } + /// Indicates any errors on the Virtual Instance for SAP solutions resource. + internal SapVirtualInstanceError Errors { get; } + /// The Virtual Instance for SAP error body. + public ErrorInformation ErrorsProperties + { + get => Errors?.Properties; + } + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapVirtualInstanceProvisioningState.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapVirtualInstanceProvisioningState.cs new file mode 100644 index 000000000000..2c1b19b21645 --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapVirtualInstanceProvisioningState.cs @@ -0,0 +1,63 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.SapVirtualInstances.Models +{ + /// Defines the provisioning states. + public readonly partial struct SapVirtualInstanceProvisioningState : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public SapVirtualInstanceProvisioningState(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string SucceededValue = "Succeeded"; + private const string UpdatingValue = "Updating"; + private const string CreatingValue = "Creating"; + private const string FailedValue = "Failed"; + private const string DeletingValue = "Deleting"; + private const string CanceledValue = "Canceled"; + + /// ACSS succeeded provisioning state. + public static SapVirtualInstanceProvisioningState Succeeded { get; } = new SapVirtualInstanceProvisioningState(SucceededValue); + /// ACSS updating provisioning state. + public static SapVirtualInstanceProvisioningState Updating { get; } = new SapVirtualInstanceProvisioningState(UpdatingValue); + /// ACSS Creating provisioning state. + public static SapVirtualInstanceProvisioningState Creating { get; } = new SapVirtualInstanceProvisioningState(CreatingValue); + /// ACSS Failed provisioning state. + public static SapVirtualInstanceProvisioningState Failed { get; } = new SapVirtualInstanceProvisioningState(FailedValue); + /// ACSS Deleting provisioning state. + public static SapVirtualInstanceProvisioningState Deleting { get; } = new SapVirtualInstanceProvisioningState(DeletingValue); + /// ACSS Canceled provisioning state. + public static SapVirtualInstanceProvisioningState Canceled { get; } = new SapVirtualInstanceProvisioningState(CanceledValue); + /// Determines if two values are the same. + public static bool operator ==(SapVirtualInstanceProvisioningState left, SapVirtualInstanceProvisioningState right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(SapVirtualInstanceProvisioningState left, SapVirtualInstanceProvisioningState right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator SapVirtualInstanceProvisioningState(string value) => new SapVirtualInstanceProvisioningState(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is SapVirtualInstanceProvisioningState other && Equals(other); + /// + public bool Equals(SapVirtualInstanceProvisioningState other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapVirtualInstanceState.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapVirtualInstanceState.cs new file mode 100644 index 000000000000..b2aa043b9ae6 --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapVirtualInstanceState.cs @@ -0,0 +1,84 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.SapVirtualInstances.Models +{ + /// Defines the Virtual Instance for SAP state. + public readonly partial struct SapVirtualInstanceState : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public SapVirtualInstanceState(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string InfrastructureDeploymentPendingValue = "InfrastructureDeploymentPending"; + private const string InfrastructureDeploymentInProgressValue = "InfrastructureDeploymentInProgress"; + private const string InfrastructureDeploymentFailedValue = "InfrastructureDeploymentFailed"; + private const string SoftwareInstallationPendingValue = "SoftwareInstallationPending"; + private const string SoftwareInstallationInProgressValue = "SoftwareInstallationInProgress"; + private const string SoftwareInstallationFailedValue = "SoftwareInstallationFailed"; + private const string SoftwareDetectionInProgressValue = "SoftwareDetectionInProgress"; + private const string SoftwareDetectionFailedValue = "SoftwareDetectionFailed"; + private const string DiscoveryPendingValue = "DiscoveryPending"; + private const string DiscoveryInProgressValue = "DiscoveryInProgress"; + private const string DiscoveryFailedValue = "DiscoveryFailed"; + private const string RegistrationCompleteValue = "RegistrationComplete"; + private const string ACSSInstallationBlockedValue = "ACSSInstallationBlocked"; + + /// Infrastructure is not yet deployed. + public static SapVirtualInstanceState InfrastructureDeploymentPending { get; } = new SapVirtualInstanceState(InfrastructureDeploymentPendingValue); + /// Infrastructure deployment is in progress. + public static SapVirtualInstanceState InfrastructureDeploymentInProgress { get; } = new SapVirtualInstanceState(InfrastructureDeploymentInProgressValue); + /// Infrastructure deployment has failed. + public static SapVirtualInstanceState InfrastructureDeploymentFailed { get; } = new SapVirtualInstanceState(InfrastructureDeploymentFailedValue); + /// Infrastructure deployment is successful. Software installation is pending. + public static SapVirtualInstanceState SoftwareInstallationPending { get; } = new SapVirtualInstanceState(SoftwareInstallationPendingValue); + /// Software installation is in progress. + public static SapVirtualInstanceState SoftwareInstallationInProgress { get; } = new SapVirtualInstanceState(SoftwareInstallationInProgressValue); + /// Software installation failed. + public static SapVirtualInstanceState SoftwareInstallationFailed { get; } = new SapVirtualInstanceState(SoftwareInstallationFailedValue); + /// Software detection is in progress. + public static SapVirtualInstanceState SoftwareDetectionInProgress { get; } = new SapVirtualInstanceState(SoftwareDetectionInProgressValue); + /// Software detection failed. + public static SapVirtualInstanceState SoftwareDetectionFailed { get; } = new SapVirtualInstanceState(SoftwareDetectionFailedValue); + /// Registration has not started. + public static SapVirtualInstanceState DiscoveryPending { get; } = new SapVirtualInstanceState(DiscoveryPendingValue); + /// Registration is in progress. + public static SapVirtualInstanceState DiscoveryInProgress { get; } = new SapVirtualInstanceState(DiscoveryInProgressValue); + /// Registration has failed. + public static SapVirtualInstanceState DiscoveryFailed { get; } = new SapVirtualInstanceState(DiscoveryFailedValue); + /// Registration is complete. + public static SapVirtualInstanceState RegistrationComplete { get; } = new SapVirtualInstanceState(RegistrationCompleteValue); + /// ACSS installation cannot proceed. + public static SapVirtualInstanceState ACSSInstallationBlocked { get; } = new SapVirtualInstanceState(ACSSInstallationBlockedValue); + /// Determines if two values are the same. + public static bool operator ==(SapVirtualInstanceState left, SapVirtualInstanceState right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(SapVirtualInstanceState left, SapVirtualInstanceState right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator SapVirtualInstanceState(string value) => new SapVirtualInstanceState(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is SapVirtualInstanceState other && Equals(other); + /// + public bool Equals(SapVirtualInstanceState other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapVirtualInstanceStatus.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapVirtualInstanceStatus.cs new file mode 100644 index 000000000000..4ac8e7edc524 --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapVirtualInstanceStatus.cs @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.SapVirtualInstances.Models +{ + /// Defines the SAP Instance status. + public readonly partial struct SapVirtualInstanceStatus : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public SapVirtualInstanceStatus(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string StartingValue = "Starting"; + private const string RunningValue = "Running"; + private const string StoppingValue = "Stopping"; + private const string OfflineValue = "Offline"; + private const string PartiallyRunningValue = "PartiallyRunning"; + private const string UnavailableValue = "Unavailable"; + private const string SoftShutdownValue = "SoftShutdown"; + + /// SAP system is getting started. + public static SapVirtualInstanceStatus Starting { get; } = new SapVirtualInstanceStatus(StartingValue); + /// SAP system is running. + public static SapVirtualInstanceStatus Running { get; } = new SapVirtualInstanceStatus(RunningValue); + /// SAP system is being stopped. + public static SapVirtualInstanceStatus Stopping { get; } = new SapVirtualInstanceStatus(StoppingValue); + /// SAP system is offline. + public static SapVirtualInstanceStatus Offline { get; } = new SapVirtualInstanceStatus(OfflineValue); + /// SAP system is partially running. + public static SapVirtualInstanceStatus PartiallyRunning { get; } = new SapVirtualInstanceStatus(PartiallyRunningValue); + /// SAP system status is unavailable. + public static SapVirtualInstanceStatus Unavailable { get; } = new SapVirtualInstanceStatus(UnavailableValue); + /// Soft shutdown of SAP system is initiated. + public static SapVirtualInstanceStatus SoftShutdown { get; } = new SapVirtualInstanceStatus(SoftShutdownValue); + /// Determines if two values are the same. + public static bool operator ==(SapVirtualInstanceStatus left, SapVirtualInstanceStatus right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(SapVirtualInstanceStatus left, SapVirtualInstanceStatus right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator SapVirtualInstanceStatus(string value) => new SapVirtualInstanceStatus(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is SapVirtualInstanceStatus other && Equals(other); + /// + public bool Equals(SapVirtualInstanceStatus other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/ServiceInitiatedSoftwareConfiguration.Serialization.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/ServiceInitiatedSoftwareConfiguration.Serialization.cs new file mode 100644 index 000000000000..2c7edde1388e --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/ServiceInitiatedSoftwareConfiguration.Serialization.cs @@ -0,0 +1,173 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.SapVirtualInstances.Models +{ + public partial class ServiceInitiatedSoftwareConfiguration : 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(ServiceInitiatedSoftwareConfiguration)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + writer.WritePropertyName("bomUrl"u8); + writer.WriteStringValue(BomUri); + writer.WritePropertyName("softwareVersion"u8); + writer.WriteStringValue(SoftwareVersion); + writer.WritePropertyName("sapBitsStorageAccountId"u8); + writer.WriteStringValue(SapBitsStorageAccountId); + writer.WritePropertyName("sapFqdn"u8); + writer.WriteStringValue(SapFqdn); + writer.WritePropertyName("sshPrivateKey"u8); + writer.WriteStringValue(SshPrivateKey); + if (Optional.IsDefined(HighAvailabilitySoftwareConfiguration)) + { + writer.WritePropertyName("highAvailabilitySoftwareConfiguration"u8); + writer.WriteObjectValue(HighAvailabilitySoftwareConfiguration, options); + } + } + + ServiceInitiatedSoftwareConfiguration 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(ServiceInitiatedSoftwareConfiguration)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeServiceInitiatedSoftwareConfiguration(document.RootElement, options); + } + + internal static ServiceInitiatedSoftwareConfiguration DeserializeServiceInitiatedSoftwareConfiguration(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string bomUrl = default; + string softwareVersion = default; + string sapBitsStorageAccountId = default; + string sapFqdn = default; + string sshPrivateKey = default; + HighAvailabilitySoftwareConfiguration highAvailabilitySoftwareConfiguration = default; + SapSoftwareInstallationType softwareInstallationType = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("bomUrl"u8)) + { + bomUrl = property.Value.GetString(); + continue; + } + if (property.NameEquals("softwareVersion"u8)) + { + softwareVersion = property.Value.GetString(); + continue; + } + if (property.NameEquals("sapBitsStorageAccountId"u8)) + { + sapBitsStorageAccountId = property.Value.GetString(); + continue; + } + if (property.NameEquals("sapFqdn"u8)) + { + sapFqdn = property.Value.GetString(); + continue; + } + if (property.NameEquals("sshPrivateKey"u8)) + { + sshPrivateKey = property.Value.GetString(); + continue; + } + if (property.NameEquals("highAvailabilitySoftwareConfiguration"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + highAvailabilitySoftwareConfiguration = HighAvailabilitySoftwareConfiguration.DeserializeHighAvailabilitySoftwareConfiguration(property.Value, options); + continue; + } + if (property.NameEquals("softwareInstallationType"u8)) + { + softwareInstallationType = new SapSoftwareInstallationType(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ServiceInitiatedSoftwareConfiguration( + softwareInstallationType, + serializedAdditionalRawData, + bomUrl, + softwareVersion, + sapBitsStorageAccountId, + sapFqdn, + sshPrivateKey, + highAvailabilitySoftwareConfiguration); + } + + 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(ServiceInitiatedSoftwareConfiguration)} does not support writing '{options.Format}' format."); + } + } + + ServiceInitiatedSoftwareConfiguration IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeServiceInitiatedSoftwareConfiguration(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ServiceInitiatedSoftwareConfiguration)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/ServiceInitiatedSoftwareConfiguration.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/ServiceInitiatedSoftwareConfiguration.cs new file mode 100644 index 000000000000..74baf107de2a --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/ServiceInitiatedSoftwareConfiguration.cs @@ -0,0 +1,77 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.SapVirtualInstances.Models +{ + /// The SAP Software configuration Input when the software is to be installed by service. + public partial class ServiceInitiatedSoftwareConfiguration : SoftwareConfiguration + { + /// Initializes a new instance of . + /// The URL to the SAP Build of Materials(BOM) file. + /// The software version to install. + /// The SAP bits storage account id. + /// The FQDN to set for the SAP system during install. + /// The SSH private key. + /// , , , or is null. + public ServiceInitiatedSoftwareConfiguration(string bomUri, string softwareVersion, string sapBitsStorageAccountId, string sapFqdn, string sshPrivateKey) + { + Argument.AssertNotNull(bomUri, nameof(bomUri)); + Argument.AssertNotNull(softwareVersion, nameof(softwareVersion)); + Argument.AssertNotNull(sapBitsStorageAccountId, nameof(sapBitsStorageAccountId)); + Argument.AssertNotNull(sapFqdn, nameof(sapFqdn)); + Argument.AssertNotNull(sshPrivateKey, nameof(sshPrivateKey)); + + BomUri = bomUri; + SoftwareVersion = softwareVersion; + SapBitsStorageAccountId = sapBitsStorageAccountId; + SapFqdn = sapFqdn; + SshPrivateKey = sshPrivateKey; + SoftwareInstallationType = SapSoftwareInstallationType.ServiceInitiated; + } + + /// Initializes a new instance of . + /// The SAP software installation type. + /// Keeps track of any properties unknown to the library. + /// The URL to the SAP Build of Materials(BOM) file. + /// The software version to install. + /// The SAP bits storage account id. + /// The FQDN to set for the SAP system during install. + /// The SSH private key. + /// Gets or sets the HA software configuration. + internal ServiceInitiatedSoftwareConfiguration(SapSoftwareInstallationType softwareInstallationType, IDictionary serializedAdditionalRawData, string bomUri, string softwareVersion, string sapBitsStorageAccountId, string sapFqdn, string sshPrivateKey, HighAvailabilitySoftwareConfiguration highAvailabilitySoftwareConfiguration) : base(softwareInstallationType, serializedAdditionalRawData) + { + BomUri = bomUri; + SoftwareVersion = softwareVersion; + SapBitsStorageAccountId = sapBitsStorageAccountId; + SapFqdn = sapFqdn; + SshPrivateKey = sshPrivateKey; + HighAvailabilitySoftwareConfiguration = highAvailabilitySoftwareConfiguration; + SoftwareInstallationType = softwareInstallationType; + } + + /// Initializes a new instance of for deserialization. + internal ServiceInitiatedSoftwareConfiguration() + { + } + + /// The URL to the SAP Build of Materials(BOM) file. + public string BomUri { get; set; } + /// The software version to install. + public string SoftwareVersion { get; set; } + /// The SAP bits storage account id. + public string SapBitsStorageAccountId { get; set; } + /// The FQDN to set for the SAP system during install. + public string SapFqdn { get; set; } + /// The SSH private key. + public string SshPrivateKey { get; set; } + /// Gets or sets the HA software configuration. + public HighAvailabilitySoftwareConfiguration HighAvailabilitySoftwareConfiguration { get; set; } + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SharedStorageResourceNames.Serialization.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SharedStorageResourceNames.Serialization.cs new file mode 100644 index 000000000000..8cd0c0723e90 --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SharedStorageResourceNames.Serialization.cs @@ -0,0 +1,140 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.SapVirtualInstances.Models +{ + public partial class SharedStorageResourceNames : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SharedStorageResourceNames)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(SharedStorageAccountName)) + { + writer.WritePropertyName("sharedStorageAccountName"u8); + writer.WriteStringValue(SharedStorageAccountName); + } + if (Optional.IsDefined(SharedStorageAccountPrivateEndPointName)) + { + writer.WritePropertyName("sharedStorageAccountPrivateEndPointName"u8); + writer.WriteStringValue(SharedStorageAccountPrivateEndPointName); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + SharedStorageResourceNames 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(SharedStorageResourceNames)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeSharedStorageResourceNames(document.RootElement, options); + } + + internal static SharedStorageResourceNames DeserializeSharedStorageResourceNames(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string sharedStorageAccountName = default; + string sharedStorageAccountPrivateEndPointName = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("sharedStorageAccountName"u8)) + { + sharedStorageAccountName = property.Value.GetString(); + continue; + } + if (property.NameEquals("sharedStorageAccountPrivateEndPointName"u8)) + { + sharedStorageAccountPrivateEndPointName = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new SharedStorageResourceNames(sharedStorageAccountName, sharedStorageAccountPrivateEndPointName, 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(SharedStorageResourceNames)} does not support writing '{options.Format}' format."); + } + } + + SharedStorageResourceNames IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeSharedStorageResourceNames(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(SharedStorageResourceNames)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SharedStorageResourceNames.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SharedStorageResourceNames.cs new file mode 100644 index 000000000000..a63616969347 --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SharedStorageResourceNames.cs @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.SapVirtualInstances.Models +{ + /// The resource names object for shared storage. + public partial class SharedStorageResourceNames + { + /// + /// 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 SharedStorageResourceNames() + { + } + + /// Initializes a new instance of . + /// The full name of the shared storage account. If it is not provided, it will be defaulted to {SID}nfs{guid of 15 chars}. + /// The full name of private end point for the shared storage account. If it is not provided, it will be defaulted to {storageAccountName}_pe. + /// Keeps track of any properties unknown to the library. + internal SharedStorageResourceNames(string sharedStorageAccountName, string sharedStorageAccountPrivateEndPointName, IDictionary serializedAdditionalRawData) + { + SharedStorageAccountName = sharedStorageAccountName; + SharedStorageAccountPrivateEndPointName = sharedStorageAccountPrivateEndPointName; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The full name of the shared storage account. If it is not provided, it will be defaulted to {SID}nfs{guid of 15 chars}. + public string SharedStorageAccountName { get; set; } + /// The full name of private end point for the shared storage account. If it is not provided, it will be defaulted to {storageAccountName}_pe. + public string SharedStorageAccountPrivateEndPointName { get; set; } + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SingleServerConfiguration.Serialization.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SingleServerConfiguration.Serialization.cs new file mode 100644 index 000000000000..fcabe023bf8d --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SingleServerConfiguration.Serialization.cs @@ -0,0 +1,201 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.SapVirtualInstances.Models +{ + public partial class SingleServerConfiguration : 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(SingleServerConfiguration)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (Optional.IsDefined(NetworkConfiguration)) + { + writer.WritePropertyName("networkConfiguration"u8); + writer.WriteObjectValue(NetworkConfiguration, options); + } + if (Optional.IsDefined(DatabaseType)) + { + writer.WritePropertyName("databaseType"u8); + writer.WriteStringValue(DatabaseType.Value.ToString()); + } + writer.WritePropertyName("subnetId"u8); + writer.WriteStringValue(SubnetId); + writer.WritePropertyName("virtualMachineConfiguration"u8); + writer.WriteObjectValue(VirtualMachineConfiguration, options); + if (Optional.IsDefined(DbDiskConfiguration)) + { + writer.WritePropertyName("dbDiskConfiguration"u8); + writer.WriteObjectValue(DbDiskConfiguration, options); + } + if (Optional.IsDefined(CustomResourceNames)) + { + writer.WritePropertyName("customResourceNames"u8); + writer.WriteObjectValue(CustomResourceNames, options); + } + } + + SingleServerConfiguration 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(SingleServerConfiguration)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeSingleServerConfiguration(document.RootElement, options); + } + + internal static SingleServerConfiguration DeserializeSingleServerConfiguration(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + NetworkConfiguration networkConfiguration = default; + SapDatabaseType? databaseType = default; + string subnetId = default; + VirtualMachineConfiguration virtualMachineConfiguration = default; + DiskConfiguration dbDiskConfiguration = default; + SingleServerCustomResourceNames customResourceNames = default; + string appResourceGroup = default; + SapDeploymentType deploymentType = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("networkConfiguration"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + networkConfiguration = NetworkConfiguration.DeserializeNetworkConfiguration(property.Value, options); + continue; + } + if (property.NameEquals("databaseType"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + databaseType = new SapDatabaseType(property.Value.GetString()); + continue; + } + if (property.NameEquals("subnetId"u8)) + { + subnetId = property.Value.GetString(); + continue; + } + if (property.NameEquals("virtualMachineConfiguration"u8)) + { + virtualMachineConfiguration = VirtualMachineConfiguration.DeserializeVirtualMachineConfiguration(property.Value, options); + continue; + } + if (property.NameEquals("dbDiskConfiguration"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + dbDiskConfiguration = DiskConfiguration.DeserializeDiskConfiguration(property.Value, options); + continue; + } + if (property.NameEquals("customResourceNames"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + customResourceNames = SingleServerCustomResourceNames.DeserializeSingleServerCustomResourceNames(property.Value, options); + continue; + } + if (property.NameEquals("appResourceGroup"u8)) + { + appResourceGroup = property.Value.GetString(); + continue; + } + if (property.NameEquals("deploymentType"u8)) + { + deploymentType = new SapDeploymentType(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new SingleServerConfiguration( + appResourceGroup, + deploymentType, + serializedAdditionalRawData, + networkConfiguration, + databaseType, + subnetId, + virtualMachineConfiguration, + dbDiskConfiguration, + customResourceNames); + } + + 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(SingleServerConfiguration)} does not support writing '{options.Format}' format."); + } + } + + SingleServerConfiguration IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeSingleServerConfiguration(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(SingleServerConfiguration)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SingleServerConfiguration.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SingleServerConfiguration.cs new file mode 100644 index 000000000000..0c9786b43b71 --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SingleServerConfiguration.cs @@ -0,0 +1,102 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.SapVirtualInstances.Models +{ + /// Gets or sets the single server configuration. For prerequisites for creating the infrastructure, please see [here](https://go.microsoft.com/fwlink/?linkid=2212611&clcid=0x409). + public partial class SingleServerConfiguration : InfrastructureConfiguration + { + /// Initializes a new instance of . + /// The application resource group where SAP system resources will be deployed. + /// The subnet id. + /// Gets or sets the virtual machine configuration. + /// , or is null. + public SingleServerConfiguration(string appResourceGroup, string subnetId, VirtualMachineConfiguration virtualMachineConfiguration) : base(appResourceGroup) + { + Argument.AssertNotNull(appResourceGroup, nameof(appResourceGroup)); + Argument.AssertNotNull(subnetId, nameof(subnetId)); + Argument.AssertNotNull(virtualMachineConfiguration, nameof(virtualMachineConfiguration)); + + SubnetId = subnetId; + VirtualMachineConfiguration = virtualMachineConfiguration; + DeploymentType = SapDeploymentType.SingleServer; + } + + /// Initializes a new instance of . + /// The application resource group where SAP system resources will be deployed. + /// The SAP deployment type. Eg: SingleServer/ThreeTier. + /// Keeps track of any properties unknown to the library. + /// Network configuration for the server. + /// The database type. + /// The subnet id. + /// Gets or sets the virtual machine configuration. + /// Gets or sets the disk configuration. + /// + /// The set of custom names to be used for underlying azure resources that are part of the SAP system. + /// 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 . + /// + internal SingleServerConfiguration(string appResourceGroup, SapDeploymentType deploymentType, IDictionary serializedAdditionalRawData, NetworkConfiguration networkConfiguration, SapDatabaseType? databaseType, string subnetId, VirtualMachineConfiguration virtualMachineConfiguration, DiskConfiguration dbDiskConfiguration, SingleServerCustomResourceNames customResourceNames) : base(appResourceGroup, deploymentType, serializedAdditionalRawData) + { + NetworkConfiguration = networkConfiguration; + DatabaseType = databaseType; + SubnetId = subnetId; + VirtualMachineConfiguration = virtualMachineConfiguration; + DbDiskConfiguration = dbDiskConfiguration; + CustomResourceNames = customResourceNames; + DeploymentType = deploymentType; + } + + /// Initializes a new instance of for deserialization. + internal SingleServerConfiguration() + { + } + + /// Network configuration for the server. + internal NetworkConfiguration NetworkConfiguration { get; set; } + /// Specifies whether a secondary IP address should be added to the network interface on all VMs of the SAP system being deployed. + public bool? IsSecondaryIPEnabled + { + get => NetworkConfiguration is null ? default : NetworkConfiguration.IsSecondaryIPEnabled; + set + { + if (NetworkConfiguration is null) + NetworkConfiguration = new NetworkConfiguration(); + NetworkConfiguration.IsSecondaryIPEnabled = value; + } + } + + /// The database type. + public SapDatabaseType? DatabaseType { get; set; } + /// The subnet id. + public string SubnetId { get; set; } + /// Gets or sets the virtual machine configuration. + public VirtualMachineConfiguration VirtualMachineConfiguration { get; set; } + /// Gets or sets the disk configuration. + internal DiskConfiguration DbDiskConfiguration { get; set; } + /// The disk configuration for the db volume. For HANA, Required volumes are: ['hana/data', 'hana/log', hana/shared', 'usr/sap', 'os'], Optional volume : ['backup']. + public IDictionary DiskVolumeConfigurations + { + get + { + if (DbDiskConfiguration is null) + DbDiskConfiguration = new DiskConfiguration(); + return DbDiskConfiguration.DiskVolumeConfigurations; + } + } + + /// + /// The set of custom names to be used for underlying azure resources that are part of the SAP system. + /// 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 SingleServerCustomResourceNames CustomResourceNames { get; set; } + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SingleServerCustomResourceNames.Serialization.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SingleServerCustomResourceNames.Serialization.cs new file mode 100644 index 000000000000..38e2a2d95596 --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SingleServerCustomResourceNames.Serialization.cs @@ -0,0 +1,117 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.SapVirtualInstances.Models +{ + [PersistableModelProxy(typeof(UnknownSingleServerCustomResourceNames))] + public partial class SingleServerCustomResourceNames : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SingleServerCustomResourceNames)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("namingPatternType"u8); + writer.WriteStringValue(NamingPatternType.ToString()); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + SingleServerCustomResourceNames 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(SingleServerCustomResourceNames)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeSingleServerCustomResourceNames(document.RootElement, options); + } + + internal static SingleServerCustomResourceNames DeserializeSingleServerCustomResourceNames(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + if (element.TryGetProperty("namingPatternType", out JsonElement discriminator)) + { + switch (discriminator.GetString()) + { + case "FullResourceName": return SingleServerFullResourceNames.DeserializeSingleServerFullResourceNames(element, options); + } + } + return UnknownSingleServerCustomResourceNames.DeserializeUnknownSingleServerCustomResourceNames(element, options); + } + + 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(SingleServerCustomResourceNames)} does not support writing '{options.Format}' format."); + } + } + + SingleServerCustomResourceNames IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeSingleServerCustomResourceNames(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(SingleServerCustomResourceNames)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SingleServerCustomResourceNames.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SingleServerCustomResourceNames.cs new file mode 100644 index 000000000000..707269bbfa9c --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SingleServerCustomResourceNames.cs @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.SapVirtualInstances.Models +{ + /// + /// The resource-names input to specify custom names for underlying azure resources that are part of a single server SAP system. + /// 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 abstract partial class SingleServerCustomResourceNames + { + /// + /// 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 protected IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + protected SingleServerCustomResourceNames() + { + } + + /// Initializes a new instance of . + /// The naming pattern type. + /// Keeps track of any properties unknown to the library. + internal SingleServerCustomResourceNames(NamingPatternType namingPatternType, IDictionary serializedAdditionalRawData) + { + NamingPatternType = namingPatternType; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The naming pattern type. + internal NamingPatternType NamingPatternType { get; set; } + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SingleServerFullResourceNames.Serialization.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SingleServerFullResourceNames.Serialization.cs new file mode 100644 index 000000000000..cb9868b39cd1 --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SingleServerFullResourceNames.Serialization.cs @@ -0,0 +1,125 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.SapVirtualInstances.Models +{ + public partial class SingleServerFullResourceNames : 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(SingleServerFullResourceNames)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (Optional.IsDefined(VirtualMachine)) + { + writer.WritePropertyName("virtualMachine"u8); + writer.WriteObjectValue(VirtualMachine, options); + } + } + + SingleServerFullResourceNames 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(SingleServerFullResourceNames)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeSingleServerFullResourceNames(document.RootElement, options); + } + + internal static SingleServerFullResourceNames DeserializeSingleServerFullResourceNames(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + VirtualMachineResourceNames virtualMachine = default; + NamingPatternType namingPatternType = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("virtualMachine"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + virtualMachine = VirtualMachineResourceNames.DeserializeVirtualMachineResourceNames(property.Value, options); + continue; + } + if (property.NameEquals("namingPatternType"u8)) + { + namingPatternType = new NamingPatternType(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new SingleServerFullResourceNames(namingPatternType, serializedAdditionalRawData, virtualMachine); + } + + 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(SingleServerFullResourceNames)} does not support writing '{options.Format}' format."); + } + } + + SingleServerFullResourceNames IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeSingleServerFullResourceNames(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(SingleServerFullResourceNames)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SingleServerFullResourceNames.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SingleServerFullResourceNames.cs new file mode 100644 index 000000000000..5d2c0d9d3cec --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SingleServerFullResourceNames.cs @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.SapVirtualInstances.Models +{ + /// The resource name object where the specified values will be full resource names of the corresponding resources in a single server SAP system. + public partial class SingleServerFullResourceNames : SingleServerCustomResourceNames + { + /// Initializes a new instance of . + public SingleServerFullResourceNames() + { + NamingPatternType = NamingPatternType.FullResourceName; + } + + /// Initializes a new instance of . + /// The naming pattern type. + /// Keeps track of any properties unknown to the library. + /// The resource names object for virtual machine and related resources. + internal SingleServerFullResourceNames(NamingPatternType namingPatternType, IDictionary serializedAdditionalRawData, VirtualMachineResourceNames virtualMachine) : base(namingPatternType, serializedAdditionalRawData) + { + VirtualMachine = virtualMachine; + NamingPatternType = namingPatternType; + } + + /// The resource names object for virtual machine and related resources. + public VirtualMachineResourceNames VirtualMachine { get; set; } + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SingleServerRecommendationResult.Serialization.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SingleServerRecommendationResult.Serialization.cs new file mode 100644 index 000000000000..73ac4704243a --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SingleServerRecommendationResult.Serialization.cs @@ -0,0 +1,121 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.SapVirtualInstances.Models +{ + public partial class SingleServerRecommendationResult : 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(SingleServerRecommendationResult)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (Optional.IsDefined(VmSku)) + { + writer.WritePropertyName("vmSku"u8); + writer.WriteStringValue(VmSku); + } + } + + SingleServerRecommendationResult 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(SingleServerRecommendationResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeSingleServerRecommendationResult(document.RootElement, options); + } + + internal static SingleServerRecommendationResult DeserializeSingleServerRecommendationResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string vmSku = default; + SapDeploymentType deploymentType = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("vmSku"u8)) + { + vmSku = property.Value.GetString(); + continue; + } + if (property.NameEquals("deploymentType"u8)) + { + deploymentType = new SapDeploymentType(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new SingleServerRecommendationResult(deploymentType, serializedAdditionalRawData, vmSku); + } + + 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(SingleServerRecommendationResult)} does not support writing '{options.Format}' format."); + } + } + + SingleServerRecommendationResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeSingleServerRecommendationResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(SingleServerRecommendationResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SingleServerRecommendationResult.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SingleServerRecommendationResult.cs new file mode 100644 index 000000000000..8da9f7ba1dba --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SingleServerRecommendationResult.cs @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.SapVirtualInstances.Models +{ + /// The recommended configuration for a single server SAP system. + public partial class SingleServerRecommendationResult : SapSizingRecommendationResult + { + /// Initializes a new instance of . + internal SingleServerRecommendationResult() + { + DeploymentType = SapDeploymentType.SingleServer; + } + + /// Initializes a new instance of . + /// The deployment type. Eg: SingleServer/ThreeTier. + /// Keeps track of any properties unknown to the library. + /// The recommended VM SKU for single server. + internal SingleServerRecommendationResult(SapDeploymentType deploymentType, IDictionary serializedAdditionalRawData, string vmSku) : base(deploymentType, serializedAdditionalRawData) + { + VmSku = vmSku; + DeploymentType = deploymentType; + } + + /// The recommended VM SKU for single server. + public string VmSku { get; } + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SkipFileShareConfiguration.Serialization.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SkipFileShareConfiguration.Serialization.cs new file mode 100644 index 000000000000..c153005acc79 --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SkipFileShareConfiguration.Serialization.cs @@ -0,0 +1,110 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.SapVirtualInstances.Models +{ + public partial class SkipFileShareConfiguration : 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(SkipFileShareConfiguration)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + } + + SkipFileShareConfiguration 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(SkipFileShareConfiguration)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeSkipFileShareConfiguration(document.RootElement, options); + } + + internal static SkipFileShareConfiguration DeserializeSkipFileShareConfiguration(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + FileShareConfigurationType configurationType = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("configurationType"u8)) + { + configurationType = new FileShareConfigurationType(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new SkipFileShareConfiguration(configurationType, 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(SkipFileShareConfiguration)} does not support writing '{options.Format}' format."); + } + } + + SkipFileShareConfiguration IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeSkipFileShareConfiguration(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(SkipFileShareConfiguration)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SkipFileShareConfiguration.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SkipFileShareConfiguration.cs new file mode 100644 index 000000000000..0c117b45e74e --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SkipFileShareConfiguration.cs @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.SapVirtualInstances.Models +{ + /// Gets or sets the file share configuration for scenarios where transport directory fileshare is not created or required. + public partial class SkipFileShareConfiguration : FileShareConfiguration + { + /// Initializes a new instance of . + public SkipFileShareConfiguration() + { + ConfigurationType = FileShareConfigurationType.Skip; + } + + /// Initializes a new instance of . + /// The type of file share config, eg: Mount/CreateAndMount/Skip. + /// Keeps track of any properties unknown to the library. + internal SkipFileShareConfiguration(FileShareConfigurationType configurationType, IDictionary serializedAdditionalRawData) : base(configurationType, serializedAdditionalRawData) + { + ConfigurationType = configurationType; + } + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SoftwareConfiguration.Serialization.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SoftwareConfiguration.Serialization.cs new file mode 100644 index 000000000000..8994068b2d94 --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SoftwareConfiguration.Serialization.cs @@ -0,0 +1,119 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.SapVirtualInstances.Models +{ + [PersistableModelProxy(typeof(UnknownSoftwareConfiguration))] + public partial class SoftwareConfiguration : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SoftwareConfiguration)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("softwareInstallationType"u8); + writer.WriteStringValue(SoftwareInstallationType.ToString()); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + SoftwareConfiguration 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(SoftwareConfiguration)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeSoftwareConfiguration(document.RootElement, options); + } + + internal static SoftwareConfiguration DeserializeSoftwareConfiguration(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + if (element.TryGetProperty("softwareInstallationType", out JsonElement discriminator)) + { + switch (discriminator.GetString()) + { + case "External": return ExternalInstallationSoftwareConfiguration.DeserializeExternalInstallationSoftwareConfiguration(element, options); + case "SAPInstallWithoutOSConfig": return SapInstallWithoutOSConfigSoftwareConfiguration.DeserializeSapInstallWithoutOSConfigSoftwareConfiguration(element, options); + case "ServiceInitiated": return ServiceInitiatedSoftwareConfiguration.DeserializeServiceInitiatedSoftwareConfiguration(element, options); + } + } + return UnknownSoftwareConfiguration.DeserializeUnknownSoftwareConfiguration(element, options); + } + + 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(SoftwareConfiguration)} does not support writing '{options.Format}' format."); + } + } + + SoftwareConfiguration IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeSoftwareConfiguration(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(SoftwareConfiguration)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SoftwareConfiguration.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SoftwareConfiguration.cs new file mode 100644 index 000000000000..571c580ec4b4 --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SoftwareConfiguration.cs @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.SapVirtualInstances.Models +{ + /// + /// The SAP Software configuration Input. + /// 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 . + /// + public abstract partial class SoftwareConfiguration + { + /// + /// 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 protected IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + protected SoftwareConfiguration() + { + } + + /// Initializes a new instance of . + /// The SAP software installation type. + /// Keeps track of any properties unknown to the library. + internal SoftwareConfiguration(SapSoftwareInstallationType softwareInstallationType, IDictionary serializedAdditionalRawData) + { + SoftwareInstallationType = softwareInstallationType; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The SAP software installation type. + internal SapSoftwareInstallationType SoftwareInstallationType { get; set; } + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SshConfiguration.Serialization.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SshConfiguration.Serialization.cs new file mode 100644 index 000000000000..9f7f91fa435f --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SshConfiguration.Serialization.cs @@ -0,0 +1,143 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.SapVirtualInstances.Models +{ + internal partial class SshConfiguration : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SshConfiguration)} does not support writing '{format}' format."); + } + + if (Optional.IsCollectionDefined(PublicKeys)) + { + writer.WritePropertyName("publicKeys"u8); + writer.WriteStartArray(); + foreach (var item in PublicKeys) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + SshConfiguration 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(SshConfiguration)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeSshConfiguration(document.RootElement, options); + } + + internal static SshConfiguration DeserializeSshConfiguration(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IList publicKeys = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("publicKeys"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(SshPublicKey.DeserializeSshPublicKey(item, options)); + } + publicKeys = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new SshConfiguration(publicKeys ?? new ChangeTrackingList(), serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(SshConfiguration)} does not support writing '{options.Format}' format."); + } + } + + SshConfiguration IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeSshConfiguration(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(SshConfiguration)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SshConfiguration.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SshConfiguration.cs new file mode 100644 index 000000000000..316b88634fcc --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SshConfiguration.cs @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.SapVirtualInstances.Models +{ + /// SSH configuration for Linux based VMs running on Azure. + internal partial class SshConfiguration + { + /// + /// 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 SshConfiguration() + { + PublicKeys = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// The list of SSH public keys used to authenticate with linux based VMs. + /// Keeps track of any properties unknown to the library. + internal SshConfiguration(IList publicKeys, IDictionary serializedAdditionalRawData) + { + PublicKeys = publicKeys; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The list of SSH public keys used to authenticate with linux based VMs. + public IList PublicKeys { get; } + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SshKeyPair.Serialization.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SshKeyPair.Serialization.cs new file mode 100644 index 000000000000..ad1c67a3c347 --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SshKeyPair.Serialization.cs @@ -0,0 +1,140 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.SapVirtualInstances.Models +{ + public partial class SshKeyPair : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SshKeyPair)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(PublicKey)) + { + writer.WritePropertyName("publicKey"u8); + writer.WriteStringValue(PublicKey); + } + if (Optional.IsDefined(PrivateKey)) + { + writer.WritePropertyName("privateKey"u8); + writer.WriteStringValue(PrivateKey); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + SshKeyPair 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(SshKeyPair)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeSshKeyPair(document.RootElement, options); + } + + internal static SshKeyPair DeserializeSshKeyPair(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string publicKey = default; + string privateKey = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("publicKey"u8)) + { + publicKey = property.Value.GetString(); + continue; + } + if (property.NameEquals("privateKey"u8)) + { + privateKey = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new SshKeyPair(publicKey, privateKey, 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(SshKeyPair)} does not support writing '{options.Format}' format."); + } + } + + SshKeyPair IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeSshKeyPair(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(SshKeyPair)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SshKeyPair.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SshKeyPair.cs new file mode 100644 index 000000000000..f9d170196f73 --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SshKeyPair.cs @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.SapVirtualInstances.Models +{ + /// The SSH Key-pair used to authenticate with the VM. The key needs to be at least 2048-bit and in ssh-rsa format. For creating ssh keys, see [Create SSH keys on Linux and Mac for Linux VMs in Azure](https://learn.microsoft.com/azure/virtual-machines/linux/create-ssh-keys-detailed). + public partial class SshKeyPair + { + /// + /// 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 SshKeyPair() + { + } + + /// Initializes a new instance of . + /// SSH public key. + /// SSH private key. + /// Keeps track of any properties unknown to the library. + internal SshKeyPair(string publicKey, string privateKey, IDictionary serializedAdditionalRawData) + { + PublicKey = publicKey; + PrivateKey = privateKey; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// SSH public key. + public string PublicKey { get; set; } + /// SSH private key. + public string PrivateKey { get; set; } + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SshPublicKey.Serialization.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SshPublicKey.Serialization.cs new file mode 100644 index 000000000000..b43fc989a4c7 --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SshPublicKey.Serialization.cs @@ -0,0 +1,129 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.SapVirtualInstances.Models +{ + public partial class SshPublicKey : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SshPublicKey)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(KeyData)) + { + writer.WritePropertyName("keyData"u8); + writer.WriteStringValue(KeyData); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + SshPublicKey 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(SshPublicKey)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeSshPublicKey(document.RootElement, options); + } + + internal static SshPublicKey DeserializeSshPublicKey(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string keyData = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("keyData"u8)) + { + keyData = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new SshPublicKey(keyData, 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(SshPublicKey)} does not support writing '{options.Format}' format."); + } + } + + SshPublicKey IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeSshPublicKey(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(SshPublicKey)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SshPublicKey.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SshPublicKey.cs new file mode 100644 index 000000000000..f5eab58038c4 --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SshPublicKey.cs @@ -0,0 +1,65 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.SapVirtualInstances.Models +{ + /// Contains information about SSH certificate public key and the path on the Linux VM where the public key is placed. + public partial class SshPublicKey + { + /// + /// 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 SshPublicKey() + { + } + + /// Initializes a new instance of . + /// SSH public key certificate used to authenticate with the VM through ssh. The key needs to be at least 2048-bit and in ssh-rsa format. <br><br> For creating ssh keys, see [Create SSH keys on Linux and Mac for Linux VMs in Azure](https://learn.microsoft.com/azure/virtual-machines/linux/create-ssh-keys-detailed). + /// Keeps track of any properties unknown to the library. + internal SshPublicKey(string keyData, IDictionary serializedAdditionalRawData) + { + KeyData = keyData; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// SSH public key certificate used to authenticate with the VM through ssh. The key needs to be at least 2048-bit and in ssh-rsa format. <br><br> For creating ssh keys, see [Create SSH keys on Linux and Mac for Linux VMs in Azure](https://learn.microsoft.com/azure/virtual-machines/linux/create-ssh-keys-detailed). + public string KeyData { get; set; } + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/StartContent.Serialization.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/StartContent.Serialization.cs new file mode 100644 index 000000000000..99284165623f --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/StartContent.Serialization.cs @@ -0,0 +1,133 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.SapVirtualInstances.Models +{ + public partial class StartContent : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(StartContent)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(StartVm)) + { + writer.WritePropertyName("startVm"u8); + writer.WriteBooleanValue(StartVm.Value); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + StartContent 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(StartContent)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeStartContent(document.RootElement, options); + } + + internal static StartContent DeserializeStartContent(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + bool? startVm = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("startVm"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + startVm = property.Value.GetBoolean(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new StartContent(startVm, 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(StartContent)} does not support writing '{options.Format}' format."); + } + } + + StartContent IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeStartContent(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(StartContent)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/StartContent.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/StartContent.cs new file mode 100644 index 000000000000..c9b715489611 --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/StartContent.cs @@ -0,0 +1,65 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.SapVirtualInstances.Models +{ + /// Start SAP instance(s) request body. + public partial class StartContent + { + /// + /// 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 StartContent() + { + } + + /// Initializes a new instance of . + /// The boolean value indicates whether to start the virtual machines before starting the SAP instances. + /// Keeps track of any properties unknown to the library. + internal StartContent(bool? startVm, IDictionary serializedAdditionalRawData) + { + StartVm = startVm; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The boolean value indicates whether to start the virtual machines before starting the SAP instances. + public bool? StartVm { get; set; } + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/StopContent.Serialization.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/StopContent.Serialization.cs new file mode 100644 index 000000000000..6cf5a397631a --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/StopContent.Serialization.cs @@ -0,0 +1,148 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.SapVirtualInstances.Models +{ + public partial class StopContent : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(StopContent)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(SoftStopTimeoutSeconds)) + { + writer.WritePropertyName("softStopTimeoutSeconds"u8); + writer.WriteNumberValue(SoftStopTimeoutSeconds.Value); + } + if (Optional.IsDefined(DeallocateVm)) + { + writer.WritePropertyName("deallocateVm"u8); + writer.WriteBooleanValue(DeallocateVm.Value); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + StopContent 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(StopContent)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeStopContent(document.RootElement, options); + } + + internal static StopContent DeserializeStopContent(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + long? softStopTimeoutSeconds = default; + bool? deallocateVm = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("softStopTimeoutSeconds"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + softStopTimeoutSeconds = property.Value.GetInt64(); + continue; + } + if (property.NameEquals("deallocateVm"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + deallocateVm = property.Value.GetBoolean(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new StopContent(softStopTimeoutSeconds, deallocateVm, 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(StopContent)} does not support writing '{options.Format}' format."); + } + } + + StopContent IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeStopContent(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(StopContent)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/StopContent.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/StopContent.cs new file mode 100644 index 000000000000..19f256f99e5c --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/StopContent.cs @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.SapVirtualInstances.Models +{ + /// Stop SAP instance(s) request body. + public partial class StopContent + { + /// + /// 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 StopContent() + { + } + + /// Initializes a new instance of . + /// This parameter defines how long (in seconds) the soft shutdown waits until the RFC/HTTP clients no longer consider the server for calls with load balancing. Value 0 means that the kernel does not wait, but goes directly into the next shutdown state, i.e. hard stop. + /// The boolean value indicates whether to Stop and deallocate the virtual machines along with the SAP instances. + /// Keeps track of any properties unknown to the library. + internal StopContent(long? softStopTimeoutSeconds, bool? deallocateVm, IDictionary serializedAdditionalRawData) + { + SoftStopTimeoutSeconds = softStopTimeoutSeconds; + DeallocateVm = deallocateVm; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// This parameter defines how long (in seconds) the soft shutdown waits until the RFC/HTTP clients no longer consider the server for calls with load balancing. Value 0 means that the kernel does not wait, but goes directly into the next shutdown state, i.e. hard stop. + public long? SoftStopTimeoutSeconds { get; set; } + /// The boolean value indicates whether to Stop and deallocate the virtual machines along with the SAP instances. + public bool? DeallocateVm { get; set; } + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/StorageConfiguration.Serialization.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/StorageConfiguration.Serialization.cs new file mode 100644 index 000000000000..493d53e139a2 --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/StorageConfiguration.Serialization.cs @@ -0,0 +1,133 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.SapVirtualInstances.Models +{ + internal partial class StorageConfiguration : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(StorageConfiguration)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(TransportFileShareConfiguration)) + { + writer.WritePropertyName("transportFileShareConfiguration"u8); + writer.WriteObjectValue(TransportFileShareConfiguration, options); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + StorageConfiguration 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(StorageConfiguration)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeStorageConfiguration(document.RootElement, options); + } + + internal static StorageConfiguration DeserializeStorageConfiguration(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + FileShareConfiguration transportFileShareConfiguration = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("transportFileShareConfiguration"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + transportFileShareConfiguration = FileShareConfiguration.DeserializeFileShareConfiguration(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new StorageConfiguration(transportFileShareConfiguration, 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(StorageConfiguration)} does not support writing '{options.Format}' format."); + } + } + + StorageConfiguration IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeStorageConfiguration(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(StorageConfiguration)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/StorageConfiguration.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/StorageConfiguration.cs new file mode 100644 index 000000000000..faaba7453055 --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/StorageConfiguration.cs @@ -0,0 +1,73 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.SapVirtualInstances.Models +{ + /// Gets or sets the storage configuration. + internal partial class StorageConfiguration + { + /// + /// 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 StorageConfiguration() + { + } + + /// Initializes a new instance of . + /// + /// The properties of the transport directory attached to the VIS. The default for transportFileShareConfiguration is the createAndMount flow if storage configuration is missing. + /// 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 . + /// + /// Keeps track of any properties unknown to the library. + internal StorageConfiguration(FileShareConfiguration transportFileShareConfiguration, IDictionary serializedAdditionalRawData) + { + TransportFileShareConfiguration = transportFileShareConfiguration; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// + /// The properties of the transport directory attached to the VIS. The default for transportFileShareConfiguration is the createAndMount flow if storage configuration is missing. + /// 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 . + /// + public FileShareConfiguration TransportFileShareConfiguration { get; set; } + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/ThreeTierConfiguration.Serialization.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/ThreeTierConfiguration.Serialization.cs new file mode 100644 index 000000000000..ccd820bcdb35 --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/ThreeTierConfiguration.Serialization.cs @@ -0,0 +1,210 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.SapVirtualInstances.Models +{ + public partial class ThreeTierConfiguration : 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(ThreeTierConfiguration)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (Optional.IsDefined(NetworkConfiguration)) + { + writer.WritePropertyName("networkConfiguration"u8); + writer.WriteObjectValue(NetworkConfiguration, options); + } + writer.WritePropertyName("centralServer"u8); + writer.WriteObjectValue(CentralServer, options); + writer.WritePropertyName("applicationServer"u8); + writer.WriteObjectValue(ApplicationServer, options); + writer.WritePropertyName("databaseServer"u8); + writer.WriteObjectValue(DatabaseServer, options); + if (Optional.IsDefined(HighAvailabilityConfig)) + { + writer.WritePropertyName("highAvailabilityConfig"u8); + writer.WriteObjectValue(HighAvailabilityConfig, options); + } + if (Optional.IsDefined(StorageConfiguration)) + { + writer.WritePropertyName("storageConfiguration"u8); + writer.WriteObjectValue(StorageConfiguration, options); + } + if (Optional.IsDefined(CustomResourceNames)) + { + writer.WritePropertyName("customResourceNames"u8); + writer.WriteObjectValue(CustomResourceNames, options); + } + } + + ThreeTierConfiguration 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(ThreeTierConfiguration)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeThreeTierConfiguration(document.RootElement, options); + } + + internal static ThreeTierConfiguration DeserializeThreeTierConfiguration(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + NetworkConfiguration networkConfiguration = default; + CentralServerConfiguration centralServer = default; + ApplicationServerConfiguration applicationServer = default; + DatabaseConfiguration databaseServer = default; + HighAvailabilityConfiguration highAvailabilityConfig = default; + StorageConfiguration storageConfiguration = default; + ThreeTierCustomResourceNames customResourceNames = default; + string appResourceGroup = default; + SapDeploymentType deploymentType = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("networkConfiguration"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + networkConfiguration = NetworkConfiguration.DeserializeNetworkConfiguration(property.Value, options); + continue; + } + if (property.NameEquals("centralServer"u8)) + { + centralServer = CentralServerConfiguration.DeserializeCentralServerConfiguration(property.Value, options); + continue; + } + if (property.NameEquals("applicationServer"u8)) + { + applicationServer = ApplicationServerConfiguration.DeserializeApplicationServerConfiguration(property.Value, options); + continue; + } + if (property.NameEquals("databaseServer"u8)) + { + databaseServer = DatabaseConfiguration.DeserializeDatabaseConfiguration(property.Value, options); + continue; + } + if (property.NameEquals("highAvailabilityConfig"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + highAvailabilityConfig = HighAvailabilityConfiguration.DeserializeHighAvailabilityConfiguration(property.Value, options); + continue; + } + if (property.NameEquals("storageConfiguration"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + storageConfiguration = StorageConfiguration.DeserializeStorageConfiguration(property.Value, options); + continue; + } + if (property.NameEquals("customResourceNames"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + customResourceNames = ThreeTierCustomResourceNames.DeserializeThreeTierCustomResourceNames(property.Value, options); + continue; + } + if (property.NameEquals("appResourceGroup"u8)) + { + appResourceGroup = property.Value.GetString(); + continue; + } + if (property.NameEquals("deploymentType"u8)) + { + deploymentType = new SapDeploymentType(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ThreeTierConfiguration( + appResourceGroup, + deploymentType, + serializedAdditionalRawData, + networkConfiguration, + centralServer, + applicationServer, + databaseServer, + highAvailabilityConfig, + storageConfiguration, + customResourceNames); + } + + 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(ThreeTierConfiguration)} does not support writing '{options.Format}' format."); + } + } + + ThreeTierConfiguration IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeThreeTierConfiguration(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ThreeTierConfiguration)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/ThreeTierConfiguration.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/ThreeTierConfiguration.cs new file mode 100644 index 000000000000..dd9e9cc5eff0 --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/ThreeTierConfiguration.cs @@ -0,0 +1,124 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.SapVirtualInstances.Models +{ + /// Gets or sets the three tier SAP configuration. For prerequisites for creating the infrastructure, please see [here](https://go.microsoft.com/fwlink/?linkid=2212611&clcid=0x409). + public partial class ThreeTierConfiguration : InfrastructureConfiguration + { + /// Initializes a new instance of . + /// The application resource group where SAP system resources will be deployed. + /// The central server configuration. + /// The application server configuration. + /// The database configuration. + /// , , or is null. + public ThreeTierConfiguration(string appResourceGroup, CentralServerConfiguration centralServer, ApplicationServerConfiguration applicationServer, DatabaseConfiguration databaseServer) : base(appResourceGroup) + { + Argument.AssertNotNull(appResourceGroup, nameof(appResourceGroup)); + Argument.AssertNotNull(centralServer, nameof(centralServer)); + Argument.AssertNotNull(applicationServer, nameof(applicationServer)); + Argument.AssertNotNull(databaseServer, nameof(databaseServer)); + + CentralServer = centralServer; + ApplicationServer = applicationServer; + DatabaseServer = databaseServer; + DeploymentType = SapDeploymentType.ThreeTier; + } + + /// Initializes a new instance of . + /// The application resource group where SAP system resources will be deployed. + /// The SAP deployment type. Eg: SingleServer/ThreeTier. + /// Keeps track of any properties unknown to the library. + /// Network configuration common to all servers. + /// The central server configuration. + /// The application server configuration. + /// The database configuration. + /// The high availability configuration. + /// The storage configuration. + /// + /// The set of custom names to be used for underlying azure resources that are part of the SAP system. + /// 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 . + /// + internal ThreeTierConfiguration(string appResourceGroup, SapDeploymentType deploymentType, IDictionary serializedAdditionalRawData, NetworkConfiguration networkConfiguration, CentralServerConfiguration centralServer, ApplicationServerConfiguration applicationServer, DatabaseConfiguration databaseServer, HighAvailabilityConfiguration highAvailabilityConfig, StorageConfiguration storageConfiguration, ThreeTierCustomResourceNames customResourceNames) : base(appResourceGroup, deploymentType, serializedAdditionalRawData) + { + NetworkConfiguration = networkConfiguration; + CentralServer = centralServer; + ApplicationServer = applicationServer; + DatabaseServer = databaseServer; + HighAvailabilityConfig = highAvailabilityConfig; + StorageConfiguration = storageConfiguration; + CustomResourceNames = customResourceNames; + DeploymentType = deploymentType; + } + + /// Initializes a new instance of for deserialization. + internal ThreeTierConfiguration() + { + } + + /// Network configuration common to all servers. + internal NetworkConfiguration NetworkConfiguration { get; set; } + /// Specifies whether a secondary IP address should be added to the network interface on all VMs of the SAP system being deployed. + public bool? IsSecondaryIPEnabled + { + get => NetworkConfiguration is null ? default : NetworkConfiguration.IsSecondaryIPEnabled; + set + { + if (NetworkConfiguration is null) + NetworkConfiguration = new NetworkConfiguration(); + NetworkConfiguration.IsSecondaryIPEnabled = value; + } + } + + /// The central server configuration. + public CentralServerConfiguration CentralServer { get; set; } + /// The application server configuration. + public ApplicationServerConfiguration ApplicationServer { get; set; } + /// The database configuration. + public DatabaseConfiguration DatabaseServer { get; set; } + /// The high availability configuration. + internal HighAvailabilityConfiguration HighAvailabilityConfig { get; set; } + /// The high availability type. + public SapHighAvailabilityType? HighAvailabilityType + { + get => HighAvailabilityConfig is null ? default(SapHighAvailabilityType?) : HighAvailabilityConfig.HighAvailabilityType; + set + { + HighAvailabilityConfig = value.HasValue ? new HighAvailabilityConfiguration(value.Value) : null; + } + } + + /// The storage configuration. + internal StorageConfiguration StorageConfiguration { get; set; } + /// + /// The properties of the transport directory attached to the VIS. The default for transportFileShareConfiguration is the createAndMount flow if storage configuration is missing. + /// 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 . + /// + public FileShareConfiguration StorageTransportFileShareConfiguration + { + get => StorageConfiguration is null ? default : StorageConfiguration.TransportFileShareConfiguration; + set + { + if (StorageConfiguration is null) + StorageConfiguration = new StorageConfiguration(); + StorageConfiguration.TransportFileShareConfiguration = value; + } + } + + /// + /// The set of custom names to be used for underlying azure resources that are part of the SAP system. + /// 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 ThreeTierCustomResourceNames CustomResourceNames { get; set; } + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/ThreeTierCustomResourceNames.Serialization.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/ThreeTierCustomResourceNames.Serialization.cs new file mode 100644 index 000000000000..eb1273a2d900 --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/ThreeTierCustomResourceNames.Serialization.cs @@ -0,0 +1,117 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.SapVirtualInstances.Models +{ + [PersistableModelProxy(typeof(UnknownThreeTierCustomResourceNames))] + public partial class ThreeTierCustomResourceNames : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ThreeTierCustomResourceNames)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("namingPatternType"u8); + writer.WriteStringValue(NamingPatternType.ToString()); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + ThreeTierCustomResourceNames 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(ThreeTierCustomResourceNames)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeThreeTierCustomResourceNames(document.RootElement, options); + } + + internal static ThreeTierCustomResourceNames DeserializeThreeTierCustomResourceNames(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + if (element.TryGetProperty("namingPatternType", out JsonElement discriminator)) + { + switch (discriminator.GetString()) + { + case "FullResourceName": return ThreeTierFullResourceNames.DeserializeThreeTierFullResourceNames(element, options); + } + } + return UnknownThreeTierCustomResourceNames.DeserializeUnknownThreeTierCustomResourceNames(element, options); + } + + 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(ThreeTierCustomResourceNames)} does not support writing '{options.Format}' format."); + } + } + + ThreeTierCustomResourceNames IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeThreeTierCustomResourceNames(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ThreeTierCustomResourceNames)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/ThreeTierCustomResourceNames.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/ThreeTierCustomResourceNames.cs new file mode 100644 index 000000000000..1da2eab3183d --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/ThreeTierCustomResourceNames.cs @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.SapVirtualInstances.Models +{ + /// + /// The resource-names input to specify custom names for underlying azure resources that are part of a three tier SAP system. + /// 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 abstract partial class ThreeTierCustomResourceNames + { + /// + /// 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 protected IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + protected ThreeTierCustomResourceNames() + { + } + + /// Initializes a new instance of . + /// The pattern type to be used for resource naming. + /// Keeps track of any properties unknown to the library. + internal ThreeTierCustomResourceNames(NamingPatternType namingPatternType, IDictionary serializedAdditionalRawData) + { + NamingPatternType = namingPatternType; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The pattern type to be used for resource naming. + internal NamingPatternType NamingPatternType { get; set; } + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/ThreeTierFullResourceNames.Serialization.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/ThreeTierFullResourceNames.Serialization.cs new file mode 100644 index 000000000000..f0a4a9469615 --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/ThreeTierFullResourceNames.Serialization.cs @@ -0,0 +1,176 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.SapVirtualInstances.Models +{ + public partial class ThreeTierFullResourceNames : 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(ThreeTierFullResourceNames)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (Optional.IsDefined(CentralServer)) + { + writer.WritePropertyName("centralServer"u8); + writer.WriteObjectValue(CentralServer, options); + } + if (Optional.IsDefined(ApplicationServer)) + { + writer.WritePropertyName("applicationServer"u8); + writer.WriteObjectValue(ApplicationServer, options); + } + if (Optional.IsDefined(DatabaseServer)) + { + writer.WritePropertyName("databaseServer"u8); + writer.WriteObjectValue(DatabaseServer, options); + } + if (Optional.IsDefined(SharedStorage)) + { + writer.WritePropertyName("sharedStorage"u8); + writer.WriteObjectValue(SharedStorage, options); + } + } + + ThreeTierFullResourceNames 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(ThreeTierFullResourceNames)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeThreeTierFullResourceNames(document.RootElement, options); + } + + internal static ThreeTierFullResourceNames DeserializeThreeTierFullResourceNames(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + CentralServerFullResourceNames centralServer = default; + ApplicationServerFullResourceNames applicationServer = default; + DatabaseServerFullResourceNames databaseServer = default; + SharedStorageResourceNames sharedStorage = default; + NamingPatternType namingPatternType = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("centralServer"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + centralServer = CentralServerFullResourceNames.DeserializeCentralServerFullResourceNames(property.Value, options); + continue; + } + if (property.NameEquals("applicationServer"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + applicationServer = ApplicationServerFullResourceNames.DeserializeApplicationServerFullResourceNames(property.Value, options); + continue; + } + if (property.NameEquals("databaseServer"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + databaseServer = DatabaseServerFullResourceNames.DeserializeDatabaseServerFullResourceNames(property.Value, options); + continue; + } + if (property.NameEquals("sharedStorage"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + sharedStorage = SharedStorageResourceNames.DeserializeSharedStorageResourceNames(property.Value, options); + continue; + } + if (property.NameEquals("namingPatternType"u8)) + { + namingPatternType = new NamingPatternType(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ThreeTierFullResourceNames( + namingPatternType, + serializedAdditionalRawData, + centralServer, + applicationServer, + databaseServer, + sharedStorage); + } + + 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(ThreeTierFullResourceNames)} does not support writing '{options.Format}' format."); + } + } + + ThreeTierFullResourceNames IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeThreeTierFullResourceNames(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ThreeTierFullResourceNames)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/ThreeTierFullResourceNames.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/ThreeTierFullResourceNames.cs new file mode 100644 index 000000000000..30dac04bfc8d --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/ThreeTierFullResourceNames.cs @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.SapVirtualInstances.Models +{ + /// The resource name object where the specified values will be full resource names of the corresponding resources in a three tier SAP system. + public partial class ThreeTierFullResourceNames : ThreeTierCustomResourceNames + { + /// Initializes a new instance of . + public ThreeTierFullResourceNames() + { + NamingPatternType = NamingPatternType.FullResourceName; + } + + /// Initializes a new instance of . + /// The pattern type to be used for resource naming. + /// Keeps track of any properties unknown to the library. + /// The full resource names object for central server layer resources. + /// The full resource names object for application layer resources. The number of entries in this list should be equal to the number VMs to be created for application layer. + /// The full resource names object for database layer resources. The number of entries in this list should be equal to the number VMs to be created for database layer. + /// The resource names object for shared storage. + internal ThreeTierFullResourceNames(NamingPatternType namingPatternType, IDictionary serializedAdditionalRawData, CentralServerFullResourceNames centralServer, ApplicationServerFullResourceNames applicationServer, DatabaseServerFullResourceNames databaseServer, SharedStorageResourceNames sharedStorage) : base(namingPatternType, serializedAdditionalRawData) + { + CentralServer = centralServer; + ApplicationServer = applicationServer; + DatabaseServer = databaseServer; + SharedStorage = sharedStorage; + NamingPatternType = namingPatternType; + } + + /// The full resource names object for central server layer resources. + public CentralServerFullResourceNames CentralServer { get; set; } + /// The full resource names object for application layer resources. The number of entries in this list should be equal to the number VMs to be created for application layer. + public ApplicationServerFullResourceNames ApplicationServer { get; set; } + /// The full resource names object for database layer resources. The number of entries in this list should be equal to the number VMs to be created for database layer. + public DatabaseServerFullResourceNames DatabaseServer { get; set; } + /// The resource names object for shared storage. + public SharedStorageResourceNames SharedStorage { get; set; } + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/ThreeTierRecommendationResult.Serialization.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/ThreeTierRecommendationResult.Serialization.cs new file mode 100644 index 000000000000..3cb091fff77b --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/ThreeTierRecommendationResult.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; + +namespace Azure.ResourceManager.SapVirtualInstances.Models +{ + public partial class ThreeTierRecommendationResult : 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(ThreeTierRecommendationResult)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (Optional.IsDefined(DbVmSku)) + { + writer.WritePropertyName("dbVmSku"u8); + writer.WriteStringValue(DbVmSku); + } + if (Optional.IsDefined(DatabaseInstanceCount)) + { + writer.WritePropertyName("databaseInstanceCount"u8); + writer.WriteNumberValue(DatabaseInstanceCount.Value); + } + if (Optional.IsDefined(CentralServerVmSku)) + { + writer.WritePropertyName("centralServerVmSku"u8); + writer.WriteStringValue(CentralServerVmSku); + } + if (Optional.IsDefined(CentralServerInstanceCount)) + { + writer.WritePropertyName("centralServerInstanceCount"u8); + writer.WriteNumberValue(CentralServerInstanceCount.Value); + } + if (Optional.IsDefined(ApplicationServerVmSku)) + { + writer.WritePropertyName("applicationServerVmSku"u8); + writer.WriteStringValue(ApplicationServerVmSku); + } + if (Optional.IsDefined(ApplicationServerInstanceCount)) + { + writer.WritePropertyName("applicationServerInstanceCount"u8); + writer.WriteNumberValue(ApplicationServerInstanceCount.Value); + } + } + + ThreeTierRecommendationResult 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(ThreeTierRecommendationResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeThreeTierRecommendationResult(document.RootElement, options); + } + + internal static ThreeTierRecommendationResult DeserializeThreeTierRecommendationResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string dbVmSku = default; + long? databaseInstanceCount = default; + string centralServerVmSku = default; + long? centralServerInstanceCount = default; + string applicationServerVmSku = default; + long? applicationServerInstanceCount = default; + SapDeploymentType deploymentType = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("dbVmSku"u8)) + { + dbVmSku = property.Value.GetString(); + continue; + } + if (property.NameEquals("databaseInstanceCount"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + databaseInstanceCount = property.Value.GetInt64(); + continue; + } + if (property.NameEquals("centralServerVmSku"u8)) + { + centralServerVmSku = property.Value.GetString(); + continue; + } + if (property.NameEquals("centralServerInstanceCount"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + centralServerInstanceCount = property.Value.GetInt64(); + continue; + } + if (property.NameEquals("applicationServerVmSku"u8)) + { + applicationServerVmSku = property.Value.GetString(); + continue; + } + if (property.NameEquals("applicationServerInstanceCount"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + applicationServerInstanceCount = property.Value.GetInt64(); + continue; + } + if (property.NameEquals("deploymentType"u8)) + { + deploymentType = new SapDeploymentType(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ThreeTierRecommendationResult( + deploymentType, + serializedAdditionalRawData, + dbVmSku, + databaseInstanceCount, + centralServerVmSku, + centralServerInstanceCount, + applicationServerVmSku, + applicationServerInstanceCount); + } + + 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(ThreeTierRecommendationResult)} does not support writing '{options.Format}' format."); + } + } + + ThreeTierRecommendationResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeThreeTierRecommendationResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ThreeTierRecommendationResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/ThreeTierRecommendationResult.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/ThreeTierRecommendationResult.cs new file mode 100644 index 000000000000..cf68c754d75d --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/ThreeTierRecommendationResult.cs @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.SapVirtualInstances.Models +{ + /// The recommended configuration for a three tier SAP system. + public partial class ThreeTierRecommendationResult : SapSizingRecommendationResult + { + /// Initializes a new instance of . + internal ThreeTierRecommendationResult() + { + DeploymentType = SapDeploymentType.ThreeTier; + } + + /// Initializes a new instance of . + /// The deployment type. Eg: SingleServer/ThreeTier. + /// Keeps track of any properties unknown to the library. + /// The database VM SKU. + /// The database server instance count. + /// The central server VM SKU. + /// The central server instance count. + /// The application server VM SKU. + /// The application server instance count. + internal ThreeTierRecommendationResult(SapDeploymentType deploymentType, IDictionary serializedAdditionalRawData, string dbVmSku, long? databaseInstanceCount, string centralServerVmSku, long? centralServerInstanceCount, string applicationServerVmSku, long? applicationServerInstanceCount) : base(deploymentType, serializedAdditionalRawData) + { + DbVmSku = dbVmSku; + DatabaseInstanceCount = databaseInstanceCount; + CentralServerVmSku = centralServerVmSku; + CentralServerInstanceCount = centralServerInstanceCount; + ApplicationServerVmSku = applicationServerVmSku; + ApplicationServerInstanceCount = applicationServerInstanceCount; + DeploymentType = deploymentType; + } + + /// The database VM SKU. + public string DbVmSku { get; } + /// The database server instance count. + public long? DatabaseInstanceCount { get; } + /// The central server VM SKU. + public string CentralServerVmSku { get; } + /// The central server instance count. + public long? CentralServerInstanceCount { get; } + /// The application server VM SKU. + public string ApplicationServerVmSku { get; } + /// The application server instance count. + public long? ApplicationServerInstanceCount { get; } + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/UnknownFileShareConfiguration.Serialization.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/UnknownFileShareConfiguration.Serialization.cs new file mode 100644 index 000000000000..409b431928a1 --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/UnknownFileShareConfiguration.Serialization.cs @@ -0,0 +1,110 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.SapVirtualInstances.Models +{ + internal partial class UnknownFileShareConfiguration : 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(FileShareConfiguration)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + } + + FileShareConfiguration 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(FileShareConfiguration)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeFileShareConfiguration(document.RootElement, options); + } + + internal static UnknownFileShareConfiguration DeserializeUnknownFileShareConfiguration(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + FileShareConfigurationType configurationType = "Unknown"; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("configurationType"u8)) + { + configurationType = new FileShareConfigurationType(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new UnknownFileShareConfiguration(configurationType, 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(FileShareConfiguration)} does not support writing '{options.Format}' format."); + } + } + + FileShareConfiguration IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeFileShareConfiguration(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(FileShareConfiguration)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/UnknownFileShareConfiguration.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/UnknownFileShareConfiguration.cs new file mode 100644 index 000000000000..d3588642b83c --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/UnknownFileShareConfiguration.cs @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.SapVirtualInstances.Models +{ + /// Unknown version of FileShareConfiguration. + internal partial class UnknownFileShareConfiguration : FileShareConfiguration + { + /// Initializes a new instance of . + /// The type of file share config, eg: Mount/CreateAndMount/Skip. + /// Keeps track of any properties unknown to the library. + internal UnknownFileShareConfiguration(FileShareConfigurationType configurationType, IDictionary serializedAdditionalRawData) : base(configurationType, serializedAdditionalRawData) + { + ConfigurationType = configurationType; + } + + /// Initializes a new instance of for deserialization. + internal UnknownFileShareConfiguration() + { + } + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/UnknownInfrastructureConfiguration.Serialization.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/UnknownInfrastructureConfiguration.Serialization.cs new file mode 100644 index 000000000000..ead7dc3103bc --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/UnknownInfrastructureConfiguration.Serialization.cs @@ -0,0 +1,116 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.SapVirtualInstances.Models +{ + internal partial class UnknownInfrastructureConfiguration : 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(InfrastructureConfiguration)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + } + + InfrastructureConfiguration 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(InfrastructureConfiguration)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeInfrastructureConfiguration(document.RootElement, options); + } + + internal static UnknownInfrastructureConfiguration DeserializeUnknownInfrastructureConfiguration(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string appResourceGroup = default; + SapDeploymentType deploymentType = "Unknown"; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("appResourceGroup"u8)) + { + appResourceGroup = property.Value.GetString(); + continue; + } + if (property.NameEquals("deploymentType"u8)) + { + deploymentType = new SapDeploymentType(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new UnknownInfrastructureConfiguration(appResourceGroup, deploymentType, 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(InfrastructureConfiguration)} does not support writing '{options.Format}' format."); + } + } + + InfrastructureConfiguration IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeInfrastructureConfiguration(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(InfrastructureConfiguration)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/UnknownInfrastructureConfiguration.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/UnknownInfrastructureConfiguration.cs new file mode 100644 index 000000000000..8cd6afc1beef --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/UnknownInfrastructureConfiguration.cs @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.SapVirtualInstances.Models +{ + /// Unknown version of InfrastructureConfiguration. + internal partial class UnknownInfrastructureConfiguration : InfrastructureConfiguration + { + /// Initializes a new instance of . + /// The application resource group where SAP system resources will be deployed. + /// The SAP deployment type. Eg: SingleServer/ThreeTier. + /// Keeps track of any properties unknown to the library. + internal UnknownInfrastructureConfiguration(string appResourceGroup, SapDeploymentType deploymentType, IDictionary serializedAdditionalRawData) : base(appResourceGroup, deploymentType, serializedAdditionalRawData) + { + DeploymentType = deploymentType; + } + + /// Initializes a new instance of for deserialization. + internal UnknownInfrastructureConfiguration() + { + } + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/UnknownOSConfiguration.Serialization.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/UnknownOSConfiguration.Serialization.cs new file mode 100644 index 000000000000..8dbe66802215 --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/UnknownOSConfiguration.Serialization.cs @@ -0,0 +1,110 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.SapVirtualInstances.Models +{ + internal partial class UnknownOSConfiguration : 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(OSConfiguration)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + } + + OSConfiguration 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(OSConfiguration)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeOSConfiguration(document.RootElement, options); + } + + internal static UnknownOSConfiguration DeserializeUnknownOSConfiguration(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + OSType osType = "Unknown"; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("osType"u8)) + { + osType = new OSType(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new UnknownOSConfiguration(osType, 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(OSConfiguration)} does not support writing '{options.Format}' format."); + } + } + + OSConfiguration IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeOSConfiguration(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(OSConfiguration)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/UnknownOSConfiguration.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/UnknownOSConfiguration.cs new file mode 100644 index 000000000000..266b67037b5b --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/UnknownOSConfiguration.cs @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.SapVirtualInstances.Models +{ + /// Unknown version of OSConfiguration. + internal partial class UnknownOSConfiguration : OSConfiguration + { + /// Initializes a new instance of . + /// The OS Type. + /// Keeps track of any properties unknown to the library. + internal UnknownOSConfiguration(OSType osType, IDictionary serializedAdditionalRawData) : base(osType, serializedAdditionalRawData) + { + OSType = osType; + } + + /// Initializes a new instance of for deserialization. + internal UnknownOSConfiguration() + { + } + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/UnknownSapConfiguration.Serialization.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/UnknownSapConfiguration.Serialization.cs new file mode 100644 index 000000000000..cc2175ca19ee --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/UnknownSapConfiguration.Serialization.cs @@ -0,0 +1,110 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.SapVirtualInstances.Models +{ + internal partial class UnknownSapConfiguration : 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(SapConfiguration)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + } + + SapConfiguration 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(SapConfiguration)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeSapConfiguration(document.RootElement, options); + } + + internal static UnknownSapConfiguration DeserializeUnknownSapConfiguration(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + SapConfigurationType configurationType = "Unknown"; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("configurationType"u8)) + { + configurationType = new SapConfigurationType(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new UnknownSapConfiguration(configurationType, 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(SapConfiguration)} does not support writing '{options.Format}' format."); + } + } + + SapConfiguration IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeSapConfiguration(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(SapConfiguration)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/UnknownSapConfiguration.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/UnknownSapConfiguration.cs new file mode 100644 index 000000000000..43650e6a5ae5 --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/UnknownSapConfiguration.cs @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.SapVirtualInstances.Models +{ + /// Unknown version of SapConfiguration. + internal partial class UnknownSapConfiguration : SapConfiguration + { + /// Initializes a new instance of . + /// The configuration type. Eg: Deployment/Discovery. + /// Keeps track of any properties unknown to the library. + internal UnknownSapConfiguration(SapConfigurationType configurationType, IDictionary serializedAdditionalRawData) : base(configurationType, serializedAdditionalRawData) + { + ConfigurationType = configurationType; + } + + /// Initializes a new instance of for deserialization. + internal UnknownSapConfiguration() + { + } + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/UnknownSapSizingRecommendationResult.Serialization.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/UnknownSapSizingRecommendationResult.Serialization.cs new file mode 100644 index 000000000000..7efea643935f --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/UnknownSapSizingRecommendationResult.Serialization.cs @@ -0,0 +1,110 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.SapVirtualInstances.Models +{ + internal partial class UnknownSapSizingRecommendationResult : 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(SapSizingRecommendationResult)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + } + + SapSizingRecommendationResult 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(SapSizingRecommendationResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeSapSizingRecommendationResult(document.RootElement, options); + } + + internal static UnknownSapSizingRecommendationResult DeserializeUnknownSapSizingRecommendationResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + SapDeploymentType deploymentType = "Unknown"; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("deploymentType"u8)) + { + deploymentType = new SapDeploymentType(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new UnknownSapSizingRecommendationResult(deploymentType, 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(SapSizingRecommendationResult)} does not support writing '{options.Format}' format."); + } + } + + SapSizingRecommendationResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeSapSizingRecommendationResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(SapSizingRecommendationResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/UnknownSapSizingRecommendationResult.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/UnknownSapSizingRecommendationResult.cs new file mode 100644 index 000000000000..aed574f9819d --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/UnknownSapSizingRecommendationResult.cs @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.SapVirtualInstances.Models +{ + /// Unknown version of SapSizingRecommendationResult. + internal partial class UnknownSapSizingRecommendationResult : SapSizingRecommendationResult + { + /// Initializes a new instance of . + /// The deployment type. Eg: SingleServer/ThreeTier. + /// Keeps track of any properties unknown to the library. + internal UnknownSapSizingRecommendationResult(SapDeploymentType deploymentType, IDictionary serializedAdditionalRawData) : base(deploymentType, serializedAdditionalRawData) + { + DeploymentType = deploymentType; + } + + /// Initializes a new instance of for deserialization. + internal UnknownSapSizingRecommendationResult() + { + } + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/UnknownSingleServerCustomResourceNames.Serialization.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/UnknownSingleServerCustomResourceNames.Serialization.cs new file mode 100644 index 000000000000..ba04977e1530 --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/UnknownSingleServerCustomResourceNames.Serialization.cs @@ -0,0 +1,110 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.SapVirtualInstances.Models +{ + internal partial class UnknownSingleServerCustomResourceNames : 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(SingleServerCustomResourceNames)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + } + + SingleServerCustomResourceNames 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(SingleServerCustomResourceNames)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeSingleServerCustomResourceNames(document.RootElement, options); + } + + internal static UnknownSingleServerCustomResourceNames DeserializeUnknownSingleServerCustomResourceNames(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + NamingPatternType namingPatternType = "Unknown"; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("namingPatternType"u8)) + { + namingPatternType = new NamingPatternType(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new UnknownSingleServerCustomResourceNames(namingPatternType, 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(SingleServerCustomResourceNames)} does not support writing '{options.Format}' format."); + } + } + + SingleServerCustomResourceNames IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeSingleServerCustomResourceNames(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(SingleServerCustomResourceNames)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/UnknownSingleServerCustomResourceNames.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/UnknownSingleServerCustomResourceNames.cs new file mode 100644 index 000000000000..ca9167a891c3 --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/UnknownSingleServerCustomResourceNames.cs @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.SapVirtualInstances.Models +{ + /// Unknown version of SingleServerCustomResourceNames. + internal partial class UnknownSingleServerCustomResourceNames : SingleServerCustomResourceNames + { + /// Initializes a new instance of . + /// The naming pattern type. + /// Keeps track of any properties unknown to the library. + internal UnknownSingleServerCustomResourceNames(NamingPatternType namingPatternType, IDictionary serializedAdditionalRawData) : base(namingPatternType, serializedAdditionalRawData) + { + NamingPatternType = namingPatternType; + } + + /// Initializes a new instance of for deserialization. + internal UnknownSingleServerCustomResourceNames() + { + } + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/UnknownSoftwareConfiguration.Serialization.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/UnknownSoftwareConfiguration.Serialization.cs new file mode 100644 index 000000000000..9606905c8e62 --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/UnknownSoftwareConfiguration.Serialization.cs @@ -0,0 +1,110 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.SapVirtualInstances.Models +{ + internal partial class UnknownSoftwareConfiguration : 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(SoftwareConfiguration)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + } + + SoftwareConfiguration 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(SoftwareConfiguration)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeSoftwareConfiguration(document.RootElement, options); + } + + internal static UnknownSoftwareConfiguration DeserializeUnknownSoftwareConfiguration(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + SapSoftwareInstallationType softwareInstallationType = "Unknown"; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("softwareInstallationType"u8)) + { + softwareInstallationType = new SapSoftwareInstallationType(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new UnknownSoftwareConfiguration(softwareInstallationType, 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(SoftwareConfiguration)} does not support writing '{options.Format}' format."); + } + } + + SoftwareConfiguration IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeSoftwareConfiguration(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(SoftwareConfiguration)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/UnknownSoftwareConfiguration.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/UnknownSoftwareConfiguration.cs new file mode 100644 index 000000000000..469cfda732f1 --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/UnknownSoftwareConfiguration.cs @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.SapVirtualInstances.Models +{ + /// Unknown version of SoftwareConfiguration. + internal partial class UnknownSoftwareConfiguration : SoftwareConfiguration + { + /// Initializes a new instance of . + /// The SAP software installation type. + /// Keeps track of any properties unknown to the library. + internal UnknownSoftwareConfiguration(SapSoftwareInstallationType softwareInstallationType, IDictionary serializedAdditionalRawData) : base(softwareInstallationType, serializedAdditionalRawData) + { + SoftwareInstallationType = softwareInstallationType; + } + + /// Initializes a new instance of for deserialization. + internal UnknownSoftwareConfiguration() + { + } + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/UnknownThreeTierCustomResourceNames.Serialization.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/UnknownThreeTierCustomResourceNames.Serialization.cs new file mode 100644 index 000000000000..749200c8bb45 --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/UnknownThreeTierCustomResourceNames.Serialization.cs @@ -0,0 +1,110 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.SapVirtualInstances.Models +{ + internal partial class UnknownThreeTierCustomResourceNames : 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(ThreeTierCustomResourceNames)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + } + + ThreeTierCustomResourceNames 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(ThreeTierCustomResourceNames)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeThreeTierCustomResourceNames(document.RootElement, options); + } + + internal static UnknownThreeTierCustomResourceNames DeserializeUnknownThreeTierCustomResourceNames(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + NamingPatternType namingPatternType = "Unknown"; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("namingPatternType"u8)) + { + namingPatternType = new NamingPatternType(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new UnknownThreeTierCustomResourceNames(namingPatternType, 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(ThreeTierCustomResourceNames)} does not support writing '{options.Format}' format."); + } + } + + ThreeTierCustomResourceNames IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeThreeTierCustomResourceNames(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ThreeTierCustomResourceNames)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/UnknownThreeTierCustomResourceNames.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/UnknownThreeTierCustomResourceNames.cs new file mode 100644 index 000000000000..35ac6ef0a5f0 --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/UnknownThreeTierCustomResourceNames.cs @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.SapVirtualInstances.Models +{ + /// Unknown version of ThreeTierCustomResourceNames. + internal partial class UnknownThreeTierCustomResourceNames : ThreeTierCustomResourceNames + { + /// Initializes a new instance of . + /// The pattern type to be used for resource naming. + /// Keeps track of any properties unknown to the library. + internal UnknownThreeTierCustomResourceNames(NamingPatternType namingPatternType, IDictionary serializedAdditionalRawData) : base(namingPatternType, serializedAdditionalRawData) + { + NamingPatternType = namingPatternType; + } + + /// Initializes a new instance of for deserialization. + internal UnknownThreeTierCustomResourceNames() + { + } + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/UpdateSapVirtualInstanceProperties.Serialization.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/UpdateSapVirtualInstanceProperties.Serialization.cs new file mode 100644 index 000000000000..eab6cf7ba249 --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/UpdateSapVirtualInstanceProperties.Serialization.cs @@ -0,0 +1,133 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.SapVirtualInstances.Models +{ + internal partial class UpdateSapVirtualInstanceProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(UpdateSapVirtualInstanceProperties)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(ManagedResourcesNetworkAccessType)) + { + writer.WritePropertyName("managedResourcesNetworkAccessType"u8); + writer.WriteStringValue(ManagedResourcesNetworkAccessType.Value.ToString()); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + UpdateSapVirtualInstanceProperties 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(UpdateSapVirtualInstanceProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeUpdateSapVirtualInstanceProperties(document.RootElement, options); + } + + internal static UpdateSapVirtualInstanceProperties DeserializeUpdateSapVirtualInstanceProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ManagedResourcesNetworkAccessType? managedResourcesNetworkAccessType = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("managedResourcesNetworkAccessType"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + managedResourcesNetworkAccessType = new ManagedResourcesNetworkAccessType(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new UpdateSapVirtualInstanceProperties(managedResourcesNetworkAccessType, 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(UpdateSapVirtualInstanceProperties)} does not support writing '{options.Format}' format."); + } + } + + UpdateSapVirtualInstanceProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeUpdateSapVirtualInstanceProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(UpdateSapVirtualInstanceProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/UpdateSapVirtualInstanceProperties.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/UpdateSapVirtualInstanceProperties.cs new file mode 100644 index 000000000000..5a311122d9de --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/UpdateSapVirtualInstanceProperties.cs @@ -0,0 +1,65 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.SapVirtualInstances.Models +{ + /// Defines the update request body properties for updating Virtual Instance for SAP. + internal partial class UpdateSapVirtualInstanceProperties + { + /// + /// 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 UpdateSapVirtualInstanceProperties() + { + } + + /// Initializes a new instance of . + /// Specifies the network access configuration for the resources that will be deployed in the Managed Resource Group. The options to choose from are Public and Private. If 'Private' is chosen, the Storage Account service tag should be enabled on the subnets in which the SAP VMs exist. This is required for establishing connectivity between VM extensions and the managed resource group storage account. This setting is currently applicable only to Storage Account. Learn more here https://go.microsoft.com/fwlink/?linkid=2247228. + /// Keeps track of any properties unknown to the library. + internal UpdateSapVirtualInstanceProperties(ManagedResourcesNetworkAccessType? managedResourcesNetworkAccessType, IDictionary serializedAdditionalRawData) + { + ManagedResourcesNetworkAccessType = managedResourcesNetworkAccessType; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Specifies the network access configuration for the resources that will be deployed in the Managed Resource Group. The options to choose from are Public and Private. If 'Private' is chosen, the Storage Account service tag should be enabled on the subnets in which the SAP VMs exist. This is required for establishing connectivity between VM extensions and the managed resource group storage account. This setting is currently applicable only to Storage Account. Learn more here https://go.microsoft.com/fwlink/?linkid=2247228. + public ManagedResourcesNetworkAccessType? ManagedResourcesNetworkAccessType { get; set; } + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/VirtualMachineConfiguration.Serialization.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/VirtualMachineConfiguration.Serialization.cs new file mode 100644 index 000000000000..517fad1a0331 --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/VirtualMachineConfiguration.Serialization.cs @@ -0,0 +1,142 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.SapVirtualInstances.Models +{ + public partial class VirtualMachineConfiguration : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(VirtualMachineConfiguration)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("vmSize"u8); + writer.WriteStringValue(VmSize); + writer.WritePropertyName("imageReference"u8); + writer.WriteObjectValue(ImageReference, options); + writer.WritePropertyName("osProfile"u8); + writer.WriteObjectValue(OSProfile, options); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + VirtualMachineConfiguration 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(VirtualMachineConfiguration)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeVirtualMachineConfiguration(document.RootElement, options); + } + + internal static VirtualMachineConfiguration DeserializeVirtualMachineConfiguration(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string vmSize = default; + ImageReference imageReference = default; + OSProfile osProfile = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("vmSize"u8)) + { + vmSize = property.Value.GetString(); + continue; + } + if (property.NameEquals("imageReference"u8)) + { + imageReference = ImageReference.DeserializeImageReference(property.Value, options); + continue; + } + if (property.NameEquals("osProfile"u8)) + { + osProfile = OSProfile.DeserializeOSProfile(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new VirtualMachineConfiguration(vmSize, imageReference, osProfile, 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(VirtualMachineConfiguration)} does not support writing '{options.Format}' format."); + } + } + + VirtualMachineConfiguration IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeVirtualMachineConfiguration(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(VirtualMachineConfiguration)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/VirtualMachineConfiguration.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/VirtualMachineConfiguration.cs new file mode 100644 index 000000000000..7292e4ec577f --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/VirtualMachineConfiguration.cs @@ -0,0 +1,89 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.SapVirtualInstances.Models +{ + /// Defines the virtual machine configuration. + public partial class VirtualMachineConfiguration + { + /// + /// 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 virtual machine size. + /// The image reference. + /// The OS profile. + /// , or is null. + public VirtualMachineConfiguration(string vmSize, ImageReference imageReference, OSProfile osProfile) + { + Argument.AssertNotNull(vmSize, nameof(vmSize)); + Argument.AssertNotNull(imageReference, nameof(imageReference)); + Argument.AssertNotNull(osProfile, nameof(osProfile)); + + VmSize = vmSize; + ImageReference = imageReference; + OSProfile = osProfile; + } + + /// Initializes a new instance of . + /// The virtual machine size. + /// The image reference. + /// The OS profile. + /// Keeps track of any properties unknown to the library. + internal VirtualMachineConfiguration(string vmSize, ImageReference imageReference, OSProfile osProfile, IDictionary serializedAdditionalRawData) + { + VmSize = vmSize; + ImageReference = imageReference; + OSProfile = osProfile; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal VirtualMachineConfiguration() + { + } + + /// The virtual machine size. + public string VmSize { get; set; } + /// The image reference. + public ImageReference ImageReference { get; set; } + /// The OS profile. + public OSProfile OSProfile { get; set; } + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/VirtualMachineResourceNames.Serialization.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/VirtualMachineResourceNames.Serialization.cs new file mode 100644 index 000000000000..684f6d4a0c3e --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/VirtualMachineResourceNames.Serialization.cs @@ -0,0 +1,230 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.SapVirtualInstances.Models +{ + public partial class VirtualMachineResourceNames : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(VirtualMachineResourceNames)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(VmName)) + { + writer.WritePropertyName("vmName"u8); + writer.WriteStringValue(VmName); + } + if (Optional.IsDefined(HostName)) + { + writer.WritePropertyName("hostName"u8); + writer.WriteStringValue(HostName); + } + if (Optional.IsCollectionDefined(NetworkInterfaces)) + { + writer.WritePropertyName("networkInterfaces"u8); + writer.WriteStartArray(); + foreach (var item in NetworkInterfaces) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(OSDiskName)) + { + writer.WritePropertyName("osDiskName"u8); + writer.WriteStringValue(OSDiskName); + } + if (Optional.IsCollectionDefined(DataDiskNames)) + { + writer.WritePropertyName("dataDiskNames"u8); + writer.WriteStartObject(); + foreach (var item in DataDiskNames) + { + writer.WritePropertyName(item.Key); + if (item.Value == null) + { + writer.WriteNullValue(); + continue; + } + writer.WriteStartArray(); + foreach (var item0 in item.Value) + { + writer.WriteStringValue(item0); + } + writer.WriteEndArray(); + } + writer.WriteEndObject(); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + VirtualMachineResourceNames 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(VirtualMachineResourceNames)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeVirtualMachineResourceNames(document.RootElement, options); + } + + internal static VirtualMachineResourceNames DeserializeVirtualMachineResourceNames(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string vmName = default; + string hostName = default; + IList networkInterfaces = default; + string osDiskName = default; + IDictionary> dataDiskNames = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("vmName"u8)) + { + vmName = property.Value.GetString(); + continue; + } + if (property.NameEquals("hostName"u8)) + { + hostName = property.Value.GetString(); + continue; + } + if (property.NameEquals("networkInterfaces"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(NetworkInterfaceResourceNames.DeserializeNetworkInterfaceResourceNames(item, options)); + } + networkInterfaces = array; + continue; + } + if (property.NameEquals("osDiskName"u8)) + { + osDiskName = property.Value.GetString(); + continue; + } + if (property.NameEquals("dataDiskNames"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + Dictionary> dictionary = new Dictionary>(); + foreach (var property0 in property.Value.EnumerateObject()) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + dictionary.Add(property0.Name, null); + } + else + { + List array = new List(); + foreach (var item in property0.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + dictionary.Add(property0.Name, array); + } + } + dataDiskNames = dictionary; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new VirtualMachineResourceNames( + vmName, + hostName, + networkInterfaces ?? new ChangeTrackingList(), + osDiskName, + dataDiskNames ?? new ChangeTrackingDictionary>(), + 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(VirtualMachineResourceNames)} does not support writing '{options.Format}' format."); + } + } + + VirtualMachineResourceNames IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeVirtualMachineResourceNames(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(VirtualMachineResourceNames)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/VirtualMachineResourceNames.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/VirtualMachineResourceNames.cs new file mode 100644 index 000000000000..f1e4d4439a2a --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/VirtualMachineResourceNames.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; + +namespace Azure.ResourceManager.SapVirtualInstances.Models +{ + /// The resource names object for virtual machine and related resources. + public partial class VirtualMachineResourceNames + { + /// + /// 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 VirtualMachineResourceNames() + { + NetworkInterfaces = new ChangeTrackingList(); + DataDiskNames = new ChangeTrackingDictionary>(); + } + + /// Initializes a new instance of . + /// The full name for virtual machine. The length of this field can be upto 64 characters. If name is not provided, service uses a default name based on the deployment type. For SingleServer, default name is {SID}vm. In case of HA-AvZone systems, default name will be {SID}{app/ascs/db}z{a/b}vm with an incrementor at the end in case of more than 1 vm per layer. For distributed and HA-AvSet systems, default name will be {SID}{app/ascs/db}vm with an incrementor at the end in case of more than 1 vm per layer. + /// The full name for virtual-machine's host (computer name). Currently, ACSS only supports host names which are less than or equal to 13 characters long. If this value is not provided, vmName will be used as host name. + /// The list of network interface name objects for the selected virtual machine. Currently, only one network interface is supported per virtual machine. + /// The full name for OS disk attached to the VM. If this value is not provided, it will be named by ARM as per its default naming standards (prefixed with vm name). There is only one OS disk attached per Virtual Machine. + /// The full resource names for virtual machine data disks. This is a dictionary containing list of names of data disks per volume. Currently supported volumes for database layer are ['hana/data', 'hana/log', hana/shared', 'usr/sap', 'os', 'backup']. For application and cs layers, only 'default' volume is supported. + /// Keeps track of any properties unknown to the library. + internal VirtualMachineResourceNames(string vmName, string hostName, IList networkInterfaces, string osDiskName, IDictionary> dataDiskNames, IDictionary serializedAdditionalRawData) + { + VmName = vmName; + HostName = hostName; + NetworkInterfaces = networkInterfaces; + OSDiskName = osDiskName; + DataDiskNames = dataDiskNames; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The full name for virtual machine. The length of this field can be upto 64 characters. If name is not provided, service uses a default name based on the deployment type. For SingleServer, default name is {SID}vm. In case of HA-AvZone systems, default name will be {SID}{app/ascs/db}z{a/b}vm with an incrementor at the end in case of more than 1 vm per layer. For distributed and HA-AvSet systems, default name will be {SID}{app/ascs/db}vm with an incrementor at the end in case of more than 1 vm per layer. + public string VmName { get; set; } + /// The full name for virtual-machine's host (computer name). Currently, ACSS only supports host names which are less than or equal to 13 characters long. If this value is not provided, vmName will be used as host name. + public string HostName { get; set; } + /// The list of network interface name objects for the selected virtual machine. Currently, only one network interface is supported per virtual machine. + public IList NetworkInterfaces { get; } + /// The full name for OS disk attached to the VM. If this value is not provided, it will be named by ARM as per its default naming standards (prefixed with vm name). There is only one OS disk attached per Virtual Machine. + public string OSDiskName { get; set; } + /// The full resource names for virtual machine data disks. This is a dictionary containing list of names of data disks per volume. Currently supported volumes for database layer are ['hana/data', 'hana/log', hana/shared', 'usr/sap', 'os', 'backup']. For application and cs layers, only 'default' volume is supported. + public IDictionary> DataDiskNames { get; } + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/WindowsConfiguration.Serialization.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/WindowsConfiguration.Serialization.cs new file mode 100644 index 000000000000..c374218bffed --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/WindowsConfiguration.Serialization.cs @@ -0,0 +1,110 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.SapVirtualInstances.Models +{ + public partial class WindowsConfiguration : 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(WindowsConfiguration)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + } + + WindowsConfiguration 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(WindowsConfiguration)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeWindowsConfiguration(document.RootElement, options); + } + + internal static WindowsConfiguration DeserializeWindowsConfiguration(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + OSType osType = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("osType"u8)) + { + osType = new OSType(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new WindowsConfiguration(osType, 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(WindowsConfiguration)} does not support writing '{options.Format}' format."); + } + } + + WindowsConfiguration IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeWindowsConfiguration(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(WindowsConfiguration)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/WindowsConfiguration.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/WindowsConfiguration.cs new file mode 100644 index 000000000000..55729d7198eb --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/WindowsConfiguration.cs @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.SapVirtualInstances.Models +{ + /// Specifies Windows operating system settings on the virtual machine. + public partial class WindowsConfiguration : OSConfiguration + { + /// Initializes a new instance of . + public WindowsConfiguration() + { + OSType = OSType.Windows; + } + + /// Initializes a new instance of . + /// The OS Type. + /// Keeps track of any properties unknown to the library. + internal WindowsConfiguration(OSType osType, IDictionary serializedAdditionalRawData) : base(osType, serializedAdditionalRawData) + { + OSType = osType; + } + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/ProviderConstants.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/ProviderConstants.cs new file mode 100644 index 000000000000..c33e111ebe5c --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/ProviderConstants.cs @@ -0,0 +1,16 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.SapVirtualInstances +{ + internal static class ProviderConstants + { + public static string DefaultProviderNamespace { get; } = ClientDiagnostics.GetResourceProviderNamespace(typeof(ProviderConstants).Assembly); + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/RestOperations/SapApplicationServerInstancesRestOperations.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/RestOperations/SapApplicationServerInstancesRestOperations.cs new file mode 100644 index 000000000000..6cd8cd64f6d2 --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/RestOperations/SapApplicationServerInstancesRestOperations.cs @@ -0,0 +1,827 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.SapVirtualInstances.Models; + +namespace Azure.ResourceManager.SapVirtualInstances +{ + internal partial class SapApplicationServerInstancesRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of SapApplicationServerInstancesRestOperations. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// The application id to use for user agent. + /// Service host. + /// The API version to use for this operation. + /// or is null. + public SapApplicationServerInstancesRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + { + _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); + _endpoint = endpoint ?? new Uri("https://management.azure.com"); + _apiVersion = apiVersion ?? "2024-09-01"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string sapVirtualInstanceName, string applicationInstanceName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Workloads/sapVirtualInstances/", false); + uri.AppendPath(sapVirtualInstanceName, true); + uri.AppendPath("/applicationInstances/", false); + uri.AppendPath(applicationInstanceName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string sapVirtualInstanceName, string applicationInstanceName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Workloads/sapVirtualInstances/", false); + uri.AppendPath(sapVirtualInstanceName, true); + uri.AppendPath("/applicationInstances/", false); + uri.AppendPath(applicationInstanceName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Gets the SAP Application Server Instance corresponding to the Virtual Instance for SAP solutions resource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the Virtual Instances for SAP solutions resource. + /// The name of SAP Application Server instance resource. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task> GetAsync(string subscriptionId, string resourceGroupName, string sapVirtualInstanceName, string applicationInstanceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(sapVirtualInstanceName, nameof(sapVirtualInstanceName)); + Argument.AssertNotNullOrEmpty(applicationInstanceName, nameof(applicationInstanceName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, sapVirtualInstanceName, applicationInstanceName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + SapApplicationServerInstanceData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = SapApplicationServerInstanceData.DeserializeSapApplicationServerInstanceData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((SapApplicationServerInstanceData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// Gets the SAP Application Server Instance corresponding to the Virtual Instance for SAP solutions resource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the Virtual Instances for SAP solutions resource. + /// The name of SAP Application Server instance resource. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response Get(string subscriptionId, string resourceGroupName, string sapVirtualInstanceName, string applicationInstanceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(sapVirtualInstanceName, nameof(sapVirtualInstanceName)); + Argument.AssertNotNullOrEmpty(applicationInstanceName, nameof(applicationInstanceName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, sapVirtualInstanceName, applicationInstanceName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + SapApplicationServerInstanceData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = SapApplicationServerInstanceData.DeserializeSapApplicationServerInstanceData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((SapApplicationServerInstanceData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateCreateRequestUri(string subscriptionId, string resourceGroupName, string sapVirtualInstanceName, string applicationInstanceName, SapApplicationServerInstanceData data) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Workloads/sapVirtualInstances/", false); + uri.AppendPath(sapVirtualInstanceName, true); + uri.AppendPath("/applicationInstances/", false); + uri.AppendPath(applicationInstanceName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateCreateRequest(string subscriptionId, string resourceGroupName, string sapVirtualInstanceName, string applicationInstanceName, SapApplicationServerInstanceData data) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Put; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Workloads/sapVirtualInstances/", false); + uri.AppendPath(sapVirtualInstanceName, true); + uri.AppendPath("/applicationInstances/", false); + uri.AppendPath(applicationInstanceName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(data, ModelSerializationExtensions.WireOptions); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Puts the SAP Application Server Instance resource. <br><br>This will be used by service only. PUT by end user will return a Bad Request error. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the Virtual Instances for SAP solutions resource. + /// The name of SAP Application Server instance resource. + /// The SAP Application Server Instance resource request body. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task CreateAsync(string subscriptionId, string resourceGroupName, string sapVirtualInstanceName, string applicationInstanceName, SapApplicationServerInstanceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(sapVirtualInstanceName, nameof(sapVirtualInstanceName)); + Argument.AssertNotNullOrEmpty(applicationInstanceName, nameof(applicationInstanceName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateRequest(subscriptionId, resourceGroupName, sapVirtualInstanceName, applicationInstanceName, data); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 201: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Puts the SAP Application Server Instance resource. <br><br>This will be used by service only. PUT by end user will return a Bad Request error. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the Virtual Instances for SAP solutions resource. + /// The name of SAP Application Server instance resource. + /// The SAP Application Server Instance resource request body. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response Create(string subscriptionId, string resourceGroupName, string sapVirtualInstanceName, string applicationInstanceName, SapApplicationServerInstanceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(sapVirtualInstanceName, nameof(sapVirtualInstanceName)); + Argument.AssertNotNullOrEmpty(applicationInstanceName, nameof(applicationInstanceName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateRequest(subscriptionId, resourceGroupName, sapVirtualInstanceName, applicationInstanceName, data); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 201: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateUpdateRequestUri(string subscriptionId, string resourceGroupName, string sapVirtualInstanceName, string applicationInstanceName, SapApplicationServerInstancePatch patch) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Workloads/sapVirtualInstances/", false); + uri.AppendPath(sapVirtualInstanceName, true); + uri.AppendPath("/applicationInstances/", false); + uri.AppendPath(applicationInstanceName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceGroupName, string sapVirtualInstanceName, string applicationInstanceName, SapApplicationServerInstancePatch patch) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Patch; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Workloads/sapVirtualInstances/", false); + uri.AppendPath(sapVirtualInstanceName, true); + uri.AppendPath("/applicationInstances/", false); + uri.AppendPath(applicationInstanceName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(patch, ModelSerializationExtensions.WireOptions); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Puts the SAP Application Server Instance resource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the Virtual Instances for SAP solutions resource. + /// The name of SAP Application Server instance resource. + /// The SAP Application Server Instance resource request body. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task> UpdateAsync(string subscriptionId, string resourceGroupName, string sapVirtualInstanceName, string applicationInstanceName, SapApplicationServerInstancePatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(sapVirtualInstanceName, nameof(sapVirtualInstanceName)); + Argument.AssertNotNullOrEmpty(applicationInstanceName, nameof(applicationInstanceName)); + Argument.AssertNotNull(patch, nameof(patch)); + + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, sapVirtualInstanceName, applicationInstanceName, patch); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + SapApplicationServerInstanceData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = SapApplicationServerInstanceData.DeserializeSapApplicationServerInstanceData(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Puts the SAP Application Server Instance resource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the Virtual Instances for SAP solutions resource. + /// The name of SAP Application Server instance resource. + /// The SAP Application Server Instance resource request body. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response Update(string subscriptionId, string resourceGroupName, string sapVirtualInstanceName, string applicationInstanceName, SapApplicationServerInstancePatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(sapVirtualInstanceName, nameof(sapVirtualInstanceName)); + Argument.AssertNotNullOrEmpty(applicationInstanceName, nameof(applicationInstanceName)); + Argument.AssertNotNull(patch, nameof(patch)); + + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, sapVirtualInstanceName, applicationInstanceName, patch); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + SapApplicationServerInstanceData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = SapApplicationServerInstanceData.DeserializeSapApplicationServerInstanceData(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string resourceGroupName, string sapVirtualInstanceName, string applicationInstanceName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Workloads/sapVirtualInstances/", false); + uri.AppendPath(sapVirtualInstanceName, true); + uri.AppendPath("/applicationInstances/", false); + uri.AppendPath(applicationInstanceName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string sapVirtualInstanceName, string applicationInstanceName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Delete; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Workloads/sapVirtualInstances/", false); + uri.AppendPath(sapVirtualInstanceName, true); + uri.AppendPath("/applicationInstances/", false); + uri.AppendPath(applicationInstanceName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Deletes the SAP Application Server Instance resource. <br><br>This operation will be used by service only. Delete by end user will return a Bad Request error. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the Virtual Instances for SAP solutions resource. + /// The name of SAP Application Server instance resource. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task DeleteAsync(string subscriptionId, string resourceGroupName, string sapVirtualInstanceName, string applicationInstanceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(sapVirtualInstanceName, nameof(sapVirtualInstanceName)); + Argument.AssertNotNullOrEmpty(applicationInstanceName, nameof(applicationInstanceName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, sapVirtualInstanceName, applicationInstanceName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Deletes the SAP Application Server Instance resource. <br><br>This operation will be used by service only. Delete by end user will return a Bad Request error. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the Virtual Instances for SAP solutions resource. + /// The name of SAP Application Server instance resource. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response Delete(string subscriptionId, string resourceGroupName, string sapVirtualInstanceName, string applicationInstanceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(sapVirtualInstanceName, nameof(sapVirtualInstanceName)); + Argument.AssertNotNullOrEmpty(applicationInstanceName, nameof(applicationInstanceName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, sapVirtualInstanceName, applicationInstanceName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListRequestUri(string subscriptionId, string resourceGroupName, string sapVirtualInstanceName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Workloads/sapVirtualInstances/", false); + uri.AppendPath(sapVirtualInstanceName, true); + uri.AppendPath("/applicationInstances", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateListRequest(string subscriptionId, string resourceGroupName, string sapVirtualInstanceName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Workloads/sapVirtualInstances/", false); + uri.AppendPath(sapVirtualInstanceName, true); + uri.AppendPath("/applicationInstances", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Lists the SAP Application Server Instance resources for a given Virtual Instance for SAP solutions resource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the Virtual Instances for SAP solutions resource. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> ListAsync(string subscriptionId, string resourceGroupName, string sapVirtualInstanceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(sapVirtualInstanceName, nameof(sapVirtualInstanceName)); + + using var message = CreateListRequest(subscriptionId, resourceGroupName, sapVirtualInstanceName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + SAPApplicationServerInstanceListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = SAPApplicationServerInstanceListResult.DeserializeSAPApplicationServerInstanceListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Lists the SAP Application Server Instance resources for a given Virtual Instance for SAP solutions resource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the Virtual Instances for SAP solutions resource. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response List(string subscriptionId, string resourceGroupName, string sapVirtualInstanceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(sapVirtualInstanceName, nameof(sapVirtualInstanceName)); + + using var message = CreateListRequest(subscriptionId, resourceGroupName, sapVirtualInstanceName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + SAPApplicationServerInstanceListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = SAPApplicationServerInstanceListResult.DeserializeSAPApplicationServerInstanceListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateStartRequestUri(string subscriptionId, string resourceGroupName, string sapVirtualInstanceName, string applicationInstanceName, StartContent content) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Workloads/sapVirtualInstances/", false); + uri.AppendPath(sapVirtualInstanceName, true); + uri.AppendPath("/applicationInstances/", false); + uri.AppendPath(applicationInstanceName, true); + uri.AppendPath("/start", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateStartRequest(string subscriptionId, string resourceGroupName, string sapVirtualInstanceName, string applicationInstanceName, StartContent content) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Workloads/sapVirtualInstances/", false); + uri.AppendPath(sapVirtualInstanceName, true); + uri.AppendPath("/applicationInstances/", false); + uri.AppendPath(applicationInstanceName, true); + uri.AppendPath("/start", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + if (content != null) + { + request.Headers.Add("Content-Type", "application/json"); + var content0 = new Utf8JsonRequestContent(); + content0.JsonWriter.WriteObjectValue(content, ModelSerializationExtensions.WireOptions); + request.Content = content0; + } + _userAgent.Apply(message); + return message; + } + + /// Starts the SAP Application Server Instance. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the Virtual Instances for SAP solutions resource. + /// The name of SAP Application Server instance resource. + /// SAP Application server instance start request body. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task StartAsync(string subscriptionId, string resourceGroupName, string sapVirtualInstanceName, string applicationInstanceName, StartContent content = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(sapVirtualInstanceName, nameof(sapVirtualInstanceName)); + Argument.AssertNotNullOrEmpty(applicationInstanceName, nameof(applicationInstanceName)); + + using var message = CreateStartRequest(subscriptionId, resourceGroupName, sapVirtualInstanceName, applicationInstanceName, content); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 202: + case 200: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Starts the SAP Application Server Instance. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the Virtual Instances for SAP solutions resource. + /// The name of SAP Application Server instance resource. + /// SAP Application server instance start request body. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response Start(string subscriptionId, string resourceGroupName, string sapVirtualInstanceName, string applicationInstanceName, StartContent content = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(sapVirtualInstanceName, nameof(sapVirtualInstanceName)); + Argument.AssertNotNullOrEmpty(applicationInstanceName, nameof(applicationInstanceName)); + + using var message = CreateStartRequest(subscriptionId, resourceGroupName, sapVirtualInstanceName, applicationInstanceName, content); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 202: + case 200: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateStopRequestUri(string subscriptionId, string resourceGroupName, string sapVirtualInstanceName, string applicationInstanceName, StopContent content) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Workloads/sapVirtualInstances/", false); + uri.AppendPath(sapVirtualInstanceName, true); + uri.AppendPath("/applicationInstances/", false); + uri.AppendPath(applicationInstanceName, true); + uri.AppendPath("/stop", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateStopRequest(string subscriptionId, string resourceGroupName, string sapVirtualInstanceName, string applicationInstanceName, StopContent content) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Workloads/sapVirtualInstances/", false); + uri.AppendPath(sapVirtualInstanceName, true); + uri.AppendPath("/applicationInstances/", false); + uri.AppendPath(applicationInstanceName, true); + uri.AppendPath("/stop", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + if (content != null) + { + request.Headers.Add("Content-Type", "application/json"); + var content0 = new Utf8JsonRequestContent(); + content0.JsonWriter.WriteObjectValue(content, ModelSerializationExtensions.WireOptions); + request.Content = content0; + } + _userAgent.Apply(message); + return message; + } + + /// Stops the SAP Application Server Instance. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the Virtual Instances for SAP solutions resource. + /// The name of SAP Application Server instance resource. + /// SAP Application server instance stop request body. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task StopAsync(string subscriptionId, string resourceGroupName, string sapVirtualInstanceName, string applicationInstanceName, StopContent content = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(sapVirtualInstanceName, nameof(sapVirtualInstanceName)); + Argument.AssertNotNullOrEmpty(applicationInstanceName, nameof(applicationInstanceName)); + + using var message = CreateStopRequest(subscriptionId, resourceGroupName, sapVirtualInstanceName, applicationInstanceName, content); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 202: + case 200: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Stops the SAP Application Server Instance. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the Virtual Instances for SAP solutions resource. + /// The name of SAP Application Server instance resource. + /// SAP Application server instance stop request body. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response Stop(string subscriptionId, string resourceGroupName, string sapVirtualInstanceName, string applicationInstanceName, StopContent content = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(sapVirtualInstanceName, nameof(sapVirtualInstanceName)); + Argument.AssertNotNullOrEmpty(applicationInstanceName, nameof(applicationInstanceName)); + + using var message = CreateStopRequest(subscriptionId, resourceGroupName, sapVirtualInstanceName, applicationInstanceName, content); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 202: + case 200: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string sapVirtualInstanceName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateListNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string sapVirtualInstanceName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Lists the SAP Application Server Instance resources for a given Virtual Instance for SAP solutions resource. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the Virtual Instances for SAP solutions resource. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> ListNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string sapVirtualInstanceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(sapVirtualInstanceName, nameof(sapVirtualInstanceName)); + + using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, sapVirtualInstanceName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + SAPApplicationServerInstanceListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = SAPApplicationServerInstanceListResult.DeserializeSAPApplicationServerInstanceListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Lists the SAP Application Server Instance resources for a given Virtual Instance for SAP solutions resource. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the Virtual Instances for SAP solutions resource. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response ListNextPage(string nextLink, string subscriptionId, string resourceGroupName, string sapVirtualInstanceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(sapVirtualInstanceName, nameof(sapVirtualInstanceName)); + + using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, sapVirtualInstanceName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + SAPApplicationServerInstanceListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = SAPApplicationServerInstanceListResult.DeserializeSAPApplicationServerInstanceListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/RestOperations/SapCentralServerInstancesRestOperations.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/RestOperations/SapCentralServerInstancesRestOperations.cs new file mode 100644 index 000000000000..905bcc7d3c5f --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/RestOperations/SapCentralServerInstancesRestOperations.cs @@ -0,0 +1,827 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.SapVirtualInstances.Models; + +namespace Azure.ResourceManager.SapVirtualInstances +{ + internal partial class SapCentralServerInstancesRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of SapCentralServerInstancesRestOperations. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// The application id to use for user agent. + /// Service host. + /// The API version to use for this operation. + /// or is null. + public SapCentralServerInstancesRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + { + _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); + _endpoint = endpoint ?? new Uri("https://management.azure.com"); + _apiVersion = apiVersion ?? "2024-09-01"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string sapVirtualInstanceName, string centralInstanceName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Workloads/sapVirtualInstances/", false); + uri.AppendPath(sapVirtualInstanceName, true); + uri.AppendPath("/centralInstances/", false); + uri.AppendPath(centralInstanceName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string sapVirtualInstanceName, string centralInstanceName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Workloads/sapVirtualInstances/", false); + uri.AppendPath(sapVirtualInstanceName, true); + uri.AppendPath("/centralInstances/", false); + uri.AppendPath(centralInstanceName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Gets the SAP Central Services Instance resource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the Virtual Instances for SAP solutions resource. + /// Central Services Instance resource name string modeled as parameter for auto generation to work correctly. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task> GetAsync(string subscriptionId, string resourceGroupName, string sapVirtualInstanceName, string centralInstanceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(sapVirtualInstanceName, nameof(sapVirtualInstanceName)); + Argument.AssertNotNullOrEmpty(centralInstanceName, nameof(centralInstanceName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, sapVirtualInstanceName, centralInstanceName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + SapCentralServerInstanceData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = SapCentralServerInstanceData.DeserializeSapCentralServerInstanceData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((SapCentralServerInstanceData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// Gets the SAP Central Services Instance resource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the Virtual Instances for SAP solutions resource. + /// Central Services Instance resource name string modeled as parameter for auto generation to work correctly. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response Get(string subscriptionId, string resourceGroupName, string sapVirtualInstanceName, string centralInstanceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(sapVirtualInstanceName, nameof(sapVirtualInstanceName)); + Argument.AssertNotNullOrEmpty(centralInstanceName, nameof(centralInstanceName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, sapVirtualInstanceName, centralInstanceName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + SapCentralServerInstanceData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = SapCentralServerInstanceData.DeserializeSapCentralServerInstanceData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((SapCentralServerInstanceData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateCreateRequestUri(string subscriptionId, string resourceGroupName, string sapVirtualInstanceName, string centralInstanceName, SapCentralServerInstanceData data) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Workloads/sapVirtualInstances/", false); + uri.AppendPath(sapVirtualInstanceName, true); + uri.AppendPath("/centralInstances/", false); + uri.AppendPath(centralInstanceName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateCreateRequest(string subscriptionId, string resourceGroupName, string sapVirtualInstanceName, string centralInstanceName, SapCentralServerInstanceData data) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Put; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Workloads/sapVirtualInstances/", false); + uri.AppendPath(sapVirtualInstanceName, true); + uri.AppendPath("/centralInstances/", false); + uri.AppendPath(centralInstanceName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(data, ModelSerializationExtensions.WireOptions); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Creates the SAP Central Services Instance resource. <br><br>This will be used by service only. PUT operation on this resource by end user will return a Bad Request error. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the Virtual Instances for SAP solutions resource. + /// Central Services Instance resource name string modeled as parameter for auto generation to work correctly. + /// The SAP Central Services Instance request body. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task CreateAsync(string subscriptionId, string resourceGroupName, string sapVirtualInstanceName, string centralInstanceName, SapCentralServerInstanceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(sapVirtualInstanceName, nameof(sapVirtualInstanceName)); + Argument.AssertNotNullOrEmpty(centralInstanceName, nameof(centralInstanceName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateRequest(subscriptionId, resourceGroupName, sapVirtualInstanceName, centralInstanceName, data); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 201: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Creates the SAP Central Services Instance resource. <br><br>This will be used by service only. PUT operation on this resource by end user will return a Bad Request error. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the Virtual Instances for SAP solutions resource. + /// Central Services Instance resource name string modeled as parameter for auto generation to work correctly. + /// The SAP Central Services Instance request body. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response Create(string subscriptionId, string resourceGroupName, string sapVirtualInstanceName, string centralInstanceName, SapCentralServerInstanceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(sapVirtualInstanceName, nameof(sapVirtualInstanceName)); + Argument.AssertNotNullOrEmpty(centralInstanceName, nameof(centralInstanceName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateRequest(subscriptionId, resourceGroupName, sapVirtualInstanceName, centralInstanceName, data); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 201: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateUpdateRequestUri(string subscriptionId, string resourceGroupName, string sapVirtualInstanceName, string centralInstanceName, SapCentralServerInstancePatch patch) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Workloads/sapVirtualInstances/", false); + uri.AppendPath(sapVirtualInstanceName, true); + uri.AppendPath("/centralInstances/", false); + uri.AppendPath(centralInstanceName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceGroupName, string sapVirtualInstanceName, string centralInstanceName, SapCentralServerInstancePatch patch) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Patch; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Workloads/sapVirtualInstances/", false); + uri.AppendPath(sapVirtualInstanceName, true); + uri.AppendPath("/centralInstances/", false); + uri.AppendPath(centralInstanceName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(patch, ModelSerializationExtensions.WireOptions); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Updates the SAP Central Services Instance resource. <br><br>This can be used to update tags on the resource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the Virtual Instances for SAP solutions resource. + /// Central Services Instance resource name string modeled as parameter for auto generation to work correctly. + /// The SAP Central Services Instance resource request body. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task> UpdateAsync(string subscriptionId, string resourceGroupName, string sapVirtualInstanceName, string centralInstanceName, SapCentralServerInstancePatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(sapVirtualInstanceName, nameof(sapVirtualInstanceName)); + Argument.AssertNotNullOrEmpty(centralInstanceName, nameof(centralInstanceName)); + Argument.AssertNotNull(patch, nameof(patch)); + + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, sapVirtualInstanceName, centralInstanceName, patch); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + SapCentralServerInstanceData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = SapCentralServerInstanceData.DeserializeSapCentralServerInstanceData(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Updates the SAP Central Services Instance resource. <br><br>This can be used to update tags on the resource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the Virtual Instances for SAP solutions resource. + /// Central Services Instance resource name string modeled as parameter for auto generation to work correctly. + /// The SAP Central Services Instance resource request body. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response Update(string subscriptionId, string resourceGroupName, string sapVirtualInstanceName, string centralInstanceName, SapCentralServerInstancePatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(sapVirtualInstanceName, nameof(sapVirtualInstanceName)); + Argument.AssertNotNullOrEmpty(centralInstanceName, nameof(centralInstanceName)); + Argument.AssertNotNull(patch, nameof(patch)); + + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, sapVirtualInstanceName, centralInstanceName, patch); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + SapCentralServerInstanceData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = SapCentralServerInstanceData.DeserializeSapCentralServerInstanceData(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string resourceGroupName, string sapVirtualInstanceName, string centralInstanceName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Workloads/sapVirtualInstances/", false); + uri.AppendPath(sapVirtualInstanceName, true); + uri.AppendPath("/centralInstances/", false); + uri.AppendPath(centralInstanceName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string sapVirtualInstanceName, string centralInstanceName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Delete; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Workloads/sapVirtualInstances/", false); + uri.AppendPath(sapVirtualInstanceName, true); + uri.AppendPath("/centralInstances/", false); + uri.AppendPath(centralInstanceName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Deletes the SAP Central Services Instance resource. <br><br>This will be used by service only. Delete operation on this resource by end user will return a Bad Request error. You can delete the parent resource, which is the Virtual Instance for SAP solutions resource, using the delete operation on it. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the Virtual Instances for SAP solutions resource. + /// Central Services Instance resource name string modeled as parameter for auto generation to work correctly. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task DeleteAsync(string subscriptionId, string resourceGroupName, string sapVirtualInstanceName, string centralInstanceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(sapVirtualInstanceName, nameof(sapVirtualInstanceName)); + Argument.AssertNotNullOrEmpty(centralInstanceName, nameof(centralInstanceName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, sapVirtualInstanceName, centralInstanceName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Deletes the SAP Central Services Instance resource. <br><br>This will be used by service only. Delete operation on this resource by end user will return a Bad Request error. You can delete the parent resource, which is the Virtual Instance for SAP solutions resource, using the delete operation on it. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the Virtual Instances for SAP solutions resource. + /// Central Services Instance resource name string modeled as parameter for auto generation to work correctly. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response Delete(string subscriptionId, string resourceGroupName, string sapVirtualInstanceName, string centralInstanceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(sapVirtualInstanceName, nameof(sapVirtualInstanceName)); + Argument.AssertNotNullOrEmpty(centralInstanceName, nameof(centralInstanceName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, sapVirtualInstanceName, centralInstanceName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListRequestUri(string subscriptionId, string resourceGroupName, string sapVirtualInstanceName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Workloads/sapVirtualInstances/", false); + uri.AppendPath(sapVirtualInstanceName, true); + uri.AppendPath("/centralInstances", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateListRequest(string subscriptionId, string resourceGroupName, string sapVirtualInstanceName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Workloads/sapVirtualInstances/", false); + uri.AppendPath(sapVirtualInstanceName, true); + uri.AppendPath("/centralInstances", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Lists the SAP Central Services Instance resource for the given Virtual Instance for SAP solutions resource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the Virtual Instances for SAP solutions resource. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> ListAsync(string subscriptionId, string resourceGroupName, string sapVirtualInstanceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(sapVirtualInstanceName, nameof(sapVirtualInstanceName)); + + using var message = CreateListRequest(subscriptionId, resourceGroupName, sapVirtualInstanceName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + SAPCentralServerInstanceListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = SAPCentralServerInstanceListResult.DeserializeSAPCentralServerInstanceListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Lists the SAP Central Services Instance resource for the given Virtual Instance for SAP solutions resource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the Virtual Instances for SAP solutions resource. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response List(string subscriptionId, string resourceGroupName, string sapVirtualInstanceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(sapVirtualInstanceName, nameof(sapVirtualInstanceName)); + + using var message = CreateListRequest(subscriptionId, resourceGroupName, sapVirtualInstanceName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + SAPCentralServerInstanceListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = SAPCentralServerInstanceListResult.DeserializeSAPCentralServerInstanceListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateStartRequestUri(string subscriptionId, string resourceGroupName, string sapVirtualInstanceName, string centralInstanceName, StartContent content) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Workloads/sapVirtualInstances/", false); + uri.AppendPath(sapVirtualInstanceName, true); + uri.AppendPath("/centralInstances/", false); + uri.AppendPath(centralInstanceName, true); + uri.AppendPath("/start", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateStartRequest(string subscriptionId, string resourceGroupName, string sapVirtualInstanceName, string centralInstanceName, StartContent content) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Workloads/sapVirtualInstances/", false); + uri.AppendPath(sapVirtualInstanceName, true); + uri.AppendPath("/centralInstances/", false); + uri.AppendPath(centralInstanceName, true); + uri.AppendPath("/start", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + if (content != null) + { + request.Headers.Add("Content-Type", "application/json"); + var content0 = new Utf8JsonRequestContent(); + content0.JsonWriter.WriteObjectValue(content, ModelSerializationExtensions.WireOptions); + request.Content = content0; + } + _userAgent.Apply(message); + return message; + } + + /// Starts the SAP Central Services Instance. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the Virtual Instances for SAP solutions resource. + /// Central Services Instance resource name string modeled as parameter for auto generation to work correctly. + /// SAP Central Services instance start request body. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task StartAsync(string subscriptionId, string resourceGroupName, string sapVirtualInstanceName, string centralInstanceName, StartContent content = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(sapVirtualInstanceName, nameof(sapVirtualInstanceName)); + Argument.AssertNotNullOrEmpty(centralInstanceName, nameof(centralInstanceName)); + + using var message = CreateStartRequest(subscriptionId, resourceGroupName, sapVirtualInstanceName, centralInstanceName, content); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 202: + case 200: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Starts the SAP Central Services Instance. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the Virtual Instances for SAP solutions resource. + /// Central Services Instance resource name string modeled as parameter for auto generation to work correctly. + /// SAP Central Services instance start request body. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response Start(string subscriptionId, string resourceGroupName, string sapVirtualInstanceName, string centralInstanceName, StartContent content = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(sapVirtualInstanceName, nameof(sapVirtualInstanceName)); + Argument.AssertNotNullOrEmpty(centralInstanceName, nameof(centralInstanceName)); + + using var message = CreateStartRequest(subscriptionId, resourceGroupName, sapVirtualInstanceName, centralInstanceName, content); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 202: + case 200: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateStopRequestUri(string subscriptionId, string resourceGroupName, string sapVirtualInstanceName, string centralInstanceName, StopContent content) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Workloads/sapVirtualInstances/", false); + uri.AppendPath(sapVirtualInstanceName, true); + uri.AppendPath("/centralInstances/", false); + uri.AppendPath(centralInstanceName, true); + uri.AppendPath("/stop", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateStopRequest(string subscriptionId, string resourceGroupName, string sapVirtualInstanceName, string centralInstanceName, StopContent content) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Workloads/sapVirtualInstances/", false); + uri.AppendPath(sapVirtualInstanceName, true); + uri.AppendPath("/centralInstances/", false); + uri.AppendPath(centralInstanceName, true); + uri.AppendPath("/stop", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + if (content != null) + { + request.Headers.Add("Content-Type", "application/json"); + var content0 = new Utf8JsonRequestContent(); + content0.JsonWriter.WriteObjectValue(content, ModelSerializationExtensions.WireOptions); + request.Content = content0; + } + _userAgent.Apply(message); + return message; + } + + /// Stops the SAP Central Services Instance. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the Virtual Instances for SAP solutions resource. + /// Central Services Instance resource name string modeled as parameter for auto generation to work correctly. + /// SAP Central Services instance stop request body. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task StopAsync(string subscriptionId, string resourceGroupName, string sapVirtualInstanceName, string centralInstanceName, StopContent content = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(sapVirtualInstanceName, nameof(sapVirtualInstanceName)); + Argument.AssertNotNullOrEmpty(centralInstanceName, nameof(centralInstanceName)); + + using var message = CreateStopRequest(subscriptionId, resourceGroupName, sapVirtualInstanceName, centralInstanceName, content); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 202: + case 200: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Stops the SAP Central Services Instance. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the Virtual Instances for SAP solutions resource. + /// Central Services Instance resource name string modeled as parameter for auto generation to work correctly. + /// SAP Central Services instance stop request body. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response Stop(string subscriptionId, string resourceGroupName, string sapVirtualInstanceName, string centralInstanceName, StopContent content = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(sapVirtualInstanceName, nameof(sapVirtualInstanceName)); + Argument.AssertNotNullOrEmpty(centralInstanceName, nameof(centralInstanceName)); + + using var message = CreateStopRequest(subscriptionId, resourceGroupName, sapVirtualInstanceName, centralInstanceName, content); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 202: + case 200: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string sapVirtualInstanceName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateListNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string sapVirtualInstanceName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Lists the SAP Central Services Instance resource for the given Virtual Instance for SAP solutions resource. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the Virtual Instances for SAP solutions resource. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> ListNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string sapVirtualInstanceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(sapVirtualInstanceName, nameof(sapVirtualInstanceName)); + + using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, sapVirtualInstanceName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + SAPCentralServerInstanceListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = SAPCentralServerInstanceListResult.DeserializeSAPCentralServerInstanceListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Lists the SAP Central Services Instance resource for the given Virtual Instance for SAP solutions resource. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the Virtual Instances for SAP solutions resource. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response ListNextPage(string nextLink, string subscriptionId, string resourceGroupName, string sapVirtualInstanceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(sapVirtualInstanceName, nameof(sapVirtualInstanceName)); + + using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, sapVirtualInstanceName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + SAPCentralServerInstanceListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = SAPCentralServerInstanceListResult.DeserializeSAPCentralServerInstanceListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/RestOperations/SapDatabaseInstancesRestOperations.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/RestOperations/SapDatabaseInstancesRestOperations.cs new file mode 100644 index 000000000000..379085ffd88e --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/RestOperations/SapDatabaseInstancesRestOperations.cs @@ -0,0 +1,827 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.SapVirtualInstances.Models; + +namespace Azure.ResourceManager.SapVirtualInstances +{ + internal partial class SapDatabaseInstancesRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of SapDatabaseInstancesRestOperations. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// The application id to use for user agent. + /// Service host. + /// The API version to use for this operation. + /// or is null. + public SapDatabaseInstancesRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + { + _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); + _endpoint = endpoint ?? new Uri("https://management.azure.com"); + _apiVersion = apiVersion ?? "2024-09-01"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string sapVirtualInstanceName, string databaseInstanceName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Workloads/sapVirtualInstances/", false); + uri.AppendPath(sapVirtualInstanceName, true); + uri.AppendPath("/databaseInstances/", false); + uri.AppendPath(databaseInstanceName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string sapVirtualInstanceName, string databaseInstanceName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Workloads/sapVirtualInstances/", false); + uri.AppendPath(sapVirtualInstanceName, true); + uri.AppendPath("/databaseInstances/", false); + uri.AppendPath(databaseInstanceName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Gets the SAP Database Instance resource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the Virtual Instances for SAP solutions resource. + /// Database resource name string modeled as parameter for auto generation to work correctly. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task> GetAsync(string subscriptionId, string resourceGroupName, string sapVirtualInstanceName, string databaseInstanceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(sapVirtualInstanceName, nameof(sapVirtualInstanceName)); + Argument.AssertNotNullOrEmpty(databaseInstanceName, nameof(databaseInstanceName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, sapVirtualInstanceName, databaseInstanceName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + SapDatabaseInstanceData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = SapDatabaseInstanceData.DeserializeSapDatabaseInstanceData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((SapDatabaseInstanceData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// Gets the SAP Database Instance resource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the Virtual Instances for SAP solutions resource. + /// Database resource name string modeled as parameter for auto generation to work correctly. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response Get(string subscriptionId, string resourceGroupName, string sapVirtualInstanceName, string databaseInstanceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(sapVirtualInstanceName, nameof(sapVirtualInstanceName)); + Argument.AssertNotNullOrEmpty(databaseInstanceName, nameof(databaseInstanceName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, sapVirtualInstanceName, databaseInstanceName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + SapDatabaseInstanceData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = SapDatabaseInstanceData.DeserializeSapDatabaseInstanceData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((SapDatabaseInstanceData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateCreateRequestUri(string subscriptionId, string resourceGroupName, string sapVirtualInstanceName, string databaseInstanceName, SapDatabaseInstanceData data) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Workloads/sapVirtualInstances/", false); + uri.AppendPath(sapVirtualInstanceName, true); + uri.AppendPath("/databaseInstances/", false); + uri.AppendPath(databaseInstanceName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateCreateRequest(string subscriptionId, string resourceGroupName, string sapVirtualInstanceName, string databaseInstanceName, SapDatabaseInstanceData data) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Put; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Workloads/sapVirtualInstances/", false); + uri.AppendPath(sapVirtualInstanceName, true); + uri.AppendPath("/databaseInstances/", false); + uri.AppendPath(databaseInstanceName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(data, ModelSerializationExtensions.WireOptions); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Creates the Database resource corresponding to the Virtual Instance for SAP solutions resource. <br><br>This will be used by service only. PUT by end user will return a Bad Request error. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the Virtual Instances for SAP solutions resource. + /// Database resource name string modeled as parameter for auto generation to work correctly. + /// Request body of Database resource of a SAP system. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task CreateAsync(string subscriptionId, string resourceGroupName, string sapVirtualInstanceName, string databaseInstanceName, SapDatabaseInstanceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(sapVirtualInstanceName, nameof(sapVirtualInstanceName)); + Argument.AssertNotNullOrEmpty(databaseInstanceName, nameof(databaseInstanceName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateRequest(subscriptionId, resourceGroupName, sapVirtualInstanceName, databaseInstanceName, data); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 201: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Creates the Database resource corresponding to the Virtual Instance for SAP solutions resource. <br><br>This will be used by service only. PUT by end user will return a Bad Request error. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the Virtual Instances for SAP solutions resource. + /// Database resource name string modeled as parameter for auto generation to work correctly. + /// Request body of Database resource of a SAP system. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response Create(string subscriptionId, string resourceGroupName, string sapVirtualInstanceName, string databaseInstanceName, SapDatabaseInstanceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(sapVirtualInstanceName, nameof(sapVirtualInstanceName)); + Argument.AssertNotNullOrEmpty(databaseInstanceName, nameof(databaseInstanceName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateRequest(subscriptionId, resourceGroupName, sapVirtualInstanceName, databaseInstanceName, data); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 201: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateUpdateRequestUri(string subscriptionId, string resourceGroupName, string sapVirtualInstanceName, string databaseInstanceName, SapDatabaseInstancePatch patch) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Workloads/sapVirtualInstances/", false); + uri.AppendPath(sapVirtualInstanceName, true); + uri.AppendPath("/databaseInstances/", false); + uri.AppendPath(databaseInstanceName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceGroupName, string sapVirtualInstanceName, string databaseInstanceName, SapDatabaseInstancePatch patch) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Patch; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Workloads/sapVirtualInstances/", false); + uri.AppendPath(sapVirtualInstanceName, true); + uri.AppendPath("/databaseInstances/", false); + uri.AppendPath(databaseInstanceName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(patch, ModelSerializationExtensions.WireOptions); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Updates the Database resource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the Virtual Instances for SAP solutions resource. + /// Database resource name string modeled as parameter for auto generation to work correctly. + /// Database resource update request body. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task> UpdateAsync(string subscriptionId, string resourceGroupName, string sapVirtualInstanceName, string databaseInstanceName, SapDatabaseInstancePatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(sapVirtualInstanceName, nameof(sapVirtualInstanceName)); + Argument.AssertNotNullOrEmpty(databaseInstanceName, nameof(databaseInstanceName)); + Argument.AssertNotNull(patch, nameof(patch)); + + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, sapVirtualInstanceName, databaseInstanceName, patch); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + SapDatabaseInstanceData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = SapDatabaseInstanceData.DeserializeSapDatabaseInstanceData(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Updates the Database resource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the Virtual Instances for SAP solutions resource. + /// Database resource name string modeled as parameter for auto generation to work correctly. + /// Database resource update request body. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response Update(string subscriptionId, string resourceGroupName, string sapVirtualInstanceName, string databaseInstanceName, SapDatabaseInstancePatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(sapVirtualInstanceName, nameof(sapVirtualInstanceName)); + Argument.AssertNotNullOrEmpty(databaseInstanceName, nameof(databaseInstanceName)); + Argument.AssertNotNull(patch, nameof(patch)); + + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, sapVirtualInstanceName, databaseInstanceName, patch); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + SapDatabaseInstanceData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = SapDatabaseInstanceData.DeserializeSapDatabaseInstanceData(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string resourceGroupName, string sapVirtualInstanceName, string databaseInstanceName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Workloads/sapVirtualInstances/", false); + uri.AppendPath(sapVirtualInstanceName, true); + uri.AppendPath("/databaseInstances/", false); + uri.AppendPath(databaseInstanceName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string sapVirtualInstanceName, string databaseInstanceName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Delete; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Workloads/sapVirtualInstances/", false); + uri.AppendPath(sapVirtualInstanceName, true); + uri.AppendPath("/databaseInstances/", false); + uri.AppendPath(databaseInstanceName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Deletes the Database resource corresponding to a Virtual Instance for SAP solutions resource. <br><br>This will be used by service only. Delete by end user will return a Bad Request error. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the Virtual Instances for SAP solutions resource. + /// Database resource name string modeled as parameter for auto generation to work correctly. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task DeleteAsync(string subscriptionId, string resourceGroupName, string sapVirtualInstanceName, string databaseInstanceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(sapVirtualInstanceName, nameof(sapVirtualInstanceName)); + Argument.AssertNotNullOrEmpty(databaseInstanceName, nameof(databaseInstanceName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, sapVirtualInstanceName, databaseInstanceName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Deletes the Database resource corresponding to a Virtual Instance for SAP solutions resource. <br><br>This will be used by service only. Delete by end user will return a Bad Request error. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the Virtual Instances for SAP solutions resource. + /// Database resource name string modeled as parameter for auto generation to work correctly. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response Delete(string subscriptionId, string resourceGroupName, string sapVirtualInstanceName, string databaseInstanceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(sapVirtualInstanceName, nameof(sapVirtualInstanceName)); + Argument.AssertNotNullOrEmpty(databaseInstanceName, nameof(databaseInstanceName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, sapVirtualInstanceName, databaseInstanceName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListRequestUri(string subscriptionId, string resourceGroupName, string sapVirtualInstanceName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Workloads/sapVirtualInstances/", false); + uri.AppendPath(sapVirtualInstanceName, true); + uri.AppendPath("/databaseInstances", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateListRequest(string subscriptionId, string resourceGroupName, string sapVirtualInstanceName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Workloads/sapVirtualInstances/", false); + uri.AppendPath(sapVirtualInstanceName, true); + uri.AppendPath("/databaseInstances", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Lists the Database resources associated with a Virtual Instance for SAP solutions resource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the Virtual Instances for SAP solutions resource. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> ListAsync(string subscriptionId, string resourceGroupName, string sapVirtualInstanceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(sapVirtualInstanceName, nameof(sapVirtualInstanceName)); + + using var message = CreateListRequest(subscriptionId, resourceGroupName, sapVirtualInstanceName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + SAPDatabaseInstanceListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = SAPDatabaseInstanceListResult.DeserializeSAPDatabaseInstanceListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Lists the Database resources associated with a Virtual Instance for SAP solutions resource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the Virtual Instances for SAP solutions resource. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response List(string subscriptionId, string resourceGroupName, string sapVirtualInstanceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(sapVirtualInstanceName, nameof(sapVirtualInstanceName)); + + using var message = CreateListRequest(subscriptionId, resourceGroupName, sapVirtualInstanceName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + SAPDatabaseInstanceListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = SAPDatabaseInstanceListResult.DeserializeSAPDatabaseInstanceListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateStartRequestUri(string subscriptionId, string resourceGroupName, string sapVirtualInstanceName, string databaseInstanceName, StartContent content) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Workloads/sapVirtualInstances/", false); + uri.AppendPath(sapVirtualInstanceName, true); + uri.AppendPath("/databaseInstances/", false); + uri.AppendPath(databaseInstanceName, true); + uri.AppendPath("/start", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateStartRequest(string subscriptionId, string resourceGroupName, string sapVirtualInstanceName, string databaseInstanceName, StartContent content) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Workloads/sapVirtualInstances/", false); + uri.AppendPath(sapVirtualInstanceName, true); + uri.AppendPath("/databaseInstances/", false); + uri.AppendPath(databaseInstanceName, true); + uri.AppendPath("/start", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + if (content != null) + { + request.Headers.Add("Content-Type", "application/json"); + var content0 = new Utf8JsonRequestContent(); + content0.JsonWriter.WriteObjectValue(content, ModelSerializationExtensions.WireOptions); + request.Content = content0; + } + _userAgent.Apply(message); + return message; + } + + /// Starts the database instance of the SAP system. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the Virtual Instances for SAP solutions resource. + /// Database resource name string modeled as parameter for auto generation to work correctly. + /// SAP Database server instance start request body. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task StartAsync(string subscriptionId, string resourceGroupName, string sapVirtualInstanceName, string databaseInstanceName, StartContent content = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(sapVirtualInstanceName, nameof(sapVirtualInstanceName)); + Argument.AssertNotNullOrEmpty(databaseInstanceName, nameof(databaseInstanceName)); + + using var message = CreateStartRequest(subscriptionId, resourceGroupName, sapVirtualInstanceName, databaseInstanceName, content); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 202: + case 200: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Starts the database instance of the SAP system. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the Virtual Instances for SAP solutions resource. + /// Database resource name string modeled as parameter for auto generation to work correctly. + /// SAP Database server instance start request body. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response Start(string subscriptionId, string resourceGroupName, string sapVirtualInstanceName, string databaseInstanceName, StartContent content = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(sapVirtualInstanceName, nameof(sapVirtualInstanceName)); + Argument.AssertNotNullOrEmpty(databaseInstanceName, nameof(databaseInstanceName)); + + using var message = CreateStartRequest(subscriptionId, resourceGroupName, sapVirtualInstanceName, databaseInstanceName, content); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 202: + case 200: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateStopRequestUri(string subscriptionId, string resourceGroupName, string sapVirtualInstanceName, string databaseInstanceName, StopContent content) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Workloads/sapVirtualInstances/", false); + uri.AppendPath(sapVirtualInstanceName, true); + uri.AppendPath("/databaseInstances/", false); + uri.AppendPath(databaseInstanceName, true); + uri.AppendPath("/stop", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateStopRequest(string subscriptionId, string resourceGroupName, string sapVirtualInstanceName, string databaseInstanceName, StopContent content) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Workloads/sapVirtualInstances/", false); + uri.AppendPath(sapVirtualInstanceName, true); + uri.AppendPath("/databaseInstances/", false); + uri.AppendPath(databaseInstanceName, true); + uri.AppendPath("/stop", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + if (content != null) + { + request.Headers.Add("Content-Type", "application/json"); + var content0 = new Utf8JsonRequestContent(); + content0.JsonWriter.WriteObjectValue(content, ModelSerializationExtensions.WireOptions); + request.Content = content0; + } + _userAgent.Apply(message); + return message; + } + + /// Stops the database instance of the SAP system. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the Virtual Instances for SAP solutions resource. + /// Database resource name string modeled as parameter for auto generation to work correctly. + /// Stop request for the database instance of the SAP system. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task StopAsync(string subscriptionId, string resourceGroupName, string sapVirtualInstanceName, string databaseInstanceName, StopContent content = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(sapVirtualInstanceName, nameof(sapVirtualInstanceName)); + Argument.AssertNotNullOrEmpty(databaseInstanceName, nameof(databaseInstanceName)); + + using var message = CreateStopRequest(subscriptionId, resourceGroupName, sapVirtualInstanceName, databaseInstanceName, content); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 202: + case 200: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Stops the database instance of the SAP system. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the Virtual Instances for SAP solutions resource. + /// Database resource name string modeled as parameter for auto generation to work correctly. + /// Stop request for the database instance of the SAP system. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response Stop(string subscriptionId, string resourceGroupName, string sapVirtualInstanceName, string databaseInstanceName, StopContent content = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(sapVirtualInstanceName, nameof(sapVirtualInstanceName)); + Argument.AssertNotNullOrEmpty(databaseInstanceName, nameof(databaseInstanceName)); + + using var message = CreateStopRequest(subscriptionId, resourceGroupName, sapVirtualInstanceName, databaseInstanceName, content); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 202: + case 200: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string sapVirtualInstanceName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateListNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string sapVirtualInstanceName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Lists the Database resources associated with a Virtual Instance for SAP solutions resource. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the Virtual Instances for SAP solutions resource. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> ListNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string sapVirtualInstanceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(sapVirtualInstanceName, nameof(sapVirtualInstanceName)); + + using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, sapVirtualInstanceName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + SAPDatabaseInstanceListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = SAPDatabaseInstanceListResult.DeserializeSAPDatabaseInstanceListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Lists the Database resources associated with a Virtual Instance for SAP solutions resource. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the Virtual Instances for SAP solutions resource. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response ListNextPage(string nextLink, string subscriptionId, string resourceGroupName, string sapVirtualInstanceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(sapVirtualInstanceName, nameof(sapVirtualInstanceName)); + + using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, sapVirtualInstanceName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + SAPDatabaseInstanceListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = SAPDatabaseInstanceListResult.DeserializeSAPDatabaseInstanceListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/RestOperations/SapVirtualInstancesRestOperations.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/RestOperations/SapVirtualInstancesRestOperations.cs new file mode 100644 index 000000000000..6a8830126e7f --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/RestOperations/SapVirtualInstancesRestOperations.cs @@ -0,0 +1,1281 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.SapVirtualInstances.Models; + +namespace Azure.ResourceManager.SapVirtualInstances +{ + internal partial class SapVirtualInstancesRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of SapVirtualInstancesRestOperations. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// The application id to use for user agent. + /// Service host. + /// The API version to use for this operation. + /// or is null. + public SapVirtualInstancesRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + { + _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); + _endpoint = endpoint ?? new Uri("https://management.azure.com"); + _apiVersion = apiVersion ?? "2024-09-01"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string sapVirtualInstanceName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Workloads/sapVirtualInstances/", false); + uri.AppendPath(sapVirtualInstanceName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string sapVirtualInstanceName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Workloads/sapVirtualInstances/", false); + uri.AppendPath(sapVirtualInstanceName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Gets a Virtual Instance for SAP solutions resource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the Virtual Instances for SAP solutions resource. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> GetAsync(string subscriptionId, string resourceGroupName, string sapVirtualInstanceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(sapVirtualInstanceName, nameof(sapVirtualInstanceName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, sapVirtualInstanceName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + SapVirtualInstanceData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = SapVirtualInstanceData.DeserializeSapVirtualInstanceData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((SapVirtualInstanceData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// Gets a Virtual Instance for SAP solutions resource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the Virtual Instances for SAP solutions resource. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response Get(string subscriptionId, string resourceGroupName, string sapVirtualInstanceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(sapVirtualInstanceName, nameof(sapVirtualInstanceName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, sapVirtualInstanceName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + SapVirtualInstanceData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = SapVirtualInstanceData.DeserializeSapVirtualInstanceData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((SapVirtualInstanceData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateCreateRequestUri(string subscriptionId, string resourceGroupName, string sapVirtualInstanceName, SapVirtualInstanceData data) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Workloads/sapVirtualInstances/", false); + uri.AppendPath(sapVirtualInstanceName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateCreateRequest(string subscriptionId, string resourceGroupName, string sapVirtualInstanceName, SapVirtualInstanceData data) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Put; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Workloads/sapVirtualInstances/", false); + uri.AppendPath(sapVirtualInstanceName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(data, ModelSerializationExtensions.WireOptions); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Creates a Virtual Instance for SAP solutions (VIS) resource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the Virtual Instances for SAP solutions resource. + /// Virtual Instance for SAP solutions resource request body. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task CreateAsync(string subscriptionId, string resourceGroupName, string sapVirtualInstanceName, SapVirtualInstanceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(sapVirtualInstanceName, nameof(sapVirtualInstanceName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateRequest(subscriptionId, resourceGroupName, sapVirtualInstanceName, data); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 201: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Creates a Virtual Instance for SAP solutions (VIS) resource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the Virtual Instances for SAP solutions resource. + /// Virtual Instance for SAP solutions resource request body. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response Create(string subscriptionId, string resourceGroupName, string sapVirtualInstanceName, SapVirtualInstanceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(sapVirtualInstanceName, nameof(sapVirtualInstanceName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateRequest(subscriptionId, resourceGroupName, sapVirtualInstanceName, data); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 201: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateUpdateRequestUri(string subscriptionId, string resourceGroupName, string sapVirtualInstanceName, SapVirtualInstancePatch patch) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Workloads/sapVirtualInstances/", false); + uri.AppendPath(sapVirtualInstanceName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceGroupName, string sapVirtualInstanceName, SapVirtualInstancePatch patch) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Patch; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Workloads/sapVirtualInstances/", false); + uri.AppendPath(sapVirtualInstanceName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(patch, ModelSerializationExtensions.WireOptions); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Updates a Virtual Instance for SAP solutions resource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the Virtual Instances for SAP solutions resource. + /// Request body to update a Virtual Instance for SAP solutions resource. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task UpdateAsync(string subscriptionId, string resourceGroupName, string sapVirtualInstanceName, SapVirtualInstancePatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(sapVirtualInstanceName, nameof(sapVirtualInstanceName)); + Argument.AssertNotNull(patch, nameof(patch)); + + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, sapVirtualInstanceName, patch); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Updates a Virtual Instance for SAP solutions resource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the Virtual Instances for SAP solutions resource. + /// Request body to update a Virtual Instance for SAP solutions resource. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response Update(string subscriptionId, string resourceGroupName, string sapVirtualInstanceName, SapVirtualInstancePatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(sapVirtualInstanceName, nameof(sapVirtualInstanceName)); + Argument.AssertNotNull(patch, nameof(patch)); + + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, sapVirtualInstanceName, patch); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string resourceGroupName, string sapVirtualInstanceName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Workloads/sapVirtualInstances/", false); + uri.AppendPath(sapVirtualInstanceName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string sapVirtualInstanceName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Delete; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Workloads/sapVirtualInstances/", false); + uri.AppendPath(sapVirtualInstanceName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Deletes a Virtual Instance for SAP solutions resource and its child resources, that is the associated Central Services Instance, Application Server Instances and Database Instance. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the Virtual Instances for SAP solutions resource. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task DeleteAsync(string subscriptionId, string resourceGroupName, string sapVirtualInstanceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(sapVirtualInstanceName, nameof(sapVirtualInstanceName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, sapVirtualInstanceName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Deletes a Virtual Instance for SAP solutions resource and its child resources, that is the associated Central Services Instance, Application Server Instances and Database Instance. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the Virtual Instances for SAP solutions resource. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response Delete(string subscriptionId, string resourceGroupName, string sapVirtualInstanceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(sapVirtualInstanceName, nameof(sapVirtualInstanceName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, sapVirtualInstanceName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListByResourceGroupRequestUri(string subscriptionId, string resourceGroupName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Workloads/sapVirtualInstances", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateListByResourceGroupRequest(string subscriptionId, string resourceGroupName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Workloads/sapVirtualInstances", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Gets all Virtual Instances for SAP solutions resources in a Resource Group. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + public async Task> ListByResourceGroupAsync(string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + + using var message = CreateListByResourceGroupRequest(subscriptionId, resourceGroupName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + SAPVirtualInstanceListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = SAPVirtualInstanceListResult.DeserializeSAPVirtualInstanceListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Gets all Virtual Instances for SAP solutions resources in a Resource Group. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + public Response ListByResourceGroup(string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + + using var message = CreateListByResourceGroupRequest(subscriptionId, resourceGroupName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + SAPVirtualInstanceListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = SAPVirtualInstanceListResult.DeserializeSAPVirtualInstanceListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListBySubscriptionRequestUri(string subscriptionId) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/providers/Microsoft.Workloads/sapVirtualInstances", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateListBySubscriptionRequest(string subscriptionId) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/providers/Microsoft.Workloads/sapVirtualInstances", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Gets all Virtual Instances for SAP solutions resources in a Subscription. + /// The ID of the target subscription. The value must be an UUID. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + public async Task> ListBySubscriptionAsync(string subscriptionId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + + using var message = CreateListBySubscriptionRequest(subscriptionId); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + SAPVirtualInstanceListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = SAPVirtualInstanceListResult.DeserializeSAPVirtualInstanceListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Gets all Virtual Instances for SAP solutions resources in a Subscription. + /// The ID of the target subscription. The value must be an UUID. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + public Response ListBySubscription(string subscriptionId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + + using var message = CreateListBySubscriptionRequest(subscriptionId); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + SAPVirtualInstanceListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = SAPVirtualInstanceListResult.DeserializeSAPVirtualInstanceListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateStartRequestUri(string subscriptionId, string resourceGroupName, string sapVirtualInstanceName, StartContent content) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Workloads/sapVirtualInstances/", false); + uri.AppendPath(sapVirtualInstanceName, true); + uri.AppendPath("/start", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateStartRequest(string subscriptionId, string resourceGroupName, string sapVirtualInstanceName, StartContent content) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Workloads/sapVirtualInstances/", false); + uri.AppendPath(sapVirtualInstanceName, true); + uri.AppendPath("/start", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + if (content != null) + { + request.Headers.Add("Content-Type", "application/json"); + var content0 = new Utf8JsonRequestContent(); + content0.JsonWriter.WriteObjectValue(content, ModelSerializationExtensions.WireOptions); + request.Content = content0; + } + _userAgent.Apply(message); + return message; + } + + /// Starts the SAP application, that is the Central Services instance and Application server instances. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the Virtual Instances for SAP solutions resource. + /// The Virtual Instance for SAP solutions resource start request body. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task StartAsync(string subscriptionId, string resourceGroupName, string sapVirtualInstanceName, StartContent content = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(sapVirtualInstanceName, nameof(sapVirtualInstanceName)); + + using var message = CreateStartRequest(subscriptionId, resourceGroupName, sapVirtualInstanceName, content); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 202: + case 200: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Starts the SAP application, that is the Central Services instance and Application server instances. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the Virtual Instances for SAP solutions resource. + /// The Virtual Instance for SAP solutions resource start request body. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response Start(string subscriptionId, string resourceGroupName, string sapVirtualInstanceName, StartContent content = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(sapVirtualInstanceName, nameof(sapVirtualInstanceName)); + + using var message = CreateStartRequest(subscriptionId, resourceGroupName, sapVirtualInstanceName, content); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 202: + case 200: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateStopRequestUri(string subscriptionId, string resourceGroupName, string sapVirtualInstanceName, StopContent content) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Workloads/sapVirtualInstances/", false); + uri.AppendPath(sapVirtualInstanceName, true); + uri.AppendPath("/stop", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateStopRequest(string subscriptionId, string resourceGroupName, string sapVirtualInstanceName, StopContent content) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Workloads/sapVirtualInstances/", false); + uri.AppendPath(sapVirtualInstanceName, true); + uri.AppendPath("/stop", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + if (content != null) + { + request.Headers.Add("Content-Type", "application/json"); + var content0 = new Utf8JsonRequestContent(); + content0.JsonWriter.WriteObjectValue(content, ModelSerializationExtensions.WireOptions); + request.Content = content0; + } + _userAgent.Apply(message); + return message; + } + + /// Stops the SAP Application, that is the Application server instances and Central Services instance. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the Virtual Instances for SAP solutions resource. + /// The Virtual Instance for SAP solutions resource stop request body. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task StopAsync(string subscriptionId, string resourceGroupName, string sapVirtualInstanceName, StopContent content = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(sapVirtualInstanceName, nameof(sapVirtualInstanceName)); + + using var message = CreateStopRequest(subscriptionId, resourceGroupName, sapVirtualInstanceName, content); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 202: + case 200: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Stops the SAP Application, that is the Application server instances and Central Services instance. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the Virtual Instances for SAP solutions resource. + /// The Virtual Instance for SAP solutions resource stop request body. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response Stop(string subscriptionId, string resourceGroupName, string sapVirtualInstanceName, StopContent content = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(sapVirtualInstanceName, nameof(sapVirtualInstanceName)); + + using var message = CreateStopRequest(subscriptionId, resourceGroupName, sapVirtualInstanceName, content); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 202: + case 200: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateGetSizingRecommendationsRequestUri(string subscriptionId, AzureLocation location, SapSizingRecommendationContent content) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/providers/Microsoft.Workloads/locations/", false); + uri.AppendPath(location, true); + uri.AppendPath("/sapVirtualInstanceMetadata/default/getSizingRecommendations", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetSizingRecommendationsRequest(string subscriptionId, AzureLocation location, SapSizingRecommendationContent content) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/providers/Microsoft.Workloads/locations/", false); + uri.AppendPath(location, true); + uri.AppendPath("/sapVirtualInstanceMetadata/default/getSizingRecommendations", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content0 = new Utf8JsonRequestContent(); + content0.JsonWriter.WriteObjectValue(content, ModelSerializationExtensions.WireOptions); + request.Content = content0; + _userAgent.Apply(message); + return message; + } + + /// Gets the sizing recommendations. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the Azure region. + /// The content of the action request. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + public async Task> GetSizingRecommendationsAsync(string subscriptionId, AzureLocation location, SapSizingRecommendationContent content, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNull(content, nameof(content)); + + using var message = CreateGetSizingRecommendationsRequest(subscriptionId, location, content); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + SapSizingRecommendationResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = SapSizingRecommendationResult.DeserializeSapSizingRecommendationResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Gets the sizing recommendations. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the Azure region. + /// The content of the action request. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + public Response GetSizingRecommendations(string subscriptionId, AzureLocation location, SapSizingRecommendationContent content, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNull(content, nameof(content)); + + using var message = CreateGetSizingRecommendationsRequest(subscriptionId, location, content); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + SapSizingRecommendationResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = SapSizingRecommendationResult.DeserializeSapSizingRecommendationResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateGetSapSupportedSkuRequestUri(string subscriptionId, AzureLocation location, SapSupportedSkusContent content) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/providers/Microsoft.Workloads/locations/", false); + uri.AppendPath(location, true); + uri.AppendPath("/sapVirtualInstanceMetadata/default/getSapSupportedSku", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetSapSupportedSkuRequest(string subscriptionId, AzureLocation location, SapSupportedSkusContent content) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/providers/Microsoft.Workloads/locations/", false); + uri.AppendPath(location, true); + uri.AppendPath("/sapVirtualInstanceMetadata/default/getSapSupportedSku", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content0 = new Utf8JsonRequestContent(); + content0.JsonWriter.WriteObjectValue(content, ModelSerializationExtensions.WireOptions); + request.Content = content0; + _userAgent.Apply(message); + return message; + } + + /// Get a list of SAP supported SKUs for ASCS, Application and Database tier. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the Azure region. + /// The content of the action request. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + public async Task> GetSapSupportedSkuAsync(string subscriptionId, AzureLocation location, SapSupportedSkusContent content, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNull(content, nameof(content)); + + using var message = CreateGetSapSupportedSkuRequest(subscriptionId, location, content); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + SapSupportedResourceSkusResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = SapSupportedResourceSkusResult.DeserializeSapSupportedResourceSkusResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Get a list of SAP supported SKUs for ASCS, Application and Database tier. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the Azure region. + /// The content of the action request. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + public Response GetSapSupportedSku(string subscriptionId, AzureLocation location, SapSupportedSkusContent content, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNull(content, nameof(content)); + + using var message = CreateGetSapSupportedSkuRequest(subscriptionId, location, content); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + SapSupportedResourceSkusResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = SapSupportedResourceSkusResult.DeserializeSapSupportedResourceSkusResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateGetDiskConfigurationsRequestUri(string subscriptionId, AzureLocation location, SapDiskConfigurationsContent content) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/providers/Microsoft.Workloads/locations/", false); + uri.AppendPath(location, true); + uri.AppendPath("/sapVirtualInstanceMetadata/default/getDiskConfigurations", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetDiskConfigurationsRequest(string subscriptionId, AzureLocation location, SapDiskConfigurationsContent content) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/providers/Microsoft.Workloads/locations/", false); + uri.AppendPath(location, true); + uri.AppendPath("/sapVirtualInstanceMetadata/default/getDiskConfigurations", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content0 = new Utf8JsonRequestContent(); + content0.JsonWriter.WriteObjectValue(content, ModelSerializationExtensions.WireOptions); + request.Content = content0; + _userAgent.Apply(message); + return message; + } + + /// Get the SAP Disk Configuration Layout prod/non-prod SAP System. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the Azure region. + /// The content of the action request. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + public async Task> GetDiskConfigurationsAsync(string subscriptionId, AzureLocation location, SapDiskConfigurationsContent content, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNull(content, nameof(content)); + + using var message = CreateGetDiskConfigurationsRequest(subscriptionId, location, content); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + SapDiskConfigurationsResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = SapDiskConfigurationsResult.DeserializeSapDiskConfigurationsResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Get the SAP Disk Configuration Layout prod/non-prod SAP System. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the Azure region. + /// The content of the action request. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + public Response GetDiskConfigurations(string subscriptionId, AzureLocation location, SapDiskConfigurationsContent content, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNull(content, nameof(content)); + + using var message = CreateGetDiskConfigurationsRequest(subscriptionId, location, content); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + SapDiskConfigurationsResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = SapDiskConfigurationsResult.DeserializeSapDiskConfigurationsResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateGetAvailabilityZoneDetailsRequestUri(string subscriptionId, AzureLocation location, SapAvailabilityZoneDetailsContent content) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/providers/Microsoft.Workloads/locations/", false); + uri.AppendPath(location, true); + uri.AppendPath("/sapVirtualInstanceMetadata/default/getAvailabilityZoneDetails", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetAvailabilityZoneDetailsRequest(string subscriptionId, AzureLocation location, SapAvailabilityZoneDetailsContent content) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/providers/Microsoft.Workloads/locations/", false); + uri.AppendPath(location, true); + uri.AppendPath("/sapVirtualInstanceMetadata/default/getAvailabilityZoneDetails", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content0 = new Utf8JsonRequestContent(); + content0.JsonWriter.WriteObjectValue(content, ModelSerializationExtensions.WireOptions); + request.Content = content0; + _userAgent.Apply(message); + return message; + } + + /// Get the recommended SAP Availability Zone Pair Details for your region. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the Azure region. + /// The content of the action request. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + public async Task> GetAvailabilityZoneDetailsAsync(string subscriptionId, AzureLocation location, SapAvailabilityZoneDetailsContent content, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNull(content, nameof(content)); + + using var message = CreateGetAvailabilityZoneDetailsRequest(subscriptionId, location, content); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + SapAvailabilityZoneDetailsResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = SapAvailabilityZoneDetailsResult.DeserializeSapAvailabilityZoneDetailsResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Get the recommended SAP Availability Zone Pair Details for your region. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the Azure region. + /// The content of the action request. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + public Response GetAvailabilityZoneDetails(string subscriptionId, AzureLocation location, SapAvailabilityZoneDetailsContent content, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNull(content, nameof(content)); + + using var message = CreateGetAvailabilityZoneDetailsRequest(subscriptionId, location, content); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + SapAvailabilityZoneDetailsResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = SapAvailabilityZoneDetailsResult.DeserializeSapAvailabilityZoneDetailsResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListByResourceGroupNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateListByResourceGroupNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Gets all Virtual Instances for SAP solutions resources in a Resource Group. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The cancellation token to use. + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + public async Task> ListByResourceGroupNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + + using var message = CreateListByResourceGroupNextPageRequest(nextLink, subscriptionId, resourceGroupName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + SAPVirtualInstanceListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = SAPVirtualInstanceListResult.DeserializeSAPVirtualInstanceListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Gets all Virtual Instances for SAP solutions resources in a Resource Group. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The cancellation token to use. + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + public Response ListByResourceGroupNextPage(string nextLink, string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + + using var message = CreateListByResourceGroupNextPageRequest(nextLink, subscriptionId, resourceGroupName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + SAPVirtualInstanceListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = SAPVirtualInstanceListResult.DeserializeSAPVirtualInstanceListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListBySubscriptionNextPageRequestUri(string nextLink, string subscriptionId) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateListBySubscriptionNextPageRequest(string nextLink, string subscriptionId) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Gets all Virtual Instances for SAP solutions resources in a Subscription. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + public async Task> ListBySubscriptionNextPageAsync(string nextLink, string subscriptionId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + + using var message = CreateListBySubscriptionNextPageRequest(nextLink, subscriptionId); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + SAPVirtualInstanceListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = SAPVirtualInstanceListResult.DeserializeSAPVirtualInstanceListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Gets all Virtual Instances for SAP solutions resources in a Subscription. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + public Response ListBySubscriptionNextPage(string nextLink, string subscriptionId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + + using var message = CreateListBySubscriptionNextPageRequest(nextLink, subscriptionId); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + SAPVirtualInstanceListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = SAPVirtualInstanceListResult.DeserializeSAPVirtualInstanceListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/SapApplicationServerInstanceCollection.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/SapApplicationServerInstanceCollection.cs new file mode 100644 index 000000000000..ce15a8b6e1d0 --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/SapApplicationServerInstanceCollection.cs @@ -0,0 +1,493 @@ +// 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.SapVirtualInstances +{ + /// + /// 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 GetSapApplicationServerInstances method from an instance of . + /// + public partial class SapApplicationServerInstanceCollection : ArmCollection, IEnumerable, IAsyncEnumerable + { + private readonly ClientDiagnostics _sapApplicationServerInstanceClientDiagnostics; + private readonly SapApplicationServerInstancesRestOperations _sapApplicationServerInstanceRestClient; + + /// Initializes a new instance of the class for mocking. + protected SapApplicationServerInstanceCollection() + { + } + + /// 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 SapApplicationServerInstanceCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _sapApplicationServerInstanceClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.SapVirtualInstances", SapApplicationServerInstanceResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(SapApplicationServerInstanceResource.ResourceType, out string sapApplicationServerInstanceApiVersion); + _sapApplicationServerInstanceRestClient = new SapApplicationServerInstancesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, sapApplicationServerInstanceApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != SapVirtualInstanceResource.ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, SapVirtualInstanceResource.ResourceType), nameof(id)); + } + + /// + /// Puts the SAP Application Server Instance resource. <br><br>This will be used by service only. PUT by end user will return a Bad Request error. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName}/applicationInstances/{applicationInstanceName} + /// + /// + /// Operation Id + /// SAPApplicationServerInstance_Create + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The name of SAP Application Server instance resource. + /// The SAP Application Server Instance resource request body. + /// 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 applicationInstanceName, SapApplicationServerInstanceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(applicationInstanceName, nameof(applicationInstanceName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _sapApplicationServerInstanceClientDiagnostics.CreateScope("SapApplicationServerInstanceCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = await _sapApplicationServerInstanceRestClient.CreateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, applicationInstanceName, data, cancellationToken).ConfigureAwait(false); + var operation = new SapVirtualInstancesArmOperation(new SapApplicationServerInstanceOperationSource(Client), _sapApplicationServerInstanceClientDiagnostics, Pipeline, _sapApplicationServerInstanceRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, applicationInstanceName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Puts the SAP Application Server Instance resource. <br><br>This will be used by service only. PUT by end user will return a Bad Request error. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName}/applicationInstances/{applicationInstanceName} + /// + /// + /// Operation Id + /// SAPApplicationServerInstance_Create + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The name of SAP Application Server instance resource. + /// The SAP Application Server Instance resource request body. + /// 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 applicationInstanceName, SapApplicationServerInstanceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(applicationInstanceName, nameof(applicationInstanceName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _sapApplicationServerInstanceClientDiagnostics.CreateScope("SapApplicationServerInstanceCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = _sapApplicationServerInstanceRestClient.Create(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, applicationInstanceName, data, cancellationToken); + var operation = new SapVirtualInstancesArmOperation(new SapApplicationServerInstanceOperationSource(Client), _sapApplicationServerInstanceClientDiagnostics, Pipeline, _sapApplicationServerInstanceRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, applicationInstanceName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets the SAP Application Server Instance corresponding to the Virtual Instance for SAP solutions resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName}/applicationInstances/{applicationInstanceName} + /// + /// + /// Operation Id + /// SAPApplicationServerInstance_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of SAP Application Server instance 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 applicationInstanceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(applicationInstanceName, nameof(applicationInstanceName)); + + using var scope = _sapApplicationServerInstanceClientDiagnostics.CreateScope("SapApplicationServerInstanceCollection.Get"); + scope.Start(); + try + { + var response = await _sapApplicationServerInstanceRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, applicationInstanceName, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new SapApplicationServerInstanceResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets the SAP Application Server Instance corresponding to the Virtual Instance for SAP solutions resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName}/applicationInstances/{applicationInstanceName} + /// + /// + /// Operation Id + /// SAPApplicationServerInstance_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of SAP Application Server instance resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Get(string applicationInstanceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(applicationInstanceName, nameof(applicationInstanceName)); + + using var scope = _sapApplicationServerInstanceClientDiagnostics.CreateScope("SapApplicationServerInstanceCollection.Get"); + scope.Start(); + try + { + var response = _sapApplicationServerInstanceRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, applicationInstanceName, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new SapApplicationServerInstanceResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Lists the SAP Application Server Instance resources for a given Virtual Instance for SAP solutions resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName}/applicationInstances + /// + /// + /// Operation Id + /// SAPApplicationServerInstance_List + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// 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) => _sapApplicationServerInstanceRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _sapApplicationServerInstanceRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new SapApplicationServerInstanceResource(Client, SapApplicationServerInstanceData.DeserializeSapApplicationServerInstanceData(e)), _sapApplicationServerInstanceClientDiagnostics, Pipeline, "SapApplicationServerInstanceCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Lists the SAP Application Server Instance resources for a given Virtual Instance for SAP solutions resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName}/applicationInstances + /// + /// + /// Operation Id + /// SAPApplicationServerInstance_List + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// 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) => _sapApplicationServerInstanceRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _sapApplicationServerInstanceRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new SapApplicationServerInstanceResource(Client, SapApplicationServerInstanceData.DeserializeSapApplicationServerInstanceData(e)), _sapApplicationServerInstanceClientDiagnostics, Pipeline, "SapApplicationServerInstanceCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName}/applicationInstances/{applicationInstanceName} + /// + /// + /// Operation Id + /// SAPApplicationServerInstance_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of SAP Application Server instance 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 applicationInstanceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(applicationInstanceName, nameof(applicationInstanceName)); + + using var scope = _sapApplicationServerInstanceClientDiagnostics.CreateScope("SapApplicationServerInstanceCollection.Exists"); + scope.Start(); + try + { + var response = await _sapApplicationServerInstanceRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, applicationInstanceName, 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.Workloads/sapVirtualInstances/{sapVirtualInstanceName}/applicationInstances/{applicationInstanceName} + /// + /// + /// Operation Id + /// SAPApplicationServerInstance_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of SAP Application Server instance resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Exists(string applicationInstanceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(applicationInstanceName, nameof(applicationInstanceName)); + + using var scope = _sapApplicationServerInstanceClientDiagnostics.CreateScope("SapApplicationServerInstanceCollection.Exists"); + scope.Start(); + try + { + var response = _sapApplicationServerInstanceRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, applicationInstanceName, 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.Workloads/sapVirtualInstances/{sapVirtualInstanceName}/applicationInstances/{applicationInstanceName} + /// + /// + /// Operation Id + /// SAPApplicationServerInstance_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of SAP Application Server instance 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 applicationInstanceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(applicationInstanceName, nameof(applicationInstanceName)); + + using var scope = _sapApplicationServerInstanceClientDiagnostics.CreateScope("SapApplicationServerInstanceCollection.GetIfExists"); + scope.Start(); + try + { + var response = await _sapApplicationServerInstanceRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, applicationInstanceName, cancellationToken: cancellationToken).ConfigureAwait(false); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new SapApplicationServerInstanceResource(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.Workloads/sapVirtualInstances/{sapVirtualInstanceName}/applicationInstances/{applicationInstanceName} + /// + /// + /// Operation Id + /// SAPApplicationServerInstance_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of SAP Application Server instance resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual NullableResponse GetIfExists(string applicationInstanceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(applicationInstanceName, nameof(applicationInstanceName)); + + using var scope = _sapApplicationServerInstanceClientDiagnostics.CreateScope("SapApplicationServerInstanceCollection.GetIfExists"); + scope.Start(); + try + { + var response = _sapApplicationServerInstanceRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, applicationInstanceName, cancellationToken: cancellationToken); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new SapApplicationServerInstanceResource(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/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/SapApplicationServerInstanceData.Serialization.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/SapApplicationServerInstanceData.Serialization.cs new file mode 100644 index 000000000000..878eb1629965 --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/SapApplicationServerInstanceData.Serialization.cs @@ -0,0 +1,178 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.Models; +using Azure.ResourceManager.SapVirtualInstances.Models; + +namespace Azure.ResourceManager.SapVirtualInstances +{ + public partial class SapApplicationServerInstanceData : 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(SapApplicationServerInstanceData)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (Optional.IsDefined(Properties)) + { + writer.WritePropertyName("properties"u8); + writer.WriteObjectValue(Properties, options); + } + } + + SapApplicationServerInstanceData 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(SapApplicationServerInstanceData)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeSapApplicationServerInstanceData(document.RootElement, options); + } + + internal static SapApplicationServerInstanceData DeserializeSapApplicationServerInstanceData(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + SapApplicationServerProperties properties = 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 = SapApplicationServerProperties.DeserializeSapApplicationServerProperties(property.Value, options); + 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 SapApplicationServerInstanceData( + id, + name, + type, + systemData, + tags ?? new ChangeTrackingDictionary(), + location, + 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(SapApplicationServerInstanceData)} does not support writing '{options.Format}' format."); + } + } + + SapApplicationServerInstanceData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeSapApplicationServerInstanceData(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(SapApplicationServerInstanceData)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/SapApplicationServerInstanceData.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/SapApplicationServerInstanceData.cs new file mode 100644 index 000000000000..cbf2c3802f58 --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/SapApplicationServerInstanceData.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.Models; +using Azure.ResourceManager.SapVirtualInstances.Models; + +namespace Azure.ResourceManager.SapVirtualInstances +{ + /// + /// A class representing the SapApplicationServerInstance data model. + /// Define the SAP Application Server Instance resource. + /// + public partial class SapApplicationServerInstanceData : 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 SapApplicationServerInstanceData(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. + /// Keeps track of any properties unknown to the library. + internal SapApplicationServerInstanceData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, SapApplicationServerProperties properties, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) + { + Properties = properties; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal SapApplicationServerInstanceData() + { + } + + /// The resource-specific properties for this resource. + public SapApplicationServerProperties Properties { get; set; } + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/SapApplicationServerInstanceResource.Serialization.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/SapApplicationServerInstanceResource.Serialization.cs new file mode 100644 index 000000000000..8949a7b78c7b --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/SapApplicationServerInstanceResource.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.SapVirtualInstances +{ + public partial class SapApplicationServerInstanceResource : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); + + SapApplicationServerInstanceData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options); + + SapApplicationServerInstanceData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options); + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/SapApplicationServerInstanceResource.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/SapApplicationServerInstanceResource.cs new file mode 100644 index 000000000000..09a7cb6fbf68 --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/SapApplicationServerInstanceResource.cs @@ -0,0 +1,871 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.SapVirtualInstances.Models; + +namespace Azure.ResourceManager.SapVirtualInstances +{ + /// + /// A Class representing a SapApplicationServerInstance 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 GetSapApplicationServerInstanceResource method. + /// Otherwise you can get one from its parent resource using the GetSapApplicationServerInstance method. + /// + public partial class SapApplicationServerInstanceResource : ArmResource + { + /// Generate the resource identifier of a instance. + /// The subscriptionId. + /// The resourceGroupName. + /// The sapVirtualInstanceName. + /// The applicationInstanceName. + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string sapVirtualInstanceName, string applicationInstanceName) + { + var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName}/applicationInstances/{applicationInstanceName}"; + return new ResourceIdentifier(resourceId); + } + + private readonly ClientDiagnostics _sapApplicationServerInstanceClientDiagnostics; + private readonly SapApplicationServerInstancesRestOperations _sapApplicationServerInstanceRestClient; + private readonly SapApplicationServerInstanceData _data; + + /// Gets the resource type for the operations. + public static readonly ResourceType ResourceType = "Microsoft.Workloads/sapVirtualInstances/applicationInstances"; + + /// Initializes a new instance of the class for mocking. + protected SapApplicationServerInstanceResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal SapApplicationServerInstanceResource(ArmClient client, SapApplicationServerInstanceData 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 SapApplicationServerInstanceResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _sapApplicationServerInstanceClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.SapVirtualInstances", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string sapApplicationServerInstanceApiVersion); + _sapApplicationServerInstanceRestClient = new SapApplicationServerInstancesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, sapApplicationServerInstanceApiVersion); +#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 SapApplicationServerInstanceData 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)); + } + + /// + /// Gets the SAP Application Server Instance corresponding to the Virtual Instance for SAP solutions resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName}/applicationInstances/{applicationInstanceName} + /// + /// + /// Operation Id + /// SAPApplicationServerInstance_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _sapApplicationServerInstanceClientDiagnostics.CreateScope("SapApplicationServerInstanceResource.Get"); + scope.Start(); + try + { + var response = await _sapApplicationServerInstanceRestClient.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 SapApplicationServerInstanceResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets the SAP Application Server Instance corresponding to the Virtual Instance for SAP solutions resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName}/applicationInstances/{applicationInstanceName} + /// + /// + /// Operation Id + /// SAPApplicationServerInstance_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _sapApplicationServerInstanceClientDiagnostics.CreateScope("SapApplicationServerInstanceResource.Get"); + scope.Start(); + try + { + var response = _sapApplicationServerInstanceRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new SapApplicationServerInstanceResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Deletes the SAP Application Server Instance resource. <br><br>This operation will be used by service only. Delete by end user will return a Bad Request error. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName}/applicationInstances/{applicationInstanceName} + /// + /// + /// Operation Id + /// SAPApplicationServerInstance_Delete + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// 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 = _sapApplicationServerInstanceClientDiagnostics.CreateScope("SapApplicationServerInstanceResource.Delete"); + scope.Start(); + try + { + var response = await _sapApplicationServerInstanceRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + var operation = new SapVirtualInstancesArmOperation(_sapApplicationServerInstanceClientDiagnostics, Pipeline, _sapApplicationServerInstanceRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Deletes the SAP Application Server Instance resource. <br><br>This operation will be used by service only. Delete by end user will return a Bad Request error. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName}/applicationInstances/{applicationInstanceName} + /// + /// + /// Operation Id + /// SAPApplicationServerInstance_Delete + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// 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 = _sapApplicationServerInstanceClientDiagnostics.CreateScope("SapApplicationServerInstanceResource.Delete"); + scope.Start(); + try + { + var response = _sapApplicationServerInstanceRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + var operation = new SapVirtualInstancesArmOperation(_sapApplicationServerInstanceClientDiagnostics, Pipeline, _sapApplicationServerInstanceRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletionResponse(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Puts the SAP Application Server Instance resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName}/applicationInstances/{applicationInstanceName} + /// + /// + /// Operation Id + /// SAPApplicationServerInstance_Update + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The SAP Application Server Instance resource request body. + /// The cancellation token to use. + /// is null. + public virtual async Task> UpdateAsync(SapApplicationServerInstancePatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(patch, nameof(patch)); + + using var scope = _sapApplicationServerInstanceClientDiagnostics.CreateScope("SapApplicationServerInstanceResource.Update"); + scope.Start(); + try + { + var response = await _sapApplicationServerInstanceRestClient.UpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, patch, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new SapApplicationServerInstanceResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Puts the SAP Application Server Instance resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName}/applicationInstances/{applicationInstanceName} + /// + /// + /// Operation Id + /// SAPApplicationServerInstance_Update + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The SAP Application Server Instance resource request body. + /// The cancellation token to use. + /// is null. + public virtual Response Update(SapApplicationServerInstancePatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(patch, nameof(patch)); + + using var scope = _sapApplicationServerInstanceClientDiagnostics.CreateScope("SapApplicationServerInstanceResource.Update"); + scope.Start(); + try + { + var response = _sapApplicationServerInstanceRestClient.Update(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, patch, cancellationToken); + return Response.FromValue(new SapApplicationServerInstanceResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Starts the SAP Application Server Instance. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName}/applicationInstances/{applicationInstanceName}/start + /// + /// + /// Operation Id + /// SAPApplicationServerInstances_Start + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// 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. + /// SAP Application server instance start request body. + /// The cancellation token to use. + public virtual async Task> StartAsync(WaitUntil waitUntil, StartContent content = null, CancellationToken cancellationToken = default) + { + using var scope = _sapApplicationServerInstanceClientDiagnostics.CreateScope("SapApplicationServerInstanceResource.Start"); + scope.Start(); + try + { + var response = await _sapApplicationServerInstanceRestClient.StartAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, content, cancellationToken).ConfigureAwait(false); + var operation = new SapVirtualInstancesArmOperation(new OperationStatusResultOperationSource(), _sapApplicationServerInstanceClientDiagnostics, Pipeline, _sapApplicationServerInstanceRestClient.CreateStartRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, content).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Starts the SAP Application Server Instance. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName}/applicationInstances/{applicationInstanceName}/start + /// + /// + /// Operation Id + /// SAPApplicationServerInstances_Start + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// 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. + /// SAP Application server instance start request body. + /// The cancellation token to use. + public virtual ArmOperation Start(WaitUntil waitUntil, StartContent content = null, CancellationToken cancellationToken = default) + { + using var scope = _sapApplicationServerInstanceClientDiagnostics.CreateScope("SapApplicationServerInstanceResource.Start"); + scope.Start(); + try + { + var response = _sapApplicationServerInstanceRestClient.Start(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, content, cancellationToken); + var operation = new SapVirtualInstancesArmOperation(new OperationStatusResultOperationSource(), _sapApplicationServerInstanceClientDiagnostics, Pipeline, _sapApplicationServerInstanceRestClient.CreateStartRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, content).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Stops the SAP Application Server Instance. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName}/applicationInstances/{applicationInstanceName}/stop + /// + /// + /// Operation Id + /// SAPApplicationServerInstances_Stop + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// 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. + /// SAP Application server instance stop request body. + /// The cancellation token to use. + public virtual async Task> StopAsync(WaitUntil waitUntil, StopContent content = null, CancellationToken cancellationToken = default) + { + using var scope = _sapApplicationServerInstanceClientDiagnostics.CreateScope("SapApplicationServerInstanceResource.Stop"); + scope.Start(); + try + { + var response = await _sapApplicationServerInstanceRestClient.StopAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, content, cancellationToken).ConfigureAwait(false); + var operation = new SapVirtualInstancesArmOperation(new OperationStatusResultOperationSource(), _sapApplicationServerInstanceClientDiagnostics, Pipeline, _sapApplicationServerInstanceRestClient.CreateStopRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, content).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Stops the SAP Application Server Instance. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName}/applicationInstances/{applicationInstanceName}/stop + /// + /// + /// Operation Id + /// SAPApplicationServerInstances_Stop + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// 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. + /// SAP Application server instance stop request body. + /// The cancellation token to use. + public virtual ArmOperation Stop(WaitUntil waitUntil, StopContent content = null, CancellationToken cancellationToken = default) + { + using var scope = _sapApplicationServerInstanceClientDiagnostics.CreateScope("SapApplicationServerInstanceResource.Stop"); + scope.Start(); + try + { + var response = _sapApplicationServerInstanceRestClient.Stop(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, content, cancellationToken); + var operation = new SapVirtualInstancesArmOperation(new OperationStatusResultOperationSource(), _sapApplicationServerInstanceClientDiagnostics, Pipeline, _sapApplicationServerInstanceRestClient.CreateStopRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, content).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Add a tag to the current resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName}/applicationInstances/{applicationInstanceName} + /// + /// + /// Operation Id + /// SAPApplicationServerInstance_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The key for the tag. + /// The value for the tag. + /// The cancellation token to use. + /// or is null. + public virtual async Task> AddTagAsync(string key, string value, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(key, nameof(key)); + Argument.AssertNotNull(value, nameof(value)); + + using var scope = _sapApplicationServerInstanceClientDiagnostics.CreateScope("SapApplicationServerInstanceResource.AddTag"); + scope.Start(); + try + { + if (await CanUseTagResourceAsync(cancellationToken: cancellationToken).ConfigureAwait(false)) + { + var originalTags = await GetTagResource().GetAsync(cancellationToken).ConfigureAwait(false); + originalTags.Value.Data.TagValues[key] = value; + await GetTagResource().CreateOrUpdateAsync(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken).ConfigureAwait(false); + var originalResponse = await _sapApplicationServerInstanceRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new SapApplicationServerInstanceResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; + var patch = new SapApplicationServerInstancePatch(); + foreach (var tag in current.Tags) + { + patch.Tags.Add(tag); + } + patch.Tags[key] = value; + var result = await UpdateAsync(patch, cancellationToken: cancellationToken).ConfigureAwait(false); + return result; + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Add a tag to the current resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName}/applicationInstances/{applicationInstanceName} + /// + /// + /// Operation Id + /// SAPApplicationServerInstance_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The key for the tag. + /// The value for the tag. + /// The cancellation token to use. + /// or is null. + public virtual Response AddTag(string key, string value, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(key, nameof(key)); + Argument.AssertNotNull(value, nameof(value)); + + using var scope = _sapApplicationServerInstanceClientDiagnostics.CreateScope("SapApplicationServerInstanceResource.AddTag"); + scope.Start(); + try + { + if (CanUseTagResource(cancellationToken: cancellationToken)) + { + var originalTags = GetTagResource().Get(cancellationToken); + originalTags.Value.Data.TagValues[key] = value; + GetTagResource().CreateOrUpdate(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken); + var originalResponse = _sapApplicationServerInstanceRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + return Response.FromValue(new SapApplicationServerInstanceResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = Get(cancellationToken: cancellationToken).Value.Data; + var patch = new SapApplicationServerInstancePatch(); + foreach (var tag in current.Tags) + { + patch.Tags.Add(tag); + } + patch.Tags[key] = value; + var result = Update(patch, cancellationToken: cancellationToken); + return result; + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Replace the tags on the resource with the given set. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName}/applicationInstances/{applicationInstanceName} + /// + /// + /// Operation Id + /// SAPApplicationServerInstance_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The set of tags to use as replacement. + /// The cancellation token to use. + /// is null. + public virtual async Task> SetTagsAsync(IDictionary tags, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(tags, nameof(tags)); + + using var scope = _sapApplicationServerInstanceClientDiagnostics.CreateScope("SapApplicationServerInstanceResource.SetTags"); + scope.Start(); + try + { + if (await CanUseTagResourceAsync(cancellationToken: cancellationToken).ConfigureAwait(false)) + { + await GetTagResource().DeleteAsync(WaitUntil.Completed, cancellationToken: cancellationToken).ConfigureAwait(false); + var originalTags = await GetTagResource().GetAsync(cancellationToken).ConfigureAwait(false); + originalTags.Value.Data.TagValues.ReplaceWith(tags); + await GetTagResource().CreateOrUpdateAsync(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken).ConfigureAwait(false); + var originalResponse = await _sapApplicationServerInstanceRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new SapApplicationServerInstanceResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; + var patch = new SapApplicationServerInstancePatch(); + patch.Tags.ReplaceWith(tags); + var result = await UpdateAsync(patch, cancellationToken: cancellationToken).ConfigureAwait(false); + return result; + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Replace the tags on the resource with the given set. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName}/applicationInstances/{applicationInstanceName} + /// + /// + /// Operation Id + /// SAPApplicationServerInstance_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The set of tags to use as replacement. + /// The cancellation token to use. + /// is null. + public virtual Response SetTags(IDictionary tags, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(tags, nameof(tags)); + + using var scope = _sapApplicationServerInstanceClientDiagnostics.CreateScope("SapApplicationServerInstanceResource.SetTags"); + scope.Start(); + try + { + if (CanUseTagResource(cancellationToken: cancellationToken)) + { + GetTagResource().Delete(WaitUntil.Completed, cancellationToken: cancellationToken); + var originalTags = GetTagResource().Get(cancellationToken); + originalTags.Value.Data.TagValues.ReplaceWith(tags); + GetTagResource().CreateOrUpdate(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken); + var originalResponse = _sapApplicationServerInstanceRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + return Response.FromValue(new SapApplicationServerInstanceResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = Get(cancellationToken: cancellationToken).Value.Data; + var patch = new SapApplicationServerInstancePatch(); + patch.Tags.ReplaceWith(tags); + var result = Update(patch, cancellationToken: cancellationToken); + return result; + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Removes a tag by key from the resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName}/applicationInstances/{applicationInstanceName} + /// + /// + /// Operation Id + /// SAPApplicationServerInstance_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The key for the tag. + /// The cancellation token to use. + /// is null. + public virtual async Task> RemoveTagAsync(string key, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(key, nameof(key)); + + using var scope = _sapApplicationServerInstanceClientDiagnostics.CreateScope("SapApplicationServerInstanceResource.RemoveTag"); + scope.Start(); + try + { + if (await CanUseTagResourceAsync(cancellationToken: cancellationToken).ConfigureAwait(false)) + { + var originalTags = await GetTagResource().GetAsync(cancellationToken).ConfigureAwait(false); + originalTags.Value.Data.TagValues.Remove(key); + await GetTagResource().CreateOrUpdateAsync(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken).ConfigureAwait(false); + var originalResponse = await _sapApplicationServerInstanceRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new SapApplicationServerInstanceResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; + var patch = new SapApplicationServerInstancePatch(); + foreach (var tag in current.Tags) + { + patch.Tags.Add(tag); + } + patch.Tags.Remove(key); + var result = await UpdateAsync(patch, cancellationToken: cancellationToken).ConfigureAwait(false); + return result; + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Removes a tag by key from the resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName}/applicationInstances/{applicationInstanceName} + /// + /// + /// Operation Id + /// SAPApplicationServerInstance_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The key for the tag. + /// The cancellation token to use. + /// is null. + public virtual Response RemoveTag(string key, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(key, nameof(key)); + + using var scope = _sapApplicationServerInstanceClientDiagnostics.CreateScope("SapApplicationServerInstanceResource.RemoveTag"); + scope.Start(); + try + { + if (CanUseTagResource(cancellationToken: cancellationToken)) + { + var originalTags = GetTagResource().Get(cancellationToken); + originalTags.Value.Data.TagValues.Remove(key); + GetTagResource().CreateOrUpdate(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken); + var originalResponse = _sapApplicationServerInstanceRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + return Response.FromValue(new SapApplicationServerInstanceResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = Get(cancellationToken: cancellationToken).Value.Data; + var patch = new SapApplicationServerInstancePatch(); + foreach (var tag in current.Tags) + { + patch.Tags.Add(tag); + } + patch.Tags.Remove(key); + var result = Update(patch, cancellationToken: cancellationToken); + return result; + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/SapCentralServerInstanceCollection.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/SapCentralServerInstanceCollection.cs new file mode 100644 index 000000000000..f4720665bca6 --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/SapCentralServerInstanceCollection.cs @@ -0,0 +1,493 @@ +// 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.SapVirtualInstances +{ + /// + /// 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 GetSapCentralServerInstances method from an instance of . + /// + public partial class SapCentralServerInstanceCollection : ArmCollection, IEnumerable, IAsyncEnumerable + { + private readonly ClientDiagnostics _sapCentralServerInstanceClientDiagnostics; + private readonly SapCentralServerInstancesRestOperations _sapCentralServerInstanceRestClient; + + /// Initializes a new instance of the class for mocking. + protected SapCentralServerInstanceCollection() + { + } + + /// 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 SapCentralServerInstanceCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _sapCentralServerInstanceClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.SapVirtualInstances", SapCentralServerInstanceResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(SapCentralServerInstanceResource.ResourceType, out string sapCentralServerInstanceApiVersion); + _sapCentralServerInstanceRestClient = new SapCentralServerInstancesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, sapCentralServerInstanceApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != SapVirtualInstanceResource.ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, SapVirtualInstanceResource.ResourceType), nameof(id)); + } + + /// + /// Creates the SAP Central Services Instance resource. <br><br>This will be used by service only. PUT operation on this resource by end user will return a Bad Request error. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName}/centralInstances/{centralInstanceName} + /// + /// + /// Operation Id + /// SAPCentralServerInstance_Create + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// 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. + /// Central Services Instance resource name string modeled as parameter for auto generation to work correctly. + /// The SAP Central Services Instance request body. + /// 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 centralInstanceName, SapCentralServerInstanceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(centralInstanceName, nameof(centralInstanceName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _sapCentralServerInstanceClientDiagnostics.CreateScope("SapCentralServerInstanceCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = await _sapCentralServerInstanceRestClient.CreateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, centralInstanceName, data, cancellationToken).ConfigureAwait(false); + var operation = new SapVirtualInstancesArmOperation(new SapCentralServerInstanceOperationSource(Client), _sapCentralServerInstanceClientDiagnostics, Pipeline, _sapCentralServerInstanceRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, centralInstanceName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Creates the SAP Central Services Instance resource. <br><br>This will be used by service only. PUT operation on this resource by end user will return a Bad Request error. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName}/centralInstances/{centralInstanceName} + /// + /// + /// Operation Id + /// SAPCentralServerInstance_Create + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// 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. + /// Central Services Instance resource name string modeled as parameter for auto generation to work correctly. + /// The SAP Central Services Instance request body. + /// 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 centralInstanceName, SapCentralServerInstanceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(centralInstanceName, nameof(centralInstanceName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _sapCentralServerInstanceClientDiagnostics.CreateScope("SapCentralServerInstanceCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = _sapCentralServerInstanceRestClient.Create(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, centralInstanceName, data, cancellationToken); + var operation = new SapVirtualInstancesArmOperation(new SapCentralServerInstanceOperationSource(Client), _sapCentralServerInstanceClientDiagnostics, Pipeline, _sapCentralServerInstanceRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, centralInstanceName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets the SAP Central Services Instance resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName}/centralInstances/{centralInstanceName} + /// + /// + /// Operation Id + /// SAPCentralServerInstance_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Central Services Instance resource name string modeled as parameter for auto generation to work correctly. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetAsync(string centralInstanceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(centralInstanceName, nameof(centralInstanceName)); + + using var scope = _sapCentralServerInstanceClientDiagnostics.CreateScope("SapCentralServerInstanceCollection.Get"); + scope.Start(); + try + { + var response = await _sapCentralServerInstanceRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, centralInstanceName, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new SapCentralServerInstanceResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets the SAP Central Services Instance resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName}/centralInstances/{centralInstanceName} + /// + /// + /// Operation Id + /// SAPCentralServerInstance_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Central Services Instance resource name string modeled as parameter for auto generation to work correctly. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Get(string centralInstanceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(centralInstanceName, nameof(centralInstanceName)); + + using var scope = _sapCentralServerInstanceClientDiagnostics.CreateScope("SapCentralServerInstanceCollection.Get"); + scope.Start(); + try + { + var response = _sapCentralServerInstanceRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, centralInstanceName, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new SapCentralServerInstanceResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Lists the SAP Central Services Instance resource for the given Virtual Instance for SAP solutions resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName}/centralInstances + /// + /// + /// Operation Id + /// SAPCentralServerInstance_List + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// 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) => _sapCentralServerInstanceRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _sapCentralServerInstanceRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new SapCentralServerInstanceResource(Client, SapCentralServerInstanceData.DeserializeSapCentralServerInstanceData(e)), _sapCentralServerInstanceClientDiagnostics, Pipeline, "SapCentralServerInstanceCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Lists the SAP Central Services Instance resource for the given Virtual Instance for SAP solutions resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName}/centralInstances + /// + /// + /// Operation Id + /// SAPCentralServerInstance_List + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// 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) => _sapCentralServerInstanceRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _sapCentralServerInstanceRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new SapCentralServerInstanceResource(Client, SapCentralServerInstanceData.DeserializeSapCentralServerInstanceData(e)), _sapCentralServerInstanceClientDiagnostics, Pipeline, "SapCentralServerInstanceCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName}/centralInstances/{centralInstanceName} + /// + /// + /// Operation Id + /// SAPCentralServerInstance_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Central Services Instance resource name string modeled as parameter for auto generation to work correctly. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> ExistsAsync(string centralInstanceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(centralInstanceName, nameof(centralInstanceName)); + + using var scope = _sapCentralServerInstanceClientDiagnostics.CreateScope("SapCentralServerInstanceCollection.Exists"); + scope.Start(); + try + { + var response = await _sapCentralServerInstanceRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, centralInstanceName, 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.Workloads/sapVirtualInstances/{sapVirtualInstanceName}/centralInstances/{centralInstanceName} + /// + /// + /// Operation Id + /// SAPCentralServerInstance_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Central Services Instance resource name string modeled as parameter for auto generation to work correctly. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Exists(string centralInstanceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(centralInstanceName, nameof(centralInstanceName)); + + using var scope = _sapCentralServerInstanceClientDiagnostics.CreateScope("SapCentralServerInstanceCollection.Exists"); + scope.Start(); + try + { + var response = _sapCentralServerInstanceRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, centralInstanceName, 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.Workloads/sapVirtualInstances/{sapVirtualInstanceName}/centralInstances/{centralInstanceName} + /// + /// + /// Operation Id + /// SAPCentralServerInstance_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Central Services Instance resource name string modeled as parameter for auto generation to work correctly. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetIfExistsAsync(string centralInstanceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(centralInstanceName, nameof(centralInstanceName)); + + using var scope = _sapCentralServerInstanceClientDiagnostics.CreateScope("SapCentralServerInstanceCollection.GetIfExists"); + scope.Start(); + try + { + var response = await _sapCentralServerInstanceRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, centralInstanceName, cancellationToken: cancellationToken).ConfigureAwait(false); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new SapCentralServerInstanceResource(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.Workloads/sapVirtualInstances/{sapVirtualInstanceName}/centralInstances/{centralInstanceName} + /// + /// + /// Operation Id + /// SAPCentralServerInstance_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Central Services Instance resource name string modeled as parameter for auto generation to work correctly. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual NullableResponse GetIfExists(string centralInstanceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(centralInstanceName, nameof(centralInstanceName)); + + using var scope = _sapCentralServerInstanceClientDiagnostics.CreateScope("SapCentralServerInstanceCollection.GetIfExists"); + scope.Start(); + try + { + var response = _sapCentralServerInstanceRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, centralInstanceName, cancellationToken: cancellationToken); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new SapCentralServerInstanceResource(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/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/SapCentralServerInstanceData.Serialization.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/SapCentralServerInstanceData.Serialization.cs new file mode 100644 index 000000000000..01279ccef8f9 --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/SapCentralServerInstanceData.Serialization.cs @@ -0,0 +1,178 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.Models; +using Azure.ResourceManager.SapVirtualInstances.Models; + +namespace Azure.ResourceManager.SapVirtualInstances +{ + public partial class SapCentralServerInstanceData : 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(SapCentralServerInstanceData)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (Optional.IsDefined(Properties)) + { + writer.WritePropertyName("properties"u8); + writer.WriteObjectValue(Properties, options); + } + } + + SapCentralServerInstanceData 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(SapCentralServerInstanceData)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeSapCentralServerInstanceData(document.RootElement, options); + } + + internal static SapCentralServerInstanceData DeserializeSapCentralServerInstanceData(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + SapCentralServerProperties properties = 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 = SapCentralServerProperties.DeserializeSapCentralServerProperties(property.Value, options); + 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 SapCentralServerInstanceData( + id, + name, + type, + systemData, + tags ?? new ChangeTrackingDictionary(), + location, + 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(SapCentralServerInstanceData)} does not support writing '{options.Format}' format."); + } + } + + SapCentralServerInstanceData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeSapCentralServerInstanceData(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(SapCentralServerInstanceData)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/SapCentralServerInstanceData.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/SapCentralServerInstanceData.cs new file mode 100644 index 000000000000..e2b64daf7eee --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/SapCentralServerInstanceData.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.Models; +using Azure.ResourceManager.SapVirtualInstances.Models; + +namespace Azure.ResourceManager.SapVirtualInstances +{ + /// + /// A class representing the SapCentralServerInstance data model. + /// Define the SAP Central Services Instance resource. + /// + public partial class SapCentralServerInstanceData : 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 SapCentralServerInstanceData(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. + /// Keeps track of any properties unknown to the library. + internal SapCentralServerInstanceData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, SapCentralServerProperties properties, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) + { + Properties = properties; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal SapCentralServerInstanceData() + { + } + + /// The resource-specific properties for this resource. + public SapCentralServerProperties Properties { get; set; } + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/SapCentralServerInstanceResource.Serialization.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/SapCentralServerInstanceResource.Serialization.cs new file mode 100644 index 000000000000..b133bd8eceef --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/SapCentralServerInstanceResource.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.SapVirtualInstances +{ + public partial class SapCentralServerInstanceResource : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); + + SapCentralServerInstanceData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options); + + SapCentralServerInstanceData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options); + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/SapCentralServerInstanceResource.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/SapCentralServerInstanceResource.cs new file mode 100644 index 000000000000..80e3337f1da6 --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/SapCentralServerInstanceResource.cs @@ -0,0 +1,871 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.SapVirtualInstances.Models; + +namespace Azure.ResourceManager.SapVirtualInstances +{ + /// + /// A Class representing a SapCentralServerInstance 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 GetSapCentralServerInstanceResource method. + /// Otherwise you can get one from its parent resource using the GetSapCentralServerInstance method. + /// + public partial class SapCentralServerInstanceResource : ArmResource + { + /// Generate the resource identifier of a instance. + /// The subscriptionId. + /// The resourceGroupName. + /// The sapVirtualInstanceName. + /// The centralInstanceName. + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string sapVirtualInstanceName, string centralInstanceName) + { + var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName}/centralInstances/{centralInstanceName}"; + return new ResourceIdentifier(resourceId); + } + + private readonly ClientDiagnostics _sapCentralServerInstanceClientDiagnostics; + private readonly SapCentralServerInstancesRestOperations _sapCentralServerInstanceRestClient; + private readonly SapCentralServerInstanceData _data; + + /// Gets the resource type for the operations. + public static readonly ResourceType ResourceType = "Microsoft.Workloads/sapVirtualInstances/centralInstances"; + + /// Initializes a new instance of the class for mocking. + protected SapCentralServerInstanceResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal SapCentralServerInstanceResource(ArmClient client, SapCentralServerInstanceData 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 SapCentralServerInstanceResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _sapCentralServerInstanceClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.SapVirtualInstances", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string sapCentralServerInstanceApiVersion); + _sapCentralServerInstanceRestClient = new SapCentralServerInstancesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, sapCentralServerInstanceApiVersion); +#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 SapCentralServerInstanceData 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)); + } + + /// + /// Gets the SAP Central Services Instance resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName}/centralInstances/{centralInstanceName} + /// + /// + /// Operation Id + /// SAPCentralServerInstance_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _sapCentralServerInstanceClientDiagnostics.CreateScope("SapCentralServerInstanceResource.Get"); + scope.Start(); + try + { + var response = await _sapCentralServerInstanceRestClient.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 SapCentralServerInstanceResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets the SAP Central Services Instance resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName}/centralInstances/{centralInstanceName} + /// + /// + /// Operation Id + /// SAPCentralServerInstance_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _sapCentralServerInstanceClientDiagnostics.CreateScope("SapCentralServerInstanceResource.Get"); + scope.Start(); + try + { + var response = _sapCentralServerInstanceRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new SapCentralServerInstanceResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Deletes the SAP Central Services Instance resource. <br><br>This will be used by service only. Delete operation on this resource by end user will return a Bad Request error. You can delete the parent resource, which is the Virtual Instance for SAP solutions resource, using the delete operation on it. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName}/centralInstances/{centralInstanceName} + /// + /// + /// Operation Id + /// SAPCentralServerInstance_Delete + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// 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 = _sapCentralServerInstanceClientDiagnostics.CreateScope("SapCentralServerInstanceResource.Delete"); + scope.Start(); + try + { + var response = await _sapCentralServerInstanceRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + var operation = new SapVirtualInstancesArmOperation(_sapCentralServerInstanceClientDiagnostics, Pipeline, _sapCentralServerInstanceRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Deletes the SAP Central Services Instance resource. <br><br>This will be used by service only. Delete operation on this resource by end user will return a Bad Request error. You can delete the parent resource, which is the Virtual Instance for SAP solutions resource, using the delete operation on it. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName}/centralInstances/{centralInstanceName} + /// + /// + /// Operation Id + /// SAPCentralServerInstance_Delete + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// 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 = _sapCentralServerInstanceClientDiagnostics.CreateScope("SapCentralServerInstanceResource.Delete"); + scope.Start(); + try + { + var response = _sapCentralServerInstanceRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + var operation = new SapVirtualInstancesArmOperation(_sapCentralServerInstanceClientDiagnostics, Pipeline, _sapCentralServerInstanceRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletionResponse(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Updates the SAP Central Services Instance resource. <br><br>This can be used to update tags on the resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName}/centralInstances/{centralInstanceName} + /// + /// + /// Operation Id + /// SAPCentralServerInstance_Update + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The SAP Central Services Instance resource request body. + /// The cancellation token to use. + /// is null. + public virtual async Task> UpdateAsync(SapCentralServerInstancePatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(patch, nameof(patch)); + + using var scope = _sapCentralServerInstanceClientDiagnostics.CreateScope("SapCentralServerInstanceResource.Update"); + scope.Start(); + try + { + var response = await _sapCentralServerInstanceRestClient.UpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, patch, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new SapCentralServerInstanceResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Updates the SAP Central Services Instance resource. <br><br>This can be used to update tags on the resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName}/centralInstances/{centralInstanceName} + /// + /// + /// Operation Id + /// SAPCentralServerInstance_Update + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The SAP Central Services Instance resource request body. + /// The cancellation token to use. + /// is null. + public virtual Response Update(SapCentralServerInstancePatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(patch, nameof(patch)); + + using var scope = _sapCentralServerInstanceClientDiagnostics.CreateScope("SapCentralServerInstanceResource.Update"); + scope.Start(); + try + { + var response = _sapCentralServerInstanceRestClient.Update(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, patch, cancellationToken); + return Response.FromValue(new SapCentralServerInstanceResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Starts the SAP Central Services Instance. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName}/centralInstances/{centralInstanceName}/start + /// + /// + /// Operation Id + /// SAPCentralServerInstances_Start + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// 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. + /// SAP Central Services instance start request body. + /// The cancellation token to use. + public virtual async Task> StartAsync(WaitUntil waitUntil, StartContent content = null, CancellationToken cancellationToken = default) + { + using var scope = _sapCentralServerInstanceClientDiagnostics.CreateScope("SapCentralServerInstanceResource.Start"); + scope.Start(); + try + { + var response = await _sapCentralServerInstanceRestClient.StartAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, content, cancellationToken).ConfigureAwait(false); + var operation = new SapVirtualInstancesArmOperation(new OperationStatusResultOperationSource(), _sapCentralServerInstanceClientDiagnostics, Pipeline, _sapCentralServerInstanceRestClient.CreateStartRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, content).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Starts the SAP Central Services Instance. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName}/centralInstances/{centralInstanceName}/start + /// + /// + /// Operation Id + /// SAPCentralServerInstances_Start + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// 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. + /// SAP Central Services instance start request body. + /// The cancellation token to use. + public virtual ArmOperation Start(WaitUntil waitUntil, StartContent content = null, CancellationToken cancellationToken = default) + { + using var scope = _sapCentralServerInstanceClientDiagnostics.CreateScope("SapCentralServerInstanceResource.Start"); + scope.Start(); + try + { + var response = _sapCentralServerInstanceRestClient.Start(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, content, cancellationToken); + var operation = new SapVirtualInstancesArmOperation(new OperationStatusResultOperationSource(), _sapCentralServerInstanceClientDiagnostics, Pipeline, _sapCentralServerInstanceRestClient.CreateStartRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, content).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Stops the SAP Central Services Instance. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName}/centralInstances/{centralInstanceName}/stop + /// + /// + /// Operation Id + /// SAPCentralServerInstances_Stop + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// 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. + /// SAP Central Services instance stop request body. + /// The cancellation token to use. + public virtual async Task> StopAsync(WaitUntil waitUntil, StopContent content = null, CancellationToken cancellationToken = default) + { + using var scope = _sapCentralServerInstanceClientDiagnostics.CreateScope("SapCentralServerInstanceResource.Stop"); + scope.Start(); + try + { + var response = await _sapCentralServerInstanceRestClient.StopAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, content, cancellationToken).ConfigureAwait(false); + var operation = new SapVirtualInstancesArmOperation(new OperationStatusResultOperationSource(), _sapCentralServerInstanceClientDiagnostics, Pipeline, _sapCentralServerInstanceRestClient.CreateStopRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, content).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Stops the SAP Central Services Instance. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName}/centralInstances/{centralInstanceName}/stop + /// + /// + /// Operation Id + /// SAPCentralServerInstances_Stop + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// 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. + /// SAP Central Services instance stop request body. + /// The cancellation token to use. + public virtual ArmOperation Stop(WaitUntil waitUntil, StopContent content = null, CancellationToken cancellationToken = default) + { + using var scope = _sapCentralServerInstanceClientDiagnostics.CreateScope("SapCentralServerInstanceResource.Stop"); + scope.Start(); + try + { + var response = _sapCentralServerInstanceRestClient.Stop(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, content, cancellationToken); + var operation = new SapVirtualInstancesArmOperation(new OperationStatusResultOperationSource(), _sapCentralServerInstanceClientDiagnostics, Pipeline, _sapCentralServerInstanceRestClient.CreateStopRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, content).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Add a tag to the current resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName}/centralInstances/{centralInstanceName} + /// + /// + /// Operation Id + /// SAPCentralServerInstance_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The key for the tag. + /// The value for the tag. + /// The cancellation token to use. + /// or is null. + public virtual async Task> AddTagAsync(string key, string value, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(key, nameof(key)); + Argument.AssertNotNull(value, nameof(value)); + + using var scope = _sapCentralServerInstanceClientDiagnostics.CreateScope("SapCentralServerInstanceResource.AddTag"); + scope.Start(); + try + { + if (await CanUseTagResourceAsync(cancellationToken: cancellationToken).ConfigureAwait(false)) + { + var originalTags = await GetTagResource().GetAsync(cancellationToken).ConfigureAwait(false); + originalTags.Value.Data.TagValues[key] = value; + await GetTagResource().CreateOrUpdateAsync(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken).ConfigureAwait(false); + var originalResponse = await _sapCentralServerInstanceRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new SapCentralServerInstanceResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; + var patch = new SapCentralServerInstancePatch(); + foreach (var tag in current.Tags) + { + patch.Tags.Add(tag); + } + patch.Tags[key] = value; + var result = await UpdateAsync(patch, cancellationToken: cancellationToken).ConfigureAwait(false); + return result; + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Add a tag to the current resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName}/centralInstances/{centralInstanceName} + /// + /// + /// Operation Id + /// SAPCentralServerInstance_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The key for the tag. + /// The value for the tag. + /// The cancellation token to use. + /// or is null. + public virtual Response AddTag(string key, string value, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(key, nameof(key)); + Argument.AssertNotNull(value, nameof(value)); + + using var scope = _sapCentralServerInstanceClientDiagnostics.CreateScope("SapCentralServerInstanceResource.AddTag"); + scope.Start(); + try + { + if (CanUseTagResource(cancellationToken: cancellationToken)) + { + var originalTags = GetTagResource().Get(cancellationToken); + originalTags.Value.Data.TagValues[key] = value; + GetTagResource().CreateOrUpdate(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken); + var originalResponse = _sapCentralServerInstanceRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + return Response.FromValue(new SapCentralServerInstanceResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = Get(cancellationToken: cancellationToken).Value.Data; + var patch = new SapCentralServerInstancePatch(); + foreach (var tag in current.Tags) + { + patch.Tags.Add(tag); + } + patch.Tags[key] = value; + var result = Update(patch, cancellationToken: cancellationToken); + return result; + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Replace the tags on the resource with the given set. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName}/centralInstances/{centralInstanceName} + /// + /// + /// Operation Id + /// SAPCentralServerInstance_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The set of tags to use as replacement. + /// The cancellation token to use. + /// is null. + public virtual async Task> SetTagsAsync(IDictionary tags, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(tags, nameof(tags)); + + using var scope = _sapCentralServerInstanceClientDiagnostics.CreateScope("SapCentralServerInstanceResource.SetTags"); + scope.Start(); + try + { + if (await CanUseTagResourceAsync(cancellationToken: cancellationToken).ConfigureAwait(false)) + { + await GetTagResource().DeleteAsync(WaitUntil.Completed, cancellationToken: cancellationToken).ConfigureAwait(false); + var originalTags = await GetTagResource().GetAsync(cancellationToken).ConfigureAwait(false); + originalTags.Value.Data.TagValues.ReplaceWith(tags); + await GetTagResource().CreateOrUpdateAsync(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken).ConfigureAwait(false); + var originalResponse = await _sapCentralServerInstanceRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new SapCentralServerInstanceResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; + var patch = new SapCentralServerInstancePatch(); + patch.Tags.ReplaceWith(tags); + var result = await UpdateAsync(patch, cancellationToken: cancellationToken).ConfigureAwait(false); + return result; + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Replace the tags on the resource with the given set. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName}/centralInstances/{centralInstanceName} + /// + /// + /// Operation Id + /// SAPCentralServerInstance_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The set of tags to use as replacement. + /// The cancellation token to use. + /// is null. + public virtual Response SetTags(IDictionary tags, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(tags, nameof(tags)); + + using var scope = _sapCentralServerInstanceClientDiagnostics.CreateScope("SapCentralServerInstanceResource.SetTags"); + scope.Start(); + try + { + if (CanUseTagResource(cancellationToken: cancellationToken)) + { + GetTagResource().Delete(WaitUntil.Completed, cancellationToken: cancellationToken); + var originalTags = GetTagResource().Get(cancellationToken); + originalTags.Value.Data.TagValues.ReplaceWith(tags); + GetTagResource().CreateOrUpdate(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken); + var originalResponse = _sapCentralServerInstanceRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + return Response.FromValue(new SapCentralServerInstanceResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = Get(cancellationToken: cancellationToken).Value.Data; + var patch = new SapCentralServerInstancePatch(); + patch.Tags.ReplaceWith(tags); + var result = Update(patch, cancellationToken: cancellationToken); + return result; + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Removes a tag by key from the resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName}/centralInstances/{centralInstanceName} + /// + /// + /// Operation Id + /// SAPCentralServerInstance_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The key for the tag. + /// The cancellation token to use. + /// is null. + public virtual async Task> RemoveTagAsync(string key, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(key, nameof(key)); + + using var scope = _sapCentralServerInstanceClientDiagnostics.CreateScope("SapCentralServerInstanceResource.RemoveTag"); + scope.Start(); + try + { + if (await CanUseTagResourceAsync(cancellationToken: cancellationToken).ConfigureAwait(false)) + { + var originalTags = await GetTagResource().GetAsync(cancellationToken).ConfigureAwait(false); + originalTags.Value.Data.TagValues.Remove(key); + await GetTagResource().CreateOrUpdateAsync(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken).ConfigureAwait(false); + var originalResponse = await _sapCentralServerInstanceRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new SapCentralServerInstanceResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; + var patch = new SapCentralServerInstancePatch(); + foreach (var tag in current.Tags) + { + patch.Tags.Add(tag); + } + patch.Tags.Remove(key); + var result = await UpdateAsync(patch, cancellationToken: cancellationToken).ConfigureAwait(false); + return result; + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Removes a tag by key from the resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName}/centralInstances/{centralInstanceName} + /// + /// + /// Operation Id + /// SAPCentralServerInstance_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The key for the tag. + /// The cancellation token to use. + /// is null. + public virtual Response RemoveTag(string key, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(key, nameof(key)); + + using var scope = _sapCentralServerInstanceClientDiagnostics.CreateScope("SapCentralServerInstanceResource.RemoveTag"); + scope.Start(); + try + { + if (CanUseTagResource(cancellationToken: cancellationToken)) + { + var originalTags = GetTagResource().Get(cancellationToken); + originalTags.Value.Data.TagValues.Remove(key); + GetTagResource().CreateOrUpdate(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken); + var originalResponse = _sapCentralServerInstanceRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + return Response.FromValue(new SapCentralServerInstanceResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = Get(cancellationToken: cancellationToken).Value.Data; + var patch = new SapCentralServerInstancePatch(); + foreach (var tag in current.Tags) + { + patch.Tags.Add(tag); + } + patch.Tags.Remove(key); + var result = Update(patch, cancellationToken: cancellationToken); + return result; + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/SapDatabaseInstanceCollection.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/SapDatabaseInstanceCollection.cs new file mode 100644 index 000000000000..838f24961510 --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/SapDatabaseInstanceCollection.cs @@ -0,0 +1,493 @@ +// 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.SapVirtualInstances +{ + /// + /// 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 GetSapDatabaseInstances method from an instance of . + /// + public partial class SapDatabaseInstanceCollection : ArmCollection, IEnumerable, IAsyncEnumerable + { + private readonly ClientDiagnostics _sapDatabaseInstanceClientDiagnostics; + private readonly SapDatabaseInstancesRestOperations _sapDatabaseInstanceRestClient; + + /// Initializes a new instance of the class for mocking. + protected SapDatabaseInstanceCollection() + { + } + + /// 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 SapDatabaseInstanceCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _sapDatabaseInstanceClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.SapVirtualInstances", SapDatabaseInstanceResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(SapDatabaseInstanceResource.ResourceType, out string sapDatabaseInstanceApiVersion); + _sapDatabaseInstanceRestClient = new SapDatabaseInstancesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, sapDatabaseInstanceApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != SapVirtualInstanceResource.ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, SapVirtualInstanceResource.ResourceType), nameof(id)); + } + + /// + /// Creates the Database resource corresponding to the Virtual Instance for SAP solutions resource. <br><br>This will be used by service only. PUT by end user will return a Bad Request error. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName}/databaseInstances/{databaseInstanceName} + /// + /// + /// Operation Id + /// SAPDatabaseInstance_Create + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// 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. + /// Database resource name string modeled as parameter for auto generation to work correctly. + /// Request body of Database resource of a SAP system. + /// 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 databaseInstanceName, SapDatabaseInstanceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(databaseInstanceName, nameof(databaseInstanceName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _sapDatabaseInstanceClientDiagnostics.CreateScope("SapDatabaseInstanceCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = await _sapDatabaseInstanceRestClient.CreateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, databaseInstanceName, data, cancellationToken).ConfigureAwait(false); + var operation = new SapVirtualInstancesArmOperation(new SapDatabaseInstanceOperationSource(Client), _sapDatabaseInstanceClientDiagnostics, Pipeline, _sapDatabaseInstanceRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, databaseInstanceName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Creates the Database resource corresponding to the Virtual Instance for SAP solutions resource. <br><br>This will be used by service only. PUT by end user will return a Bad Request error. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName}/databaseInstances/{databaseInstanceName} + /// + /// + /// Operation Id + /// SAPDatabaseInstance_Create + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// 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. + /// Database resource name string modeled as parameter for auto generation to work correctly. + /// Request body of Database resource of a SAP system. + /// 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 databaseInstanceName, SapDatabaseInstanceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(databaseInstanceName, nameof(databaseInstanceName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _sapDatabaseInstanceClientDiagnostics.CreateScope("SapDatabaseInstanceCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = _sapDatabaseInstanceRestClient.Create(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, databaseInstanceName, data, cancellationToken); + var operation = new SapVirtualInstancesArmOperation(new SapDatabaseInstanceOperationSource(Client), _sapDatabaseInstanceClientDiagnostics, Pipeline, _sapDatabaseInstanceRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, databaseInstanceName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets the SAP Database Instance resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName}/databaseInstances/{databaseInstanceName} + /// + /// + /// Operation Id + /// SAPDatabaseInstance_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Database resource name string modeled as parameter for auto generation to work correctly. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetAsync(string databaseInstanceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(databaseInstanceName, nameof(databaseInstanceName)); + + using var scope = _sapDatabaseInstanceClientDiagnostics.CreateScope("SapDatabaseInstanceCollection.Get"); + scope.Start(); + try + { + var response = await _sapDatabaseInstanceRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, databaseInstanceName, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new SapDatabaseInstanceResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets the SAP Database Instance resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName}/databaseInstances/{databaseInstanceName} + /// + /// + /// Operation Id + /// SAPDatabaseInstance_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Database resource name string modeled as parameter for auto generation to work correctly. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Get(string databaseInstanceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(databaseInstanceName, nameof(databaseInstanceName)); + + using var scope = _sapDatabaseInstanceClientDiagnostics.CreateScope("SapDatabaseInstanceCollection.Get"); + scope.Start(); + try + { + var response = _sapDatabaseInstanceRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, databaseInstanceName, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new SapDatabaseInstanceResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Lists the Database resources associated with a Virtual Instance for SAP solutions resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName}/databaseInstances + /// + /// + /// Operation Id + /// SAPDatabaseInstance_List + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// 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) => _sapDatabaseInstanceRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _sapDatabaseInstanceRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new SapDatabaseInstanceResource(Client, SapDatabaseInstanceData.DeserializeSapDatabaseInstanceData(e)), _sapDatabaseInstanceClientDiagnostics, Pipeline, "SapDatabaseInstanceCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Lists the Database resources associated with a Virtual Instance for SAP solutions resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName}/databaseInstances + /// + /// + /// Operation Id + /// SAPDatabaseInstance_List + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// 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) => _sapDatabaseInstanceRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _sapDatabaseInstanceRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new SapDatabaseInstanceResource(Client, SapDatabaseInstanceData.DeserializeSapDatabaseInstanceData(e)), _sapDatabaseInstanceClientDiagnostics, Pipeline, "SapDatabaseInstanceCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName}/databaseInstances/{databaseInstanceName} + /// + /// + /// Operation Id + /// SAPDatabaseInstance_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Database resource name string modeled as parameter for auto generation to work correctly. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> ExistsAsync(string databaseInstanceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(databaseInstanceName, nameof(databaseInstanceName)); + + using var scope = _sapDatabaseInstanceClientDiagnostics.CreateScope("SapDatabaseInstanceCollection.Exists"); + scope.Start(); + try + { + var response = await _sapDatabaseInstanceRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, databaseInstanceName, 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.Workloads/sapVirtualInstances/{sapVirtualInstanceName}/databaseInstances/{databaseInstanceName} + /// + /// + /// Operation Id + /// SAPDatabaseInstance_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Database resource name string modeled as parameter for auto generation to work correctly. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Exists(string databaseInstanceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(databaseInstanceName, nameof(databaseInstanceName)); + + using var scope = _sapDatabaseInstanceClientDiagnostics.CreateScope("SapDatabaseInstanceCollection.Exists"); + scope.Start(); + try + { + var response = _sapDatabaseInstanceRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, databaseInstanceName, 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.Workloads/sapVirtualInstances/{sapVirtualInstanceName}/databaseInstances/{databaseInstanceName} + /// + /// + /// Operation Id + /// SAPDatabaseInstance_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Database resource name string modeled as parameter for auto generation to work correctly. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetIfExistsAsync(string databaseInstanceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(databaseInstanceName, nameof(databaseInstanceName)); + + using var scope = _sapDatabaseInstanceClientDiagnostics.CreateScope("SapDatabaseInstanceCollection.GetIfExists"); + scope.Start(); + try + { + var response = await _sapDatabaseInstanceRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, databaseInstanceName, cancellationToken: cancellationToken).ConfigureAwait(false); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new SapDatabaseInstanceResource(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.Workloads/sapVirtualInstances/{sapVirtualInstanceName}/databaseInstances/{databaseInstanceName} + /// + /// + /// Operation Id + /// SAPDatabaseInstance_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Database resource name string modeled as parameter for auto generation to work correctly. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual NullableResponse GetIfExists(string databaseInstanceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(databaseInstanceName, nameof(databaseInstanceName)); + + using var scope = _sapDatabaseInstanceClientDiagnostics.CreateScope("SapDatabaseInstanceCollection.GetIfExists"); + scope.Start(); + try + { + var response = _sapDatabaseInstanceRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, databaseInstanceName, cancellationToken: cancellationToken); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new SapDatabaseInstanceResource(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/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/SapDatabaseInstanceData.Serialization.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/SapDatabaseInstanceData.Serialization.cs new file mode 100644 index 000000000000..6ee6544117fd --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/SapDatabaseInstanceData.Serialization.cs @@ -0,0 +1,178 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.Models; +using Azure.ResourceManager.SapVirtualInstances.Models; + +namespace Azure.ResourceManager.SapVirtualInstances +{ + public partial class SapDatabaseInstanceData : 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(SapDatabaseInstanceData)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (Optional.IsDefined(Properties)) + { + writer.WritePropertyName("properties"u8); + writer.WriteObjectValue(Properties, options); + } + } + + SapDatabaseInstanceData 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(SapDatabaseInstanceData)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeSapDatabaseInstanceData(document.RootElement, options); + } + + internal static SapDatabaseInstanceData DeserializeSapDatabaseInstanceData(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + SapDatabaseProperties properties = 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 = SapDatabaseProperties.DeserializeSapDatabaseProperties(property.Value, options); + 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 SapDatabaseInstanceData( + id, + name, + type, + systemData, + tags ?? new ChangeTrackingDictionary(), + location, + 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(SapDatabaseInstanceData)} does not support writing '{options.Format}' format."); + } + } + + SapDatabaseInstanceData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeSapDatabaseInstanceData(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(SapDatabaseInstanceData)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/SapDatabaseInstanceData.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/SapDatabaseInstanceData.cs new file mode 100644 index 000000000000..2a7a52a0a861 --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/SapDatabaseInstanceData.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.Models; +using Azure.ResourceManager.SapVirtualInstances.Models; + +namespace Azure.ResourceManager.SapVirtualInstances +{ + /// + /// A class representing the SapDatabaseInstance data model. + /// Define the Database resource. + /// + public partial class SapDatabaseInstanceData : 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 SapDatabaseInstanceData(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. + /// Keeps track of any properties unknown to the library. + internal SapDatabaseInstanceData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, SapDatabaseProperties properties, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) + { + Properties = properties; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal SapDatabaseInstanceData() + { + } + + /// The resource-specific properties for this resource. + public SapDatabaseProperties Properties { get; set; } + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/SapDatabaseInstanceResource.Serialization.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/SapDatabaseInstanceResource.Serialization.cs new file mode 100644 index 000000000000..7dea59643721 --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/SapDatabaseInstanceResource.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.SapVirtualInstances +{ + public partial class SapDatabaseInstanceResource : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); + + SapDatabaseInstanceData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options); + + SapDatabaseInstanceData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options); + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/SapDatabaseInstanceResource.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/SapDatabaseInstanceResource.cs new file mode 100644 index 000000000000..7143c285d63a --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/SapDatabaseInstanceResource.cs @@ -0,0 +1,871 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.SapVirtualInstances.Models; + +namespace Azure.ResourceManager.SapVirtualInstances +{ + /// + /// A Class representing a SapDatabaseInstance 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 GetSapDatabaseInstanceResource method. + /// Otherwise you can get one from its parent resource using the GetSapDatabaseInstance method. + /// + public partial class SapDatabaseInstanceResource : ArmResource + { + /// Generate the resource identifier of a instance. + /// The subscriptionId. + /// The resourceGroupName. + /// The sapVirtualInstanceName. + /// The databaseInstanceName. + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string sapVirtualInstanceName, string databaseInstanceName) + { + var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName}/databaseInstances/{databaseInstanceName}"; + return new ResourceIdentifier(resourceId); + } + + private readonly ClientDiagnostics _sapDatabaseInstanceClientDiagnostics; + private readonly SapDatabaseInstancesRestOperations _sapDatabaseInstanceRestClient; + private readonly SapDatabaseInstanceData _data; + + /// Gets the resource type for the operations. + public static readonly ResourceType ResourceType = "Microsoft.Workloads/sapVirtualInstances/databaseInstances"; + + /// Initializes a new instance of the class for mocking. + protected SapDatabaseInstanceResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal SapDatabaseInstanceResource(ArmClient client, SapDatabaseInstanceData 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 SapDatabaseInstanceResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _sapDatabaseInstanceClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.SapVirtualInstances", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string sapDatabaseInstanceApiVersion); + _sapDatabaseInstanceRestClient = new SapDatabaseInstancesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, sapDatabaseInstanceApiVersion); +#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 SapDatabaseInstanceData 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)); + } + + /// + /// Gets the SAP Database Instance resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName}/databaseInstances/{databaseInstanceName} + /// + /// + /// Operation Id + /// SAPDatabaseInstance_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _sapDatabaseInstanceClientDiagnostics.CreateScope("SapDatabaseInstanceResource.Get"); + scope.Start(); + try + { + var response = await _sapDatabaseInstanceRestClient.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 SapDatabaseInstanceResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets the SAP Database Instance resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName}/databaseInstances/{databaseInstanceName} + /// + /// + /// Operation Id + /// SAPDatabaseInstance_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _sapDatabaseInstanceClientDiagnostics.CreateScope("SapDatabaseInstanceResource.Get"); + scope.Start(); + try + { + var response = _sapDatabaseInstanceRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new SapDatabaseInstanceResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Deletes the Database resource corresponding to a Virtual Instance for SAP solutions resource. <br><br>This will be used by service only. Delete by end user will return a Bad Request error. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName}/databaseInstances/{databaseInstanceName} + /// + /// + /// Operation Id + /// SAPDatabaseInstance_Delete + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// 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 = _sapDatabaseInstanceClientDiagnostics.CreateScope("SapDatabaseInstanceResource.Delete"); + scope.Start(); + try + { + var response = await _sapDatabaseInstanceRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + var operation = new SapVirtualInstancesArmOperation(_sapDatabaseInstanceClientDiagnostics, Pipeline, _sapDatabaseInstanceRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Deletes the Database resource corresponding to a Virtual Instance for SAP solutions resource. <br><br>This will be used by service only. Delete by end user will return a Bad Request error. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName}/databaseInstances/{databaseInstanceName} + /// + /// + /// Operation Id + /// SAPDatabaseInstance_Delete + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// 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 = _sapDatabaseInstanceClientDiagnostics.CreateScope("SapDatabaseInstanceResource.Delete"); + scope.Start(); + try + { + var response = _sapDatabaseInstanceRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + var operation = new SapVirtualInstancesArmOperation(_sapDatabaseInstanceClientDiagnostics, Pipeline, _sapDatabaseInstanceRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletionResponse(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Updates the Database resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName}/databaseInstances/{databaseInstanceName} + /// + /// + /// Operation Id + /// SAPDatabaseInstance_Update + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Database resource update request body. + /// The cancellation token to use. + /// is null. + public virtual async Task> UpdateAsync(SapDatabaseInstancePatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(patch, nameof(patch)); + + using var scope = _sapDatabaseInstanceClientDiagnostics.CreateScope("SapDatabaseInstanceResource.Update"); + scope.Start(); + try + { + var response = await _sapDatabaseInstanceRestClient.UpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, patch, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new SapDatabaseInstanceResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Updates the Database resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName}/databaseInstances/{databaseInstanceName} + /// + /// + /// Operation Id + /// SAPDatabaseInstance_Update + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Database resource update request body. + /// The cancellation token to use. + /// is null. + public virtual Response Update(SapDatabaseInstancePatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(patch, nameof(patch)); + + using var scope = _sapDatabaseInstanceClientDiagnostics.CreateScope("SapDatabaseInstanceResource.Update"); + scope.Start(); + try + { + var response = _sapDatabaseInstanceRestClient.Update(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, patch, cancellationToken); + return Response.FromValue(new SapDatabaseInstanceResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Starts the database instance of the SAP system. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName}/databaseInstances/{databaseInstanceName}/start + /// + /// + /// Operation Id + /// SAPDatabaseInstances_Start + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// 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. + /// SAP Database server instance start request body. + /// The cancellation token to use. + public virtual async Task> StartAsync(WaitUntil waitUntil, StartContent content = null, CancellationToken cancellationToken = default) + { + using var scope = _sapDatabaseInstanceClientDiagnostics.CreateScope("SapDatabaseInstanceResource.Start"); + scope.Start(); + try + { + var response = await _sapDatabaseInstanceRestClient.StartAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, content, cancellationToken).ConfigureAwait(false); + var operation = new SapVirtualInstancesArmOperation(new OperationStatusResultOperationSource(), _sapDatabaseInstanceClientDiagnostics, Pipeline, _sapDatabaseInstanceRestClient.CreateStartRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, content).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Starts the database instance of the SAP system. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName}/databaseInstances/{databaseInstanceName}/start + /// + /// + /// Operation Id + /// SAPDatabaseInstances_Start + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// 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. + /// SAP Database server instance start request body. + /// The cancellation token to use. + public virtual ArmOperation Start(WaitUntil waitUntil, StartContent content = null, CancellationToken cancellationToken = default) + { + using var scope = _sapDatabaseInstanceClientDiagnostics.CreateScope("SapDatabaseInstanceResource.Start"); + scope.Start(); + try + { + var response = _sapDatabaseInstanceRestClient.Start(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, content, cancellationToken); + var operation = new SapVirtualInstancesArmOperation(new OperationStatusResultOperationSource(), _sapDatabaseInstanceClientDiagnostics, Pipeline, _sapDatabaseInstanceRestClient.CreateStartRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, content).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Stops the database instance of the SAP system. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName}/databaseInstances/{databaseInstanceName}/stop + /// + /// + /// Operation Id + /// SAPDatabaseInstances_Stop + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// 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. + /// Stop request for the database instance of the SAP system. + /// The cancellation token to use. + public virtual async Task> StopAsync(WaitUntil waitUntil, StopContent content = null, CancellationToken cancellationToken = default) + { + using var scope = _sapDatabaseInstanceClientDiagnostics.CreateScope("SapDatabaseInstanceResource.Stop"); + scope.Start(); + try + { + var response = await _sapDatabaseInstanceRestClient.StopAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, content, cancellationToken).ConfigureAwait(false); + var operation = new SapVirtualInstancesArmOperation(new OperationStatusResultOperationSource(), _sapDatabaseInstanceClientDiagnostics, Pipeline, _sapDatabaseInstanceRestClient.CreateStopRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, content).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Stops the database instance of the SAP system. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName}/databaseInstances/{databaseInstanceName}/stop + /// + /// + /// Operation Id + /// SAPDatabaseInstances_Stop + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// 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. + /// Stop request for the database instance of the SAP system. + /// The cancellation token to use. + public virtual ArmOperation Stop(WaitUntil waitUntil, StopContent content = null, CancellationToken cancellationToken = default) + { + using var scope = _sapDatabaseInstanceClientDiagnostics.CreateScope("SapDatabaseInstanceResource.Stop"); + scope.Start(); + try + { + var response = _sapDatabaseInstanceRestClient.Stop(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, content, cancellationToken); + var operation = new SapVirtualInstancesArmOperation(new OperationStatusResultOperationSource(), _sapDatabaseInstanceClientDiagnostics, Pipeline, _sapDatabaseInstanceRestClient.CreateStopRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, content).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Add a tag to the current resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName}/databaseInstances/{databaseInstanceName} + /// + /// + /// Operation Id + /// SAPDatabaseInstance_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The key for the tag. + /// The value for the tag. + /// The cancellation token to use. + /// or is null. + public virtual async Task> AddTagAsync(string key, string value, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(key, nameof(key)); + Argument.AssertNotNull(value, nameof(value)); + + using var scope = _sapDatabaseInstanceClientDiagnostics.CreateScope("SapDatabaseInstanceResource.AddTag"); + scope.Start(); + try + { + if (await CanUseTagResourceAsync(cancellationToken: cancellationToken).ConfigureAwait(false)) + { + var originalTags = await GetTagResource().GetAsync(cancellationToken).ConfigureAwait(false); + originalTags.Value.Data.TagValues[key] = value; + await GetTagResource().CreateOrUpdateAsync(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken).ConfigureAwait(false); + var originalResponse = await _sapDatabaseInstanceRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new SapDatabaseInstanceResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; + var patch = new SapDatabaseInstancePatch(); + foreach (var tag in current.Tags) + { + patch.Tags.Add(tag); + } + patch.Tags[key] = value; + var result = await UpdateAsync(patch, cancellationToken: cancellationToken).ConfigureAwait(false); + return result; + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Add a tag to the current resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName}/databaseInstances/{databaseInstanceName} + /// + /// + /// Operation Id + /// SAPDatabaseInstance_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The key for the tag. + /// The value for the tag. + /// The cancellation token to use. + /// or is null. + public virtual Response AddTag(string key, string value, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(key, nameof(key)); + Argument.AssertNotNull(value, nameof(value)); + + using var scope = _sapDatabaseInstanceClientDiagnostics.CreateScope("SapDatabaseInstanceResource.AddTag"); + scope.Start(); + try + { + if (CanUseTagResource(cancellationToken: cancellationToken)) + { + var originalTags = GetTagResource().Get(cancellationToken); + originalTags.Value.Data.TagValues[key] = value; + GetTagResource().CreateOrUpdate(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken); + var originalResponse = _sapDatabaseInstanceRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + return Response.FromValue(new SapDatabaseInstanceResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = Get(cancellationToken: cancellationToken).Value.Data; + var patch = new SapDatabaseInstancePatch(); + foreach (var tag in current.Tags) + { + patch.Tags.Add(tag); + } + patch.Tags[key] = value; + var result = Update(patch, cancellationToken: cancellationToken); + return result; + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Replace the tags on the resource with the given set. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName}/databaseInstances/{databaseInstanceName} + /// + /// + /// Operation Id + /// SAPDatabaseInstance_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The set of tags to use as replacement. + /// The cancellation token to use. + /// is null. + public virtual async Task> SetTagsAsync(IDictionary tags, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(tags, nameof(tags)); + + using var scope = _sapDatabaseInstanceClientDiagnostics.CreateScope("SapDatabaseInstanceResource.SetTags"); + scope.Start(); + try + { + if (await CanUseTagResourceAsync(cancellationToken: cancellationToken).ConfigureAwait(false)) + { + await GetTagResource().DeleteAsync(WaitUntil.Completed, cancellationToken: cancellationToken).ConfigureAwait(false); + var originalTags = await GetTagResource().GetAsync(cancellationToken).ConfigureAwait(false); + originalTags.Value.Data.TagValues.ReplaceWith(tags); + await GetTagResource().CreateOrUpdateAsync(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken).ConfigureAwait(false); + var originalResponse = await _sapDatabaseInstanceRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new SapDatabaseInstanceResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; + var patch = new SapDatabaseInstancePatch(); + patch.Tags.ReplaceWith(tags); + var result = await UpdateAsync(patch, cancellationToken: cancellationToken).ConfigureAwait(false); + return result; + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Replace the tags on the resource with the given set. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName}/databaseInstances/{databaseInstanceName} + /// + /// + /// Operation Id + /// SAPDatabaseInstance_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The set of tags to use as replacement. + /// The cancellation token to use. + /// is null. + public virtual Response SetTags(IDictionary tags, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(tags, nameof(tags)); + + using var scope = _sapDatabaseInstanceClientDiagnostics.CreateScope("SapDatabaseInstanceResource.SetTags"); + scope.Start(); + try + { + if (CanUseTagResource(cancellationToken: cancellationToken)) + { + GetTagResource().Delete(WaitUntil.Completed, cancellationToken: cancellationToken); + var originalTags = GetTagResource().Get(cancellationToken); + originalTags.Value.Data.TagValues.ReplaceWith(tags); + GetTagResource().CreateOrUpdate(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken); + var originalResponse = _sapDatabaseInstanceRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + return Response.FromValue(new SapDatabaseInstanceResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = Get(cancellationToken: cancellationToken).Value.Data; + var patch = new SapDatabaseInstancePatch(); + patch.Tags.ReplaceWith(tags); + var result = Update(patch, cancellationToken: cancellationToken); + return result; + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Removes a tag by key from the resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName}/databaseInstances/{databaseInstanceName} + /// + /// + /// Operation Id + /// SAPDatabaseInstance_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The key for the tag. + /// The cancellation token to use. + /// is null. + public virtual async Task> RemoveTagAsync(string key, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(key, nameof(key)); + + using var scope = _sapDatabaseInstanceClientDiagnostics.CreateScope("SapDatabaseInstanceResource.RemoveTag"); + scope.Start(); + try + { + if (await CanUseTagResourceAsync(cancellationToken: cancellationToken).ConfigureAwait(false)) + { + var originalTags = await GetTagResource().GetAsync(cancellationToken).ConfigureAwait(false); + originalTags.Value.Data.TagValues.Remove(key); + await GetTagResource().CreateOrUpdateAsync(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken).ConfigureAwait(false); + var originalResponse = await _sapDatabaseInstanceRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new SapDatabaseInstanceResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; + var patch = new SapDatabaseInstancePatch(); + foreach (var tag in current.Tags) + { + patch.Tags.Add(tag); + } + patch.Tags.Remove(key); + var result = await UpdateAsync(patch, cancellationToken: cancellationToken).ConfigureAwait(false); + return result; + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Removes a tag by key from the resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName}/databaseInstances/{databaseInstanceName} + /// + /// + /// Operation Id + /// SAPDatabaseInstance_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The key for the tag. + /// The cancellation token to use. + /// is null. + public virtual Response RemoveTag(string key, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(key, nameof(key)); + + using var scope = _sapDatabaseInstanceClientDiagnostics.CreateScope("SapDatabaseInstanceResource.RemoveTag"); + scope.Start(); + try + { + if (CanUseTagResource(cancellationToken: cancellationToken)) + { + var originalTags = GetTagResource().Get(cancellationToken); + originalTags.Value.Data.TagValues.Remove(key); + GetTagResource().CreateOrUpdate(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken); + var originalResponse = _sapDatabaseInstanceRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + return Response.FromValue(new SapDatabaseInstanceResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = Get(cancellationToken: cancellationToken).Value.Data; + var patch = new SapDatabaseInstancePatch(); + foreach (var tag in current.Tags) + { + patch.Tags.Add(tag); + } + patch.Tags.Remove(key); + var result = Update(patch, cancellationToken: cancellationToken); + return result; + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/SapVirtualInstanceCollection.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/SapVirtualInstanceCollection.cs new file mode 100644 index 000000000000..5544653d0006 --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/SapVirtualInstanceCollection.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.SapVirtualInstances +{ + /// + /// 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 GetSapVirtualInstances method from an instance of . + /// + public partial class SapVirtualInstanceCollection : ArmCollection, IEnumerable, IAsyncEnumerable + { + private readonly ClientDiagnostics _sapVirtualInstanceClientDiagnostics; + private readonly SapVirtualInstancesRestOperations _sapVirtualInstanceRestClient; + + /// Initializes a new instance of the class for mocking. + protected SapVirtualInstanceCollection() + { + } + + /// 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 SapVirtualInstanceCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _sapVirtualInstanceClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.SapVirtualInstances", SapVirtualInstanceResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(SapVirtualInstanceResource.ResourceType, out string sapVirtualInstanceApiVersion); + _sapVirtualInstanceRestClient = new SapVirtualInstancesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, sapVirtualInstanceApiVersion); +#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)); + } + + /// + /// Creates a Virtual Instance for SAP solutions (VIS) resource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName} + /// + /// + /// Operation Id + /// SAPVirtualInstance_Create + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The name of the Virtual Instances for SAP solutions resource. + /// Virtual Instance for SAP solutions resource request body. + /// 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 sapVirtualInstanceName, SapVirtualInstanceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(sapVirtualInstanceName, nameof(sapVirtualInstanceName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _sapVirtualInstanceClientDiagnostics.CreateScope("SapVirtualInstanceCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = await _sapVirtualInstanceRestClient.CreateAsync(Id.SubscriptionId, Id.ResourceGroupName, sapVirtualInstanceName, data, cancellationToken).ConfigureAwait(false); + var operation = new SapVirtualInstancesArmOperation(new SapVirtualInstanceOperationSource(Client), _sapVirtualInstanceClientDiagnostics, Pipeline, _sapVirtualInstanceRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, sapVirtualInstanceName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Creates a Virtual Instance for SAP solutions (VIS) resource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName} + /// + /// + /// Operation Id + /// SAPVirtualInstance_Create + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The name of the Virtual Instances for SAP solutions resource. + /// Virtual Instance for SAP solutions resource request body. + /// 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 sapVirtualInstanceName, SapVirtualInstanceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(sapVirtualInstanceName, nameof(sapVirtualInstanceName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _sapVirtualInstanceClientDiagnostics.CreateScope("SapVirtualInstanceCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = _sapVirtualInstanceRestClient.Create(Id.SubscriptionId, Id.ResourceGroupName, sapVirtualInstanceName, data, cancellationToken); + var operation = new SapVirtualInstancesArmOperation(new SapVirtualInstanceOperationSource(Client), _sapVirtualInstanceClientDiagnostics, Pipeline, _sapVirtualInstanceRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, sapVirtualInstanceName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets a Virtual Instance for SAP solutions resource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName} + /// + /// + /// Operation Id + /// SAPVirtualInstance_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the Virtual Instances for SAP solutions 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 sapVirtualInstanceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(sapVirtualInstanceName, nameof(sapVirtualInstanceName)); + + using var scope = _sapVirtualInstanceClientDiagnostics.CreateScope("SapVirtualInstanceCollection.Get"); + scope.Start(); + try + { + var response = await _sapVirtualInstanceRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, sapVirtualInstanceName, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new SapVirtualInstanceResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets a Virtual Instance for SAP solutions resource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName} + /// + /// + /// Operation Id + /// SAPVirtualInstance_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the Virtual Instances for SAP solutions resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Get(string sapVirtualInstanceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(sapVirtualInstanceName, nameof(sapVirtualInstanceName)); + + using var scope = _sapVirtualInstanceClientDiagnostics.CreateScope("SapVirtualInstanceCollection.Get"); + scope.Start(); + try + { + var response = _sapVirtualInstanceRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, sapVirtualInstanceName, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new SapVirtualInstanceResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets all Virtual Instances for SAP solutions resources in a Resource Group. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances + /// + /// + /// Operation Id + /// SAPVirtualInstance_ListByResourceGroup + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// 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) => _sapVirtualInstanceRestClient.CreateListByResourceGroupRequest(Id.SubscriptionId, Id.ResourceGroupName); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _sapVirtualInstanceRestClient.CreateListByResourceGroupNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new SapVirtualInstanceResource(Client, SapVirtualInstanceData.DeserializeSapVirtualInstanceData(e)), _sapVirtualInstanceClientDiagnostics, Pipeline, "SapVirtualInstanceCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Gets all Virtual Instances for SAP solutions resources in a Resource Group. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances + /// + /// + /// Operation Id + /// SAPVirtualInstance_ListByResourceGroup + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// 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) => _sapVirtualInstanceRestClient.CreateListByResourceGroupRequest(Id.SubscriptionId, Id.ResourceGroupName); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _sapVirtualInstanceRestClient.CreateListByResourceGroupNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new SapVirtualInstanceResource(Client, SapVirtualInstanceData.DeserializeSapVirtualInstanceData(e)), _sapVirtualInstanceClientDiagnostics, Pipeline, "SapVirtualInstanceCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName} + /// + /// + /// Operation Id + /// SAPVirtualInstance_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the Virtual Instances for SAP solutions 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 sapVirtualInstanceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(sapVirtualInstanceName, nameof(sapVirtualInstanceName)); + + using var scope = _sapVirtualInstanceClientDiagnostics.CreateScope("SapVirtualInstanceCollection.Exists"); + scope.Start(); + try + { + var response = await _sapVirtualInstanceRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, sapVirtualInstanceName, 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.Workloads/sapVirtualInstances/{sapVirtualInstanceName} + /// + /// + /// Operation Id + /// SAPVirtualInstance_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the Virtual Instances for SAP solutions resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Exists(string sapVirtualInstanceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(sapVirtualInstanceName, nameof(sapVirtualInstanceName)); + + using var scope = _sapVirtualInstanceClientDiagnostics.CreateScope("SapVirtualInstanceCollection.Exists"); + scope.Start(); + try + { + var response = _sapVirtualInstanceRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, sapVirtualInstanceName, 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.Workloads/sapVirtualInstances/{sapVirtualInstanceName} + /// + /// + /// Operation Id + /// SAPVirtualInstance_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the Virtual Instances for SAP solutions 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 sapVirtualInstanceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(sapVirtualInstanceName, nameof(sapVirtualInstanceName)); + + using var scope = _sapVirtualInstanceClientDiagnostics.CreateScope("SapVirtualInstanceCollection.GetIfExists"); + scope.Start(); + try + { + var response = await _sapVirtualInstanceRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, sapVirtualInstanceName, cancellationToken: cancellationToken).ConfigureAwait(false); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new SapVirtualInstanceResource(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.Workloads/sapVirtualInstances/{sapVirtualInstanceName} + /// + /// + /// Operation Id + /// SAPVirtualInstance_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the Virtual Instances for SAP solutions resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual NullableResponse GetIfExists(string sapVirtualInstanceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(sapVirtualInstanceName, nameof(sapVirtualInstanceName)); + + using var scope = _sapVirtualInstanceClientDiagnostics.CreateScope("SapVirtualInstanceCollection.GetIfExists"); + scope.Start(); + try + { + var response = _sapVirtualInstanceRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, sapVirtualInstanceName, cancellationToken: cancellationToken); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new SapVirtualInstanceResource(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/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/SapVirtualInstanceData.Serialization.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/SapVirtualInstanceData.Serialization.cs new file mode 100644 index 000000000000..1b7ef37e6f1c --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/SapVirtualInstanceData.Serialization.cs @@ -0,0 +1,194 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.Models; +using Azure.ResourceManager.SapVirtualInstances.Models; + +namespace Azure.ResourceManager.SapVirtualInstances +{ + public partial class SapVirtualInstanceData : 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(SapVirtualInstanceData)} 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); + writer.WriteObjectValue(Identity, options); + } + } + + SapVirtualInstanceData 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(SapVirtualInstanceData)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeSapVirtualInstanceData(document.RootElement, options); + } + + internal static SapVirtualInstanceData DeserializeSapVirtualInstanceData(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + SapVirtualInstanceProperties properties = default; + SAPVirtualInstanceIdentity 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 = SapVirtualInstanceProperties.DeserializeSapVirtualInstanceProperties(property.Value, options); + continue; + } + if (property.NameEquals("identity"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + identity = SAPVirtualInstanceIdentity.DeserializeSAPVirtualInstanceIdentity(property.Value, options); + 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 SapVirtualInstanceData( + 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(SapVirtualInstanceData)} does not support writing '{options.Format}' format."); + } + } + + SapVirtualInstanceData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeSapVirtualInstanceData(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(SapVirtualInstanceData)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/SapVirtualInstanceData.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/SapVirtualInstanceData.cs new file mode 100644 index 000000000000..23effb8e55dd --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/SapVirtualInstanceData.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.Models; +using Azure.ResourceManager.SapVirtualInstances.Models; + +namespace Azure.ResourceManager.SapVirtualInstances +{ + /// + /// A class representing the SapVirtualInstance data model. + /// Define the Virtual Instance for SAP solutions resource. + /// + public partial class SapVirtualInstanceData : 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 SapVirtualInstanceData(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 SapVirtualInstanceData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, SapVirtualInstanceProperties properties, SAPVirtualInstanceIdentity identity, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) + { + Properties = properties; + Identity = identity; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal SapVirtualInstanceData() + { + } + + /// The resource-specific properties for this resource. + public SapVirtualInstanceProperties Properties { get; set; } + /// The managed service identities assigned to this resource. + public SAPVirtualInstanceIdentity Identity { get; set; } + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/SapVirtualInstanceResource.Serialization.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/SapVirtualInstanceResource.Serialization.cs new file mode 100644 index 000000000000..bb21a27aa9a0 --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/SapVirtualInstanceResource.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.SapVirtualInstances +{ + public partial class SapVirtualInstanceResource : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); + + SapVirtualInstanceData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options); + + SapVirtualInstanceData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options); + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/SapVirtualInstanceResource.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/SapVirtualInstanceResource.cs new file mode 100644 index 000000000000..7880898f8e6a --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/SapVirtualInstanceResource.cs @@ -0,0 +1,1086 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.Resources; +using Azure.ResourceManager.SapVirtualInstances.Models; + +namespace Azure.ResourceManager.SapVirtualInstances +{ + /// + /// A Class representing a SapVirtualInstance 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 GetSapVirtualInstanceResource method. + /// Otherwise you can get one from its parent resource using the GetSapVirtualInstance method. + /// + public partial class SapVirtualInstanceResource : ArmResource + { + /// Generate the resource identifier of a instance. + /// The subscriptionId. + /// The resourceGroupName. + /// The sapVirtualInstanceName. + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string sapVirtualInstanceName) + { + var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName}"; + return new ResourceIdentifier(resourceId); + } + + private readonly ClientDiagnostics _sapVirtualInstanceClientDiagnostics; + private readonly SapVirtualInstancesRestOperations _sapVirtualInstanceRestClient; + private readonly SapVirtualInstanceData _data; + + /// Gets the resource type for the operations. + public static readonly ResourceType ResourceType = "Microsoft.Workloads/sapVirtualInstances"; + + /// Initializes a new instance of the class for mocking. + protected SapVirtualInstanceResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal SapVirtualInstanceResource(ArmClient client, SapVirtualInstanceData 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 SapVirtualInstanceResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _sapVirtualInstanceClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.SapVirtualInstances", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string sapVirtualInstanceApiVersion); + _sapVirtualInstanceRestClient = new SapVirtualInstancesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, sapVirtualInstanceApiVersion); +#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 SapVirtualInstanceData 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)); + } + + /// Gets a collection of SapCentralServerInstanceResources in the SapVirtualInstance. + /// An object representing collection of SapCentralServerInstanceResources and their operations over a SapCentralServerInstanceResource. + public virtual SapCentralServerInstanceCollection GetSapCentralServerInstances() + { + return GetCachedClient(client => new SapCentralServerInstanceCollection(client, Id)); + } + + /// + /// Gets the SAP Central Services Instance resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName}/centralInstances/{centralInstanceName} + /// + /// + /// Operation Id + /// SAPCentralServerInstance_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Central Services Instance resource name string modeled as parameter for auto generation to work correctly. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetSapCentralServerInstanceAsync(string centralInstanceName, CancellationToken cancellationToken = default) + { + return await GetSapCentralServerInstances().GetAsync(centralInstanceName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets the SAP Central Services Instance resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName}/centralInstances/{centralInstanceName} + /// + /// + /// Operation Id + /// SAPCentralServerInstance_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Central Services Instance resource name string modeled as parameter for auto generation to work correctly. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetSapCentralServerInstance(string centralInstanceName, CancellationToken cancellationToken = default) + { + return GetSapCentralServerInstances().Get(centralInstanceName, cancellationToken); + } + + /// Gets a collection of SapDatabaseInstanceResources in the SapVirtualInstance. + /// An object representing collection of SapDatabaseInstanceResources and their operations over a SapDatabaseInstanceResource. + public virtual SapDatabaseInstanceCollection GetSapDatabaseInstances() + { + return GetCachedClient(client => new SapDatabaseInstanceCollection(client, Id)); + } + + /// + /// Gets the SAP Database Instance resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName}/databaseInstances/{databaseInstanceName} + /// + /// + /// Operation Id + /// SAPDatabaseInstance_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Database resource name string modeled as parameter for auto generation to work correctly. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetSapDatabaseInstanceAsync(string databaseInstanceName, CancellationToken cancellationToken = default) + { + return await GetSapDatabaseInstances().GetAsync(databaseInstanceName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets the SAP Database Instance resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName}/databaseInstances/{databaseInstanceName} + /// + /// + /// Operation Id + /// SAPDatabaseInstance_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Database resource name string modeled as parameter for auto generation to work correctly. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetSapDatabaseInstance(string databaseInstanceName, CancellationToken cancellationToken = default) + { + return GetSapDatabaseInstances().Get(databaseInstanceName, cancellationToken); + } + + /// Gets a collection of SapApplicationServerInstanceResources in the SapVirtualInstance. + /// An object representing collection of SapApplicationServerInstanceResources and their operations over a SapApplicationServerInstanceResource. + public virtual SapApplicationServerInstanceCollection GetSapApplicationServerInstances() + { + return GetCachedClient(client => new SapApplicationServerInstanceCollection(client, Id)); + } + + /// + /// Gets the SAP Application Server Instance corresponding to the Virtual Instance for SAP solutions resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName}/applicationInstances/{applicationInstanceName} + /// + /// + /// Operation Id + /// SAPApplicationServerInstance_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of SAP Application Server instance resource. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetSapApplicationServerInstanceAsync(string applicationInstanceName, CancellationToken cancellationToken = default) + { + return await GetSapApplicationServerInstances().GetAsync(applicationInstanceName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets the SAP Application Server Instance corresponding to the Virtual Instance for SAP solutions resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName}/applicationInstances/{applicationInstanceName} + /// + /// + /// Operation Id + /// SAPApplicationServerInstance_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of SAP Application Server instance resource. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetSapApplicationServerInstance(string applicationInstanceName, CancellationToken cancellationToken = default) + { + return GetSapApplicationServerInstances().Get(applicationInstanceName, cancellationToken); + } + + /// + /// Gets a Virtual Instance for SAP solutions resource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName} + /// + /// + /// Operation Id + /// SAPVirtualInstance_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _sapVirtualInstanceClientDiagnostics.CreateScope("SapVirtualInstanceResource.Get"); + scope.Start(); + try + { + var response = await _sapVirtualInstanceRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new SapVirtualInstanceResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets a Virtual Instance for SAP solutions resource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName} + /// + /// + /// Operation Id + /// SAPVirtualInstance_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _sapVirtualInstanceClientDiagnostics.CreateScope("SapVirtualInstanceResource.Get"); + scope.Start(); + try + { + var response = _sapVirtualInstanceRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new SapVirtualInstanceResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Deletes a Virtual Instance for SAP solutions resource and its child resources, that is the associated Central Services Instance, Application Server Instances and Database Instance. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName} + /// + /// + /// Operation Id + /// SAPVirtualInstance_Delete + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// 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 = _sapVirtualInstanceClientDiagnostics.CreateScope("SapVirtualInstanceResource.Delete"); + scope.Start(); + try + { + var response = await _sapVirtualInstanceRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + var operation = new SapVirtualInstancesArmOperation(_sapVirtualInstanceClientDiagnostics, Pipeline, _sapVirtualInstanceRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Deletes a Virtual Instance for SAP solutions resource and its child resources, that is the associated Central Services Instance, Application Server Instances and Database Instance. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName} + /// + /// + /// Operation Id + /// SAPVirtualInstance_Delete + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// 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 = _sapVirtualInstanceClientDiagnostics.CreateScope("SapVirtualInstanceResource.Delete"); + scope.Start(); + try + { + var response = _sapVirtualInstanceRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + var operation = new SapVirtualInstancesArmOperation(_sapVirtualInstanceClientDiagnostics, Pipeline, _sapVirtualInstanceRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletionResponse(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Updates a Virtual Instance for SAP solutions resource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName} + /// + /// + /// Operation Id + /// SAPVirtualInstance_Update + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// 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. + /// Request body to update a Virtual Instance for SAP solutions resource. + /// The cancellation token to use. + /// is null. + public virtual async Task> UpdateAsync(WaitUntil waitUntil, SapVirtualInstancePatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(patch, nameof(patch)); + + using var scope = _sapVirtualInstanceClientDiagnostics.CreateScope("SapVirtualInstanceResource.Update"); + scope.Start(); + try + { + var response = await _sapVirtualInstanceRestClient.UpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch, cancellationToken).ConfigureAwait(false); + var operation = new SapVirtualInstancesArmOperation(new SapVirtualInstanceOperationSource(Client), _sapVirtualInstanceClientDiagnostics, Pipeline, _sapVirtualInstanceRestClient.CreateUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Updates a Virtual Instance for SAP solutions resource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName} + /// + /// + /// Operation Id + /// SAPVirtualInstance_Update + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// 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. + /// Request body to update a Virtual Instance for SAP solutions resource. + /// The cancellation token to use. + /// is null. + public virtual ArmOperation Update(WaitUntil waitUntil, SapVirtualInstancePatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(patch, nameof(patch)); + + using var scope = _sapVirtualInstanceClientDiagnostics.CreateScope("SapVirtualInstanceResource.Update"); + scope.Start(); + try + { + var response = _sapVirtualInstanceRestClient.Update(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch, cancellationToken); + var operation = new SapVirtualInstancesArmOperation(new SapVirtualInstanceOperationSource(Client), _sapVirtualInstanceClientDiagnostics, Pipeline, _sapVirtualInstanceRestClient.CreateUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Starts the SAP application, that is the Central Services instance and Application server instances. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName}/start + /// + /// + /// Operation Id + /// SAPVirtualInstances_Start + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// 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 Virtual Instance for SAP solutions resource start request body. + /// The cancellation token to use. + public virtual async Task> StartAsync(WaitUntil waitUntil, StartContent content = null, CancellationToken cancellationToken = default) + { + using var scope = _sapVirtualInstanceClientDiagnostics.CreateScope("SapVirtualInstanceResource.Start"); + scope.Start(); + try + { + var response = await _sapVirtualInstanceRestClient.StartAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, content, cancellationToken).ConfigureAwait(false); + var operation = new SapVirtualInstancesArmOperation(new OperationStatusResultOperationSource(), _sapVirtualInstanceClientDiagnostics, Pipeline, _sapVirtualInstanceRestClient.CreateStartRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, content).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Starts the SAP application, that is the Central Services instance and Application server instances. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName}/start + /// + /// + /// Operation Id + /// SAPVirtualInstances_Start + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// 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 Virtual Instance for SAP solutions resource start request body. + /// The cancellation token to use. + public virtual ArmOperation Start(WaitUntil waitUntil, StartContent content = null, CancellationToken cancellationToken = default) + { + using var scope = _sapVirtualInstanceClientDiagnostics.CreateScope("SapVirtualInstanceResource.Start"); + scope.Start(); + try + { + var response = _sapVirtualInstanceRestClient.Start(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, content, cancellationToken); + var operation = new SapVirtualInstancesArmOperation(new OperationStatusResultOperationSource(), _sapVirtualInstanceClientDiagnostics, Pipeline, _sapVirtualInstanceRestClient.CreateStartRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, content).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Stops the SAP Application, that is the Application server instances and Central Services instance. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName}/stop + /// + /// + /// Operation Id + /// SAPVirtualInstances_Stop + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// 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 Virtual Instance for SAP solutions resource stop request body. + /// The cancellation token to use. + public virtual async Task> StopAsync(WaitUntil waitUntil, StopContent content = null, CancellationToken cancellationToken = default) + { + using var scope = _sapVirtualInstanceClientDiagnostics.CreateScope("SapVirtualInstanceResource.Stop"); + scope.Start(); + try + { + var response = await _sapVirtualInstanceRestClient.StopAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, content, cancellationToken).ConfigureAwait(false); + var operation = new SapVirtualInstancesArmOperation(new OperationStatusResultOperationSource(), _sapVirtualInstanceClientDiagnostics, Pipeline, _sapVirtualInstanceRestClient.CreateStopRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, content).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Stops the SAP Application, that is the Application server instances and Central Services instance. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName}/stop + /// + /// + /// Operation Id + /// SAPVirtualInstances_Stop + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// 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 Virtual Instance for SAP solutions resource stop request body. + /// The cancellation token to use. + public virtual ArmOperation Stop(WaitUntil waitUntil, StopContent content = null, CancellationToken cancellationToken = default) + { + using var scope = _sapVirtualInstanceClientDiagnostics.CreateScope("SapVirtualInstanceResource.Stop"); + scope.Start(); + try + { + var response = _sapVirtualInstanceRestClient.Stop(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, content, cancellationToken); + var operation = new SapVirtualInstancesArmOperation(new OperationStatusResultOperationSource(), _sapVirtualInstanceClientDiagnostics, Pipeline, _sapVirtualInstanceRestClient.CreateStopRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, content).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Add a tag to the current resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName} + /// + /// + /// Operation Id + /// SAPVirtualInstance_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The key for the tag. + /// The value for the tag. + /// The cancellation token to use. + /// or is null. + public virtual async Task> AddTagAsync(string key, string value, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(key, nameof(key)); + Argument.AssertNotNull(value, nameof(value)); + + using var scope = _sapVirtualInstanceClientDiagnostics.CreateScope("SapVirtualInstanceResource.AddTag"); + scope.Start(); + try + { + if (await CanUseTagResourceAsync(cancellationToken: cancellationToken).ConfigureAwait(false)) + { + var originalTags = await GetTagResource().GetAsync(cancellationToken).ConfigureAwait(false); + originalTags.Value.Data.TagValues[key] = value; + await GetTagResource().CreateOrUpdateAsync(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken).ConfigureAwait(false); + var originalResponse = await _sapVirtualInstanceRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new SapVirtualInstanceResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; + var patch = new SapVirtualInstancePatch(); + foreach (var tag in current.Tags) + { + patch.Tags.Add(tag); + } + patch.Tags[key] = value; + var result = await UpdateAsync(WaitUntil.Completed, patch, cancellationToken: cancellationToken).ConfigureAwait(false); + return Response.FromValue(result.Value, result.GetRawResponse()); + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Add a tag to the current resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName} + /// + /// + /// Operation Id + /// SAPVirtualInstance_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The key for the tag. + /// The value for the tag. + /// The cancellation token to use. + /// or is null. + public virtual Response AddTag(string key, string value, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(key, nameof(key)); + Argument.AssertNotNull(value, nameof(value)); + + using var scope = _sapVirtualInstanceClientDiagnostics.CreateScope("SapVirtualInstanceResource.AddTag"); + scope.Start(); + try + { + if (CanUseTagResource(cancellationToken: cancellationToken)) + { + var originalTags = GetTagResource().Get(cancellationToken); + originalTags.Value.Data.TagValues[key] = value; + GetTagResource().CreateOrUpdate(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken); + var originalResponse = _sapVirtualInstanceRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + return Response.FromValue(new SapVirtualInstanceResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = Get(cancellationToken: cancellationToken).Value.Data; + var patch = new SapVirtualInstancePatch(); + foreach (var tag in current.Tags) + { + patch.Tags.Add(tag); + } + patch.Tags[key] = value; + var result = Update(WaitUntil.Completed, patch, cancellationToken: cancellationToken); + return Response.FromValue(result.Value, result.GetRawResponse()); + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Replace the tags on the resource with the given set. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName} + /// + /// + /// Operation Id + /// SAPVirtualInstance_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The set of tags to use as replacement. + /// The cancellation token to use. + /// is null. + public virtual async Task> SetTagsAsync(IDictionary tags, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(tags, nameof(tags)); + + using var scope = _sapVirtualInstanceClientDiagnostics.CreateScope("SapVirtualInstanceResource.SetTags"); + scope.Start(); + try + { + if (await CanUseTagResourceAsync(cancellationToken: cancellationToken).ConfigureAwait(false)) + { + await GetTagResource().DeleteAsync(WaitUntil.Completed, cancellationToken: cancellationToken).ConfigureAwait(false); + var originalTags = await GetTagResource().GetAsync(cancellationToken).ConfigureAwait(false); + originalTags.Value.Data.TagValues.ReplaceWith(tags); + await GetTagResource().CreateOrUpdateAsync(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken).ConfigureAwait(false); + var originalResponse = await _sapVirtualInstanceRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new SapVirtualInstanceResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; + var patch = new SapVirtualInstancePatch(); + patch.Tags.ReplaceWith(tags); + var result = await UpdateAsync(WaitUntil.Completed, patch, cancellationToken: cancellationToken).ConfigureAwait(false); + return Response.FromValue(result.Value, result.GetRawResponse()); + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Replace the tags on the resource with the given set. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName} + /// + /// + /// Operation Id + /// SAPVirtualInstance_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The set of tags to use as replacement. + /// The cancellation token to use. + /// is null. + public virtual Response SetTags(IDictionary tags, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(tags, nameof(tags)); + + using var scope = _sapVirtualInstanceClientDiagnostics.CreateScope("SapVirtualInstanceResource.SetTags"); + scope.Start(); + try + { + if (CanUseTagResource(cancellationToken: cancellationToken)) + { + GetTagResource().Delete(WaitUntil.Completed, cancellationToken: cancellationToken); + var originalTags = GetTagResource().Get(cancellationToken); + originalTags.Value.Data.TagValues.ReplaceWith(tags); + GetTagResource().CreateOrUpdate(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken); + var originalResponse = _sapVirtualInstanceRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + return Response.FromValue(new SapVirtualInstanceResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = Get(cancellationToken: cancellationToken).Value.Data; + var patch = new SapVirtualInstancePatch(); + patch.Tags.ReplaceWith(tags); + var result = Update(WaitUntil.Completed, patch, cancellationToken: cancellationToken); + return Response.FromValue(result.Value, result.GetRawResponse()); + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Removes a tag by key from the resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName} + /// + /// + /// Operation Id + /// SAPVirtualInstance_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The key for the tag. + /// The cancellation token to use. + /// is null. + public virtual async Task> RemoveTagAsync(string key, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(key, nameof(key)); + + using var scope = _sapVirtualInstanceClientDiagnostics.CreateScope("SapVirtualInstanceResource.RemoveTag"); + scope.Start(); + try + { + if (await CanUseTagResourceAsync(cancellationToken: cancellationToken).ConfigureAwait(false)) + { + var originalTags = await GetTagResource().GetAsync(cancellationToken).ConfigureAwait(false); + originalTags.Value.Data.TagValues.Remove(key); + await GetTagResource().CreateOrUpdateAsync(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken).ConfigureAwait(false); + var originalResponse = await _sapVirtualInstanceRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new SapVirtualInstanceResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; + var patch = new SapVirtualInstancePatch(); + foreach (var tag in current.Tags) + { + patch.Tags.Add(tag); + } + patch.Tags.Remove(key); + var result = await UpdateAsync(WaitUntil.Completed, patch, cancellationToken: cancellationToken).ConfigureAwait(false); + return Response.FromValue(result.Value, result.GetRawResponse()); + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Removes a tag by key from the resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName} + /// + /// + /// Operation Id + /// SAPVirtualInstance_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The key for the tag. + /// The cancellation token to use. + /// is null. + public virtual Response RemoveTag(string key, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(key, nameof(key)); + + using var scope = _sapVirtualInstanceClientDiagnostics.CreateScope("SapVirtualInstanceResource.RemoveTag"); + scope.Start(); + try + { + if (CanUseTagResource(cancellationToken: cancellationToken)) + { + var originalTags = GetTagResource().Get(cancellationToken); + originalTags.Value.Data.TagValues.Remove(key); + GetTagResource().CreateOrUpdate(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken); + var originalResponse = _sapVirtualInstanceRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + return Response.FromValue(new SapVirtualInstanceResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = Get(cancellationToken: cancellationToken).Value.Data; + var patch = new SapVirtualInstancePatch(); + foreach (var tag in current.Tags) + { + patch.Tags.Add(tag); + } + patch.Tags.Remove(key); + var result = Update(WaitUntil.Completed, patch, cancellationToken: cancellationToken); + return Response.FromValue(result.Value, result.GetRawResponse()); + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Properties/AssemblyInfo.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Properties/AssemblyInfo.cs new file mode 100644 index 000000000000..bd4bf19bb2e8 --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Properties/AssemblyInfo.cs @@ -0,0 +1,11 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System.Runtime.CompilerServices; + +[assembly: InternalsVisibleTo("Azure.ResourceManager.SapVirtualInstances.Tests, PublicKey = 0024000004800000940000000602000000240000525341310004000001000100d15ddcb29688295338af4b7686603fe614abd555e09efba8fb88ee09e1f7b1ccaeed2e8f823fa9eef3fdd60217fc012ea67d2479751a0b8c087a4185541b851bd8b16f8d91b840e51b1cb0ba6fe647997e57429265e85ef62d565db50a69ae1647d54d7bd855e4db3d8a91510e5bcbd0edfbbecaa20a7bd9ae74593daa7b11b4")] + +// Replace Microsoft.Test with the correct resource provider namepace for your service and uncomment. +// See https://docs.microsoft.com/en-us/azure/azure-resource-manager/management/azure-services-resource-providers +// for the list of possible values. +[assembly: Azure.Core.AzureResourceProviderNamespace("SapVirtualInstances")] diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/tests/Azure.ResourceManager.SapVirtualInstances.Tests.csproj b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/tests/Azure.ResourceManager.SapVirtualInstances.Tests.csproj new file mode 100644 index 000000000000..7fdacf298294 --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/tests/Azure.ResourceManager.SapVirtualInstances.Tests.csproj @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/tests/SapVirtualInstancesManagementTestBase.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/tests/SapVirtualInstancesManagementTestBase.cs new file mode 100644 index 000000000000..9197b1df6841 --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/tests/SapVirtualInstancesManagementTestBase.cs @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using Azure; +using Azure.Core; +using Azure.Core.TestFramework; +using Azure.ResourceManager; +using Azure.ResourceManager.Resources; +using Azure.ResourceManager.TestFramework; +using NUnit.Framework; +using System.Threading.Tasks; + +namespace Azure.ResourceManager.SapVirtualInstances.Tests +{ + public class SapVirtualInstancesManagementTestBase : ManagementRecordedTestBase + { + protected ArmClient Client { get; private set; } + protected SubscriptionResource DefaultSubscription { get; private set; } + + protected SapVirtualInstancesManagementTestBase(bool isAsync, RecordedTestMode mode) + : base(isAsync, mode) + { + } + + protected SapVirtualInstancesManagementTestBase(bool isAsync) + : base(isAsync) + { + } + + [SetUp] + public async Task CreateCommonClient() + { + Client = GetArmClient(); + DefaultSubscription = await Client.GetDefaultSubscriptionAsync().ConfigureAwait(false); + } + + protected async Task CreateResourceGroup(SubscriptionResource subscription, string rgNamePrefix, AzureLocation location) + { + string rgName = Recording.GenerateAssetName(rgNamePrefix); + ResourceGroupData input = new ResourceGroupData(location); + var lro = await subscription.GetResourceGroups().CreateOrUpdateAsync(WaitUntil.Completed, rgName, input); + return lro.Value; + } + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/tests/SapVirtualInstancesManagementTestEnvironment.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/tests/SapVirtualInstancesManagementTestEnvironment.cs new file mode 100644 index 000000000000..8ffa2df9862e --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/tests/SapVirtualInstancesManagementTestEnvironment.cs @@ -0,0 +1,11 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using Azure.Core.TestFramework; + +namespace Azure.ResourceManager.SapVirtualInstances.Tests +{ + public class SapVirtualInstancesManagementTestEnvironment : TestEnvironment + { + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/tsp-location.yaml b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/tsp-location.yaml new file mode 100644 index 000000000000..4017697f8ef1 --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/tsp-location.yaml @@ -0,0 +1,4 @@ +directory: specification/workloads/Workloads.SAPVirtualInstance.Management +commit: 676334a284e5136f0a0721d6ae844bb04332f579 +repo: Azure/azure-rest-api-specs +additionalDirectories: diff --git a/sdk/workloadssapvirtualinstance/ci.mgmt.yml b/sdk/workloadssapvirtualinstance/ci.mgmt.yml new file mode 100644 index 000000000000..a90c11972d53 --- /dev/null +++ b/sdk/workloadssapvirtualinstance/ci.mgmt.yml @@ -0,0 +1,26 @@ +# NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. + +trigger: none + +pr: + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/workloadssapvirtualinstance /ci.mgmt.yml + - sdk/workloadssapvirtualinstance /Azure.ResourceManager.SapVirtualInstances / + + +extends: + template: /eng/pipelines/templates/stages/archetype-sdk-client.yml + parameters: + ServiceDirectory: workloadssapvirtualinstance + ArtifactName: packages + LimitForPullRequest: true + Artifacts: + - name: Azure.ResourceManager.SapVirtualInstances + safeName: AzureResourceManagerSapVirtualInstances